LearnPress – WordPress LMS Plugin - Version 4.1.6.9.3

Version Description

(2022-08-10) = ~ Fixed: show wrong shortcode on course, item's course.

Download this release

Release Info

Developer ThimPress
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 4.1.6.9.3
Comparing to
See all releases

Code changes from version 4.1.6.9.2 to 4.1.6.9.3

assets/js/dist/frontend/courses.js CHANGED
@@ -111,6 +111,7 @@ window.lpArchiveRequestCourse = (args, callBackSuccess) => {
111
  }
112
  }).catch(error => {
113
  listCourse.innerHTML += `<div class="lp-ajax-message error" style="display:block">${error.message || 'Error: Query lp/v1/courses/archive-course'}</div>`;
 
114
  }).finally(() => {
115
  isLoading = false; // skeleton && skeleton.remove();
116
 
111
  }
112
  }).catch(error => {
113
  listCourse.innerHTML += `<div class="lp-ajax-message error" style="display:block">${error.message || 'Error: Query lp/v1/courses/archive-course'}</div>`;
114
+ console.log(error);
115
  }).finally(() => {
116
  isLoading = false; // skeleton && skeleton.remove();
117
 
assets/js/dist/frontend/courses.min.js CHANGED
@@ -1 +1 @@
1
- !function(){lpGlobalSettings.courses_url;const e=document.location.href;let t,r,o=JSON.parse(window.localStorage.getItem("lp_filter_courses"))||{},s=!1,n=1,c=null,a=null;lpGlobalSettings.is_course_archive&&(window.location.search.length||-1!==e.search("page")||(o={}));const l=(e,t)=>{const r=new URL(e);return Object.keys(t).forEach((e=>{r.searchParams.set(e,t[e])})),r};window.lpArchiveRequestCourse=(e,o)=>{const c=lpGlobalSettings.lp_rest_url;if(!c)return;if(!t)return;const u=a&&a.querySelector("div.lp-archive-courses .lp-content-area"),p=u&&u.querySelector("ul.learn-press-courses");if(!p)return;if(s)return;s=!0,r?p.append(t):r=t.outerHTML;const d=l(c+"lp/v1/courses/archive-course",{...lpArchiveSkeleton,...e});wp.apiFetch({path:"lp/v1/courses/archive-course"+d.search,method:"GET"}).then((e=>{void 0!==e.data.content&&p&&(p.innerHTML=e.data.content||"");const t=e.data.pagination,r=document.querySelector(".learn-press-pagination");if(r&&r.remove(),void 0!==t){const e=(new DOMParser).parseFromString(t,"text/html").querySelector(".learn-press-pagination");e&&(p.after(e),i())}wp.hooks.doAction("lp-js-get-courses",e),"function"==typeof o&&o(e)})).catch((e=>{p.innerHTML+=`<div class="lp-ajax-message error" style="display:block">${e.message||"Error: Query lp/v1/courses/archive-course"}</div>`})).finally((()=>{if(s=!1,jQuery("form.search-courses button").removeClass("loading"),n)n=0;else{const e={behavior:"smooth"};a.scrollIntoView(e)}window.localStorage.setItem("lp_filter_courses",JSON.stringify(e));const t=l(document.location,e);window.history.pushState("","",t)}))};const i=()=>{const e=document.querySelectorAll(".lp-archive-courses .learn-press-pagination .page-numbers");e.length>0&&e.forEach((r=>r.addEventListener("click",(o=>{if(o.preventDefault(),o.stopPropagation(),!a)return;t&&(t.style.display="block"),a.scrollIntoView({behavior:"smooth"});let s={};if(s=JSON.parse(window.localStorage.getItem("lp_filter_courses"))||{},o.currentTarget.getAttribute("href")){const t=[...e].filter((e=>e.classList.contains("current"))),n=o.currentTarget.textContent||r.classList.contains("next")&&parseInt(t[0].textContent)+1||r.classList.contains("prev")&&parseInt(t[0].textContent)-1;s.paged=n,lpArchiveRequestCourse({...s})}}))))};function u(){a=document.querySelector(".lp-archive-courses"),t=document.querySelector(".lp-archive-course-skeleton"),c=document.querySelector(".no-first-load-ajax"),t&&(t&&!c&&lpArchiveRequestCourse(o),i(),(()=>{const e=document.querySelectorAll("form.search-courses"),r=JSON.parse(window.localStorage.getItem("lp_filter_courses"))||{};e.forEach((e=>{const o=e.querySelector('input[name="c_search"]'),s=e.querySelector('[type="submit"]');let n;o.addEventListener("keyup",(e=>{t&&(t.style.display="block"),e.preventDefault();const o=e.target.value.trim();(!o||o&&o.length>2)&&(void 0!==n&&clearTimeout(n),n=setTimeout((function(){s.classList.add("loading"),r.c_search=o,r.paged=1,lpArchiveRequestCourse({...r})}),800))})),e.addEventListener("submit",(t=>{t.preventDefault();const r=e.querySelector('input[name="c_search"]');r&&r.dispatchEvent(new Event("keyup"))}))}))})()),(()=>{const e=document.querySelectorAll('.lp-archive-courses input[name="lp-switch-layout-btn"]');e.length>0&&e.forEach((e=>e.addEventListener("change",(e=>{e.preventDefault();const t=e.target.value;if(t){const e=document.querySelector(".lp-archive-courses .learn-press-courses[data-layout]");e&&(e.dataset.layout=t),LP.Cookies.set("courses-layout",t)}}))))})(),(()=>{const e=LP.Cookies.get("courses-layout"),t=document.querySelectorAll('.lp-courses-bar .switch-layout [name="lp-switch-layout-btn"]');t.length>0&&[...t].map((t=>t.value===e&&(t.checked=!0)))})()}document.addEventListener("DOMContentLoaded",(function(e){u()}))}();
1
+ !function(){lpGlobalSettings.courses_url;const e=document.location.href;let t,r,o=JSON.parse(window.localStorage.getItem("lp_filter_courses"))||{},s=!1,n=1,c=null,a=null;lpGlobalSettings.is_course_archive&&(window.location.search.length||-1!==e.search("page")||(o={}));const l=(e,t)=>{const r=new URL(e);return Object.keys(t).forEach((e=>{r.searchParams.set(e,t[e])})),r};window.lpArchiveRequestCourse=(e,o)=>{const c=lpGlobalSettings.lp_rest_url;if(!c)return;if(!t)return;const u=a&&a.querySelector("div.lp-archive-courses .lp-content-area"),p=u&&u.querySelector("ul.learn-press-courses");if(!p)return;if(s)return;s=!0,r?p.append(t):r=t.outerHTML;const d=l(c+"lp/v1/courses/archive-course",{...lpArchiveSkeleton,...e});wp.apiFetch({path:"lp/v1/courses/archive-course"+d.search,method:"GET"}).then((e=>{void 0!==e.data.content&&p&&(p.innerHTML=e.data.content||"");const t=e.data.pagination,r=document.querySelector(".learn-press-pagination");if(r&&r.remove(),void 0!==t){const e=(new DOMParser).parseFromString(t,"text/html").querySelector(".learn-press-pagination");e&&(p.after(e),i())}wp.hooks.doAction("lp-js-get-courses",e),"function"==typeof o&&o(e)})).catch((e=>{p.innerHTML+=`<div class="lp-ajax-message error" style="display:block">${e.message||"Error: Query lp/v1/courses/archive-course"}</div>`,console.log(e)})).finally((()=>{if(s=!1,jQuery("form.search-courses button").removeClass("loading"),n)n=0;else{const e={behavior:"smooth"};a.scrollIntoView(e)}window.localStorage.setItem("lp_filter_courses",JSON.stringify(e));const t=l(document.location,e);window.history.pushState("","",t)}))};const i=()=>{const e=document.querySelectorAll(".lp-archive-courses .learn-press-pagination .page-numbers");e.length>0&&e.forEach((r=>r.addEventListener("click",(o=>{if(o.preventDefault(),o.stopPropagation(),!a)return;t&&(t.style.display="block"),a.scrollIntoView({behavior:"smooth"});let s={};if(s=JSON.parse(window.localStorage.getItem("lp_filter_courses"))||{},o.currentTarget.getAttribute("href")){const t=[...e].filter((e=>e.classList.contains("current"))),n=o.currentTarget.textContent||r.classList.contains("next")&&parseInt(t[0].textContent)+1||r.classList.contains("prev")&&parseInt(t[0].textContent)-1;s.paged=n,lpArchiveRequestCourse({...s})}}))))};function u(){a=document.querySelector(".lp-archive-courses"),t=document.querySelector(".lp-archive-course-skeleton"),c=document.querySelector(".no-first-load-ajax"),t&&(t&&!c&&lpArchiveRequestCourse(o),i(),(()=>{const e=document.querySelectorAll("form.search-courses"),r=JSON.parse(window.localStorage.getItem("lp_filter_courses"))||{};e.forEach((e=>{const o=e.querySelector('input[name="c_search"]'),s=e.querySelector('[type="submit"]');let n;o.addEventListener("keyup",(e=>{t&&(t.style.display="block"),e.preventDefault();const o=e.target.value.trim();(!o||o&&o.length>2)&&(void 0!==n&&clearTimeout(n),n=setTimeout((function(){s.classList.add("loading"),r.c_search=o,r.paged=1,lpArchiveRequestCourse({...r})}),800))})),e.addEventListener("submit",(t=>{t.preventDefault();const r=e.querySelector('input[name="c_search"]');r&&r.dispatchEvent(new Event("keyup"))}))}))})()),(()=>{const e=document.querySelectorAll('.lp-archive-courses input[name="lp-switch-layout-btn"]');e.length>0&&e.forEach((e=>e.addEventListener("change",(e=>{e.preventDefault();const t=e.target.value;if(t){const e=document.querySelector(".lp-archive-courses .learn-press-courses[data-layout]");e&&(e.dataset.layout=t),LP.Cookies.set("courses-layout",t)}}))))})(),(()=>{const e=LP.Cookies.get("courses-layout"),t=document.querySelectorAll('.lp-courses-bar .switch-layout [name="lp-switch-layout-btn"]');t.length>0&&[...t].map((t=>t.value===e&&(t.checked=!0)))})()}document.addEventListener("DOMContentLoaded",(function(e){u()}))}();
assets/js/dist/frontend/quiz.js CHANGED
@@ -2050,7 +2050,9 @@ class Quiz extends _wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Component {
2050
  componentDidMount() {
2051
  const {
2052
  settings,
2053
- setQuizData
 
 
2054
  } = this.props;
2055
  const {
2056
  question_ids,
@@ -2069,6 +2071,22 @@ class Quiz extends _wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Component {
2069
  setQuizData(settings);
2070
  }
2071
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2072
  render() {
2073
  const {
2074
  status,
@@ -2077,7 +2095,7 @@ class Quiz extends _wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Component {
2077
  const isA = -1 !== ['', 'completed', 'viewed'].indexOf(status) || !status;
2078
  const notStarted = -1 !== ['', 'viewed', undefined].indexOf(status) || !status; // Just render content if status !== undefined (meant all data loaded)
2079
 
2080
- return undefined !== status && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", null, !isReviewing && 'completed' === status && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Result, null), !isReviewing && notStarted && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Meta, null), !isReviewing && notStarted && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Content, null), 'started' === status && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Status, null), (-1 !== ['completed', 'started'].indexOf(status) || isReviewing) && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Questions, null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Buttons, null), isA && !isReviewing && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Attempts, null)));
2081
  }
2082
 
2083
  }
2050
  componentDidMount() {
2051
  const {
2052
  settings,
2053
+ setQuizData,
2054
+ status,
2055
+ isReviewing
2056
  } = this.props;
2057
  const {
2058
  question_ids,
2071
  setQuizData(settings);
2072
  }
2073
 
2074
+ componentDidUpdate(prevProps, prevState) {
2075
+ const {
2076
+ status,
2077
+ isReviewing
2078
+ } = this.props;
2079
+ const notStarted = -1 !== ['', 'viewed', undefined].indexOf(status) || !status;
2080
+
2081
+ if (isReviewing || !notStarted) {
2082
+ const elQuiz = document.querySelector('.quiz-content');
2083
+
2084
+ if (elQuiz) {
2085
+ elQuiz.style.display = 'none';
2086
+ }
2087
+ }
2088
+ }
2089
+
2090
  render() {
2091
  const {
2092
  status,
2095
  const isA = -1 !== ['', 'completed', 'viewed'].indexOf(status) || !status;
2096
  const notStarted = -1 !== ['', 'viewed', undefined].indexOf(status) || !status; // Just render content if status !== undefined (meant all data loaded)
2097
 
2098
+ return undefined !== status && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", null, !isReviewing && 'completed' === status && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Result, null), !isReviewing && notStarted && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Meta, null), 'started' === status && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Status, null), (-1 !== ['completed', 'started'].indexOf(status) || isReviewing) && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Questions, null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Buttons, null), isA && !isReviewing && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_components__WEBPACK_IMPORTED_MODULE_4__.Attempts, null)));
2099
  }
2100
 
2101
  }
assets/js/dist/frontend/quiz.min.js CHANGED
@@ -1 +1 @@
1
- !function(){var e={605:function(){LP.Hook.addAction("lp-compatible-builder",(()=>{LP.Hook.removeAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend&&[...document.querySelectorAll("#popup-content")][0].addEventListener("scroll",(()=>{Waypoint.refreshAll(),window.dispatchEvent(new Event("resize"))})),"undefined"!=typeof vc_js&&"undefined"!=typeof VcWaypoint&&[...document.querySelectorAll("#popup-content")][0].addEventListener("scroll",(()=>{VcWaypoint.refreshAll()}))})),LP.Hook.addAction("lp-quiz-compatible-builder",(()=>(LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0))),LP.Hook.addAction("lp-question-compatible-builder",(()=>(LP.Hook.removeAction("lp-question-compatible-builder"),LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0)))},184:function(e,t){var s;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var i=typeof s;if("string"===i||"number"===i)e.push(s);else if(Array.isArray(s)){if(s.length){var a=r.apply(null,s);a&&e.push(a)}}else if("object"===i)if(s.toString===Object.prototype.toString)for(var o in s)n.call(s,o)&&s[o]&&e.push(o);else e.push(s.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(s=function(){return r}.apply(t,[]))||(e.exports=s)}()},965:function(e){"use strict";function t(e,s){var n;if(Array.isArray(s))for(n=0;n<s.length;n++)t(e,s[n]);else for(n in s)e[n]=(e[n]||[]).concat(s[n])}e.exports=function(e){var s,n={};return t(n,e),(s=function(e){return function(t){return function(s){var r,i,a=n[s.type],o=t(s);if(a)for(r=0;r<a.length;r++)(i=a[r](s,e))&&e.dispatch(i);return o}}}).effects=n,s}}},t={};function s(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,s),i.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";s.r(n),s.d(n,{default:function(){return st},init:function(){return nt}});var e={};s.r(e),s.d(e,{__requestBeforeStartQuiz:function(){return fe},__requestCheckAnswerSuccess:function(){return be},__requestShowHintSuccess:function(){return ye},__requestStartQuizSuccess:function(){return _e},__requestSubmitQuiz:function(){return we},__requestSubmitQuizSuccess:function(){return ve},checkAnswer:function(){return ke},markQuestionRendered:function(){return Pe},sendKey:function(){return Ne},setCurrentPage:function(){return ge},setCurrentQuestion:function(){return he},setQuizData:function(){return me},setQuizMode:function(){return Qe},showHint:function(){return ze},startQuiz:function(){return qe},submitQuiz:function(){return Se},updateUserQuestionAnswers:function(){return Ee}});var t={};s.r(t),s.d(t,{getCurrentQuestion:function(){return Ue},getData:function(){return Me},getDefaultRestArgs:function(){return De},getItemStatus:function(){return Te},getProp:function(){return Re},getQuestion:function(){return $e},getQuestionAnswered:function(){return He},getQuestionMark:function(){return Fe},getQuestionOptions:function(){return Ae},getQuestions:function(){return xe},getQuestionsSelectedAnswers:function(){return Je},getQuizAnswered:function(){return Le},getQuizAttempts:function(){return Oe},getUserMark:function(){return Ge},isCheckedAnswer:function(){return je},isCorrect:function(){return Be}});var r=window.wp.element;function i(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var a=window.wp.compose,o=window.wp.data,u=()=>{const e=(0,o.select)("learnpress/quiz").getData("content");return(0,r.createElement)("div",{className:"quiz-content",dangerouslySetInnerHTML:{__html:e}})},l=window.wp.i18n,c=e=>{let t;const s=86400;if(e>s)t=(e-e%s)/s,e%=s;else if(e==s)return"24:00";const n=new Date(1e3*e).toUTCString().match(/\d{2}:\d{2}:\d{2}/)[0].split(":");return t&&(n[0]=parseInt(n[0])+24*t),n.join(":")};const{Hook:d}=LP;var p=()=>{const e=e=>(0,o.select)("learnpress/quiz").getData(e),t=d.applyFilters("quiz-meta-fields",{duration:{title:(0,l.__)("Duration:","learnpress"),name:"duration",content:c(e("duration"))||"--"},passingGrade:{title:(0,l.__)("Passing grade:","learnpress"),name:"passing-grade",content:e("passingGrade")||"--"},questionsCount:{title:(0,l.__)("Questions:","learnpress"),name:"questions-count",content:e("questionIds")?e("questionIds").length:0}});return t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("ul",{className:"quiz-intro"},Object.values(t).map(((e,t)=>{const s=e.name||t;return(0,r.createElement)("li",{key:`quiz-intro-field-${t}`,className:`quiz-intro-item quiz-intro-item--${s}`},(0,r.createElement)("div",{className:"quiz-intro-item__title",dangerouslySetInnerHTML:{__html:e.title}}),(0,r.createElement)("span",{className:"quiz-intro-item__content",dangerouslySetInnerHTML:{__html:e.content}}))}))))};class m extends r.Component{constructor(){super(...arguments),i(this,"startQuiz",(e=>{e&&e.preventDefault();const t=document.querySelector(".lp-button.start");t&&t.setAttribute("disabled","disabled"),t.classList.add("loading");const{startQuiz:s,status:n}=this.props;if("completed"===n){const{confirm:e,isOpen:s}=(0,o.select)("learnpress/modal");if("no"===e((0,l.__)("Are you sure you want to retake quiz?","learnpress"),this.startQuiz))return void(!s()&&t&&t.removeAttribute("disabled"))}s()})),i(this,"nav",(e=>t=>{let{questionNav:s,currentPage:n,numPages:r,setCurrentPage:i}=this.props;"prev"===e?n>1?n-=1:n="infinity"===s?r:1:n<r?n+=1:n="infinity"===s?1:r,i(n)})),i(this,"moveTo",(e=>t=>{t.preventDefault();const{numPages:s,setCurrentPage:n}=this.props;e<1||e>s||n(e)})),i(this,"isLast",(()=>{const{currentPage:e,numPages:t}=this.props;return e===t})),i(this,"isFirst",(()=>{const{currentPage:e}=this.props;return 1===e})),i(this,"submit",(()=>{const{submitQuiz:e}=this.props,{confirm:t}=(0,o.select)("learnpress/modal");"no"!==t((0,l.__)("Are you sure to submit quiz?","learnpress"),this.submit)&&e()})),i(this,"setQuizMode",(e=>()=>{const{setQuizMode:t}=this.props;t(e)})),i(this,"isReviewing",(()=>{const{isReviewing:e}=this.props;return e}))}pageNumbers(e){const{numPages:t,currentPage:s}=this.props;if(t<2)return"";(e={numPages:t,currentPage:s,midSize:1,endSize:1,prevNext:!0,...e||{}}).endSize<1&&(e.endSize=1),e.midSize<0&&(e.midSize=1);const n=[...Array(t).keys()];let i=!1;return(0,r.createElement)("div",{className:"nav-links"},e.prevNext&&!this.isFirst()&&(0,r.createElement)("button",{className:"page-numbers prev","data-type":"question-navx",onClick:this.nav("prev")},(0,l.__)("Prev","learnpress")),n.map((t=>(t+=1)===e.currentPage?(i=!0,(0,r.createElement)("span",{key:`page-number-${t}`,className:"page-numbers current"},t)):t<=e.endSize||e.currentPage&&t>=e.currentPage-e.midSize&&t<=e.currentPage+e.midSize||t>e.numPages-e.endSize?(i=!0,(0,r.createElement)("button",{key:`page-number-${t}`,className:"page-numbers",onClick:this.moveTo(t)},t)):i?(i=!1,(0,r.createElement)("span",{key:`page-number-${t}`,className:"page-numbers dots"},"…")):"")),e.prevNext&&!this.isLast()&&(0,r.createElement)("button",{className:"page-numbers next","data-type":"question-navx",onClick:this.nav("next")},(0,l.__)("Next","learnpress")))}render(){const{status:e,questionNav:t,isReviewing:s,showReview:n,numPages:i,question:a,questionsPerPage:o,canRetry:u,retakeNumber:c,requiredPassword:d,allowRetake:p}=this.props,m=["quiz-buttons"];("started"===e||s)&&m.push("align-center"),"questionNav"===t&&m.push("infinity"),this.isFirst()&&m.push("is-first"),this.isLast()&&m.push("is-last");const h=document.querySelector("#popup-sidebar"),g=document.querySelector("#learn-press-quiz-app");let f="";f="started"===e||s?{marginLeft:h&&h.offsetWidth/2,width:g&&g.offsetWidth}:null;let _=" fixed";return"no"==lpQuizSettings.navigationPosition&&(_=" nav-center"),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:m.join(" ")},(0,r.createElement)("div",{className:"button-left"+("started"===e||s?_:""),style:f},("completed"===e&&u||-1!==["","viewed"].indexOf(e))&&!s&&!d&&(0,r.createElement)("button",{className:"lp-button start",onClick:this.startQuiz},"completed"===e?`${(0,l.__)("Retake","learnpress")} ${p?"":" "+(c?` (${c})`:"")} `:" "+(0,l.__)("Start","learnpress")),("started"===e||s)&&i>1&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"questions-pagination"},this.pageNumbers()))),(0,r.createElement)("div",{className:"button-right"},"started"===e&&(0,r.createElement)(r.Fragment,null,("infinity"===t||this.isLast())&&!s&&(0,r.createElement)("button",{className:"lp-button submit-quiz",onClick:this.submit},(0,l.__)("Finish Quiz","learnpress"))),s&&n&&(0,r.createElement)("button",{className:"lp-button back-quiz",onClick:this.setQuizMode("")},(0,l.__)("Result","learnpress")),"completed"===e&&n&&!s&&(0,r.createElement)("button",{className:"lp-button review-quiz",onClick:this.setQuizMode("reviewing")},(0,l.__)("Review","learnpress")))),this.props.message&&!0!==this.props.success&&(0,r.createElement)("div",{className:"learn-press-message error"},this.props.message))}}const h=(0,a.compose)((0,o.withSelect)((e=>{const{getData:t}=e("learnpress/quiz");return{status:t("status"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),questionsPerPage:t("questionsPerPage")}})))((e=>{const{showCheck:t,checkedQuestions:s,hintedQuestions:n,question:i,status:a,type:o,Button:u}=e;if("started"!==a)return!1;const l=(0,r.createElement)(u,{question:i});switch(o){case"hint":return n?!!i.hasHint&&-1===n.indexOf(i.id)&&l:l;case"check":return!!t&&(s?-1===s.indexOf(i.id)&&l:l)}}));var g=(0,a.compose)([(0,o.withSelect)((e=>{const{getData:t,getCurrentQuestion:s}=e("learnpress/quiz"),n={id:t("id"),status:t("status"),questionIds:t("questionIds"),questionNav:t("questionNav"),isReviewing:t("reviewQuestions")&&"reviewing"===t("mode"),showReview:t("reviewQuestions"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),numPages:t("numPages"),pages:t("pages"),currentPage:t("currentPage"),questionsPerPage:t("questionsPerPage"),pageNumbers:t("pageNumbers"),keyPressed:t("keyPressed"),canRetry:t("retakeCount")>0&&t("retaken")<t("retakeCount"),retakeNumber:t("retakeCount")>0&&t("retaken")<t("retakeCount")?t("retakeCount")-t("retaken"):null,message:t("messageResponse")||!1,success:void 0===t("successResponse")||t("successResponse"),requiredPassword:t("requiredPassword"),allowRetake:t("allowRetake")};if(1===n.questionsPerPage&&(n.question=s("object")),1===lpQuizSettings.checkNorequizenroll){const e=window.localStorage.getItem("quiz_off_retaken_"+lpQuizSettings.id);t("retakeCount")>e?(n.retakeNumber=t("retakeCount")-e,n.canRetry=!0):n.canRetry=!1}return n.allowRetake&&(n.canRetry=!0),n})),(0,o.withDispatch)(((e,t)=>{let{id:s}=t;const{startQuiz:n,setCurrentQuestion:r,submitQuiz:i,setQuizMode:a,showHint:o,checkAnswer:u,setCurrentPage:l}=e("learnpress/quiz");return{startQuiz:n,setCurrentQuestion:r,setQuizMode:a,setCurrentPage:l,submitQuiz(e){i(e)},showHint(e){o(e)},checkAnswer(e){u(e)}}}))])(m);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},f.apply(this,arguments)}class _ extends r.Component{constructor(){super(...arguments),i(this,"showHint",(()=>{const{showHint:e,question:t}=this.props;e(t.id,!t.showHint)}))}render(){const{question:e}=this.props;return e.hint?(0,r.createElement)("button",{className:"btn-show-hint",onClick:this.showHint},(0,r.createElement)("span",null,(0,l.__)("Hint","learnpress"))):""}}var q=(0,a.compose)((0,o.withDispatch)(((e,t)=>{let{id:s}=t;const{showHint:n}=e("learnpress/quiz");return{showHint(e,t){n(e,t)}}})))(_),w=s(184),v=s.n(w);class S extends r.Component{constructor(){super(...arguments),i(this,"checkAnswer",(()=>{const{checkAnswer:e,question:t,answered:s}=this.props;s&&(e(t.id),this.setState({loading:!0}))})),this.state={loading:!1}}render(){const{answered:e}=this.props;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("button",{className:v()("lp-button","instant-check",{loading:this.state.loading,disable:!e}),onClick:this.checkAnswer},(0,r.createElement)("span",{className:"instant-check__icon"}),(0,l.__)("Check answer","learnpress"),!e&&(0,r.createElement)("div",{className:"instant-check__info",dangerouslySetInnerHTML:{__html:(0,l.__)("You need to answer the question before check answer.","learnpress")}})))}}var E=(0,a.compose)((0,o.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getQuestionAnswered:n}=e("learnpress/quiz");return{answered:n(s)}})),(0,o.withDispatch)(((e,t)=>{let{id:s}=t;const{checkAnswer:n}=e("learnpress/quiz");return{checkAnswer(e){n(e)}}})))(S),y=function(e){const{question:t}=e,s={"instant-check":()=>(0,r.createElement)(h,{type:"check",Button:E,question:t}),hint:()=>(0,r.createElement)(h,{type:"hint",Button:q,question:t})};return(0,r.createElement)(r.Fragment,null,LP.config.questionFooterButtons().map((e=>(0,r.createElement)(r.Fragment,{key:`button-${e}`},s[e]&&s[e]()))))};const z=window.jQuery,{uniqueId:b,isArray:k,isNumber:P,bind:Q}=lodash;class N extends r.Component{constructor(){super(...arguments),i(this,"setRef",(e=>{this.$wrap=z(e)})),i(this,"parseOptions",(e=>(e&&(e=k(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=k(e)?e:JSON.parse(e)),e||[]))),i(this,"getWrapperClass",(()=>{const{question:e,answered:t}=this.props,s=["question","question-"+e.type],n=this.parseOptions(e.options);return n.length&&void 0!==n[0].isTrue&&s.push("question-answered"),s})),i(this,"getEditLink",(()=>{const{question:e,editPermalink:t}=this.props;return t?t.replace(/post=(.*[0-9])/,`post=${e.id}`):""})),i(this,"editPermalink",(e=>(0,l.sprintf)('<a href="%s">%s</a>',e,(0,l.__)("Edit","learnpress")))),this.state={time:null,showHint:!1},this.$wrap=null}componentDidMount(e){const{question:t,isCurrent:s,markQuestionRendered:n}=this.props;return s&&n(t.id),this.state.time||this.setState({time:new Date}),LP.Hook.doAction("lp-question-compatible-builder"),"undefined"!=typeof MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub]),e}render(){const{question:e,isShow:t,isShowIndex:s,isShowHint:n,status:i}=this.props,a=LP.questionTypes.default,o=this.getEditLink();o&&jQuery("#wp-admin-bar-edit-lp_question").find(".ab-item").attr("href",o);const u={index:()=>s?(0,r.createElement)("span",{className:"question-index"},s,"."):"",title:()=>(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:e.title}}),hint:()=>(0,r.createElement)(q,{question:e}),"edit-permalink":()=>o&&(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:this.editPermalink(o)},className:"edit-link"})},c={title:()=>(0,r.createElement)("h4",{className:"question-title"},LP.config.questionTitleParts().map((e=>(0,r.createElement)(r.Fragment,{key:`title-part-${e}`},u[e]&&u[e]())))),content:()=>(0,r.createElement)("div",{className:"question-content",dangerouslySetInnerHTML:{__html:e.content}}),"answer-options":()=>this.$wrap&&(0,r.createElement)(a,f({},this.props,{$wrap:this.$wrap})),explanation:()=>e.explanation&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"question-explanation-content"},(0,r.createElement)("strong",{className:"explanation-title"},(0,l.__)("Explanation","learnpress"),":"),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:e.explanation}}))),hint:()=>e.hint&&!e.explanation&&e.showHint&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"question-hint-content"},(0,r.createElement)("strong",{className:"hint-title"},(0,l.__)("Hint","learnpress"),":"),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:e.hint}}))),buttons:()=>"started"===i&&(0,r.createElement)(y,{question:e})},d=LP.config.questionBlocks();return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:this.getWrapperClass().join(" "),style:{display:t?"":"none"},"data-id":e.id,ref:this.setRef},d.map((e=>(0,r.createElement)(r.Fragment,{key:`block-${e}`},c[e]?c[e]():"")))))}}var I=(0,a.compose)([(0,o.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getData:n,getQuestionAnswered:r,getQuestionMark:i}=e("learnpress/quiz");return{status:n("status"),questions:n("question"),answered:r(s),questionsRendered:n("questionsRendered"),editPermalink:n("editPermalink"),numPages:n("numPages"),mark:i(s)||""}})),(0,o.withDispatch)((e=>{const{updateUserQuestionAnswers:t,markQuestionRendered:s}=e("learnpress/quiz");return{markQuestionRendered:s,updateUserQuestionAnswers:t}}))])(N);class C extends r.Component{constructor(e){super(...arguments),i(this,"startQuiz",(e=>{e.preventDefault();const{startQuiz:t}=this.props;t()})),i(this,"isInVisibleRange",((e,t)=>{const{currentPage:s,questionsPerPage:n}=this.props;return s===Math.ceil(t/n)})),i(this,"nav",(e=>{const{sendKey:t}=this.props;switch(e.keyCode){case 37:return t("left");case 38:case 40:return;case 39:return t("right");default:e.keyCode>=49&&e.keyCode<=57&&t(e.keyCode-48)}})),this.needToTop=!1,this.state={isReviewing:null,currentPage:0,self:this}}static getDerivedStateFromProps(e,t){const s=["isReviewing","currentPage"],n={};for(let r=0;r<s.length;r++)e[s[r]]!==t[s[r]]&&(n[s[r]]=e[s[r]]);return Object.values(n).length?(t.self.needToTop=!0,n):null}componentDidUpdate(){this.needToTop&&(jQuery("#popup-content").animate({scrollTop:0}).find(".content-item-scrollable:last").animate({scrollTop:0}),this.needToTop=!1)}render(){const{status:e,currentQuestion:t,questions:s,questionsRendered:n,isReviewing:i,questionsPerPage:a}=this.props;let o=!0;return"completed"!==e||i||(o=!1),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{tabIndex:100,onKeyUp:this.nav},(0,r.createElement)("div",{className:"quiz-questions",style:{display:o?"":"none"}},s.map(((e,s)=>{const i=!a&&t===e.id,o=n&&-1!==n.indexOf(e.id),u=this.isInVisibleRange(e.id,s+1);return o||!o||u?(0,r.createElement)(I,{key:`loop-question-${e.id}`,isCurrent:i,isShow:u,isShowIndex:!!a&&s+1,questionsPerPage:a,question:e}):""})))))}}var A=(0,a.compose)((0,o.withSelect)(((e,t,s)=>{const{getData:n,getQuestions:r}=e("learnpress/quiz");return{status:n("status"),currentQuestion:n("currentQuestion"),questions:r(),questionsRendered:n("questionsRendered"),isReviewing:"reviewing"===n("mode"),numPages:n("numPages"),currentPage:n("currentPage"),questionsPerPage:n("questionsPerPage")||1}})),(0,o.withDispatch)((e=>{const{startQuiz:t,sendKey:s}=e("learnpress/quiz");return{startQuiz:t,sendKey:s}})))(C),T=()=>{const e=(0,o.select)("learnpress/quiz").getData("attempts")||[],t=e&&!!e.length;return!!t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"quiz-attempts"},(0,r.createElement)("h4",{className:"attempts-heading"},(0,l.__)("Last Attempted","learnpress")),t&&(0,r.createElement)("table",null,(0,r.createElement)("thead",null,(0,r.createElement)("tr",null,(0,r.createElement)("th",{className:"quiz-attempts__questions"},(0,l.__)("Questions","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__spend"},(0,l.__)("Time spent","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__marks"},(0,l.__)("Marks","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__grade"},(0,l.__)("Passing grade","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__result"},(0,l.__)("Result","learnpress")))),(0,r.createElement)("tbody",null,e.map(((e,t)=>(0,r.createElement)("tr",{key:`attempt-${t}`},(0,r.createElement)("td",{className:"quiz-attempts__questions"},`${e.questionCorrect} / ${e.questionCount}`),(0,r.createElement)("td",{className:"quiz-attempts__spend"},e.timeSpend||"--"),(0,r.createElement)("td",{className:"quiz-attempts__marks"},`${e.userMark} / ${e.mark}`),(0,r.createElement)("td",{className:"quiz-attempts__grade"},e.passingGrade||"-"),(0,r.createElement)("td",{className:"quiz-attempts__result"},`${parseFloat(e.result).toFixed(2)}%`," ",(0,r.createElement)("span",null,e.graduationText)))))))))},R=()=>{const{getData:e}=(0,o.select)("learnpress/quiz"),{submitQuiz:t}=(0,o.dispatch)("learnpress/quiz"),s=e("totalTime"),n=e("duration"),[i,a]=(0,r.useState)(s);let[u,l]=(0,r.useState)(0);const c=s>0;return(0,r.useEffect)((()=>{const e=setInterval((()=>{if(c){let s=i;s-=1,s>0?(a(s),u++,l(n-s)):(clearInterval(e),t())}else u++,l(u),a(u)}),1e3);return()=>clearInterval(e)}),[i,u]),(0,r.createElement)("div",{className:"countdown"},(0,r.createElement)("i",{className:"fas fa-stopwatch"}),(0,r.createElement)("span",null,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";const t=[];let n;return s<3600?(t.push((i-i%60)/60),t.push(i%60)):s&&(t.push((i-i%3600)/3600),n=i%3600,t.push((n-n%60)/60),t.push(n%60)),t.map((e=>e<10?`0${e}`:e)).join(e)}()),(0,r.createElement)("input",{type:"hidden",name:"lp-quiz-time-spend",value:u}))},O=window.wp.url;const L=jQuery;let x=null;const M={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init(){return!!this.instance||(this.elLPOverlay=L(".lp-overlay"),!!this.elLPOverlay.length&&(x=this.elLPOverlay,this.elMainContent=x.find(".main-content"),this.elTitle=x.find(".modal-title"),this.elBtnYes=x.find(".btn-yes"),this.elBtnNo=x.find(".btn-no"),this.elFooter=x.find(".lp-modal-footer"),L(document).on("click",".close, .btn-no",(function(){x.hide()})),L(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof M.callBackYes&&M.callBackYes()})),this.instance=this,!0))},setElCalledModal(e){this.elCalledModal=e},setContentModal(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal(e){this.elTitle.html(e)}};var D=M,H={elBtnFinishCourse:null,elBtnCompleteItem:null,init(){D.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest("form");D.elLPOverlay.show(),D.setTitleModal(t.dataset.title),D.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),D.callBackYes=()=>{t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((e=>e.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest("form");D.elLPOverlay.show(),D.setTitleModal(t.dataset.title),D.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),D.callBackYes=()=>{t.submit()}})))))}};const{debounce:F}=lodash;var U=()=>{const[e,t]=(0,r.useState)(0),[s,n]=(0,r.useState)(!1),i=(0,o.useSelect)((e=>e("learnpress/quiz").getData("id")),[]),a=(0,o.useSelect)((e=>e("learnpress/quiz").getData("results")),[]),u=(0,o.useSelect)((e=>e("learnpress/quiz").getData("passingGrade")),[]),c=(0,o.useSelect)((e=>e("learnpress/quiz").getData("submitting")),[]);(0,r.useEffect)((()=>{p();let e="";if(e=a.graduation?a.graduation:a.result>=f.replace(/[^0-9\.]+/g,"")?"passed":"failed",e){const t=document.querySelector(`.course-curriculum .course-item.course-item-${i}`);t&&(t.classList.remove("failed","passed"),t.classList.add("has-status","status-completed",e))}const t=[...document.querySelectorAll("#popup-header .items-progress")][0],s=document.querySelector(".curriculum-sections");if(t&&s){const e=t.dataset.totalItems,s=t.querySelector(".items-completed"),n=t.querySelector(".learn-press-progress__active");if(s){const t=document.querySelectorAll("#popup-sidebar .course-curriculum .course-item.status-completed");s.textContent=parseInt(t.length);const r=100-100*parseInt(t.length)/parseInt(e);n.style.left="-"+r+"%"}}}),[a]),(0,r.useEffect)((()=>{void 0!==c&&d()}),[c]);const d=()=>{const e=document.querySelectorAll(".popup-header__inner");e.length>0&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&(async e=>{const t=await wp.apiFetch({path:(0,O.addQueryArgs)("lp/v1/lazy-load/items-progress",{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}),method:"GET"}),{data:s}=t;e.innerHTML+=s,H.init()})(e[0])},p=()=>{t(0),n(!1),jQuery.easing._customEasing=function(e,t,s,n,r){return n*Math.sqrt(1-(t=t/r-1)*t)+s},F((()=>{const e=jQuery("<span />").css({width:1,height:1}).appendTo(document.body);e.css("left",0).animate({left:a.result},{duration:1500,step:(e,s)=>{t(e)},done:()=>{n(!0),e.remove(),jQuery("#quizResultGrade").css({transform:"scale(1.3)",transition:"all 0.25s"}),F((()=>{jQuery("#quizResultGrade").css({transform:"scale(1)"})}),500)()},easing:"_customEasing"})}),a.result>0?1e3:10)()};let m=e;Number.isInteger(e)||(m=parseFloat(e).toFixed(2));const h=190*Math.PI,g={strokeDasharray:`${h} ${h}`,strokeDashoffset:h-m/100*h},f=a.passingGrade||u;let _="";_=a.graduation?a.graduation:m>=f.replace(/[^0-9\.]+/g,"")?"passed":"failed";let q="";q=a.graduationText?a.graduationText:"passed"===_?(0,l.__)("Passed","learnpress"):(0,l.__)("Failed","learnpress");const w=["quiz-result",_];return(0,r.createElement)("div",{className:w.join(" ")},(0,r.createElement)("h3",{className:"result-heading"},(0,l.__)("Your Result","learnpress")),(0,r.createElement)("div",{id:"quizResultGrade",className:"result-grade"},(0,r.createElement)("svg",{className:"circle-progress-bar",width:200,height:200},(0,r.createElement)("circle",{className:"circle-progress-bar__circle",stroke:"",strokeWidth:10,style:g,fill:"transparent",r:95,cx:100,cy:100})),(0,r.createElement)("span",{className:"result-achieved"},`${m}%`),(0,r.createElement)("span",{className:"result-require"},f||"-")),s&&(0,r.createElement)("p",{className:"result-message"},q),(0,r.createElement)("ul",{className:"result-statistic"},(0,r.createElement)("li",{className:"result-statistic-field result-time-spend"},(0,r.createElement)("span",null,(0,l.__)("Time spent","learnpress")),(0,r.createElement)("p",null,a.timeSpend)),(0,r.createElement)("li",{className:"result-statistic-field result-point"},(0,r.createElement)("span",null,(0,l.__)("Points","learnpress")),(0,r.createElement)("p",null,a.userMark," / ",a.mark)),(0,r.createElement)("li",{className:"result-statistic-field result-questions"},(0,r.createElement)("span",null,(0,l.__)("Questions","learnpress")),(0,r.createElement)("p",null,a.questionCount)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-correct"},(0,r.createElement)("span",null,(0,l.__)("Correct","learnpress")),(0,r.createElement)("p",null,a.questionCorrect)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-wrong"},(0,r.createElement)("span",null,(0,l.__)("Wrong","learnpress")),(0,r.createElement)("p",null,a.questionWrong)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-skipped"},(0,r.createElement)("span",null,(0,l.__)("Skipped","learnpress")),(0,r.createElement)("p",null,a.questionEmpty))))};const $=jQuery,{debounce:j}=lodash;var B=()=>{const{submitQuiz:e}=(0,o.dispatch)("learnpress/quiz");(0,r.useEffect)((()=>{const e=$("#popup-content");if(!e.length)return;const t=e.find(".content-item-scrollable:eq(1)"),s=e.find(".content-item-wrap"),n=e.find(".quiz-status"),r=n.offset().top-92;let i=!1,a="-"+s.css("margin-left");$(window).on("resize.refresh-quiz-stauts-bar",j((function(){a="-"+s.css("margin-left"),n.css({"margin-left":a,"margin-right":a})}),100)).trigger("resize.refresh-quiz-stauts-bar"),t.on("scroll",(()=>{if(t.scrollTop()>=r){if(i)return;i=!0}else{if(!i)return;i=!1}i?e.addClass("fixed-quiz-status"):e.removeClass("fixed-quiz-status")}))}),[]);const t=()=>{const{confirm:s}=(0,o.select)("learnpress/modal");"no"!==s((0,l.__)("Are you sure to submit quiz?","learnpress"),t)&&e()},{getData:s,getUserMark:n}=(0,o.select)("learnpress/quiz"),i=s("currentPage"),a=s("questionsPerPage"),u=s("questionIds").length,c=s("submitting"),d=(s("duration"),n()),p=["quiz-status"],m=(i-1)*a+1;let h=m+a-1,g="";return h=Math.min(h,u),c&&p.push("submitting"),g=h<u?a>1?(0,l.sprintf)((0,l.__)("Question <span>%d to %d of %d</span>","learnpress"),m,h,u):(0,l.sprintf)((0,l.__)("Question <span>%d of %d</span>","learnpress"),m,u):(0,l.sprintf)((0,l.__)("Question <span>%d to %d</span>","learnpress"),m,h),(0,r.createElement)("div",{className:p.join(" ")},(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"questions-index",dangerouslySetInnerHTML:{__html:g}}),(0,r.createElement)("div",{className:"current-point"},(0,l.sprintf)((0,l.__)("Earned Point: %s","learnpress"),d)),(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"submit-quiz"},(0,r.createElement)("button",{className:"lp-button",id:"button-submit-quiz",onClick:t},c?(0,l.__)("Submitting...","learnpress"):(0,l.__)("Finish Quiz","learnpress"))),(0,r.createElement)(R,null))))};const{omit:J,flow:G,isArray:K,chunk:W}=lodash,{camelCaseDashObjectKeys:Z}=LP,{get:Y,set:V}=LP.localStorage,X={},ee=(e,t)=>{const{answered:s,id:n}=e,r={...s[t.questionId]||{},answered:t.answers,temp:!0};return n&&localStorage.setItem(`LP_Quiz_${n}_Answered`,JSON.stringify({...e.answered,[t.questionId]:r})),{...e,answered:{...e.answered,[t.questionId]:r}}},te=(e,t)=>{const{questionsRendered:s}=e;return K(s)?(s.push(t.questionId),{...e,questionsRendered:[...s]}):{...e,questionsRendered:[t.questionId]}},se=(e,t)=>(t.currentPage&&V(`Q${e.id}.currentPage`,t.currentPage),{...e,...t}),ne=(e,t)=>{const s=e.questions.map((e=>e.id==t.questionId?{...e,showHint:t.showHint}:e));return{...e,questions:[...s]}},re=(e,t)=>{const s=e.questions.map((e=>{if(e.id!==t.questionId)return e;const s={explanation:t.explanation};return t.options&&(s.options=t.options),{...e,...s}})),n={...e.answered,[t.questionId]:t.result};let r=localStorage.getItem(`LP_Quiz_${e.id}_Answered`);return r&&(r={...JSON.parse(r),...n},localStorage.setItem(`LP_Quiz_${e.id}_Answered`,JSON.stringify(r))),{...e,questions:[...s],answered:n,checkedQuestions:[...e.checkedQuestions,t.questionId]}},ie=(e,t)=>{localStorage.removeItem(`LP_Quiz_${e.id}_Answered`);const s=e.questions.map((s=>{const n={};return e.reviewQuestions&&(t.results.questions[s.id].explanation&&(n.explanation=t.results.questions[s.id].explanation),t.results.questions[s.id].options&&(n.options=t.results.questions[s.id].options)),{...s,...n}}));return se(e,{submitting:!1,currentPage:1,...t.results,questions:[...s]})},ae=(e,t)=>{const s=void 0!==t.results.success&&t.results.success,n=t.results.message||!1;return se(e,{checkedQuestions:[],hintedQuestions:[],mode:"",currentPage:1,...t.results.results,successResponse:s,messageResponse:n})},oe=G(o.combineReducers,(e=>(t,s)=>e(t,s)),(e=>(t,s)=>e(t,s)),(e=>(t,s)=>e(t,s)))({a(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{a:1}},b(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{b:2}}});var ue=(0,o.combineReducers)({blocks:oe,userQuiz:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_QUIZ_DATA":1>t.data.questionsPerPage&&(t.data.questionsPerPage=1);const s=W(e.questionIds||t.data.questionIds,t.data.questionsPerPage);return t.data.numPages=s.length,t.data.pages=s,{...e,...t.data,currentPage:Y(`Q${t.data.id}.currentPage`)||t.data.currentPage};case"SUBMIT_QUIZ":return{...e,submitting:!0};case"START_QUIZ":case"START_QUIZ_SUCCESS":return ae(e,t);case"SET_CURRENT_QUESTION":return V(`Q${e.id}.currentQuestion`,t.questionId),{...e,currentQuestion:t.questionId};case"SET_CURRENT_PAGE":return V(`Q${e.id}.currentPage`,t.currentPage),{...e,currentPage:t.currentPage};case"SUBMIT_QUIZ_SUCCESS":return ie(e,t);case"UPDATE_USER_QUESTION_ANSWERS":return"started"===e.status?ee(e,t):e;case"MARK_QUESTION_RENDERED":return te(e,t);case"SET_QUIZ_MODE":return"reviewing"==t.mode?se(e,{mode:t.mode}):{...e,mode:t.mode};case"SET_QUESTION_HINT":return ne(e,t);case"CHECK_ANSWER":return re(e,t);case"SEND_KEY":return{...e,keyPressed:t.keyPressed}}return e}}),le=window.LP.dataControls;function ce(){const e=[].slice.call(arguments,2),t=(0,o.dispatch)(arguments[0]),s=arguments[1];t[s](...e)}const{camelCaseDashObjectKeys:de,Hook:pe}=LP;function me(e,t){return{type:"SET_QUIZ_DATA",data:de(t="string"==typeof e?{[e]:t}:e)}}function he(e){return{type:"SET_CURRENT_QUESTION",questionId:e}}function ge(e){return{type:"SET_CURRENT_PAGE",currentPage:e}}function fe(e,t,s){return{type:"BEFORE_START_QUIZ"}}function _e(e,t,s,n){return pe.doAction("quiz-started",e,t,s,n),{type:"START_QUIZ_SUCCESS",quizId:t,courseId:s,userId:n,results:e}}const qe=function*(){const{itemId:e,courseId:t}=(0,o.select)("learnpress/quiz").getDefaultRestArgs();if(!0!==pe.applyFilters("before-start-quiz",!0,e,t))return;let s=yield(0,le.apiFetch)({path:"lp/v1/users/start-quiz",method:"POST",data:{item_id:e,course_id:t}});const n=document.querySelector(".lp-button.start");if("error"!==s.status){if(s=pe.applyFilters("request-start-quiz-response",s,e,t),1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id;window.localStorage.removeItem(e);const t={endTime:Date.now()+1e3*s.results.duration,status:s.results.status};window.localStorage.setItem(e,JSON.stringify(t));const n="quiz_off_retaken_"+lpQuizSettings.id;let r=window.localStorage.getItem(n);null===r?r=0:r++,window.localStorage.setItem(n,r)}yield ce("learnpress/quiz","__requestStartQuizSuccess",de(s),e,t)}else{const e=document.querySelector(".quiz-buttons"),t=`<div class="learn-press-message error">${s.message}</div>`;e.insertAdjacentHTML("afterend",t),n.classList.remove("loading")}};function we(){return{type:"SUBMIT_QUIZ"}}function ve(e,t,s){return pe.doAction("quiz-submitted",e,t,s),{type:"SUBMIT_QUIZ_SUCCESS",results:e}}function*Se(){const{getDefaultRestArgs:e,getQuestionsSelectedAnswers:t}=(0,o.select)("learnpress/quiz"),{itemId:s,courseId:n}=e();if(!0!==pe.applyFilters("before-submit-quiz",!0))return;const r=t();if(1===lpQuizSettings.checkNorequizenroll){const e=`LP_Quiz_${s}_Answered`,t=localStorage.getItem(e);if(null!==t){const e=JSON.parse(t);for(const[t,s]of Object.entries(e))r[t]=s.answered}}let i=0;const a=document.querySelector("input[name=lp-quiz-time-spend]");a&&(i=a.value);let u=yield(0,le.apiFetch)({path:"lp/v1/users/submit-quiz",method:"POST",data:{item_id:s,course_id:n,answered:r,time_spend:i}});if(u=pe.applyFilters("request-submit-quiz-response",u,s,n),"success"===u.status){if(1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id,t=window.localStorage.getItem(e);if(null!==t){const s=JSON.parse(t);s.status=u.results.status,s.results=u.results.results,window.localStorage.setItem(e,JSON.stringify(s)),window.localStorage.removeItem("LP_Quiz_"+lpQuizSettings.id+"_Answered")}}yield ce("learnpress/quiz","__requestSubmitQuizSuccess",de(u.results),s,n)}}function Ee(e,t,s){return{type:"UPDATE_USER_QUESTION_ANSWERS",questionId:e,answers:t}}function ye(e,t){return{type:"SET_QUESTION_HINT",questionId:e,showHint:t}}function*ze(e,t){yield ce("learnpress/quiz","__requestShowHintSuccess",e,t)}function be(e,t){return{type:"CHECK_ANSWER",questionId:e,...t}}function*ke(e){const{getDefaultRestArgs:t,getQuestionAnswered:s}=(0,o.select)("learnpress/quiz"),{itemId:n,courseId:r}=t(),i=yield(0,le.apiFetch)({path:"lp/v1/users/check-answer",method:"POST",data:{item_id:n,course_id:r,question_id:e,answered:s(e)||""}});if("success"===i.status){if(1===lpQuizSettings.checkNorequizenroll){const t="quiz_off_"+lpQuizSettings.id,s=window.localStorage.getItem(t);if(null!==s){const n=JSON.parse(s),r=i.options;void 0===n.checked_questions?(n.checked_questions=[],n.checked_questions.push(e)):-1===n.checked_questions.indexOf(e)&&n.checked_questions.push(e),void 0===n.question_options?(n.question_options={},n.question_options[e]=r):void 0===n.question_options[e]&&(n.question_options[e]=r),window.localStorage.setItem(t,JSON.stringify(n))}}yield ce("learnpress/quiz","__requestCheckAnswerSuccess",e,de(i))}}function Pe(e){return{type:"MARK_QUESTION_RENDERED",questionId:e}}function Qe(e){return{type:"SET_QUIZ_MODE",mode:e}}function Ne(e){return setTimeout((()=>{ce("learnpress/quiz","sendKey","")}),300),{type:"SEND_KEY",keyPressed:e}}const{get:Ie,isArray:Ce}=lodash,Ae=function(e,t){console.time("parseOptions");let s=$e(e,t).options;return s=Ce(s)?s:JSON.parse(CryptoJS.AES.decrypt(s.data,s.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),s=Ce(s)?s:JSON.parse(s),console.timeEnd("parseOptions"),s};function Te(e,t){const s=(0,o.select)("course-learner/user").getItemById(t);return s?Ie(s,"userSettings.status"):""}function Re(e,t,s){return e[t]||s}function Oe(e,t){const s=(0,o.select)("course-learner/user").getItemById(t);return s?Ie(s,"userSettings.attempts"):[]}function Le(e,t){const s=(0,o.select)("course-learner/user").getItemById(t);return s?Ie(s,"userSettings.answered",{}):{}}function xe(e){const{userQuiz:t}=e,s=Ie(t,"questions");return s?Object.values(s):[]}function Me(e,t){const{userQuiz:s}=e;return t?Ie(s,t):s}function De(e){const{userQuiz:t}=e;return{itemId:t.id,courseId:t.courseId}}function He(e,t){const{userQuiz:s}=e;return Ie(s,`answered.${t}.answered`)||void 0}function Fe(e,t){const{userQuiz:s}=e;return Ie(s,`answered.${t}.mark`)||void 0}function Ue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=Ie(e,"userQuiz.questionsPerPage")||1;if(s>1)return!1;const n=Ie(e,"userQuiz.currentPage")||1;return Ie(e,"object"===t?`userQuiz.questions[${n-1}]`:`userQuiz.questionIds[${n-1}]`)}const $e=function(e,t){const{userQuiz:s}=e;return(0,o.select)("learnpress/quiz").getQuestions().find((e=>e.id==t))};function je(e,t){return-1!==(Ie(e,"userQuiz.checkedQuestions")||[]).indexOf(t)}function Be(e,t){}const Je=function(e,t){const s=Ie(e,"userQuiz.answered"),n={};for(const e in s)if(s.hasOwnProperty(e)&&(s[e].temp||s[e].blanks)){if(t&&e===t)return s[e].answered;n[e]=s[e].answered}return n};function Ge(e){const t=e.userQuiz||{},{answered:s,negativeMarking:n,questions:r,checkedQuestions:i}=t;let a=0;for(let e in s){if(!s.hasOwnProperty(e))continue;e=parseInt(e);const t=s[e],o=t.questionMark?t.questionMark:function(){const t=r.find((t=>t.id===e));return t?t.point:0}();i.indexOf(e),t.temp||(n?t.answered&&(a=t.correct?a+t.mark:a-o):t.answered&&t.correct&&(a+=t.mark))}return a>0?a:0}var Ke=s(965),We=s.n(Ke);const Ze={ENROLL_COURSE_X:(e,t)=>{}};const{controls:Ye}=LP.dataControls;!function(e){let t=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:e.getState,dispatch:function(){return t(...arguments)}};t=We()(Ze)(s)(e.dispatch),e.dispatch=t}((0,o.registerStore)("learnpress/quiz",{reducer:ue,selectors:t,actions:e,controls:{...Ye}}));const{chunk:Ve}=lodash;class Xe extends r.Component{constructor(e){super(...arguments),i(this,"startQuiz",(e=>{this.props.startQuiz()})),this.state={currentPage:1,numPages:0,pages:[]}}componentDidMount(){const{settings:e,setQuizData:t}=this.props,{question_ids:s,questions_per_page:n}=e,r=Ve(s,n);e.currentPage=1,e.numPages=r.length,e.pages=r;const i=!!e.id&&localStorage.getItem(`LP_Quiz_${e.id}_Answered`);i&&(e.answered=JSON.parse(i)),t(e)}render(){const{status:e,isReviewing:t}=this.props,s=-1!==["","completed","viewed"].indexOf(e)||!e,n=-1!==["","viewed",void 0].indexOf(e)||!e;return void 0!==e&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",null,!t&&"completed"===e&&(0,r.createElement)(U,null),!t&&n&&(0,r.createElement)(p,null),!t&&n&&(0,r.createElement)(u,null),"started"===e&&(0,r.createElement)(B,null),(-1!==["completed","started"].indexOf(e)||t)&&(0,r.createElement)(A,null),(0,r.createElement)(g,null),s&&!t&&(0,r.createElement)(T,null)))}}var et=(0,a.compose)([(0,o.withSelect)((e=>{const{getQuestions:t,getData:s}=e("learnpress/quiz");return{questions:t(),status:s("status"),store:s(),answered:s("answered"),isReviewing:"reviewing"===s("mode"),questionIds:s("questionIds"),checkCount:s("instantCheck"),questionsPerPage:s("questionsPerPage")||1}})),(0,o.withDispatch)((e=>{const{setQuizData:t,startQuiz:s}=e("learnpress/quiz");return{setQuizData:t,startQuiz:s}}))])(Xe);s(605);const{modal:{default:tt}}=LP;var st=et;const nt=(e,t)=>{if(1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id,s=window.localStorage.getItem(e);if(null!==s){const e=JSON.parse(s);if(t.status=e.status,"started"===e.status){const s=Date.now();t.total_time=Math.floor((e.endTime-s)/1e3)}else"completed"===e.status&&(t.results=e.results,t.answered=e.results.answered,t.questions=e.results.questions);if(void 0!==e.checked_questions&&(t.checked_questions=e.checked_questions),void 0!==e.question_options)for(const s in t.questions){let n=t.questions[s];void 0!==e.question_options[n.id]&&(n.options=e.question_options[n.id]),t.questions[s]=n}}}wp.element.render((0,r.createElement)(tt,null,(0,r.createElement)(et,{settings:t})),[...document.querySelectorAll(e)][0]),LP.Hook.doAction("lp-quiz-compatible-builder")}}(),(window.LP=window.LP||{}).quiz=n}();
1
+ !function(){var e={605:function(){LP.Hook.addAction("lp-compatible-builder",(()=>{LP.Hook.removeAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend&&[...document.querySelectorAll("#popup-content")][0].addEventListener("scroll",(()=>{Waypoint.refreshAll(),window.dispatchEvent(new Event("resize"))})),"undefined"!=typeof vc_js&&"undefined"!=typeof VcWaypoint&&[...document.querySelectorAll("#popup-content")][0].addEventListener("scroll",(()=>{VcWaypoint.refreshAll()}))})),LP.Hook.addAction("lp-quiz-compatible-builder",(()=>(LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0))),LP.Hook.addAction("lp-question-compatible-builder",(()=>(LP.Hook.removeAction("lp-question-compatible-builder"),LP.Hook.removeAction("lp-quiz-compatible-builder"),LP.Hook.doAction("lp-compatible-builder"),"undefined"!=typeof elementorFrontend?window.elementorFrontend.init():"undefined"!=typeof vc_js?("undefined"!=typeof vc_round_charts&&vc_round_charts(),"undefined"!=typeof vc_pieChart&&vc_pieChart(),"undefined"!=typeof vc_line_charts&&vc_line_charts(),window.vc_js()):void 0)))},184:function(e,t){var s;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var i=typeof s;if("string"===i||"number"===i)e.push(s);else if(Array.isArray(s)){if(s.length){var o=r.apply(null,s);o&&e.push(o)}}else if("object"===i)if(s.toString===Object.prototype.toString)for(var a in s)n.call(s,a)&&s[a]&&e.push(a);else e.push(s.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(s=function(){return r}.apply(t,[]))||(e.exports=s)}()},965:function(e){"use strict";function t(e,s){var n;if(Array.isArray(s))for(n=0;n<s.length;n++)t(e,s[n]);else for(n in s)e[n]=(e[n]||[]).concat(s[n])}e.exports=function(e){var s,n={};return t(n,e),(s=function(e){return function(t){return function(s){var r,i,o=n[s.type],a=t(s);if(o)for(r=0;r<o.length;r++)(i=o[r](s,e))&&e.dispatch(i);return a}}}).effects=n,s}}},t={};function s(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,s),i.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";s.r(n),s.d(n,{default:function(){return tt},init:function(){return st}});var e={};s.r(e),s.d(e,{__requestBeforeStartQuiz:function(){return ge},__requestCheckAnswerSuccess:function(){return ze},__requestShowHintSuccess:function(){return ye},__requestStartQuizSuccess:function(){return fe},__requestSubmitQuiz:function(){return qe},__requestSubmitQuizSuccess:function(){return we},checkAnswer:function(){return be},markQuestionRendered:function(){return ke},sendKey:function(){return Qe},setCurrentPage:function(){return he},setCurrentQuestion:function(){return me},setQuizData:function(){return pe},setQuizMode:function(){return Pe},showHint:function(){return Ee},startQuiz:function(){return _e},submitQuiz:function(){return ve},updateUserQuestionAnswers:function(){return Se}});var t={};s.r(t),s.d(t,{getCurrentQuestion:function(){return Fe},getData:function(){return xe},getDefaultRestArgs:function(){return De},getItemStatus:function(){return Ae},getProp:function(){return Te},getQuestion:function(){return Ue},getQuestionAnswered:function(){return Me},getQuestionMark:function(){return He},getQuestionOptions:function(){return Ce},getQuestions:function(){return Le},getQuestionsSelectedAnswers:function(){return Be},getQuizAnswered:function(){return Oe},getQuizAttempts:function(){return Re},getUserMark:function(){return Je},isCheckedAnswer:function(){return $e},isCorrect:function(){return je}});var r=window.wp.element;function i(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var o=window.wp.compose,a=window.wp.data,u=window.wp.i18n,l=e=>{let t;const s=86400;if(e>s)t=(e-e%s)/s,e%=s;else if(e==s)return"24:00";const n=new Date(1e3*e).toUTCString().match(/\d{2}:\d{2}:\d{2}/)[0].split(":");return t&&(n[0]=parseInt(n[0])+24*t),n.join(":")};const{Hook:c}=LP;var d=()=>{const e=e=>(0,a.select)("learnpress/quiz").getData(e),t=c.applyFilters("quiz-meta-fields",{duration:{title:(0,u.__)("Duration:","learnpress"),name:"duration",content:l(e("duration"))||"--"},passingGrade:{title:(0,u.__)("Passing grade:","learnpress"),name:"passing-grade",content:e("passingGrade")||"--"},questionsCount:{title:(0,u.__)("Questions:","learnpress"),name:"questions-count",content:e("questionIds")?e("questionIds").length:0}});return t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("ul",{className:"quiz-intro"},Object.values(t).map(((e,t)=>{const s=e.name||t;return(0,r.createElement)("li",{key:`quiz-intro-field-${t}`,className:`quiz-intro-item quiz-intro-item--${s}`},(0,r.createElement)("div",{className:"quiz-intro-item__title",dangerouslySetInnerHTML:{__html:e.title}}),(0,r.createElement)("span",{className:"quiz-intro-item__content",dangerouslySetInnerHTML:{__html:e.content}}))}))))};class p extends r.Component{constructor(){super(...arguments),i(this,"startQuiz",(e=>{e&&e.preventDefault();const t=document.querySelector(".lp-button.start");t&&t.setAttribute("disabled","disabled"),t.classList.add("loading");const{startQuiz:s,status:n}=this.props;if("completed"===n){const{confirm:e,isOpen:s}=(0,a.select)("learnpress/modal");if("no"===e((0,u.__)("Are you sure you want to retake quiz?","learnpress"),this.startQuiz))return void(!s()&&t&&t.removeAttribute("disabled"))}s()})),i(this,"nav",(e=>t=>{let{questionNav:s,currentPage:n,numPages:r,setCurrentPage:i}=this.props;"prev"===e?n>1?n-=1:n="infinity"===s?r:1:n<r?n+=1:n="infinity"===s?1:r,i(n)})),i(this,"moveTo",(e=>t=>{t.preventDefault();const{numPages:s,setCurrentPage:n}=this.props;e<1||e>s||n(e)})),i(this,"isLast",(()=>{const{currentPage:e,numPages:t}=this.props;return e===t})),i(this,"isFirst",(()=>{const{currentPage:e}=this.props;return 1===e})),i(this,"submit",(()=>{const{submitQuiz:e}=this.props,{confirm:t}=(0,a.select)("learnpress/modal");"no"!==t((0,u.__)("Are you sure to submit quiz?","learnpress"),this.submit)&&e()})),i(this,"setQuizMode",(e=>()=>{const{setQuizMode:t}=this.props;t(e)})),i(this,"isReviewing",(()=>{const{isReviewing:e}=this.props;return e}))}pageNumbers(e){const{numPages:t,currentPage:s}=this.props;if(t<2)return"";(e={numPages:t,currentPage:s,midSize:1,endSize:1,prevNext:!0,...e||{}}).endSize<1&&(e.endSize=1),e.midSize<0&&(e.midSize=1);const n=[...Array(t).keys()];let i=!1;return(0,r.createElement)("div",{className:"nav-links"},e.prevNext&&!this.isFirst()&&(0,r.createElement)("button",{className:"page-numbers prev","data-type":"question-navx",onClick:this.nav("prev")},(0,u.__)("Prev","learnpress")),n.map((t=>(t+=1)===e.currentPage?(i=!0,(0,r.createElement)("span",{key:`page-number-${t}`,className:"page-numbers current"},t)):t<=e.endSize||e.currentPage&&t>=e.currentPage-e.midSize&&t<=e.currentPage+e.midSize||t>e.numPages-e.endSize?(i=!0,(0,r.createElement)("button",{key:`page-number-${t}`,className:"page-numbers",onClick:this.moveTo(t)},t)):i?(i=!1,(0,r.createElement)("span",{key:`page-number-${t}`,className:"page-numbers dots"},"…")):"")),e.prevNext&&!this.isLast()&&(0,r.createElement)("button",{className:"page-numbers next","data-type":"question-navx",onClick:this.nav("next")},(0,u.__)("Next","learnpress")))}render(){const{status:e,questionNav:t,isReviewing:s,showReview:n,numPages:i,question:o,questionsPerPage:a,canRetry:l,retakeNumber:c,requiredPassword:d,allowRetake:p}=this.props,m=["quiz-buttons"];("started"===e||s)&&m.push("align-center"),"questionNav"===t&&m.push("infinity"),this.isFirst()&&m.push("is-first"),this.isLast()&&m.push("is-last");const h=document.querySelector("#popup-sidebar"),g=document.querySelector("#learn-press-quiz-app");let f="";f="started"===e||s?{marginLeft:h&&h.offsetWidth/2,width:g&&g.offsetWidth}:null;let _=" fixed";return"no"==lpQuizSettings.navigationPosition&&(_=" nav-center"),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:m.join(" ")},(0,r.createElement)("div",{className:"button-left"+("started"===e||s?_:""),style:f},("completed"===e&&l||-1!==["","viewed"].indexOf(e))&&!s&&!d&&(0,r.createElement)("button",{className:"lp-button start",onClick:this.startQuiz},"completed"===e?`${(0,u.__)("Retake","learnpress")} ${p?"":" "+(c?` (${c})`:"")} `:" "+(0,u.__)("Start","learnpress")),("started"===e||s)&&i>1&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"questions-pagination"},this.pageNumbers()))),(0,r.createElement)("div",{className:"button-right"},"started"===e&&(0,r.createElement)(r.Fragment,null,("infinity"===t||this.isLast())&&!s&&(0,r.createElement)("button",{className:"lp-button submit-quiz",onClick:this.submit},(0,u.__)("Finish Quiz","learnpress"))),s&&n&&(0,r.createElement)("button",{className:"lp-button back-quiz",onClick:this.setQuizMode("")},(0,u.__)("Result","learnpress")),"completed"===e&&n&&!s&&(0,r.createElement)("button",{className:"lp-button review-quiz",onClick:this.setQuizMode("reviewing")},(0,u.__)("Review","learnpress")))),this.props.message&&!0!==this.props.success&&(0,r.createElement)("div",{className:"learn-press-message error"},this.props.message))}}const m=(0,o.compose)((0,a.withSelect)((e=>{const{getData:t}=e("learnpress/quiz");return{status:t("status"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),questionsPerPage:t("questionsPerPage")}})))((e=>{const{showCheck:t,checkedQuestions:s,hintedQuestions:n,question:i,status:o,type:a,Button:u}=e;if("started"!==o)return!1;const l=(0,r.createElement)(u,{question:i});switch(a){case"hint":return n?!!i.hasHint&&-1===n.indexOf(i.id)&&l:l;case"check":return!!t&&(s?-1===s.indexOf(i.id)&&l:l)}}));var h=(0,o.compose)([(0,a.withSelect)((e=>{const{getData:t,getCurrentQuestion:s}=e("learnpress/quiz"),n={id:t("id"),status:t("status"),questionIds:t("questionIds"),questionNav:t("questionNav"),isReviewing:t("reviewQuestions")&&"reviewing"===t("mode"),showReview:t("reviewQuestions"),showCheck:t("instantCheck"),checkedQuestions:t("checkedQuestions"),hintedQuestions:t("hintedQuestions"),numPages:t("numPages"),pages:t("pages"),currentPage:t("currentPage"),questionsPerPage:t("questionsPerPage"),pageNumbers:t("pageNumbers"),keyPressed:t("keyPressed"),canRetry:t("retakeCount")>0&&t("retaken")<t("retakeCount"),retakeNumber:t("retakeCount")>0&&t("retaken")<t("retakeCount")?t("retakeCount")-t("retaken"):null,message:t("messageResponse")||!1,success:void 0===t("successResponse")||t("successResponse"),requiredPassword:t("requiredPassword"),allowRetake:t("allowRetake")};if(1===n.questionsPerPage&&(n.question=s("object")),1===lpQuizSettings.checkNorequizenroll){const e=window.localStorage.getItem("quiz_off_retaken_"+lpQuizSettings.id);t("retakeCount")>e?(n.retakeNumber=t("retakeCount")-e,n.canRetry=!0):n.canRetry=!1}return n.allowRetake&&(n.canRetry=!0),n})),(0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{startQuiz:n,setCurrentQuestion:r,submitQuiz:i,setQuizMode:o,showHint:a,checkAnswer:u,setCurrentPage:l}=e("learnpress/quiz");return{startQuiz:n,setCurrentQuestion:r,setQuizMode:o,setCurrentPage:l,submitQuiz(e){i(e)},showHint(e){a(e)},checkAnswer(e){u(e)}}}))])(p);function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},g.apply(this,arguments)}class f extends r.Component{constructor(){super(...arguments),i(this,"showHint",(()=>{const{showHint:e,question:t}=this.props;e(t.id,!t.showHint)}))}render(){const{question:e}=this.props;return e.hint?(0,r.createElement)("button",{className:"btn-show-hint",onClick:this.showHint},(0,r.createElement)("span",null,(0,u.__)("Hint","learnpress"))):""}}var _=(0,o.compose)((0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{showHint:n}=e("learnpress/quiz");return{showHint(e,t){n(e,t)}}})))(f),q=s(184),w=s.n(q);class v extends r.Component{constructor(){super(...arguments),i(this,"checkAnswer",(()=>{const{checkAnswer:e,question:t,answered:s}=this.props;s&&(e(t.id),this.setState({loading:!0}))})),this.state={loading:!1}}render(){const{answered:e}=this.props;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("button",{className:w()("lp-button","instant-check",{loading:this.state.loading,disable:!e}),onClick:this.checkAnswer},(0,r.createElement)("span",{className:"instant-check__icon"}),(0,u.__)("Check answer","learnpress"),!e&&(0,r.createElement)("div",{className:"instant-check__info",dangerouslySetInnerHTML:{__html:(0,u.__)("You need to answer the question before check answer.","learnpress")}})))}}var S=(0,o.compose)((0,a.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getQuestionAnswered:n}=e("learnpress/quiz");return{answered:n(s)}})),(0,a.withDispatch)(((e,t)=>{let{id:s}=t;const{checkAnswer:n}=e("learnpress/quiz");return{checkAnswer(e){n(e)}}})))(v),y=function(e){const{question:t}=e,s={"instant-check":()=>(0,r.createElement)(m,{type:"check",Button:S,question:t}),hint:()=>(0,r.createElement)(m,{type:"hint",Button:_,question:t})};return(0,r.createElement)(r.Fragment,null,LP.config.questionFooterButtons().map((e=>(0,r.createElement)(r.Fragment,{key:`button-${e}`},s[e]&&s[e]()))))};const E=window.jQuery,{uniqueId:z,isArray:b,isNumber:k,bind:P}=lodash;class Q extends r.Component{constructor(){super(...arguments),i(this,"setRef",(e=>{this.$wrap=E(e)})),i(this,"parseOptions",(e=>(e&&(e=b(e)?e:JSON.parse(CryptoJS.AES.decrypt(e.data,e.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),e=b(e)?e:JSON.parse(e)),e||[]))),i(this,"getWrapperClass",(()=>{const{question:e,answered:t}=this.props,s=["question","question-"+e.type],n=this.parseOptions(e.options);return n.length&&void 0!==n[0].isTrue&&s.push("question-answered"),s})),i(this,"getEditLink",(()=>{const{question:e,editPermalink:t}=this.props;return t?t.replace(/post=(.*[0-9])/,`post=${e.id}`):""})),i(this,"editPermalink",(e=>(0,u.sprintf)('<a href="%s">%s</a>',e,(0,u.__)("Edit","learnpress")))),this.state={time:null,showHint:!1},this.$wrap=null}componentDidMount(e){const{question:t,isCurrent:s,markQuestionRendered:n}=this.props;return s&&n(t.id),this.state.time||this.setState({time:new Date}),LP.Hook.doAction("lp-question-compatible-builder"),"undefined"!=typeof MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub]),e}render(){const{question:e,isShow:t,isShowIndex:s,isShowHint:n,status:i}=this.props,o=LP.questionTypes.default,a=this.getEditLink();a&&jQuery("#wp-admin-bar-edit-lp_question").find(".ab-item").attr("href",a);const l={index:()=>s?(0,r.createElement)("span",{className:"question-index"},s,"."):"",title:()=>(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:e.title}}),hint:()=>(0,r.createElement)(_,{question:e}),"edit-permalink":()=>a&&(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:this.editPermalink(a)},className:"edit-link"})},c={title:()=>(0,r.createElement)("h4",{className:"question-title"},LP.config.questionTitleParts().map((e=>(0,r.createElement)(r.Fragment,{key:`title-part-${e}`},l[e]&&l[e]())))),content:()=>(0,r.createElement)("div",{className:"question-content",dangerouslySetInnerHTML:{__html:e.content}}),"answer-options":()=>this.$wrap&&(0,r.createElement)(o,g({},this.props,{$wrap:this.$wrap})),explanation:()=>e.explanation&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"question-explanation-content"},(0,r.createElement)("strong",{className:"explanation-title"},(0,u.__)("Explanation","learnpress"),":"),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:e.explanation}}))),hint:()=>e.hint&&!e.explanation&&e.showHint&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"question-hint-content"},(0,r.createElement)("strong",{className:"hint-title"},(0,u.__)("Hint","learnpress"),":"),(0,r.createElement)("div",{dangerouslySetInnerHTML:{__html:e.hint}}))),buttons:()=>"started"===i&&(0,r.createElement)(y,{question:e})},d=LP.config.questionBlocks();return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:this.getWrapperClass().join(" "),style:{display:t?"":"none"},"data-id":e.id,ref:this.setRef},d.map((e=>(0,r.createElement)(r.Fragment,{key:`block-${e}`},c[e]?c[e]():"")))))}}var N=(0,o.compose)([(0,a.withSelect)(((e,t)=>{let{question:{id:s}}=t;const{getData:n,getQuestionAnswered:r,getQuestionMark:i}=e("learnpress/quiz");return{status:n("status"),questions:n("question"),answered:r(s),questionsRendered:n("questionsRendered"),editPermalink:n("editPermalink"),numPages:n("numPages"),mark:i(s)||""}})),(0,a.withDispatch)((e=>{const{updateUserQuestionAnswers:t,markQuestionRendered:s}=e("learnpress/quiz");return{markQuestionRendered:s,updateUserQuestionAnswers:t}}))])(Q);class I extends r.Component{constructor(e){super(...arguments),i(this,"startQuiz",(e=>{e.preventDefault();const{startQuiz:t}=this.props;t()})),i(this,"isInVisibleRange",((e,t)=>{const{currentPage:s,questionsPerPage:n}=this.props;return s===Math.ceil(t/n)})),i(this,"nav",(e=>{const{sendKey:t}=this.props;switch(e.keyCode){case 37:return t("left");case 38:case 40:return;case 39:return t("right");default:e.keyCode>=49&&e.keyCode<=57&&t(e.keyCode-48)}})),this.needToTop=!1,this.state={isReviewing:null,currentPage:0,self:this}}static getDerivedStateFromProps(e,t){const s=["isReviewing","currentPage"],n={};for(let r=0;r<s.length;r++)e[s[r]]!==t[s[r]]&&(n[s[r]]=e[s[r]]);return Object.values(n).length?(t.self.needToTop=!0,n):null}componentDidUpdate(){this.needToTop&&(jQuery("#popup-content").animate({scrollTop:0}).find(".content-item-scrollable:last").animate({scrollTop:0}),this.needToTop=!1)}render(){const{status:e,currentQuestion:t,questions:s,questionsRendered:n,isReviewing:i,questionsPerPage:o}=this.props;let a=!0;return"completed"!==e||i||(a=!1),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{tabIndex:100,onKeyUp:this.nav},(0,r.createElement)("div",{className:"quiz-questions",style:{display:a?"":"none"}},s.map(((e,s)=>{const i=!o&&t===e.id,a=n&&-1!==n.indexOf(e.id),u=this.isInVisibleRange(e.id,s+1);return a||!a||u?(0,r.createElement)(N,{key:`loop-question-${e.id}`,isCurrent:i,isShow:u,isShowIndex:!!o&&s+1,questionsPerPage:o,question:e}):""})))))}}var C=(0,o.compose)((0,a.withSelect)(((e,t,s)=>{const{getData:n,getQuestions:r}=e("learnpress/quiz");return{status:n("status"),currentQuestion:n("currentQuestion"),questions:r(),questionsRendered:n("questionsRendered"),isReviewing:"reviewing"===n("mode"),numPages:n("numPages"),currentPage:n("currentPage"),questionsPerPage:n("questionsPerPage")||1}})),(0,a.withDispatch)((e=>{const{startQuiz:t,sendKey:s}=e("learnpress/quiz");return{startQuiz:t,sendKey:s}})))(I),A=()=>{const e=(0,a.select)("learnpress/quiz").getData("attempts")||[],t=e&&!!e.length;return!!t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"quiz-attempts"},(0,r.createElement)("h4",{className:"attempts-heading"},(0,u.__)("Last Attempted","learnpress")),t&&(0,r.createElement)("table",null,(0,r.createElement)("thead",null,(0,r.createElement)("tr",null,(0,r.createElement)("th",{className:"quiz-attempts__questions"},(0,u.__)("Questions","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__spend"},(0,u.__)("Time spent","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__marks"},(0,u.__)("Marks","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__grade"},(0,u.__)("Passing grade","learnpress")),(0,r.createElement)("th",{className:"quiz-attempts__result"},(0,u.__)("Result","learnpress")))),(0,r.createElement)("tbody",null,e.map(((e,t)=>(0,r.createElement)("tr",{key:`attempt-${t}`},(0,r.createElement)("td",{className:"quiz-attempts__questions"},`${e.questionCorrect} / ${e.questionCount}`),(0,r.createElement)("td",{className:"quiz-attempts__spend"},e.timeSpend||"--"),(0,r.createElement)("td",{className:"quiz-attempts__marks"},`${e.userMark} / ${e.mark}`),(0,r.createElement)("td",{className:"quiz-attempts__grade"},e.passingGrade||"-"),(0,r.createElement)("td",{className:"quiz-attempts__result"},`${parseFloat(e.result).toFixed(2)}%`," ",(0,r.createElement)("span",null,e.graduationText)))))))))},T=()=>{const{getData:e}=(0,a.select)("learnpress/quiz"),{submitQuiz:t}=(0,a.dispatch)("learnpress/quiz"),s=e("totalTime"),n=e("duration"),[i,o]=(0,r.useState)(s);let[u,l]=(0,r.useState)(0);const c=s>0;return(0,r.useEffect)((()=>{const e=setInterval((()=>{if(c){let s=i;s-=1,s>0?(o(s),u++,l(n-s)):(clearInterval(e),t())}else u++,l(u),o(u)}),1e3);return()=>clearInterval(e)}),[i,u]),(0,r.createElement)("div",{className:"countdown"},(0,r.createElement)("i",{className:"fas fa-stopwatch"}),(0,r.createElement)("span",null,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";const t=[];let n;return s<3600?(t.push((i-i%60)/60),t.push(i%60)):s&&(t.push((i-i%3600)/3600),n=i%3600,t.push((n-n%60)/60),t.push(n%60)),t.map((e=>e<10?`0${e}`:e)).join(e)}()),(0,r.createElement)("input",{type:"hidden",name:"lp-quiz-time-spend",value:u}))},R=window.wp.url;const O=jQuery;let L=null;const x={elLPOverlay:null,elMainContent:null,elTitle:null,elBtnYes:null,elBtnNo:null,elFooter:null,elCalledModal:null,callBackYes:null,instance:null,init(){return!!this.instance||(this.elLPOverlay=O(".lp-overlay"),!!this.elLPOverlay.length&&(L=this.elLPOverlay,this.elMainContent=L.find(".main-content"),this.elTitle=L.find(".modal-title"),this.elBtnYes=L.find(".btn-yes"),this.elBtnNo=L.find(".btn-no"),this.elFooter=L.find(".lp-modal-footer"),O(document).on("click",".close, .btn-no",(function(){L.hide()})),O(document).on("click",".btn-yes",(function(e){e.preventDefault(),e.stopPropagation(),"function"==typeof x.callBackYes&&x.callBackYes()})),this.instance=this,!0))},setElCalledModal(e){this.elCalledModal=e},setContentModal(e,t){this.elMainContent.html(e),"function"==typeof t&&t()},setTitleModal(e){this.elTitle.html(e)}};var D=x,M={elBtnFinishCourse:null,elBtnCompleteItem:null,init(){D.init()&&void 0!==lpGlobalSettings&&"yes"===lpGlobalSettings.option_enable_popup_confirm_finish&&(this.elBtnFinishCourse=document.querySelectorAll(".lp-btn-finish-course"),this.elBtnCompleteItem=document.querySelector(".lp-btn-complete-item"),this.elBtnCompleteItem&&this.elBtnCompleteItem.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest("form");D.elLPOverlay.show(),D.setTitleModal(t.dataset.title),D.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),D.callBackYes=()=>{t.submit()}})),this.elBtnFinishCourse&&this.elBtnFinishCourse.forEach((e=>e.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest("form");D.elLPOverlay.show(),D.setTitleModal(t.dataset.title),D.setContentModal('<div class="pd-2em">'+t.dataset.confirm+"</div>"),D.callBackYes=()=>{t.submit()}})))))}};const{debounce:H}=lodash;var F=()=>{const[e,t]=(0,r.useState)(0),[s,n]=(0,r.useState)(!1),i=(0,a.useSelect)((e=>e("learnpress/quiz").getData("id")),[]),o=(0,a.useSelect)((e=>e("learnpress/quiz").getData("results")),[]),l=(0,a.useSelect)((e=>e("learnpress/quiz").getData("passingGrade")),[]),c=(0,a.useSelect)((e=>e("learnpress/quiz").getData("submitting")),[]);(0,r.useEffect)((()=>{p();let e="";if(e=o.graduation?o.graduation:o.result>=f.replace(/[^0-9\.]+/g,"")?"passed":"failed",e){const t=document.querySelector(`.course-curriculum .course-item.course-item-${i}`);t&&(t.classList.remove("failed","passed"),t.classList.add("has-status","status-completed",e))}const t=[...document.querySelectorAll("#popup-header .items-progress")][0],s=document.querySelector(".curriculum-sections");if(t&&s){const e=t.dataset.totalItems,s=t.querySelector(".items-completed"),n=t.querySelector(".learn-press-progress__active");if(s){const t=document.querySelectorAll("#popup-sidebar .course-curriculum .course-item.status-completed");s.textContent=parseInt(t.length);const r=100-100*parseInt(t.length)/parseInt(e);n.style.left="-"+r+"%"}}}),[o]),(0,r.useEffect)((()=>{void 0!==c&&d()}),[c]);const d=()=>{const e=document.querySelectorAll(".popup-header__inner");e.length>0&&0===e[0].querySelectorAll("form.form-button-finish-course").length&&(async e=>{const t=await wp.apiFetch({path:(0,R.addQueryArgs)("lp/v1/lazy-load/items-progress",{courseId:lpGlobalSettings.post_id||"",userId:lpGlobalSettings.user_id||""}),method:"GET"}),{data:s}=t;e.innerHTML+=s,M.init()})(e[0])},p=()=>{t(0),n(!1),jQuery.easing._customEasing=function(e,t,s,n,r){return n*Math.sqrt(1-(t=t/r-1)*t)+s},H((()=>{const e=jQuery("<span />").css({width:1,height:1}).appendTo(document.body);e.css("left",0).animate({left:o.result},{duration:1500,step:(e,s)=>{t(e)},done:()=>{n(!0),e.remove(),jQuery("#quizResultGrade").css({transform:"scale(1.3)",transition:"all 0.25s"}),H((()=>{jQuery("#quizResultGrade").css({transform:"scale(1)"})}),500)()},easing:"_customEasing"})}),o.result>0?1e3:10)()};let m=e;Number.isInteger(e)||(m=parseFloat(e).toFixed(2));const h=190*Math.PI,g={strokeDasharray:`${h} ${h}`,strokeDashoffset:h-m/100*h},f=o.passingGrade||l;let _="";_=o.graduation?o.graduation:m>=f.replace(/[^0-9\.]+/g,"")?"passed":"failed";let q="";q=o.graduationText?o.graduationText:"passed"===_?(0,u.__)("Passed","learnpress"):(0,u.__)("Failed","learnpress");const w=["quiz-result",_];return(0,r.createElement)("div",{className:w.join(" ")},(0,r.createElement)("h3",{className:"result-heading"},(0,u.__)("Your Result","learnpress")),(0,r.createElement)("div",{id:"quizResultGrade",className:"result-grade"},(0,r.createElement)("svg",{className:"circle-progress-bar",width:200,height:200},(0,r.createElement)("circle",{className:"circle-progress-bar__circle",stroke:"",strokeWidth:10,style:g,fill:"transparent",r:95,cx:100,cy:100})),(0,r.createElement)("span",{className:"result-achieved"},`${m}%`),(0,r.createElement)("span",{className:"result-require"},f||"-")),s&&(0,r.createElement)("p",{className:"result-message"},q),(0,r.createElement)("ul",{className:"result-statistic"},(0,r.createElement)("li",{className:"result-statistic-field result-time-spend"},(0,r.createElement)("span",null,(0,u.__)("Time spent","learnpress")),(0,r.createElement)("p",null,o.timeSpend)),(0,r.createElement)("li",{className:"result-statistic-field result-point"},(0,r.createElement)("span",null,(0,u.__)("Points","learnpress")),(0,r.createElement)("p",null,o.userMark," / ",o.mark)),(0,r.createElement)("li",{className:"result-statistic-field result-questions"},(0,r.createElement)("span",null,(0,u.__)("Questions","learnpress")),(0,r.createElement)("p",null,o.questionCount)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-correct"},(0,r.createElement)("span",null,(0,u.__)("Correct","learnpress")),(0,r.createElement)("p",null,o.questionCorrect)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-wrong"},(0,r.createElement)("span",null,(0,u.__)("Wrong","learnpress")),(0,r.createElement)("p",null,o.questionWrong)),(0,r.createElement)("li",{className:"result-statistic-field result-questions-skipped"},(0,r.createElement)("span",null,(0,u.__)("Skipped","learnpress")),(0,r.createElement)("p",null,o.questionEmpty))))};const U=jQuery,{debounce:$}=lodash;var j=()=>{const{submitQuiz:e}=(0,a.dispatch)("learnpress/quiz");(0,r.useEffect)((()=>{const e=U("#popup-content");if(!e.length)return;const t=e.find(".content-item-scrollable:eq(1)"),s=e.find(".content-item-wrap"),n=e.find(".quiz-status"),r=n.offset().top-92;let i=!1,o="-"+s.css("margin-left");U(window).on("resize.refresh-quiz-stauts-bar",$((function(){o="-"+s.css("margin-left"),n.css({"margin-left":o,"margin-right":o})}),100)).trigger("resize.refresh-quiz-stauts-bar"),t.on("scroll",(()=>{if(t.scrollTop()>=r){if(i)return;i=!0}else{if(!i)return;i=!1}i?e.addClass("fixed-quiz-status"):e.removeClass("fixed-quiz-status")}))}),[]);const t=()=>{const{confirm:s}=(0,a.select)("learnpress/modal");"no"!==s((0,u.__)("Are you sure to submit quiz?","learnpress"),t)&&e()},{getData:s,getUserMark:n}=(0,a.select)("learnpress/quiz"),i=s("currentPage"),o=s("questionsPerPage"),l=s("questionIds").length,c=s("submitting"),d=(s("duration"),n()),p=["quiz-status"],m=(i-1)*o+1;let h=m+o-1,g="";return h=Math.min(h,l),c&&p.push("submitting"),g=h<l?o>1?(0,u.sprintf)((0,u.__)("Question <span>%d to %d of %d</span>","learnpress"),m,h,l):(0,u.sprintf)((0,u.__)("Question <span>%d of %d</span>","learnpress"),m,l):(0,u.sprintf)((0,u.__)("Question <span>%d to %d</span>","learnpress"),m,h),(0,r.createElement)("div",{className:p.join(" ")},(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"questions-index",dangerouslySetInnerHTML:{__html:g}}),(0,r.createElement)("div",{className:"current-point"},(0,u.sprintf)((0,u.__)("Earned Point: %s","learnpress"),d)),(0,r.createElement)("div",null,(0,r.createElement)("div",{className:"submit-quiz"},(0,r.createElement)("button",{className:"lp-button",id:"button-submit-quiz",onClick:t},c?(0,u.__)("Submitting...","learnpress"):(0,u.__)("Finish Quiz","learnpress"))),(0,r.createElement)(T,null))))};const{omit:B,flow:J,isArray:G,chunk:K}=lodash,{camelCaseDashObjectKeys:W}=LP,{get:Z,set:Y}=LP.localStorage,V={},X=(e,t)=>{const{answered:s,id:n}=e,r={...s[t.questionId]||{},answered:t.answers,temp:!0};return n&&localStorage.setItem(`LP_Quiz_${n}_Answered`,JSON.stringify({...e.answered,[t.questionId]:r})),{...e,answered:{...e.answered,[t.questionId]:r}}},ee=(e,t)=>{const{questionsRendered:s}=e;return G(s)?(s.push(t.questionId),{...e,questionsRendered:[...s]}):{...e,questionsRendered:[t.questionId]}},te=(e,t)=>(t.currentPage&&Y(`Q${e.id}.currentPage`,t.currentPage),{...e,...t}),se=(e,t)=>{const s=e.questions.map((e=>e.id==t.questionId?{...e,showHint:t.showHint}:e));return{...e,questions:[...s]}},ne=(e,t)=>{const s=e.questions.map((e=>{if(e.id!==t.questionId)return e;const s={explanation:t.explanation};return t.options&&(s.options=t.options),{...e,...s}})),n={...e.answered,[t.questionId]:t.result};let r=localStorage.getItem(`LP_Quiz_${e.id}_Answered`);return r&&(r={...JSON.parse(r),...n},localStorage.setItem(`LP_Quiz_${e.id}_Answered`,JSON.stringify(r))),{...e,questions:[...s],answered:n,checkedQuestions:[...e.checkedQuestions,t.questionId]}},re=(e,t)=>{localStorage.removeItem(`LP_Quiz_${e.id}_Answered`);const s=e.questions.map((s=>{const n={};return e.reviewQuestions&&(t.results.questions[s.id].explanation&&(n.explanation=t.results.questions[s.id].explanation),t.results.questions[s.id].options&&(n.options=t.results.questions[s.id].options)),{...s,...n}}));return te(e,{submitting:!1,currentPage:1,...t.results,questions:[...s]})},ie=(e,t)=>{const s=void 0!==t.results.success&&t.results.success,n=t.results.message||!1;return te(e,{checkedQuestions:[],hintedQuestions:[],mode:"",currentPage:1,...t.results.results,successResponse:s,messageResponse:n})},oe=J(a.combineReducers,(e=>(t,s)=>e(t,s)),(e=>(t,s)=>e(t,s)),(e=>(t,s)=>e(t,s)))({a(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{a:1}},b(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{b:2}}});var ae=(0,a.combineReducers)({blocks:oe,userQuiz:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_QUIZ_DATA":1>t.data.questionsPerPage&&(t.data.questionsPerPage=1);const s=K(e.questionIds||t.data.questionIds,t.data.questionsPerPage);return t.data.numPages=s.length,t.data.pages=s,{...e,...t.data,currentPage:Z(`Q${t.data.id}.currentPage`)||t.data.currentPage};case"SUBMIT_QUIZ":return{...e,submitting:!0};case"START_QUIZ":case"START_QUIZ_SUCCESS":return ie(e,t);case"SET_CURRENT_QUESTION":return Y(`Q${e.id}.currentQuestion`,t.questionId),{...e,currentQuestion:t.questionId};case"SET_CURRENT_PAGE":return Y(`Q${e.id}.currentPage`,t.currentPage),{...e,currentPage:t.currentPage};case"SUBMIT_QUIZ_SUCCESS":return re(e,t);case"UPDATE_USER_QUESTION_ANSWERS":return"started"===e.status?X(e,t):e;case"MARK_QUESTION_RENDERED":return ee(e,t);case"SET_QUIZ_MODE":return"reviewing"==t.mode?te(e,{mode:t.mode}):{...e,mode:t.mode};case"SET_QUESTION_HINT":return se(e,t);case"CHECK_ANSWER":return ne(e,t);case"SEND_KEY":return{...e,keyPressed:t.keyPressed}}return e}}),ue=window.LP.dataControls;function le(){const e=[].slice.call(arguments,2),t=(0,a.dispatch)(arguments[0]),s=arguments[1];t[s](...e)}const{camelCaseDashObjectKeys:ce,Hook:de}=LP;function pe(e,t){return{type:"SET_QUIZ_DATA",data:ce(t="string"==typeof e?{[e]:t}:e)}}function me(e){return{type:"SET_CURRENT_QUESTION",questionId:e}}function he(e){return{type:"SET_CURRENT_PAGE",currentPage:e}}function ge(e,t,s){return{type:"BEFORE_START_QUIZ"}}function fe(e,t,s,n){return de.doAction("quiz-started",e,t,s,n),{type:"START_QUIZ_SUCCESS",quizId:t,courseId:s,userId:n,results:e}}const _e=function*(){const{itemId:e,courseId:t}=(0,a.select)("learnpress/quiz").getDefaultRestArgs();if(!0!==de.applyFilters("before-start-quiz",!0,e,t))return;let s=yield(0,ue.apiFetch)({path:"lp/v1/users/start-quiz",method:"POST",data:{item_id:e,course_id:t}});const n=document.querySelector(".lp-button.start");if("error"!==s.status){if(s=de.applyFilters("request-start-quiz-response",s,e,t),1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id;window.localStorage.removeItem(e);const t={endTime:Date.now()+1e3*s.results.duration,status:s.results.status};window.localStorage.setItem(e,JSON.stringify(t));const n="quiz_off_retaken_"+lpQuizSettings.id;let r=window.localStorage.getItem(n);null===r?r=0:r++,window.localStorage.setItem(n,r)}yield le("learnpress/quiz","__requestStartQuizSuccess",ce(s),e,t)}else{const e=document.querySelector(".quiz-buttons"),t=`<div class="learn-press-message error">${s.message}</div>`;e.insertAdjacentHTML("afterend",t),n.classList.remove("loading")}};function qe(){return{type:"SUBMIT_QUIZ"}}function we(e,t,s){return de.doAction("quiz-submitted",e,t,s),{type:"SUBMIT_QUIZ_SUCCESS",results:e}}function*ve(){const{getDefaultRestArgs:e,getQuestionsSelectedAnswers:t}=(0,a.select)("learnpress/quiz"),{itemId:s,courseId:n}=e();if(!0!==de.applyFilters("before-submit-quiz",!0))return;const r=t();if(1===lpQuizSettings.checkNorequizenroll){const e=`LP_Quiz_${s}_Answered`,t=localStorage.getItem(e);if(null!==t){const e=JSON.parse(t);for(const[t,s]of Object.entries(e))r[t]=s.answered}}let i=0;const o=document.querySelector("input[name=lp-quiz-time-spend]");o&&(i=o.value);let u=yield(0,ue.apiFetch)({path:"lp/v1/users/submit-quiz",method:"POST",data:{item_id:s,course_id:n,answered:r,time_spend:i}});if(u=de.applyFilters("request-submit-quiz-response",u,s,n),"success"===u.status){if(1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id,t=window.localStorage.getItem(e);if(null!==t){const s=JSON.parse(t);s.status=u.results.status,s.results=u.results.results,window.localStorage.setItem(e,JSON.stringify(s)),window.localStorage.removeItem("LP_Quiz_"+lpQuizSettings.id+"_Answered")}}yield le("learnpress/quiz","__requestSubmitQuizSuccess",ce(u.results),s,n)}}function Se(e,t,s){return{type:"UPDATE_USER_QUESTION_ANSWERS",questionId:e,answers:t}}function ye(e,t){return{type:"SET_QUESTION_HINT",questionId:e,showHint:t}}function*Ee(e,t){yield le("learnpress/quiz","__requestShowHintSuccess",e,t)}function ze(e,t){return{type:"CHECK_ANSWER",questionId:e,...t}}function*be(e){const{getDefaultRestArgs:t,getQuestionAnswered:s}=(0,a.select)("learnpress/quiz"),{itemId:n,courseId:r}=t(),i=yield(0,ue.apiFetch)({path:"lp/v1/users/check-answer",method:"POST",data:{item_id:n,course_id:r,question_id:e,answered:s(e)||""}});if("success"===i.status){if(1===lpQuizSettings.checkNorequizenroll){const t="quiz_off_"+lpQuizSettings.id,s=window.localStorage.getItem(t);if(null!==s){const n=JSON.parse(s),r=i.options;void 0===n.checked_questions?(n.checked_questions=[],n.checked_questions.push(e)):-1===n.checked_questions.indexOf(e)&&n.checked_questions.push(e),void 0===n.question_options?(n.question_options={},n.question_options[e]=r):void 0===n.question_options[e]&&(n.question_options[e]=r),window.localStorage.setItem(t,JSON.stringify(n))}}yield le("learnpress/quiz","__requestCheckAnswerSuccess",e,ce(i))}}function ke(e){return{type:"MARK_QUESTION_RENDERED",questionId:e}}function Pe(e){return{type:"SET_QUIZ_MODE",mode:e}}function Qe(e){return setTimeout((()=>{le("learnpress/quiz","sendKey","")}),300),{type:"SEND_KEY",keyPressed:e}}const{get:Ne,isArray:Ie}=lodash,Ce=function(e,t){console.time("parseOptions");let s=Ue(e,t).options;return s=Ie(s)?s:JSON.parse(CryptoJS.AES.decrypt(s.data,s.key,{format:CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)),s=Ie(s)?s:JSON.parse(s),console.timeEnd("parseOptions"),s};function Ae(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.status"):""}function Te(e,t,s){return e[t]||s}function Re(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.attempts"):[]}function Oe(e,t){const s=(0,a.select)("course-learner/user").getItemById(t);return s?Ne(s,"userSettings.answered",{}):{}}function Le(e){const{userQuiz:t}=e,s=Ne(t,"questions");return s?Object.values(s):[]}function xe(e,t){const{userQuiz:s}=e;return t?Ne(s,t):s}function De(e){const{userQuiz:t}=e;return{itemId:t.id,courseId:t.courseId}}function Me(e,t){const{userQuiz:s}=e;return Ne(s,`answered.${t}.answered`)||void 0}function He(e,t){const{userQuiz:s}=e;return Ne(s,`answered.${t}.mark`)||void 0}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=Ne(e,"userQuiz.questionsPerPage")||1;if(s>1)return!1;const n=Ne(e,"userQuiz.currentPage")||1;return Ne(e,"object"===t?`userQuiz.questions[${n-1}]`:`userQuiz.questionIds[${n-1}]`)}const Ue=function(e,t){const{userQuiz:s}=e;return(0,a.select)("learnpress/quiz").getQuestions().find((e=>e.id==t))};function $e(e,t){return-1!==(Ne(e,"userQuiz.checkedQuestions")||[]).indexOf(t)}function je(e,t){}const Be=function(e,t){const s=Ne(e,"userQuiz.answered"),n={};for(const e in s)if(s.hasOwnProperty(e)&&(s[e].temp||s[e].blanks)){if(t&&e===t)return s[e].answered;n[e]=s[e].answered}return n};function Je(e){const t=e.userQuiz||{},{answered:s,negativeMarking:n,questions:r,checkedQuestions:i}=t;let o=0;for(let e in s){if(!s.hasOwnProperty(e))continue;e=parseInt(e);const t=s[e],a=t.questionMark?t.questionMark:function(){const t=r.find((t=>t.id===e));return t?t.point:0}();i.indexOf(e),t.temp||(n?t.answered&&(o=t.correct?o+t.mark:o-a):t.answered&&t.correct&&(o+=t.mark))}return o>0?o:0}var Ge=s(965),Ke=s.n(Ge);const We={ENROLL_COURSE_X:(e,t)=>{}};const{controls:Ze}=LP.dataControls;!function(e){let t=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:e.getState,dispatch:function(){return t(...arguments)}};t=Ke()(We)(s)(e.dispatch),e.dispatch=t}((0,a.registerStore)("learnpress/quiz",{reducer:ae,selectors:t,actions:e,controls:{...Ze}}));const{chunk:Ye}=lodash;class Ve extends r.Component{constructor(e){super(...arguments),i(this,"startQuiz",(e=>{this.props.startQuiz()})),this.state={currentPage:1,numPages:0,pages:[]}}componentDidMount(){const{settings:e,setQuizData:t,status:s,isReviewing:n}=this.props,{question_ids:r,questions_per_page:i}=e,o=Ye(r,i);e.currentPage=1,e.numPages=o.length,e.pages=o;const a=!!e.id&&localStorage.getItem(`LP_Quiz_${e.id}_Answered`);a&&(e.answered=JSON.parse(a)),t(e)}componentDidUpdate(e,t){const{status:s,isReviewing:n}=this.props,r=-1!==["","viewed",void 0].indexOf(s)||!s;if(n||!r){const e=document.querySelector(".quiz-content");e&&(e.style.display="none")}}render(){const{status:e,isReviewing:t}=this.props,s=-1!==["","completed","viewed"].indexOf(e)||!e,n=-1!==["","viewed",void 0].indexOf(e)||!e;return void 0!==e&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",null,!t&&"completed"===e&&(0,r.createElement)(F,null),!t&&n&&(0,r.createElement)(d,null),"started"===e&&(0,r.createElement)(j,null),(-1!==["completed","started"].indexOf(e)||t)&&(0,r.createElement)(C,null),(0,r.createElement)(h,null),s&&!t&&(0,r.createElement)(A,null)))}}var Xe=(0,o.compose)([(0,a.withSelect)((e=>{const{getQuestions:t,getData:s}=e("learnpress/quiz");return{questions:t(),status:s("status"),store:s(),answered:s("answered"),isReviewing:"reviewing"===s("mode"),questionIds:s("questionIds"),checkCount:s("instantCheck"),questionsPerPage:s("questionsPerPage")||1}})),(0,a.withDispatch)((e=>{const{setQuizData:t,startQuiz:s}=e("learnpress/quiz");return{setQuizData:t,startQuiz:s}}))])(Ve);s(605);const{modal:{default:et}}=LP;var tt=Xe;const st=(e,t)=>{if(1===lpQuizSettings.checkNorequizenroll){const e="quiz_off_"+lpQuizSettings.id,s=window.localStorage.getItem(e);if(null!==s){const e=JSON.parse(s);if(t.status=e.status,"started"===e.status){const s=Date.now();t.total_time=Math.floor((e.endTime-s)/1e3)}else"completed"===e.status&&(t.results=e.results,t.answered=e.results.answered,t.questions=e.results.questions);if(void 0!==e.checked_questions&&(t.checked_questions=e.checked_questions),void 0!==e.question_options)for(const s in t.questions){let n=t.questions[s];void 0!==e.question_options[n.id]&&(n.options=e.question_options[n.id]),t.questions[s]=n}}}wp.element.render((0,r.createElement)(et,null,(0,r.createElement)(Xe,{settings:t})),[...document.querySelectorAll(e)][0]),LP.Hook.doAction("lp-quiz-compatible-builder")}}(),(window.LP=window.LP||{}).quiz=n}();
assets/js/vendor/plugins.all.js CHANGED
@@ -1,359 +1 @@
1
- if (!Object.prototype.watchChange) {
2
- var isFunction = function (fn) {
3
- return fn && {}.toString.call(fn) === '[object Function]';
4
- };
5
- Object.defineProperty(
6
- Object.prototype,
7
- 'watchChange',
8
- {
9
- enumerable: false,
10
- configurable: true,
11
- writable: false,
12
- value: function (prop, handler) {
13
- var obj = this;
14
-
15
- function x(prop, handler) {
16
- var oldval = obj[prop],
17
- newval = oldval,
18
- getter = function () {
19
- return newval;
20
- },
21
- setter = function (val) {
22
- return newval = handler.call(obj, prop, oldval, val);
23
- };
24
-
25
- if (delete obj[prop]) {
26
- Object.defineProperty(
27
- obj,
28
- prop,
29
- {
30
- get: getter,
31
- set: setter,
32
- enumerable: true,
33
- configurable: true
34
- }
35
- );
36
- }
37
- }
38
-
39
- if (isFunction(prop)) {
40
- for (var k in this) {
41
- new x(k, prop);
42
- }
43
- } else {
44
- new x(prop, handler)
45
- }
46
- }
47
- });
48
- }
49
-
50
- if (!Object.prototype.unwatchChange) {
51
- Object.defineProperty(
52
- Object.prototype,
53
- 'unwatchChange',
54
- {
55
- enumerable: false,
56
- configurable: true,
57
- writable: false,
58
- value: function (prop) {
59
- var val = this[prop];
60
- delete this[prop];
61
- this[prop] = val;
62
- }
63
- }
64
- );
65
- }
66
- /*!
67
- * jQuery.scrollTo
68
- * Copyright (c) 2007-2015 Ariel Flesler - aflesler ○ gmail • com | http://flesler.blogspot.com
69
- * Licensed under MIT
70
- * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
71
- * @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery
72
- * @author Ariel Flesler
73
- * @version 2.1.2
74
- */
75
- ;(function(factory) {
76
- 'use strict';
77
- if (typeof define === 'function' && define.amd) {
78
- // AMD
79
- define(['jquery'], factory);
80
- } else if (typeof module !== 'undefined' && module.exports) {
81
- // CommonJS
82
- module.exports = factory(require('jquery'));
83
- } else {
84
- // Global
85
- factory(jQuery);
86
- }
87
- })(function($) {
88
- 'use strict';
89
-
90
- var $scrollTo = $.scrollTo = function(target, duration, settings) {
91
- return $(window).scrollTo(target, duration, settings);
92
- };
93
-
94
- $scrollTo.defaults = {
95
- axis:'xy',
96
- duration: 0,
97
- limit:true
98
- };
99
-
100
- function isWin(elem) {
101
- return !elem.nodeName ||
102
- $.inArray(elem.nodeName.toLowerCase(), ['iframe','#document','html','body']) !== -1;
103
- }
104
-
105
- $.fn.scrollTo = function(target, duration, settings) {
106
- if (typeof duration === 'object') {
107
- settings = duration;
108
- duration = 0;
109
- }
110
- if (typeof settings === 'function') {
111
- settings = { onAfter:settings };
112
- }
113
- if (target === 'max') {
114
- target = 9e9;
115
- }
116
-
117
- settings = $.extend({}, $scrollTo.defaults, settings);
118
- // Speed is still recognized for backwards compatibility
119
- duration = duration || settings.duration;
120
- // Make sure the settings are given right
121
- var queue = settings.queue && settings.axis.length > 1;
122
- if (queue) {
123
- // Let's keep the overall duration
124
- duration /= 2;
125
- }
126
- settings.offset = both(settings.offset);
127
- settings.over = both(settings.over);
128
-
129
- return this.each(function() {
130
- // Null target yields nothing, just like jQuery does
131
- if (target === null) return;
132
-
133
- var win = isWin(this),
134
- elem = win ? this.contentWindow || window : this,
135
- $elem = $(elem),
136
- targ = target,
137
- attr = {},
138
- toff;
139
-
140
- switch (typeof targ) {
141
- // A number will pass the regex
142
- case 'number':
143
- case 'string':
144
- if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
145
- targ = both(targ);
146
- // We are done
147
- break;
148
- }
149
- // Relative/Absolute selector
150
- targ = win ? $(targ) : $(targ, elem);
151
- /* falls through */
152
- case 'object':
153
- if (targ.length === 0) return;
154
- // DOMElement / jQuery
155
- if (targ.is || targ.style) {
156
- // Get the real position of the target
157
- toff = (targ = $(targ)).offset();
158
- }
159
- }
160
-
161
- var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
162
-
163
- $.each(settings.axis.split(''), function(i, axis) {
164
- var Pos = axis === 'x' ? 'Left' : 'Top',
165
- pos = Pos.toLowerCase(),
166
- key = 'scroll' + Pos,
167
- prev = $elem[key](),
168
- max = $scrollTo.max(elem, axis);
169
-
170
- if (toff) {// jQuery / DOMElement
171
- attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]);
172
-
173
- // If it's a dom element, reduce the margin
174
- if (settings.margin) {
175
- attr[key] -= parseInt(targ.css('margin'+Pos), 10) || 0;
176
- attr[key] -= parseInt(targ.css('border'+Pos+'Width'), 10) || 0;
177
- }
178
-
179
- attr[key] += offset[pos] || 0;
180
-
181
- if (settings.over[pos]) {
182
- // Scroll to a fraction of its width/height
183
- attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos];
184
- }
185
- } else {
186
- var val = targ[pos];
187
- // Handle percentage values
188
- attr[key] = val.slice && val.slice(-1) === '%' ?
189
- parseFloat(val) / 100 * max
190
- : val;
191
- }
192
-
193
- // Number or 'number'
194
- if (settings.limit && /^\d+$/.test(attr[key])) {
195
- // Check the limits
196
- attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
197
- }
198
-
199
- // Don't waste time animating, if there's no need.
200
- if (!i && settings.axis.length > 1) {
201
- if (prev === attr[key]) {
202
- // No animation needed
203
- attr = {};
204
- } else if (queue) {
205
- // Intermediate animation
206
- animate(settings.onAfterFirst);
207
- // Don't animate this axis again in the next iteration.
208
- attr = {};
209
- }
210
- }
211
- });
212
-
213
- animate(settings.onAfter);
214
-
215
- function animate(callback) {
216
- var opts = $.extend({}, settings, {
217
- // The queue setting conflicts with animate()
218
- // Force it to always be true
219
- queue: true,
220
- duration: duration,
221
- complete: callback && function() {
222
- callback.call(elem, targ, settings);
223
- }
224
- });
225
- $elem.animate(attr, opts);
226
- }
227
- });
228
- };
229
-
230
- // Max scrolling position, works on quirks mode
231
- // It only fails (not too badly) on IE, quirks mode.
232
- $scrollTo.max = function(elem, axis) {
233
- var Dim = axis === 'x' ? 'Width' : 'Height',
234
- scroll = 'scroll'+Dim;
235
-
236
- if (!isWin(elem))
237
- return elem[scroll] - $(elem)[Dim.toLowerCase()]();
238
-
239
- var size = 'client' + Dim,
240
- doc = elem.ownerDocument || elem.document,
241
- html = doc.documentElement,
242
- body = doc.body;
243
-
244
- return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
245
- };
246
-
247
- function both(val) {
248
- return $.isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val };
249
- }
250
-
251
- // Add special hooks so that window scroll properties can be animated
252
- $.Tween.propHooks.scrollLeft =
253
- $.Tween.propHooks.scrollTop = {
254
- get: function(t) {
255
- return $(t.elem)[t.prop]();
256
- },
257
- set: function(t) {
258
- var curr = this.get(t);
259
- // If interrupt is true and user scrolled, stop animating
260
- if (t.options.interrupt && t._last && t._last !== curr) {
261
- return $(t.elem).stop();
262
- }
263
- var next = Math.round(t.now);
264
- // Don't waste CPU
265
- // Browsers don't render floating point scroll
266
- if (curr !== next) {
267
- $(t.elem)[t.prop](next);
268
- t._last = this.get(t);
269
- }
270
- }
271
- };
272
-
273
- // AMD requirement
274
- return $scrollTo;
275
- });
276
- (function (e) {
277
- e.backward_timer = function (t) {
278
- var n = {seconds: 5, step: 1, format: "h%:m%:s%", value_setter: undefined, on_exhausted: function (e) {
279
- }, on_tick : function (e) {
280
- }}, r = this;
281
- r.seconds_left = 0;
282
- r.target = e(t);
283
- r.timeout = undefined;
284
- r.settings = {};
285
- r.methods = {init : function (t) {
286
- r.settings = e.extend({}, n, t);
287
- if (r.settings.value_setter == undefined) {
288
- if (r.target.is("input")) {
289
- r.settings.value_setter = "val"
290
- } else {
291
- r.settings.value_setter = "text"
292
- }
293
- }
294
- r.methods.reset()
295
- }, start : function () {
296
- if (r.timeout == undefined) {
297
- var e = r.seconds_left == r.settings.seconds ? 0 : r.settings.step * 1e3;
298
- setTimeout(r.methods._on_tick, e, e)
299
- }
300
- }, cancel : function () {
301
- if (r.timeout != undefined) {
302
- clearTimeout(r.timeout);
303
- r.timeout = undefined
304
- }
305
- }, reset : function () {
306
- r.seconds_left = r.settings.seconds;
307
- r.methods._render_seconds()
308
- }, _on_tick : function (e) {
309
- if (e != 0) {
310
- r.settings.on_tick(r)
311
- }
312
- r.methods._render_seconds();
313
- if (r.seconds_left > 0) {
314
- if (r.seconds_left < r.settings.step) {
315
- var t = r.seconds_left
316
- } else {
317
- var t = r.settings.step
318
- }
319
- r.seconds_left -= t;
320
- var n = t * 1e3;
321
- r.timeout = setTimeout(r.methods._on_tick, n, n)
322
- } else {
323
- r.timeout = undefined;
324
- r.settings.on_exhausted(r)
325
- }
326
- }, _render_seconds : function () {
327
- var e = r.methods._seconds_to_dhms(r.seconds_left), t = r.settings.format;
328
- if (t.indexOf("d%") !== -1) {
329
- t = t.replace("d%", e.d).replace("h%", r.methods._check_leading_zero(e.h))
330
- } else {
331
- t = t.replace("h%", e.d * 24 + e.h)
332
- }
333
- t = t.replace("m%", r.methods._check_leading_zero(e.m)).replace("s%", r.methods._check_leading_zero(e.s));
334
- r.target[r.settings.value_setter](t)
335
- }, _seconds_to_dhms : function (e) {
336
- var t = Math.floor(e / (24 * 3600)), e = e - t * 24 * 3600, n = Math.floor(e / 3600), e = e - n * 3600, r = Math.floor(e / 60), i = Math.floor(e - r * 60);
337
- return{d: t, h: n, m: r, s: i}
338
- }, _check_leading_zero: function (e) {
339
- return e < 10 ? "0" + e : "" + e
340
- }}
341
- };
342
- e.fn.backward_timer = function (t) {
343
- var n = arguments;
344
- return this.each(function () {
345
- var r = e(this).data("backward_timer");
346
- if (r == undefined) {
347
- r = new e.backward_timer(this);
348
- e(this).data("backward_timer", r)
349
- }
350
- if (r.methods[t]) {
351
- return r.methods[t].apply(this, Array.prototype.slice.call(n, 1))
352
- } else if (typeof t === "object" || !t) {
353
- return r.methods.init.apply(this, n)
354
- } else {
355
- e.error("Method " + t + " does not exist on jQuery.backward_timer")
356
- }
357
- })
358
- }
359
- })(jQuery);
1
+ if(!Object.prototype.watchChange){var isFunction=function(e){return e&&"[object Function]"==={}.toString.call(e)};Object.defineProperty(Object.prototype,"watchChange",{enumerable:!1,configurable:!0,writable:!1,value:function(e,t){var n=this;function o(e,t){var o=n[e],s=o;delete n[e]&&Object.defineProperty(n,e,{get:function(){return s},set:function(r){return s=t.call(n,e,o,r)},enumerable:!0,configurable:!0})}if(isFunction(e))for(var s in this)new o(s,e);else new o(e,t)}})}Object.prototype.unwatchChange||Object.defineProperty(Object.prototype,"unwatchChange",{enumerable:!1,configurable:!0,writable:!1,value:function(e){var t=this[e];delete this[e],this[e]=t}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}((function(e){"use strict";var t=e.scrollTo=function(t,n,o){return e(window).scrollTo(t,n,o)};function n(t){return!t.nodeName||-1!==e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])}function o(t){return e.isFunction(t)||e.isPlainObject(t)?t:{top:t,left:t}}return t.defaults={axis:"xy",duration:0,limit:!0},e.fn.scrollTo=function(s,r,i){"object"==typeof r&&(i=r,r=0),"function"==typeof i&&(i={onAfter:i}),"max"===s&&(s=9e9),i=e.extend({},t.defaults,i),r=r||i.duration;var a=i.queue&&i.axis.length>1;return a&&(r/=2),i.offset=o(i.offset),i.over=o(i.over),this.each((function(){if(null!==s){var c,u=n(this),l=u?this.contentWindow||window:this,f=e(l),d=s,h={};switch(typeof d){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(d)){d=o(d);break}d=u?e(d):e(d,l);case"object":if(0===d.length)return;(d.is||d.style)&&(c=(d=e(d)).offset())}var m=e.isFunction(i.offset)&&i.offset(l,d)||i.offset;e.each(i.axis.split(""),(function(e,n){var o="x"===n?"Left":"Top",s=o.toLowerCase(),r="scroll"+o,p=f[r](),g=t.max(l,n);if(c)h[r]=c[s]+(u?0:p-f.offset()[s]),i.margin&&(h[r]-=parseInt(d.css("margin"+o),10)||0,h[r]-=parseInt(d.css("border"+o+"Width"),10)||0),h[r]+=m[s]||0,i.over[s]&&(h[r]+=d["x"===n?"width":"height"]()*i.over[s]);else{var v=d[s];h[r]=v.slice&&"%"===v.slice(-1)?parseFloat(v)/100*g:v}i.limit&&/^\d+$/.test(h[r])&&(h[r]=h[r]<=0?0:Math.min(h[r],g)),!e&&i.axis.length>1&&(p===h[r]?h={}:a&&(_(i.onAfterFirst),h={}))})),_(i.onAfter)}function _(t){var n=e.extend({},i,{queue:!0,duration:r,complete:t&&function(){t.call(l,d,i)}});f.animate(h,n)}}))},t.max=function(t,o){var s="x"===o?"Width":"Height",r="scroll"+s;if(!n(t))return t[r]-e(t)[s.toLowerCase()]();var i="client"+s,a=t.ownerDocument||t.document,c=a.documentElement,u=a.body;return Math.max(c[r],u[r])-Math.min(c[i],u[i])},e.Tween.propHooks.scrollLeft=e.Tween.propHooks.scrollTop={get:function(t){return e(t.elem)[t.prop]()},set:function(t){var n=this.get(t);if(t.options.interrupt&&t._last&&t._last!==n)return e(t.elem).stop();var o=Math.round(t.now);n!==o&&(e(t.elem)[t.prop](o),t._last=this.get(t))}},t})),function(e){e.backward_timer=function(t){var n={seconds:5,step:1,format:"h%:m%:s%",value_setter:void 0,on_exhausted:function(e){},on_tick:function(e){}},o=this;o.seconds_left=0,o.target=e(t),o.timeout=void 0,o.settings={},o.methods={init:function(t){o.settings=e.extend({},n,t),null==o.settings.value_setter&&(o.target.is("input")?o.settings.value_setter="val":o.settings.value_setter="text"),o.methods.reset()},start:function(){if(null==o.timeout){var e=o.seconds_left==o.settings.seconds?0:1e3*o.settings.step;setTimeout(o.methods._on_tick,e,e)}},cancel:function(){null!=o.timeout&&(clearTimeout(o.timeout),o.timeout=void 0)},reset:function(){o.seconds_left=o.settings.seconds,o.methods._render_seconds()},_on_tick:function(e){if(0!=e&&o.settings.on_tick(o),o.methods._render_seconds(),o.seconds_left>0){if(o.seconds_left<o.settings.step)var t=o.seconds_left;else t=o.settings.step;o.seconds_left-=t;var n=1e3*t;o.timeout=setTimeout(o.methods._on_tick,n,n)}else o.timeout=void 0,o.settings.on_exhausted(o)},_render_seconds:function(){var e=o.methods._seconds_to_dhms(o.seconds_left),t=o.settings.format;t=(t=-1!==t.indexOf("d%")?t.replace("d%",e.d).replace("h%",o.methods._check_leading_zero(e.h)):t.replace("h%",24*e.d+e.h)).replace("m%",o.methods._check_leading_zero(e.m)).replace("s%",o.methods._check_leading_zero(e.s)),o.target[o.settings.value_setter](t)},_seconds_to_dhms:function(e){var t=Math.floor(e/86400),n=(e-=24*t*3600,Math.floor(e/3600)),o=(e-=3600*n,Math.floor(e/60));return{d:t,h:n,m:o,s:Math.floor(e-60*o)}},_check_leading_zero:function(e){return e<10?"0"+e:""+e}}},e.fn.backward_timer=function(t){var n=arguments;return this.each((function(){var o=e(this).data("backward_timer");return null==o&&(o=new e.backward_timer(this),e(this).data("backward_timer",o)),o.methods[t]?o.methods[t].apply(this,Array.prototype.slice.call(n,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.backward_timer"):o.methods.init.apply(this,n)}))}}(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/vendor/vue/vue_libs.js CHANGED
@@ -1,14524 +1 @@
1
- /*!
2
- * Vue.js v2.6.10
3
- * (c) 2014-2019 Evan You
4
- * Released under the MIT License.
5
- */
6
-
7
- (function (global, factory) {
8
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
9
- typeof define === 'function' && define.amd ? define(factory) :
10
- (global = global || self, global.Vue = factory());
11
- }(this, function () { 'use strict';
12
-
13
- /* */
14
-
15
- var emptyObject = Object.freeze({});
16
-
17
- // These helpers produce better VM code in JS engines due to their
18
- // explicitness and function inlining.
19
- function isUndef (v) {
20
- return v === undefined || v === null
21
- }
22
-
23
- function isDef (v) {
24
- return v !== undefined && v !== null
25
- }
26
-
27
- function isTrue (v) {
28
- return v === true
29
- }
30
-
31
- function isFalse (v) {
32
- return v === false
33
- }
34
-
35
- /**
36
- * Check if value is primitive.
37
- */
38
- function isPrimitive (value) {
39
- return (
40
- typeof value === 'string' ||
41
- typeof value === 'number' ||
42
- // $flow-disable-line
43
- typeof value === 'symbol' ||
44
- typeof value === 'boolean'
45
- )
46
- }
47
-
48
- /**
49
- * Quick object check - this is primarily used to tell
50
- * Objects from primitive values when we know the value
51
- * is a JSON-compliant type.
52
- */
53
- function isObject (obj) {
54
- return obj !== null && typeof obj === 'object'
55
- }
56
-
57
- /**
58
- * Get the raw type string of a value, e.g., [object Object].
59
- */
60
- var _toString = Object.prototype.toString;
61
-
62
- function toRawType (value) {
63
- return _toString.call(value).slice(8, -1)
64
- }
65
-
66
- /**
67
- * Strict object type check. Only returns true
68
- * for plain JavaScript objects.
69
- */
70
- function isPlainObject (obj) {
71
- return _toString.call(obj) === '[object Object]'
72
- }
73
-
74
- function isRegExp (v) {
75
- return _toString.call(v) === '[object RegExp]'
76
- }
77
-
78
- /**
79
- * Check if val is a valid array index.
80
- */
81
- function isValidArrayIndex (val) {
82
- var n = parseFloat(String(val));
83
- return n >= 0 && Math.floor(n) === n && isFinite(val)
84
- }
85
-
86
- function isPromise (val) {
87
- return (
88
- isDef(val) &&
89
- typeof val.then === 'function' &&
90
- typeof val.catch === 'function'
91
- )
92
- }
93
-
94
- /**
95
- * Convert a value to a string that is actually rendered.
96
- */
97
- function toString (val) {
98
- return val == null
99
- ? ''
100
- : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
101
- ? JSON.stringify(val, null, 2)
102
- : String(val)
103
- }
104
-
105
- /**
106
- * Convert an input value to a number for persistence.
107
- * If the conversion fails, return original string.
108
- */
109
- function toNumber (val) {
110
- var n = parseFloat(val);
111
- return isNaN(n) ? val : n
112
- }
113
-
114
- /**
115
- * Make a map and return a function for checking if a key
116
- * is in that map.
117
- */
118
- function makeMap (
119
- str,
120
- expectsLowerCase
121
- ) {
122
- var map = Object.create(null);
123
- var list = str.split(',');
124
- for (var i = 0; i < list.length; i++) {
125
- map[list[i]] = true;
126
- }
127
- return expectsLowerCase
128
- ? function (val) { return map[val.toLowerCase()]; }
129
- : function (val) { return map[val]; }
130
- }
131
-
132
- /**
133
- * Check if a tag is a built-in tag.
134
- */
135
- var isBuiltInTag = makeMap('slot,component', true);
136
-
137
- /**
138
- * Check if an attribute is a reserved attribute.
139
- */
140
- var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
141
-
142
- /**
143
- * Remove an item from an array.
144
- */
145
- function remove (arr, item) {
146
- if (arr.length) {
147
- var index = arr.indexOf(item);
148
- if (index > -1) {
149
- return arr.splice(index, 1)
150
- }
151
- }
152
- }
153
-
154
- /**
155
- * Check whether an object has the property.
156
- */
157
- var hasOwnProperty = Object.prototype.hasOwnProperty;
158
- function hasOwn (obj, key) {
159
- return hasOwnProperty.call(obj, key)
160
- }
161
-
162
- /**
163
- * Create a cached version of a pure function.
164
- */
165
- function cached (fn) {
166
- var cache = Object.create(null);
167
- return (function cachedFn (str) {
168
- var hit = cache[str];
169
- return hit || (cache[str] = fn(str))
170
- })
171
- }
172
-
173
- /**
174
- * Camelize a hyphen-delimited string.
175
- */
176
- var camelizeRE = /-(\w)/g;
177
- var camelize = cached(function (str) {
178
- return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
179
- });
180
-
181
- /**
182
- * Capitalize a string.
183
- */
184
- var capitalize = cached(function (str) {
185
- return str.charAt(0).toUpperCase() + str.slice(1)
186
- });
187
-
188
- /**
189
- * Hyphenate a camelCase string.
190
- */
191
- var hyphenateRE = /\B([A-Z])/g;
192
- var hyphenate = cached(function (str) {
193
- return str.replace(hyphenateRE, '-$1').toLowerCase()
194
- });
195
-
196
- /**
197
- * Simple bind polyfill for environments that do not support it,
198
- * e.g., PhantomJS 1.x. Technically, we don't need this anymore
199
- * since native bind is now performant enough in most browsers.
200
- * But removing it would mean breaking code that was able to run in
201
- * PhantomJS 1.x, so this must be kept for backward compatibility.
202
- */
203
-
204
- /* istanbul ignore next */
205
- function polyfillBind (fn, ctx) {
206
- function boundFn (a) {
207
- var l = arguments.length;
208
- return l
209
- ? l > 1
210
- ? fn.apply(ctx, arguments)
211
- : fn.call(ctx, a)
212
- : fn.call(ctx)
213
- }
214
-
215
- boundFn._length = fn.length;
216
- return boundFn
217
- }
218
-
219
- function nativeBind (fn, ctx) {
220
- return fn.bind(ctx)
221
- }
222
-
223
- var bind = Function.prototype.bind
224
- ? nativeBind
225
- : polyfillBind;
226
-
227
- /**
228
- * Convert an Array-like object to a real Array.
229
- */
230
- function toArray (list, start) {
231
- start = start || 0;
232
- var i = list.length - start;
233
- var ret = new Array(i);
234
- while (i--) {
235
- ret[i] = list[i + start];
236
- }
237
- return ret
238
- }
239
-
240
- /**
241
- * Mix properties into target object.
242
- */
243
- function extend (to, _from) {
244
- for (var key in _from) {
245
- to[key] = _from[key];
246
- }
247
- return to
248
- }
249
-
250
- /**
251
- * Merge an Array of Objects into a single Object.
252
- */
253
- function toObject (arr) {
254
- var res = {};
255
- for (var i = 0; i < arr.length; i++) {
256
- if (arr[i]) {
257
- extend(res, arr[i]);
258
- }
259
- }
260
- return res
261
- }
262
-
263
- /* eslint-disable no-unused-vars */
264
-
265
- /**
266
- * Perform no operation.
267
- * Stubbing args to make Flow happy without leaving useless transpiled code
268
- * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
269
- */
270
- function noop (a, b, c) {}
271
-
272
- /**
273
- * Always return false.
274
- */
275
- var no = function (a, b, c) { return false; };
276
-
277
- /* eslint-enable no-unused-vars */
278
-
279
- /**
280
- * Return the same value.
281
- */
282
- var identity = function (_) { return _; };
283
-
284
- /**
285
- * Generate a string containing static keys from compiler modules.
286
- */
287
- function genStaticKeys (modules) {
288
- return modules.reduce(function (keys, m) {
289
- return keys.concat(m.staticKeys || [])
290
- }, []).join(',')
291
- }
292
-
293
- /**
294
- * Check if two values are loosely equal - that is,
295
- * if they are plain objects, do they have the same shape?
296
- */
297
- function looseEqual (a, b) {
298
- if (a === b) { return true }
299
- var isObjectA = isObject(a);
300
- var isObjectB = isObject(b);
301
- if (isObjectA && isObjectB) {
302
- try {
303
- var isArrayA = Array.isArray(a);
304
- var isArrayB = Array.isArray(b);
305
- if (isArrayA && isArrayB) {
306
- return a.length === b.length && a.every(function (e, i) {
307
- return looseEqual(e, b[i])
308
- })
309
- } else if (a instanceof Date && b instanceof Date) {
310
- return a.getTime() === b.getTime()
311
- } else if (!isArrayA && !isArrayB) {
312
- var keysA = Object.keys(a);
313
- var keysB = Object.keys(b);
314
- return keysA.length === keysB.length && keysA.every(function (key) {
315
- return looseEqual(a[key], b[key])
316
- })
317
- } else {
318
- /* istanbul ignore next */
319
- return false
320
- }
321
- } catch (e) {
322
- /* istanbul ignore next */
323
- return false
324
- }
325
- } else if (!isObjectA && !isObjectB) {
326
- return String(a) === String(b)
327
- } else {
328
- return false
329
- }
330
- }
331
-
332
- /**
333
- * Return the first index at which a loosely equal value can be
334
- * found in the array (if value is a plain object, the array must
335
- * contain an object of the same shape), or -1 if it is not present.
336
- */
337
- function looseIndexOf (arr, val) {
338
- for (var i = 0; i < arr.length; i++) {
339
- if (looseEqual(arr[i], val)) { return i }
340
- }
341
- return -1
342
- }
343
-
344
- /**
345
- * Ensure a function is called only once.
346
- */
347
- function once (fn) {
348
- var called = false;
349
- return function () {
350
- if (!called) {
351
- called = true;
352
- fn.apply(this, arguments);
353
- }
354
- }
355
- }
356
-
357
- var SSR_ATTR = 'data-server-rendered';
358
-
359
- var ASSET_TYPES = [
360
- 'component',
361
- 'directive',
362
- 'filter'
363
- ];
364
-
365
- var LIFECYCLE_HOOKS = [
366
- 'beforeCreate',
367
- 'created',
368
- 'beforeMount',
369
- 'mounted',
370
- 'beforeUpdate',
371
- 'updated',
372
- 'beforeDestroy',
373
- 'destroyed',
374
- 'activated',
375
- 'deactivated',
376
- 'errorCaptured',
377
- 'serverPrefetch'
378
- ];
379
-
380
- /* */
381
-
382
-
383
-
384
- var config = ({
385
- /**
386
- * Option merge strategies (used in core/util/options)
387
- */
388
- // $flow-disable-line
389
- optionMergeStrategies: Object.create(null),
390
-
391
- /**
392
- * Whether to suppress warnings.
393
- */
394
- silent: false,
395
-
396
- /**
397
- * Show production mode tip message on boot?
398
- */
399
- productionTip: "development" !== 'production',
400
-
401
- /**
402
- * Whether to enable devtools
403
- */
404
- devtools: "development" !== 'production',
405
-
406
- /**
407
- * Whether to record perf
408
- */
409
- performance: false,
410
-
411
- /**
412
- * Error handler for watcher errors
413
- */
414
- errorHandler: null,
415
-
416
- /**
417
- * Warn handler for watcher warns
418
- */
419
- warnHandler: null,
420
-
421
- /**
422
- * Ignore certain custom elements
423
- */
424
- ignoredElements: [],
425
-
426
- /**
427
- * Custom user key aliases for v-on
428
- */
429
- // $flow-disable-line
430
- keyCodes: Object.create(null),
431
-
432
- /**
433
- * Check if a tag is reserved so that it cannot be registered as a
434
- * component. This is platform-dependent and may be overwritten.
435
- */
436
- isReservedTag: no,
437
-
438
- /**
439
- * Check if an attribute is reserved so that it cannot be used as a component
440
- * prop. This is platform-dependent and may be overwritten.
441
- */
442
- isReservedAttr: no,
443
-
444
- /**
445
- * Check if a tag is an unknown element.
446
- * Platform-dependent.
447
- */
448
- isUnknownElement: no,
449
-
450
- /**
451
- * Get the namespace of an element
452
- */
453
- getTagNamespace: noop,
454
-
455
- /**
456
- * Parse the real tag name for the specific platform.
457
- */
458
- parsePlatformTagName: identity,
459
-
460
- /**
461
- * Check if an attribute must be bound using property, e.g. value
462
- * Platform-dependent.
463
- */
464
- mustUseProp: no,
465
-
466
- /**
467
- * Perform updates asynchronously. Intended to be used by Vue Test Utils
468
- * This will significantly reduce performance if set to false.
469
- */
470
- async: true,
471
-
472
- /**
473
- * Exposed for legacy reasons
474
- */
475
- _lifecycleHooks: LIFECYCLE_HOOKS
476
- });
477
-
478
- /* */
479
-
480
- /**
481
- * unicode letters used for parsing html tags, component names and property paths.
482
- * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
483
- * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
484
- */
485
- var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
486
-
487
- /**
488
- * Check if a string starts with $ or _
489
- */
490
- function isReserved (str) {
491
- var c = (str + '').charCodeAt(0);
492
- return c === 0x24 || c === 0x5F
493
- }
494
-
495
- /**
496
- * Define a property.
497
- */
498
- function def (obj, key, val, enumerable) {
499
- Object.defineProperty(obj, key, {
500
- value: val,
501
- enumerable: !!enumerable,
502
- writable: true,
503
- configurable: true
504
- });
505
- }
506
-
507
- /**
508
- * Parse simple path.
509
- */
510
- var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
511
- function parsePath (path) {
512
- if (bailRE.test(path)) {
513
- return
514
- }
515
- var segments = path.split('.');
516
- return function (obj) {
517
- for (var i = 0; i < segments.length; i++) {
518
- if (!obj) { return }
519
- obj = obj[segments[i]];
520
- }
521
- return obj
522
- }
523
- }
524
-
525
- /* */
526
-
527
- // can we use __proto__?
528
- var hasProto = '__proto__' in {};
529
-
530
- // Browser environment sniffing
531
- var inBrowser = typeof window !== 'undefined';
532
- var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
533
- var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
534
- var UA = inBrowser && window.navigator.userAgent.toLowerCase();
535
- var isIE = UA && /msie|trident/.test(UA);
536
- var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
537
- var isEdge = UA && UA.indexOf('edge/') > 0;
538
- var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
539
- var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
540
- var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
541
- var isPhantomJS = UA && /phantomjs/.test(UA);
542
- var isFF = UA && UA.match(/firefox\/(\d+)/);
543
-
544
- // Firefox has a "watch" function on Object.prototype...
545
- var nativeWatch = ({}).watch;
546
-
547
- var supportsPassive = false;
548
- if (inBrowser) {
549
- try {
550
- var opts = {};
551
- Object.defineProperty(opts, 'passive', ({
552
- get: function get () {
553
- /* istanbul ignore next */
554
- supportsPassive = true;
555
- }
556
- })); // https://github.com/facebook/flow/issues/285
557
- window.addEventListener('test-passive', null, opts);
558
- } catch (e) {}
559
- }
560
-
561
- // this needs to be lazy-evaled because vue may be required before
562
- // vue-server-renderer can set VUE_ENV
563
- var _isServer;
564
- var isServerRendering = function () {
565
- if (_isServer === undefined) {
566
- /* istanbul ignore if */
567
- if (!inBrowser && !inWeex && typeof global !== 'undefined') {
568
- // detect presence of vue-server-renderer and avoid
569
- // Webpack shimming the process
570
- _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
571
- } else {
572
- _isServer = false;
573
- }
574
- }
575
- return _isServer
576
- };
577
-
578
- // detect devtools
579
- var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
580
-
581
- /* istanbul ignore next */
582
- function isNative (Ctor) {
583
- return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
584
- }
585
-
586
- var hasSymbol =
587
- typeof Symbol !== 'undefined' && isNative(Symbol) &&
588
- typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
589
-
590
- var _Set;
591
- /* istanbul ignore if */ // $flow-disable-line
592
- if (typeof Set !== 'undefined' && isNative(Set)) {
593
- // use native Set when available.
594
- _Set = Set;
595
- } else {
596
- // a non-standard Set polyfill that only works with primitive keys.
597
- _Set = /*@__PURE__*/(function () {
598
- function Set () {
599
- this.set = Object.create(null);
600
- }
601
- Set.prototype.has = function has (key) {
602
- return this.set[key] === true
603
- };
604
- Set.prototype.add = function add (key) {
605
- this.set[key] = true;
606
- };
607
- Set.prototype.clear = function clear () {
608
- this.set = Object.create(null);
609
- };
610
-
611
- return Set;
612
- }());
613
- }
614
-
615
- /* */
616
-
617
- var warn = noop;
618
- var tip = noop;
619
- var generateComponentTrace = (noop); // work around flow check
620
- var formatComponentName = (noop);
621
-
622
- {
623
- var hasConsole = typeof console !== 'undefined';
624
- var classifyRE = /(?:^|[-_])(\w)/g;
625
- var classify = function (str) { return str
626
- .replace(classifyRE, function (c) { return c.toUpperCase(); })
627
- .replace(/[-_]/g, ''); };
628
-
629
- warn = function (msg, vm) {
630
- var trace = vm ? generateComponentTrace(vm) : '';
631
-
632
- if (config.warnHandler) {
633
- config.warnHandler.call(null, msg, vm, trace);
634
- } else if (hasConsole && (!config.silent)) {
635
- console.error(("[Vue warn]: " + msg + trace));
636
- }
637
- };
638
-
639
- tip = function (msg, vm) {
640
- if (hasConsole && (!config.silent)) {
641
- console.warn("[Vue tip]: " + msg + (
642
- vm ? generateComponentTrace(vm) : ''
643
- ));
644
- }
645
- };
646
-
647
- formatComponentName = function (vm, includeFile) {
648
- if (vm.$root === vm) {
649
- return '<Root>'
650
- }
651
- var options = typeof vm === 'function' && vm.cid != null
652
- ? vm.options
653
- : vm._isVue
654
- ? vm.$options || vm.constructor.options
655
- : vm;
656
- var name = options.name || options._componentTag;
657
- var file = options.__file;
658
- if (!name && file) {
659
- var match = file.match(/([^/\\]+)\.vue$/);
660
- name = match && match[1];
661
- }
662
-
663
- return (
664
- (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
665
- (file && includeFile !== false ? (" at " + file) : '')
666
- )
667
- };
668
-
669
- var repeat = function (str, n) {
670
- var res = '';
671
- while (n) {
672
- if (n % 2 === 1) { res += str; }
673
- if (n > 1) { str += str; }
674
- n >>= 1;
675
- }
676
- return res
677
- };
678
-
679
- generateComponentTrace = function (vm) {
680
- if (vm._isVue && vm.$parent) {
681
- var tree = [];
682
- var currentRecursiveSequence = 0;
683
- while (vm) {
684
- if (tree.length > 0) {
685
- var last = tree[tree.length - 1];
686
- if (last.constructor === vm.constructor) {
687
- currentRecursiveSequence++;
688
- vm = vm.$parent;
689
- continue
690
- } else if (currentRecursiveSequence > 0) {
691
- tree[tree.length - 1] = [last, currentRecursiveSequence];
692
- currentRecursiveSequence = 0;
693
- }
694
- }
695
- tree.push(vm);
696
- vm = vm.$parent;
697
- }
698
- return '\n\nfound in\n\n' + tree
699
- .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
700
- ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
701
- : formatComponentName(vm))); })
702
- .join('\n')
703
- } else {
704
- return ("\n\n(found in " + (formatComponentName(vm)) + ")")
705
- }
706
- };
707
- }
708
-
709
- /* */
710
-
711
- var uid = 0;
712
-
713
- /**
714
- * A dep is an observable that can have multiple
715
- * directives subscribing to it.
716
- */
717
- var Dep = function Dep () {
718
- this.id = uid++;
719
- this.subs = [];
720
- };
721
-
722
- Dep.prototype.addSub = function addSub (sub) {
723
- this.subs.push(sub);
724
- };
725
-
726
- Dep.prototype.removeSub = function removeSub (sub) {
727
- remove(this.subs, sub);
728
- };
729
-
730
- Dep.prototype.depend = function depend () {
731
- if (Dep.target) {
732
- Dep.target.addDep(this);
733
- }
734
- };
735
-
736
- Dep.prototype.notify = function notify () {
737
- // stabilize the subscriber list first
738
- var subs = this.subs.slice();
739
- if (!config.async) {
740
- // subs aren't sorted in scheduler if not running async
741
- // we need to sort them now to make sure they fire in correct
742
- // order
743
- subs.sort(function (a, b) { return a.id - b.id; });
744
- }
745
- for (var i = 0, l = subs.length; i < l; i++) {
746
- subs[i].update();
747
- }
748
- };
749
-
750
- // The current target watcher being evaluated.
751
- // This is globally unique because only one watcher
752
- // can be evaluated at a time.
753
- Dep.target = null;
754
- var targetStack = [];
755
-
756
- function pushTarget (target) {
757
- targetStack.push(target);
758
- Dep.target = target;
759
- }
760
-
761
- function popTarget () {
762
- targetStack.pop();
763
- Dep.target = targetStack[targetStack.length - 1];
764
- }
765
-
766
- /* */
767
-
768
- var VNode = function VNode (
769
- tag,
770
- data,
771
- children,
772
- text,
773
- elm,
774
- context,
775
- componentOptions,
776
- asyncFactory
777
- ) {
778
- this.tag = tag;
779
- this.data = data;
780
- this.children = children;
781
- this.text = text;
782
- this.elm = elm;
783
- this.ns = undefined;
784
- this.context = context;
785
- this.fnContext = undefined;
786
- this.fnOptions = undefined;
787
- this.fnScopeId = undefined;
788
- this.key = data && data.key;
789
- this.componentOptions = componentOptions;
790
- this.componentInstance = undefined;
791
- this.parent = undefined;
792
- this.raw = false;
793
- this.isStatic = false;
794
- this.isRootInsert = true;
795
- this.isComment = false;
796
- this.isCloned = false;
797
- this.isOnce = false;
798
- this.asyncFactory = asyncFactory;
799
- this.asyncMeta = undefined;
800
- this.isAsyncPlaceholder = false;
801
- };
802
-
803
- var prototypeAccessors = { child: { configurable: true } };
804
-
805
- // DEPRECATED: alias for componentInstance for backwards compat.
806
- /* istanbul ignore next */
807
- prototypeAccessors.child.get = function () {
808
- return this.componentInstance
809
- };
810
-
811
- Object.defineProperties( VNode.prototype, prototypeAccessors );
812
-
813
- var createEmptyVNode = function (text) {
814
- if ( text === void 0 ) text = '';
815
-
816
- var node = new VNode();
817
- node.text = text;
818
- node.isComment = true;
819
- return node
820
- };
821
-
822
- function createTextVNode (val) {
823
- return new VNode(undefined, undefined, undefined, String(val))
824
- }
825
-
826
- // optimized shallow clone
827
- // used for static nodes and slot nodes because they may be reused across
828
- // multiple renders, cloning them avoids errors when DOM manipulations rely
829
- // on their elm reference.
830
- function cloneVNode (vnode) {
831
- var cloned = new VNode(
832
- vnode.tag,
833
- vnode.data,
834
- // #7975
835
- // clone children array to avoid mutating original in case of cloning
836
- // a child.
837
- vnode.children && vnode.children.slice(),
838
- vnode.text,
839
- vnode.elm,
840
- vnode.context,
841
- vnode.componentOptions,
842
- vnode.asyncFactory
843
- );
844
- cloned.ns = vnode.ns;
845
- cloned.isStatic = vnode.isStatic;
846
- cloned.key = vnode.key;
847
- cloned.isComment = vnode.isComment;
848
- cloned.fnContext = vnode.fnContext;
849
- cloned.fnOptions = vnode.fnOptions;
850
- cloned.fnScopeId = vnode.fnScopeId;
851
- cloned.asyncMeta = vnode.asyncMeta;
852
- cloned.isCloned = true;
853
- return cloned
854
- }
855
-
856
- /*
857
- * not type checking this file because flow doesn't play well with
858
- * dynamically accessing methods on Array prototype
859
- */
860
-
861
- var arrayProto = Array.prototype;
862
- var arrayMethods = Object.create(arrayProto);
863
-
864
- var methodsToPatch = [
865
- 'push',
866
- 'pop',
867
- 'shift',
868
- 'unshift',
869
- 'splice',
870
- 'sort',
871
- 'reverse'
872
- ];
873
-
874
- /**
875
- * Intercept mutating methods and emit events
876
- */
877
- methodsToPatch.forEach(function (method) {
878
- // cache original method
879
- var original = arrayProto[method];
880
- def(arrayMethods, method, function mutator () {
881
- var args = [], len = arguments.length;
882
- while ( len-- ) args[ len ] = arguments[ len ];
883
-
884
- var result = original.apply(this, args);
885
- var ob = this.__ob__;
886
- var inserted;
887
- switch (method) {
888
- case 'push':
889
- case 'unshift':
890
- inserted = args;
891
- break
892
- case 'splice':
893
- inserted = args.slice(2);
894
- break
895
- }
896
- if (inserted) { ob.observeArray(inserted); }
897
- // notify change
898
- ob.dep.notify();
899
- return result
900
- });
901
- });
902
-
903
- /* */
904
-
905
- var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
906
-
907
- /**
908
- * In some cases we may want to disable observation inside a component's
909
- * update computation.
910
- */
911
- var shouldObserve = true;
912
-
913
- function toggleObserving (value) {
914
- shouldObserve = value;
915
- }
916
-
917
- /**
918
- * Observer class that is attached to each observed
919
- * object. Once attached, the observer converts the target
920
- * object's property keys into getter/setters that
921
- * collect dependencies and dispatch updates.
922
- */
923
- var Observer = function Observer (value) {
924
- this.value = value;
925
- this.dep = new Dep();
926
- this.vmCount = 0;
927
- def(value, '__ob__', this);
928
- if (Array.isArray(value)) {
929
- if (hasProto) {
930
- protoAugment(value, arrayMethods);
931
- } else {
932
- copyAugment(value, arrayMethods, arrayKeys);
933
- }
934
- this.observeArray(value);
935
- } else {
936
- this.walk(value);
937
- }
938
- };
939
-
940
- /**
941
- * Walk through all properties and convert them into
942
- * getter/setters. This method should only be called when
943
- * value type is Object.
944
- */
945
- Observer.prototype.walk = function walk (obj) {
946
- var keys = Object.keys(obj);
947
- for (var i = 0; i < keys.length; i++) {
948
- defineReactive$$1(obj, keys[i]);
949
- }
950
- };
951
-
952
- /**
953
- * Observe a list of Array items.
954
- */
955
- Observer.prototype.observeArray = function observeArray (items) {
956
- for (var i = 0, l = items.length; i < l; i++) {
957
- observe(items[i]);
958
- }
959
- };
960
-
961
- // helpers
962
-
963
- /**
964
- * Augment a target Object or Array by intercepting
965
- * the prototype chain using __proto__
966
- */
967
- function protoAugment (target, src) {
968
- /* eslint-disable no-proto */
969
- target.__proto__ = src;
970
- /* eslint-enable no-proto */
971
- }
972
-
973
- /**
974
- * Augment a target Object or Array by defining
975
- * hidden properties.
976
- */
977
- /* istanbul ignore next */
978
- function copyAugment (target, src, keys) {
979
- for (var i = 0, l = keys.length; i < l; i++) {
980
- var key = keys[i];
981
- def(target, key, src[key]);
982
- }
983
- }
984
-
985
- /**
986
- * Attempt to create an observer instance for a value,
987
- * returns the new observer if successfully observed,
988
- * or the existing observer if the value already has one.
989
- */
990
- function observe (value, asRootData) {
991
- if (!isObject(value) || value instanceof VNode) {
992
- return
993
- }
994
- var ob;
995
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
996
- ob = value.__ob__;
997
- } else if (
998
- shouldObserve &&
999
- !isServerRendering() &&
1000
- (Array.isArray(value) || isPlainObject(value)) &&
1001
- Object.isExtensible(value) &&
1002
- !value._isVue
1003
- ) {
1004
- ob = new Observer(value);
1005
- }
1006
- if (asRootData && ob) {
1007
- ob.vmCount++;
1008
- }
1009
- return ob
1010
- }
1011
-
1012
- /**
1013
- * Define a reactive property on an Object.
1014
- */
1015
- function defineReactive$$1 (
1016
- obj,
1017
- key,
1018
- val,
1019
- customSetter,
1020
- shallow
1021
- ) {
1022
- var dep = new Dep();
1023
-
1024
- var property = Object.getOwnPropertyDescriptor(obj, key);
1025
- if (property && property.configurable === false) {
1026
- return
1027
- }
1028
-
1029
- // cater for pre-defined getter/setters
1030
- var getter = property && property.get;
1031
- var setter = property && property.set;
1032
- if ((!getter || setter) && arguments.length === 2) {
1033
- val = obj[key];
1034
- }
1035
-
1036
- var childOb = !shallow && observe(val);
1037
- Object.defineProperty(obj, key, {
1038
- enumerable: true,
1039
- configurable: true,
1040
- get: function reactiveGetter () {
1041
- var value = getter ? getter.call(obj) : val;
1042
- if (Dep.target) {
1043
- dep.depend();
1044
- if (childOb) {
1045
- childOb.dep.depend();
1046
- if (Array.isArray(value)) {
1047
- dependArray(value);
1048
- }
1049
- }
1050
- }
1051
- return value
1052
- },
1053
- set: function reactiveSetter (newVal) {
1054
- var value = getter ? getter.call(obj) : val;
1055
- /* eslint-disable no-self-compare */
1056
- if (newVal === value || (newVal !== newVal && value !== value)) {
1057
- return
1058
- }
1059
- /* eslint-enable no-self-compare */
1060
- if (customSetter) {
1061
- customSetter();
1062
- }
1063
- // #7981: for accessor properties without setter
1064
- if (getter && !setter) { return }
1065
- if (setter) {
1066
- setter.call(obj, newVal);
1067
- } else {
1068
- val = newVal;
1069
- }
1070
- childOb = !shallow && observe(newVal);
1071
- dep.notify();
1072
- }
1073
- });
1074
- }
1075
-
1076
- /**
1077
- * Set a property on an object. Adds the new property and
1078
- * triggers change notification if the property doesn't
1079
- * already exist.
1080
- */
1081
- function set (target, key, val) {
1082
- if (isUndef(target) || isPrimitive(target)
1083
- ) {
1084
- warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
1085
- }
1086
- if (Array.isArray(target) && isValidArrayIndex(key)) {
1087
- target.length = Math.max(target.length, key);
1088
- target.splice(key, 1, val);
1089
- return val
1090
- }
1091
- if (key in target && !(key in Object.prototype)) {
1092
- target[key] = val;
1093
- return val
1094
- }
1095
- var ob = (target).__ob__;
1096
- if (target._isVue || (ob && ob.vmCount)) {
1097
- warn(
1098
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
1099
- 'at runtime - declare it upfront in the data option.'
1100
- );
1101
- return val
1102
- }
1103
- if (!ob) {
1104
- target[key] = val;
1105
- return val
1106
- }
1107
- defineReactive$$1(ob.value, key, val);
1108
- ob.dep.notify();
1109
- return val
1110
- }
1111
-
1112
- /**
1113
- * Delete a property and trigger change if necessary.
1114
- */
1115
- function del (target, key) {
1116
- if (isUndef(target) || isPrimitive(target)
1117
- ) {
1118
- warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
1119
- }
1120
- if (Array.isArray(target) && isValidArrayIndex(key)) {
1121
- target.splice(key, 1);
1122
- return
1123
- }
1124
- var ob = (target).__ob__;
1125
- if (target._isVue || (ob && ob.vmCount)) {
1126
- warn(
1127
- 'Avoid deleting properties on a Vue instance or its root $data ' +
1128
- '- just set it to null.'
1129
- );
1130
- return
1131
- }
1132
- if (!hasOwn(target, key)) {
1133
- return
1134
- }
1135
- delete target[key];
1136
- if (!ob) {
1137
- return
1138
- }
1139
- ob.dep.notify();
1140
- }
1141
-
1142
- /**
1143
- * Collect dependencies on array elements when the array is touched, since
1144
- * we cannot intercept array element access like property getters.
1145
- */
1146
- function dependArray (value) {
1147
- for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
1148
- e = value[i];
1149
- e && e.__ob__ && e.__ob__.dep.depend();
1150
- if (Array.isArray(e)) {
1151
- dependArray(e);
1152
- }
1153
- }
1154
- }
1155
-
1156
- /* */
1157
-
1158
- /**
1159
- * Option overwriting strategies are functions that handle
1160
- * how to merge a parent option value and a child option
1161
- * value into the final value.
1162
- */
1163
- var strats = config.optionMergeStrategies;
1164
-
1165
- /**
1166
- * Options with restrictions
1167
- */
1168
- {
1169
- strats.el = strats.propsData = function (parent, child, vm, key) {
1170
- if (!vm) {
1171
- warn(
1172
- "option \"" + key + "\" can only be used during instance " +
1173
- 'creation with the `new` keyword.'
1174
- );
1175
- }
1176
- return defaultStrat(parent, child)
1177
- };
1178
- }
1179
-
1180
- /**
1181
- * Helper that recursively merges two data objects together.
1182
- */
1183
- function mergeData (to, from) {
1184
- if (!from) { return to }
1185
- var key, toVal, fromVal;
1186
-
1187
- var keys = hasSymbol
1188
- ? Reflect.ownKeys(from)
1189
- : Object.keys(from);
1190
-
1191
- for (var i = 0; i < keys.length; i++) {
1192
- key = keys[i];
1193
- // in case the object is already observed...
1194
- if (key === '__ob__') { continue }
1195
- toVal = to[key];
1196
- fromVal = from[key];
1197
- if (!hasOwn(to, key)) {
1198
- set(to, key, fromVal);
1199
- } else if (
1200
- toVal !== fromVal &&
1201
- isPlainObject(toVal) &&
1202
- isPlainObject(fromVal)
1203
- ) {
1204
- mergeData(toVal, fromVal);
1205
- }
1206
- }
1207
- return to
1208
- }
1209
-
1210
- /**
1211
- * Data
1212
- */
1213
- function mergeDataOrFn (
1214
- parentVal,
1215
- childVal,
1216
- vm
1217
- ) {
1218
- if (!vm) {
1219
- // in a Vue.extend merge, both should be functions
1220
- if (!childVal) {
1221
- return parentVal
1222
- }
1223
- if (!parentVal) {
1224
- return childVal
1225
- }
1226
- // when parentVal & childVal are both present,
1227
- // we need to return a function that returns the
1228
- // merged result of both functions... no need to
1229
- // check if parentVal is a function here because
1230
- // it has to be a function to pass previous merges.
1231
- return function mergedDataFn () {
1232
- return mergeData(
1233
- typeof childVal === 'function' ? childVal.call(this, this) : childVal,
1234
- typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
1235
- )
1236
- }
1237
- } else {
1238
- return function mergedInstanceDataFn () {
1239
- // instance merge
1240
- var instanceData = typeof childVal === 'function'
1241
- ? childVal.call(vm, vm)
1242
- : childVal;
1243
- var defaultData = typeof parentVal === 'function'
1244
- ? parentVal.call(vm, vm)
1245
- : parentVal;
1246
- if (instanceData) {
1247
- return mergeData(instanceData, defaultData)
1248
- } else {
1249
- return defaultData
1250
- }
1251
- }
1252
- }
1253
- }
1254
-
1255
- strats.data = function (
1256
- parentVal,
1257
- childVal,
1258
- vm
1259
- ) {
1260
- if (!vm) {
1261
- if (childVal && typeof childVal !== 'function') {
1262
- warn(
1263
- 'The "data" option should be a function ' +
1264
- 'that returns a per-instance value in component ' +
1265
- 'definitions.',
1266
- vm
1267
- );
1268
-
1269
- return parentVal
1270
- }
1271
- return mergeDataOrFn(parentVal, childVal)
1272
- }
1273
-
1274
- return mergeDataOrFn(parentVal, childVal, vm)
1275
- };
1276
-
1277
- /**
1278
- * Hooks and props are merged as arrays.
1279
- */
1280
- function mergeHook (
1281
- parentVal,
1282
- childVal
1283
- ) {
1284
- var res = childVal
1285
- ? parentVal
1286
- ? parentVal.concat(childVal)
1287
- : Array.isArray(childVal)
1288
- ? childVal
1289
- : [childVal]
1290
- : parentVal;
1291
- return res
1292
- ? dedupeHooks(res)
1293
- : res
1294
- }
1295
-
1296
- function dedupeHooks (hooks) {
1297
- var res = [];
1298
- for (var i = 0; i < hooks.length; i++) {
1299
- if (res.indexOf(hooks[i]) === -1) {
1300
- res.push(hooks[i]);
1301
- }
1302
- }
1303
- return res
1304
- }
1305
-
1306
- LIFECYCLE_HOOKS.forEach(function (hook) {
1307
- strats[hook] = mergeHook;
1308
- });
1309
-
1310
- /**
1311
- * Assets
1312
- *
1313
- * When a vm is present (instance creation), we need to do
1314
- * a three-way merge between constructor options, instance
1315
- * options and parent options.
1316
- */
1317
- function mergeAssets (
1318
- parentVal,
1319
- childVal,
1320
- vm,
1321
- key
1322
- ) {
1323
- var res = Object.create(parentVal || null);
1324
- if (childVal) {
1325
- assertObjectType(key, childVal, vm);
1326
- return extend(res, childVal)
1327
- } else {
1328
- return res
1329
- }
1330
- }
1331
-
1332
- ASSET_TYPES.forEach(function (type) {
1333
- strats[type + 's'] = mergeAssets;
1334
- });
1335
-
1336
- /**
1337
- * Watchers.
1338
- *
1339
- * Watchers hashes should not overwrite one
1340
- * another, so we merge them as arrays.
1341
- */
1342
- strats.watch = function (
1343
- parentVal,
1344
- childVal,
1345
- vm,
1346
- key
1347
- ) {
1348
- // work around Firefox's Object.prototype.watch...
1349
- if (parentVal === nativeWatch) { parentVal = undefined; }
1350
- if (childVal === nativeWatch) { childVal = undefined; }
1351
- /* istanbul ignore if */
1352
- if (!childVal) { return Object.create(parentVal || null) }
1353
- {
1354
- assertObjectType(key, childVal, vm);
1355
- }
1356
- if (!parentVal) { return childVal }
1357
- var ret = {};
1358
- extend(ret, parentVal);
1359
- for (var key$1 in childVal) {
1360
- var parent = ret[key$1];
1361
- var child = childVal[key$1];
1362
- if (parent && !Array.isArray(parent)) {
1363
- parent = [parent];
1364
- }
1365
- ret[key$1] = parent
1366
- ? parent.concat(child)
1367
- : Array.isArray(child) ? child : [child];
1368
- }
1369
- return ret
1370
- };
1371
-
1372
- /**
1373
- * Other object hashes.
1374
- */
1375
- strats.props =
1376
- strats.methods =
1377
- strats.inject =
1378
- strats.computed = function (
1379
- parentVal,
1380
- childVal,
1381
- vm,
1382
- key
1383
- ) {
1384
- if (childVal && "development" !== 'production') {
1385
- assertObjectType(key, childVal, vm);
1386
- }
1387
- if (!parentVal) { return childVal }
1388
- var ret = Object.create(null);
1389
- extend(ret, parentVal);
1390
- if (childVal) { extend(ret, childVal); }
1391
- return ret
1392
- };
1393
- strats.provide = mergeDataOrFn;
1394
-
1395
- /**
1396
- * Default strategy.
1397
- */
1398
- var defaultStrat = function (parentVal, childVal) {
1399
- return childVal === undefined
1400
- ? parentVal
1401
- : childVal
1402
- };
1403
-
1404
- /**
1405
- * Validate component names
1406
- */
1407
- function checkComponents (options) {
1408
- for (var key in options.components) {
1409
- validateComponentName(key);
1410
- }
1411
- }
1412
-
1413
- function validateComponentName (name) {
1414
- if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
1415
- warn(
1416
- 'Invalid component name: "' + name + '". Component names ' +
1417
- 'should conform to valid custom element name in html5 specification.'
1418
- );
1419
- }
1420
- if (isBuiltInTag(name) || config.isReservedTag(name)) {
1421
- warn(
1422
- 'Do not use built-in or reserved HTML elements as component ' +
1423
- 'id: ' + name
1424
- );
1425
- }
1426
- }
1427
-
1428
- /**
1429
- * Ensure all props option syntax are normalized into the
1430
- * Object-based format.
1431
- */
1432
- function normalizeProps (options, vm) {
1433
- var props = options.props;
1434
- if (!props) { return }
1435
- var res = {};
1436
- var i, val, name;
1437
- if (Array.isArray(props)) {
1438
- i = props.length;
1439
- while (i--) {
1440
- val = props[i];
1441
- if (typeof val === 'string') {
1442
- name = camelize(val);
1443
- res[name] = { type: null };
1444
- } else {
1445
- warn('props must be strings when using array syntax.');
1446
- }
1447
- }
1448
- } else if (isPlainObject(props)) {
1449
- for (var key in props) {
1450
- val = props[key];
1451
- name = camelize(key);
1452
- res[name] = isPlainObject(val)
1453
- ? val
1454
- : { type: val };
1455
- }
1456
- } else {
1457
- warn(
1458
- "Invalid value for option \"props\": expected an Array or an Object, " +
1459
- "but got " + (toRawType(props)) + ".",
1460
- vm
1461
- );
1462
- }
1463
- options.props = res;
1464
- }
1465
-
1466
- /**
1467
- * Normalize all injections into Object-based format
1468
- */
1469
- function normalizeInject (options, vm) {
1470
- var inject = options.inject;
1471
- if (!inject) { return }
1472
- var normalized = options.inject = {};
1473
- if (Array.isArray(inject)) {
1474
- for (var i = 0; i < inject.length; i++) {
1475
- normalized[inject[i]] = { from: inject[i] };
1476
- }
1477
- } else if (isPlainObject(inject)) {
1478
- for (var key in inject) {
1479
- var val = inject[key];
1480
- normalized[key] = isPlainObject(val)
1481
- ? extend({ from: key }, val)
1482
- : { from: val };
1483
- }
1484
- } else {
1485
- warn(
1486
- "Invalid value for option \"inject\": expected an Array or an Object, " +
1487
- "but got " + (toRawType(inject)) + ".",
1488
- vm
1489
- );
1490
- }
1491
- }
1492
-
1493
- /**
1494
- * Normalize raw function directives into object format.
1495
- */
1496
- function normalizeDirectives (options) {
1497
- var dirs = options.directives;
1498
- if (dirs) {
1499
- for (var key in dirs) {
1500
- var def$$1 = dirs[key];
1501
- if (typeof def$$1 === 'function') {
1502
- dirs[key] = { bind: def$$1, update: def$$1 };
1503
- }
1504
- }
1505
- }
1506
- }
1507
-
1508
- function assertObjectType (name, value, vm) {
1509
- if (!isPlainObject(value)) {
1510
- warn(
1511
- "Invalid value for option \"" + name + "\": expected an Object, " +
1512
- "but got " + (toRawType(value)) + ".",
1513
- vm
1514
- );
1515
- }
1516
- }
1517
-
1518
- /**
1519
- * Merge two option objects into a new one.
1520
- * Core utility used in both instantiation and inheritance.
1521
- */
1522
- function mergeOptions (
1523
- parent,
1524
- child,
1525
- vm
1526
- ) {
1527
- {
1528
- checkComponents(child);
1529
- }
1530
-
1531
- if (typeof child === 'function') {
1532
- child = child.options;
1533
- }
1534
-
1535
- normalizeProps(child, vm);
1536
- normalizeInject(child, vm);
1537
- normalizeDirectives(child);
1538
-
1539
- // Apply extends and mixins on the child options,
1540
- // but only if it is a raw options object that isn't
1541
- // the result of another mergeOptions call.
1542
- // Only merged options has the _base property.
1543
- if (!child._base) {
1544
- if (child.extends) {
1545
- parent = mergeOptions(parent, child.extends, vm);
1546
- }
1547
- if (child.mixins) {
1548
- for (var i = 0, l = child.mixins.length; i < l; i++) {
1549
- parent = mergeOptions(parent, child.mixins[i], vm);
1550
- }
1551
- }
1552
- }
1553
-
1554
- var options = {};
1555
- var key;
1556
- for (key in parent) {
1557
- mergeField(key);
1558
- }
1559
- for (key in child) {
1560
- if (!hasOwn(parent, key)) {
1561
- mergeField(key);
1562
- }
1563
- }
1564
- function mergeField (key) {
1565
- var strat = strats[key] || defaultStrat;
1566
- options[key] = strat(parent[key], child[key], vm, key);
1567
- }
1568
- return options
1569
- }
1570
-
1571
- /**
1572
- * Resolve an asset.
1573
- * This function is used because child instances need access
1574
- * to assets defined in its ancestor chain.
1575
- */
1576
- function resolveAsset (
1577
- options,
1578
- type,
1579
- id,
1580
- warnMissing
1581
- ) {
1582
- /* istanbul ignore if */
1583
- if (typeof id !== 'string') {
1584
- return
1585
- }
1586
- var assets = options[type];
1587
- // check local registration variations first
1588
- if (hasOwn(assets, id)) { return assets[id] }
1589
- var camelizedId = camelize(id);
1590
- if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
1591
- var PascalCaseId = capitalize(camelizedId);
1592
- if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
1593
- // fallback to prototype chain
1594
- var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
1595
- if (warnMissing && !res) {
1596
- warn(
1597
- 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
1598
- options
1599
- );
1600
- }
1601
- return res
1602
- }
1603
-
1604
- /* */
1605
-
1606
-
1607
-
1608
- function validateProp (
1609
- key,
1610
- propOptions,
1611
- propsData,
1612
- vm
1613
- ) {
1614
- var prop = propOptions[key];
1615
- var absent = !hasOwn(propsData, key);
1616
- var value = propsData[key];
1617
- // boolean casting
1618
- var booleanIndex = getTypeIndex(Boolean, prop.type);
1619
- if (booleanIndex > -1) {
1620
- if (absent && !hasOwn(prop, 'default')) {
1621
- value = false;
1622
- } else if (value === '' || value === hyphenate(key)) {
1623
- // only cast empty string / same name to boolean if
1624
- // boolean has higher priority
1625
- var stringIndex = getTypeIndex(String, prop.type);
1626
- if (stringIndex < 0 || booleanIndex < stringIndex) {
1627
- value = true;
1628
- }
1629
- }
1630
- }
1631
- // check default value
1632
- if (value === undefined) {
1633
- value = getPropDefaultValue(vm, prop, key);
1634
- // since the default value is a fresh copy,
1635
- // make sure to observe it.
1636
- var prevShouldObserve = shouldObserve;
1637
- toggleObserving(true);
1638
- observe(value);
1639
- toggleObserving(prevShouldObserve);
1640
- }
1641
- {
1642
- assertProp(prop, key, value, vm, absent);
1643
- }
1644
- return value
1645
- }
1646
-
1647
- /**
1648
- * Get the default value of a prop.
1649
- */
1650
- function getPropDefaultValue (vm, prop, key) {
1651
- // no default, return undefined
1652
- if (!hasOwn(prop, 'default')) {
1653
- return undefined
1654
- }
1655
- var def = prop.default;
1656
- // warn against non-factory defaults for Object & Array
1657
- if (isObject(def)) {
1658
- warn(
1659
- 'Invalid default value for prop "' + key + '": ' +
1660
- 'Props with type Object/Array must use a factory function ' +
1661
- 'to return the default value.',
1662
- vm
1663
- );
1664
- }
1665
- // the raw prop value was also undefined from previous render,
1666
- // return previous default value to avoid unnecessary watcher trigger
1667
- if (vm && vm.$options.propsData &&
1668
- vm.$options.propsData[key] === undefined &&
1669
- vm._props[key] !== undefined
1670
- ) {
1671
- return vm._props[key]
1672
- }
1673
- // call factory function for non-Function types
1674
- // a value is Function if its prototype is function even across different execution context
1675
- return typeof def === 'function' && getType(prop.type) !== 'Function'
1676
- ? def.call(vm)
1677
- : def
1678
- }
1679
-
1680
- /**
1681
- * Assert whether a prop is valid.
1682
- */
1683
- function assertProp (
1684
- prop,
1685
- name,
1686
- value,
1687
- vm,
1688
- absent
1689
- ) {
1690
- if (prop.required && absent) {
1691
- warn(
1692
- 'Missing required prop: "' + name + '"',
1693
- vm
1694
- );
1695
- return
1696
- }
1697
- if (value == null && !prop.required) {
1698
- return
1699
- }
1700
- var type = prop.type;
1701
- var valid = !type || type === true;
1702
- var expectedTypes = [];
1703
- if (type) {
1704
- if (!Array.isArray(type)) {
1705
- type = [type];
1706
- }
1707
- for (var i = 0; i < type.length && !valid; i++) {
1708
- var assertedType = assertType(value, type[i]);
1709
- expectedTypes.push(assertedType.expectedType || '');
1710
- valid = assertedType.valid;
1711
- }
1712
- }
1713
-
1714
- if (!valid) {
1715
- warn(
1716
- getInvalidTypeMessage(name, value, expectedTypes),
1717
- vm
1718
- );
1719
- return
1720
- }
1721
- var validator = prop.validator;
1722
- if (validator) {
1723
- if (!validator(value)) {
1724
- warn(
1725
- 'Invalid prop: custom validator check failed for prop "' + name + '".',
1726
- vm
1727
- );
1728
- }
1729
- }
1730
- }
1731
-
1732
- var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
1733
-
1734
- function assertType (value, type) {
1735
- var valid;
1736
- var expectedType = getType(type);
1737
- if (simpleCheckRE.test(expectedType)) {
1738
- var t = typeof value;
1739
- valid = t === expectedType.toLowerCase();
1740
- // for primitive wrapper objects
1741
- if (!valid && t === 'object') {
1742
- valid = value instanceof type;
1743
- }
1744
- } else if (expectedType === 'Object') {
1745
- valid = isPlainObject(value);
1746
- } else if (expectedType === 'Array') {
1747
- valid = Array.isArray(value);
1748
- } else {
1749
- valid = value instanceof type;
1750
- }
1751
- return {
1752
- valid: valid,
1753
- expectedType: expectedType
1754
- }
1755
- }
1756
-
1757
- /**
1758
- * Use function string name to check built-in types,
1759
- * because a simple equality check will fail when running
1760
- * across different vms / iframes.
1761
- */
1762
- function getType (fn) {
1763
- var match = fn && fn.toString().match(/^\s*function (\w+)/);
1764
- return match ? match[1] : ''
1765
- }
1766
-
1767
- function isSameType (a, b) {
1768
- return getType(a) === getType(b)
1769
- }
1770
-
1771
- function getTypeIndex (type, expectedTypes) {
1772
- if (!Array.isArray(expectedTypes)) {
1773
- return isSameType(expectedTypes, type) ? 0 : -1
1774
- }
1775
- for (var i = 0, len = expectedTypes.length; i < len; i++) {
1776
- if (isSameType(expectedTypes[i], type)) {
1777
- return i
1778
- }
1779
- }
1780
- return -1
1781
- }
1782
-
1783
- function getInvalidTypeMessage (name, value, expectedTypes) {
1784
- var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
1785
- " Expected " + (expectedTypes.map(capitalize).join(', '));
1786
- var expectedType = expectedTypes[0];
1787
- var receivedType = toRawType(value);
1788
- var expectedValue = styleValue(value, expectedType);
1789
- var receivedValue = styleValue(value, receivedType);
1790
- // check if we need to specify expected value
1791
- if (expectedTypes.length === 1 &&
1792
- isExplicable(expectedType) &&
1793
- !isBoolean(expectedType, receivedType)) {
1794
- message += " with value " + expectedValue;
1795
- }
1796
- message += ", got " + receivedType + " ";
1797
- // check if we need to specify received value
1798
- if (isExplicable(receivedType)) {
1799
- message += "with value " + receivedValue + ".";
1800
- }
1801
- return message
1802
- }
1803
-
1804
- function styleValue (value, type) {
1805
- if (type === 'String') {
1806
- return ("\"" + value + "\"")
1807
- } else if (type === 'Number') {
1808
- return ("" + (Number(value)))
1809
- } else {
1810
- return ("" + value)
1811
- }
1812
- }
1813
-
1814
- function isExplicable (value) {
1815
- var explicitTypes = ['string', 'number', 'boolean'];
1816
- return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
1817
- }
1818
-
1819
- function isBoolean () {
1820
- var args = [], len = arguments.length;
1821
- while ( len-- ) args[ len ] = arguments[ len ];
1822
-
1823
- return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
1824
- }
1825
-
1826
- /* */
1827
-
1828
- function handleError (err, vm, info) {
1829
- // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
1830
- // See: https://github.com/vuejs/vuex/issues/1505
1831
- pushTarget();
1832
- try {
1833
- if (vm) {
1834
- var cur = vm;
1835
- while ((cur = cur.$parent)) {
1836
- var hooks = cur.$options.errorCaptured;
1837
- if (hooks) {
1838
- for (var i = 0; i < hooks.length; i++) {
1839
- try {
1840
- var capture = hooks[i].call(cur, err, vm, info) === false;
1841
- if (capture) { return }
1842
- } catch (e) {
1843
- globalHandleError(e, cur, 'errorCaptured hook');
1844
- }
1845
- }
1846
- }
1847
- }
1848
- }
1849
- globalHandleError(err, vm, info);
1850
- } finally {
1851
- popTarget();
1852
- }
1853
- }
1854
-
1855
- function invokeWithErrorHandling (
1856
- handler,
1857
- context,
1858
- args,
1859
- vm,
1860
- info
1861
- ) {
1862
- var res;
1863
- try {
1864
- res = args ? handler.apply(context, args) : handler.call(context);
1865
- if (res && !res._isVue && isPromise(res) && !res._handled) {
1866
- res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
1867
- // issue #9511
1868
- // avoid catch triggering multiple times when nested calls
1869
- res._handled = true;
1870
- }
1871
- } catch (e) {
1872
- handleError(e, vm, info);
1873
- }
1874
- return res
1875
- }
1876
-
1877
- function globalHandleError (err, vm, info) {
1878
- if (config.errorHandler) {
1879
- try {
1880
- return config.errorHandler.call(null, err, vm, info)
1881
- } catch (e) {
1882
- // if the user intentionally throws the original error in the handler,
1883
- // do not log it twice
1884
- if (e !== err) {
1885
- logError(e, null, 'config.errorHandler');
1886
- }
1887
- }
1888
- }
1889
- logError(err, vm, info);
1890
- }
1891
-
1892
- function logError (err, vm, info) {
1893
- {
1894
- warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
1895
- }
1896
- /* istanbul ignore else */
1897
- if ((inBrowser || inWeex) && typeof console !== 'undefined') {
1898
- console.error(err);
1899
- } else {
1900
- throw err
1901
- }
1902
- }
1903
-
1904
- /* */
1905
-
1906
- var isUsingMicroTask = false;
1907
-
1908
- var callbacks = [];
1909
- var pending = false;
1910
-
1911
- function flushCallbacks () {
1912
- pending = false;
1913
- var copies = callbacks.slice(0);
1914
- callbacks.length = 0;
1915
- for (var i = 0; i < copies.length; i++) {
1916
- copies[i]();
1917
- }
1918
- }
1919
-
1920
- // Here we have async deferring wrappers using microtasks.
1921
- // In 2.5 we used (macro) tasks (in combination with microtasks).
1922
- // However, it has subtle problems when state is changed right before repaint
1923
- // (e.g. #6813, out-in transitions).
1924
- // Also, using (macro) tasks in event handler would cause some weird behaviors
1925
- // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
1926
- // So we now use microtasks everywhere, again.
1927
- // A major drawback of this tradeoff is that there are some scenarios
1928
- // where microtasks have too high a priority and fire in between supposedly
1929
- // sequential events (e.g. #4521, #6690, which have workarounds)
1930
- // or even between bubbling of the same event (#6566).
1931
- var timerFunc;
1932
-
1933
- // The nextTick behavior leverages the microtask queue, which can be accessed
1934
- // via either native Promise.then or MutationObserver.
1935
- // MutationObserver has wider support, however it is seriously bugged in
1936
- // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
1937
- // completely stops working after triggering a few times... so, if native
1938
- // Promise is available, we will use it:
1939
- /* istanbul ignore next, $flow-disable-line */
1940
- if (typeof Promise !== 'undefined' && isNative(Promise)) {
1941
- var p = Promise.resolve();
1942
- timerFunc = function () {
1943
- p.then(flushCallbacks);
1944
- // In problematic UIWebViews, Promise.then doesn't completely break, but
1945
- // it can get stuck in a weird state where callbacks are pushed into the
1946
- // microtask queue but the queue isn't being flushed, until the browser
1947
- // needs to do some other work, e.g. handle a timer. Therefore we can
1948
- // "force" the microtask queue to be flushed by adding an empty timer.
1949
- if (isIOS) { setTimeout(noop); }
1950
- };
1951
- isUsingMicroTask = true;
1952
- } else if (!isIE && typeof MutationObserver !== 'undefined' && (
1953
- isNative(MutationObserver) ||
1954
- // PhantomJS and iOS 7.x
1955
- MutationObserver.toString() === '[object MutationObserverConstructor]'
1956
- )) {
1957
- // Use MutationObserver where native Promise is not available,
1958
- // e.g. PhantomJS, iOS7, Android 4.4
1959
- // (#6466 MutationObserver is unreliable in IE11)
1960
- var counter = 1;
1961
- var observer = new MutationObserver(flushCallbacks);
1962
- var textNode = document.createTextNode(String(counter));
1963
- observer.observe(textNode, {
1964
- characterData: true
1965
- });
1966
- timerFunc = function () {
1967
- counter = (counter + 1) % 2;
1968
- textNode.data = String(counter);
1969
- };
1970
- isUsingMicroTask = true;
1971
- } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
1972
- // Fallback to setImmediate.
1973
- // Techinically it leverages the (macro) task queue,
1974
- // but it is still a better choice than setTimeout.
1975
- timerFunc = function () {
1976
- setImmediate(flushCallbacks);
1977
- };
1978
- } else {
1979
- // Fallback to setTimeout.
1980
- timerFunc = function () {
1981
- setTimeout(flushCallbacks, 0);
1982
- };
1983
- }
1984
-
1985
- function nextTick (cb, ctx) {
1986
- var _resolve;
1987
- callbacks.push(function () {
1988
- if (cb) {
1989
- try {
1990
- cb.call(ctx);
1991
- } catch (e) {
1992
- handleError(e, ctx, 'nextTick');
1993
- }
1994
- } else if (_resolve) {
1995
- _resolve(ctx);
1996
- }
1997
- });
1998
- if (!pending) {
1999
- pending = true;
2000
- timerFunc();
2001
- }
2002
- // $flow-disable-line
2003
- if (!cb && typeof Promise !== 'undefined') {
2004
- return new Promise(function (resolve) {
2005
- _resolve = resolve;
2006
- })
2007
- }
2008
- }
2009
-
2010
- /* */
2011
-
2012
- var mark;
2013
- var measure;
2014
-
2015
- {
2016
- var perf = inBrowser && window.performance;
2017
- /* istanbul ignore if */
2018
- if (
2019
- perf &&
2020
- perf.mark &&
2021
- perf.measure &&
2022
- perf.clearMarks &&
2023
- perf.clearMeasures
2024
- ) {
2025
- mark = function (tag) { return perf.mark(tag); };
2026
- measure = function (name, startTag, endTag) {
2027
- perf.measure(name, startTag, endTag);
2028
- perf.clearMarks(startTag);
2029
- perf.clearMarks(endTag);
2030
- // perf.clearMeasures(name)
2031
- };
2032
- }
2033
- }
2034
-
2035
- /* not type checking this file because flow doesn't play well with Proxy */
2036
-
2037
- var initProxy;
2038
-
2039
- {
2040
- var allowedGlobals = makeMap(
2041
- 'Infinity,undefined,NaN,isFinite,isNaN,' +
2042
- 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
2043
- 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
2044
- 'require' // for Webpack/Browserify
2045
- );
2046
-
2047
- var warnNonPresent = function (target, key) {
2048
- warn(
2049
- "Property or method \"" + key + "\" is not defined on the instance but " +
2050
- 'referenced during render. Make sure that this property is reactive, ' +
2051
- 'either in the data option, or for class-based components, by ' +
2052
- 'initializing the property. ' +
2053
- 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
2054
- target
2055
- );
2056
- };
2057
-
2058
- var warnReservedPrefix = function (target, key) {
2059
- warn(
2060
- "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
2061
- 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
2062
- 'prevent conflicts with Vue internals' +
2063
- 'See: https://vuejs.org/v2/api/#data',
2064
- target
2065
- );
2066
- };
2067
-
2068
- var hasProxy =
2069
- typeof Proxy !== 'undefined' && isNative(Proxy);
2070
-
2071
- if (hasProxy) {
2072
- var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
2073
- config.keyCodes = new Proxy(config.keyCodes, {
2074
- set: function set (target, key, value) {
2075
- if (isBuiltInModifier(key)) {
2076
- warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
2077
- return false
2078
- } else {
2079
- target[key] = value;
2080
- return true
2081
- }
2082
- }
2083
- });
2084
- }
2085
-
2086
- var hasHandler = {
2087
- has: function has (target, key) {
2088
- var has = key in target;
2089
- var isAllowed = allowedGlobals(key) ||
2090
- (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
2091
- if (!has && !isAllowed) {
2092
- if (key in target.$data) { warnReservedPrefix(target, key); }
2093
- else { warnNonPresent(target, key); }
2094
- }
2095
- return has || !isAllowed
2096
- }
2097
- };
2098
-
2099
- var getHandler = {
2100
- get: function get (target, key) {
2101
- if (typeof key === 'string' && !(key in target)) {
2102
- if (key in target.$data) { warnReservedPrefix(target, key); }
2103
- else { warnNonPresent(target, key); }
2104
- }
2105
- return target[key]
2106
- }
2107
- };
2108
-
2109
- initProxy = function initProxy (vm) {
2110
- if (hasProxy) {
2111
- // determine which proxy handler to use
2112
- var options = vm.$options;
2113
- var handlers = options.render && options.render._withStripped
2114
- ? getHandler
2115
- : hasHandler;
2116
- vm._renderProxy = new Proxy(vm, handlers);
2117
- } else {
2118
- vm._renderProxy = vm;
2119
- }
2120
- };
2121
- }
2122
-
2123
- /* */
2124
-
2125
- var seenObjects = new _Set();
2126
-
2127
- /**
2128
- * Recursively traverse an object to evoke all converted
2129
- * getters, so that every nested property inside the object
2130
- * is collected as a "deep" dependency.
2131
- */
2132
- function traverse (val) {
2133
- _traverse(val, seenObjects);
2134
- seenObjects.clear();
2135
- }
2136
-
2137
- function _traverse (val, seen) {
2138
- var i, keys;
2139
- var isA = Array.isArray(val);
2140
- if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
2141
- return
2142
- }
2143
- if (val.__ob__) {
2144
- var depId = val.__ob__.dep.id;
2145
- if (seen.has(depId)) {
2146
- return
2147
- }
2148
- seen.add(depId);
2149
- }
2150
- if (isA) {
2151
- i = val.length;
2152
- while (i--) { _traverse(val[i], seen); }
2153
- } else {
2154
- keys = Object.keys(val);
2155
- i = keys.length;
2156
- while (i--) { _traverse(val[keys[i]], seen); }
2157
- }
2158
- }
2159
-
2160
- /* */
2161
-
2162
- var normalizeEvent = cached(function (name) {
2163
- var passive = name.charAt(0) === '&';
2164
- name = passive ? name.slice(1) : name;
2165
- var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
2166
- name = once$$1 ? name.slice(1) : name;
2167
- var capture = name.charAt(0) === '!';
2168
- name = capture ? name.slice(1) : name;
2169
- return {
2170
- name: name,
2171
- once: once$$1,
2172
- capture: capture,
2173
- passive: passive
2174
- }
2175
- });
2176
-
2177
- function createFnInvoker (fns, vm) {
2178
- function invoker () {
2179
- var arguments$1 = arguments;
2180
-
2181
- var fns = invoker.fns;
2182
- if (Array.isArray(fns)) {
2183
- var cloned = fns.slice();
2184
- for (var i = 0; i < cloned.length; i++) {
2185
- invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
2186
- }
2187
- } else {
2188
- // return handler return value for single handlers
2189
- return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
2190
- }
2191
- }
2192
- invoker.fns = fns;
2193
- return invoker
2194
- }
2195
-
2196
- function updateListeners (
2197
- on,
2198
- oldOn,
2199
- add,
2200
- remove$$1,
2201
- createOnceHandler,
2202
- vm
2203
- ) {
2204
- var name, def$$1, cur, old, event;
2205
- for (name in on) {
2206
- def$$1 = cur = on[name];
2207
- old = oldOn[name];
2208
- event = normalizeEvent(name);
2209
- if (isUndef(cur)) {
2210
- warn(
2211
- "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
2212
- vm
2213
- );
2214
- } else if (isUndef(old)) {
2215
- if (isUndef(cur.fns)) {
2216
- cur = on[name] = createFnInvoker(cur, vm);
2217
- }
2218
- if (isTrue(event.once)) {
2219
- cur = on[name] = createOnceHandler(event.name, cur, event.capture);
2220
- }
2221
- add(event.name, cur, event.capture, event.passive, event.params);
2222
- } else if (cur !== old) {
2223
- old.fns = cur;
2224
- on[name] = old;
2225
- }
2226
- }
2227
- for (name in oldOn) {
2228
- if (isUndef(on[name])) {
2229
- event = normalizeEvent(name);
2230
- remove$$1(event.name, oldOn[name], event.capture);
2231
- }
2232
- }
2233
- }
2234
-
2235
- /* */
2236
-
2237
- function mergeVNodeHook (def, hookKey, hook) {
2238
- if (def instanceof VNode) {
2239
- def = def.data.hook || (def.data.hook = {});
2240
- }
2241
- var invoker;
2242
- var oldHook = def[hookKey];
2243
-
2244
- function wrappedHook () {
2245
- hook.apply(this, arguments);
2246
- // important: remove merged hook to ensure it's called only once
2247
- // and prevent memory leak
2248
- remove(invoker.fns, wrappedHook);
2249
- }
2250
-
2251
- if (isUndef(oldHook)) {
2252
- // no existing hook
2253
- invoker = createFnInvoker([wrappedHook]);
2254
- } else {
2255
- /* istanbul ignore if */
2256
- if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
2257
- // already a merged invoker
2258
- invoker = oldHook;
2259
- invoker.fns.push(wrappedHook);
2260
- } else {
2261
- // existing plain hook
2262
- invoker = createFnInvoker([oldHook, wrappedHook]);
2263
- }
2264
- }
2265
-
2266
- invoker.merged = true;
2267
- def[hookKey] = invoker;
2268
- }
2269
-
2270
- /* */
2271
-
2272
- function extractPropsFromVNodeData (
2273
- data,
2274
- Ctor,
2275
- tag
2276
- ) {
2277
- // we are only extracting raw values here.
2278
- // validation and default values are handled in the child
2279
- // component itself.
2280
- var propOptions = Ctor.options.props;
2281
- if (isUndef(propOptions)) {
2282
- return
2283
- }
2284
- var res = {};
2285
- var attrs = data.attrs;
2286
- var props = data.props;
2287
- if (isDef(attrs) || isDef(props)) {
2288
- for (var key in propOptions) {
2289
- var altKey = hyphenate(key);
2290
- {
2291
- var keyInLowerCase = key.toLowerCase();
2292
- if (
2293
- key !== keyInLowerCase &&
2294
- attrs && hasOwn(attrs, keyInLowerCase)
2295
- ) {
2296
- tip(
2297
- "Prop \"" + keyInLowerCase + "\" is passed to component " +
2298
- (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
2299
- " \"" + key + "\". " +
2300
- "Note that HTML attributes are case-insensitive and camelCased " +
2301
- "props need to use their kebab-case equivalents when using in-DOM " +
2302
- "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
2303
- );
2304
- }
2305
- }
2306
- checkProp(res, props, key, altKey, true) ||
2307
- checkProp(res, attrs, key, altKey, false);
2308
- }
2309
- }
2310
- return res
2311
- }
2312
-
2313
- function checkProp (
2314
- res,
2315
- hash,
2316
- key,
2317
- altKey,
2318
- preserve
2319
- ) {
2320
- if (isDef(hash)) {
2321
- if (hasOwn(hash, key)) {
2322
- res[key] = hash[key];
2323
- if (!preserve) {
2324
- delete hash[key];
2325
- }
2326
- return true
2327
- } else if (hasOwn(hash, altKey)) {
2328
- res[key] = hash[altKey];
2329
- if (!preserve) {
2330
- delete hash[altKey];
2331
- }
2332
- return true
2333
- }
2334
- }
2335
- return false
2336
- }
2337
-
2338
- /* */
2339
-
2340
- // The template compiler attempts to minimize the need for normalization by
2341
- // statically analyzing the template at compile time.
2342
- //
2343
- // For plain HTML markup, normalization can be completely skipped because the
2344
- // generated render function is guaranteed to return Array<VNode>. There are
2345
- // two cases where extra normalization is needed:
2346
-
2347
- // 1. When the children contains components - because a functional component
2348
- // may return an Array instead of a single root. In this case, just a simple
2349
- // normalization is needed - if any child is an Array, we flatten the whole
2350
- // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
2351
- // because functional components already normalize their own children.
2352
- function simpleNormalizeChildren (children) {
2353
- for (var i = 0; i < children.length; i++) {
2354
- if (Array.isArray(children[i])) {
2355
- return Array.prototype.concat.apply([], children)
2356
- }
2357
- }
2358
- return children
2359
- }
2360
-
2361
- // 2. When the children contains constructs that always generated nested Arrays,
2362
- // e.g. <template>, <slot>, v-for, or when the children is provided by user
2363
- // with hand-written render functions / JSX. In such cases a full normalization
2364
- // is needed to cater to all possible types of children values.
2365
- function normalizeChildren (children) {
2366
- return isPrimitive(children)
2367
- ? [createTextVNode(children)]
2368
- : Array.isArray(children)
2369
- ? normalizeArrayChildren(children)
2370
- : undefined
2371
- }
2372
-
2373
- function isTextNode (node) {
2374
- return isDef(node) && isDef(node.text) && isFalse(node.isComment)
2375
- }
2376
-
2377
- function normalizeArrayChildren (children, nestedIndex) {
2378
- var res = [];
2379
- var i, c, lastIndex, last;
2380
- for (i = 0; i < children.length; i++) {
2381
- c = children[i];
2382
- if (isUndef(c) || typeof c === 'boolean') { continue }
2383
- lastIndex = res.length - 1;
2384
- last = res[lastIndex];
2385
- // nested
2386
- if (Array.isArray(c)) {
2387
- if (c.length > 0) {
2388
- c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
2389
- // merge adjacent text nodes
2390
- if (isTextNode(c[0]) && isTextNode(last)) {
2391
- res[lastIndex] = createTextVNode(last.text + (c[0]).text);
2392
- c.shift();
2393
- }
2394
- res.push.apply(res, c);
2395
- }
2396
- } else if (isPrimitive(c)) {
2397
- if (isTextNode(last)) {
2398
- // merge adjacent text nodes
2399
- // this is necessary for SSR hydration because text nodes are
2400
- // essentially merged when rendered to HTML strings
2401
- res[lastIndex] = createTextVNode(last.text + c);
2402
- } else if (c !== '') {
2403
- // convert primitive to vnode
2404
- res.push(createTextVNode(c));
2405
- }
2406
- } else {
2407
- if (isTextNode(c) && isTextNode(last)) {
2408
- // merge adjacent text nodes
2409
- res[lastIndex] = createTextVNode(last.text + c.text);
2410
- } else {
2411
- // default key for nested array children (likely generated by v-for)
2412
- if (isTrue(children._isVList) &&
2413
- isDef(c.tag) &&
2414
- isUndef(c.key) &&
2415
- isDef(nestedIndex)) {
2416
- c.key = "__vlist" + nestedIndex + "_" + i + "__";
2417
- }
2418
- res.push(c);
2419
- }
2420
- }
2421
- }
2422
- return res
2423
- }
2424
-
2425
- /* */
2426
-
2427
- function initProvide (vm) {
2428
- var provide = vm.$options.provide;
2429
- if (provide) {
2430
- vm._provided = typeof provide === 'function'
2431
- ? provide.call(vm)
2432
- : provide;
2433
- }
2434
- }
2435
-
2436
- function initInjections (vm) {
2437
- var result = resolveInject(vm.$options.inject, vm);
2438
- if (result) {
2439
- toggleObserving(false);
2440
- Object.keys(result).forEach(function (key) {
2441
- /* istanbul ignore else */
2442
- {
2443
- defineReactive$$1(vm, key, result[key], function () {
2444
- warn(
2445
- "Avoid mutating an injected value directly since the changes will be " +
2446
- "overwritten whenever the provided component re-renders. " +
2447
- "injection being mutated: \"" + key + "\"",
2448
- vm
2449
- );
2450
- });
2451
- }
2452
- });
2453
- toggleObserving(true);
2454
- }
2455
- }
2456
-
2457
- function resolveInject (inject, vm) {
2458
- if (inject) {
2459
- // inject is :any because flow is not smart enough to figure out cached
2460
- var result = Object.create(null);
2461
- var keys = hasSymbol
2462
- ? Reflect.ownKeys(inject)
2463
- : Object.keys(inject);
2464
-
2465
- for (var i = 0; i < keys.length; i++) {
2466
- var key = keys[i];
2467
- // #6574 in case the inject object is observed...
2468
- if (key === '__ob__') { continue }
2469
- var provideKey = inject[key].from;
2470
- var source = vm;
2471
- while (source) {
2472
- if (source._provided && hasOwn(source._provided, provideKey)) {
2473
- result[key] = source._provided[provideKey];
2474
- break
2475
- }
2476
- source = source.$parent;
2477
- }
2478
- if (!source) {
2479
- if ('default' in inject[key]) {
2480
- var provideDefault = inject[key].default;
2481
- result[key] = typeof provideDefault === 'function'
2482
- ? provideDefault.call(vm)
2483
- : provideDefault;
2484
- } else {
2485
- warn(("Injection \"" + key + "\" not found"), vm);
2486
- }
2487
- }
2488
- }
2489
- return result
2490
- }
2491
- }
2492
-
2493
- /* */
2494
-
2495
-
2496
-
2497
- /**
2498
- * Runtime helper for resolving raw children VNodes into a slot object.
2499
- */
2500
- function resolveSlots (
2501
- children,
2502
- context
2503
- ) {
2504
- if (!children || !children.length) {
2505
- return {}
2506
- }
2507
- var slots = {};
2508
- for (var i = 0, l = children.length; i < l; i++) {
2509
- var child = children[i];
2510
- var data = child.data;
2511
- // remove slot attribute if the node is resolved as a Vue slot node
2512
- if (data && data.attrs && data.attrs.slot) {
2513
- delete data.attrs.slot;
2514
- }
2515
- // named slots should only be respected if the vnode was rendered in the
2516
- // same context.
2517
- if ((child.context === context || child.fnContext === context) &&
2518
- data && data.slot != null
2519
- ) {
2520
- var name = data.slot;
2521
- var slot = (slots[name] || (slots[name] = []));
2522
- if (child.tag === 'template') {
2523
- slot.push.apply(slot, child.children || []);
2524
- } else {
2525
- slot.push(child);
2526
- }
2527
- } else {
2528
- (slots.default || (slots.default = [])).push(child);
2529
- }
2530
- }
2531
- // ignore slots that contains only whitespace
2532
- for (var name$1 in slots) {
2533
- if (slots[name$1].every(isWhitespace)) {
2534
- delete slots[name$1];
2535
- }
2536
- }
2537
- return slots
2538
- }
2539
-
2540
- function isWhitespace (node) {
2541
- return (node.isComment && !node.asyncFactory) || node.text === ' '
2542
- }
2543
-
2544
- /* */
2545
-
2546
- function normalizeScopedSlots (
2547
- slots,
2548
- normalSlots,
2549
- prevSlots
2550
- ) {
2551
- var res;
2552
- var hasNormalSlots = Object.keys(normalSlots).length > 0;
2553
- var isStable = slots ? !!slots.$stable : !hasNormalSlots;
2554
- var key = slots && slots.$key;
2555
- if (!slots) {
2556
- res = {};
2557
- } else if (slots._normalized) {
2558
- // fast path 1: child component re-render only, parent did not change
2559
- return slots._normalized
2560
- } else if (
2561
- isStable &&
2562
- prevSlots &&
2563
- prevSlots !== emptyObject &&
2564
- key === prevSlots.$key &&
2565
- !hasNormalSlots &&
2566
- !prevSlots.$hasNormal
2567
- ) {
2568
- // fast path 2: stable scoped slots w/ no normal slots to proxy,
2569
- // only need to normalize once
2570
- return prevSlots
2571
- } else {
2572
- res = {};
2573
- for (var key$1 in slots) {
2574
- if (slots[key$1] && key$1[0] !== '$') {
2575
- res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
2576
- }
2577
- }
2578
- }
2579
- // expose normal slots on scopedSlots
2580
- for (var key$2 in normalSlots) {
2581
- if (!(key$2 in res)) {
2582
- res[key$2] = proxyNormalSlot(normalSlots, key$2);
2583
- }
2584
- }
2585
- // avoriaz seems to mock a non-extensible $scopedSlots object
2586
- // and when that is passed down this would cause an error
2587
- if (slots && Object.isExtensible(slots)) {
2588
- (slots)._normalized = res;
2589
- }
2590
- def(res, '$stable', isStable);
2591
- def(res, '$key', key);
2592
- def(res, '$hasNormal', hasNormalSlots);
2593
- return res
2594
- }
2595
-
2596
- function normalizeScopedSlot(normalSlots, key, fn) {
2597
- var normalized = function () {
2598
- var res = arguments.length ? fn.apply(null, arguments) : fn({});
2599
- res = res && typeof res === 'object' && !Array.isArray(res)
2600
- ? [res] // single vnode
2601
- : normalizeChildren(res);
2602
- return res && (
2603
- res.length === 0 ||
2604
- (res.length === 1 && res[0].isComment) // #9658
2605
- ) ? undefined
2606
- : res
2607
- };
2608
- // this is a slot using the new v-slot syntax without scope. although it is
2609
- // compiled as a scoped slot, render fn users would expect it to be present
2610
- // on this.$slots because the usage is semantically a normal slot.
2611
- if (fn.proxy) {
2612
- Object.defineProperty(normalSlots, key, {
2613
- get: normalized,
2614
- enumerable: true,
2615
- configurable: true
2616
- });
2617
- }
2618
- return normalized
2619
- }
2620
-
2621
- function proxyNormalSlot(slots, key) {
2622
- return function () { return slots[key]; }
2623
- }
2624
-
2625
- /* */
2626
-
2627
- /**
2628
- * Runtime helper for rendering v-for lists.
2629
- */
2630
- function renderList (
2631
- val,
2632
- render
2633
- ) {
2634
- var ret, i, l, keys, key;
2635
- if (Array.isArray(val) || typeof val === 'string') {
2636
- ret = new Array(val.length);
2637
- for (i = 0, l = val.length; i < l; i++) {
2638
- ret[i] = render(val[i], i);
2639
- }
2640
- } else if (typeof val === 'number') {
2641
- ret = new Array(val);
2642
- for (i = 0; i < val; i++) {
2643
- ret[i] = render(i + 1, i);
2644
- }
2645
- } else if (isObject(val)) {
2646
- if (hasSymbol && val[Symbol.iterator]) {
2647
- ret = [];
2648
- var iterator = val[Symbol.iterator]();
2649
- var result = iterator.next();
2650
- while (!result.done) {
2651
- ret.push(render(result.value, ret.length));
2652
- result = iterator.next();
2653
- }
2654
- } else {
2655
- keys = Object.keys(val);
2656
- ret = new Array(keys.length);
2657
- for (i = 0, l = keys.length; i < l; i++) {
2658
- key = keys[i];
2659
- ret[i] = render(val[key], key, i);
2660
- }
2661
- }
2662
- }
2663
- if (!isDef(ret)) {
2664
- ret = [];
2665
- }
2666
- (ret)._isVList = true;
2667
- return ret
2668
- }
2669
-
2670
- /* */
2671
-
2672
- /**
2673
- * Runtime helper for rendering <slot>
2674
- */
2675
- function renderSlot (
2676
- name,
2677
- fallback,
2678
- props,
2679
- bindObject
2680
- ) {
2681
- var scopedSlotFn = this.$scopedSlots[name];
2682
- var nodes;
2683
- if (scopedSlotFn) { // scoped slot
2684
- props = props || {};
2685
- if (bindObject) {
2686
- if (!isObject(bindObject)) {
2687
- warn(
2688
- 'slot v-bind without argument expects an Object',
2689
- this
2690
- );
2691
- }
2692
- props = extend(extend({}, bindObject), props);
2693
- }
2694
- nodes = scopedSlotFn(props) || fallback;
2695
- } else {
2696
- nodes = this.$slots[name] || fallback;
2697
- }
2698
-
2699
- var target = props && props.slot;
2700
- if (target) {
2701
- return this.$createElement('template', { slot: target }, nodes)
2702
- } else {
2703
- return nodes
2704
- }
2705
- }
2706
-
2707
- /* */
2708
-
2709
- /**
2710
- * Runtime helper for resolving filters
2711
- */
2712
- function resolveFilter (id) {
2713
- return resolveAsset(this.$options, 'filters', id, true) || identity
2714
- }
2715
-
2716
- /* */
2717
-
2718
- function isKeyNotMatch (expect, actual) {
2719
- if (Array.isArray(expect)) {
2720
- return expect.indexOf(actual) === -1
2721
- } else {
2722
- return expect !== actual
2723
- }
2724
- }
2725
-
2726
- /**
2727
- * Runtime helper for checking keyCodes from config.
2728
- * exposed as Vue.prototype._k
2729
- * passing in eventKeyName as last argument separately for backwards compat
2730
- */
2731
- function checkKeyCodes (
2732
- eventKeyCode,
2733
- key,
2734
- builtInKeyCode,
2735
- eventKeyName,
2736
- builtInKeyName
2737
- ) {
2738
- var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
2739
- if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
2740
- return isKeyNotMatch(builtInKeyName, eventKeyName)
2741
- } else if (mappedKeyCode) {
2742
- return isKeyNotMatch(mappedKeyCode, eventKeyCode)
2743
- } else if (eventKeyName) {
2744
- return hyphenate(eventKeyName) !== key
2745
- }
2746
- }
2747
-
2748
- /* */
2749
-
2750
- /**
2751
- * Runtime helper for merging v-bind="object" into a VNode's data.
2752
- */
2753
- function bindObjectProps (
2754
- data,
2755
- tag,
2756
- value,
2757
- asProp,
2758
- isSync
2759
- ) {
2760
- if (value) {
2761
- if (!isObject(value)) {
2762
- warn(
2763
- 'v-bind without argument expects an Object or Array value',
2764
- this
2765
- );
2766
- } else {
2767
- if (Array.isArray(value)) {
2768
- value = toObject(value);
2769
- }
2770
- var hash;
2771
- var loop = function ( key ) {
2772
- if (
2773
- key === 'class' ||
2774
- key === 'style' ||
2775
- isReservedAttribute(key)
2776
- ) {
2777
- hash = data;
2778
- } else {
2779
- var type = data.attrs && data.attrs.type;
2780
- hash = asProp || config.mustUseProp(tag, type, key)
2781
- ? data.domProps || (data.domProps = {})
2782
- : data.attrs || (data.attrs = {});
2783
- }
2784
- var camelizedKey = camelize(key);
2785
- var hyphenatedKey = hyphenate(key);
2786
- if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
2787
- hash[key] = value[key];
2788
-
2789
- if (isSync) {
2790
- var on = data.on || (data.on = {});
2791
- on[("update:" + key)] = function ($event) {
2792
- value[key] = $event;
2793
- };
2794
- }
2795
- }
2796
- };
2797
-
2798
- for (var key in value) loop( key );
2799
- }
2800
- }
2801
- return data
2802
- }
2803
-
2804
- /* */
2805
-
2806
- /**
2807
- * Runtime helper for rendering static trees.
2808
- */
2809
- function renderStatic (
2810
- index,
2811
- isInFor
2812
- ) {
2813
- var cached = this._staticTrees || (this._staticTrees = []);
2814
- var tree = cached[index];
2815
- // if has already-rendered static tree and not inside v-for,
2816
- // we can reuse the same tree.
2817
- if (tree && !isInFor) {
2818
- return tree
2819
- }
2820
- // otherwise, render a fresh tree.
2821
- tree = cached[index] = this.$options.staticRenderFns[index].call(
2822
- this._renderProxy,
2823
- null,
2824
- this // for render fns generated for functional component templates
2825
- );
2826
- markStatic(tree, ("__static__" + index), false);
2827
- return tree
2828
- }
2829
-
2830
- /**
2831
- * Runtime helper for v-once.
2832
- * Effectively it means marking the node as static with a unique key.
2833
- */
2834
- function markOnce (
2835
- tree,
2836
- index,
2837
- key
2838
- ) {
2839
- markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
2840
- return tree
2841
- }
2842
-
2843
- function markStatic (
2844
- tree,
2845
- key,
2846
- isOnce
2847
- ) {
2848
- if (Array.isArray(tree)) {
2849
- for (var i = 0; i < tree.length; i++) {
2850
- if (tree[i] && typeof tree[i] !== 'string') {
2851
- markStaticNode(tree[i], (key + "_" + i), isOnce);
2852
- }
2853
- }
2854
- } else {
2855
- markStaticNode(tree, key, isOnce);
2856
- }
2857
- }
2858
-
2859
- function markStaticNode (node, key, isOnce) {
2860
- node.isStatic = true;
2861
- node.key = key;
2862
- node.isOnce = isOnce;
2863
- }
2864
-
2865
- /* */
2866
-
2867
- function bindObjectListeners (data, value) {
2868
- if (value) {
2869
- if (!isPlainObject(value)) {
2870
- warn(
2871
- 'v-on without argument expects an Object value',
2872
- this
2873
- );
2874
- } else {
2875
- var on = data.on = data.on ? extend({}, data.on) : {};
2876
- for (var key in value) {
2877
- var existing = on[key];
2878
- var ours = value[key];
2879
- on[key] = existing ? [].concat(existing, ours) : ours;
2880
- }
2881
- }
2882
- }
2883
- return data
2884
- }
2885
-
2886
- /* */
2887
-
2888
- function resolveScopedSlots (
2889
- fns, // see flow/vnode
2890
- res,
2891
- // the following are added in 2.6
2892
- hasDynamicKeys,
2893
- contentHashKey
2894
- ) {
2895
- res = res || { $stable: !hasDynamicKeys };
2896
- for (var i = 0; i < fns.length; i++) {
2897
- var slot = fns[i];
2898
- if (Array.isArray(slot)) {
2899
- resolveScopedSlots(slot, res, hasDynamicKeys);
2900
- } else if (slot) {
2901
- // marker for reverse proxying v-slot without scope on this.$slots
2902
- if (slot.proxy) {
2903
- slot.fn.proxy = true;
2904
- }
2905
- res[slot.key] = slot.fn;
2906
- }
2907
- }
2908
- if (contentHashKey) {
2909
- (res).$key = contentHashKey;
2910
- }
2911
- return res
2912
- }
2913
-
2914
- /* */
2915
-
2916
- function bindDynamicKeys (baseObj, values) {
2917
- for (var i = 0; i < values.length; i += 2) {
2918
- var key = values[i];
2919
- if (typeof key === 'string' && key) {
2920
- baseObj[values[i]] = values[i + 1];
2921
- } else if (key !== '' && key !== null) {
2922
- // null is a speical value for explicitly removing a binding
2923
- warn(
2924
- ("Invalid value for dynamic directive argument (expected string or null): " + key),
2925
- this
2926
- );
2927
- }
2928
- }
2929
- return baseObj
2930
- }
2931
-
2932
- // helper to dynamically append modifier runtime markers to event names.
2933
- // ensure only append when value is already string, otherwise it will be cast
2934
- // to string and cause the type check to miss.
2935
- function prependModifier (value, symbol) {
2936
- return typeof value === 'string' ? symbol + value : value
2937
- }
2938
-
2939
- /* */
2940
-
2941
- function installRenderHelpers (target) {
2942
- target._o = markOnce;
2943
- target._n = toNumber;
2944
- target._s = toString;
2945
- target._l = renderList;
2946
- target._t = renderSlot;
2947
- target._q = looseEqual;
2948
- target._i = looseIndexOf;
2949
- target._m = renderStatic;
2950
- target._f = resolveFilter;
2951
- target._k = checkKeyCodes;
2952
- target._b = bindObjectProps;
2953
- target._v = createTextVNode;
2954
- target._e = createEmptyVNode;
2955
- target._u = resolveScopedSlots;
2956
- target._g = bindObjectListeners;
2957
- target._d = bindDynamicKeys;
2958
- target._p = prependModifier;
2959
- }
2960
-
2961
- /* */
2962
-
2963
- function FunctionalRenderContext (
2964
- data,
2965
- props,
2966
- children,
2967
- parent,
2968
- Ctor
2969
- ) {
2970
- var this$1 = this;
2971
-
2972
- var options = Ctor.options;
2973
- // ensure the createElement function in functional components
2974
- // gets a unique context - this is necessary for correct named slot check
2975
- var contextVm;
2976
- if (hasOwn(parent, '_uid')) {
2977
- contextVm = Object.create(parent);
2978
- // $flow-disable-line
2979
- contextVm._original = parent;
2980
- } else {
2981
- // the context vm passed in is a functional context as well.
2982
- // in this case we want to make sure we are able to get a hold to the
2983
- // real context instance.
2984
- contextVm = parent;
2985
- // $flow-disable-line
2986
- parent = parent._original;
2987
- }
2988
- var isCompiled = isTrue(options._compiled);
2989
- var needNormalization = !isCompiled;
2990
-
2991
- this.data = data;
2992
- this.props = props;
2993
- this.children = children;
2994
- this.parent = parent;
2995
- this.listeners = data.on || emptyObject;
2996
- this.injections = resolveInject(options.inject, parent);
2997
- this.slots = function () {
2998
- if (!this$1.$slots) {
2999
- normalizeScopedSlots(
3000
- data.scopedSlots,
3001
- this$1.$slots = resolveSlots(children, parent)
3002
- );
3003
- }
3004
- return this$1.$slots
3005
- };
3006
-
3007
- Object.defineProperty(this, 'scopedSlots', ({
3008
- enumerable: true,
3009
- get: function get () {
3010
- return normalizeScopedSlots(data.scopedSlots, this.slots())
3011
- }
3012
- }));
3013
-
3014
- // support for compiled functional template
3015
- if (isCompiled) {
3016
- // exposing $options for renderStatic()
3017
- this.$options = options;
3018
- // pre-resolve slots for renderSlot()
3019
- this.$slots = this.slots();
3020
- this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
3021
- }
3022
-
3023
- if (options._scopeId) {
3024
- this._c = function (a, b, c, d) {
3025
- var vnode = createElement(contextVm, a, b, c, d, needNormalization);
3026
- if (vnode && !Array.isArray(vnode)) {
3027
- vnode.fnScopeId = options._scopeId;
3028
- vnode.fnContext = parent;
3029
- }
3030
- return vnode
3031
- };
3032
- } else {
3033
- this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
3034
- }
3035
- }
3036
-
3037
- installRenderHelpers(FunctionalRenderContext.prototype);
3038
-
3039
- function createFunctionalComponent (
3040
- Ctor,
3041
- propsData,
3042
- data,
3043
- contextVm,
3044
- children
3045
- ) {
3046
- var options = Ctor.options;
3047
- var props = {};
3048
- var propOptions = options.props;
3049
- if (isDef(propOptions)) {
3050
- for (var key in propOptions) {
3051
- props[key] = validateProp(key, propOptions, propsData || emptyObject);
3052
- }
3053
- } else {
3054
- if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
3055
- if (isDef(data.props)) { mergeProps(props, data.props); }
3056
- }
3057
-
3058
- var renderContext = new FunctionalRenderContext(
3059
- data,
3060
- props,
3061
- children,
3062
- contextVm,
3063
- Ctor
3064
- );
3065
-
3066
- var vnode = options.render.call(null, renderContext._c, renderContext);
3067
-
3068
- if (vnode instanceof VNode) {
3069
- return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
3070
- } else if (Array.isArray(vnode)) {
3071
- var vnodes = normalizeChildren(vnode) || [];
3072
- var res = new Array(vnodes.length);
3073
- for (var i = 0; i < vnodes.length; i++) {
3074
- res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
3075
- }
3076
- return res
3077
- }
3078
- }
3079
-
3080
- function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
3081
- // #7817 clone node before setting fnContext, otherwise if the node is reused
3082
- // (e.g. it was from a cached normal slot) the fnContext causes named slots
3083
- // that should not be matched to match.
3084
- var clone = cloneVNode(vnode);
3085
- clone.fnContext = contextVm;
3086
- clone.fnOptions = options;
3087
- {
3088
- (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
3089
- }
3090
- if (data.slot) {
3091
- (clone.data || (clone.data = {})).slot = data.slot;
3092
- }
3093
- return clone
3094
- }
3095
-
3096
- function mergeProps (to, from) {
3097
- for (var key in from) {
3098
- to[camelize(key)] = from[key];
3099
- }
3100
- }
3101
-
3102
- /* */
3103
-
3104
- /* */
3105
-
3106
- /* */
3107
-
3108
- /* */
3109
-
3110
- // inline hooks to be invoked on component VNodes during patch
3111
- var componentVNodeHooks = {
3112
- init: function init (vnode, hydrating) {
3113
- if (
3114
- vnode.componentInstance &&
3115
- !vnode.componentInstance._isDestroyed &&
3116
- vnode.data.keepAlive
3117
- ) {
3118
- // kept-alive components, treat as a patch
3119
- var mountedNode = vnode; // work around flow
3120
- componentVNodeHooks.prepatch(mountedNode, mountedNode);
3121
- } else {
3122
- var child = vnode.componentInstance = createComponentInstanceForVnode(
3123
- vnode,
3124
- activeInstance
3125
- );
3126
- child.$mount(hydrating ? vnode.elm : undefined, hydrating);
3127
- }
3128
- },
3129
-
3130
- prepatch: function prepatch (oldVnode, vnode) {
3131
- var options = vnode.componentOptions;
3132
- var child = vnode.componentInstance = oldVnode.componentInstance;
3133
- updateChildComponent(
3134
- child,
3135
- options.propsData, // updated props
3136
- options.listeners, // updated listeners
3137
- vnode, // new parent vnode
3138
- options.children // new children
3139
- );
3140
- },
3141
-
3142
- insert: function insert (vnode) {
3143
- var context = vnode.context;
3144
- var componentInstance = vnode.componentInstance;
3145
- if (!componentInstance._isMounted) {
3146
- componentInstance._isMounted = true;
3147
- callHook(componentInstance, 'mounted');
3148
- }
3149
- if (vnode.data.keepAlive) {
3150
- if (context._isMounted) {
3151
- // vue-router#1212
3152
- // During updates, a kept-alive component's child components may
3153
- // change, so directly walking the tree here may call activated hooks
3154
- // on incorrect children. Instead we push them into a queue which will
3155
- // be processed after the whole patch process ended.
3156
- queueActivatedComponent(componentInstance);
3157
- } else {
3158
- activateChildComponent(componentInstance, true /* direct */);
3159
- }
3160
- }
3161
- },
3162
-
3163
- destroy: function destroy (vnode) {
3164
- var componentInstance = vnode.componentInstance;
3165
- if (!componentInstance._isDestroyed) {
3166
- if (!vnode.data.keepAlive) {
3167
- componentInstance.$destroy();
3168
- } else {
3169
- deactivateChildComponent(componentInstance, true /* direct */);
3170
- }
3171
- }
3172
- }
3173
- };
3174
-
3175
- var hooksToMerge = Object.keys(componentVNodeHooks);
3176
-
3177
- function createComponent (
3178
- Ctor,
3179
- data,
3180
- context,
3181
- children,
3182
- tag
3183
- ) {
3184
- if (isUndef(Ctor)) {
3185
- return
3186
- }
3187
-
3188
- var baseCtor = context.$options._base;
3189
-
3190
- // plain options object: turn it into a constructor
3191
- if (isObject(Ctor)) {
3192
- Ctor = baseCtor.extend(Ctor);
3193
- }
3194
-
3195
- // if at this stage it's not a constructor or an async component factory,
3196
- // reject.
3197
- if (typeof Ctor !== 'function') {
3198
- {
3199
- warn(("Invalid Component definition: " + (String(Ctor))), context);
3200
- }
3201
- return
3202
- }
3203
-
3204
- // async component
3205
- var asyncFactory;
3206
- if (isUndef(Ctor.cid)) {
3207
- asyncFactory = Ctor;
3208
- Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
3209
- if (Ctor === undefined) {
3210
- // return a placeholder node for async component, which is rendered
3211
- // as a comment node but preserves all the raw information for the node.
3212
- // the information will be used for async server-rendering and hydration.
3213
- return createAsyncPlaceholder(
3214
- asyncFactory,
3215
- data,
3216
- context,
3217
- children,
3218
- tag
3219
- )
3220
- }
3221
- }
3222
-
3223
- data = data || {};
3224
-
3225
- // resolve constructor options in case global mixins are applied after
3226
- // component constructor creation
3227
- resolveConstructorOptions(Ctor);
3228
-
3229
- // transform component v-model data into props & events
3230
- if (isDef(data.model)) {
3231
- transformModel(Ctor.options, data);
3232
- }
3233
-
3234
- // extract props
3235
- var propsData = extractPropsFromVNodeData(data, Ctor, tag);
3236
-
3237
- // functional component
3238
- if (isTrue(Ctor.options.functional)) {
3239
- return createFunctionalComponent(Ctor, propsData, data, context, children)
3240
- }
3241
-
3242
- // extract listeners, since these needs to be treated as
3243
- // child component listeners instead of DOM listeners
3244
- var listeners = data.on;
3245
- // replace with listeners with .native modifier
3246
- // so it gets processed during parent component patch.
3247
- data.on = data.nativeOn;
3248
-
3249
- if (isTrue(Ctor.options.abstract)) {
3250
- // abstract components do not keep anything
3251
- // other than props & listeners & slot
3252
-
3253
- // work around flow
3254
- var slot = data.slot;
3255
- data = {};
3256
- if (slot) {
3257
- data.slot = slot;
3258
- }
3259
- }
3260
-
3261
- // install component management hooks onto the placeholder node
3262
- installComponentHooks(data);
3263
-
3264
- // return a placeholder vnode
3265
- var name = Ctor.options.name || tag;
3266
- var vnode = new VNode(
3267
- ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
3268
- data, undefined, undefined, undefined, context,
3269
- { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
3270
- asyncFactory
3271
- );
3272
-
3273
- return vnode
3274
- }
3275
-
3276
- function createComponentInstanceForVnode (
3277
- vnode, // we know it's MountedComponentVNode but flow doesn't
3278
- parent // activeInstance in lifecycle state
3279
- ) {
3280
- var options = {
3281
- _isComponent: true,
3282
- _parentVnode: vnode,
3283
- parent: parent
3284
- };
3285
- // check inline-template render functions
3286
- var inlineTemplate = vnode.data.inlineTemplate;
3287
- if (isDef(inlineTemplate)) {
3288
- options.render = inlineTemplate.render;
3289
- options.staticRenderFns = inlineTemplate.staticRenderFns;
3290
- }
3291
- return new vnode.componentOptions.Ctor(options)
3292
- }
3293
-
3294
- function installComponentHooks (data) {
3295
- var hooks = data.hook || (data.hook = {});
3296
- for (var i = 0; i < hooksToMerge.length; i++) {
3297
- var key = hooksToMerge[i];
3298
- var existing = hooks[key];
3299
- var toMerge = componentVNodeHooks[key];
3300
- if (existing !== toMerge && !(existing && existing._merged)) {
3301
- hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
3302
- }
3303
- }
3304
- }
3305
-
3306
- function mergeHook$1 (f1, f2) {
3307
- var merged = function (a, b) {
3308
- // flow complains about extra args which is why we use any
3309
- f1(a, b);
3310
- f2(a, b);
3311
- };
3312
- merged._merged = true;
3313
- return merged
3314
- }
3315
-
3316
- // transform component v-model info (value and callback) into
3317
- // prop and event handler respectively.
3318
- function transformModel (options, data) {
3319
- var prop = (options.model && options.model.prop) || 'value';
3320
- var event = (options.model && options.model.event) || 'input'
3321
- ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
3322
- var on = data.on || (data.on = {});
3323
- var existing = on[event];
3324
- var callback = data.model.callback;
3325
- if (isDef(existing)) {
3326
- if (
3327
- Array.isArray(existing)
3328
- ? existing.indexOf(callback) === -1
3329
- : existing !== callback
3330
- ) {
3331
- on[event] = [callback].concat(existing);
3332
- }
3333
- } else {
3334
- on[event] = callback;
3335
- }
3336
- }
3337
-
3338
- /* */
3339
-
3340
- var SIMPLE_NORMALIZE = 1;
3341
- var ALWAYS_NORMALIZE = 2;
3342
-
3343
- // wrapper function for providing a more flexible interface
3344
- // without getting yelled at by flow
3345
- function createElement (
3346
- context,
3347
- tag,
3348
- data,
3349
- children,
3350
- normalizationType,
3351
- alwaysNormalize
3352
- ) {
3353
- if (Array.isArray(data) || isPrimitive(data)) {
3354
- normalizationType = children;
3355
- children = data;
3356
- data = undefined;
3357
- }
3358
- if (isTrue(alwaysNormalize)) {
3359
- normalizationType = ALWAYS_NORMALIZE;
3360
- }
3361
- return _createElement(context, tag, data, children, normalizationType)
3362
- }
3363
-
3364
- function _createElement (
3365
- context,
3366
- tag,
3367
- data,
3368
- children,
3369
- normalizationType
3370
- ) {
3371
- if (isDef(data) && isDef((data).__ob__)) {
3372
- warn(
3373
- "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
3374
- 'Always create fresh vnode data objects in each render!',
3375
- context
3376
- );
3377
- return createEmptyVNode()
3378
- }
3379
- // object syntax in v-bind
3380
- if (isDef(data) && isDef(data.is)) {
3381
- tag = data.is;
3382
- }
3383
- if (!tag) {
3384
- // in case of component :is set to falsy value
3385
- return createEmptyVNode()
3386
- }
3387
- // warn against non-primitive key
3388
- if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
3389
- ) {
3390
- {
3391
- warn(
3392
- 'Avoid using non-primitive value as key, ' +
3393
- 'use string/number value instead.',
3394
- context
3395
- );
3396
- }
3397
- }
3398
- // support single function children as default scoped slot
3399
- if (Array.isArray(children) &&
3400
- typeof children[0] === 'function'
3401
- ) {
3402
- data = data || {};
3403
- data.scopedSlots = { default: children[0] };
3404
- children.length = 0;
3405
- }
3406
- if (normalizationType === ALWAYS_NORMALIZE) {
3407
- children = normalizeChildren(children);
3408
- } else if (normalizationType === SIMPLE_NORMALIZE) {
3409
- children = simpleNormalizeChildren(children);
3410
- }
3411
- var vnode, ns;
3412
- if (typeof tag === 'string') {
3413
- var Ctor;
3414
- ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
3415
- if (config.isReservedTag(tag)) {
3416
- // platform built-in elements
3417
- vnode = new VNode(
3418
- config.parsePlatformTagName(tag), data, children,
3419
- undefined, undefined, context
3420
- );
3421
- } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
3422
- // component
3423
- vnode = createComponent(Ctor, data, context, children, tag);
3424
- } else {
3425
- // unknown or unlisted namespaced elements
3426
- // check at runtime because it may get assigned a namespace when its
3427
- // parent normalizes children
3428
- vnode = new VNode(
3429
- tag, data, children,
3430
- undefined, undefined, context
3431
- );
3432
- }
3433
- } else {
3434
- // direct component options / constructor
3435
- vnode = createComponent(tag, data, context, children);
3436
- }
3437
- if (Array.isArray(vnode)) {
3438
- return vnode
3439
- } else if (isDef(vnode)) {
3440
- if (isDef(ns)) { applyNS(vnode, ns); }
3441
- if (isDef(data)) { registerDeepBindings(data); }
3442
- return vnode
3443
- } else {
3444
- return createEmptyVNode()
3445
- }
3446
- }
3447
-
3448
- function applyNS (vnode, ns, force) {
3449
- vnode.ns = ns;
3450
- if (vnode.tag === 'foreignObject') {
3451
- // use default namespace inside foreignObject
3452
- ns = undefined;
3453
- force = true;
3454
- }
3455
- if (isDef(vnode.children)) {
3456
- for (var i = 0, l = vnode.children.length; i < l; i++) {
3457
- var child = vnode.children[i];
3458
- if (isDef(child.tag) && (
3459
- isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
3460
- applyNS(child, ns, force);
3461
- }
3462
- }
3463
- }
3464
- }
3465
-
3466
- // ref #5318
3467
- // necessary to ensure parent re-render when deep bindings like :style and
3468
- // :class are used on slot nodes
3469
- function registerDeepBindings (data) {
3470
- if (isObject(data.style)) {
3471
- traverse(data.style);
3472
- }
3473
- if (isObject(data.class)) {
3474
- traverse(data.class);
3475
- }
3476
- }
3477
-
3478
- /* */
3479
-
3480
- function initRender (vm) {
3481
- vm._vnode = null; // the root of the child tree
3482
- vm._staticTrees = null; // v-once cached trees
3483
- var options = vm.$options;
3484
- var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
3485
- var renderContext = parentVnode && parentVnode.context;
3486
- vm.$slots = resolveSlots(options._renderChildren, renderContext);
3487
- vm.$scopedSlots = emptyObject;
3488
- // bind the createElement fn to this instance
3489
- // so that we get proper render context inside it.
3490
- // args order: tag, data, children, normalizationType, alwaysNormalize
3491
- // internal version is used by render functions compiled from templates
3492
- vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
3493
- // normalization is always applied for the public version, used in
3494
- // user-written render functions.
3495
- vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
3496
-
3497
- // $attrs & $listeners are exposed for easier HOC creation.
3498
- // they need to be reactive so that HOCs using them are always updated
3499
- var parentData = parentVnode && parentVnode.data;
3500
-
3501
- /* istanbul ignore else */
3502
- {
3503
- defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
3504
- !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
3505
- }, true);
3506
- defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
3507
- !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
3508
- }, true);
3509
- }
3510
- }
3511
-
3512
- var currentRenderingInstance = null;
3513
-
3514
- function renderMixin (Vue) {
3515
- // install runtime convenience helpers
3516
- installRenderHelpers(Vue.prototype);
3517
-
3518
- Vue.prototype.$nextTick = function (fn) {
3519
- return nextTick(fn, this)
3520
- };
3521
-
3522
- Vue.prototype._render = function () {
3523
- var vm = this;
3524
- var ref = vm.$options;
3525
- var render = ref.render;
3526
- var _parentVnode = ref._parentVnode;
3527
-
3528
- if (_parentVnode) {
3529
- vm.$scopedSlots = normalizeScopedSlots(
3530
- _parentVnode.data.scopedSlots,
3531
- vm.$slots,
3532
- vm.$scopedSlots
3533
- );
3534
- }
3535
-
3536
- // set parent vnode. this allows render functions to have access
3537
- // to the data on the placeholder node.
3538
- vm.$vnode = _parentVnode;
3539
- // render self
3540
- var vnode;
3541
- try {
3542
- // There's no need to maintain a stack becaues all render fns are called
3543
- // separately from one another. Nested component's render fns are called
3544
- // when parent component is patched.
3545
- currentRenderingInstance = vm;
3546
- vnode = render.call(vm._renderProxy, vm.$createElement);
3547
- } catch (e) {
3548
- handleError(e, vm, "render");
3549
- // return error render result,
3550
- // or previous vnode to prevent render error causing blank component
3551
- /* istanbul ignore else */
3552
- if (vm.$options.renderError) {
3553
- try {
3554
- vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
3555
- } catch (e) {
3556
- handleError(e, vm, "renderError");
3557
- vnode = vm._vnode;
3558
- }
3559
- } else {
3560
- vnode = vm._vnode;
3561
- }
3562
- } finally {
3563
- currentRenderingInstance = null;
3564
- }
3565
- // if the returned array contains only a single node, allow it
3566
- if (Array.isArray(vnode) && vnode.length === 1) {
3567
- vnode = vnode[0];
3568
- }
3569
- // return empty vnode in case the render function errored out
3570
- if (!(vnode instanceof VNode)) {
3571
- if (Array.isArray(vnode)) {
3572
- warn(
3573
- 'Multiple root nodes returned from render function. Render function ' +
3574
- 'should return a single root node.',
3575
- vm
3576
- );
3577
- }
3578
- vnode = createEmptyVNode();
3579
- }
3580
- // set parent
3581
- vnode.parent = _parentVnode;
3582
- return vnode
3583
- };
3584
- }
3585
-
3586
- /* */
3587
-
3588
- function ensureCtor (comp, base) {
3589
- if (
3590
- comp.__esModule ||
3591
- (hasSymbol && comp[Symbol.toStringTag] === 'Module')
3592
- ) {
3593
- comp = comp.default;
3594
- }
3595
- return isObject(comp)
3596
- ? base.extend(comp)
3597
- : comp
3598
- }
3599
-
3600
- function createAsyncPlaceholder (
3601
- factory,
3602
- data,
3603
- context,
3604
- children,
3605
- tag
3606
- ) {
3607
- var node = createEmptyVNode();
3608
- node.asyncFactory = factory;
3609
- node.asyncMeta = { data: data, context: context, children: children, tag: tag };
3610
- return node
3611
- }
3612
-
3613
- function resolveAsyncComponent (
3614
- factory,
3615
- baseCtor
3616
- ) {
3617
- if (isTrue(factory.error) && isDef(factory.errorComp)) {
3618
- return factory.errorComp
3619
- }
3620
-
3621
- if (isDef(factory.resolved)) {
3622
- return factory.resolved
3623
- }
3624
-
3625
- var owner = currentRenderingInstance;
3626
- if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
3627
- // already pending
3628
- factory.owners.push(owner);
3629
- }
3630
-
3631
- if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
3632
- return factory.loadingComp
3633
- }
3634
-
3635
- if (owner && !isDef(factory.owners)) {
3636
- var owners = factory.owners = [owner];
3637
- var sync = true;
3638
- var timerLoading = null;
3639
- var timerTimeout = null
3640
-
3641
- ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
3642
-
3643
- var forceRender = function (renderCompleted) {
3644
- for (var i = 0, l = owners.length; i < l; i++) {
3645
- (owners[i]).$forceUpdate();
3646
- }
3647
-
3648
- if (renderCompleted) {
3649
- owners.length = 0;
3650
- if (timerLoading !== null) {
3651
- clearTimeout(timerLoading);
3652
- timerLoading = null;
3653
- }
3654
- if (timerTimeout !== null) {
3655
- clearTimeout(timerTimeout);
3656
- timerTimeout = null;
3657
- }
3658
- }
3659
- };
3660
-
3661
- var resolve = once(function (res) {
3662
- // cache resolved
3663
- factory.resolved = ensureCtor(res, baseCtor);
3664
- // invoke callbacks only if this is not a synchronous resolve
3665
- // (async resolves are shimmed as synchronous during SSR)
3666
- if (!sync) {
3667
- forceRender(true);
3668
- } else {
3669
- owners.length = 0;
3670
- }
3671
- });
3672
-
3673
- var reject = once(function (reason) {
3674
- warn(
3675
- "Failed to resolve async component: " + (String(factory)) +
3676
- (reason ? ("\nReason: " + reason) : '')
3677
- );
3678
- if (isDef(factory.errorComp)) {
3679
- factory.error = true;
3680
- forceRender(true);
3681
- }
3682
- });
3683
-
3684
- var res = factory(resolve, reject);
3685
-
3686
- if (isObject(res)) {
3687
- if (isPromise(res)) {
3688
- // () => Promise
3689
- if (isUndef(factory.resolved)) {
3690
- res.then(resolve, reject);
3691
- }
3692
- } else if (isPromise(res.component)) {
3693
- res.component.then(resolve, reject);
3694
-
3695
- if (isDef(res.error)) {
3696
- factory.errorComp = ensureCtor(res.error, baseCtor);
3697
- }
3698
-
3699
- if (isDef(res.loading)) {
3700
- factory.loadingComp = ensureCtor(res.loading, baseCtor);
3701
- if (res.delay === 0) {
3702
- factory.loading = true;
3703
- } else {
3704
- timerLoading = setTimeout(function () {
3705
- timerLoading = null;
3706
- if (isUndef(factory.resolved) && isUndef(factory.error)) {
3707
- factory.loading = true;
3708
- forceRender(false);
3709
- }
3710
- }, res.delay || 200);
3711
- }
3712
- }
3713
-
3714
- if (isDef(res.timeout)) {
3715
- timerTimeout = setTimeout(function () {
3716
- timerTimeout = null;
3717
- if (isUndef(factory.resolved)) {
3718
- reject(
3719
- "timeout (" + (res.timeout) + "ms)"
3720
- );
3721
- }
3722
- }, res.timeout);
3723
- }
3724
- }
3725
- }
3726
-
3727
- sync = false;
3728
- // return in case resolved synchronously
3729
- return factory.loading
3730
- ? factory.loadingComp
3731
- : factory.resolved
3732
- }
3733
- }
3734
-
3735
- /* */
3736
-
3737
- function isAsyncPlaceholder (node) {
3738
- return node.isComment && node.asyncFactory
3739
- }
3740
-
3741
- /* */
3742
-
3743
- function getFirstComponentChild (children) {
3744
- if (Array.isArray(children)) {
3745
- for (var i = 0; i < children.length; i++) {
3746
- var c = children[i];
3747
- if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
3748
- return c
3749
- }
3750
- }
3751
- }
3752
- }
3753
-
3754
- /* */
3755
-
3756
- /* */
3757
-
3758
- function initEvents (vm) {
3759
- vm._events = Object.create(null);
3760
- vm._hasHookEvent = false;
3761
- // init parent attached events
3762
- var listeners = vm.$options._parentListeners;
3763
- if (listeners) {
3764
- updateComponentListeners(vm, listeners);
3765
- }
3766
- }
3767
-
3768
- var target;
3769
-
3770
- function add (event, fn) {
3771
- target.$on(event, fn);
3772
- }
3773
-
3774
- function remove$1 (event, fn) {
3775
- target.$off(event, fn);
3776
- }
3777
-
3778
- function createOnceHandler (event, fn) {
3779
- var _target = target;
3780
- return function onceHandler () {
3781
- var res = fn.apply(null, arguments);
3782
- if (res !== null) {
3783
- _target.$off(event, onceHandler);
3784
- }
3785
- }
3786
- }
3787
-
3788
- function updateComponentListeners (
3789
- vm,
3790
- listeners,
3791
- oldListeners
3792
- ) {
3793
- target = vm;
3794
- updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
3795
- target = undefined;
3796
- }
3797
-
3798
- function eventsMixin (Vue) {
3799
- var hookRE = /^hook:/;
3800
- Vue.prototype.$on = function (event, fn) {
3801
- var vm = this;
3802
- if (Array.isArray(event)) {
3803
- for (var i = 0, l = event.length; i < l; i++) {
3804
- vm.$on(event[i], fn);
3805
- }
3806
- } else {
3807
- (vm._events[event] || (vm._events[event] = [])).push(fn);
3808
- // optimize hook:event cost by using a boolean flag marked at registration
3809
- // instead of a hash lookup
3810
- if (hookRE.test(event)) {
3811
- vm._hasHookEvent = true;
3812
- }
3813
- }
3814
- return vm
3815
- };
3816
-
3817
- Vue.prototype.$once = function (event, fn) {
3818
- var vm = this;
3819
- function on () {
3820
- vm.$off(event, on);
3821
- fn.apply(vm, arguments);
3822
- }
3823
- on.fn = fn;
3824
- vm.$on(event, on);
3825
- return vm
3826
- };
3827
-
3828
- Vue.prototype.$off = function (event, fn) {
3829
- var vm = this;
3830
- // all
3831
- if (!arguments.length) {
3832
- vm._events = Object.create(null);
3833
- return vm
3834
- }
3835
- // array of events
3836
- if (Array.isArray(event)) {
3837
- for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
3838
- vm.$off(event[i$1], fn);
3839
- }
3840
- return vm
3841
- }
3842
- // specific event
3843
- var cbs = vm._events[event];
3844
- if (!cbs) {
3845
- return vm
3846
- }
3847
- if (!fn) {
3848
- vm._events[event] = null;
3849
- return vm
3850
- }
3851
- // specific handler
3852
- var cb;
3853
- var i = cbs.length;
3854
- while (i--) {
3855
- cb = cbs[i];
3856
- if (cb === fn || cb.fn === fn) {
3857
- cbs.splice(i, 1);
3858
- break
3859
- }
3860
- }
3861
- return vm
3862
- };
3863
-
3864
- Vue.prototype.$emit = function (event) {
3865
- var vm = this;
3866
- {
3867
- var lowerCaseEvent = event.toLowerCase();
3868
- if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
3869
- tip(
3870
- "Event \"" + lowerCaseEvent + "\" is emitted in component " +
3871
- (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
3872
- "Note that HTML attributes are case-insensitive and you cannot use " +
3873
- "v-on to listen to camelCase events when using in-DOM templates. " +
3874
- "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
3875
- );
3876
- }
3877
- }
3878
- var cbs = vm._events[event];
3879
- if (cbs) {
3880
- cbs = cbs.length > 1 ? toArray(cbs) : cbs;
3881
- var args = toArray(arguments, 1);
3882
- var info = "event handler for \"" + event + "\"";
3883
- for (var i = 0, l = cbs.length; i < l; i++) {
3884
- invokeWithErrorHandling(cbs[i], vm, args, vm, info);
3885
- }
3886
- }
3887
- return vm
3888
- };
3889
- }
3890
-
3891
- /* */
3892
-
3893
- var activeInstance = null;
3894
- var isUpdatingChildComponent = false;
3895
-
3896
- function setActiveInstance(vm) {
3897
- var prevActiveInstance = activeInstance;
3898
- activeInstance = vm;
3899
- return function () {
3900
- activeInstance = prevActiveInstance;
3901
- }
3902
- }
3903
-
3904
- function initLifecycle (vm) {
3905
- var options = vm.$options;
3906
-
3907
- // locate first non-abstract parent
3908
- var parent = options.parent;
3909
- if (parent && !options.abstract) {
3910
- while (parent.$options.abstract && parent.$parent) {
3911
- parent = parent.$parent;
3912
- }
3913
- parent.$children.push(vm);
3914
- }
3915
-
3916
- vm.$parent = parent;
3917
- vm.$root = parent ? parent.$root : vm;
3918
-
3919
- vm.$children = [];
3920
- vm.$refs = {};
3921
-
3922
- vm._watcher = null;
3923
- vm._inactive = null;
3924
- vm._directInactive = false;
3925
- vm._isMounted = false;
3926
- vm._isDestroyed = false;
3927
- vm._isBeingDestroyed = false;
3928
- }
3929
-
3930
- function lifecycleMixin (Vue) {
3931
- Vue.prototype._update = function (vnode, hydrating) {
3932
- var vm = this;
3933
- var prevEl = vm.$el;
3934
- var prevVnode = vm._vnode;
3935
- var restoreActiveInstance = setActiveInstance(vm);
3936
- vm._vnode = vnode;
3937
- // Vue.prototype.__patch__ is injected in entry points
3938
- // based on the rendering backend used.
3939
- if (!prevVnode) {
3940
- // initial render
3941
- vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
3942
- } else {
3943
- // updates
3944
- vm.$el = vm.__patch__(prevVnode, vnode);
3945
- }
3946
- restoreActiveInstance();
3947
- // update __vue__ reference
3948
- if (prevEl) {
3949
- prevEl.__vue__ = null;
3950
- }
3951
- if (vm.$el) {
3952
- vm.$el.__vue__ = vm;
3953
- }
3954
- // if parent is an HOC, update its $el as well
3955
- if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
3956
- vm.$parent.$el = vm.$el;
3957
- }
3958
- // updated hook is called by the scheduler to ensure that children are
3959
- // updated in a parent's updated hook.
3960
- };
3961
-
3962
- Vue.prototype.$forceUpdate = function () {
3963
- var vm = this;
3964
- if (vm._watcher) {
3965
- vm._watcher.update();
3966
- }
3967
- };
3968
-
3969
- Vue.prototype.$destroy = function () {
3970
- var vm = this;
3971
- if (vm._isBeingDestroyed) {
3972
- return
3973
- }
3974
- callHook(vm, 'beforeDestroy');
3975
- vm._isBeingDestroyed = true;
3976
- // remove self from parent
3977
- var parent = vm.$parent;
3978
- if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
3979
- remove(parent.$children, vm);
3980
- }
3981
- // teardown watchers
3982
- if (vm._watcher) {
3983
- vm._watcher.teardown();
3984
- }
3985
- var i = vm._watchers.length;
3986
- while (i--) {
3987
- vm._watchers[i].teardown();
3988
- }
3989
- // remove reference from data ob
3990
- // frozen object may not have observer.
3991
- if (vm._data.__ob__) {
3992
- vm._data.__ob__.vmCount--;
3993
- }
3994
- // call the last hook...
3995
- vm._isDestroyed = true;
3996
- // invoke destroy hooks on current rendered tree
3997
- vm.__patch__(vm._vnode, null);
3998
- // fire destroyed hook
3999
- callHook(vm, 'destroyed');
4000
- // turn off all instance listeners.
4001
- vm.$off();
4002
- // remove __vue__ reference
4003
- if (vm.$el) {
4004
- vm.$el.__vue__ = null;
4005
- }
4006
- // release circular reference (#6759)
4007
- if (vm.$vnode) {
4008
- vm.$vnode.parent = null;
4009
- }
4010
- };
4011
- }
4012
-
4013
- function mountComponent (
4014
- vm,
4015
- el,
4016
- hydrating
4017
- ) {
4018
- vm.$el = el;
4019
- if (!vm.$options.render) {
4020
- vm.$options.render = createEmptyVNode;
4021
- {
4022
- /* istanbul ignore if */
4023
- if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
4024
- vm.$options.el || el) {
4025
- warn(
4026
- 'You are using the runtime-only build of Vue where the template ' +
4027
- 'compiler is not available. Either pre-compile the templates into ' +
4028
- 'render functions, or use the compiler-included build.',
4029
- vm
4030
- );
4031
- } else {
4032
- warn(
4033
- 'Failed to mount component: template or render function not defined.',
4034
- vm
4035
- );
4036
- }
4037
- }
4038
- }
4039
- callHook(vm, 'beforeMount');
4040
-
4041
- var updateComponent;
4042
- /* istanbul ignore if */
4043
- if (config.performance && mark) {
4044
- updateComponent = function () {
4045
- var name = vm._name;
4046
- var id = vm._uid;
4047
- var startTag = "vue-perf-start:" + id;
4048
- var endTag = "vue-perf-end:" + id;
4049
-
4050
- mark(startTag);
4051
- var vnode = vm._render();
4052
- mark(endTag);
4053
- measure(("vue " + name + " render"), startTag, endTag);
4054
-
4055
- mark(startTag);
4056
- vm._update(vnode, hydrating);
4057
- mark(endTag);
4058
- measure(("vue " + name + " patch"), startTag, endTag);
4059
- };
4060
- } else {
4061
- updateComponent = function () {
4062
- vm._update(vm._render(), hydrating);
4063
- };
4064
- }
4065
-
4066
- // we set this to vm._watcher inside the watcher's constructor
4067
- // since the watcher's initial patch may call $forceUpdate (e.g. inside child
4068
- // component's mounted hook), which relies on vm._watcher being already defined
4069
- new Watcher(vm, updateComponent, noop, {
4070
- before: function before () {
4071
- if (vm._isMounted && !vm._isDestroyed) {
4072
- callHook(vm, 'beforeUpdate');
4073
- }
4074
- }
4075
- }, true /* isRenderWatcher */);
4076
- hydrating = false;
4077
-
4078
- // manually mounted instance, call mounted on self
4079
- // mounted is called for render-created child components in its inserted hook
4080
- if (vm.$vnode == null) {
4081
- vm._isMounted = true;
4082
- callHook(vm, 'mounted');
4083
- }
4084
- return vm
4085
- }
4086
-
4087
- function updateChildComponent (
4088
- vm,
4089
- propsData,
4090
- listeners,
4091
- parentVnode,
4092
- renderChildren
4093
- ) {
4094
- {
4095
- isUpdatingChildComponent = true;
4096
- }
4097
-
4098
- // determine whether component has slot children
4099
- // we need to do this before overwriting $options._renderChildren.
4100
-
4101
- // check if there are dynamic scopedSlots (hand-written or compiled but with
4102
- // dynamic slot names). Static scoped slots compiled from template has the
4103
- // "$stable" marker.
4104
- var newScopedSlots = parentVnode.data.scopedSlots;
4105
- var oldScopedSlots = vm.$scopedSlots;
4106
- var hasDynamicScopedSlot = !!(
4107
- (newScopedSlots && !newScopedSlots.$stable) ||
4108
- (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
4109
- (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
4110
- );
4111
-
4112
- // Any static slot children from the parent may have changed during parent's
4113
- // update. Dynamic scoped slots may also have changed. In such cases, a forced
4114
- // update is necessary to ensure correctness.
4115
- var needsForceUpdate = !!(
4116
- renderChildren || // has new static slots
4117
- vm.$options._renderChildren || // has old static slots
4118
- hasDynamicScopedSlot
4119
- );
4120
-
4121
- vm.$options._parentVnode = parentVnode;
4122
- vm.$vnode = parentVnode; // update vm's placeholder node without re-render
4123
-
4124
- if (vm._vnode) { // update child tree's parent
4125
- vm._vnode.parent = parentVnode;
4126
- }
4127
- vm.$options._renderChildren = renderChildren;
4128
-
4129
- // update $attrs and $listeners hash
4130
- // these are also reactive so they may trigger child update if the child
4131
- // used them during render
4132
- vm.$attrs = parentVnode.data.attrs || emptyObject;
4133
- vm.$listeners = listeners || emptyObject;
4134
-
4135
- // update props
4136
- if (propsData && vm.$options.props) {
4137
- toggleObserving(false);
4138
- var props = vm._props;
4139
- var propKeys = vm.$options._propKeys || [];
4140
- for (var i = 0; i < propKeys.length; i++) {
4141
- var key = propKeys[i];
4142
- var propOptions = vm.$options.props; // wtf flow?
4143
- props[key] = validateProp(key, propOptions, propsData, vm);
4144
- }
4145
- toggleObserving(true);
4146
- // keep a copy of raw propsData
4147
- vm.$options.propsData = propsData;
4148
- }
4149
-
4150
- // update listeners
4151
- listeners = listeners || emptyObject;
4152
- var oldListeners = vm.$options._parentListeners;
4153
- vm.$options._parentListeners = listeners;
4154
- updateComponentListeners(vm, listeners, oldListeners);
4155
-
4156
- // resolve slots + force update if has children
4157
- if (needsForceUpdate) {
4158
- vm.$slots = resolveSlots(renderChildren, parentVnode.context);
4159
- vm.$forceUpdate();
4160
- }
4161
-
4162
- {
4163
- isUpdatingChildComponent = false;
4164
- }
4165
- }
4166
-
4167
- function isInInactiveTree (vm) {
4168
- while (vm && (vm = vm.$parent)) {
4169
- if (vm._inactive) { return true }
4170
- }
4171
- return false
4172
- }
4173
-
4174
- function activateChildComponent (vm, direct) {
4175
- if (direct) {
4176
- vm._directInactive = false;
4177
- if (isInInactiveTree(vm)) {
4178
- return
4179
- }
4180
- } else if (vm._directInactive) {
4181
- return
4182
- }
4183
- if (vm._inactive || vm._inactive === null) {
4184
- vm._inactive = false;
4185
- for (var i = 0; i < vm.$children.length; i++) {
4186
- activateChildComponent(vm.$children[i]);
4187
- }
4188
- callHook(vm, 'activated');
4189
- }
4190
- }
4191
-
4192
- function deactivateChildComponent (vm, direct) {
4193
- if (direct) {
4194
- vm._directInactive = true;
4195
- if (isInInactiveTree(vm)) {
4196
- return
4197
- }
4198
- }
4199
- if (!vm._inactive) {
4200
- vm._inactive = true;
4201
- for (var i = 0; i < vm.$children.length; i++) {
4202
- deactivateChildComponent(vm.$children[i]);
4203
- }
4204
- callHook(vm, 'deactivated');
4205
- }
4206
- }
4207
-
4208
- function callHook (vm, hook) {
4209
- // #7573 disable dep collection when invoking lifecycle hooks
4210
- pushTarget();
4211
- var handlers = vm.$options[hook];
4212
- var info = hook + " hook";
4213
- if (handlers) {
4214
- for (var i = 0, j = handlers.length; i < j; i++) {
4215
- invokeWithErrorHandling(handlers[i], vm, null, vm, info);
4216
- }
4217
- }
4218
- if (vm._hasHookEvent) {
4219
- vm.$emit('hook:' + hook);
4220
- }
4221
- popTarget();
4222
- }
4223
-
4224
- /* */
4225
-
4226
- var MAX_UPDATE_COUNT = 100;
4227
-
4228
- var queue = [];
4229
- var activatedChildren = [];
4230
- var has = {};
4231
- var circular = {};
4232
- var waiting = false;
4233
- var flushing = false;
4234
- var index = 0;
4235
-
4236
- /**
4237
- * Reset the scheduler's state.
4238
- */
4239
- function resetSchedulerState () {
4240
- index = queue.length = activatedChildren.length = 0;
4241
- has = {};
4242
- {
4243
- circular = {};
4244
- }
4245
- waiting = flushing = false;
4246
- }
4247
-
4248
- // Async edge case #6566 requires saving the timestamp when event listeners are
4249
- // attached. However, calling performance.now() has a perf overhead especially
4250
- // if the page has thousands of event listeners. Instead, we take a timestamp
4251
- // every time the scheduler flushes and use that for all event listeners
4252
- // attached during that flush.
4253
- var currentFlushTimestamp = 0;
4254
-
4255
- // Async edge case fix requires storing an event listener's attach timestamp.
4256
- var getNow = Date.now;
4257
-
4258
- // Determine what event timestamp the browser is using. Annoyingly, the
4259
- // timestamp can either be hi-res (relative to page load) or low-res
4260
- // (relative to UNIX epoch), so in order to compare time we have to use the
4261
- // same timestamp type when saving the flush timestamp.
4262
- // All IE versions use low-res event timestamps, and have problematic clock
4263
- // implementations (#9632)
4264
- if (inBrowser && !isIE) {
4265
- var performance = window.performance;
4266
- if (
4267
- performance &&
4268
- typeof performance.now === 'function' &&
4269
- getNow() > document.createEvent('Event').timeStamp
4270
- ) {
4271
- // if the event timestamp, although evaluated AFTER the Date.now(), is
4272
- // smaller than it, it means the event is using a hi-res timestamp,
4273
- // and we need to use the hi-res version for event listener timestamps as
4274
- // well.
4275
- getNow = function () { return performance.now(); };
4276
- }
4277
- }
4278
-
4279
- /**
4280
- * Flush both queues and run the watchers.
4281
- */
4282
- function flushSchedulerQueue () {
4283
- currentFlushTimestamp = getNow();
4284
- flushing = true;
4285
- var watcher, id;
4286
-
4287
- // Sort queue before flush.
4288
- // This ensures that:
4289
- // 1. Components are updated from parent to child. (because parent is always
4290
- // created before the child)
4291
- // 2. A component's user watchers are run before its render watcher (because
4292
- // user watchers are created before the render watcher)
4293
- // 3. If a component is destroyed during a parent component's watcher run,
4294
- // its watchers can be skipped.
4295
- queue.sort(function (a, b) { return a.id - b.id; });
4296
-
4297
- // do not cache length because more watchers might be pushed
4298
- // as we run existing watchers
4299
- for (index = 0; index < queue.length; index++) {
4300
- watcher = queue[index];
4301
- if (watcher.before) {
4302
- watcher.before();
4303
- }
4304
- id = watcher.id;
4305
- has[id] = null;
4306
- watcher.run();
4307
- // in dev build, check and stop circular updates.
4308
- if (has[id] != null) {
4309
- circular[id] = (circular[id] || 0) + 1;
4310
- if (circular[id] > MAX_UPDATE_COUNT) {
4311
- warn(
4312
- 'You may have an infinite update loop ' + (
4313
- watcher.user
4314
- ? ("in watcher with expression \"" + (watcher.expression) + "\"")
4315
- : "in a component render function."
4316
- ),
4317
- watcher.vm
4318
- );
4319
- break
4320
- }
4321
- }
4322
- }
4323
-
4324
- // keep copies of post queues before resetting state
4325
- var activatedQueue = activatedChildren.slice();
4326
- var updatedQueue = queue.slice();
4327
-
4328
- resetSchedulerState();
4329
-
4330
- // call component updated and activated hooks
4331
- callActivatedHooks(activatedQueue);
4332
- callUpdatedHooks(updatedQueue);
4333
-
4334
- // devtool hook
4335
- /* istanbul ignore if */
4336
- if (devtools && config.devtools) {
4337
- devtools.emit('flush');
4338
- }
4339
- }
4340
-
4341
- function callUpdatedHooks (queue) {
4342
- var i = queue.length;
4343
- while (i--) {
4344
- var watcher = queue[i];
4345
- var vm = watcher.vm;
4346
- if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
4347
- callHook(vm, 'updated');
4348
- }
4349
- }
4350
- }
4351
-
4352
- /**
4353
- * Queue a kept-alive component that was activated during patch.
4354
- * The queue will be processed after the entire tree has been patched.
4355
- */
4356
- function queueActivatedComponent (vm) {
4357
- // setting _inactive to false here so that a render function can
4358
- // rely on checking whether it's in an inactive tree (e.g. router-view)
4359
- vm._inactive = false;
4360
- activatedChildren.push(vm);
4361
- }
4362
-
4363
- function callActivatedHooks (queue) {
4364
- for (var i = 0; i < queue.length; i++) {
4365
- queue[i]._inactive = true;
4366
- activateChildComponent(queue[i], true /* true */);
4367
- }
4368
- }
4369
-
4370
- /**
4371
- * Push a watcher into the watcher queue.
4372
- * Jobs with duplicate IDs will be skipped unless it's
4373
- * pushed when the queue is being flushed.
4374
- */
4375
- function queueWatcher (watcher) {
4376
- var id = watcher.id;
4377
- if (has[id] == null) {
4378
- has[id] = true;
4379
- if (!flushing) {
4380
- queue.push(watcher);
4381
- } else {
4382
- // if already flushing, splice the watcher based on its id
4383
- // if already past its id, it will be run next immediately.
4384
- var i = queue.length - 1;
4385
- while (i > index && queue[i].id > watcher.id) {
4386
- i--;
4387
- }
4388
- queue.splice(i + 1, 0, watcher);
4389
- }
4390
- // queue the flush
4391
- if (!waiting) {
4392
- waiting = true;
4393
-
4394
- if (!config.async) {
4395
- flushSchedulerQueue();
4396
- return
4397
- }
4398
- nextTick(flushSchedulerQueue);
4399
- }
4400
- }
4401
- }
4402
-
4403
- /* */
4404
-
4405
-
4406
-
4407
- var uid$2 = 0;
4408
-
4409
- /**
4410
- * A watcher parses an expression, collects dependencies,
4411
- * and fires callback when the expression value changes.
4412
- * This is used for both the $watch() api and directives.
4413
- */
4414
- var Watcher = function Watcher (
4415
- vm,
4416
- expOrFn,
4417
- cb,
4418
- options,
4419
- isRenderWatcher
4420
- ) {
4421
- this.vm = vm;
4422
- if (isRenderWatcher) {
4423
- vm._watcher = this;
4424
- }
4425
- vm._watchers.push(this);
4426
- // options
4427
- if (options) {
4428
- this.deep = !!options.deep;
4429
- this.user = !!options.user;
4430
- this.lazy = !!options.lazy;
4431
- this.sync = !!options.sync;
4432
- this.before = options.before;
4433
- } else {
4434
- this.deep = this.user = this.lazy = this.sync = false;
4435
- }
4436
- this.cb = cb;
4437
- this.id = ++uid$2; // uid for batching
4438
- this.active = true;
4439
- this.dirty = this.lazy; // for lazy watchers
4440
- this.deps = [];
4441
- this.newDeps = [];
4442
- this.depIds = new _Set();
4443
- this.newDepIds = new _Set();
4444
- this.expression = expOrFn.toString();
4445
- // parse expression for getter
4446
- if (typeof expOrFn === 'function') {
4447
- this.getter = expOrFn;
4448
- } else {
4449
- this.getter = parsePath(expOrFn);
4450
- if (!this.getter) {
4451
- this.getter = noop;
4452
- warn(
4453
- "Failed watching path: \"" + expOrFn + "\" " +
4454
- 'Watcher only accepts simple dot-delimited paths. ' +
4455
- 'For full control, use a function instead.',
4456
- vm
4457
- );
4458
- }
4459
- }
4460
- this.value = this.lazy
4461
- ? undefined
4462
- : this.get();
4463
- };
4464
-
4465
- /**
4466
- * Evaluate the getter, and re-collect dependencies.
4467
- */
4468
- Watcher.prototype.get = function get () {
4469
- pushTarget(this);
4470
- var value;
4471
- var vm = this.vm;
4472
- try {
4473
- value = this.getter.call(vm, vm);
4474
- } catch (e) {
4475
- if (this.user) {
4476
- handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
4477
- } else {
4478
- throw e
4479
- }
4480
- } finally {
4481
- // "touch" every property so they are all tracked as
4482
- // dependencies for deep watching
4483
- if (this.deep) {
4484
- traverse(value);
4485
- }
4486
- popTarget();
4487
- this.cleanupDeps();
4488
- }
4489
- return value
4490
- };
4491
-
4492
- /**
4493
- * Add a dependency to this directive.
4494
- */
4495
- Watcher.prototype.addDep = function addDep (dep) {
4496
- var id = dep.id;
4497
- if (!this.newDepIds.has(id)) {
4498
- this.newDepIds.add(id);
4499
- this.newDeps.push(dep);
4500
- if (!this.depIds.has(id)) {
4501
- dep.addSub(this);
4502
- }
4503
- }
4504
- };
4505
-
4506
- /**
4507
- * Clean up for dependency collection.
4508
- */
4509
- Watcher.prototype.cleanupDeps = function cleanupDeps () {
4510
- var i = this.deps.length;
4511
- while (i--) {
4512
- var dep = this.deps[i];
4513
- if (!this.newDepIds.has(dep.id)) {
4514
- dep.removeSub(this);
4515
- }
4516
- }
4517
- var tmp = this.depIds;
4518
- this.depIds = this.newDepIds;
4519
- this.newDepIds = tmp;
4520
- this.newDepIds.clear();
4521
- tmp = this.deps;
4522
- this.deps = this.newDeps;
4523
- this.newDeps = tmp;
4524
- this.newDeps.length = 0;
4525
- };
4526
-
4527
- /**
4528
- * Subscriber interface.
4529
- * Will be called when a dependency changes.
4530
- */
4531
- Watcher.prototype.update = function update () {
4532
- /* istanbul ignore else */
4533
- if (this.lazy) {
4534
- this.dirty = true;
4535
- } else if (this.sync) {
4536
- this.run();
4537
- } else {
4538
- queueWatcher(this);
4539
- }
4540
- };
4541
-
4542
- /**
4543
- * Scheduler job interface.
4544
- * Will be called by the scheduler.
4545
- */
4546
- Watcher.prototype.run = function run () {
4547
- if (this.active) {
4548
- var value = this.get();
4549
- if (
4550
- value !== this.value ||
4551
- // Deep watchers and watchers on Object/Arrays should fire even
4552
- // when the value is the same, because the value may
4553
- // have mutated.
4554
- isObject(value) ||
4555
- this.deep
4556
- ) {
4557
- // set new value
4558
- var oldValue = this.value;
4559
- this.value = value;
4560
- if (this.user) {
4561
- try {
4562
- this.cb.call(this.vm, value, oldValue);
4563
- } catch (e) {
4564
- handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
4565
- }
4566
- } else {
4567
- this.cb.call(this.vm, value, oldValue);
4568
- }
4569
- }
4570
- }
4571
- };
4572
-
4573
- /**
4574
- * Evaluate the value of the watcher.
4575
- * This only gets called for lazy watchers.
4576
- */
4577
- Watcher.prototype.evaluate = function evaluate () {
4578
- this.value = this.get();
4579
- this.dirty = false;
4580
- };
4581
-
4582
- /**
4583
- * Depend on all deps collected by this watcher.
4584
- */
4585
- Watcher.prototype.depend = function depend () {
4586
- var i = this.deps.length;
4587
- while (i--) {
4588
- this.deps[i].depend();
4589
- }
4590
- };
4591
-
4592
- /**
4593
- * Remove self from all dependencies' subscriber list.
4594
- */
4595
- Watcher.prototype.teardown = function teardown () {
4596
- if (this.active) {
4597
- // remove self from vm's watcher list
4598
- // this is a somewhat expensive operation so we skip it
4599
- // if the vm is being destroyed.
4600
- if (!this.vm._isBeingDestroyed) {
4601
- remove(this.vm._watchers, this);
4602
- }
4603
- var i = this.deps.length;
4604
- while (i--) {
4605
- this.deps[i].removeSub(this);
4606
- }
4607
- this.active = false;
4608
- }
4609
- };
4610
-
4611
- /* */
4612
-
4613
- var sharedPropertyDefinition = {
4614
- enumerable: true,
4615
- configurable: true,
4616
- get: noop,
4617
- set: noop
4618
- };
4619
-
4620
- function proxy (target, sourceKey, key) {
4621
- sharedPropertyDefinition.get = function proxyGetter () {
4622
- return this[sourceKey][key]
4623
- };
4624
- sharedPropertyDefinition.set = function proxySetter (val) {
4625
- this[sourceKey][key] = val;
4626
- };
4627
- Object.defineProperty(target, key, sharedPropertyDefinition);
4628
- }
4629
-
4630
- function initState (vm) {
4631
- vm._watchers = [];
4632
- var opts = vm.$options;
4633
- if (opts.props) { initProps(vm, opts.props); }
4634
- if (opts.methods) { initMethods(vm, opts.methods); }
4635
- if (opts.data) {
4636
- initData(vm);
4637
- } else {
4638
- observe(vm._data = {}, true /* asRootData */);
4639
- }
4640
- if (opts.computed) { initComputed(vm, opts.computed); }
4641
- if (opts.watch && opts.watch !== nativeWatch) {
4642
- initWatch(vm, opts.watch);
4643
- }
4644
- }
4645
-
4646
- function initProps (vm, propsOptions) {
4647
- var propsData = vm.$options.propsData || {};
4648
- var props = vm._props = {};
4649
- // cache prop keys so that future props updates can iterate using Array
4650
- // instead of dynamic object key enumeration.
4651
- var keys = vm.$options._propKeys = [];
4652
- var isRoot = !vm.$parent;
4653
- // root instance props should be converted
4654
- if (!isRoot) {
4655
- toggleObserving(false);
4656
- }
4657
- var loop = function ( key ) {
4658
- keys.push(key);
4659
- var value = validateProp(key, propsOptions, propsData, vm);
4660
- /* istanbul ignore else */
4661
- {
4662
- var hyphenatedKey = hyphenate(key);
4663
- if (isReservedAttribute(hyphenatedKey) ||
4664
- config.isReservedAttr(hyphenatedKey)) {
4665
- warn(
4666
- ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
4667
- vm
4668
- );
4669
- }
4670
- defineReactive$$1(props, key, value, function () {
4671
- if (!isRoot && !isUpdatingChildComponent) {
4672
- warn(
4673
- "Avoid mutating a prop directly since the value will be " +
4674
- "overwritten whenever the parent component re-renders. " +
4675
- "Instead, use a data or computed property based on the prop's " +
4676
- "value. Prop being mutated: \"" + key + "\"",
4677
- vm
4678
- );
4679
- }
4680
- });
4681
- }
4682
- // static props are already proxied on the component's prototype
4683
- // during Vue.extend(). We only need to proxy props defined at
4684
- // instantiation here.
4685
- if (!(key in vm)) {
4686
- proxy(vm, "_props", key);
4687
- }
4688
- };
4689
-
4690
- for (var key in propsOptions) loop( key );
4691
- toggleObserving(true);
4692
- }
4693
-
4694
- function initData (vm) {
4695
- var data = vm.$options.data;
4696
- data = vm._data = typeof data === 'function'
4697
- ? getData(data, vm)
4698
- : data || {};
4699
- if (!isPlainObject(data)) {
4700
- data = {};
4701
- warn(
4702
- 'data functions should return an object:\n' +
4703
- 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
4704
- vm
4705
- );
4706
- }
4707
- // proxy data on instance
4708
- var keys = Object.keys(data);
4709
- var props = vm.$options.props;
4710
- var methods = vm.$options.methods;
4711
- var i = keys.length;
4712
- while (i--) {
4713
- var key = keys[i];
4714
- {
4715
- if (methods && hasOwn(methods, key)) {
4716
- warn(
4717
- ("Method \"" + key + "\" has already been defined as a data property."),
4718
- vm
4719
- );
4720
- }
4721
- }
4722
- if (props && hasOwn(props, key)) {
4723
- warn(
4724
- "The data property \"" + key + "\" is already declared as a prop. " +
4725
- "Use prop default value instead.",
4726
- vm
4727
- );
4728
- } else if (!isReserved(key)) {
4729
- proxy(vm, "_data", key);
4730
- }
4731
- }
4732
- // observe data
4733
- observe(data, true /* asRootData */);
4734
- }
4735
-
4736
- function getData (data, vm) {
4737
- // #7573 disable dep collection when invoking data getters
4738
- pushTarget();
4739
- try {
4740
- return data.call(vm, vm)
4741
- } catch (e) {
4742
- handleError(e, vm, "data()");
4743
- return {}
4744
- } finally {
4745
- popTarget();
4746
- }
4747
- }
4748
-
4749
- var computedWatcherOptions = { lazy: true };
4750
-
4751
- function initComputed (vm, computed) {
4752
- // $flow-disable-line
4753
- var watchers = vm._computedWatchers = Object.create(null);
4754
- // computed properties are just getters during SSR
4755
- var isSSR = isServerRendering();
4756
-
4757
- for (var key in computed) {
4758
- var userDef = computed[key];
4759
- var getter = typeof userDef === 'function' ? userDef : userDef.get;
4760
- if (getter == null) {
4761
- warn(
4762
- ("Getter is missing for computed property \"" + key + "\"."),
4763
- vm
4764
- );
4765
- }
4766
-
4767
- if (!isSSR) {
4768
- // create internal watcher for the computed property.
4769
- watchers[key] = new Watcher(
4770
- vm,
4771
- getter || noop,
4772
- noop,
4773
- computedWatcherOptions
4774
- );
4775
- }
4776
-
4777
- // component-defined computed properties are already defined on the
4778
- // component prototype. We only need to define computed properties defined
4779
- // at instantiation here.
4780
- if (!(key in vm)) {
4781
- defineComputed(vm, key, userDef);
4782
- } else {
4783
- if (key in vm.$data) {
4784
- warn(("The computed property \"" + key + "\" is already defined in data."), vm);
4785
- } else if (vm.$options.props && key in vm.$options.props) {
4786
- warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
4787
- }
4788
- }
4789
- }
4790
- }
4791
-
4792
- function defineComputed (
4793
- target,
4794
- key,
4795
- userDef
4796
- ) {
4797
- var shouldCache = !isServerRendering();
4798
- if (typeof userDef === 'function') {
4799
- sharedPropertyDefinition.get = shouldCache
4800
- ? createComputedGetter(key)
4801
- : createGetterInvoker(userDef);
4802
- sharedPropertyDefinition.set = noop;
4803
- } else {
4804
- sharedPropertyDefinition.get = userDef.get
4805
- ? shouldCache && userDef.cache !== false
4806
- ? createComputedGetter(key)
4807
- : createGetterInvoker(userDef.get)
4808
- : noop;
4809
- sharedPropertyDefinition.set = userDef.set || noop;
4810
- }
4811
- if (sharedPropertyDefinition.set === noop) {
4812
- sharedPropertyDefinition.set = function () {
4813
- warn(
4814
- ("Computed property \"" + key + "\" was assigned to but it has no setter."),
4815
- this
4816
- );
4817
- };
4818
- }
4819
- Object.defineProperty(target, key, sharedPropertyDefinition);
4820
- }
4821
-
4822
- function createComputedGetter (key) {
4823
- return function computedGetter () {
4824
- var watcher = this._computedWatchers && this._computedWatchers[key];
4825
- if (watcher) {
4826
- if (watcher.dirty) {
4827
- watcher.evaluate();
4828
- }
4829
- if (Dep.target) {
4830
- watcher.depend();
4831
- }
4832
- return watcher.value
4833
- }
4834
- }
4835
- }
4836
-
4837
- function createGetterInvoker(fn) {
4838
- return function computedGetter () {
4839
- return fn.call(this, this)
4840
- }
4841
- }
4842
-
4843
- function initMethods (vm, methods) {
4844
- var props = vm.$options.props;
4845
- for (var key in methods) {
4846
- {
4847
- if (typeof methods[key] !== 'function') {
4848
- warn(
4849
- "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
4850
- "Did you reference the function correctly?",
4851
- vm
4852
- );
4853
- }
4854
- if (props && hasOwn(props, key)) {
4855
- warn(
4856
- ("Method \"" + key + "\" has already been defined as a prop."),
4857
- vm
4858
- );
4859
- }
4860
- if ((key in vm) && isReserved(key)) {
4861
- warn(
4862
- "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
4863
- "Avoid defining component methods that start with _ or $."
4864
- );
4865
- }
4866
- }
4867
- vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
4868
- }
4869
- }
4870
-
4871
- function initWatch (vm, watch) {
4872
- for (var key in watch) {
4873
- var handler = watch[key];
4874
- if (Array.isArray(handler)) {
4875
- for (var i = 0; i < handler.length; i++) {
4876
- createWatcher(vm, key, handler[i]);
4877
- }
4878
- } else {
4879
- createWatcher(vm, key, handler);
4880
- }
4881
- }
4882
- }
4883
-
4884
- function createWatcher (
4885
- vm,
4886
- expOrFn,
4887
- handler,
4888
- options
4889
- ) {
4890
- if (isPlainObject(handler)) {
4891
- options = handler;
4892
- handler = handler.handler;
4893
- }
4894
- if (typeof handler === 'string') {
4895
- handler = vm[handler];
4896
- }
4897
- return vm.$watch(expOrFn, handler, options)
4898
- }
4899
-
4900
- function stateMixin (Vue) {
4901
- // flow somehow has problems with directly declared definition object
4902
- // when using Object.defineProperty, so we have to procedurally build up
4903
- // the object here.
4904
- var dataDef = {};
4905
- dataDef.get = function () { return this._data };
4906
- var propsDef = {};
4907
- propsDef.get = function () { return this._props };
4908
- {
4909
- dataDef.set = function () {
4910
- warn(
4911
- 'Avoid replacing instance root $data. ' +
4912
- 'Use nested data properties instead.',
4913
- this
4914
- );
4915
- };
4916
- propsDef.set = function () {
4917
- warn("$props is readonly.", this);
4918
- };
4919
- }
4920
- Object.defineProperty(Vue.prototype, '$data', dataDef);
4921
- Object.defineProperty(Vue.prototype, '$props', propsDef);
4922
-
4923
- Vue.prototype.$set = set;
4924
- Vue.prototype.$delete = del;
4925
-
4926
- Vue.prototype.$watch = function (
4927
- expOrFn,
4928
- cb,
4929
- options
4930
- ) {
4931
- var vm = this;
4932
- if (isPlainObject(cb)) {
4933
- return createWatcher(vm, expOrFn, cb, options)
4934
- }
4935
- options = options || {};
4936
- options.user = true;
4937
- var watcher = new Watcher(vm, expOrFn, cb, options);
4938
- if (options.immediate) {
4939
- try {
4940
- cb.call(vm, watcher.value);
4941
- } catch (error) {
4942
- handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
4943
- }
4944
- }
4945
- return function unwatchFn () {
4946
- watcher.teardown();
4947
- }
4948
- };
4949
- }
4950
-
4951
- /* */
4952
-
4953
- var uid$3 = 0;
4954
-
4955
- function initMixin (Vue) {
4956
- Vue.prototype._init = function (options) {
4957
- var vm = this;
4958
- // a uid
4959
- vm._uid = uid$3++;
4960
-
4961
- var startTag, endTag;
4962
- /* istanbul ignore if */
4963
- if (config.performance && mark) {
4964
- startTag = "vue-perf-start:" + (vm._uid);
4965
- endTag = "vue-perf-end:" + (vm._uid);
4966
- mark(startTag);
4967
- }
4968
-
4969
- // a flag to avoid this being observed
4970
- vm._isVue = true;
4971
- // merge options
4972
- if (options && options._isComponent) {
4973
- // optimize internal component instantiation
4974
- // since dynamic options merging is pretty slow, and none of the
4975
- // internal component options needs special treatment.
4976
- initInternalComponent(vm, options);
4977
- } else {
4978
- vm.$options = mergeOptions(
4979
- resolveConstructorOptions(vm.constructor),
4980
- options || {},
4981
- vm
4982
- );
4983
- }
4984
- /* istanbul ignore else */
4985
- {
4986
- initProxy(vm);
4987
- }
4988
- // expose real self
4989
- vm._self = vm;
4990
- initLifecycle(vm);
4991
- initEvents(vm);
4992
- initRender(vm);
4993
- callHook(vm, 'beforeCreate');
4994
- initInjections(vm); // resolve injections before data/props
4995
- initState(vm);
4996
- initProvide(vm); // resolve provide after data/props
4997
- callHook(vm, 'created');
4998
-
4999
- /* istanbul ignore if */
5000
- if (config.performance && mark) {
5001
- vm._name = formatComponentName(vm, false);
5002
- mark(endTag);
5003
- measure(("vue " + (vm._name) + " init"), startTag, endTag);
5004
- }
5005
-
5006
- if (vm.$options.el) {
5007
- vm.$mount(vm.$options.el);
5008
- }
5009
- };
5010
- }
5011
-
5012
- function initInternalComponent (vm, options) {
5013
- var opts = vm.$options = Object.create(vm.constructor.options);
5014
- // doing this because it's faster than dynamic enumeration.
5015
- var parentVnode = options._parentVnode;
5016
- opts.parent = options.parent;
5017
- opts._parentVnode = parentVnode;
5018
-
5019
- var vnodeComponentOptions = parentVnode.componentOptions;
5020
- opts.propsData = vnodeComponentOptions.propsData;
5021
- opts._parentListeners = vnodeComponentOptions.listeners;
5022
- opts._renderChildren = vnodeComponentOptions.children;
5023
- opts._componentTag = vnodeComponentOptions.tag;
5024
-
5025
- if (options.render) {
5026
- opts.render = options.render;
5027
- opts.staticRenderFns = options.staticRenderFns;
5028
- }
5029
- }
5030
-
5031
- function resolveConstructorOptions (Ctor) {
5032
- var options = Ctor.options;
5033
- if (Ctor.super) {
5034
- var superOptions = resolveConstructorOptions(Ctor.super);
5035
- var cachedSuperOptions = Ctor.superOptions;
5036
- if (superOptions !== cachedSuperOptions) {
5037
- // super option changed,
5038
- // need to resolve new options.
5039
- Ctor.superOptions = superOptions;
5040
- // check if there are any late-modified/attached options (#4976)
5041
- var modifiedOptions = resolveModifiedOptions(Ctor);
5042
- // update base extend options
5043
- if (modifiedOptions) {
5044
- extend(Ctor.extendOptions, modifiedOptions);
5045
- }
5046
- options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
5047
- if (options.name) {
5048
- options.components[options.name] = Ctor;
5049
- }
5050
- }
5051
- }
5052
- return options
5053
- }
5054
-
5055
- function resolveModifiedOptions (Ctor) {
5056
- var modified;
5057
- var latest = Ctor.options;
5058
- var sealed = Ctor.sealedOptions;
5059
- for (var key in latest) {
5060
- if (latest[key] !== sealed[key]) {
5061
- if (!modified) { modified = {}; }
5062
- modified[key] = latest[key];
5063
- }
5064
- }
5065
- return modified
5066
- }
5067
-
5068
- function Vue (options) {
5069
- if (!(this instanceof Vue)
5070
- ) {
5071
- warn('Vue is a constructor and should be called with the `new` keyword');
5072
- }
5073
- this._init(options);
5074
- }
5075
-
5076
- initMixin(Vue);
5077
- stateMixin(Vue);
5078
- eventsMixin(Vue);
5079
- lifecycleMixin(Vue);
5080
- renderMixin(Vue);
5081
-
5082
- /* */
5083
-
5084
- function initUse (Vue) {
5085
- Vue.use = function (plugin) {
5086
- var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
5087
- if (installedPlugins.indexOf(plugin) > -1) {
5088
- return this
5089
- }
5090
-
5091
- // additional parameters
5092
- var args = toArray(arguments, 1);
5093
- args.unshift(this);
5094
- if (typeof plugin.install === 'function') {
5095
- plugin.install.apply(plugin, args);
5096
- } else if (typeof plugin === 'function') {
5097
- plugin.apply(null, args);
5098
- }
5099
- installedPlugins.push(plugin);
5100
- return this
5101
- };
5102
- }
5103
-
5104
- /* */
5105
-
5106
- function initMixin$1 (Vue) {
5107
- Vue.mixin = function (mixin) {
5108
- this.options = mergeOptions(this.options, mixin);
5109
- return this
5110
- };
5111
- }
5112
-
5113
- /* */
5114
-
5115
- function initExtend (Vue) {
5116
- /**
5117
- * Each instance constructor, including Vue, has a unique
5118
- * cid. This enables us to create wrapped "child
5119
- * constructors" for prototypal inheritance and cache them.
5120
- */
5121
- Vue.cid = 0;
5122
- var cid = 1;
5123
-
5124
- /**
5125
- * Class inheritance
5126
- */
5127
- Vue.extend = function (extendOptions) {
5128
- extendOptions = extendOptions || {};
5129
- var Super = this;
5130
- var SuperId = Super.cid;
5131
- var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
5132
- if (cachedCtors[SuperId]) {
5133
- return cachedCtors[SuperId]
5134
- }
5135
-
5136
- var name = extendOptions.name || Super.options.name;
5137
- if (name) {
5138
- validateComponentName(name);
5139
- }
5140
-
5141
- var Sub = function VueComponent (options) {
5142
- this._init(options);
5143
- };
5144
- Sub.prototype = Object.create(Super.prototype);
5145
- Sub.prototype.constructor = Sub;
5146
- Sub.cid = cid++;
5147
- Sub.options = mergeOptions(
5148
- Super.options,
5149
- extendOptions
5150
- );
5151
- Sub['super'] = Super;
5152
-
5153
- // For props and computed properties, we define the proxy getters on
5154
- // the Vue instances at extension time, on the extended prototype. This
5155
- // avoids Object.defineProperty calls for each instance created.
5156
- if (Sub.options.props) {
5157
- initProps$1(Sub);
5158
- }
5159
- if (Sub.options.computed) {
5160
- initComputed$1(Sub);
5161
- }
5162
-
5163
- // allow further extension/mixin/plugin usage
5164
- Sub.extend = Super.extend;
5165
- Sub.mixin = Super.mixin;
5166
- Sub.use = Super.use;
5167
-
5168
- // create asset registers, so extended classes
5169
- // can have their private assets too.
5170
- ASSET_TYPES.forEach(function (type) {
5171
- Sub[type] = Super[type];
5172
- });
5173
- // enable recursive self-lookup
5174
- if (name) {
5175
- Sub.options.components[name] = Sub;
5176
- }
5177
-
5178
- // keep a reference to the super options at extension time.
5179
- // later at instantiation we can check if Super's options have
5180
- // been updated.
5181
- Sub.superOptions = Super.options;
5182
- Sub.extendOptions = extendOptions;
5183
- Sub.sealedOptions = extend({}, Sub.options);
5184
-
5185
- // cache constructor
5186
- cachedCtors[SuperId] = Sub;
5187
- return Sub
5188
- };
5189
- }
5190
-
5191
- function initProps$1 (Comp) {
5192
- var props = Comp.options.props;
5193
- for (var key in props) {
5194
- proxy(Comp.prototype, "_props", key);
5195
- }
5196
- }
5197
-
5198
- function initComputed$1 (Comp) {
5199
- var computed = Comp.options.computed;
5200
- for (var key in computed) {
5201
- defineComputed(Comp.prototype, key, computed[key]);
5202
- }
5203
- }
5204
-
5205
- /* */
5206
-
5207
- function initAssetRegisters (Vue) {
5208
- /**
5209
- * Create asset registration methods.
5210
- */
5211
- ASSET_TYPES.forEach(function (type) {
5212
- Vue[type] = function (
5213
- id,
5214
- definition
5215
- ) {
5216
- if (!definition) {
5217
- return this.options[type + 's'][id]
5218
- } else {
5219
- /* istanbul ignore if */
5220
- if (type === 'component') {
5221
- validateComponentName(id);
5222
- }
5223
- if (type === 'component' && isPlainObject(definition)) {
5224
- definition.name = definition.name || id;
5225
- definition = this.options._base.extend(definition);
5226
- }
5227
- if (type === 'directive' && typeof definition === 'function') {
5228
- definition = { bind: definition, update: definition };
5229
- }
5230
- this.options[type + 's'][id] = definition;
5231
- return definition
5232
- }
5233
- };
5234
- });
5235
- }
5236
-
5237
- /* */
5238
-
5239
-
5240
-
5241
- function getComponentName (opts) {
5242
- return opts && (opts.Ctor.options.name || opts.tag)
5243
- }
5244
-
5245
- function matches (pattern, name) {
5246
- if (Array.isArray(pattern)) {
5247
- return pattern.indexOf(name) > -1
5248
- } else if (typeof pattern === 'string') {
5249
- return pattern.split(',').indexOf(name) > -1
5250
- } else if (isRegExp(pattern)) {
5251
- return pattern.test(name)
5252
- }
5253
- /* istanbul ignore next */
5254
- return false
5255
- }
5256
-
5257
- function pruneCache (keepAliveInstance, filter) {
5258
- var cache = keepAliveInstance.cache;
5259
- var keys = keepAliveInstance.keys;
5260
- var _vnode = keepAliveInstance._vnode;
5261
- for (var key in cache) {
5262
- var cachedNode = cache[key];
5263
- if (cachedNode) {
5264
- var name = getComponentName(cachedNode.componentOptions);
5265
- if (name && !filter(name)) {
5266
- pruneCacheEntry(cache, key, keys, _vnode);
5267
- }
5268
- }
5269
- }
5270
- }
5271
-
5272
- function pruneCacheEntry (
5273
- cache,
5274
- key,
5275
- keys,
5276
- current
5277
- ) {
5278
- var cached$$1 = cache[key];
5279
- if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
5280
- cached$$1.componentInstance.$destroy();
5281
- }
5282
- cache[key] = null;
5283
- remove(keys, key);
5284
- }
5285
-
5286
- var patternTypes = [String, RegExp, Array];
5287
-
5288
- var KeepAlive = {
5289
- name: 'keep-alive',
5290
- abstract: true,
5291
-
5292
- props: {
5293
- include: patternTypes,
5294
- exclude: patternTypes,
5295
- max: [String, Number]
5296
- },
5297
-
5298
- created: function created () {
5299
- this.cache = Object.create(null);
5300
- this.keys = [];
5301
- },
5302
-
5303
- destroyed: function destroyed () {
5304
- for (var key in this.cache) {
5305
- pruneCacheEntry(this.cache, key, this.keys);
5306
- }
5307
- },
5308
-
5309
- mounted: function mounted () {
5310
- var this$1 = this;
5311
-
5312
- this.$watch('include', function (val) {
5313
- pruneCache(this$1, function (name) { return matches(val, name); });
5314
- });
5315
- this.$watch('exclude', function (val) {
5316
- pruneCache(this$1, function (name) { return !matches(val, name); });
5317
- });
5318
- },
5319
-
5320
- render: function render () {
5321
- var slot = this.$slots.default;
5322
- var vnode = getFirstComponentChild(slot);
5323
- var componentOptions = vnode && vnode.componentOptions;
5324
- if (componentOptions) {
5325
- // check pattern
5326
- var name = getComponentName(componentOptions);
5327
- var ref = this;
5328
- var include = ref.include;
5329
- var exclude = ref.exclude;
5330
- if (
5331
- // not included
5332
- (include && (!name || !matches(include, name))) ||
5333
- // excluded
5334
- (exclude && name && matches(exclude, name))
5335
- ) {
5336
- return vnode
5337
- }
5338
-
5339
- var ref$1 = this;
5340
- var cache = ref$1.cache;
5341
- var keys = ref$1.keys;
5342
- var key = vnode.key == null
5343
- // same constructor may get registered as different local components
5344
- // so cid alone is not enough (#3269)
5345
- ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
5346
- : vnode.key;
5347
- if (cache[key]) {
5348
- vnode.componentInstance = cache[key].componentInstance;
5349
- // make current key freshest
5350
- remove(keys, key);
5351
- keys.push(key);
5352
- } else {
5353
- cache[key] = vnode;
5354
- keys.push(key);
5355
- // prune oldest entry
5356
- if (this.max && keys.length > parseInt(this.max)) {
5357
- pruneCacheEntry(cache, keys[0], keys, this._vnode);
5358
- }
5359
- }
5360
-
5361
- vnode.data.keepAlive = true;
5362
- }
5363
- return vnode || (slot && slot[0])
5364
- }
5365
- };
5366
-
5367
- var builtInComponents = {
5368
- KeepAlive: KeepAlive
5369
- };
5370
-
5371
- /* */
5372
-
5373
- function initGlobalAPI (Vue) {
5374
- // config
5375
- var configDef = {};
5376
- configDef.get = function () { return config; };
5377
- {
5378
- configDef.set = function () {
5379
- warn(
5380
- 'Do not replace the Vue.config object, set individual fields instead.'
5381
- );
5382
- };
5383
- }
5384
- Object.defineProperty(Vue, 'config', configDef);
5385
-
5386
- // exposed util methods.
5387
- // NOTE: these are not considered part of the public API - avoid relying on
5388
- // them unless you are aware of the risk.
5389
- Vue.util = {
5390
- warn: warn,
5391
- extend: extend,
5392
- mergeOptions: mergeOptions,
5393
- defineReactive: defineReactive$$1
5394
- };
5395
-
5396
- Vue.set = set;
5397
- Vue.delete = del;
5398
- Vue.nextTick = nextTick;
5399
-
5400
- // 2.6 explicit observable API
5401
- Vue.observable = function (obj) {
5402
- observe(obj);
5403
- return obj
5404
- };
5405
-
5406
- Vue.options = Object.create(null);
5407
- ASSET_TYPES.forEach(function (type) {
5408
- Vue.options[type + 's'] = Object.create(null);
5409
- });
5410
-
5411
- // this is used to identify the "base" constructor to extend all plain-object
5412
- // components with in Weex's multi-instance scenarios.
5413
- Vue.options._base = Vue;
5414
-
5415
- extend(Vue.options.components, builtInComponents);
5416
-
5417
- initUse(Vue);
5418
- initMixin$1(Vue);
5419
- initExtend(Vue);
5420
- initAssetRegisters(Vue);
5421
- }
5422
-
5423
- initGlobalAPI(Vue);
5424
-
5425
- Object.defineProperty(Vue.prototype, '$isServer', {
5426
- get: isServerRendering
5427
- });
5428
-
5429
- Object.defineProperty(Vue.prototype, '$ssrContext', {
5430
- get: function get () {
5431
- /* istanbul ignore next */
5432
- return this.$vnode && this.$vnode.ssrContext
5433
- }
5434
- });
5435
-
5436
- // expose FunctionalRenderContext for ssr runtime helper installation
5437
- Object.defineProperty(Vue, 'FunctionalRenderContext', {
5438
- value: FunctionalRenderContext
5439
- });
5440
-
5441
- Vue.version = '2.6.10';
5442
-
5443
- /* */
5444
-
5445
- // these are reserved for web because they are directly compiled away
5446
- // during template compilation
5447
- var isReservedAttr = makeMap('style,class');
5448
-
5449
- // attributes that should be using props for binding
5450
- var acceptValue = makeMap('input,textarea,option,select,progress');
5451
- var mustUseProp = function (tag, type, attr) {
5452
- return (
5453
- (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
5454
- (attr === 'selected' && tag === 'option') ||
5455
- (attr === 'checked' && tag === 'input') ||
5456
- (attr === 'muted' && tag === 'video')
5457
- )
5458
- };
5459
-
5460
- var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
5461
-
5462
- var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
5463
-
5464
- var convertEnumeratedValue = function (key, value) {
5465
- return isFalsyAttrValue(value) || value === 'false'
5466
- ? 'false'
5467
- // allow arbitrary string value for contenteditable
5468
- : key === 'contenteditable' && isValidContentEditableValue(value)
5469
- ? value
5470
- : 'true'
5471
- };
5472
-
5473
- var isBooleanAttr = makeMap(
5474
- 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
5475
- 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
5476
- 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
5477
- 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
5478
- 'required,reversed,scoped,seamless,selected,sortable,translate,' +
5479
- 'truespeed,typemustmatch,visible'
5480
- );
5481
-
5482
- var xlinkNS = 'http://www.w3.org/1999/xlink';
5483
-
5484
- var isXlink = function (name) {
5485
- return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
5486
- };
5487
-
5488
- var getXlinkProp = function (name) {
5489
- return isXlink(name) ? name.slice(6, name.length) : ''
5490
- };
5491
-
5492
- var isFalsyAttrValue = function (val) {
5493
- return val == null || val === false
5494
- };
5495
-
5496
- /* */
5497
-
5498
- function genClassForVnode (vnode) {
5499
- var data = vnode.data;
5500
- var parentNode = vnode;
5501
- var childNode = vnode;
5502
- while (isDef(childNode.componentInstance)) {
5503
- childNode = childNode.componentInstance._vnode;
5504
- if (childNode && childNode.data) {
5505
- data = mergeClassData(childNode.data, data);
5506
- }
5507
- }
5508
- while (isDef(parentNode = parentNode.parent)) {
5509
- if (parentNode && parentNode.data) {
5510
- data = mergeClassData(data, parentNode.data);
5511
- }
5512
- }
5513
- return renderClass(data.staticClass, data.class)
5514
- }
5515
-
5516
- function mergeClassData (child, parent) {
5517
- return {
5518
- staticClass: concat(child.staticClass, parent.staticClass),
5519
- class: isDef(child.class)
5520
- ? [child.class, parent.class]
5521
- : parent.class
5522
- }
5523
- }
5524
-
5525
- function renderClass (
5526
- staticClass,
5527
- dynamicClass
5528
- ) {
5529
- if (isDef(staticClass) || isDef(dynamicClass)) {
5530
- return concat(staticClass, stringifyClass(dynamicClass))
5531
- }
5532
- /* istanbul ignore next */
5533
- return ''
5534
- }
5535
-
5536
- function concat (a, b) {
5537
- return a ? b ? (a + ' ' + b) : a : (b || '')
5538
- }
5539
-
5540
- function stringifyClass (value) {
5541
- if (Array.isArray(value)) {
5542
- return stringifyArray(value)
5543
- }
5544
- if (isObject(value)) {
5545
- return stringifyObject(value)
5546
- }
5547
- if (typeof value === 'string') {
5548
- return value
5549
- }
5550
- /* istanbul ignore next */
5551
- return ''
5552
- }
5553
-
5554
- function stringifyArray (value) {
5555
- var res = '';
5556
- var stringified;
5557
- for (var i = 0, l = value.length; i < l; i++) {
5558
- if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
5559
- if (res) { res += ' '; }
5560
- res += stringified;
5561
- }
5562
- }
5563
- return res
5564
- }
5565
-
5566
- function stringifyObject (value) {
5567
- var res = '';
5568
- for (var key in value) {
5569
- if (value[key]) {
5570
- if (res) { res += ' '; }
5571
- res += key;
5572
- }
5573
- }
5574
- return res
5575
- }
5576
-
5577
- /* */
5578
-
5579
- var namespaceMap = {
5580
- svg: 'http://www.w3.org/2000/svg',
5581
- math: 'http://www.w3.org/1998/Math/MathML'
5582
- };
5583
-
5584
- var isHTMLTag = makeMap(
5585
- 'html,body,base,head,link,meta,style,title,' +
5586
- 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
5587
- 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
5588
- 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
5589
- 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
5590
- 'embed,object,param,source,canvas,script,noscript,del,ins,' +
5591
- 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
5592
- 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
5593
- 'output,progress,select,textarea,' +
5594
- 'details,dialog,menu,menuitem,summary,' +
5595
- 'content,element,shadow,template,blockquote,iframe,tfoot'
5596
- );
5597
-
5598
- // this map is intentionally selective, only covering SVG elements that may
5599
- // contain child elements.
5600
- var isSVG = makeMap(
5601
- 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
5602
- 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
5603
- 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
5604
- true
5605
- );
5606
-
5607
- var isPreTag = function (tag) { return tag === 'pre'; };
5608
-
5609
- var isReservedTag = function (tag) {
5610
- return isHTMLTag(tag) || isSVG(tag)
5611
- };
5612
-
5613
- function getTagNamespace (tag) {
5614
- if (isSVG(tag)) {
5615
- return 'svg'
5616
- }
5617
- // basic support for MathML
5618
- // note it doesn't support other MathML elements being component roots
5619
- if (tag === 'math') {
5620
- return 'math'
5621
- }
5622
- }
5623
-
5624
- var unknownElementCache = Object.create(null);
5625
- function isUnknownElement (tag) {
5626
- /* istanbul ignore if */
5627
- if (!inBrowser) {
5628
- return true
5629
- }
5630
- if (isReservedTag(tag)) {
5631
- return false
5632
- }
5633
- tag = tag.toLowerCase();
5634
- /* istanbul ignore if */
5635
- if (unknownElementCache[tag] != null) {
5636
- return unknownElementCache[tag]
5637
- }
5638
- var el = document.createElement(tag);
5639
- if (tag.indexOf('-') > -1) {
5640
- // http://stackoverflow.com/a/28210364/1070244
5641
- return (unknownElementCache[tag] = (
5642
- el.constructor === window.HTMLUnknownElement ||
5643
- el.constructor === window.HTMLElement
5644
- ))
5645
- } else {
5646
- return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
5647
- }
5648
- }
5649
-
5650
- var isTextInputType = makeMap('text,number,password,search,email,tel,url');
5651
-
5652
- /* */
5653
-
5654
- /**
5655
- * Query an element selector if it's not an element already.
5656
- */
5657
- function query (el) {
5658
- if (typeof el === 'string') {
5659
- var selected = document.querySelector(el);
5660
- if (!selected) {
5661
- warn(
5662
- 'Cannot find element: ' + el
5663
- );
5664
- return document.createElement('div')
5665
- }
5666
- return selected
5667
- } else {
5668
- return el
5669
- }
5670
- }
5671
-
5672
- /* */
5673
-
5674
- function createElement$1 (tagName, vnode) {
5675
- var elm = document.createElement(tagName);
5676
- if (tagName !== 'select') {
5677
- return elm
5678
- }
5679
- // false or null will remove the attribute but undefined will not
5680
- if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
5681
- elm.setAttribute('multiple', 'multiple');
5682
- }
5683
- return elm
5684
- }
5685
-
5686
- function createElementNS (namespace, tagName) {
5687
- return document.createElementNS(namespaceMap[namespace], tagName)
5688
- }
5689
-
5690
- function createTextNode (text) {
5691
- return document.createTextNode(text)
5692
- }
5693
-
5694
- function createComment (text) {
5695
- return document.createComment(text)
5696
- }
5697
-
5698
- function insertBefore (parentNode, newNode, referenceNode) {
5699
- parentNode.insertBefore(newNode, referenceNode);
5700
- }
5701
-
5702
- function removeChild (node, child) {
5703
- node.removeChild(child);
5704
- }
5705
-
5706
- function appendChild (node, child) {
5707
- node.appendChild(child);
5708
- }
5709
-
5710
- function parentNode (node) {
5711
- return node.parentNode
5712
- }
5713
-
5714
- function nextSibling (node) {
5715
- return node.nextSibling
5716
- }
5717
-
5718
- function tagName (node) {
5719
- return node.tagName
5720
- }
5721
-
5722
- function setTextContent (node, text) {
5723
- node.textContent = text;
5724
- }
5725
-
5726
- function setStyleScope (node, scopeId) {
5727
- node.setAttribute(scopeId, '');
5728
- }
5729
-
5730
- var nodeOps = /*#__PURE__*/Object.freeze({
5731
- createElement: createElement$1,
5732
- createElementNS: createElementNS,
5733
- createTextNode: createTextNode,
5734
- createComment: createComment,
5735
- insertBefore: insertBefore,
5736
- removeChild: removeChild,
5737
- appendChild: appendChild,
5738
- parentNode: parentNode,
5739
- nextSibling: nextSibling,
5740
- tagName: tagName,
5741
- setTextContent: setTextContent,
5742
- setStyleScope: setStyleScope
5743
- });
5744
-
5745
- /* */
5746
-
5747
- var ref = {
5748
- create: function create (_, vnode) {
5749
- registerRef(vnode);
5750
- },
5751
- update: function update (oldVnode, vnode) {
5752
- if (oldVnode.data.ref !== vnode.data.ref) {
5753
- registerRef(oldVnode, true);
5754
- registerRef(vnode);
5755
- }
5756
- },
5757
- destroy: function destroy (vnode) {
5758
- registerRef(vnode, true);
5759
- }
5760
- };
5761
-
5762
- function registerRef (vnode, isRemoval) {
5763
- var key = vnode.data.ref;
5764
- if (!isDef(key)) { return }
5765
-
5766
- var vm = vnode.context;
5767
- var ref = vnode.componentInstance || vnode.elm;
5768
- var refs = vm.$refs;
5769
- if (isRemoval) {
5770
- if (Array.isArray(refs[key])) {
5771
- remove(refs[key], ref);
5772
- } else if (refs[key] === ref) {
5773
- refs[key] = undefined;
5774
- }
5775
- } else {
5776
- if (vnode.data.refInFor) {
5777
- if (!Array.isArray(refs[key])) {
5778
- refs[key] = [ref];
5779
- } else if (refs[key].indexOf(ref) < 0) {
5780
- // $flow-disable-line
5781
- refs[key].push(ref);
5782
- }
5783
- } else {
5784
- refs[key] = ref;
5785
- }
5786
- }
5787
- }
5788
-
5789
- /**
5790
- * Virtual DOM patching algorithm based on Snabbdom by
5791
- * Simon Friis Vindum (@paldepind)
5792
- * Licensed under the MIT License
5793
- * https://github.com/paldepind/snabbdom/blob/master/LICENSE
5794
- *
5795
- * modified by Evan You (@yyx990803)
5796
- *
5797
- * Not type-checking this because this file is perf-critical and the cost
5798
- * of making flow understand it is not worth it.
5799
- */
5800
-
5801
- var emptyNode = new VNode('', {}, []);
5802
-
5803
- var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
5804
-
5805
- function sameVnode (a, b) {
5806
- return (
5807
- a.key === b.key && (
5808
- (
5809
- a.tag === b.tag &&
5810
- a.isComment === b.isComment &&
5811
- isDef(a.data) === isDef(b.data) &&
5812
- sameInputType(a, b)
5813
- ) || (
5814
- isTrue(a.isAsyncPlaceholder) &&
5815
- a.asyncFactory === b.asyncFactory &&
5816
- isUndef(b.asyncFactory.error)
5817
- )
5818
- )
5819
- )
5820
- }
5821
-
5822
- function sameInputType (a, b) {
5823
- if (a.tag !== 'input') { return true }
5824
- var i;
5825
- var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
5826
- var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
5827
- return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
5828
- }
5829
-
5830
- function createKeyToOldIdx (children, beginIdx, endIdx) {
5831
- var i, key;
5832
- var map = {};
5833
- for (i = beginIdx; i <= endIdx; ++i) {
5834
- key = children[i].key;
5835
- if (isDef(key)) { map[key] = i; }
5836
- }
5837
- return map
5838
- }
5839
-
5840
- function createPatchFunction (backend) {
5841
- var i, j;
5842
- var cbs = {};
5843
-
5844
- var modules = backend.modules;
5845
- var nodeOps = backend.nodeOps;
5846
-
5847
- for (i = 0; i < hooks.length; ++i) {
5848
- cbs[hooks[i]] = [];
5849
- for (j = 0; j < modules.length; ++j) {
5850
- if (isDef(modules[j][hooks[i]])) {
5851
- cbs[hooks[i]].push(modules[j][hooks[i]]);
5852
- }
5853
- }
5854
- }
5855
-
5856
- function emptyNodeAt (elm) {
5857
- return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
5858
- }
5859
-
5860
- function createRmCb (childElm, listeners) {
5861
- function remove$$1 () {
5862
- if (--remove$$1.listeners === 0) {
5863
- removeNode(childElm);
5864
- }
5865
- }
5866
- remove$$1.listeners = listeners;
5867
- return remove$$1
5868
- }
5869
-
5870
- function removeNode (el) {
5871
- var parent = nodeOps.parentNode(el);
5872
- // element may have already been removed due to v-html / v-text
5873
- if (isDef(parent)) {
5874
- nodeOps.removeChild(parent, el);
5875
- }
5876
- }
5877
-
5878
- function isUnknownElement$$1 (vnode, inVPre) {
5879
- return (
5880
- !inVPre &&
5881
- !vnode.ns &&
5882
- !(
5883
- config.ignoredElements.length &&
5884
- config.ignoredElements.some(function (ignore) {
5885
- return isRegExp(ignore)
5886
- ? ignore.test(vnode.tag)
5887
- : ignore === vnode.tag
5888
- })
5889
- ) &&
5890
- config.isUnknownElement(vnode.tag)
5891
- )
5892
- }
5893
-
5894
- var creatingElmInVPre = 0;
5895
-
5896
- function createElm (
5897
- vnode,
5898
- insertedVnodeQueue,
5899
- parentElm,
5900
- refElm,
5901
- nested,
5902
- ownerArray,
5903
- index
5904
- ) {
5905
- if (isDef(vnode.elm) && isDef(ownerArray)) {
5906
- // This vnode was used in a previous render!
5907
- // now it's used as a new node, overwriting its elm would cause
5908
- // potential patch errors down the road when it's used as an insertion
5909
- // reference node. Instead, we clone the node on-demand before creating
5910
- // associated DOM element for it.
5911
- vnode = ownerArray[index] = cloneVNode(vnode);
5912
- }
5913
-
5914
- vnode.isRootInsert = !nested; // for transition enter check
5915
- if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
5916
- return
5917
- }
5918
-
5919
- var data = vnode.data;
5920
- var children = vnode.children;
5921
- var tag = vnode.tag;
5922
- if (isDef(tag)) {
5923
- {
5924
- if (data && data.pre) {
5925
- creatingElmInVPre++;
5926
- }
5927
- if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
5928
- warn(
5929
- 'Unknown custom element: <' + tag + '> - did you ' +
5930
- 'register the component correctly? For recursive components, ' +
5931
- 'make sure to provide the "name" option.',
5932
- vnode.context
5933
- );
5934
- }
5935
- }
5936
-
5937
- vnode.elm = vnode.ns
5938
- ? nodeOps.createElementNS(vnode.ns, tag)
5939
- : nodeOps.createElement(tag, vnode);
5940
- setScope(vnode);
5941
-
5942
- /* istanbul ignore if */
5943
- {
5944
- createChildren(vnode, children, insertedVnodeQueue);
5945
- if (isDef(data)) {
5946
- invokeCreateHooks(vnode, insertedVnodeQueue);
5947
- }
5948
- insert(parentElm, vnode.elm, refElm);
5949
- }
5950
-
5951
- if (data && data.pre) {
5952
- creatingElmInVPre--;
5953
- }
5954
- } else if (isTrue(vnode.isComment)) {
5955
- vnode.elm = nodeOps.createComment(vnode.text);
5956
- insert(parentElm, vnode.elm, refElm);
5957
- } else {
5958
- vnode.elm = nodeOps.createTextNode(vnode.text);
5959
- insert(parentElm, vnode.elm, refElm);
5960
- }
5961
- }
5962
-
5963
- function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
5964
- var i = vnode.data;
5965
- if (isDef(i)) {
5966
- var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
5967
- if (isDef(i = i.hook) && isDef(i = i.init)) {
5968
- i(vnode, false /* hydrating */);
5969
- }
5970
- // after calling the init hook, if the vnode is a child component
5971
- // it should've created a child instance and mounted it. the child
5972
- // component also has set the placeholder vnode's elm.
5973
- // in that case we can just return the element and be done.
5974
- if (isDef(vnode.componentInstance)) {
5975
- initComponent(vnode, insertedVnodeQueue);
5976
- insert(parentElm, vnode.elm, refElm);
5977
- if (isTrue(isReactivated)) {
5978
- reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
5979
- }
5980
- return true
5981
- }
5982
- }
5983
- }
5984
-
5985
- function initComponent (vnode, insertedVnodeQueue) {
5986
- if (isDef(vnode.data.pendingInsert)) {
5987
- insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
5988
- vnode.data.pendingInsert = null;
5989
- }
5990
- vnode.elm = vnode.componentInstance.$el;
5991
- if (isPatchable(vnode)) {
5992
- invokeCreateHooks(vnode, insertedVnodeQueue);
5993
- setScope(vnode);
5994
- } else {
5995
- // empty component root.
5996
- // skip all element-related modules except for ref (#3455)
5997
- registerRef(vnode);
5998
- // make sure to invoke the insert hook
5999
- insertedVnodeQueue.push(vnode);
6000
- }
6001
- }
6002
-
6003
- function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
6004
- var i;
6005
- // hack for #4339: a reactivated component with inner transition
6006
- // does not trigger because the inner node's created hooks are not called
6007
- // again. It's not ideal to involve module-specific logic in here but
6008
- // there doesn't seem to be a better way to do it.
6009
- var innerNode = vnode;
6010
- while (innerNode.componentInstance) {
6011
- innerNode = innerNode.componentInstance._vnode;
6012
- if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
6013
- for (i = 0; i < cbs.activate.length; ++i) {
6014
- cbs.activate[i](emptyNode, innerNode);
6015
- }
6016
- insertedVnodeQueue.push(innerNode);
6017
- break
6018
- }
6019
- }
6020
- // unlike a newly created component,
6021
- // a reactivated keep-alive component doesn't insert itself
6022
- insert(parentElm, vnode.elm, refElm);
6023
- }
6024
-
6025
- function insert (parent, elm, ref$$1) {
6026
- if (isDef(parent)) {
6027
- if (isDef(ref$$1)) {
6028
- if (nodeOps.parentNode(ref$$1) === parent) {
6029
- nodeOps.insertBefore(parent, elm, ref$$1);
6030
- }
6031
- } else {
6032
- nodeOps.appendChild(parent, elm);
6033
- }
6034
- }
6035
- }
6036
-
6037
- function createChildren (vnode, children, insertedVnodeQueue) {
6038
- if (Array.isArray(children)) {
6039
- {
6040
- checkDuplicateKeys(children);
6041
- }
6042
- for (var i = 0; i < children.length; ++i) {
6043
- createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
6044
- }
6045
- } else if (isPrimitive(vnode.text)) {
6046
- nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
6047
- }
6048
- }
6049
-
6050
- function isPatchable (vnode) {
6051
- while (vnode.componentInstance) {
6052
- vnode = vnode.componentInstance._vnode;
6053
- }
6054
- return isDef(vnode.tag)
6055
- }
6056
-
6057
- function invokeCreateHooks (vnode, insertedVnodeQueue) {
6058
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
6059
- cbs.create[i$1](emptyNode, vnode);
6060
- }
6061
- i = vnode.data.hook; // Reuse variable
6062
- if (isDef(i)) {
6063
- if (isDef(i.create)) { i.create(emptyNode, vnode); }
6064
- if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
6065
- }
6066
- }
6067
-
6068
- // set scope id attribute for scoped CSS.
6069
- // this is implemented as a special case to avoid the overhead
6070
- // of going through the normal attribute patching process.
6071
- function setScope (vnode) {
6072
- var i;
6073
- if (isDef(i = vnode.fnScopeId)) {
6074
- nodeOps.setStyleScope(vnode.elm, i);
6075
- } else {
6076
- var ancestor = vnode;
6077
- while (ancestor) {
6078
- if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
6079
- nodeOps.setStyleScope(vnode.elm, i);
6080
- }
6081
- ancestor = ancestor.parent;
6082
- }
6083
- }
6084
- // for slot content they should also get the scopeId from the host instance.
6085
- if (isDef(i = activeInstance) &&
6086
- i !== vnode.context &&
6087
- i !== vnode.fnContext &&
6088
- isDef(i = i.$options._scopeId)
6089
- ) {
6090
- nodeOps.setStyleScope(vnode.elm, i);
6091
- }
6092
- }
6093
-
6094
- function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
6095
- for (; startIdx <= endIdx; ++startIdx) {
6096
- createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
6097
- }
6098
- }
6099
-
6100
- function invokeDestroyHook (vnode) {
6101
- var i, j;
6102
- var data = vnode.data;
6103
- if (isDef(data)) {
6104
- if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
6105
- for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
6106
- }
6107
- if (isDef(i = vnode.children)) {
6108
- for (j = 0; j < vnode.children.length; ++j) {
6109
- invokeDestroyHook(vnode.children[j]);
6110
- }
6111
- }
6112
- }
6113
-
6114
- function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
6115
- for (; startIdx <= endIdx; ++startIdx) {
6116
- var ch = vnodes[startIdx];
6117
- if (isDef(ch)) {
6118
- if (isDef(ch.tag)) {
6119
- removeAndInvokeRemoveHook(ch);
6120
- invokeDestroyHook(ch);
6121
- } else { // Text node
6122
- removeNode(ch.elm);
6123
- }
6124
- }
6125
- }
6126
- }
6127
-
6128
- function removeAndInvokeRemoveHook (vnode, rm) {
6129
- if (isDef(rm) || isDef(vnode.data)) {
6130
- var i;
6131
- var listeners = cbs.remove.length + 1;
6132
- if (isDef(rm)) {
6133
- // we have a recursively passed down rm callback
6134
- // increase the listeners count
6135
- rm.listeners += listeners;
6136
- } else {
6137
- // directly removing
6138
- rm = createRmCb(vnode.elm, listeners);
6139
- }
6140
- // recursively invoke hooks on child component root node
6141
- if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
6142
- removeAndInvokeRemoveHook(i, rm);
6143
- }
6144
- for (i = 0; i < cbs.remove.length; ++i) {
6145
- cbs.remove[i](vnode, rm);
6146
- }
6147
- if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
6148
- i(vnode, rm);
6149
- } else {
6150
- rm();
6151
- }
6152
- } else {
6153
- removeNode(vnode.elm);
6154
- }
6155
- }
6156
-
6157
- function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
6158
- var oldStartIdx = 0;
6159
- var newStartIdx = 0;
6160
- var oldEndIdx = oldCh.length - 1;
6161
- var oldStartVnode = oldCh[0];
6162
- var oldEndVnode = oldCh[oldEndIdx];
6163
- var newEndIdx = newCh.length - 1;
6164
- var newStartVnode = newCh[0];
6165
- var newEndVnode = newCh[newEndIdx];
6166
- var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
6167
-
6168
- // removeOnly is a special flag used only by <transition-group>
6169
- // to ensure removed elements stay in correct relative positions
6170
- // during leaving transitions
6171
- var canMove = !removeOnly;
6172
-
6173
- {
6174
- checkDuplicateKeys(newCh);
6175
- }
6176
-
6177
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
6178
- if (isUndef(oldStartVnode)) {
6179
- oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
6180
- } else if (isUndef(oldEndVnode)) {
6181
- oldEndVnode = oldCh[--oldEndIdx];
6182
- } else if (sameVnode(oldStartVnode, newStartVnode)) {
6183
- patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6184
- oldStartVnode = oldCh[++oldStartIdx];
6185
- newStartVnode = newCh[++newStartIdx];
6186
- } else if (sameVnode(oldEndVnode, newEndVnode)) {
6187
- patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
6188
- oldEndVnode = oldCh[--oldEndIdx];
6189
- newEndVnode = newCh[--newEndIdx];
6190
- } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
6191
- patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
6192
- canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
6193
- oldStartVnode = oldCh[++oldStartIdx];
6194
- newEndVnode = newCh[--newEndIdx];
6195
- } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
6196
- patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6197
- canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
6198
- oldEndVnode = oldCh[--oldEndIdx];
6199
- newStartVnode = newCh[++newStartIdx];
6200
- } else {
6201
- if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
6202
- idxInOld = isDef(newStartVnode.key)
6203
- ? oldKeyToIdx[newStartVnode.key]
6204
- : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
6205
- if (isUndef(idxInOld)) { // New element
6206
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
6207
- } else {
6208
- vnodeToMove = oldCh[idxInOld];
6209
- if (sameVnode(vnodeToMove, newStartVnode)) {
6210
- patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6211
- oldCh[idxInOld] = undefined;
6212
- canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
6213
- } else {
6214
- // same key but different element. treat as new element
6215
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
6216
- }
6217
- }
6218
- newStartVnode = newCh[++newStartIdx];
6219
- }
6220
- }
6221
- if (oldStartIdx > oldEndIdx) {
6222
- refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
6223
- addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
6224
- } else if (newStartIdx > newEndIdx) {
6225
- removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
6226
- }
6227
- }
6228
-
6229
- function checkDuplicateKeys (children) {
6230
- var seenKeys = {};
6231
- for (var i = 0; i < children.length; i++) {
6232
- var vnode = children[i];
6233
- var key = vnode.key;
6234
- if (isDef(key)) {
6235
- if (seenKeys[key]) {
6236
- warn(
6237
- ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
6238
- vnode.context
6239
- );
6240
- } else {
6241
- seenKeys[key] = true;
6242
- }
6243
- }
6244
- }
6245
- }
6246
-
6247
- function findIdxInOld (node, oldCh, start, end) {
6248
- for (var i = start; i < end; i++) {
6249
- var c = oldCh[i];
6250
- if (isDef(c) && sameVnode(node, c)) { return i }
6251
- }
6252
- }
6253
-
6254
- function patchVnode (
6255
- oldVnode,
6256
- vnode,
6257
- insertedVnodeQueue,
6258
- ownerArray,
6259
- index,
6260
- removeOnly
6261
- ) {
6262
- if (oldVnode === vnode) {
6263
- return
6264
- }
6265
-
6266
- if (isDef(vnode.elm) && isDef(ownerArray)) {
6267
- // clone reused vnode
6268
- vnode = ownerArray[index] = cloneVNode(vnode);
6269
- }
6270
-
6271
- var elm = vnode.elm = oldVnode.elm;
6272
-
6273
- if (isTrue(oldVnode.isAsyncPlaceholder)) {
6274
- if (isDef(vnode.asyncFactory.resolved)) {
6275
- hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
6276
- } else {
6277
- vnode.isAsyncPlaceholder = true;
6278
- }
6279
- return
6280
- }
6281
-
6282
- // reuse element for static trees.
6283
- // note we only do this if the vnode is cloned -
6284
- // if the new node is not cloned it means the render functions have been
6285
- // reset by the hot-reload-api and we need to do a proper re-render.
6286
- if (isTrue(vnode.isStatic) &&
6287
- isTrue(oldVnode.isStatic) &&
6288
- vnode.key === oldVnode.key &&
6289
- (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
6290
- ) {
6291
- vnode.componentInstance = oldVnode.componentInstance;
6292
- return
6293
- }
6294
-
6295
- var i;
6296
- var data = vnode.data;
6297
- if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
6298
- i(oldVnode, vnode);
6299
- }
6300
-
6301
- var oldCh = oldVnode.children;
6302
- var ch = vnode.children;
6303
- if (isDef(data) && isPatchable(vnode)) {
6304
- for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
6305
- if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
6306
- }
6307
- if (isUndef(vnode.text)) {
6308
- if (isDef(oldCh) && isDef(ch)) {
6309
- if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
6310
- } else if (isDef(ch)) {
6311
- {
6312
- checkDuplicateKeys(ch);
6313
- }
6314
- if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
6315
- addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
6316
- } else if (isDef(oldCh)) {
6317
- removeVnodes(elm, oldCh, 0, oldCh.length - 1);
6318
- } else if (isDef(oldVnode.text)) {
6319
- nodeOps.setTextContent(elm, '');
6320
- }
6321
- } else if (oldVnode.text !== vnode.text) {
6322
- nodeOps.setTextContent(elm, vnode.text);
6323
- }
6324
- if (isDef(data)) {
6325
- if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
6326
- }
6327
- }
6328
-
6329
- function invokeInsertHook (vnode, queue, initial) {
6330
- // delay insert hooks for component root nodes, invoke them after the
6331
- // element is really inserted
6332
- if (isTrue(initial) && isDef(vnode.parent)) {
6333
- vnode.parent.data.pendingInsert = queue;
6334
- } else {
6335
- for (var i = 0; i < queue.length; ++i) {
6336
- queue[i].data.hook.insert(queue[i]);
6337
- }
6338
- }
6339
- }
6340
-
6341
- var hydrationBailed = false;
6342
- // list of modules that can skip create hook during hydration because they
6343
- // are already rendered on the client or has no need for initialization
6344
- // Note: style is excluded because it relies on initial clone for future
6345
- // deep updates (#7063).
6346
- var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
6347
-
6348
- // Note: this is a browser-only function so we can assume elms are DOM nodes.
6349
- function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
6350
- var i;
6351
- var tag = vnode.tag;
6352
- var data = vnode.data;
6353
- var children = vnode.children;
6354
- inVPre = inVPre || (data && data.pre);
6355
- vnode.elm = elm;
6356
-
6357
- if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
6358
- vnode.isAsyncPlaceholder = true;
6359
- return true
6360
- }
6361
- // assert node match
6362
- {
6363
- if (!assertNodeMatch(elm, vnode, inVPre)) {
6364
- return false
6365
- }
6366
- }
6367
- if (isDef(data)) {
6368
- if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
6369
- if (isDef(i = vnode.componentInstance)) {
6370
- // child component. it should have hydrated its own tree.
6371
- initComponent(vnode, insertedVnodeQueue);
6372
- return true
6373
- }
6374
- }
6375
- if (isDef(tag)) {
6376
- if (isDef(children)) {
6377
- // empty element, allow client to pick up and populate children
6378
- if (!elm.hasChildNodes()) {
6379
- createChildren(vnode, children, insertedVnodeQueue);
6380
- } else {
6381
- // v-html and domProps: innerHTML
6382
- if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
6383
- if (i !== elm.innerHTML) {
6384
- /* istanbul ignore if */
6385
- if (typeof console !== 'undefined' &&
6386
- !hydrationBailed
6387
- ) {
6388
- hydrationBailed = true;
6389
- console.warn('Parent: ', elm);
6390
- console.warn('server innerHTML: ', i);
6391
- console.warn('client innerHTML: ', elm.innerHTML);
6392
- }
6393
- return false
6394
- }
6395
- } else {
6396
- // iterate and compare children lists
6397
- var childrenMatch = true;
6398
- var childNode = elm.firstChild;
6399
- for (var i$1 = 0; i$1 < children.length; i$1++) {
6400
- if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
6401
- childrenMatch = false;
6402
- break
6403
- }
6404
- childNode = childNode.nextSibling;
6405
- }
6406
- // if childNode is not null, it means the actual childNodes list is
6407
- // longer than the virtual children list.
6408
- if (!childrenMatch || childNode) {
6409
- /* istanbul ignore if */
6410
- if (typeof console !== 'undefined' &&
6411
- !hydrationBailed
6412
- ) {
6413
- hydrationBailed = true;
6414
- console.warn('Parent: ', elm);
6415
- console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
6416
- }
6417
- return false
6418
- }
6419
- }
6420
- }
6421
- }
6422
- if (isDef(data)) {
6423
- var fullInvoke = false;
6424
- for (var key in data) {
6425
- if (!isRenderedModule(key)) {
6426
- fullInvoke = true;
6427
- invokeCreateHooks(vnode, insertedVnodeQueue);
6428
- break
6429
- }
6430
- }
6431
- if (!fullInvoke && data['class']) {
6432
- // ensure collecting deps for deep class bindings for future updates
6433
- traverse(data['class']);
6434
- }
6435
- }
6436
- } else if (elm.data !== vnode.text) {
6437
- elm.data = vnode.text;
6438
- }
6439
- return true
6440
- }
6441
-
6442
- function assertNodeMatch (node, vnode, inVPre) {
6443
- if (isDef(vnode.tag)) {
6444
- return vnode.tag.indexOf('vue-component') === 0 || (
6445
- !isUnknownElement$$1(vnode, inVPre) &&
6446
- vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
6447
- )
6448
- } else {
6449
- return node.nodeType === (vnode.isComment ? 8 : 3)
6450
- }
6451
- }
6452
-
6453
- return function patch (oldVnode, vnode, hydrating, removeOnly) {
6454
- if (isUndef(vnode)) {
6455
- if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
6456
- return
6457
- }
6458
-
6459
- var isInitialPatch = false;
6460
- var insertedVnodeQueue = [];
6461
-
6462
- if (isUndef(oldVnode)) {
6463
- // empty mount (likely as component), create new root element
6464
- isInitialPatch = true;
6465
- createElm(vnode, insertedVnodeQueue);
6466
- } else {
6467
- var isRealElement = isDef(oldVnode.nodeType);
6468
- if (!isRealElement && sameVnode(oldVnode, vnode)) {
6469
- // patch existing root node
6470
- patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
6471
- } else {
6472
- if (isRealElement) {
6473
- // mounting to a real element
6474
- // check if this is server-rendered content and if we can perform
6475
- // a successful hydration.
6476
- if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
6477
- oldVnode.removeAttribute(SSR_ATTR);
6478
- hydrating = true;
6479
- }
6480
- if (isTrue(hydrating)) {
6481
- if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
6482
- invokeInsertHook(vnode, insertedVnodeQueue, true);
6483
- return oldVnode
6484
- } else {
6485
- warn(
6486
- 'The client-side rendered virtual DOM tree is not matching ' +
6487
- 'server-rendered content. This is likely caused by incorrect ' +
6488
- 'HTML markup, for example nesting block-level elements inside ' +
6489
- '<p>, or missing <tbody>. Bailing hydration and performing ' +
6490
- 'full client-side render.'
6491
- );
6492
- }
6493
- }
6494
- // either not server-rendered, or hydration failed.
6495
- // create an empty node and replace it
6496
- oldVnode = emptyNodeAt(oldVnode);
6497
- }
6498
-
6499
- // replacing existing element
6500
- var oldElm = oldVnode.elm;
6501
- var parentElm = nodeOps.parentNode(oldElm);
6502
-
6503
- // create new node
6504
- createElm(
6505
- vnode,
6506
- insertedVnodeQueue,
6507
- // extremely rare edge case: do not insert if old element is in a
6508
- // leaving transition. Only happens when combining transition +
6509
- // keep-alive + HOCs. (#4590)
6510
- oldElm._leaveCb ? null : parentElm,
6511
- nodeOps.nextSibling(oldElm)
6512
- );
6513
-
6514
- // update parent placeholder node element, recursively
6515
- if (isDef(vnode.parent)) {
6516
- var ancestor = vnode.parent;
6517
- var patchable = isPatchable(vnode);
6518
- while (ancestor) {
6519
- for (var i = 0; i < cbs.destroy.length; ++i) {
6520
- cbs.destroy[i](ancestor);
6521
- }
6522
- ancestor.elm = vnode.elm;
6523
- if (patchable) {
6524
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
6525
- cbs.create[i$1](emptyNode, ancestor);
6526
- }
6527
- // #6513
6528
- // invoke insert hooks that may have been merged by create hooks.
6529
- // e.g. for directives that uses the "inserted" hook.
6530
- var insert = ancestor.data.hook.insert;
6531
- if (insert.merged) {
6532
- // start at index 1 to avoid re-invoking component mounted hook
6533
- for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
6534
- insert.fns[i$2]();
6535
- }
6536
- }
6537
- } else {
6538
- registerRef(ancestor);
6539
- }
6540
- ancestor = ancestor.parent;
6541
- }
6542
- }
6543
-
6544
- // destroy old node
6545
- if (isDef(parentElm)) {
6546
- removeVnodes(parentElm, [oldVnode], 0, 0);
6547
- } else if (isDef(oldVnode.tag)) {
6548
- invokeDestroyHook(oldVnode);
6549
- }
6550
- }
6551
- }
6552
-
6553
- invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
6554
- return vnode.elm
6555
- }
6556
- }
6557
-
6558
- /* */
6559
-
6560
- var directives = {
6561
- create: updateDirectives,
6562
- update: updateDirectives,
6563
- destroy: function unbindDirectives (vnode) {
6564
- updateDirectives(vnode, emptyNode);
6565
- }
6566
- };
6567
-
6568
- function updateDirectives (oldVnode, vnode) {
6569
- if (oldVnode.data.directives || vnode.data.directives) {
6570
- _update(oldVnode, vnode);
6571
- }
6572
- }
6573
-
6574
- function _update (oldVnode, vnode) {
6575
- var isCreate = oldVnode === emptyNode;
6576
- var isDestroy = vnode === emptyNode;
6577
- var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
6578
- var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
6579
-
6580
- var dirsWithInsert = [];
6581
- var dirsWithPostpatch = [];
6582
-
6583
- var key, oldDir, dir;
6584
- for (key in newDirs) {
6585
- oldDir = oldDirs[key];
6586
- dir = newDirs[key];
6587
- if (!oldDir) {
6588
- // new directive, bind
6589
- callHook$1(dir, 'bind', vnode, oldVnode);
6590
- if (dir.def && dir.def.inserted) {
6591
- dirsWithInsert.push(dir);
6592
- }
6593
- } else {
6594
- // existing directive, update
6595
- dir.oldValue = oldDir.value;
6596
- dir.oldArg = oldDir.arg;
6597
- callHook$1(dir, 'update', vnode, oldVnode);
6598
- if (dir.def && dir.def.componentUpdated) {
6599
- dirsWithPostpatch.push(dir);
6600
- }
6601
- }
6602
- }
6603
-
6604
- if (dirsWithInsert.length) {
6605
- var callInsert = function () {
6606
- for (var i = 0; i < dirsWithInsert.length; i++) {
6607
- callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
6608
- }
6609
- };
6610
- if (isCreate) {
6611
- mergeVNodeHook(vnode, 'insert', callInsert);
6612
- } else {
6613
- callInsert();
6614
- }
6615
- }
6616
-
6617
- if (dirsWithPostpatch.length) {
6618
- mergeVNodeHook(vnode, 'postpatch', function () {
6619
- for (var i = 0; i < dirsWithPostpatch.length; i++) {
6620
- callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
6621
- }
6622
- });
6623
- }
6624
-
6625
- if (!isCreate) {
6626
- for (key in oldDirs) {
6627
- if (!newDirs[key]) {
6628
- // no longer present, unbind
6629
- callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
6630
- }
6631
- }
6632
- }
6633
- }
6634
-
6635
- var emptyModifiers = Object.create(null);
6636
-
6637
- function normalizeDirectives$1 (
6638
- dirs,
6639
- vm
6640
- ) {
6641
- var res = Object.create(null);
6642
- if (!dirs) {
6643
- // $flow-disable-line
6644
- return res
6645
- }
6646
- var i, dir;
6647
- for (i = 0; i < dirs.length; i++) {
6648
- dir = dirs[i];
6649
- if (!dir.modifiers) {
6650
- // $flow-disable-line
6651
- dir.modifiers = emptyModifiers;
6652
- }
6653
- res[getRawDirName(dir)] = dir;
6654
- dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
6655
- }
6656
- // $flow-disable-line
6657
- return res
6658
- }
6659
-
6660
- function getRawDirName (dir) {
6661
- return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
6662
- }
6663
-
6664
- function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
6665
- var fn = dir.def && dir.def[hook];
6666
- if (fn) {
6667
- try {
6668
- fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
6669
- } catch (e) {
6670
- handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
6671
- }
6672
- }
6673
- }
6674
-
6675
- var baseModules = [
6676
- ref,
6677
- directives
6678
- ];
6679
-
6680
- /* */
6681
-
6682
- function updateAttrs (oldVnode, vnode) {
6683
- var opts = vnode.componentOptions;
6684
- if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
6685
- return
6686
- }
6687
- if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
6688
- return
6689
- }
6690
- var key, cur, old;
6691
- var elm = vnode.elm;
6692
- var oldAttrs = oldVnode.data.attrs || {};
6693
- var attrs = vnode.data.attrs || {};
6694
- // clone observed objects, as the user probably wants to mutate it
6695
- if (isDef(attrs.__ob__)) {
6696
- attrs = vnode.data.attrs = extend({}, attrs);
6697
- }
6698
-
6699
- for (key in attrs) {
6700
- cur = attrs[key];
6701
- old = oldAttrs[key];
6702
- if (old !== cur) {
6703
- setAttr(elm, key, cur);
6704
- }
6705
- }
6706
- // #4391: in IE9, setting type can reset value for input[type=radio]
6707
- // #6666: IE/Edge forces progress value down to 1 before setting a max
6708
- /* istanbul ignore if */
6709
- if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
6710
- setAttr(elm, 'value', attrs.value);
6711
- }
6712
- for (key in oldAttrs) {
6713
- if (isUndef(attrs[key])) {
6714
- if (isXlink(key)) {
6715
- elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
6716
- } else if (!isEnumeratedAttr(key)) {
6717
- elm.removeAttribute(key);
6718
- }
6719
- }
6720
- }
6721
- }
6722
-
6723
- function setAttr (el, key, value) {
6724
- if (el.tagName.indexOf('-') > -1) {
6725
- baseSetAttr(el, key, value);
6726
- } else if (isBooleanAttr(key)) {
6727
- // set attribute for blank value
6728
- // e.g. <option disabled>Select one</option>
6729
- if (isFalsyAttrValue(value)) {
6730
- el.removeAttribute(key);
6731
- } else {
6732
- // technically allowfullscreen is a boolean attribute for <iframe>,
6733
- // but Flash expects a value of "true" when used on <embed> tag
6734
- value = key === 'allowfullscreen' && el.tagName === 'EMBED'
6735
- ? 'true'
6736
- : key;
6737
- el.setAttribute(key, value);
6738
- }
6739
- } else if (isEnumeratedAttr(key)) {
6740
- el.setAttribute(key, convertEnumeratedValue(key, value));
6741
- } else if (isXlink(key)) {
6742
- if (isFalsyAttrValue(value)) {
6743
- el.removeAttributeNS(xlinkNS, getXlinkProp(key));
6744
- } else {
6745
- el.setAttributeNS(xlinkNS, key, value);
6746
- }
6747
- } else {
6748
- baseSetAttr(el, key, value);
6749
- }
6750
- }
6751
-
6752
- function baseSetAttr (el, key, value) {
6753
- if (isFalsyAttrValue(value)) {
6754
- el.removeAttribute(key);
6755
- } else {
6756
- // #7138: IE10 & 11 fires input event when setting placeholder on
6757
- // <textarea>... block the first input event and remove the blocker
6758
- // immediately.
6759
- /* istanbul ignore if */
6760
- if (
6761
- isIE && !isIE9 &&
6762
- el.tagName === 'TEXTAREA' &&
6763
- key === 'placeholder' && value !== '' && !el.__ieph
6764
- ) {
6765
- var blocker = function (e) {
6766
- e.stopImmediatePropagation();
6767
- el.removeEventListener('input', blocker);
6768
- };
6769
- el.addEventListener('input', blocker);
6770
- // $flow-disable-line
6771
- el.__ieph = true; /* IE placeholder patched */
6772
- }
6773
- el.setAttribute(key, value);
6774
- }
6775
- }
6776
-
6777
- var attrs = {
6778
- create: updateAttrs,
6779
- update: updateAttrs
6780
- };
6781
-
6782
- /* */
6783
-
6784
- function updateClass (oldVnode, vnode) {
6785
- var el = vnode.elm;
6786
- var data = vnode.data;
6787
- var oldData = oldVnode.data;
6788
- if (
6789
- isUndef(data.staticClass) &&
6790
- isUndef(data.class) && (
6791
- isUndef(oldData) || (
6792
- isUndef(oldData.staticClass) &&
6793
- isUndef(oldData.class)
6794
- )
6795
- )
6796
- ) {
6797
- return
6798
- }
6799
-
6800
- var cls = genClassForVnode(vnode);
6801
-
6802
- // handle transition classes
6803
- var transitionClass = el._transitionClasses;
6804
- if (isDef(transitionClass)) {
6805
- cls = concat(cls, stringifyClass(transitionClass));
6806
- }
6807
-
6808
- // set the class
6809
- if (cls !== el._prevClass) {
6810
- el.setAttribute('class', cls);
6811
- el._prevClass = cls;
6812
- }
6813
- }
6814
-
6815
- var klass = {
6816
- create: updateClass,
6817
- update: updateClass
6818
- };
6819
-
6820
- /* */
6821
-
6822
- var validDivisionCharRE = /[\w).+\-_$\]]/;
6823
-
6824
- function parseFilters (exp) {
6825
- var inSingle = false;
6826
- var inDouble = false;
6827
- var inTemplateString = false;
6828
- var inRegex = false;
6829
- var curly = 0;
6830
- var square = 0;
6831
- var paren = 0;
6832
- var lastFilterIndex = 0;
6833
- var c, prev, i, expression, filters;
6834
-
6835
- for (i = 0; i < exp.length; i++) {
6836
- prev = c;
6837
- c = exp.charCodeAt(i);
6838
- if (inSingle) {
6839
- if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
6840
- } else if (inDouble) {
6841
- if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
6842
- } else if (inTemplateString) {
6843
- if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
6844
- } else if (inRegex) {
6845
- if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
6846
- } else if (
6847
- c === 0x7C && // pipe
6848
- exp.charCodeAt(i + 1) !== 0x7C &&
6849
- exp.charCodeAt(i - 1) !== 0x7C &&
6850
- !curly && !square && !paren
6851
- ) {
6852
- if (expression === undefined) {
6853
- // first filter, end of expression
6854
- lastFilterIndex = i + 1;
6855
- expression = exp.slice(0, i).trim();
6856
- } else {
6857
- pushFilter();
6858
- }
6859
- } else {
6860
- switch (c) {
6861
- case 0x22: inDouble = true; break // "
6862
- case 0x27: inSingle = true; break // '
6863
- case 0x60: inTemplateString = true; break // `
6864
- case 0x28: paren++; break // (
6865
- case 0x29: paren--; break // )
6866
- case 0x5B: square++; break // [
6867
- case 0x5D: square--; break // ]
6868
- case 0x7B: curly++; break // {
6869
- case 0x7D: curly--; break // }
6870
- }
6871
- if (c === 0x2f) { // /
6872
- var j = i - 1;
6873
- var p = (void 0);
6874
- // find first non-whitespace prev char
6875
- for (; j >= 0; j--) {
6876
- p = exp.charAt(j);
6877
- if (p !== ' ') { break }
6878
- }
6879
- if (!p || !validDivisionCharRE.test(p)) {
6880
- inRegex = true;
6881
- }
6882
- }
6883
- }
6884
- }
6885
-
6886
- if (expression === undefined) {
6887
- expression = exp.slice(0, i).trim();
6888
- } else if (lastFilterIndex !== 0) {
6889
- pushFilter();
6890
- }
6891
-
6892
- function pushFilter () {
6893
- (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
6894
- lastFilterIndex = i + 1;
6895
- }
6896
-
6897
- if (filters) {
6898
- for (i = 0; i < filters.length; i++) {
6899
- expression = wrapFilter(expression, filters[i]);
6900
- }
6901
- }
6902
-
6903
- return expression
6904
- }
6905
-
6906
- function wrapFilter (exp, filter) {
6907
- var i = filter.indexOf('(');
6908
- if (i < 0) {
6909
- // _f: resolveFilter
6910
- return ("_f(\"" + filter + "\")(" + exp + ")")
6911
- } else {
6912
- var name = filter.slice(0, i);
6913
- var args = filter.slice(i + 1);
6914
- return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
6915
- }
6916
- }
6917
-
6918
- /* */
6919
-
6920
-
6921
-
6922
- /* eslint-disable no-unused-vars */
6923
- function baseWarn (msg, range) {
6924
- console.error(("[Vue compiler]: " + msg));
6925
- }
6926
- /* eslint-enable no-unused-vars */
6927
-
6928
- function pluckModuleFunction (
6929
- modules,
6930
- key
6931
- ) {
6932
- return modules
6933
- ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
6934
- : []
6935
- }
6936
-
6937
- function addProp (el, name, value, range, dynamic) {
6938
- (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
6939
- el.plain = false;
6940
- }
6941
-
6942
- function addAttr (el, name, value, range, dynamic) {
6943
- var attrs = dynamic
6944
- ? (el.dynamicAttrs || (el.dynamicAttrs = []))
6945
- : (el.attrs || (el.attrs = []));
6946
- attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
6947
- el.plain = false;
6948
- }
6949
-
6950
- // add a raw attr (use this in preTransforms)
6951
- function addRawAttr (el, name, value, range) {
6952
- el.attrsMap[name] = value;
6953
- el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
6954
- }
6955
-
6956
- function addDirective (
6957
- el,
6958
- name,
6959
- rawName,
6960
- value,
6961
- arg,
6962
- isDynamicArg,
6963
- modifiers,
6964
- range
6965
- ) {
6966
- (el.directives || (el.directives = [])).push(rangeSetItem({
6967
- name: name,
6968
- rawName: rawName,
6969
- value: value,
6970
- arg: arg,
6971
- isDynamicArg: isDynamicArg,
6972
- modifiers: modifiers
6973
- }, range));
6974
- el.plain = false;
6975
- }
6976
-
6977
- function prependModifierMarker (symbol, name, dynamic) {
6978
- return dynamic
6979
- ? ("_p(" + name + ",\"" + symbol + "\")")
6980
- : symbol + name // mark the event as captured
6981
- }
6982
-
6983
- function addHandler (
6984
- el,
6985
- name,
6986
- value,
6987
- modifiers,
6988
- important,
6989
- warn,
6990
- range,
6991
- dynamic
6992
- ) {
6993
- modifiers = modifiers || emptyObject;
6994
- // warn prevent and passive modifier
6995
- /* istanbul ignore if */
6996
- if (
6997
- warn &&
6998
- modifiers.prevent && modifiers.passive
6999
- ) {
7000
- warn(
7001
- 'passive and prevent can\'t be used together. ' +
7002
- 'Passive handler can\'t prevent default event.',
7003
- range
7004
- );
7005
- }
7006
-
7007
- // normalize click.right and click.middle since they don't actually fire
7008
- // this is technically browser-specific, but at least for now browsers are
7009
- // the only target envs that have right/middle clicks.
7010
- if (modifiers.right) {
7011
- if (dynamic) {
7012
- name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
7013
- } else if (name === 'click') {
7014
- name = 'contextmenu';
7015
- delete modifiers.right;
7016
- }
7017
- } else if (modifiers.middle) {
7018
- if (dynamic) {
7019
- name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
7020
- } else if (name === 'click') {
7021
- name = 'mouseup';
7022
- }
7023
- }
7024
-
7025
- // check capture modifier
7026
- if (modifiers.capture) {
7027
- delete modifiers.capture;
7028
- name = prependModifierMarker('!', name, dynamic);
7029
- }
7030
- if (modifiers.once) {
7031
- delete modifiers.once;
7032
- name = prependModifierMarker('~', name, dynamic);
7033
- }
7034
- /* istanbul ignore if */
7035
- if (modifiers.passive) {
7036
- delete modifiers.passive;
7037
- name = prependModifierMarker('&', name, dynamic);
7038
- }
7039
-
7040
- var events;
7041
- if (modifiers.native) {
7042
- delete modifiers.native;
7043
- events = el.nativeEvents || (el.nativeEvents = {});
7044
- } else {
7045
- events = el.events || (el.events = {});
7046
- }
7047
-
7048
- var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
7049
- if (modifiers !== emptyObject) {
7050
- newHandler.modifiers = modifiers;
7051
- }
7052
-
7053
- var handlers = events[name];
7054
- /* istanbul ignore if */
7055
- if (Array.isArray(handlers)) {
7056
- important ? handlers.unshift(newHandler) : handlers.push(newHandler);
7057
- } else if (handlers) {
7058
- events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
7059
- } else {
7060
- events[name] = newHandler;
7061
- }
7062
-
7063
- el.plain = false;
7064
- }
7065
-
7066
- function getRawBindingAttr (
7067
- el,
7068
- name
7069
- ) {
7070
- return el.rawAttrsMap[':' + name] ||
7071
- el.rawAttrsMap['v-bind:' + name] ||
7072
- el.rawAttrsMap[name]
7073
- }
7074
-
7075
- function getBindingAttr (
7076
- el,
7077
- name,
7078
- getStatic
7079
- ) {
7080
- var dynamicValue =
7081
- getAndRemoveAttr(el, ':' + name) ||
7082
- getAndRemoveAttr(el, 'v-bind:' + name);
7083
- if (dynamicValue != null) {
7084
- return parseFilters(dynamicValue)
7085
- } else if (getStatic !== false) {
7086
- var staticValue = getAndRemoveAttr(el, name);
7087
- if (staticValue != null) {
7088
- return JSON.stringify(staticValue)
7089
- }
7090
- }
7091
- }
7092
-
7093
- // note: this only removes the attr from the Array (attrsList) so that it
7094
- // doesn't get processed by processAttrs.
7095
- // By default it does NOT remove it from the map (attrsMap) because the map is
7096
- // needed during codegen.
7097
- function getAndRemoveAttr (
7098
- el,
7099
- name,
7100
- removeFromMap
7101
- ) {
7102
- var val;
7103
- if ((val = el.attrsMap[name]) != null) {
7104
- var list = el.attrsList;
7105
- for (var i = 0, l = list.length; i < l; i++) {
7106
- if (list[i].name === name) {
7107
- list.splice(i, 1);
7108
- break
7109
- }
7110
- }
7111
- }
7112
- if (removeFromMap) {
7113
- delete el.attrsMap[name];
7114
- }
7115
- return val
7116
- }
7117
-
7118
- function getAndRemoveAttrByRegex (
7119
- el,
7120
- name
7121
- ) {
7122
- var list = el.attrsList;
7123
- for (var i = 0, l = list.length; i < l; i++) {
7124
- var attr = list[i];
7125
- if (name.test(attr.name)) {
7126
- list.splice(i, 1);
7127
- return attr
7128
- }
7129
- }
7130
- }
7131
-
7132
- function rangeSetItem (
7133
- item,
7134
- range
7135
- ) {
7136
- if (range) {
7137
- if (range.start != null) {
7138
- item.start = range.start;
7139
- }
7140
- if (range.end != null) {
7141
- item.end = range.end;
7142
- }
7143
- }
7144
- return item
7145
- }
7146
-
7147
- /* */
7148
-
7149
- /**
7150
- * Cross-platform code generation for component v-model
7151
- */
7152
- function genComponentModel (
7153
- el,
7154
- value,
7155
- modifiers
7156
- ) {
7157
- var ref = modifiers || {};
7158
- var number = ref.number;
7159
- var trim = ref.trim;
7160
-
7161
- var baseValueExpression = '$$v';
7162
- var valueExpression = baseValueExpression;
7163
- if (trim) {
7164
- valueExpression =
7165
- "(typeof " + baseValueExpression + " === 'string'" +
7166
- "? " + baseValueExpression + ".trim()" +
7167
- ": " + baseValueExpression + ")";
7168
- }
7169
- if (number) {
7170
- valueExpression = "_n(" + valueExpression + ")";
7171
- }
7172
- var assignment = genAssignmentCode(value, valueExpression);
7173
-
7174
- el.model = {
7175
- value: ("(" + value + ")"),
7176
- expression: JSON.stringify(value),
7177
- callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
7178
- };
7179
- }
7180
-
7181
- /**
7182
- * Cross-platform codegen helper for generating v-model value assignment code.
7183
- */
7184
- function genAssignmentCode (
7185
- value,
7186
- assignment
7187
- ) {
7188
- var res = parseModel(value);
7189
- if (res.key === null) {
7190
- return (value + "=" + assignment)
7191
- } else {
7192
- return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
7193
- }
7194
- }
7195
-
7196
- /**
7197
- * Parse a v-model expression into a base path and a final key segment.
7198
- * Handles both dot-path and possible square brackets.
7199
- *
7200
- * Possible cases:
7201
- *
7202
- * - test
7203
- * - test[key]
7204
- * - test[test1[key]]
7205
- * - test["a"][key]
7206
- * - xxx.test[a[a].test1[key]]
7207
- * - test.xxx.a["asa"][test1[key]]
7208
- *
7209
- */
7210
-
7211
- var len, str, chr, index$1, expressionPos, expressionEndPos;
7212
-
7213
-
7214
-
7215
- function parseModel (val) {
7216
- // Fix https://github.com/vuejs/vue/pull/7730
7217
- // allow v-model="obj.val " (trailing whitespace)
7218
- val = val.trim();
7219
- len = val.length;
7220
-
7221
- if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
7222
- index$1 = val.lastIndexOf('.');
7223
- if (index$1 > -1) {
7224
- return {
7225
- exp: val.slice(0, index$1),
7226
- key: '"' + val.slice(index$1 + 1) + '"'
7227
- }
7228
- } else {
7229
- return {
7230
- exp: val,
7231
- key: null
7232
- }
7233
- }
7234
- }
7235
-
7236
- str = val;
7237
- index$1 = expressionPos = expressionEndPos = 0;
7238
-
7239
- while (!eof()) {
7240
- chr = next();
7241
- /* istanbul ignore if */
7242
- if (isStringStart(chr)) {
7243
- parseString(chr);
7244
- } else if (chr === 0x5B) {
7245
- parseBracket(chr);
7246
- }
7247
- }
7248
-
7249
- return {
7250
- exp: val.slice(0, expressionPos),
7251
- key: val.slice(expressionPos + 1, expressionEndPos)
7252
- }
7253
- }
7254
-
7255
- function next () {
7256
- return str.charCodeAt(++index$1)
7257
- }
7258
-
7259
- function eof () {
7260
- return index$1 >= len
7261
- }
7262
-
7263
- function isStringStart (chr) {
7264
- return chr === 0x22 || chr === 0x27
7265
- }
7266
-
7267
- function parseBracket (chr) {
7268
- var inBracket = 1;
7269
- expressionPos = index$1;
7270
- while (!eof()) {
7271
- chr = next();
7272
- if (isStringStart(chr)) {
7273
- parseString(chr);
7274
- continue
7275
- }
7276
- if (chr === 0x5B) { inBracket++; }
7277
- if (chr === 0x5D) { inBracket--; }
7278
- if (inBracket === 0) {
7279
- expressionEndPos = index$1;
7280
- break
7281
- }
7282
- }
7283
- }
7284
-
7285
- function parseString (chr) {
7286
- var stringQuote = chr;
7287
- while (!eof()) {
7288
- chr = next();
7289
- if (chr === stringQuote) {
7290
- break
7291
- }
7292
- }
7293
- }
7294
-
7295
- /* */
7296
-
7297
- var warn$1;
7298
-
7299
- // in some cases, the event used has to be determined at runtime
7300
- // so we used some reserved tokens during compile.
7301
- var RANGE_TOKEN = '__r';
7302
- var CHECKBOX_RADIO_TOKEN = '__c';
7303
-
7304
- function model (
7305
- el,
7306
- dir,
7307
- _warn
7308
- ) {
7309
- warn$1 = _warn;
7310
- var value = dir.value;
7311
- var modifiers = dir.modifiers;
7312
- var tag = el.tag;
7313
- var type = el.attrsMap.type;
7314
-
7315
- {
7316
- // inputs with type="file" are read only and setting the input's
7317
- // value will throw an error.
7318
- if (tag === 'input' && type === 'file') {
7319
- warn$1(
7320
- "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
7321
- "File inputs are read only. Use a v-on:change listener instead.",
7322
- el.rawAttrsMap['v-model']
7323
- );
7324
- }
7325
- }
7326
-
7327
- if (el.component) {
7328
- genComponentModel(el, value, modifiers);
7329
- // component v-model doesn't need extra runtime
7330
- return false
7331
- } else if (tag === 'select') {
7332
- genSelect(el, value, modifiers);
7333
- } else if (tag === 'input' && type === 'checkbox') {
7334
- genCheckboxModel(el, value, modifiers);
7335
- } else if (tag === 'input' && type === 'radio') {
7336
- genRadioModel(el, value, modifiers);
7337
- } else if (tag === 'input' || tag === 'textarea') {
7338
- genDefaultModel(el, value, modifiers);
7339
- } else if (!config.isReservedTag(tag)) {
7340
- genComponentModel(el, value, modifiers);
7341
- // component v-model doesn't need extra runtime
7342
- return false
7343
- } else {
7344
- warn$1(
7345
- "<" + (el.tag) + " v-model=\"" + value + "\">: " +
7346
- "v-model is not supported on this element type. " +
7347
- 'If you are working with contenteditable, it\'s recommended to ' +
7348
- 'wrap a library dedicated for that purpose inside a custom component.',
7349
- el.rawAttrsMap['v-model']
7350
- );
7351
- }
7352
-
7353
- // ensure runtime directive metadata
7354
- return true
7355
- }
7356
-
7357
- function genCheckboxModel (
7358
- el,
7359
- value,
7360
- modifiers
7361
- ) {
7362
- var number = modifiers && modifiers.number;
7363
- var valueBinding = getBindingAttr(el, 'value') || 'null';
7364
- var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
7365
- var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
7366
- addProp(el, 'checked',
7367
- "Array.isArray(" + value + ")" +
7368
- "?_i(" + value + "," + valueBinding + ")>-1" + (
7369
- trueValueBinding === 'true'
7370
- ? (":(" + value + ")")
7371
- : (":_q(" + value + "," + trueValueBinding + ")")
7372
- )
7373
- );
7374
- addHandler(el, 'change',
7375
- "var $$a=" + value + "," +
7376
- '$$el=$event.target,' +
7377
- "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
7378
- 'if(Array.isArray($$a)){' +
7379
- "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
7380
- '$$i=_i($$a,$$v);' +
7381
- "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
7382
- "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
7383
- "}else{" + (genAssignmentCode(value, '$$c')) + "}",
7384
- null, true
7385
- );
7386
- }
7387
-
7388
- function genRadioModel (
7389
- el,
7390
- value,
7391
- modifiers
7392
- ) {
7393
- var number = modifiers && modifiers.number;
7394
- var valueBinding = getBindingAttr(el, 'value') || 'null';
7395
- valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
7396
- addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
7397
- addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
7398
- }
7399
-
7400
- function genSelect (
7401
- el,
7402
- value,
7403
- modifiers
7404
- ) {
7405
- var number = modifiers && modifiers.number;
7406
- var selectedVal = "Array.prototype.filter" +
7407
- ".call($event.target.options,function(o){return o.selected})" +
7408
- ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
7409
- "return " + (number ? '_n(val)' : 'val') + "})";
7410
-
7411
- var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
7412
- var code = "var $$selectedVal = " + selectedVal + ";";
7413
- code = code + " " + (genAssignmentCode(value, assignment));
7414
- addHandler(el, 'change', code, null, true);
7415
- }
7416
-
7417
- function genDefaultModel (
7418
- el,
7419
- value,
7420
- modifiers
7421
- ) {
7422
- var type = el.attrsMap.type;
7423
-
7424
- // warn if v-bind:value conflicts with v-model
7425
- // except for inputs with v-bind:type
7426
- {
7427
- var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
7428
- var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
7429
- if (value$1 && !typeBinding) {
7430
- var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
7431
- warn$1(
7432
- binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
7433
- 'because the latter already expands to a value binding internally',
7434
- el.rawAttrsMap[binding]
7435
- );
7436
- }
7437
- }
7438
-
7439
- var ref = modifiers || {};
7440
- var lazy = ref.lazy;
7441
- var number = ref.number;
7442
- var trim = ref.trim;
7443
- var needCompositionGuard = !lazy && type !== 'range';
7444
- var event = lazy
7445
- ? 'change'
7446
- : type === 'range'
7447
- ? RANGE_TOKEN
7448
- : 'input';
7449
-
7450
- var valueExpression = '$event.target.value';
7451
- if (trim) {
7452
- valueExpression = "$event.target.value.trim()";
7453
- }
7454
- if (number) {
7455
- valueExpression = "_n(" + valueExpression + ")";
7456
- }
7457
-
7458
- var code = genAssignmentCode(value, valueExpression);
7459
- if (needCompositionGuard) {
7460
- code = "if($event.target.composing)return;" + code;
7461
- }
7462
-
7463
- addProp(el, 'value', ("(" + value + ")"));
7464
- addHandler(el, event, code, null, true);
7465
- if (trim || number) {
7466
- addHandler(el, 'blur', '$forceUpdate()');
7467
- }
7468
- }
7469
-
7470
- /* */
7471
-
7472
- // normalize v-model event tokens that can only be determined at runtime.
7473
- // it's important to place the event as the first in the array because
7474
- // the whole point is ensuring the v-model callback gets called before
7475
- // user-attached handlers.
7476
- function normalizeEvents (on) {
7477
- /* istanbul ignore if */
7478
- if (isDef(on[RANGE_TOKEN])) {
7479
- // IE input[type=range] only supports `change` event
7480
- var event = isIE ? 'change' : 'input';
7481
- on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
7482
- delete on[RANGE_TOKEN];
7483
- }
7484
- // This was originally intended to fix #4521 but no longer necessary
7485
- // after 2.5. Keeping it for backwards compat with generated code from < 2.4
7486
- /* istanbul ignore if */
7487
- if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
7488
- on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
7489
- delete on[CHECKBOX_RADIO_TOKEN];
7490
- }
7491
- }
7492
-
7493
- var target$1;
7494
-
7495
- function createOnceHandler$1 (event, handler, capture) {
7496
- var _target = target$1; // save current target element in closure
7497
- return function onceHandler () {
7498
- var res = handler.apply(null, arguments);
7499
- if (res !== null) {
7500
- remove$2(event, onceHandler, capture, _target);
7501
- }
7502
- }
7503
- }
7504
-
7505
- // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
7506
- // implementation and does not fire microtasks in between event propagation, so
7507
- // safe to exclude.
7508
- var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
7509
-
7510
- function add$1 (
7511
- name,
7512
- handler,
7513
- capture,
7514
- passive
7515
- ) {
7516
- // async edge case #6566: inner click event triggers patch, event handler
7517
- // attached to outer element during patch, and triggered again. This
7518
- // happens because browsers fire microtask ticks between event propagation.
7519
- // the solution is simple: we save the timestamp when a handler is attached,
7520
- // and the handler would only fire if the event passed to it was fired
7521
- // AFTER it was attached.
7522
- if (useMicrotaskFix) {
7523
- var attachedTimestamp = currentFlushTimestamp;
7524
- var original = handler;
7525
- handler = original._wrapper = function (e) {
7526
- if (
7527
- // no bubbling, should always fire.
7528
- // this is just a safety net in case event.timeStamp is unreliable in
7529
- // certain weird environments...
7530
- e.target === e.currentTarget ||
7531
- // event is fired after handler attachment
7532
- e.timeStamp >= attachedTimestamp ||
7533
- // bail for environments that have buggy event.timeStamp implementations
7534
- // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
7535
- // #9681 QtWebEngine event.timeStamp is negative value
7536
- e.timeStamp <= 0 ||
7537
- // #9448 bail if event is fired in another document in a multi-page
7538
- // electron/nw.js app, since event.timeStamp will be using a different
7539
- // starting reference
7540
- e.target.ownerDocument !== document
7541
- ) {
7542
- return original.apply(this, arguments)
7543
- }
7544
- };
7545
- }
7546
- target$1.addEventListener(
7547
- name,
7548
- handler,
7549
- supportsPassive
7550
- ? { capture: capture, passive: passive }
7551
- : capture
7552
- );
7553
- }
7554
-
7555
- function remove$2 (
7556
- name,
7557
- handler,
7558
- capture,
7559
- _target
7560
- ) {
7561
- (_target || target$1).removeEventListener(
7562
- name,
7563
- handler._wrapper || handler,
7564
- capture
7565
- );
7566
- }
7567
-
7568
- function updateDOMListeners (oldVnode, vnode) {
7569
- if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
7570
- return
7571
- }
7572
- var on = vnode.data.on || {};
7573
- var oldOn = oldVnode.data.on || {};
7574
- target$1 = vnode.elm;
7575
- normalizeEvents(on);
7576
- updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
7577
- target$1 = undefined;
7578
- }
7579
-
7580
- var events = {
7581
- create: updateDOMListeners,
7582
- update: updateDOMListeners
7583
- };
7584
-
7585
- /* */
7586
-
7587
- var svgContainer;
7588
-
7589
- function updateDOMProps (oldVnode, vnode) {
7590
- if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
7591
- return
7592
- }
7593
- var key, cur;
7594
- var elm = vnode.elm;
7595
- var oldProps = oldVnode.data.domProps || {};
7596
- var props = vnode.data.domProps || {};
7597
- // clone observed objects, as the user probably wants to mutate it
7598
- if (isDef(props.__ob__)) {
7599
- props = vnode.data.domProps = extend({}, props);
7600
- }
7601
-
7602
- for (key in oldProps) {
7603
- if (!(key in props)) {
7604
- elm[key] = '';
7605
- }
7606
- }
7607
-
7608
- for (key in props) {
7609
- cur = props[key];
7610
- // ignore children if the node has textContent or innerHTML,
7611
- // as these will throw away existing DOM nodes and cause removal errors
7612
- // on subsequent patches (#3360)
7613
- if (key === 'textContent' || key === 'innerHTML') {
7614
- if (vnode.children) { vnode.children.length = 0; }
7615
- if (cur === oldProps[key]) { continue }
7616
- // #6601 work around Chrome version <= 55 bug where single textNode
7617
- // replaced by innerHTML/textContent retains its parentNode property
7618
- if (elm.childNodes.length === 1) {
7619
- elm.removeChild(elm.childNodes[0]);
7620
- }
7621
- }
7622
-
7623
- if (key === 'value' && elm.tagName !== 'PROGRESS') {
7624
- // store value as _value as well since
7625
- // non-string values will be stringified
7626
- elm._value = cur;
7627
- // avoid resetting cursor position when value is the same
7628
- var strCur = isUndef(cur) ? '' : String(cur);
7629
- if (shouldUpdateValue(elm, strCur)) {
7630
- elm.value = strCur;
7631
- }
7632
- } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
7633
- // IE doesn't support innerHTML for SVG elements
7634
- svgContainer = svgContainer || document.createElement('div');
7635
- svgContainer.innerHTML = "<svg>" + cur + "</svg>";
7636
- var svg = svgContainer.firstChild;
7637
- while (elm.firstChild) {
7638
- elm.removeChild(elm.firstChild);
7639
- }
7640
- while (svg.firstChild) {
7641
- elm.appendChild(svg.firstChild);
7642
- }
7643
- } else if (
7644
- // skip the update if old and new VDOM state is the same.
7645
- // `value` is handled separately because the DOM value may be temporarily
7646
- // out of sync with VDOM state due to focus, composition and modifiers.
7647
- // This #4521 by skipping the unnecesarry `checked` update.
7648
- cur !== oldProps[key]
7649
- ) {
7650
- // some property updates can throw
7651
- // e.g. `value` on <progress> w/ non-finite value
7652
- try {
7653
- elm[key] = cur;
7654
- } catch (e) {}
7655
- }
7656
- }
7657
- }
7658
-
7659
- // check platforms/web/util/attrs.js acceptValue
7660
-
7661
-
7662
- function shouldUpdateValue (elm, checkVal) {
7663
- return (!elm.composing && (
7664
- elm.tagName === 'OPTION' ||
7665
- isNotInFocusAndDirty(elm, checkVal) ||
7666
- isDirtyWithModifiers(elm, checkVal)
7667
- ))
7668
- }
7669
-
7670
- function isNotInFocusAndDirty (elm, checkVal) {
7671
- // return true when textbox (.number and .trim) loses focus and its value is
7672
- // not equal to the updated value
7673
- var notInFocus = true;
7674
- // #6157
7675
- // work around IE bug when accessing document.activeElement in an iframe
7676
- try { notInFocus = document.activeElement !== elm; } catch (e) {}
7677
- return notInFocus && elm.value !== checkVal
7678
- }
7679
-
7680
- function isDirtyWithModifiers (elm, newVal) {
7681
- var value = elm.value;
7682
- var modifiers = elm._vModifiers; // injected by v-model runtime
7683
- if (isDef(modifiers)) {
7684
- if (modifiers.number) {
7685
- return toNumber(value) !== toNumber(newVal)
7686
- }
7687
- if (modifiers.trim) {
7688
- return value.trim() !== newVal.trim()
7689
- }
7690
- }
7691
- return value !== newVal
7692
- }
7693
-
7694
- var domProps = {
7695
- create: updateDOMProps,
7696
- update: updateDOMProps
7697
- };
7698
-
7699
- /* */
7700
-
7701
- var parseStyleText = cached(function (cssText) {
7702
- var res = {};
7703
- var listDelimiter = /;(?![^(]*\))/g;
7704
- var propertyDelimiter = /:(.+)/;
7705
- cssText.split(listDelimiter).forEach(function (item) {
7706
- if (item) {
7707
- var tmp = item.split(propertyDelimiter);
7708
- tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
7709
- }
7710
- });
7711
- return res
7712
- });
7713
-
7714
- // merge static and dynamic style data on the same vnode
7715
- function normalizeStyleData (data) {
7716
- var style = normalizeStyleBinding(data.style);
7717
- // static style is pre-processed into an object during compilation
7718
- // and is always a fresh object, so it's safe to merge into it
7719
- return data.staticStyle
7720
- ? extend(data.staticStyle, style)
7721
- : style
7722
- }
7723
-
7724
- // normalize possible array / string values into Object
7725
- function normalizeStyleBinding (bindingStyle) {
7726
- if (Array.isArray(bindingStyle)) {
7727
- return toObject(bindingStyle)
7728
- }
7729
- if (typeof bindingStyle === 'string') {
7730
- return parseStyleText(bindingStyle)
7731
- }
7732
- return bindingStyle
7733
- }
7734
-
7735
- /**
7736
- * parent component style should be after child's
7737
- * so that parent component's style could override it
7738
- */
7739
- function getStyle (vnode, checkChild) {
7740
- var res = {};
7741
- var styleData;
7742
-
7743
- if (checkChild) {
7744
- var childNode = vnode;
7745
- while (childNode.componentInstance) {
7746
- childNode = childNode.componentInstance._vnode;
7747
- if (
7748
- childNode && childNode.data &&
7749
- (styleData = normalizeStyleData(childNode.data))
7750
- ) {
7751
- extend(res, styleData);
7752
- }
7753
- }
7754
- }
7755
-
7756
- if ((styleData = normalizeStyleData(vnode.data))) {
7757
- extend(res, styleData);
7758
- }
7759
-
7760
- var parentNode = vnode;
7761
- while ((parentNode = parentNode.parent)) {
7762
- if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
7763
- extend(res, styleData);
7764
- }
7765
- }
7766
- return res
7767
- }
7768
-
7769
- /* */
7770
-
7771
- var cssVarRE = /^--/;
7772
- var importantRE = /\s*!important$/;
7773
- var setProp = function (el, name, val) {
7774
- /* istanbul ignore if */
7775
- if (cssVarRE.test(name)) {
7776
- el.style.setProperty(name, val);
7777
- } else if (importantRE.test(val)) {
7778
- el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
7779
- } else {
7780
- var normalizedName = normalize(name);
7781
- if (Array.isArray(val)) {
7782
- // Support values array created by autoprefixer, e.g.
7783
- // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
7784
- // Set them one by one, and the browser will only set those it can recognize
7785
- for (var i = 0, len = val.length; i < len; i++) {
7786
- el.style[normalizedName] = val[i];
7787
- }
7788
- } else {
7789
- el.style[normalizedName] = val;
7790
- }
7791
- }
7792
- };
7793
-
7794
- var vendorNames = ['Webkit', 'Moz', 'ms'];
7795
-
7796
- var emptyStyle;
7797
- var normalize = cached(function (prop) {
7798
- emptyStyle = emptyStyle || document.createElement('div').style;
7799
- prop = camelize(prop);
7800
- if (prop !== 'filter' && (prop in emptyStyle)) {
7801
- return prop
7802
- }
7803
- var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
7804
- for (var i = 0; i < vendorNames.length; i++) {
7805
- var name = vendorNames[i] + capName;
7806
- if (name in emptyStyle) {
7807
- return name
7808
- }
7809
- }
7810
- });
7811
-
7812
- function updateStyle (oldVnode, vnode) {
7813
- var data = vnode.data;
7814
- var oldData = oldVnode.data;
7815
-
7816
- if (isUndef(data.staticStyle) && isUndef(data.style) &&
7817
- isUndef(oldData.staticStyle) && isUndef(oldData.style)
7818
- ) {
7819
- return
7820
- }
7821
-
7822
- var cur, name;
7823
- var el = vnode.elm;
7824
- var oldStaticStyle = oldData.staticStyle;
7825
- var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
7826
-
7827
- // if static style exists, stylebinding already merged into it when doing normalizeStyleData
7828
- var oldStyle = oldStaticStyle || oldStyleBinding;
7829
-
7830
- var style = normalizeStyleBinding(vnode.data.style) || {};
7831
-
7832
- // store normalized style under a different key for next diff
7833
- // make sure to clone it if it's reactive, since the user likely wants
7834
- // to mutate it.
7835
- vnode.data.normalizedStyle = isDef(style.__ob__)
7836
- ? extend({}, style)
7837
- : style;
7838
-
7839
- var newStyle = getStyle(vnode, true);
7840
-
7841
- for (name in oldStyle) {
7842
- if (isUndef(newStyle[name])) {
7843
- setProp(el, name, '');
7844
- }
7845
- }
7846
- for (name in newStyle) {
7847
- cur = newStyle[name];
7848
- if (cur !== oldStyle[name]) {
7849
- // ie9 setting to null has no effect, must use empty string
7850
- setProp(el, name, cur == null ? '' : cur);
7851
- }
7852
- }
7853
- }
7854
-
7855
- var style = {
7856
- create: updateStyle,
7857
- update: updateStyle
7858
- };
7859
-
7860
- /* */
7861
-
7862
- var whitespaceRE = /\s+/;
7863
-
7864
- /**
7865
- * Add class with compatibility for SVG since classList is not supported on
7866
- * SVG elements in IE
7867
- */
7868
- function addClass (el, cls) {
7869
- /* istanbul ignore if */
7870
- if (!cls || !(cls = cls.trim())) {
7871
- return
7872
- }
7873
-
7874
- /* istanbul ignore else */
7875
- if (el.classList) {
7876
- if (cls.indexOf(' ') > -1) {
7877
- cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
7878
- } else {
7879
- el.classList.add(cls);
7880
- }
7881
- } else {
7882
- var cur = " " + (el.getAttribute('class') || '') + " ";
7883
- if (cur.indexOf(' ' + cls + ' ') < 0) {
7884
- el.setAttribute('class', (cur + cls).trim());
7885
- }
7886
- }
7887
- }
7888
-
7889
- /**
7890
- * Remove class with compatibility for SVG since classList is not supported on
7891
- * SVG elements in IE
7892
- */
7893
- function removeClass (el, cls) {
7894
- /* istanbul ignore if */
7895
- if (!cls || !(cls = cls.trim())) {
7896
- return
7897
- }
7898
-
7899
- /* istanbul ignore else */
7900
- if (el.classList) {
7901
- if (cls.indexOf(' ') > -1) {
7902
- cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
7903
- } else {
7904
- el.classList.remove(cls);
7905
- }
7906
- if (!el.classList.length) {
7907
- el.removeAttribute('class');
7908
- }
7909
- } else {
7910
- var cur = " " + (el.getAttribute('class') || '') + " ";
7911
- var tar = ' ' + cls + ' ';
7912
- while (cur.indexOf(tar) >= 0) {
7913
- cur = cur.replace(tar, ' ');
7914
- }
7915
- cur = cur.trim();
7916
- if (cur) {
7917
- el.setAttribute('class', cur);
7918
- } else {
7919
- el.removeAttribute('class');
7920
- }
7921
- }
7922
- }
7923
-
7924
- /* */
7925
-
7926
- function resolveTransition (def$$1) {
7927
- if (!def$$1) {
7928
- return
7929
- }
7930
- /* istanbul ignore else */
7931
- if (typeof def$$1 === 'object') {
7932
- var res = {};
7933
- if (def$$1.css !== false) {
7934
- extend(res, autoCssTransition(def$$1.name || 'v'));
7935
- }
7936
- extend(res, def$$1);
7937
- return res
7938
- } else if (typeof def$$1 === 'string') {
7939
- return autoCssTransition(def$$1)
7940
- }
7941
- }
7942
-
7943
- var autoCssTransition = cached(function (name) {
7944
- return {
7945
- enterClass: (name + "-enter"),
7946
- enterToClass: (name + "-enter-to"),
7947
- enterActiveClass: (name + "-enter-active"),
7948
- leaveClass: (name + "-leave"),
7949
- leaveToClass: (name + "-leave-to"),
7950
- leaveActiveClass: (name + "-leave-active")
7951
- }
7952
- });
7953
-
7954
- var hasTransition = inBrowser && !isIE9;
7955
- var TRANSITION = 'transition';
7956
- var ANIMATION = 'animation';
7957
-
7958
- // Transition property/event sniffing
7959
- var transitionProp = 'transition';
7960
- var transitionEndEvent = 'transitionend';
7961
- var animationProp = 'animation';
7962
- var animationEndEvent = 'animationend';
7963
- if (hasTransition) {
7964
- /* istanbul ignore if */
7965
- if (window.ontransitionend === undefined &&
7966
- window.onwebkittransitionend !== undefined
7967
- ) {
7968
- transitionProp = 'WebkitTransition';
7969
- transitionEndEvent = 'webkitTransitionEnd';
7970
- }
7971
- if (window.onanimationend === undefined &&
7972
- window.onwebkitanimationend !== undefined
7973
- ) {
7974
- animationProp = 'WebkitAnimation';
7975
- animationEndEvent = 'webkitAnimationEnd';
7976
- }
7977
- }
7978
-
7979
- // binding to window is necessary to make hot reload work in IE in strict mode
7980
- var raf = inBrowser
7981
- ? window.requestAnimationFrame
7982
- ? window.requestAnimationFrame.bind(window)
7983
- : setTimeout
7984
- : /* istanbul ignore next */ function (fn) { return fn(); };
7985
-
7986
- function nextFrame (fn) {
7987
- raf(function () {
7988
- raf(fn);
7989
- });
7990
- }
7991
-
7992
- function addTransitionClass (el, cls) {
7993
- var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
7994
- if (transitionClasses.indexOf(cls) < 0) {
7995
- transitionClasses.push(cls);
7996
- addClass(el, cls);
7997
- }
7998
- }
7999
-
8000
- function removeTransitionClass (el, cls) {
8001
- if (el._transitionClasses) {
8002
- remove(el._transitionClasses, cls);
8003
- }
8004
- removeClass(el, cls);
8005
- }
8006
-
8007
- function whenTransitionEnds (
8008
- el,
8009
- expectedType,
8010
- cb
8011
- ) {
8012
- var ref = getTransitionInfo(el, expectedType);
8013
- var type = ref.type;
8014
- var timeout = ref.timeout;
8015
- var propCount = ref.propCount;
8016
- if (!type) { return cb() }
8017
- var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
8018
- var ended = 0;
8019
- var end = function () {
8020
- el.removeEventListener(event, onEnd);
8021
- cb();
8022
- };
8023
- var onEnd = function (e) {
8024
- if (e.target === el) {
8025
- if (++ended >= propCount) {
8026
- end();
8027
- }
8028
- }
8029
- };
8030
- setTimeout(function () {
8031
- if (ended < propCount) {
8032
- end();
8033
- }
8034
- }, timeout + 1);
8035
- el.addEventListener(event, onEnd);
8036
- }
8037
-
8038
- var transformRE = /\b(transform|all)(,|$)/;
8039
-
8040
- function getTransitionInfo (el, expectedType) {
8041
- var styles = window.getComputedStyle(el);
8042
- // JSDOM may return undefined for transition properties
8043
- var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
8044
- var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
8045
- var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
8046
- var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
8047
- var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
8048
- var animationTimeout = getTimeout(animationDelays, animationDurations);
8049
-
8050
- var type;
8051
- var timeout = 0;
8052
- var propCount = 0;
8053
- /* istanbul ignore if */
8054
- if (expectedType === TRANSITION) {
8055
- if (transitionTimeout > 0) {
8056
- type = TRANSITION;
8057
- timeout = transitionTimeout;
8058
- propCount = transitionDurations.length;
8059
- }
8060
- } else if (expectedType === ANIMATION) {
8061
- if (animationTimeout > 0) {
8062
- type = ANIMATION;
8063
- timeout = animationTimeout;
8064
- propCount = animationDurations.length;
8065
- }
8066
- } else {
8067
- timeout = Math.max(transitionTimeout, animationTimeout);
8068
- type = timeout > 0
8069
- ? transitionTimeout > animationTimeout
8070
- ? TRANSITION
8071
- : ANIMATION
8072
- : null;
8073
- propCount = type
8074
- ? type === TRANSITION
8075
- ? transitionDurations.length
8076
- : animationDurations.length
8077
- : 0;
8078
- }
8079
- var hasTransform =
8080
- type === TRANSITION &&
8081
- transformRE.test(styles[transitionProp + 'Property']);
8082
- return {
8083
- type: type,
8084
- timeout: timeout,
8085
- propCount: propCount,
8086
- hasTransform: hasTransform
8087
- }
8088
- }
8089
-
8090
- function getTimeout (delays, durations) {
8091
- /* istanbul ignore next */
8092
- while (delays.length < durations.length) {
8093
- delays = delays.concat(delays);
8094
- }
8095
-
8096
- return Math.max.apply(null, durations.map(function (d, i) {
8097
- return toMs(d) + toMs(delays[i])
8098
- }))
8099
- }
8100
-
8101
- // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
8102
- // in a locale-dependent way, using a comma instead of a dot.
8103
- // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
8104
- // as a floor function) causing unexpected behaviors
8105
- function toMs (s) {
8106
- return Number(s.slice(0, -1).replace(',', '.')) * 1000
8107
- }
8108
-
8109
- /* */
8110
-
8111
- function enter (vnode, toggleDisplay) {
8112
- var el = vnode.elm;
8113
-
8114
- // call leave callback now
8115
- if (isDef(el._leaveCb)) {
8116
- el._leaveCb.cancelled = true;
8117
- el._leaveCb();
8118
- }
8119
-
8120
- var data = resolveTransition(vnode.data.transition);
8121
- if (isUndef(data)) {
8122
- return
8123
- }
8124
-
8125
- /* istanbul ignore if */
8126
- if (isDef(el._enterCb) || el.nodeType !== 1) {
8127
- return
8128
- }
8129
-
8130
- var css = data.css;
8131
- var type = data.type;
8132
- var enterClass = data.enterClass;
8133
- var enterToClass = data.enterToClass;
8134
- var enterActiveClass = data.enterActiveClass;
8135
- var appearClass = data.appearClass;
8136
- var appearToClass = data.appearToClass;
8137
- var appearActiveClass = data.appearActiveClass;
8138
- var beforeEnter = data.beforeEnter;
8139
- var enter = data.enter;
8140
- var afterEnter = data.afterEnter;
8141
- var enterCancelled = data.enterCancelled;
8142
- var beforeAppear = data.beforeAppear;
8143
- var appear = data.appear;
8144
- var afterAppear = data.afterAppear;
8145
- var appearCancelled = data.appearCancelled;
8146
- var duration = data.duration;
8147
-
8148
- // activeInstance will always be the <transition> component managing this
8149
- // transition. One edge case to check is when the <transition> is placed
8150
- // as the root node of a child component. In that case we need to check
8151
- // <transition>'s parent for appear check.
8152
- var context = activeInstance;
8153
- var transitionNode = activeInstance.$vnode;
8154
- while (transitionNode && transitionNode.parent) {
8155
- context = transitionNode.context;
8156
- transitionNode = transitionNode.parent;
8157
- }
8158
-
8159
- var isAppear = !context._isMounted || !vnode.isRootInsert;
8160
-
8161
- if (isAppear && !appear && appear !== '') {
8162
- return
8163
- }
8164
-
8165
- var startClass = isAppear && appearClass
8166
- ? appearClass
8167
- : enterClass;
8168
- var activeClass = isAppear && appearActiveClass
8169
- ? appearActiveClass
8170
- : enterActiveClass;
8171
- var toClass = isAppear && appearToClass
8172
- ? appearToClass
8173
- : enterToClass;
8174
-
8175
- var beforeEnterHook = isAppear
8176
- ? (beforeAppear || beforeEnter)
8177
- : beforeEnter;
8178
- var enterHook = isAppear
8179
- ? (typeof appear === 'function' ? appear : enter)
8180
- : enter;
8181
- var afterEnterHook = isAppear
8182
- ? (afterAppear || afterEnter)
8183
- : afterEnter;
8184
- var enterCancelledHook = isAppear
8185
- ? (appearCancelled || enterCancelled)
8186
- : enterCancelled;
8187
-
8188
- var explicitEnterDuration = toNumber(
8189
- isObject(duration)
8190
- ? duration.enter
8191
- : duration
8192
- );
8193
-
8194
- if (explicitEnterDuration != null) {
8195
- checkDuration(explicitEnterDuration, 'enter', vnode);
8196
- }
8197
-
8198
- var expectsCSS = css !== false && !isIE9;
8199
- var userWantsControl = getHookArgumentsLength(enterHook);
8200
-
8201
- var cb = el._enterCb = once(function () {
8202
- if (expectsCSS) {
8203
- removeTransitionClass(el, toClass);
8204
- removeTransitionClass(el, activeClass);
8205
- }
8206
- if (cb.cancelled) {
8207
- if (expectsCSS) {
8208
- removeTransitionClass(el, startClass);
8209
- }
8210
- enterCancelledHook && enterCancelledHook(el);
8211
- } else {
8212
- afterEnterHook && afterEnterHook(el);
8213
- }
8214
- el._enterCb = null;
8215
- });
8216
-
8217
- if (!vnode.data.show) {
8218
- // remove pending leave element on enter by injecting an insert hook
8219
- mergeVNodeHook(vnode, 'insert', function () {
8220
- var parent = el.parentNode;
8221
- var pendingNode = parent && parent._pending && parent._pending[vnode.key];
8222
- if (pendingNode &&
8223
- pendingNode.tag === vnode.tag &&
8224
- pendingNode.elm._leaveCb
8225
- ) {
8226
- pendingNode.elm._leaveCb();
8227
- }
8228
- enterHook && enterHook(el, cb);
8229
- });
8230
- }
8231
-
8232
- // start enter transition
8233
- beforeEnterHook && beforeEnterHook(el);
8234
- if (expectsCSS) {
8235
- addTransitionClass(el, startClass);
8236
- addTransitionClass(el, activeClass);
8237
- nextFrame(function () {
8238
- removeTransitionClass(el, startClass);
8239
- if (!cb.cancelled) {
8240
- addTransitionClass(el, toClass);
8241
- if (!userWantsControl) {
8242
- if (isValidDuration(explicitEnterDuration)) {
8243
- setTimeout(cb, explicitEnterDuration);
8244
- } else {
8245
- whenTransitionEnds(el, type, cb);
8246
- }
8247
- }
8248
- }
8249
- });
8250
- }
8251
-
8252
- if (vnode.data.show) {
8253
- toggleDisplay && toggleDisplay();
8254
- enterHook && enterHook(el, cb);
8255
- }
8256
-
8257
- if (!expectsCSS && !userWantsControl) {
8258
- cb();
8259
- }
8260
- }
8261
-
8262
- function leave (vnode, rm) {
8263
- var el = vnode.elm;
8264
-
8265
- // call enter callback now
8266
- if (isDef(el._enterCb)) {
8267
- el._enterCb.cancelled = true;
8268
- el._enterCb();
8269
- }
8270
-
8271
- var data = resolveTransition(vnode.data.transition);
8272
- if (isUndef(data) || el.nodeType !== 1) {
8273
- return rm()
8274
- }
8275
-
8276
- /* istanbul ignore if */
8277
- if (isDef(el._leaveCb)) {
8278
- return
8279
- }
8280
-
8281
- var css = data.css;
8282
- var type = data.type;
8283
- var leaveClass = data.leaveClass;
8284
- var leaveToClass = data.leaveToClass;
8285
- var leaveActiveClass = data.leaveActiveClass;
8286
- var beforeLeave = data.beforeLeave;
8287
- var leave = data.leave;
8288
- var afterLeave = data.afterLeave;
8289
- var leaveCancelled = data.leaveCancelled;
8290
- var delayLeave = data.delayLeave;
8291
- var duration = data.duration;
8292
-
8293
- var expectsCSS = css !== false && !isIE9;
8294
- var userWantsControl = getHookArgumentsLength(leave);
8295
-
8296
- var explicitLeaveDuration = toNumber(
8297
- isObject(duration)
8298
- ? duration.leave
8299
- : duration
8300
- );
8301
-
8302
- if (isDef(explicitLeaveDuration)) {
8303
- checkDuration(explicitLeaveDuration, 'leave', vnode);
8304
- }
8305
-
8306
- var cb = el._leaveCb = once(function () {
8307
- if (el.parentNode && el.parentNode._pending) {
8308
- el.parentNode._pending[vnode.key] = null;
8309
- }
8310
- if (expectsCSS) {
8311
- removeTransitionClass(el, leaveToClass);
8312
- removeTransitionClass(el, leaveActiveClass);
8313
- }
8314
- if (cb.cancelled) {
8315
- if (expectsCSS) {
8316
- removeTransitionClass(el, leaveClass);
8317
- }
8318
- leaveCancelled && leaveCancelled(el);
8319
- } else {
8320
- rm();
8321
- afterLeave && afterLeave(el);
8322
- }
8323
- el._leaveCb = null;
8324
- });
8325
-
8326
- if (delayLeave) {
8327
- delayLeave(performLeave);
8328
- } else {
8329
- performLeave();
8330
- }
8331
-
8332
- function performLeave () {
8333
- // the delayed leave may have already been cancelled
8334
- if (cb.cancelled) {
8335
- return
8336
- }
8337
- // record leaving element
8338
- if (!vnode.data.show && el.parentNode) {
8339
- (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
8340
- }
8341
- beforeLeave && beforeLeave(el);
8342
- if (expectsCSS) {
8343
- addTransitionClass(el, leaveClass);
8344
- addTransitionClass(el, leaveActiveClass);
8345
- nextFrame(function () {
8346
- removeTransitionClass(el, leaveClass);
8347
- if (!cb.cancelled) {
8348
- addTransitionClass(el, leaveToClass);
8349
- if (!userWantsControl) {
8350
- if (isValidDuration(explicitLeaveDuration)) {
8351
- setTimeout(cb, explicitLeaveDuration);
8352
- } else {
8353
- whenTransitionEnds(el, type, cb);
8354
- }
8355
- }
8356
- }
8357
- });
8358
- }
8359
- leave && leave(el, cb);
8360
- if (!expectsCSS && !userWantsControl) {
8361
- cb();
8362
- }
8363
- }
8364
- }
8365
-
8366
- // only used in dev mode
8367
- function checkDuration (val, name, vnode) {
8368
- if (typeof val !== 'number') {
8369
- warn(
8370
- "<transition> explicit " + name + " duration is not a valid number - " +
8371
- "got " + (JSON.stringify(val)) + ".",
8372
- vnode.context
8373
- );
8374
- } else if (isNaN(val)) {
8375
- warn(
8376
- "<transition> explicit " + name + " duration is NaN - " +
8377
- 'the duration expression might be incorrect.',
8378
- vnode.context
8379
- );
8380
- }
8381
- }
8382
-
8383
- function isValidDuration (val) {
8384
- return typeof val === 'number' && !isNaN(val)
8385
- }
8386
-
8387
- /**
8388
- * Normalize a transition hook's argument length. The hook may be:
8389
- * - a merged hook (invoker) with the original in .fns
8390
- * - a wrapped component method (check ._length)
8391
- * - a plain function (.length)
8392
- */
8393
- function getHookArgumentsLength (fn) {
8394
- if (isUndef(fn)) {
8395
- return false
8396
- }
8397
- var invokerFns = fn.fns;
8398
- if (isDef(invokerFns)) {
8399
- // invoker
8400
- return getHookArgumentsLength(
8401
- Array.isArray(invokerFns)
8402
- ? invokerFns[0]
8403
- : invokerFns
8404
- )
8405
- } else {
8406
- return (fn._length || fn.length) > 1
8407
- }
8408
- }
8409
-
8410
- function _enter (_, vnode) {
8411
- if (vnode.data.show !== true) {
8412
- enter(vnode);
8413
- }
8414
- }
8415
-
8416
- var transition = inBrowser ? {
8417
- create: _enter,
8418
- activate: _enter,
8419
- remove: function remove$$1 (vnode, rm) {
8420
- /* istanbul ignore else */
8421
- if (vnode.data.show !== true) {
8422
- leave(vnode, rm);
8423
- } else {
8424
- rm();
8425
- }
8426
- }
8427
- } : {};
8428
-
8429
- var platformModules = [
8430
- attrs,
8431
- klass,
8432
- events,
8433
- domProps,
8434
- style,
8435
- transition
8436
- ];
8437
-
8438
- /* */
8439
-
8440
- // the directive module should be applied last, after all
8441
- // built-in modules have been applied.
8442
- var modules = platformModules.concat(baseModules);
8443
-
8444
- var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
8445
-
8446
- /**
8447
- * Not type checking this file because flow doesn't like attaching
8448
- * properties to Elements.
8449
- */
8450
-
8451
- /* istanbul ignore if */
8452
- if (isIE9) {
8453
- // http://www.matts411.com/post/internet-explorer-9-oninput/
8454
- document.addEventListener('selectionchange', function () {
8455
- var el = document.activeElement;
8456
- if (el && el.vmodel) {
8457
- trigger(el, 'input');
8458
- }
8459
- });
8460
- }
8461
-
8462
- var directive = {
8463
- inserted: function inserted (el, binding, vnode, oldVnode) {
8464
- if (vnode.tag === 'select') {
8465
- // #6903
8466
- if (oldVnode.elm && !oldVnode.elm._vOptions) {
8467
- mergeVNodeHook(vnode, 'postpatch', function () {
8468
- directive.componentUpdated(el, binding, vnode);
8469
- });
8470
- } else {
8471
- setSelected(el, binding, vnode.context);
8472
- }
8473
- el._vOptions = [].map.call(el.options, getValue);
8474
- } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
8475
- el._vModifiers = binding.modifiers;
8476
- if (!binding.modifiers.lazy) {
8477
- el.addEventListener('compositionstart', onCompositionStart);
8478
- el.addEventListener('compositionend', onCompositionEnd);
8479
- // Safari < 10.2 & UIWebView doesn't fire compositionend when
8480
- // switching focus before confirming composition choice
8481
- // this also fixes the issue where some browsers e.g. iOS Chrome
8482
- // fires "change" instead of "input" on autocomplete.
8483
- el.addEventListener('change', onCompositionEnd);
8484
- /* istanbul ignore if */
8485
- if (isIE9) {
8486
- el.vmodel = true;
8487
- }
8488
- }
8489
- }
8490
- },
8491
-
8492
- componentUpdated: function componentUpdated (el, binding, vnode) {
8493
- if (vnode.tag === 'select') {
8494
- setSelected(el, binding, vnode.context);
8495
- // in case the options rendered by v-for have changed,
8496
- // it's possible that the value is out-of-sync with the rendered options.
8497
- // detect such cases and filter out values that no longer has a matching
8498
- // option in the DOM.
8499
- var prevOptions = el._vOptions;
8500
- var curOptions = el._vOptions = [].map.call(el.options, getValue);
8501
- if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
8502
- // trigger change event if
8503
- // no matching option found for at least one value
8504
- var needReset = el.multiple
8505
- ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
8506
- : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
8507
- if (needReset) {
8508
- trigger(el, 'change');
8509
- }
8510
- }
8511
- }
8512
- }
8513
- };
8514
-
8515
- function setSelected (el, binding, vm) {
8516
- actuallySetSelected(el, binding, vm);
8517
- /* istanbul ignore if */
8518
- if (isIE || isEdge) {
8519
- setTimeout(function () {
8520
- actuallySetSelected(el, binding, vm);
8521
- }, 0);
8522
- }
8523
- }
8524
-
8525
- function actuallySetSelected (el, binding, vm) {
8526
- var value = binding.value;
8527
- var isMultiple = el.multiple;
8528
- if (isMultiple && !Array.isArray(value)) {
8529
- warn(
8530
- "<select multiple v-model=\"" + (binding.expression) + "\"> " +
8531
- "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
8532
- vm
8533
- );
8534
- return
8535
- }
8536
- var selected, option;
8537
- for (var i = 0, l = el.options.length; i < l; i++) {
8538
- option = el.options[i];
8539
- if (isMultiple) {
8540
- selected = looseIndexOf(value, getValue(option)) > -1;
8541
- if (option.selected !== selected) {
8542
- option.selected = selected;
8543
- }
8544
- } else {
8545
- if (looseEqual(getValue(option), value)) {
8546
- if (el.selectedIndex !== i) {
8547
- el.selectedIndex = i;
8548
- }
8549
- return
8550
- }
8551
- }
8552
- }
8553
- if (!isMultiple) {
8554
- el.selectedIndex = -1;
8555
- }
8556
- }
8557
-
8558
- function hasNoMatchingOption (value, options) {
8559
- return options.every(function (o) { return !looseEqual(o, value); })
8560
- }
8561
-
8562
- function getValue (option) {
8563
- return '_value' in option
8564
- ? option._value
8565
- : option.value
8566
- }
8567
-
8568
- function onCompositionStart (e) {
8569
- e.target.composing = true;
8570
- }
8571
-
8572
- function onCompositionEnd (e) {
8573
- // prevent triggering an input event for no reason
8574
- if (!e.target.composing) { return }
8575
- e.target.composing = false;
8576
- trigger(e.target, 'input');
8577
- }
8578
-
8579
- function trigger (el, type) {
8580
- var e = document.createEvent('HTMLEvents');
8581
- e.initEvent(type, true, true);
8582
- el.dispatchEvent(e);
8583
- }
8584
-
8585
- /* */
8586
-
8587
- // recursively search for possible transition defined inside the component root
8588
- function locateNode (vnode) {
8589
- return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
8590
- ? locateNode(vnode.componentInstance._vnode)
8591
- : vnode
8592
- }
8593
-
8594
- var show = {
8595
- bind: function bind (el, ref, vnode) {
8596
- var value = ref.value;
8597
-
8598
- vnode = locateNode(vnode);
8599
- var transition$$1 = vnode.data && vnode.data.transition;
8600
- var originalDisplay = el.__vOriginalDisplay =
8601
- el.style.display === 'none' ? '' : el.style.display;
8602
- if (value && transition$$1) {
8603
- vnode.data.show = true;
8604
- enter(vnode, function () {
8605
- el.style.display = originalDisplay;
8606
- });
8607
- } else {
8608
- el.style.display = value ? originalDisplay : 'none';
8609
- }
8610
- },
8611
-
8612
- update: function update (el, ref, vnode) {
8613
- var value = ref.value;
8614
- var oldValue = ref.oldValue;
8615
-
8616
- /* istanbul ignore if */
8617
- if (!value === !oldValue) { return }
8618
- vnode = locateNode(vnode);
8619
- var transition$$1 = vnode.data && vnode.data.transition;
8620
- if (transition$$1) {
8621
- vnode.data.show = true;
8622
- if (value) {
8623
- enter(vnode, function () {
8624
- el.style.display = el.__vOriginalDisplay;
8625
- });
8626
- } else {
8627
- leave(vnode, function () {
8628
- el.style.display = 'none';
8629
- });
8630
- }
8631
- } else {
8632
- el.style.display = value ? el.__vOriginalDisplay : 'none';
8633
- }
8634
- },
8635
-
8636
- unbind: function unbind (
8637
- el,
8638
- binding,
8639
- vnode,
8640
- oldVnode,
8641
- isDestroy
8642
- ) {
8643
- if (!isDestroy) {
8644
- el.style.display = el.__vOriginalDisplay;
8645
- }
8646
- }
8647
- };
8648
-
8649
- var platformDirectives = {
8650
- model: directive,
8651
- show: show
8652
- };
8653
-
8654
- /* */
8655
-
8656
- var transitionProps = {
8657
- name: String,
8658
- appear: Boolean,
8659
- css: Boolean,
8660
- mode: String,
8661
- type: String,
8662
- enterClass: String,
8663
- leaveClass: String,
8664
- enterToClass: String,
8665
- leaveToClass: String,
8666
- enterActiveClass: String,
8667
- leaveActiveClass: String,
8668
- appearClass: String,
8669
- appearActiveClass: String,
8670
- appearToClass: String,
8671
- duration: [Number, String, Object]
8672
- };
8673
-
8674
- // in case the child is also an abstract component, e.g. <keep-alive>
8675
- // we want to recursively retrieve the real component to be rendered
8676
- function getRealChild (vnode) {
8677
- var compOptions = vnode && vnode.componentOptions;
8678
- if (compOptions && compOptions.Ctor.options.abstract) {
8679
- return getRealChild(getFirstComponentChild(compOptions.children))
8680
- } else {
8681
- return vnode
8682
- }
8683
- }
8684
-
8685
- function extractTransitionData (comp) {
8686
- var data = {};
8687
- var options = comp.$options;
8688
- // props
8689
- for (var key in options.propsData) {
8690
- data[key] = comp[key];
8691
- }
8692
- // events.
8693
- // extract listeners and pass them directly to the transition methods
8694
- var listeners = options._parentListeners;
8695
- for (var key$1 in listeners) {
8696
- data[camelize(key$1)] = listeners[key$1];
8697
- }
8698
- return data
8699
- }
8700
-
8701
- function placeholder (h, rawChild) {
8702
- if (/\d-keep-alive$/.test(rawChild.tag)) {
8703
- return h('keep-alive', {
8704
- props: rawChild.componentOptions.propsData
8705
- })
8706
- }
8707
- }
8708
-
8709
- function hasParentTransition (vnode) {
8710
- while ((vnode = vnode.parent)) {
8711
- if (vnode.data.transition) {
8712
- return true
8713
- }
8714
- }
8715
- }
8716
-
8717
- function isSameChild (child, oldChild) {
8718
- return oldChild.key === child.key && oldChild.tag === child.tag
8719
- }
8720
-
8721
- var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
8722
-
8723
- var isVShowDirective = function (d) { return d.name === 'show'; };
8724
-
8725
- var Transition = {
8726
- name: 'transition',
8727
- props: transitionProps,
8728
- abstract: true,
8729
-
8730
- render: function render (h) {
8731
- var this$1 = this;
8732
-
8733
- var children = this.$slots.default;
8734
- if (!children) {
8735
- return
8736
- }
8737
-
8738
- // filter out text nodes (possible whitespaces)
8739
- children = children.filter(isNotTextNode);
8740
- /* istanbul ignore if */
8741
- if (!children.length) {
8742
- return
8743
- }
8744
-
8745
- // warn multiple elements
8746
- if (children.length > 1) {
8747
- warn(
8748
- '<transition> can only be used on a single element. Use ' +
8749
- '<transition-group> for lists.',
8750
- this.$parent
8751
- );
8752
- }
8753
-
8754
- var mode = this.mode;
8755
-
8756
- // warn invalid mode
8757
- if (mode && mode !== 'in-out' && mode !== 'out-in'
8758
- ) {
8759
- warn(
8760
- 'invalid <transition> mode: ' + mode,
8761
- this.$parent
8762
- );
8763
- }
8764
-
8765
- var rawChild = children[0];
8766
-
8767
- // if this is a component root node and the component's
8768
- // parent container node also has transition, skip.
8769
- if (hasParentTransition(this.$vnode)) {
8770
- return rawChild
8771
- }
8772
-
8773
- // apply transition data to child
8774
- // use getRealChild() to ignore abstract components e.g. keep-alive
8775
- var child = getRealChild(rawChild);
8776
- /* istanbul ignore if */
8777
- if (!child) {
8778
- return rawChild
8779
- }
8780
-
8781
- if (this._leaving) {
8782
- return placeholder(h, rawChild)
8783
- }
8784
-
8785
- // ensure a key that is unique to the vnode type and to this transition
8786
- // component instance. This key will be used to remove pending leaving nodes
8787
- // during entering.
8788
- var id = "__transition-" + (this._uid) + "-";
8789
- child.key = child.key == null
8790
- ? child.isComment
8791
- ? id + 'comment'
8792
- : id + child.tag
8793
- : isPrimitive(child.key)
8794
- ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
8795
- : child.key;
8796
-
8797
- var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
8798
- var oldRawChild = this._vnode;
8799
- var oldChild = getRealChild(oldRawChild);
8800
-
8801
- // mark v-show
8802
- // so that the transition module can hand over the control to the directive
8803
- if (child.data.directives && child.data.directives.some(isVShowDirective)) {
8804
- child.data.show = true;
8805
- }
8806
-
8807
- if (
8808
- oldChild &&
8809
- oldChild.data &&
8810
- !isSameChild(child, oldChild) &&
8811
- !isAsyncPlaceholder(oldChild) &&
8812
- // #6687 component root is a comment node
8813
- !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
8814
- ) {
8815
- // replace old child transition data with fresh one
8816
- // important for dynamic transitions!
8817
- var oldData = oldChild.data.transition = extend({}, data);
8818
- // handle transition mode
8819
- if (mode === 'out-in') {
8820
- // return placeholder node and queue update when leave finishes
8821
- this._leaving = true;
8822
- mergeVNodeHook(oldData, 'afterLeave', function () {
8823
- this$1._leaving = false;
8824
- this$1.$forceUpdate();
8825
- });
8826
- return placeholder(h, rawChild)
8827
- } else if (mode === 'in-out') {
8828
- if (isAsyncPlaceholder(child)) {
8829
- return oldRawChild
8830
- }
8831
- var delayedLeave;
8832
- var performLeave = function () { delayedLeave(); };
8833
- mergeVNodeHook(data, 'afterEnter', performLeave);
8834
- mergeVNodeHook(data, 'enterCancelled', performLeave);
8835
- mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
8836
- }
8837
- }
8838
-
8839
- return rawChild
8840
- }
8841
- };
8842
-
8843
- /* */
8844
-
8845
- var props = extend({
8846
- tag: String,
8847
- moveClass: String
8848
- }, transitionProps);
8849
-
8850
- delete props.mode;
8851
-
8852
- var TransitionGroup = {
8853
- props: props,
8854
-
8855
- beforeMount: function beforeMount () {
8856
- var this$1 = this;
8857
-
8858
- var update = this._update;
8859
- this._update = function (vnode, hydrating) {
8860
- var restoreActiveInstance = setActiveInstance(this$1);
8861
- // force removing pass
8862
- this$1.__patch__(
8863
- this$1._vnode,
8864
- this$1.kept,
8865
- false, // hydrating
8866
- true // removeOnly (!important, avoids unnecessary moves)
8867
- );
8868
- this$1._vnode = this$1.kept;
8869
- restoreActiveInstance();
8870
- update.call(this$1, vnode, hydrating);
8871
- };
8872
- },
8873
-
8874
- render: function render (h) {
8875
- var tag = this.tag || this.$vnode.data.tag || 'span';
8876
- var map = Object.create(null);
8877
- var prevChildren = this.prevChildren = this.children;
8878
- var rawChildren = this.$slots.default || [];
8879
- var children = this.children = [];
8880
- var transitionData = extractTransitionData(this);
8881
-
8882
- for (var i = 0; i < rawChildren.length; i++) {
8883
- var c = rawChildren[i];
8884
- if (c.tag) {
8885
- if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
8886
- children.push(c);
8887
- map[c.key] = c
8888
- ;(c.data || (c.data = {})).transition = transitionData;
8889
- } else {
8890
- var opts = c.componentOptions;
8891
- var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
8892
- warn(("<transition-group> children must be keyed: <" + name + ">"));
8893
- }
8894
- }
8895
- }
8896
-
8897
- if (prevChildren) {
8898
- var kept = [];
8899
- var removed = [];
8900
- for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
8901
- var c$1 = prevChildren[i$1];
8902
- c$1.data.transition = transitionData;
8903
- c$1.data.pos = c$1.elm.getBoundingClientRect();
8904
- if (map[c$1.key]) {
8905
- kept.push(c$1);
8906
- } else {
8907
- removed.push(c$1);
8908
- }
8909
- }
8910
- this.kept = h(tag, null, kept);
8911
- this.removed = removed;
8912
- }
8913
-
8914
- return h(tag, null, children)
8915
- },
8916
-
8917
- updated: function updated () {
8918
- var children = this.prevChildren;
8919
- var moveClass = this.moveClass || ((this.name || 'v') + '-move');
8920
- if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
8921
- return
8922
- }
8923
-
8924
- // we divide the work into three loops to avoid mixing DOM reads and writes
8925
- // in each iteration - which helps prevent layout thrashing.
8926
- children.forEach(callPendingCbs);
8927
- children.forEach(recordPosition);
8928
- children.forEach(applyTranslation);
8929
-
8930
- // force reflow to put everything in position
8931
- // assign to this to avoid being removed in tree-shaking
8932
- // $flow-disable-line
8933
- this._reflow = document.body.offsetHeight;
8934
-
8935
- children.forEach(function (c) {
8936
- if (c.data.moved) {
8937
- var el = c.elm;
8938
- var s = el.style;
8939
- addTransitionClass(el, moveClass);
8940
- s.transform = s.WebkitTransform = s.transitionDuration = '';
8941
- el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
8942
- if (e && e.target !== el) {
8943
- return
8944
- }
8945
- if (!e || /transform$/.test(e.propertyName)) {
8946
- el.removeEventListener(transitionEndEvent, cb);
8947
- el._moveCb = null;
8948
- removeTransitionClass(el, moveClass);
8949
- }
8950
- });
8951
- }
8952
- });
8953
- },
8954
-
8955
- methods: {
8956
- hasMove: function hasMove (el, moveClass) {
8957
- /* istanbul ignore if */
8958
- if (!hasTransition) {
8959
- return false
8960
- }
8961
- /* istanbul ignore if */
8962
- if (this._hasMove) {
8963
- return this._hasMove
8964
- }
8965
- // Detect whether an element with the move class applied has
8966
- // CSS transitions. Since the element may be inside an entering
8967
- // transition at this very moment, we make a clone of it and remove
8968
- // all other transition classes applied to ensure only the move class
8969
- // is applied.
8970
- var clone = el.cloneNode();
8971
- if (el._transitionClasses) {
8972
- el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
8973
- }
8974
- addClass(clone, moveClass);
8975
- clone.style.display = 'none';
8976
- this.$el.appendChild(clone);
8977
- var info = getTransitionInfo(clone);
8978
- this.$el.removeChild(clone);
8979
- return (this._hasMove = info.hasTransform)
8980
- }
8981
- }
8982
- };
8983
-
8984
- function callPendingCbs (c) {
8985
- /* istanbul ignore if */
8986
- if (c.elm._moveCb) {
8987
- c.elm._moveCb();
8988
- }
8989
- /* istanbul ignore if */
8990
- if (c.elm._enterCb) {
8991
- c.elm._enterCb();
8992
- }
8993
- }
8994
-
8995
- function recordPosition (c) {
8996
- c.data.newPos = c.elm.getBoundingClientRect();
8997
- }
8998
-
8999
- function applyTranslation (c) {
9000
- var oldPos = c.data.pos;
9001
- var newPos = c.data.newPos;
9002
- var dx = oldPos.left - newPos.left;
9003
- var dy = oldPos.top - newPos.top;
9004
- if (dx || dy) {
9005
- c.data.moved = true;
9006
- var s = c.elm.style;
9007
- s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
9008
- s.transitionDuration = '0s';
9009
- }
9010
- }
9011
-
9012
- var platformComponents = {
9013
- Transition: Transition,
9014
- TransitionGroup: TransitionGroup
9015
- };
9016
-
9017
- /* */
9018
-
9019
- // install platform specific utils
9020
- Vue.config.mustUseProp = mustUseProp;
9021
- Vue.config.isReservedTag = isReservedTag;
9022
- Vue.config.isReservedAttr = isReservedAttr;
9023
- Vue.config.getTagNamespace = getTagNamespace;
9024
- Vue.config.isUnknownElement = isUnknownElement;
9025
-
9026
- // install platform runtime directives & components
9027
- extend(Vue.options.directives, platformDirectives);
9028
- extend(Vue.options.components, platformComponents);
9029
-
9030
- // install platform patch function
9031
- Vue.prototype.__patch__ = inBrowser ? patch : noop;
9032
-
9033
- // public mount method
9034
- Vue.prototype.$mount = function (
9035
- el,
9036
- hydrating
9037
- ) {
9038
- el = el && inBrowser ? query(el) : undefined;
9039
- return mountComponent(this, el, hydrating)
9040
- };
9041
-
9042
- // devtools global hook
9043
- /* istanbul ignore next */
9044
- if (inBrowser) {
9045
- setTimeout(function () {
9046
- if (config.devtools) {
9047
- if (devtools) {
9048
- devtools.emit('init', Vue);
9049
- } else {
9050
- console[console.info ? 'info' : 'log'](
9051
- 'Download the Vue Devtools extension for a better development experience:\n' +
9052
- 'https://github.com/vuejs/vue-devtools'
9053
- );
9054
- }
9055
- }
9056
- if (config.productionTip !== false &&
9057
- typeof console !== 'undefined'
9058
- ) {
9059
- console[console.info ? 'info' : 'log'](
9060
- "You are running Vue in development mode.\n" +
9061
- "Make sure to turn on production mode when deploying for production.\n" +
9062
- "See more tips at https://vuejs.org/guide/deployment.html"
9063
- );
9064
- }
9065
- }, 0);
9066
- }
9067
-
9068
- /* */
9069
-
9070
- var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
9071
- var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
9072
-
9073
- var buildRegex = cached(function (delimiters) {
9074
- var open = delimiters[0].replace(regexEscapeRE, '\\$&');
9075
- var close = delimiters[1].replace(regexEscapeRE, '\\$&');
9076
- return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
9077
- });
9078
-
9079
-
9080
-
9081
- function parseText (
9082
- text,
9083
- delimiters
9084
- ) {
9085
- var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
9086
- if (!tagRE.test(text)) {
9087
- return
9088
- }
9089
- var tokens = [];
9090
- var rawTokens = [];
9091
- var lastIndex = tagRE.lastIndex = 0;
9092
- var match, index, tokenValue;
9093
- while ((match = tagRE.exec(text))) {
9094
- index = match.index;
9095
- // push text token
9096
- if (index > lastIndex) {
9097
- rawTokens.push(tokenValue = text.slice(lastIndex, index));
9098
- tokens.push(JSON.stringify(tokenValue));
9099
- }
9100
- // tag token
9101
- var exp = parseFilters(match[1].trim());
9102
- tokens.push(("_s(" + exp + ")"));
9103
- rawTokens.push({ '@binding': exp });
9104
- lastIndex = index + match[0].length;
9105
- }
9106
- if (lastIndex < text.length) {
9107
- rawTokens.push(tokenValue = text.slice(lastIndex));
9108
- tokens.push(JSON.stringify(tokenValue));
9109
- }
9110
- return {
9111
- expression: tokens.join('+'),
9112
- tokens: rawTokens
9113
- }
9114
- }
9115
-
9116
- /* */
9117
-
9118
- function transformNode (el, options) {
9119
- var warn = options.warn || baseWarn;
9120
- var staticClass = getAndRemoveAttr(el, 'class');
9121
- if (staticClass) {
9122
- var res = parseText(staticClass, options.delimiters);
9123
- if (res) {
9124
- warn(
9125
- "class=\"" + staticClass + "\": " +
9126
- 'Interpolation inside attributes has been removed. ' +
9127
- 'Use v-bind or the colon shorthand instead. For example, ' +
9128
- 'instead of <div class="{{ val }}">, use <div :class="val">.',
9129
- el.rawAttrsMap['class']
9130
- );
9131
- }
9132
- }
9133
- if (staticClass) {
9134
- el.staticClass = JSON.stringify(staticClass);
9135
- }
9136
- var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
9137
- if (classBinding) {
9138
- el.classBinding = classBinding;
9139
- }
9140
- }
9141
-
9142
- function genData (el) {
9143
- var data = '';
9144
- if (el.staticClass) {
9145
- data += "staticClass:" + (el.staticClass) + ",";
9146
- }
9147
- if (el.classBinding) {
9148
- data += "class:" + (el.classBinding) + ",";
9149
- }
9150
- return data
9151
- }
9152
-
9153
- var klass$1 = {
9154
- staticKeys: ['staticClass'],
9155
- transformNode: transformNode,
9156
- genData: genData
9157
- };
9158
-
9159
- /* */
9160
-
9161
- function transformNode$1 (el, options) {
9162
- var warn = options.warn || baseWarn;
9163
- var staticStyle = getAndRemoveAttr(el, 'style');
9164
- if (staticStyle) {
9165
- /* istanbul ignore if */
9166
- {
9167
- var res = parseText(staticStyle, options.delimiters);
9168
- if (res) {
9169
- warn(
9170
- "style=\"" + staticStyle + "\": " +
9171
- 'Interpolation inside attributes has been removed. ' +
9172
- 'Use v-bind or the colon shorthand instead. For example, ' +
9173
- 'instead of <div style="{{ val }}">, use <div :style="val">.',
9174
- el.rawAttrsMap['style']
9175
- );
9176
- }
9177
- }
9178
- el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
9179
- }
9180
-
9181
- var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
9182
- if (styleBinding) {
9183
- el.styleBinding = styleBinding;
9184
- }
9185
- }
9186
-
9187
- function genData$1 (el) {
9188
- var data = '';
9189
- if (el.staticStyle) {
9190
- data += "staticStyle:" + (el.staticStyle) + ",";
9191
- }
9192
- if (el.styleBinding) {
9193
- data += "style:(" + (el.styleBinding) + "),";
9194
- }
9195
- return data
9196
- }
9197
-
9198
- var style$1 = {
9199
- staticKeys: ['staticStyle'],
9200
- transformNode: transformNode$1,
9201
- genData: genData$1
9202
- };
9203
-
9204
- /* */
9205
-
9206
- var decoder;
9207
-
9208
- var he = {
9209
- decode: function decode (html) {
9210
- decoder = decoder || document.createElement('div');
9211
- decoder.innerHTML = html;
9212
- return decoder.textContent
9213
- }
9214
- };
9215
-
9216
- /* */
9217
-
9218
- var isUnaryTag = makeMap(
9219
- 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
9220
- 'link,meta,param,source,track,wbr'
9221
- );
9222
-
9223
- // Elements that you can, intentionally, leave open
9224
- // (and which close themselves)
9225
- var canBeLeftOpenTag = makeMap(
9226
- 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
9227
- );
9228
-
9229
- // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
9230
- // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
9231
- var isNonPhrasingTag = makeMap(
9232
- 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
9233
- 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
9234
- 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
9235
- 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
9236
- 'title,tr,track'
9237
- );
9238
-
9239
- /**
9240
- * Not type-checking this file because it's mostly vendor code.
9241
- */
9242
-
9243
- // Regular Expressions for parsing tags and attributes
9244
- var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
9245
- var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
9246
- var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
9247
- var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
9248
- var startTagOpen = new RegExp(("^<" + qnameCapture));
9249
- var startTagClose = /^\s*(\/?)>/;
9250
- var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
9251
- var doctype = /^<!DOCTYPE [^>]+>/i;
9252
- // #7298: escape - to avoid being pased as HTML comment when inlined in page
9253
- var comment = /^<!\--/;
9254
- var conditionalComment = /^<!\[/;
9255
-
9256
- // Special Elements (can contain anything)
9257
- var isPlainTextElement = makeMap('script,style,textarea', true);
9258
- var reCache = {};
9259
-
9260
- var decodingMap = {
9261
- '&lt;': '<',
9262
- '&gt;': '>',
9263
- '&quot;': '"',
9264
- '&amp;': '&',
9265
- '&#10;': '\n',
9266
- '&#9;': '\t',
9267
- '&#39;': "'"
9268
- };
9269
- var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
9270
- var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
9271
-
9272
- // #5992
9273
- var isIgnoreNewlineTag = makeMap('pre,textarea', true);
9274
- var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
9275
-
9276
- function decodeAttr (value, shouldDecodeNewlines) {
9277
- var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
9278
- return value.replace(re, function (match) { return decodingMap[match]; })
9279
- }
9280
-
9281
- function parseHTML (html, options) {
9282
- var stack = [];
9283
- var expectHTML = options.expectHTML;
9284
- var isUnaryTag$$1 = options.isUnaryTag || no;
9285
- var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
9286
- var index = 0;
9287
- var last, lastTag;
9288
- while (html) {
9289
- last = html;
9290
- // Make sure we're not in a plaintext content element like script/style
9291
- if (!lastTag || !isPlainTextElement(lastTag)) {
9292
- var textEnd = html.indexOf('<');
9293
- if (textEnd === 0) {
9294
- // Comment:
9295
- if (comment.test(html)) {
9296
- var commentEnd = html.indexOf('-->');
9297
-
9298
- if (commentEnd >= 0) {
9299
- if (options.shouldKeepComment) {
9300
- options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
9301
- }
9302
- advance(commentEnd + 3);
9303
- continue
9304
- }
9305
- }
9306
-
9307
- // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
9308
- if (conditionalComment.test(html)) {
9309
- var conditionalEnd = html.indexOf(']>');
9310
-
9311
- if (conditionalEnd >= 0) {
9312
- advance(conditionalEnd + 2);
9313
- continue
9314
- }
9315
- }
9316
-
9317
- // Doctype:
9318
- var doctypeMatch = html.match(doctype);
9319
- if (doctypeMatch) {
9320
- advance(doctypeMatch[0].length);
9321
- continue
9322
- }
9323
-
9324
- // End tag:
9325
- var endTagMatch = html.match(endTag);
9326
- if (endTagMatch) {
9327
- var curIndex = index;
9328
- advance(endTagMatch[0].length);
9329
- parseEndTag(endTagMatch[1], curIndex, index);
9330
- continue
9331
- }
9332
-
9333
- // Start tag:
9334
- var startTagMatch = parseStartTag();
9335
- if (startTagMatch) {
9336
- handleStartTag(startTagMatch);
9337
- if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
9338
- advance(1);
9339
- }
9340
- continue
9341
- }
9342
- }
9343
-
9344
- var text = (void 0), rest = (void 0), next = (void 0);
9345
- if (textEnd >= 0) {
9346
- rest = html.slice(textEnd);
9347
- while (
9348
- !endTag.test(rest) &&
9349
- !startTagOpen.test(rest) &&
9350
- !comment.test(rest) &&
9351
- !conditionalComment.test(rest)
9352
- ) {
9353
- // < in plain text, be forgiving and treat it as text
9354
- next = rest.indexOf('<', 1);
9355
- if (next < 0) { break }
9356
- textEnd += next;
9357
- rest = html.slice(textEnd);
9358
- }
9359
- text = html.substring(0, textEnd);
9360
- }
9361
-
9362
- if (textEnd < 0) {
9363
- text = html;
9364
- }
9365
-
9366
- if (text) {
9367
- advance(text.length);
9368
- }
9369
-
9370
- if (options.chars && text) {
9371
- options.chars(text, index - text.length, index);
9372
- }
9373
- } else {
9374
- var endTagLength = 0;
9375
- var stackedTag = lastTag.toLowerCase();
9376
- var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
9377
- var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
9378
- endTagLength = endTag.length;
9379
- if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
9380
- text = text
9381
- .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
9382
- .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
9383
- }
9384
- if (shouldIgnoreFirstNewline(stackedTag, text)) {
9385
- text = text.slice(1);
9386
- }
9387
- if (options.chars) {
9388
- options.chars(text);
9389
- }
9390
- return ''
9391
- });
9392
- index += html.length - rest$1.length;
9393
- html = rest$1;
9394
- parseEndTag(stackedTag, index - endTagLength, index);
9395
- }
9396
-
9397
- if (html === last) {
9398
- options.chars && options.chars(html);
9399
- if (!stack.length && options.warn) {
9400
- options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
9401
- }
9402
- break
9403
- }
9404
- }
9405
-
9406
- // Clean up any remaining tags
9407
- parseEndTag();
9408
-
9409
- function advance (n) {
9410
- index += n;
9411
- html = html.substring(n);
9412
- }
9413
-
9414
- function parseStartTag () {
9415
- var start = html.match(startTagOpen);
9416
- if (start) {
9417
- var match = {
9418
- tagName: start[1],
9419
- attrs: [],
9420
- start: index
9421
- };
9422
- advance(start[0].length);
9423
- var end, attr;
9424
- while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
9425
- attr.start = index;
9426
- advance(attr[0].length);
9427
- attr.end = index;
9428
- match.attrs.push(attr);
9429
- }
9430
- if (end) {
9431
- match.unarySlash = end[1];
9432
- advance(end[0].length);
9433
- match.end = index;
9434
- return match
9435
- }
9436
- }
9437
- }
9438
-
9439
- function handleStartTag (match) {
9440
- var tagName = match.tagName;
9441
- var unarySlash = match.unarySlash;
9442
-
9443
- if (expectHTML) {
9444
- if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
9445
- parseEndTag(lastTag);
9446
- }
9447
- if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
9448
- parseEndTag(tagName);
9449
- }
9450
- }
9451
-
9452
- var unary = isUnaryTag$$1(tagName) || !!unarySlash;
9453
-
9454
- var l = match.attrs.length;
9455
- var attrs = new Array(l);
9456
- for (var i = 0; i < l; i++) {
9457
- var args = match.attrs[i];
9458
- var value = args[3] || args[4] || args[5] || '';
9459
- var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
9460
- ? options.shouldDecodeNewlinesForHref
9461
- : options.shouldDecodeNewlines;
9462
- attrs[i] = {
9463
- name: args[1],
9464
- value: decodeAttr(value, shouldDecodeNewlines)
9465
- };
9466
- if (options.outputSourceRange) {
9467
- attrs[i].start = args.start + args[0].match(/^\s*/).length;
9468
- attrs[i].end = args.end;
9469
- }
9470
- }
9471
-
9472
- if (!unary) {
9473
- stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
9474
- lastTag = tagName;
9475
- }
9476
-
9477
- if (options.start) {
9478
- options.start(tagName, attrs, unary, match.start, match.end);
9479
- }
9480
- }
9481
-
9482
- function parseEndTag (tagName, start, end) {
9483
- var pos, lowerCasedTagName;
9484
- if (start == null) { start = index; }
9485
- if (end == null) { end = index; }
9486
-
9487
- // Find the closest opened tag of the same type
9488
- if (tagName) {
9489
- lowerCasedTagName = tagName.toLowerCase();
9490
- for (pos = stack.length - 1; pos >= 0; pos--) {
9491
- if (stack[pos].lowerCasedTag === lowerCasedTagName) {
9492
- break
9493
- }
9494
- }
9495
- } else {
9496
- // If no tag name is provided, clean shop
9497
- pos = 0;
9498
- }
9499
-
9500
- if (pos >= 0) {
9501
- // Close all the open elements, up the stack
9502
- for (var i = stack.length - 1; i >= pos; i--) {
9503
- if (i > pos || !tagName &&
9504
- options.warn
9505
- ) {
9506
- options.warn(
9507
- ("tag <" + (stack[i].tag) + "> has no matching end tag."),
9508
- { start: stack[i].start, end: stack[i].end }
9509
- );
9510
- }
9511
- if (options.end) {
9512
- options.end(stack[i].tag, start, end);
9513
- }
9514
- }
9515
-
9516
- // Remove the open elements from the stack
9517
- stack.length = pos;
9518
- lastTag = pos && stack[pos - 1].tag;
9519
- } else if (lowerCasedTagName === 'br') {
9520
- if (options.start) {
9521
- options.start(tagName, [], true, start, end);
9522
- }
9523
- } else if (lowerCasedTagName === 'p') {
9524
- if (options.start) {
9525
- options.start(tagName, [], false, start, end);
9526
- }
9527
- if (options.end) {
9528
- options.end(tagName, start, end);
9529
- }
9530
- }
9531
- }
9532
- }
9533
-
9534
- /* */
9535
-
9536
- var onRE = /^@|^v-on:/;
9537
- var dirRE = /^v-|^@|^:/;
9538
- var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
9539
- var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
9540
- var stripParensRE = /^\(|\)$/g;
9541
- var dynamicArgRE = /^\[.*\]$/;
9542
-
9543
- var argRE = /:(.*)$/;
9544
- var bindRE = /^:|^\.|^v-bind:/;
9545
- var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
9546
-
9547
- var slotRE = /^v-slot(:|$)|^#/;
9548
-
9549
- var lineBreakRE = /[\r\n]/;
9550
- var whitespaceRE$1 = /\s+/g;
9551
-
9552
- var invalidAttributeRE = /[\s"'<>\/=]/;
9553
-
9554
- var decodeHTMLCached = cached(he.decode);
9555
-
9556
- var emptySlotScopeToken = "_empty_";
9557
-
9558
- // configurable state
9559
- var warn$2;
9560
- var delimiters;
9561
- var transforms;
9562
- var preTransforms;
9563
- var postTransforms;
9564
- var platformIsPreTag;
9565
- var platformMustUseProp;
9566
- var platformGetTagNamespace;
9567
- var maybeComponent;
9568
-
9569
- function createASTElement (
9570
- tag,
9571
- attrs,
9572
- parent
9573
- ) {
9574
- return {
9575
- type: 1,
9576
- tag: tag,
9577
- attrsList: attrs,
9578
- attrsMap: makeAttrsMap(attrs),
9579
- rawAttrsMap: {},
9580
- parent: parent,
9581
- children: []
9582
- }
9583
- }
9584
-
9585
- /**
9586
- * Convert HTML string to AST.
9587
- */
9588
- function parse (
9589
- template,
9590
- options
9591
- ) {
9592
- warn$2 = options.warn || baseWarn;
9593
-
9594
- platformIsPreTag = options.isPreTag || no;
9595
- platformMustUseProp = options.mustUseProp || no;
9596
- platformGetTagNamespace = options.getTagNamespace || no;
9597
- var isReservedTag = options.isReservedTag || no;
9598
- maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
9599
-
9600
- transforms = pluckModuleFunction(options.modules, 'transformNode');
9601
- preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
9602
- postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
9603
-
9604
- delimiters = options.delimiters;
9605
-
9606
- var stack = [];
9607
- var preserveWhitespace = options.preserveWhitespace !== false;
9608
- var whitespaceOption = options.whitespace;
9609
- var root;
9610
- var currentParent;
9611
- var inVPre = false;
9612
- var inPre = false;
9613
- var warned = false;
9614
-
9615
- function warnOnce (msg, range) {
9616
- if (!warned) {
9617
- warned = true;
9618
- warn$2(msg, range);
9619
- }
9620
- }
9621
-
9622
- function closeElement (element) {
9623
- trimEndingWhitespace(element);
9624
- if (!inVPre && !element.processed) {
9625
- element = processElement(element, options);
9626
- }
9627
- // tree management
9628
- if (!stack.length && element !== root) {
9629
- // allow root elements with v-if, v-else-if and v-else
9630
- if (root.if && (element.elseif || element.else)) {
9631
- {
9632
- checkRootConstraints(element);
9633
- }
9634
- addIfCondition(root, {
9635
- exp: element.elseif,
9636
- block: element
9637
- });
9638
- } else {
9639
- warnOnce(
9640
- "Component template should contain exactly one root element. " +
9641
- "If you are using v-if on multiple elements, " +
9642
- "use v-else-if to chain them instead.",
9643
- { start: element.start }
9644
- );
9645
- }
9646
- }
9647
- if (currentParent && !element.forbidden) {
9648
- if (element.elseif || element.else) {
9649
- processIfConditions(element, currentParent);
9650
- } else {
9651
- if (element.slotScope) {
9652
- // scoped slot
9653
- // keep it in the children list so that v-else(-if) conditions can
9654
- // find it as the prev node.
9655
- var name = element.slotTarget || '"default"'
9656
- ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
9657
- }
9658
- currentParent.children.push(element);
9659
- element.parent = currentParent;
9660
- }
9661
- }
9662
-
9663
- // final children cleanup
9664
- // filter out scoped slots
9665
- element.children = element.children.filter(function (c) { return !(c).slotScope; });
9666
- // remove trailing whitespace node again
9667
- trimEndingWhitespace(element);
9668
-
9669
- // check pre state
9670
- if (element.pre) {
9671
- inVPre = false;
9672
- }
9673
- if (platformIsPreTag(element.tag)) {
9674
- inPre = false;
9675
- }
9676
- // apply post-transforms
9677
- for (var i = 0; i < postTransforms.length; i++) {
9678
- postTransforms[i](element, options);
9679
- }
9680
- }
9681
-
9682
- function trimEndingWhitespace (el) {
9683
- // remove trailing whitespace node
9684
- if (!inPre) {
9685
- var lastNode;
9686
- while (
9687
- (lastNode = el.children[el.children.length - 1]) &&
9688
- lastNode.type === 3 &&
9689
- lastNode.text === ' '
9690
- ) {
9691
- el.children.pop();
9692
- }
9693
- }
9694
- }
9695
-
9696
- function checkRootConstraints (el) {
9697
- if (el.tag === 'slot' || el.tag === 'template') {
9698
- warnOnce(
9699
- "Cannot use <" + (el.tag) + "> as component root element because it may " +
9700
- 'contain multiple nodes.',
9701
- { start: el.start }
9702
- );
9703
- }
9704
- if (el.attrsMap.hasOwnProperty('v-for')) {
9705
- warnOnce(
9706
- 'Cannot use v-for on stateful component root element because ' +
9707
- 'it renders multiple elements.',
9708
- el.rawAttrsMap['v-for']
9709
- );
9710
- }
9711
- }
9712
-
9713
- parseHTML(template, {
9714
- warn: warn$2,
9715
- expectHTML: options.expectHTML,
9716
- isUnaryTag: options.isUnaryTag,
9717
- canBeLeftOpenTag: options.canBeLeftOpenTag,
9718
- shouldDecodeNewlines: options.shouldDecodeNewlines,
9719
- shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
9720
- shouldKeepComment: options.comments,
9721
- outputSourceRange: options.outputSourceRange,
9722
- start: function start (tag, attrs, unary, start$1, end) {
9723
- // check namespace.
9724
- // inherit parent ns if there is one
9725
- var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
9726
-
9727
- // handle IE svg bug
9728
- /* istanbul ignore if */
9729
- if (isIE && ns === 'svg') {
9730
- attrs = guardIESVGBug(attrs);
9731
- }
9732
-
9733
- var element = createASTElement(tag, attrs, currentParent);
9734
- if (ns) {
9735
- element.ns = ns;
9736
- }
9737
-
9738
- {
9739
- if (options.outputSourceRange) {
9740
- element.start = start$1;
9741
- element.end = end;
9742
- element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
9743
- cumulated[attr.name] = attr;
9744
- return cumulated
9745
- }, {});
9746
- }
9747
- attrs.forEach(function (attr) {
9748
- if (invalidAttributeRE.test(attr.name)) {
9749
- warn$2(
9750
- "Invalid dynamic argument expression: attribute names cannot contain " +
9751
- "spaces, quotes, <, >, / or =.",
9752
- {
9753
- start: attr.start + attr.name.indexOf("["),
9754
- end: attr.start + attr.name.length
9755
- }
9756
- );
9757
- }
9758
- });
9759
- }
9760
-
9761
- if (isForbiddenTag(element) && !isServerRendering()) {
9762
- element.forbidden = true;
9763
- warn$2(
9764
- 'Templates should only be responsible for mapping the state to the ' +
9765
- 'UI. Avoid placing tags with side-effects in your templates, such as ' +
9766
- "<" + tag + ">" + ', as they will not be parsed.',
9767
- { start: element.start }
9768
- );
9769
- }
9770
-
9771
- // apply pre-transforms
9772
- for (var i = 0; i < preTransforms.length; i++) {
9773
- element = preTransforms[i](element, options) || element;
9774
- }
9775
-
9776
- if (!inVPre) {
9777
- processPre(element);
9778
- if (element.pre) {
9779
- inVPre = true;
9780
- }
9781
- }
9782
- if (platformIsPreTag(element.tag)) {
9783
- inPre = true;
9784
- }
9785
- if (inVPre) {
9786
- processRawAttrs(element);
9787
- } else if (!element.processed) {
9788
- // structural directives
9789
- processFor(element);
9790
- processIf(element);
9791
- processOnce(element);
9792
- }
9793
-
9794
- if (!root) {
9795
- root = element;
9796
- {
9797
- checkRootConstraints(root);
9798
- }
9799
- }
9800
-
9801
- if (!unary) {
9802
- currentParent = element;
9803
- stack.push(element);
9804
- } else {
9805
- closeElement(element);
9806
- }
9807
- },
9808
-
9809
- end: function end (tag, start, end$1) {
9810
- var element = stack[stack.length - 1];
9811
- // pop stack
9812
- stack.length -= 1;
9813
- currentParent = stack[stack.length - 1];
9814
- if (options.outputSourceRange) {
9815
- element.end = end$1;
9816
- }
9817
- closeElement(element);
9818
- },
9819
-
9820
- chars: function chars (text, start, end) {
9821
- if (!currentParent) {
9822
- {
9823
- if (text === template) {
9824
- warnOnce(
9825
- 'Component template requires a root element, rather than just text.',
9826
- { start: start }
9827
- );
9828
- } else if ((text = text.trim())) {
9829
- warnOnce(
9830
- ("text \"" + text + "\" outside root element will be ignored."),
9831
- { start: start }
9832
- );
9833
- }
9834
- }
9835
- return
9836
- }
9837
- // IE textarea placeholder bug
9838
- /* istanbul ignore if */
9839
- if (isIE &&
9840
- currentParent.tag === 'textarea' &&
9841
- currentParent.attrsMap.placeholder === text
9842
- ) {
9843
- return
9844
- }
9845
- var children = currentParent.children;
9846
- if (inPre || text.trim()) {
9847
- text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
9848
- } else if (!children.length) {
9849
- // remove the whitespace-only node right after an opening tag
9850
- text = '';
9851
- } else if (whitespaceOption) {
9852
- if (whitespaceOption === 'condense') {
9853
- // in condense mode, remove the whitespace node if it contains
9854
- // line break, otherwise condense to a single space
9855
- text = lineBreakRE.test(text) ? '' : ' ';
9856
- } else {
9857
- text = ' ';
9858
- }
9859
- } else {
9860
- text = preserveWhitespace ? ' ' : '';
9861
- }
9862
- if (text) {
9863
- if (!inPre && whitespaceOption === 'condense') {
9864
- // condense consecutive whitespaces into single space
9865
- text = text.replace(whitespaceRE$1, ' ');
9866
- }
9867
- var res;
9868
- var child;
9869
- if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
9870
- child = {
9871
- type: 2,
9872
- expression: res.expression,
9873
- tokens: res.tokens,
9874
- text: text
9875
- };
9876
- } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
9877
- child = {
9878
- type: 3,
9879
- text: text
9880
- };
9881
- }
9882
- if (child) {
9883
- if (options.outputSourceRange) {
9884
- child.start = start;
9885
- child.end = end;
9886
- }
9887
- children.push(child);
9888
- }
9889
- }
9890
- },
9891
- comment: function comment (text, start, end) {
9892
- // adding anyting as a sibling to the root node is forbidden
9893
- // comments should still be allowed, but ignored
9894
- if (currentParent) {
9895
- var child = {
9896
- type: 3,
9897
- text: text,
9898
- isComment: true
9899
- };
9900
- if (options.outputSourceRange) {
9901
- child.start = start;
9902
- child.end = end;
9903
- }
9904
- currentParent.children.push(child);
9905
- }
9906
- }
9907
- });
9908
- return root
9909
- }
9910
-
9911
- function processPre (el) {
9912
- if (getAndRemoveAttr(el, 'v-pre') != null) {
9913
- el.pre = true;
9914
- }
9915
- }
9916
-
9917
- function processRawAttrs (el) {
9918
- var list = el.attrsList;
9919
- var len = list.length;
9920
- if (len) {
9921
- var attrs = el.attrs = new Array(len);
9922
- for (var i = 0; i < len; i++) {
9923
- attrs[i] = {
9924
- name: list[i].name,
9925
- value: JSON.stringify(list[i].value)
9926
- };
9927
- if (list[i].start != null) {
9928
- attrs[i].start = list[i].start;
9929
- attrs[i].end = list[i].end;
9930
- }
9931
- }
9932
- } else if (!el.pre) {
9933
- // non root node in pre blocks with no attributes
9934
- el.plain = true;
9935
- }
9936
- }
9937
-
9938
- function processElement (
9939
- element,
9940
- options
9941
- ) {
9942
- processKey(element);
9943
-
9944
- // determine whether this is a plain element after
9945
- // removing structural attributes
9946
- element.plain = (
9947
- !element.key &&
9948
- !element.scopedSlots &&
9949
- !element.attrsList.length
9950
- );
9951
-
9952
- processRef(element);
9953
- processSlotContent(element);
9954
- processSlotOutlet(element);
9955
- processComponent(element);
9956
- for (var i = 0; i < transforms.length; i++) {
9957
- element = transforms[i](element, options) || element;
9958
- }
9959
- processAttrs(element);
9960
- return element
9961
- }
9962
-
9963
- function processKey (el) {
9964
- var exp = getBindingAttr(el, 'key');
9965
- if (exp) {
9966
- {
9967
- if (el.tag === 'template') {
9968
- warn$2(
9969
- "<template> cannot be keyed. Place the key on real elements instead.",
9970
- getRawBindingAttr(el, 'key')
9971
- );
9972
- }
9973
- if (el.for) {
9974
- var iterator = el.iterator2 || el.iterator1;
9975
- var parent = el.parent;
9976
- if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
9977
- warn$2(
9978
- "Do not use v-for index as key on <transition-group> children, " +
9979
- "this is the same as not using keys.",
9980
- getRawBindingAttr(el, 'key'),
9981
- true /* tip */
9982
- );
9983
- }
9984
- }
9985
- }
9986
- el.key = exp;
9987
- }
9988
- }
9989
-
9990
- function processRef (el) {
9991
- var ref = getBindingAttr(el, 'ref');
9992
- if (ref) {
9993
- el.ref = ref;
9994
- el.refInFor = checkInFor(el);
9995
- }
9996
- }
9997
-
9998
- function processFor (el) {
9999
- var exp;
10000
- if ((exp = getAndRemoveAttr(el, 'v-for'))) {
10001
- var res = parseFor(exp);
10002
- if (res) {
10003
- extend(el, res);
10004
- } else {
10005
- warn$2(
10006
- ("Invalid v-for expression: " + exp),
10007
- el.rawAttrsMap['v-for']
10008
- );
10009
- }
10010
- }
10011
- }
10012
-
10013
-
10014
-
10015
- function parseFor (exp) {
10016
- var inMatch = exp.match(forAliasRE);
10017
- if (!inMatch) { return }
10018
- var res = {};
10019
- res.for = inMatch[2].trim();
10020
- var alias = inMatch[1].trim().replace(stripParensRE, '');
10021
- var iteratorMatch = alias.match(forIteratorRE);
10022
- if (iteratorMatch) {
10023
- res.alias = alias.replace(forIteratorRE, '').trim();
10024
- res.iterator1 = iteratorMatch[1].trim();
10025
- if (iteratorMatch[2]) {
10026
- res.iterator2 = iteratorMatch[2].trim();
10027
- }
10028
- } else {
10029
- res.alias = alias;
10030
- }
10031
- return res
10032
- }
10033
-
10034
- function processIf (el) {
10035
- var exp = getAndRemoveAttr(el, 'v-if');
10036
- if (exp) {
10037
- el.if = exp;
10038
- addIfCondition(el, {
10039
- exp: exp,
10040
- block: el
10041
- });
10042
- } else {
10043
- if (getAndRemoveAttr(el, 'v-else') != null) {
10044
- el.else = true;
10045
- }
10046
- var elseif = getAndRemoveAttr(el, 'v-else-if');
10047
- if (elseif) {
10048
- el.elseif = elseif;
10049
- }
10050
- }
10051
- }
10052
-
10053
- function processIfConditions (el, parent) {
10054
- var prev = findPrevElement(parent.children);
10055
- if (prev && prev.if) {
10056
- addIfCondition(prev, {
10057
- exp: el.elseif,
10058
- block: el
10059
- });
10060
- } else {
10061
- warn$2(
10062
- "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
10063
- "used on element <" + (el.tag) + "> without corresponding v-if.",
10064
- el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
10065
- );
10066
- }
10067
- }
10068
-
10069
- function findPrevElement (children) {
10070
- var i = children.length;
10071
- while (i--) {
10072
- if (children[i].type === 1) {
10073
- return children[i]
10074
- } else {
10075
- if (children[i].text !== ' ') {
10076
- warn$2(
10077
- "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
10078
- "will be ignored.",
10079
- children[i]
10080
- );
10081
- }
10082
- children.pop();
10083
- }
10084
- }
10085
- }
10086
-
10087
- function addIfCondition (el, condition) {
10088
- if (!el.ifConditions) {
10089
- el.ifConditions = [];
10090
- }
10091
- el.ifConditions.push(condition);
10092
- }
10093
-
10094
- function processOnce (el) {
10095
- var once$$1 = getAndRemoveAttr(el, 'v-once');
10096
- if (once$$1 != null) {
10097
- el.once = true;
10098
- }
10099
- }
10100
-
10101
- // handle content being passed to a component as slot,
10102
- // e.g. <template slot="xxx">, <div slot-scope="xxx">
10103
- function processSlotContent (el) {
10104
- var slotScope;
10105
- if (el.tag === 'template') {
10106
- slotScope = getAndRemoveAttr(el, 'scope');
10107
- /* istanbul ignore if */
10108
- if (slotScope) {
10109
- warn$2(
10110
- "the \"scope\" attribute for scoped slots have been deprecated and " +
10111
- "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
10112
- "can also be used on plain elements in addition to <template> to " +
10113
- "denote scoped slots.",
10114
- el.rawAttrsMap['scope'],
10115
- true
10116
- );
10117
- }
10118
- el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
10119
- } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
10120
- /* istanbul ignore if */
10121
- if (el.attrsMap['v-for']) {
10122
- warn$2(
10123
- "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
10124
- "(v-for takes higher priority). Use a wrapper <template> for the " +
10125
- "scoped slot to make it clearer.",
10126
- el.rawAttrsMap['slot-scope'],
10127
- true
10128
- );
10129
- }
10130
- el.slotScope = slotScope;
10131
- }
10132
-
10133
- // slot="xxx"
10134
- var slotTarget = getBindingAttr(el, 'slot');
10135
- if (slotTarget) {
10136
- el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
10137
- el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
10138
- // preserve slot as an attribute for native shadow DOM compat
10139
- // only for non-scoped slots.
10140
- if (el.tag !== 'template' && !el.slotScope) {
10141
- addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
10142
- }
10143
- }
10144
-
10145
- // 2.6 v-slot syntax
10146
- {
10147
- if (el.tag === 'template') {
10148
- // v-slot on <template>
10149
- var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
10150
- if (slotBinding) {
10151
- {
10152
- if (el.slotTarget || el.slotScope) {
10153
- warn$2(
10154
- "Unexpected mixed usage of different slot syntaxes.",
10155
- el
10156
- );
10157
- }
10158
- if (el.parent && !maybeComponent(el.parent)) {
10159
- warn$2(
10160
- "<template v-slot> can only appear at the root level inside " +
10161
- "the receiving the component",
10162
- el
10163
- );
10164
- }
10165
- }
10166
- var ref = getSlotName(slotBinding);
10167
- var name = ref.name;
10168
- var dynamic = ref.dynamic;
10169
- el.slotTarget = name;
10170
- el.slotTargetDynamic = dynamic;
10171
- el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
10172
- }
10173
- } else {
10174
- // v-slot on component, denotes default slot
10175
- var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
10176
- if (slotBinding$1) {
10177
- {
10178
- if (!maybeComponent(el)) {
10179
- warn$2(
10180
- "v-slot can only be used on components or <template>.",
10181
- slotBinding$1
10182
- );
10183
- }
10184
- if (el.slotScope || el.slotTarget) {
10185
- warn$2(
10186
- "Unexpected mixed usage of different slot syntaxes.",
10187
- el
10188
- );
10189
- }
10190
- if (el.scopedSlots) {
10191
- warn$2(
10192
- "To avoid scope ambiguity, the default slot should also use " +
10193
- "<template> syntax when there are other named slots.",
10194
- slotBinding$1
10195
- );
10196
- }
10197
- }
10198
- // add the component's children to its default slot
10199
- var slots = el.scopedSlots || (el.scopedSlots = {});
10200
- var ref$1 = getSlotName(slotBinding$1);
10201
- var name$1 = ref$1.name;
10202
- var dynamic$1 = ref$1.dynamic;
10203
- var slotContainer = slots[name$1] = createASTElement('template', [], el);
10204
- slotContainer.slotTarget = name$1;
10205
- slotContainer.slotTargetDynamic = dynamic$1;
10206
- slotContainer.children = el.children.filter(function (c) {
10207
- if (!c.slotScope) {
10208
- c.parent = slotContainer;
10209
- return true
10210
- }
10211
- });
10212
- slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
10213
- // remove children as they are returned from scopedSlots now
10214
- el.children = [];
10215
- // mark el non-plain so data gets generated
10216
- el.plain = false;
10217
- }
10218
- }
10219
- }
10220
- }
10221
-
10222
- function getSlotName (binding) {
10223
- var name = binding.name.replace(slotRE, '');
10224
- if (!name) {
10225
- if (binding.name[0] !== '#') {
10226
- name = 'default';
10227
- } else {
10228
- warn$2(
10229
- "v-slot shorthand syntax requires a slot name.",
10230
- binding
10231
- );
10232
- }
10233
- }
10234
- return dynamicArgRE.test(name)
10235
- // dynamic [name]
10236
- ? { name: name.slice(1, -1), dynamic: true }
10237
- // static name
10238
- : { name: ("\"" + name + "\""), dynamic: false }
10239
- }
10240
-
10241
- // handle <slot/> outlets
10242
- function processSlotOutlet (el) {
10243
- if (el.tag === 'slot') {
10244
- el.slotName = getBindingAttr(el, 'name');
10245
- if (el.key) {
10246
- warn$2(
10247
- "`key` does not work on <slot> because slots are abstract outlets " +
10248
- "and can possibly expand into multiple elements. " +
10249
- "Use the key on a wrapping element instead.",
10250
- getRawBindingAttr(el, 'key')
10251
- );
10252
- }
10253
- }
10254
- }
10255
-
10256
- function processComponent (el) {
10257
- var binding;
10258
- if ((binding = getBindingAttr(el, 'is'))) {
10259
- el.component = binding;
10260
- }
10261
- if (getAndRemoveAttr(el, 'inline-template') != null) {
10262
- el.inlineTemplate = true;
10263
- }
10264
- }
10265
-
10266
- function processAttrs (el) {
10267
- var list = el.attrsList;
10268
- var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
10269
- for (i = 0, l = list.length; i < l; i++) {
10270
- name = rawName = list[i].name;
10271
- value = list[i].value;
10272
- if (dirRE.test(name)) {
10273
- // mark element as dynamic
10274
- el.hasBindings = true;
10275
- // modifiers
10276
- modifiers = parseModifiers(name.replace(dirRE, ''));
10277
- // support .foo shorthand syntax for the .prop modifier
10278
- if (modifiers) {
10279
- name = name.replace(modifierRE, '');
10280
- }
10281
- if (bindRE.test(name)) { // v-bind
10282
- name = name.replace(bindRE, '');
10283
- value = parseFilters(value);
10284
- isDynamic = dynamicArgRE.test(name);
10285
- if (isDynamic) {
10286
- name = name.slice(1, -1);
10287
- }
10288
- if (
10289
- value.trim().length === 0
10290
- ) {
10291
- warn$2(
10292
- ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
10293
- );
10294
- }
10295
- if (modifiers) {
10296
- if (modifiers.prop && !isDynamic) {
10297
- name = camelize(name);
10298
- if (name === 'innerHtml') { name = 'innerHTML'; }
10299
- }
10300
- if (modifiers.camel && !isDynamic) {
10301
- name = camelize(name);
10302
- }
10303
- if (modifiers.sync) {
10304
- syncGen = genAssignmentCode(value, "$event");
10305
- if (!isDynamic) {
10306
- addHandler(
10307
- el,
10308
- ("update:" + (camelize(name))),
10309
- syncGen,
10310
- null,
10311
- false,
10312
- warn$2,
10313
- list[i]
10314
- );
10315
- if (hyphenate(name) !== camelize(name)) {
10316
- addHandler(
10317
- el,
10318
- ("update:" + (hyphenate(name))),
10319
- syncGen,
10320
- null,
10321
- false,
10322
- warn$2,
10323
- list[i]
10324
- );
10325
- }
10326
- } else {
10327
- // handler w/ dynamic event name
10328
- addHandler(
10329
- el,
10330
- ("\"update:\"+(" + name + ")"),
10331
- syncGen,
10332
- null,
10333
- false,
10334
- warn$2,
10335
- list[i],
10336
- true // dynamic
10337
- );
10338
- }
10339
- }
10340
- }
10341
- if ((modifiers && modifiers.prop) || (
10342
- !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
10343
- )) {
10344
- addProp(el, name, value, list[i], isDynamic);
10345
- } else {
10346
- addAttr(el, name, value, list[i], isDynamic);
10347
- }
10348
- } else if (onRE.test(name)) { // v-on
10349
- name = name.replace(onRE, '');
10350
- isDynamic = dynamicArgRE.test(name);
10351
- if (isDynamic) {
10352
- name = name.slice(1, -1);
10353
- }
10354
- addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
10355
- } else { // normal directives
10356
- name = name.replace(dirRE, '');
10357
- // parse arg
10358
- var argMatch = name.match(argRE);
10359
- var arg = argMatch && argMatch[1];
10360
- isDynamic = false;
10361
- if (arg) {
10362
- name = name.slice(0, -(arg.length + 1));
10363
- if (dynamicArgRE.test(arg)) {
10364
- arg = arg.slice(1, -1);
10365
- isDynamic = true;
10366
- }
10367
- }
10368
- addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
10369
- if (name === 'model') {
10370
- checkForAliasModel(el, value);
10371
- }
10372
- }
10373
- } else {
10374
- // literal attribute
10375
- {
10376
- var res = parseText(value, delimiters);
10377
- if (res) {
10378
- warn$2(
10379
- name + "=\"" + value + "\": " +
10380
- 'Interpolation inside attributes has been removed. ' +
10381
- 'Use v-bind or the colon shorthand instead. For example, ' +
10382
- 'instead of <div id="{{ val }}">, use <div :id="val">.',
10383
- list[i]
10384
- );
10385
- }
10386
- }
10387
- addAttr(el, name, JSON.stringify(value), list[i]);
10388
- // #6887 firefox doesn't update muted state if set via attribute
10389
- // even immediately after element creation
10390
- if (!el.component &&
10391
- name === 'muted' &&
10392
- platformMustUseProp(el.tag, el.attrsMap.type, name)) {
10393
- addProp(el, name, 'true', list[i]);
10394
- }
10395
- }
10396
- }
10397
- }
10398
-
10399
- function checkInFor (el) {
10400
- var parent = el;
10401
- while (parent) {
10402
- if (parent.for !== undefined) {
10403
- return true
10404
- }
10405
- parent = parent.parent;
10406
- }
10407
- return false
10408
- }
10409
-
10410
- function parseModifiers (name) {
10411
- var match = name.match(modifierRE);
10412
- if (match) {
10413
- var ret = {};
10414
- match.forEach(function (m) { ret[m.slice(1)] = true; });
10415
- return ret
10416
- }
10417
- }
10418
-
10419
- function makeAttrsMap (attrs) {
10420
- var map = {};
10421
- for (var i = 0, l = attrs.length; i < l; i++) {
10422
- if (
10423
- map[attrs[i].name] && !isIE && !isEdge
10424
- ) {
10425
- warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
10426
- }
10427
- map[attrs[i].name] = attrs[i].value;
10428
- }
10429
- return map
10430
- }
10431
-
10432
- // for script (e.g. type="x/template") or style, do not decode content
10433
- function isTextTag (el) {
10434
- return el.tag === 'script' || el.tag === 'style'
10435
- }
10436
-
10437
- function isForbiddenTag (el) {
10438
- return (
10439
- el.tag === 'style' ||
10440
- (el.tag === 'script' && (
10441
- !el.attrsMap.type ||
10442
- el.attrsMap.type === 'text/javascript'
10443
- ))
10444
- )
10445
- }
10446
-
10447
- var ieNSBug = /^xmlns:NS\d+/;
10448
- var ieNSPrefix = /^NS\d+:/;
10449
-
10450
- /* istanbul ignore next */
10451
- function guardIESVGBug (attrs) {
10452
- var res = [];
10453
- for (var i = 0; i < attrs.length; i++) {
10454
- var attr = attrs[i];
10455
- if (!ieNSBug.test(attr.name)) {
10456
- attr.name = attr.name.replace(ieNSPrefix, '');
10457
- res.push(attr);
10458
- }
10459
- }
10460
- return res
10461
- }
10462
-
10463
- function checkForAliasModel (el, value) {
10464
- var _el = el;
10465
- while (_el) {
10466
- if (_el.for && _el.alias === value) {
10467
- warn$2(
10468
- "<" + (el.tag) + " v-model=\"" + value + "\">: " +
10469
- "You are binding v-model directly to a v-for iteration alias. " +
10470
- "This will not be able to modify the v-for source array because " +
10471
- "writing to the alias is like modifying a function local variable. " +
10472
- "Consider using an array of objects and use v-model on an object property instead.",
10473
- el.rawAttrsMap['v-model']
10474
- );
10475
- }
10476
- _el = _el.parent;
10477
- }
10478
- }
10479
-
10480
- /* */
10481
-
10482
- function preTransformNode (el, options) {
10483
- if (el.tag === 'input') {
10484
- var map = el.attrsMap;
10485
- if (!map['v-model']) {
10486
- return
10487
- }
10488
-
10489
- var typeBinding;
10490
- if (map[':type'] || map['v-bind:type']) {
10491
- typeBinding = getBindingAttr(el, 'type');
10492
- }
10493
- if (!map.type && !typeBinding && map['v-bind']) {
10494
- typeBinding = "(" + (map['v-bind']) + ").type";
10495
- }
10496
-
10497
- if (typeBinding) {
10498
- var ifCondition = getAndRemoveAttr(el, 'v-if', true);
10499
- var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
10500
- var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
10501
- var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
10502
- // 1. checkbox
10503
- var branch0 = cloneASTElement(el);
10504
- // process for on the main node
10505
- processFor(branch0);
10506
- addRawAttr(branch0, 'type', 'checkbox');
10507
- processElement(branch0, options);
10508
- branch0.processed = true; // prevent it from double-processed
10509
- branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
10510
- addIfCondition(branch0, {
10511
- exp: branch0.if,
10512
- block: branch0
10513
- });
10514
- // 2. add radio else-if condition
10515
- var branch1 = cloneASTElement(el);
10516
- getAndRemoveAttr(branch1, 'v-for', true);
10517
- addRawAttr(branch1, 'type', 'radio');
10518
- processElement(branch1, options);
10519
- addIfCondition(branch0, {
10520
- exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
10521
- block: branch1
10522
- });
10523
- // 3. other
10524
- var branch2 = cloneASTElement(el);
10525
- getAndRemoveAttr(branch2, 'v-for', true);
10526
- addRawAttr(branch2, ':type', typeBinding);
10527
- processElement(branch2, options);
10528
- addIfCondition(branch0, {
10529
- exp: ifCondition,
10530
- block: branch2
10531
- });
10532
-
10533
- if (hasElse) {
10534
- branch0.else = true;
10535
- } else if (elseIfCondition) {
10536
- branch0.elseif = elseIfCondition;
10537
- }
10538
-
10539
- return branch0
10540
- }
10541
- }
10542
- }
10543
-
10544
- function cloneASTElement (el) {
10545
- return createASTElement(el.tag, el.attrsList.slice(), el.parent)
10546
- }
10547
-
10548
- var model$1 = {
10549
- preTransformNode: preTransformNode
10550
- };
10551
-
10552
- var modules$1 = [
10553
- klass$1,
10554
- style$1,
10555
- model$1
10556
- ];
10557
-
10558
- /* */
10559
-
10560
- function text (el, dir) {
10561
- if (dir.value) {
10562
- addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
10563
- }
10564
- }
10565
-
10566
- /* */
10567
-
10568
- function html (el, dir) {
10569
- if (dir.value) {
10570
- addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
10571
- }
10572
- }
10573
-
10574
- var directives$1 = {
10575
- model: model,
10576
- text: text,
10577
- html: html
10578
- };
10579
-
10580
- /* */
10581
-
10582
- var baseOptions = {
10583
- expectHTML: true,
10584
- modules: modules$1,
10585
- directives: directives$1,
10586
- isPreTag: isPreTag,
10587
- isUnaryTag: isUnaryTag,
10588
- mustUseProp: mustUseProp,
10589
- canBeLeftOpenTag: canBeLeftOpenTag,
10590
- isReservedTag: isReservedTag,
10591
- getTagNamespace: getTagNamespace,
10592
- staticKeys: genStaticKeys(modules$1)
10593
- };
10594
-
10595
- /* */
10596
-
10597
- var isStaticKey;
10598
- var isPlatformReservedTag;
10599
-
10600
- var genStaticKeysCached = cached(genStaticKeys$1);
10601
-
10602
- /**
10603
- * Goal of the optimizer: walk the generated template AST tree
10604
- * and detect sub-trees that are purely static, i.e. parts of
10605
- * the DOM that never needs to change.
10606
- *
10607
- * Once we detect these sub-trees, we can:
10608
- *
10609
- * 1. Hoist them into constants, so that we no longer need to
10610
- * create fresh nodes for them on each re-render;
10611
- * 2. Completely skip them in the patching process.
10612
- */
10613
- function optimize (root, options) {
10614
- if (!root) { return }
10615
- isStaticKey = genStaticKeysCached(options.staticKeys || '');
10616
- isPlatformReservedTag = options.isReservedTag || no;
10617
- // first pass: mark all non-static nodes.
10618
- markStatic$1(root);
10619
- // second pass: mark static roots.
10620
- markStaticRoots(root, false);
10621
- }
10622
-
10623
- function genStaticKeys$1 (keys) {
10624
- return makeMap(
10625
- 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
10626
- (keys ? ',' + keys : '')
10627
- )
10628
- }
10629
-
10630
- function markStatic$1 (node) {
10631
- node.static = isStatic(node);
10632
- if (node.type === 1) {
10633
- // do not make component slot content static. this avoids
10634
- // 1. components not able to mutate slot nodes
10635
- // 2. static slot content fails for hot-reloading
10636
- if (
10637
- !isPlatformReservedTag(node.tag) &&
10638
- node.tag !== 'slot' &&
10639
- node.attrsMap['inline-template'] == null
10640
- ) {
10641
- return
10642
- }
10643
- for (var i = 0, l = node.children.length; i < l; i++) {
10644
- var child = node.children[i];
10645
- markStatic$1(child);
10646
- if (!child.static) {
10647
- node.static = false;
10648
- }
10649
- }
10650
- if (node.ifConditions) {
10651
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
10652
- var block = node.ifConditions[i$1].block;
10653
- markStatic$1(block);
10654
- if (!block.static) {
10655
- node.static = false;
10656
- }
10657
- }
10658
- }
10659
- }
10660
- }
10661
-
10662
- function markStaticRoots (node, isInFor) {
10663
- if (node.type === 1) {
10664
- if (node.static || node.once) {
10665
- node.staticInFor = isInFor;
10666
- }
10667
- // For a node to qualify as a static root, it should have children that
10668
- // are not just static text. Otherwise the cost of hoisting out will
10669
- // outweigh the benefits and it's better off to just always render it fresh.
10670
- if (node.static && node.children.length && !(
10671
- node.children.length === 1 &&
10672
- node.children[0].type === 3
10673
- )) {
10674
- node.staticRoot = true;
10675
- return
10676
- } else {
10677
- node.staticRoot = false;
10678
- }
10679
- if (node.children) {
10680
- for (var i = 0, l = node.children.length; i < l; i++) {
10681
- markStaticRoots(node.children[i], isInFor || !!node.for);
10682
- }
10683
- }
10684
- if (node.ifConditions) {
10685
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
10686
- markStaticRoots(node.ifConditions[i$1].block, isInFor);
10687
- }
10688
- }
10689
- }
10690
- }
10691
-
10692
- function isStatic (node) {
10693
- if (node.type === 2) { // expression
10694
- return false
10695
- }
10696
- if (node.type === 3) { // text
10697
- return true
10698
- }
10699
- return !!(node.pre || (
10700
- !node.hasBindings && // no dynamic bindings
10701
- !node.if && !node.for && // not v-if or v-for or v-else
10702
- !isBuiltInTag(node.tag) && // not a built-in
10703
- isPlatformReservedTag(node.tag) && // not a component
10704
- !isDirectChildOfTemplateFor(node) &&
10705
- Object.keys(node).every(isStaticKey)
10706
- ))
10707
- }
10708
-
10709
- function isDirectChildOfTemplateFor (node) {
10710
- while (node.parent) {
10711
- node = node.parent;
10712
- if (node.tag !== 'template') {
10713
- return false
10714
- }
10715
- if (node.for) {
10716
- return true
10717
- }
10718
- }
10719
- return false
10720
- }
10721
-
10722
- /* */
10723
-
10724
- var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/;
10725
- var fnInvokeRE = /\([^)]*?\);*$/;
10726
- var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
10727
-
10728
- // KeyboardEvent.keyCode aliases
10729
- var keyCodes = {
10730
- esc: 27,
10731
- tab: 9,
10732
- enter: 13,
10733
- space: 32,
10734
- up: 38,
10735
- left: 37,
10736
- right: 39,
10737
- down: 40,
10738
- 'delete': [8, 46]
10739
- };
10740
-
10741
- // KeyboardEvent.key aliases
10742
- var keyNames = {
10743
- // #7880: IE11 and Edge use `Esc` for Escape key name.
10744
- esc: ['Esc', 'Escape'],
10745
- tab: 'Tab',
10746
- enter: 'Enter',
10747
- // #9112: IE11 uses `Spacebar` for Space key name.
10748
- space: [' ', 'Spacebar'],
10749
- // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
10750
- up: ['Up', 'ArrowUp'],
10751
- left: ['Left', 'ArrowLeft'],
10752
- right: ['Right', 'ArrowRight'],
10753
- down: ['Down', 'ArrowDown'],
10754
- // #9112: IE11 uses `Del` for Delete key name.
10755
- 'delete': ['Backspace', 'Delete', 'Del']
10756
- };
10757
-
10758
- // #4868: modifiers that prevent the execution of the listener
10759
- // need to explicitly return null so that we can determine whether to remove
10760
- // the listener for .once
10761
- var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
10762
-
10763
- var modifierCode = {
10764
- stop: '$event.stopPropagation();',
10765
- prevent: '$event.preventDefault();',
10766
- self: genGuard("$event.target !== $event.currentTarget"),
10767
- ctrl: genGuard("!$event.ctrlKey"),
10768
- shift: genGuard("!$event.shiftKey"),
10769
- alt: genGuard("!$event.altKey"),
10770
- meta: genGuard("!$event.metaKey"),
10771
- left: genGuard("'button' in $event && $event.button !== 0"),
10772
- middle: genGuard("'button' in $event && $event.button !== 1"),
10773
- right: genGuard("'button' in $event && $event.button !== 2")
10774
- };
10775
-
10776
- function genHandlers (
10777
- events,
10778
- isNative
10779
- ) {
10780
- var prefix = isNative ? 'nativeOn:' : 'on:';
10781
- var staticHandlers = "";
10782
- var dynamicHandlers = "";
10783
- for (var name in events) {
10784
- var handlerCode = genHandler(events[name]);
10785
- if (events[name] && events[name].dynamic) {
10786
- dynamicHandlers += name + "," + handlerCode + ",";
10787
- } else {
10788
- staticHandlers += "\"" + name + "\":" + handlerCode + ",";
10789
- }
10790
- }
10791
- staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
10792
- if (dynamicHandlers) {
10793
- return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
10794
- } else {
10795
- return prefix + staticHandlers
10796
- }
10797
- }
10798
-
10799
- function genHandler (handler) {
10800
- if (!handler) {
10801
- return 'function(){}'
10802
- }
10803
-
10804
- if (Array.isArray(handler)) {
10805
- return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
10806
- }
10807
-
10808
- var isMethodPath = simplePathRE.test(handler.value);
10809
- var isFunctionExpression = fnExpRE.test(handler.value);
10810
- var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
10811
-
10812
- if (!handler.modifiers) {
10813
- if (isMethodPath || isFunctionExpression) {
10814
- return handler.value
10815
- }
10816
- return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
10817
- } else {
10818
- var code = '';
10819
- var genModifierCode = '';
10820
- var keys = [];
10821
- for (var key in handler.modifiers) {
10822
- if (modifierCode[key]) {
10823
- genModifierCode += modifierCode[key];
10824
- // left/right
10825
- if (keyCodes[key]) {
10826
- keys.push(key);
10827
- }
10828
- } else if (key === 'exact') {
10829
- var modifiers = (handler.modifiers);
10830
- genModifierCode += genGuard(
10831
- ['ctrl', 'shift', 'alt', 'meta']
10832
- .filter(function (keyModifier) { return !modifiers[keyModifier]; })
10833
- .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
10834
- .join('||')
10835
- );
10836
- } else {
10837
- keys.push(key);
10838
- }
10839
- }
10840
- if (keys.length) {
10841
- code += genKeyFilter(keys);
10842
- }
10843
- // Make sure modifiers like prevent and stop get executed after key filtering
10844
- if (genModifierCode) {
10845
- code += genModifierCode;
10846
- }
10847
- var handlerCode = isMethodPath
10848
- ? ("return " + (handler.value) + "($event)")
10849
- : isFunctionExpression
10850
- ? ("return (" + (handler.value) + ")($event)")
10851
- : isFunctionInvocation
10852
- ? ("return " + (handler.value))
10853
- : handler.value;
10854
- return ("function($event){" + code + handlerCode + "}")
10855
- }
10856
- }
10857
-
10858
- function genKeyFilter (keys) {
10859
- return (
10860
- // make sure the key filters only apply to KeyboardEvents
10861
- // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
10862
- // key events that do not have keyCode property...
10863
- "if(!$event.type.indexOf('key')&&" +
10864
- (keys.map(genFilterCode).join('&&')) + ")return null;"
10865
- )
10866
- }
10867
-
10868
- function genFilterCode (key) {
10869
- var keyVal = parseInt(key, 10);
10870
- if (keyVal) {
10871
- return ("$event.keyCode!==" + keyVal)
10872
- }
10873
- var keyCode = keyCodes[key];
10874
- var keyName = keyNames[key];
10875
- return (
10876
- "_k($event.keyCode," +
10877
- (JSON.stringify(key)) + "," +
10878
- (JSON.stringify(keyCode)) + "," +
10879
- "$event.key," +
10880
- "" + (JSON.stringify(keyName)) +
10881
- ")"
10882
- )
10883
- }
10884
-
10885
- /* */
10886
-
10887
- function on (el, dir) {
10888
- if (dir.modifiers) {
10889
- warn("v-on without argument does not support modifiers.");
10890
- }
10891
- el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
10892
- }
10893
-
10894
- /* */
10895
-
10896
- function bind$1 (el, dir) {
10897
- el.wrapData = function (code) {
10898
- return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
10899
- };
10900
- }
10901
-
10902
- /* */
10903
-
10904
- var baseDirectives = {
10905
- on: on,
10906
- bind: bind$1,
10907
- cloak: noop
10908
- };
10909
-
10910
- /* */
10911
-
10912
-
10913
-
10914
-
10915
-
10916
- var CodegenState = function CodegenState (options) {
10917
- this.options = options;
10918
- this.warn = options.warn || baseWarn;
10919
- this.transforms = pluckModuleFunction(options.modules, 'transformCode');
10920
- this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
10921
- this.directives = extend(extend({}, baseDirectives), options.directives);
10922
- var isReservedTag = options.isReservedTag || no;
10923
- this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
10924
- this.onceId = 0;
10925
- this.staticRenderFns = [];
10926
- this.pre = false;
10927
- };
10928
-
10929
-
10930
-
10931
- function generate (
10932
- ast,
10933
- options
10934
- ) {
10935
- var state = new CodegenState(options);
10936
- var code = ast ? genElement(ast, state) : '_c("div")';
10937
- return {
10938
- render: ("with(this){return " + code + "}"),
10939
- staticRenderFns: state.staticRenderFns
10940
- }
10941
- }
10942
-
10943
- function genElement (el, state) {
10944
- if (el.parent) {
10945
- el.pre = el.pre || el.parent.pre;
10946
- }
10947
-
10948
- if (el.staticRoot && !el.staticProcessed) {
10949
- return genStatic(el, state)
10950
- } else if (el.once && !el.onceProcessed) {
10951
- return genOnce(el, state)
10952
- } else if (el.for && !el.forProcessed) {
10953
- return genFor(el, state)
10954
- } else if (el.if && !el.ifProcessed) {
10955
- return genIf(el, state)
10956
- } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
10957
- return genChildren(el, state) || 'void 0'
10958
- } else if (el.tag === 'slot') {
10959
- return genSlot(el, state)
10960
- } else {
10961
- // component or element
10962
- var code;
10963
- if (el.component) {
10964
- code = genComponent(el.component, el, state);
10965
- } else {
10966
- var data;
10967
- if (!el.plain || (el.pre && state.maybeComponent(el))) {
10968
- data = genData$2(el, state);
10969
- }
10970
-
10971
- var children = el.inlineTemplate ? null : genChildren(el, state, true);
10972
- code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
10973
- }
10974
- // module transforms
10975
- for (var i = 0; i < state.transforms.length; i++) {
10976
- code = state.transforms[i](el, code);
10977
- }
10978
- return code
10979
- }
10980
- }
10981
-
10982
- // hoist static sub-trees out
10983
- function genStatic (el, state) {
10984
- el.staticProcessed = true;
10985
- // Some elements (templates) need to behave differently inside of a v-pre
10986
- // node. All pre nodes are static roots, so we can use this as a location to
10987
- // wrap a state change and reset it upon exiting the pre node.
10988
- var originalPreState = state.pre;
10989
- if (el.pre) {
10990
- state.pre = el.pre;
10991
- }
10992
- state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
10993
- state.pre = originalPreState;
10994
- return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
10995
- }
10996
-
10997
- // v-once
10998
- function genOnce (el, state) {
10999
- el.onceProcessed = true;
11000
- if (el.if && !el.ifProcessed) {
11001
- return genIf(el, state)
11002
- } else if (el.staticInFor) {
11003
- var key = '';
11004
- var parent = el.parent;
11005
- while (parent) {
11006
- if (parent.for) {
11007
- key = parent.key;
11008
- break
11009
- }
11010
- parent = parent.parent;
11011
- }
11012
- if (!key) {
11013
- state.warn(
11014
- "v-once can only be used inside v-for that is keyed. ",
11015
- el.rawAttrsMap['v-once']
11016
- );
11017
- return genElement(el, state)
11018
- }
11019
- return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
11020
- } else {
11021
- return genStatic(el, state)
11022
- }
11023
- }
11024
-
11025
- function genIf (
11026
- el,
11027
- state,
11028
- altGen,
11029
- altEmpty
11030
- ) {
11031
- el.ifProcessed = true; // avoid recursion
11032
- return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
11033
- }
11034
-
11035
- function genIfConditions (
11036
- conditions,
11037
- state,
11038
- altGen,
11039
- altEmpty
11040
- ) {
11041
- if (!conditions.length) {
11042
- return altEmpty || '_e()'
11043
- }
11044
-
11045
- var condition = conditions.shift();
11046
- if (condition.exp) {
11047
- return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
11048
- } else {
11049
- return ("" + (genTernaryExp(condition.block)))
11050
- }
11051
-
11052
- // v-if with v-once should generate code like (a)?_m(0):_m(1)
11053
- function genTernaryExp (el) {
11054
- return altGen
11055
- ? altGen(el, state)
11056
- : el.once
11057
- ? genOnce(el, state)
11058
- : genElement(el, state)
11059
- }
11060
- }
11061
-
11062
- function genFor (
11063
- el,
11064
- state,
11065
- altGen,
11066
- altHelper
11067
- ) {
11068
- var exp = el.for;
11069
- var alias = el.alias;
11070
- var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
11071
- var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
11072
-
11073
- if (state.maybeComponent(el) &&
11074
- el.tag !== 'slot' &&
11075
- el.tag !== 'template' &&
11076
- !el.key
11077
- ) {
11078
- state.warn(
11079
- "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
11080
- "v-for should have explicit keys. " +
11081
- "See https://vuejs.org/guide/list.html#key for more info.",
11082
- el.rawAttrsMap['v-for'],
11083
- true /* tip */
11084
- );
11085
- }
11086
-
11087
- el.forProcessed = true; // avoid recursion
11088
- return (altHelper || '_l') + "((" + exp + ")," +
11089
- "function(" + alias + iterator1 + iterator2 + "){" +
11090
- "return " + ((altGen || genElement)(el, state)) +
11091
- '})'
11092
- }
11093
-
11094
- function genData$2 (el, state) {
11095
- var data = '{';
11096
-
11097
- // directives first.
11098
- // directives may mutate the el's other properties before they are generated.
11099
- var dirs = genDirectives(el, state);
11100
- if (dirs) { data += dirs + ','; }
11101
-
11102
- // key
11103
- if (el.key) {
11104
- data += "key:" + (el.key) + ",";
11105
- }
11106
- // ref
11107
- if (el.ref) {
11108
- data += "ref:" + (el.ref) + ",";
11109
- }
11110
- if (el.refInFor) {
11111
- data += "refInFor:true,";
11112
- }
11113
- // pre
11114
- if (el.pre) {
11115
- data += "pre:true,";
11116
- }
11117
- // record original tag name for components using "is" attribute
11118
- if (el.component) {
11119
- data += "tag:\"" + (el.tag) + "\",";
11120
- }
11121
- // module data generation functions
11122
- for (var i = 0; i < state.dataGenFns.length; i++) {
11123
- data += state.dataGenFns[i](el);
11124
- }
11125
- // attributes
11126
- if (el.attrs) {
11127
- data += "attrs:" + (genProps(el.attrs)) + ",";
11128
- }
11129
- // DOM props
11130
- if (el.props) {
11131
- data += "domProps:" + (genProps(el.props)) + ",";
11132
- }
11133
- // event handlers
11134
- if (el.events) {
11135
- data += (genHandlers(el.events, false)) + ",";
11136
- }
11137
- if (el.nativeEvents) {
11138
- data += (genHandlers(el.nativeEvents, true)) + ",";
11139
- }
11140
- // slot target
11141
- // only for non-scoped slots
11142
- if (el.slotTarget && !el.slotScope) {
11143
- data += "slot:" + (el.slotTarget) + ",";
11144
- }
11145
- // scoped slots
11146
- if (el.scopedSlots) {
11147
- data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
11148
- }
11149
- // component v-model
11150
- if (el.model) {
11151
- data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
11152
- }
11153
- // inline-template
11154
- if (el.inlineTemplate) {
11155
- var inlineTemplate = genInlineTemplate(el, state);
11156
- if (inlineTemplate) {
11157
- data += inlineTemplate + ",";
11158
- }
11159
- }
11160
- data = data.replace(/,$/, '') + '}';
11161
- // v-bind dynamic argument wrap
11162
- // v-bind with dynamic arguments must be applied using the same v-bind object
11163
- // merge helper so that class/style/mustUseProp attrs are handled correctly.
11164
- if (el.dynamicAttrs) {
11165
- data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
11166
- }
11167
- // v-bind data wrap
11168
- if (el.wrapData) {
11169
- data = el.wrapData(data);
11170
- }
11171
- // v-on data wrap
11172
- if (el.wrapListeners) {
11173
- data = el.wrapListeners(data);
11174
- }
11175
- return data
11176
- }
11177
-
11178
- function genDirectives (el, state) {
11179
- var dirs = el.directives;
11180
- if (!dirs) { return }
11181
- var res = 'directives:[';
11182
- var hasRuntime = false;
11183
- var i, l, dir, needRuntime;
11184
- for (i = 0, l = dirs.length; i < l; i++) {
11185
- dir = dirs[i];
11186
- needRuntime = true;
11187
- var gen = state.directives[dir.name];
11188
- if (gen) {
11189
- // compile-time directive that manipulates AST.
11190
- // returns true if it also needs a runtime counterpart.
11191
- needRuntime = !!gen(el, dir, state.warn);
11192
- }
11193
- if (needRuntime) {
11194
- hasRuntime = true;
11195
- res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
11196
- }
11197
- }
11198
- if (hasRuntime) {
11199
- return res.slice(0, -1) + ']'
11200
- }
11201
- }
11202
-
11203
- function genInlineTemplate (el, state) {
11204
- var ast = el.children[0];
11205
- if (el.children.length !== 1 || ast.type !== 1) {
11206
- state.warn(
11207
- 'Inline-template components must have exactly one child element.',
11208
- { start: el.start }
11209
- );
11210
- }
11211
- if (ast && ast.type === 1) {
11212
- var inlineRenderFns = generate(ast, state.options);
11213
- return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
11214
- }
11215
- }
11216
-
11217
- function genScopedSlots (
11218
- el,
11219
- slots,
11220
- state
11221
- ) {
11222
- // by default scoped slots are considered "stable", this allows child
11223
- // components with only scoped slots to skip forced updates from parent.
11224
- // but in some cases we have to bail-out of this optimization
11225
- // for example if the slot contains dynamic names, has v-if or v-for on them...
11226
- var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
11227
- var slot = slots[key];
11228
- return (
11229
- slot.slotTargetDynamic ||
11230
- slot.if ||
11231
- slot.for ||
11232
- containsSlotChild(slot) // is passing down slot from parent which may be dynamic
11233
- )
11234
- });
11235
-
11236
- // #9534: if a component with scoped slots is inside a conditional branch,
11237
- // it's possible for the same component to be reused but with different
11238
- // compiled slot content. To avoid that, we generate a unique key based on
11239
- // the generated code of all the slot contents.
11240
- var needsKey = !!el.if;
11241
-
11242
- // OR when it is inside another scoped slot or v-for (the reactivity may be
11243
- // disconnected due to the intermediate scope variable)
11244
- // #9438, #9506
11245
- // TODO: this can be further optimized by properly analyzing in-scope bindings
11246
- // and skip force updating ones that do not actually use scope variables.
11247
- if (!needsForceUpdate) {
11248
- var parent = el.parent;
11249
- while (parent) {
11250
- if (
11251
- (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
11252
- parent.for
11253
- ) {
11254
- needsForceUpdate = true;
11255
- break
11256
- }
11257
- if (parent.if) {
11258
- needsKey = true;
11259
- }
11260
- parent = parent.parent;
11261
- }
11262
- }
11263
-
11264
- var generatedSlots = Object.keys(slots)
11265
- .map(function (key) { return genScopedSlot(slots[key], state); })
11266
- .join(',');
11267
-
11268
- return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
11269
- }
11270
-
11271
- function hash(str) {
11272
- var hash = 5381;
11273
- var i = str.length;
11274
- while(i) {
11275
- hash = (hash * 33) ^ str.charCodeAt(--i);
11276
- }
11277
- return hash >>> 0
11278
- }
11279
-
11280
- function containsSlotChild (el) {
11281
- if (el.type === 1) {
11282
- if (el.tag === 'slot') {
11283
- return true
11284
- }
11285
- return el.children.some(containsSlotChild)
11286
- }
11287
- return false
11288
- }
11289
-
11290
- function genScopedSlot (
11291
- el,
11292
- state
11293
- ) {
11294
- var isLegacySyntax = el.attrsMap['slot-scope'];
11295
- if (el.if && !el.ifProcessed && !isLegacySyntax) {
11296
- return genIf(el, state, genScopedSlot, "null")
11297
- }
11298
- if (el.for && !el.forProcessed) {
11299
- return genFor(el, state, genScopedSlot)
11300
- }
11301
- var slotScope = el.slotScope === emptySlotScopeToken
11302
- ? ""
11303
- : String(el.slotScope);
11304
- var fn = "function(" + slotScope + "){" +
11305
- "return " + (el.tag === 'template'
11306
- ? el.if && isLegacySyntax
11307
- ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
11308
- : genChildren(el, state) || 'undefined'
11309
- : genElement(el, state)) + "}";
11310
- // reverse proxy v-slot without scope on this.$slots
11311
- var reverseProxy = slotScope ? "" : ",proxy:true";
11312
- return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
11313
- }
11314
-
11315
- function genChildren (
11316
- el,
11317
- state,
11318
- checkSkip,
11319
- altGenElement,
11320
- altGenNode
11321
- ) {
11322
- var children = el.children;
11323
- if (children.length) {
11324
- var el$1 = children[0];
11325
- // optimize single v-for
11326
- if (children.length === 1 &&
11327
- el$1.for &&
11328
- el$1.tag !== 'template' &&
11329
- el$1.tag !== 'slot'
11330
- ) {
11331
- var normalizationType = checkSkip
11332
- ? state.maybeComponent(el$1) ? ",1" : ",0"
11333
- : "";
11334
- return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
11335
- }
11336
- var normalizationType$1 = checkSkip
11337
- ? getNormalizationType(children, state.maybeComponent)
11338
- : 0;
11339
- var gen = altGenNode || genNode;
11340
- return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
11341
- }
11342
- }
11343
-
11344
- // determine the normalization needed for the children array.
11345
- // 0: no normalization needed
11346
- // 1: simple normalization needed (possible 1-level deep nested array)
11347
- // 2: full normalization needed
11348
- function getNormalizationType (
11349
- children,
11350
- maybeComponent
11351
- ) {
11352
- var res = 0;
11353
- for (var i = 0; i < children.length; i++) {
11354
- var el = children[i];
11355
- if (el.type !== 1) {
11356
- continue
11357
- }
11358
- if (needsNormalization(el) ||
11359
- (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
11360
- res = 2;
11361
- break
11362
- }
11363
- if (maybeComponent(el) ||
11364
- (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
11365
- res = 1;
11366
- }
11367
- }
11368
- return res
11369
- }
11370
-
11371
- function needsNormalization (el) {
11372
- return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
11373
- }
11374
-
11375
- function genNode (node, state) {
11376
- if (node.type === 1) {
11377
- return genElement(node, state)
11378
- } else if (node.type === 3 && node.isComment) {
11379
- return genComment(node)
11380
- } else {
11381
- return genText(node)
11382
- }
11383
- }
11384
-
11385
- function genText (text) {
11386
- return ("_v(" + (text.type === 2
11387
- ? text.expression // no need for () because already wrapped in _s()
11388
- : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
11389
- }
11390
-
11391
- function genComment (comment) {
11392
- return ("_e(" + (JSON.stringify(comment.text)) + ")")
11393
- }
11394
-
11395
- function genSlot (el, state) {
11396
- var slotName = el.slotName || '"default"';
11397
- var children = genChildren(el, state);
11398
- var res = "_t(" + slotName + (children ? ("," + children) : '');
11399
- var attrs = el.attrs || el.dynamicAttrs
11400
- ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
11401
- // slot props are camelized
11402
- name: camelize(attr.name),
11403
- value: attr.value,
11404
- dynamic: attr.dynamic
11405
- }); }))
11406
- : null;
11407
- var bind$$1 = el.attrsMap['v-bind'];
11408
- if ((attrs || bind$$1) && !children) {
11409
- res += ",null";
11410
- }
11411
- if (attrs) {
11412
- res += "," + attrs;
11413
- }
11414
- if (bind$$1) {
11415
- res += (attrs ? '' : ',null') + "," + bind$$1;
11416
- }
11417
- return res + ')'
11418
- }
11419
-
11420
- // componentName is el.component, take it as argument to shun flow's pessimistic refinement
11421
- function genComponent (
11422
- componentName,
11423
- el,
11424
- state
11425
- ) {
11426
- var children = el.inlineTemplate ? null : genChildren(el, state, true);
11427
- return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
11428
- }
11429
-
11430
- function genProps (props) {
11431
- var staticProps = "";
11432
- var dynamicProps = "";
11433
- for (var i = 0; i < props.length; i++) {
11434
- var prop = props[i];
11435
- var value = transformSpecialNewlines(prop.value);
11436
- if (prop.dynamic) {
11437
- dynamicProps += (prop.name) + "," + value + ",";
11438
- } else {
11439
- staticProps += "\"" + (prop.name) + "\":" + value + ",";
11440
- }
11441
- }
11442
- staticProps = "{" + (staticProps.slice(0, -1)) + "}";
11443
- if (dynamicProps) {
11444
- return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
11445
- } else {
11446
- return staticProps
11447
- }
11448
- }
11449
-
11450
- // #3895, #4268
11451
- function transformSpecialNewlines (text) {
11452
- return text
11453
- .replace(/\u2028/g, '\\u2028')
11454
- .replace(/\u2029/g, '\\u2029')
11455
- }
11456
-
11457
- /* */
11458
-
11459
-
11460
-
11461
- // these keywords should not appear inside expressions, but operators like
11462
- // typeof, instanceof and in are allowed
11463
- var prohibitedKeywordRE = new RegExp('\\b' + (
11464
- 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
11465
- 'super,throw,while,yield,delete,export,import,return,switch,default,' +
11466
- 'extends,finally,continue,debugger,function,arguments'
11467
- ).split(',').join('\\b|\\b') + '\\b');
11468
-
11469
- // these unary operators should not be used as property/method names
11470
- var unaryOperatorsRE = new RegExp('\\b' + (
11471
- 'delete,typeof,void'
11472
- ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
11473
-
11474
- // strip strings in expressions
11475
- var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
11476
-
11477
- // detect problematic expressions in a template
11478
- function detectErrors (ast, warn) {
11479
- if (ast) {
11480
- checkNode(ast, warn);
11481
- }
11482
- }
11483
-
11484
- function checkNode (node, warn) {
11485
- if (node.type === 1) {
11486
- for (var name in node.attrsMap) {
11487
- if (dirRE.test(name)) {
11488
- var value = node.attrsMap[name];
11489
- if (value) {
11490
- var range = node.rawAttrsMap[name];
11491
- if (name === 'v-for') {
11492
- checkFor(node, ("v-for=\"" + value + "\""), warn, range);
11493
- } else if (onRE.test(name)) {
11494
- checkEvent(value, (name + "=\"" + value + "\""), warn, range);
11495
- } else {
11496
- checkExpression(value, (name + "=\"" + value + "\""), warn, range);
11497
- }
11498
- }
11499
- }
11500
- }
11501
- if (node.children) {
11502
- for (var i = 0; i < node.children.length; i++) {
11503
- checkNode(node.children[i], warn);
11504
- }
11505
- }
11506
- } else if (node.type === 2) {
11507
- checkExpression(node.expression, node.text, warn, node);
11508
- }
11509
- }
11510
-
11511
- function checkEvent (exp, text, warn, range) {
11512
- var stipped = exp.replace(stripStringRE, '');
11513
- var keywordMatch = stipped.match(unaryOperatorsRE);
11514
- if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
11515
- warn(
11516
- "avoid using JavaScript unary operator as property name: " +
11517
- "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
11518
- range
11519
- );
11520
- }
11521
- checkExpression(exp, text, warn, range);
11522
- }
11523
-
11524
- function checkFor (node, text, warn, range) {
11525
- checkExpression(node.for || '', text, warn, range);
11526
- checkIdentifier(node.alias, 'v-for alias', text, warn, range);
11527
- checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
11528
- checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
11529
- }
11530
-
11531
- function checkIdentifier (
11532
- ident,
11533
- type,
11534
- text,
11535
- warn,
11536
- range
11537
- ) {
11538
- if (typeof ident === 'string') {
11539
- try {
11540
- new Function(("var " + ident + "=_"));
11541
- } catch (e) {
11542
- warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
11543
- }
11544
- }
11545
- }
11546
-
11547
- function checkExpression (exp, text, warn, range) {
11548
- try {
11549
- new Function(("return " + exp));
11550
- } catch (e) {
11551
- var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
11552
- if (keywordMatch) {
11553
- warn(
11554
- "avoid using JavaScript keyword as property name: " +
11555
- "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
11556
- range
11557
- );
11558
- } else {
11559
- warn(
11560
- "invalid expression: " + (e.message) + " in\n\n" +
11561
- " " + exp + "\n\n" +
11562
- " Raw expression: " + (text.trim()) + "\n",
11563
- range
11564
- );
11565
- }
11566
- }
11567
- }
11568
-
11569
- /* */
11570
-
11571
- var range = 2;
11572
-
11573
- function generateCodeFrame (
11574
- source,
11575
- start,
11576
- end
11577
- ) {
11578
- if ( start === void 0 ) start = 0;
11579
- if ( end === void 0 ) end = source.length;
11580
-
11581
- var lines = source.split(/\r?\n/);
11582
- var count = 0;
11583
- var res = [];
11584
- for (var i = 0; i < lines.length; i++) {
11585
- count += lines[i].length + 1;
11586
- if (count >= start) {
11587
- for (var j = i - range; j <= i + range || end > count; j++) {
11588
- if (j < 0 || j >= lines.length) { continue }
11589
- res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
11590
- var lineLength = lines[j].length;
11591
- if (j === i) {
11592
- // push underline
11593
- var pad = start - (count - lineLength) + 1;
11594
- var length = end > count ? lineLength - pad : end - start;
11595
- res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
11596
- } else if (j > i) {
11597
- if (end > count) {
11598
- var length$1 = Math.min(end - count, lineLength);
11599
- res.push(" | " + repeat$1("^", length$1));
11600
- }
11601
- count += lineLength + 1;
11602
- }
11603
- }
11604
- break
11605
- }
11606
- }
11607
- return res.join('\n')
11608
- }
11609
-
11610
- function repeat$1 (str, n) {
11611
- var result = '';
11612
- if (n > 0) {
11613
- while (true) { // eslint-disable-line
11614
- if (n & 1) { result += str; }
11615
- n >>>= 1;
11616
- if (n <= 0) { break }
11617
- str += str;
11618
- }
11619
- }
11620
- return result
11621
- }
11622
-
11623
- /* */
11624
-
11625
-
11626
-
11627
- function createFunction (code, errors) {
11628
- try {
11629
- return new Function(code)
11630
- } catch (err) {
11631
- errors.push({ err: err, code: code });
11632
- return noop
11633
- }
11634
- }
11635
-
11636
- function createCompileToFunctionFn (compile) {
11637
- var cache = Object.create(null);
11638
-
11639
- return function compileToFunctions (
11640
- template,
11641
- options,
11642
- vm
11643
- ) {
11644
- options = extend({}, options);
11645
- var warn$$1 = options.warn || warn;
11646
- delete options.warn;
11647
-
11648
- /* istanbul ignore if */
11649
- {
11650
- // detect possible CSP restriction
11651
- try {
11652
- new Function('return 1');
11653
- } catch (e) {
11654
- if (e.toString().match(/unsafe-eval|CSP/)) {
11655
- warn$$1(
11656
- 'It seems you are using the standalone build of Vue.js in an ' +
11657
- 'environment with Content Security Policy that prohibits unsafe-eval. ' +
11658
- 'The template compiler cannot work in this environment. Consider ' +
11659
- 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
11660
- 'templates into render functions.'
11661
- );
11662
- }
11663
- }
11664
- }
11665
-
11666
- // check cache
11667
- var key = options.delimiters
11668
- ? String(options.delimiters) + template
11669
- : template;
11670
- if (cache[key]) {
11671
- return cache[key]
11672
- }
11673
-
11674
- // compile
11675
- var compiled = compile(template, options);
11676
-
11677
- // check compilation errors/tips
11678
- {
11679
- if (compiled.errors && compiled.errors.length) {
11680
- if (options.outputSourceRange) {
11681
- compiled.errors.forEach(function (e) {
11682
- warn$$1(
11683
- "Error compiling template:\n\n" + (e.msg) + "\n\n" +
11684
- generateCodeFrame(template, e.start, e.end),
11685
- vm
11686
- );
11687
- });
11688
- } else {
11689
- warn$$1(
11690
- "Error compiling template:\n\n" + template + "\n\n" +
11691
- compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
11692
- vm
11693
- );
11694
- }
11695
- }
11696
- if (compiled.tips && compiled.tips.length) {
11697
- if (options.outputSourceRange) {
11698
- compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
11699
- } else {
11700
- compiled.tips.forEach(function (msg) { return tip(msg, vm); });
11701
- }
11702
- }
11703
- }
11704
-
11705
- // turn code into functions
11706
- var res = {};
11707
- var fnGenErrors = [];
11708
- res.render = createFunction(compiled.render, fnGenErrors);
11709
- res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
11710
- return createFunction(code, fnGenErrors)
11711
- });
11712
-
11713
- // check function generation errors.
11714
- // this should only happen if there is a bug in the compiler itself.
11715
- // mostly for codegen development use
11716
- /* istanbul ignore if */
11717
- {
11718
- if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
11719
- warn$$1(
11720
- "Failed to generate render function:\n\n" +
11721
- fnGenErrors.map(function (ref) {
11722
- var err = ref.err;
11723
- var code = ref.code;
11724
-
11725
- return ((err.toString()) + " in\n\n" + code + "\n");
11726
- }).join('\n'),
11727
- vm
11728
- );
11729
- }
11730
- }
11731
-
11732
- return (cache[key] = res)
11733
- }
11734
- }
11735
-
11736
- /* */
11737
-
11738
- function createCompilerCreator (baseCompile) {
11739
- return function createCompiler (baseOptions) {
11740
- function compile (
11741
- template,
11742
- options
11743
- ) {
11744
- var finalOptions = Object.create(baseOptions);
11745
- var errors = [];
11746
- var tips = [];
11747
-
11748
- var warn = function (msg, range, tip) {
11749
- (tip ? tips : errors).push(msg);
11750
- };
11751
-
11752
- if (options) {
11753
- if (options.outputSourceRange) {
11754
- // $flow-disable-line
11755
- var leadingSpaceLength = template.match(/^\s*/)[0].length;
11756
-
11757
- warn = function (msg, range, tip) {
11758
- var data = { msg: msg };
11759
- if (range) {
11760
- if (range.start != null) {
11761
- data.start = range.start + leadingSpaceLength;
11762
- }
11763
- if (range.end != null) {
11764
- data.end = range.end + leadingSpaceLength;
11765
- }
11766
- }
11767
- (tip ? tips : errors).push(data);
11768
- };
11769
- }
11770
- // merge custom modules
11771
- if (options.modules) {
11772
- finalOptions.modules =
11773
- (baseOptions.modules || []).concat(options.modules);
11774
- }
11775
- // merge custom directives
11776
- if (options.directives) {
11777
- finalOptions.directives = extend(
11778
- Object.create(baseOptions.directives || null),
11779
- options.directives
11780
- );
11781
- }
11782
- // copy other options
11783
- for (var key in options) {
11784
- if (key !== 'modules' && key !== 'directives') {
11785
- finalOptions[key] = options[key];
11786
- }
11787
- }
11788
- }
11789
-
11790
- finalOptions.warn = warn;
11791
-
11792
- var compiled = baseCompile(template.trim(), finalOptions);
11793
- {
11794
- detectErrors(compiled.ast, warn);
11795
- }
11796
- compiled.errors = errors;
11797
- compiled.tips = tips;
11798
- return compiled
11799
- }
11800
-
11801
- return {
11802
- compile: compile,
11803
- compileToFunctions: createCompileToFunctionFn(compile)
11804
- }
11805
- }
11806
- }
11807
-
11808
- /* */
11809
-
11810
- // `createCompilerCreator` allows creating compilers that use alternative
11811
- // parser/optimizer/codegen, e.g the SSR optimizing compiler.
11812
- // Here we just export a default compiler using the default parts.
11813
- var createCompiler = createCompilerCreator(function baseCompile (
11814
- template,
11815
- options
11816
- ) {
11817
- var ast = parse(template.trim(), options);
11818
- if (options.optimize !== false) {
11819
- optimize(ast, options);
11820
- }
11821
- var code = generate(ast, options);
11822
- return {
11823
- ast: ast,
11824
- render: code.render,
11825
- staticRenderFns: code.staticRenderFns
11826
- }
11827
- });
11828
-
11829
- /* */
11830
-
11831
- var ref$1 = createCompiler(baseOptions);
11832
- var compile = ref$1.compile;
11833
- var compileToFunctions = ref$1.compileToFunctions;
11834
-
11835
- /* */
11836
-
11837
- // check whether current browser encodes a char inside attribute values
11838
- var div;
11839
- function getShouldDecode (href) {
11840
- div = div || document.createElement('div');
11841
- div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
11842
- return div.innerHTML.indexOf('&#10;') > 0
11843
- }
11844
-
11845
- // #3663: IE encodes newlines inside attribute values while other browsers don't
11846
- var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
11847
- // #6828: chrome encodes content in a[href]
11848
- var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
11849
-
11850
- /* */
11851
-
11852
- var idToTemplate = cached(function (id) {
11853
- var el = query(id);
11854
- return el && el.innerHTML
11855
- });
11856
-
11857
- var mount = Vue.prototype.$mount;
11858
- Vue.prototype.$mount = function (
11859
- el,
11860
- hydrating
11861
- ) {
11862
- el = el && query(el);
11863
-
11864
- /* istanbul ignore if */
11865
- if (el === document.body || el === document.documentElement) {
11866
- warn(
11867
- "Do not mount Vue to <html> or <body> - mount to normal elements instead."
11868
- );
11869
- return this
11870
- }
11871
-
11872
- var options = this.$options;
11873
- // resolve template/el and convert to render function
11874
- if (!options.render) {
11875
- var template = options.template;
11876
- if (template) {
11877
- if (typeof template === 'string') {
11878
- if (template.charAt(0) === '#') {
11879
- template = idToTemplate(template);
11880
- /* istanbul ignore if */
11881
- if (!template) {
11882
- warn(
11883
- ("Template element not found or is empty: " + (options.template)),
11884
- this
11885
- );
11886
- }
11887
- }
11888
- } else if (template.nodeType) {
11889
- template = template.innerHTML;
11890
- } else {
11891
- {
11892
- warn('invalid template option:' + template, this);
11893
- }
11894
- return this
11895
- }
11896
- } else if (el) {
11897
- template = getOuterHTML(el);
11898
- }
11899
- if (template) {
11900
- /* istanbul ignore if */
11901
- if (config.performance && mark) {
11902
- mark('compile');
11903
- }
11904
-
11905
- var ref = compileToFunctions(template, {
11906
- outputSourceRange: "development" !== 'production',
11907
- shouldDecodeNewlines: shouldDecodeNewlines,
11908
- shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
11909
- delimiters: options.delimiters,
11910
- comments: options.comments
11911
- }, this);
11912
- var render = ref.render;
11913
- var staticRenderFns = ref.staticRenderFns;
11914
- options.render = render;
11915
- options.staticRenderFns = staticRenderFns;
11916
-
11917
- /* istanbul ignore if */
11918
- if (config.performance && mark) {
11919
- mark('compile end');
11920
- measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
11921
- }
11922
- }
11923
- }
11924
- return mount.call(this, el, hydrating)
11925
- };
11926
-
11927
- /**
11928
- * Get outerHTML of elements, taking care
11929
- * of SVG elements in IE as well.
11930
- */
11931
- function getOuterHTML (el) {
11932
- if (el.outerHTML) {
11933
- return el.outerHTML
11934
- } else {
11935
- var container = document.createElement('div');
11936
- container.appendChild(el.cloneNode(true));
11937
- return container.innerHTML
11938
- }
11939
- }
11940
-
11941
- Vue.compile = compileToFunctions;
11942
-
11943
- return Vue;
11944
-
11945
- }));
11946
- /**
11947
- * vuex v3.1.0
11948
- * (c) 2019 Evan You
11949
- * @license MIT
11950
- */
11951
- (function (global, factory) {
11952
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
11953
- typeof define === 'function' && define.amd ? define(factory) :
11954
- (global = global || self, global.Vuex = factory());
11955
- }(this, function () { 'use strict';
11956
-
11957
- function applyMixin (Vue) {
11958
- var version = Number(Vue.version.split('.')[0]);
11959
-
11960
- if (version >= 2) {
11961
- Vue.mixin({ beforeCreate: vuexInit });
11962
- } else {
11963
- // override init and inject vuex init procedure
11964
- // for 1.x backwards compatibility.
11965
- var _init = Vue.prototype._init;
11966
- Vue.prototype._init = function (options) {
11967
- if ( options === void 0 ) options = {};
11968
-
11969
- options.init = options.init
11970
- ? [vuexInit].concat(options.init)
11971
- : vuexInit;
11972
- _init.call(this, options);
11973
- };
11974
- }
11975
-
11976
- /**
11977
- * Vuex init hook, injected into each instances init hooks list.
11978
- */
11979
-
11980
- function vuexInit () {
11981
- var options = this.$options;
11982
- // store injection
11983
- if (options.store) {
11984
- this.$store = typeof options.store === 'function'
11985
- ? options.store()
11986
- : options.store;
11987
- } else if (options.parent && options.parent.$store) {
11988
- this.$store = options.parent.$store;
11989
- }
11990
- }
11991
- }
11992
-
11993
- var devtoolHook =
11994
- typeof window !== 'undefined' &&
11995
- window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
11996
-
11997
- function devtoolPlugin (store) {
11998
- if (!devtoolHook) { return }
11999
-
12000
- store._devtoolHook = devtoolHook;
12001
-
12002
- devtoolHook.emit('vuex:init', store);
12003
-
12004
- devtoolHook.on('vuex:travel-to-state', function (targetState) {
12005
- store.replaceState(targetState);
12006
- });
12007
-
12008
- store.subscribe(function (mutation, state) {
12009
- devtoolHook.emit('vuex:mutation', mutation, state);
12010
- });
12011
- }
12012
-
12013
- /**
12014
- * Get the first item that pass the test
12015
- * by second argument function
12016
- *
12017
- * @param {Array} list
12018
- * @param {Function} f
12019
- * @return {*}
12020
- */
12021
-
12022
- /**
12023
- * forEach for object
12024
- */
12025
- function forEachValue (obj, fn) {
12026
- Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
12027
- }
12028
-
12029
- function isObject (obj) {
12030
- return obj !== null && typeof obj === 'object'
12031
- }
12032
-
12033
- function isPromise (val) {
12034
- return val && typeof val.then === 'function'
12035
- }
12036
-
12037
- function assert (condition, msg) {
12038
- if (!condition) { throw new Error(("[vuex] " + msg)) }
12039
- }
12040
-
12041
- // Base data struct for store's module, package with some attribute and method
12042
- var Module = function Module (rawModule, runtime) {
12043
- this.runtime = runtime;
12044
- // Store some children item
12045
- this._children = Object.create(null);
12046
- // Store the origin module object which passed by programmer
12047
- this._rawModule = rawModule;
12048
- var rawState = rawModule.state;
12049
-
12050
- // Store the origin module's state
12051
- this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
12052
- };
12053
-
12054
- var prototypeAccessors = { namespaced: { configurable: true } };
12055
-
12056
- prototypeAccessors.namespaced.get = function () {
12057
- return !!this._rawModule.namespaced
12058
- };
12059
-
12060
- Module.prototype.addChild = function addChild (key, module) {
12061
- this._children[key] = module;
12062
- };
12063
-
12064
- Module.prototype.removeChild = function removeChild (key) {
12065
- delete this._children[key];
12066
- };
12067
-
12068
- Module.prototype.getChild = function getChild (key) {
12069
- return this._children[key]
12070
- };
12071
-
12072
- Module.prototype.update = function update (rawModule) {
12073
- this._rawModule.namespaced = rawModule.namespaced;
12074
- if (rawModule.actions) {
12075
- this._rawModule.actions = rawModule.actions;
12076
- }
12077
- if (rawModule.mutations) {
12078
- this._rawModule.mutations = rawModule.mutations;
12079
- }
12080
- if (rawModule.getters) {
12081
- this._rawModule.getters = rawModule.getters;
12082
- }
12083
- };
12084
-
12085
- Module.prototype.forEachChild = function forEachChild (fn) {
12086
- forEachValue(this._children, fn);
12087
- };
12088
-
12089
- Module.prototype.forEachGetter = function forEachGetter (fn) {
12090
- if (this._rawModule.getters) {
12091
- forEachValue(this._rawModule.getters, fn);
12092
- }
12093
- };
12094
-
12095
- Module.prototype.forEachAction = function forEachAction (fn) {
12096
- if (this._rawModule.actions) {
12097
- forEachValue(this._rawModule.actions, fn);
12098
- }
12099
- };
12100
-
12101
- Module.prototype.forEachMutation = function forEachMutation (fn) {
12102
- if (this._rawModule.mutations) {
12103
- forEachValue(this._rawModule.mutations, fn);
12104
- }
12105
- };
12106
-
12107
- Object.defineProperties( Module.prototype, prototypeAccessors );
12108
-
12109
- var ModuleCollection = function ModuleCollection (rawRootModule) {
12110
- // register root module (Vuex.Store options)
12111
- this.register([], rawRootModule, false);
12112
- };
12113
-
12114
- ModuleCollection.prototype.get = function get (path) {
12115
- return path.reduce(function (module, key) {
12116
- return module.getChild(key)
12117
- }, this.root)
12118
- };
12119
-
12120
- ModuleCollection.prototype.getNamespace = function getNamespace (path) {
12121
- var module = this.root;
12122
- return path.reduce(function (namespace, key) {
12123
- module = module.getChild(key);
12124
- return namespace + (module.namespaced ? key + '/' : '')
12125
- }, '')
12126
- };
12127
-
12128
- ModuleCollection.prototype.update = function update$1 (rawRootModule) {
12129
- update([], this.root, rawRootModule);
12130
- };
12131
-
12132
- ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
12133
- var this$1 = this;
12134
- if ( runtime === void 0 ) runtime = true;
12135
-
12136
- {
12137
- assertRawModule(path, rawModule);
12138
- }
12139
-
12140
- var newModule = new Module(rawModule, runtime);
12141
- if (path.length === 0) {
12142
- this.root = newModule;
12143
- } else {
12144
- var parent = this.get(path.slice(0, -1));
12145
- parent.addChild(path[path.length - 1], newModule);
12146
- }
12147
-
12148
- // register nested modules
12149
- if (rawModule.modules) {
12150
- forEachValue(rawModule.modules, function (rawChildModule, key) {
12151
- this$1.register(path.concat(key), rawChildModule, runtime);
12152
- });
12153
- }
12154
- };
12155
-
12156
- ModuleCollection.prototype.unregister = function unregister (path) {
12157
- var parent = this.get(path.slice(0, -1));
12158
- var key = path[path.length - 1];
12159
- if (!parent.getChild(key).runtime) { return }
12160
-
12161
- parent.removeChild(key);
12162
- };
12163
-
12164
- function update (path, targetModule, newModule) {
12165
- {
12166
- assertRawModule(path, newModule);
12167
- }
12168
-
12169
- // update target module
12170
- targetModule.update(newModule);
12171
-
12172
- // update nested modules
12173
- if (newModule.modules) {
12174
- for (var key in newModule.modules) {
12175
- if (!targetModule.getChild(key)) {
12176
- {
12177
- console.warn(
12178
- "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
12179
- 'manual reload is needed'
12180
- );
12181
- }
12182
- return
12183
- }
12184
- update(
12185
- path.concat(key),
12186
- targetModule.getChild(key),
12187
- newModule.modules[key]
12188
- );
12189
- }
12190
- }
12191
- }
12192
-
12193
- var functionAssert = {
12194
- assert: function (value) { return typeof value === 'function'; },
12195
- expected: 'function'
12196
- };
12197
-
12198
- var objectAssert = {
12199
- assert: function (value) { return typeof value === 'function' ||
12200
- (typeof value === 'object' && typeof value.handler === 'function'); },
12201
- expected: 'function or object with "handler" function'
12202
- };
12203
-
12204
- var assertTypes = {
12205
- getters: functionAssert,
12206
- mutations: functionAssert,
12207
- actions: objectAssert
12208
- };
12209
-
12210
- function assertRawModule (path, rawModule) {
12211
- Object.keys(assertTypes).forEach(function (key) {
12212
- if (!rawModule[key]) { return }
12213
-
12214
- var assertOptions = assertTypes[key];
12215
-
12216
- forEachValue(rawModule[key], function (value, type) {
12217
- assert(
12218
- assertOptions.assert(value),
12219
- makeAssertionMessage(path, key, type, value, assertOptions.expected)
12220
- );
12221
- });
12222
- });
12223
- }
12224
-
12225
- function makeAssertionMessage (path, key, type, value, expected) {
12226
- var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
12227
- if (path.length > 0) {
12228
- buf += " in module \"" + (path.join('.')) + "\"";
12229
- }
12230
- buf += " is " + (JSON.stringify(value)) + ".";
12231
- return buf
12232
- }
12233
-
12234
- var Vue; // bind on install
12235
-
12236
- var Store = function Store (options) {
12237
- var this$1 = this;
12238
- if ( options === void 0 ) options = {};
12239
-
12240
- // Auto install if it is not done yet and `window` has `Vue`.
12241
- // To allow users to avoid auto-installation in some cases,
12242
- // this code should be placed here. See #731
12243
- if (!Vue && typeof window !== 'undefined' && window.Vue) {
12244
- install(window.Vue);
12245
- }
12246
-
12247
- {
12248
- assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
12249
- assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
12250
- assert(this instanceof Store, "store must be called with the new operator.");
12251
- }
12252
-
12253
- var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
12254
- var strict = options.strict; if ( strict === void 0 ) strict = false;
12255
-
12256
- // store internal state
12257
- this._committing = false;
12258
- this._actions = Object.create(null);
12259
- this._actionSubscribers = [];
12260
- this._mutations = Object.create(null);
12261
- this._wrappedGetters = Object.create(null);
12262
- this._modules = new ModuleCollection(options);
12263
- this._modulesNamespaceMap = Object.create(null);
12264
- this._subscribers = [];
12265
- this._watcherVM = new Vue();
12266
-
12267
- // bind commit and dispatch to self
12268
- var store = this;
12269
- var ref = this;
12270
- var dispatch = ref.dispatch;
12271
- var commit = ref.commit;
12272
- this.dispatch = function boundDispatch (type, payload) {
12273
- return dispatch.call(store, type, payload)
12274
- };
12275
- this.commit = function boundCommit (type, payload, options) {
12276
- return commit.call(store, type, payload, options)
12277
- };
12278
-
12279
- // strict mode
12280
- this.strict = strict;
12281
-
12282
- var state = this._modules.root.state;
12283
-
12284
- // init root module.
12285
- // this also recursively registers all sub-modules
12286
- // and collects all module getters inside this._wrappedGetters
12287
- installModule(this, state, [], this._modules.root);
12288
-
12289
- // initialize the store vm, which is responsible for the reactivity
12290
- // (also registers _wrappedGetters as computed properties)
12291
- resetStoreVM(this, state);
12292
-
12293
- // apply plugins
12294
- plugins.forEach(function (plugin) { return plugin(this$1); });
12295
-
12296
- var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
12297
- if (useDevtools) {
12298
- devtoolPlugin(this);
12299
- }
12300
- };
12301
-
12302
- var prototypeAccessors$1 = { state: { configurable: true } };
12303
-
12304
- prototypeAccessors$1.state.get = function () {
12305
- return this._vm._data.$$state
12306
- };
12307
-
12308
- prototypeAccessors$1.state.set = function (v) {
12309
- {
12310
- assert(false, "use store.replaceState() to explicit replace store state.");
12311
- }
12312
- };
12313
-
12314
- Store.prototype.commit = function commit (_type, _payload, _options) {
12315
- var this$1 = this;
12316
-
12317
- // check object-style commit
12318
- var ref = unifyObjectStyle(_type, _payload, _options);
12319
- var type = ref.type;
12320
- var payload = ref.payload;
12321
- var options = ref.options;
12322
-
12323
- var mutation = { type: type, payload: payload };
12324
- var entry = this._mutations[type];
12325
- if (!entry) {
12326
- {
12327
- console.error(("[vuex] unknown mutation type: " + type));
12328
- }
12329
- return
12330
- }
12331
- this._withCommit(function () {
12332
- entry.forEach(function commitIterator (handler) {
12333
- handler(payload);
12334
- });
12335
- });
12336
- this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
12337
-
12338
- if (
12339
- options && options.silent
12340
- ) {
12341
- console.warn(
12342
- "[vuex] mutation type: " + type + ". Silent option has been removed. " +
12343
- 'Use the filter functionality in the vue-devtools'
12344
- );
12345
- }
12346
- };
12347
-
12348
- Store.prototype.dispatch = function dispatch (_type, _payload) {
12349
- var this$1 = this;
12350
-
12351
- // check object-style dispatch
12352
- var ref = unifyObjectStyle(_type, _payload);
12353
- var type = ref.type;
12354
- var payload = ref.payload;
12355
-
12356
- var action = { type: type, payload: payload };
12357
- var entry = this._actions[type];
12358
- if (!entry) {
12359
- {
12360
- console.error(("[vuex] unknown action type: " + type));
12361
- }
12362
- return
12363
- }
12364
-
12365
- try {
12366
- this._actionSubscribers
12367
- .filter(function (sub) { return sub.before; })
12368
- .forEach(function (sub) { return sub.before(action, this$1.state); });
12369
- } catch (e) {
12370
- {
12371
- console.warn("[vuex] error in before action subscribers: ");
12372
- console.error(e);
12373
- }
12374
- }
12375
-
12376
- var result = entry.length > 1
12377
- ? Promise.all(entry.map(function (handler) { return handler(payload); }))
12378
- : entry[0](payload);
12379
-
12380
- return result.then(function (res) {
12381
- try {
12382
- this$1._actionSubscribers
12383
- .filter(function (sub) { return sub.after; })
12384
- .forEach(function (sub) { return sub.after(action, this$1.state); });
12385
- } catch (e) {
12386
- {
12387
- console.warn("[vuex] error in after action subscribers: ");
12388
- console.error(e);
12389
- }
12390
- }
12391
- return res
12392
- })
12393
- };
12394
-
12395
- Store.prototype.subscribe = function subscribe (fn) {
12396
- return genericSubscribe(fn, this._subscribers)
12397
- };
12398
-
12399
- Store.prototype.subscribeAction = function subscribeAction (fn) {
12400
- var subs = typeof fn === 'function' ? { before: fn } : fn;
12401
- return genericSubscribe(subs, this._actionSubscribers)
12402
- };
12403
-
12404
- Store.prototype.watch = function watch (getter, cb, options) {
12405
- var this$1 = this;
12406
-
12407
- {
12408
- assert(typeof getter === 'function', "store.watch only accepts a function.");
12409
- }
12410
- return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
12411
- };
12412
-
12413
- Store.prototype.replaceState = function replaceState (state) {
12414
- var this$1 = this;
12415
-
12416
- this._withCommit(function () {
12417
- this$1._vm._data.$$state = state;
12418
- });
12419
- };
12420
-
12421
- Store.prototype.registerModule = function registerModule (path, rawModule, options) {
12422
- if ( options === void 0 ) options = {};
12423
-
12424
- if (typeof path === 'string') { path = [path]; }
12425
-
12426
- {
12427
- assert(Array.isArray(path), "module path must be a string or an Array.");
12428
- assert(path.length > 0, 'cannot register the root module by using registerModule.');
12429
- }
12430
-
12431
- this._modules.register(path, rawModule);
12432
- installModule(this, this.state, path, this._modules.get(path), options.preserveState);
12433
- // reset store to update getters...
12434
- resetStoreVM(this, this.state);
12435
- };
12436
-
12437
- Store.prototype.unregisterModule = function unregisterModule (path) {
12438
- var this$1 = this;
12439
-
12440
- if (typeof path === 'string') { path = [path]; }
12441
-
12442
- {
12443
- assert(Array.isArray(path), "module path must be a string or an Array.");
12444
- }
12445
-
12446
- this._modules.unregister(path);
12447
- this._withCommit(function () {
12448
- var parentState = getNestedState(this$1.state, path.slice(0, -1));
12449
- Vue.delete(parentState, path[path.length - 1]);
12450
- });
12451
- resetStore(this);
12452
- };
12453
-
12454
- Store.prototype.hotUpdate = function hotUpdate (newOptions) {
12455
- this._modules.update(newOptions);
12456
- resetStore(this, true);
12457
- };
12458
-
12459
- Store.prototype._withCommit = function _withCommit (fn) {
12460
- var committing = this._committing;
12461
- this._committing = true;
12462
- fn();
12463
- this._committing = committing;
12464
- };
12465
-
12466
- Object.defineProperties( Store.prototype, prototypeAccessors$1 );
12467
-
12468
- function genericSubscribe (fn, subs) {
12469
- if (subs.indexOf(fn) < 0) {
12470
- subs.push(fn);
12471
- }
12472
- return function () {
12473
- var i = subs.indexOf(fn);
12474
- if (i > -1) {
12475
- subs.splice(i, 1);
12476
- }
12477
- }
12478
- }
12479
-
12480
- function resetStore (store, hot) {
12481
- store._actions = Object.create(null);
12482
- store._mutations = Object.create(null);
12483
- store._wrappedGetters = Object.create(null);
12484
- store._modulesNamespaceMap = Object.create(null);
12485
- var state = store.state;
12486
- // init all modules
12487
- installModule(store, state, [], store._modules.root, true);
12488
- // reset vm
12489
- resetStoreVM(store, state, hot);
12490
- }
12491
-
12492
- function resetStoreVM (store, state, hot) {
12493
- var oldVm = store._vm;
12494
-
12495
- // bind store public getters
12496
- store.getters = {};
12497
- var wrappedGetters = store._wrappedGetters;
12498
- var computed = {};
12499
- forEachValue(wrappedGetters, function (fn, key) {
12500
- // use computed to leverage its lazy-caching mechanism
12501
- computed[key] = function () { return fn(store); };
12502
- Object.defineProperty(store.getters, key, {
12503
- get: function () { return store._vm[key]; },
12504
- enumerable: true // for local getters
12505
- });
12506
- });
12507
-
12508
- // use a Vue instance to store the state tree
12509
- // suppress warnings just in case the user has added
12510
- // some funky global mixins
12511
- var silent = Vue.config.silent;
12512
- Vue.config.silent = true;
12513
- store._vm = new Vue({
12514
- data: {
12515
- $$state: state
12516
- },
12517
- computed: computed
12518
- });
12519
- Vue.config.silent = silent;
12520
-
12521
- // enable strict mode for new vm
12522
- if (store.strict) {
12523
- enableStrictMode(store);
12524
- }
12525
-
12526
- if (oldVm) {
12527
- if (hot) {
12528
- // dispatch changes in all subscribed watchers
12529
- // to force getter re-evaluation for hot reloading.
12530
- store._withCommit(function () {
12531
- oldVm._data.$$state = null;
12532
- });
12533
- }
12534
- Vue.nextTick(function () { return oldVm.$destroy(); });
12535
- }
12536
- }
12537
-
12538
- function installModule (store, rootState, path, module, hot) {
12539
- var isRoot = !path.length;
12540
- var namespace = store._modules.getNamespace(path);
12541
-
12542
- // register in namespace map
12543
- if (module.namespaced) {
12544
- store._modulesNamespaceMap[namespace] = module;
12545
- }
12546
-
12547
- // set state
12548
- if (!isRoot && !hot) {
12549
- var parentState = getNestedState(rootState, path.slice(0, -1));
12550
- var moduleName = path[path.length - 1];
12551
- store._withCommit(function () {
12552
- Vue.set(parentState, moduleName, module.state);
12553
- });
12554
- }
12555
-
12556
- var local = module.context = makeLocalContext(store, namespace, path);
12557
-
12558
- module.forEachMutation(function (mutation, key) {
12559
- var namespacedType = namespace + key;
12560
- registerMutation(store, namespacedType, mutation, local);
12561
- });
12562
-
12563
- module.forEachAction(function (action, key) {
12564
- var type = action.root ? key : namespace + key;
12565
- var handler = action.handler || action;
12566
- registerAction(store, type, handler, local);
12567
- });
12568
-
12569
- module.forEachGetter(function (getter, key) {
12570
- var namespacedType = namespace + key;
12571
- registerGetter(store, namespacedType, getter, local);
12572
- });
12573
-
12574
- module.forEachChild(function (child, key) {
12575
- installModule(store, rootState, path.concat(key), child, hot);
12576
- });
12577
- }
12578
-
12579
- /**
12580
- * make localized dispatch, commit, getters and state
12581
- * if there is no namespace, just use root ones
12582
- */
12583
- function makeLocalContext (store, namespace, path) {
12584
- var noNamespace = namespace === '';
12585
-
12586
- var local = {
12587
- dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
12588
- var args = unifyObjectStyle(_type, _payload, _options);
12589
- var payload = args.payload;
12590
- var options = args.options;
12591
- var type = args.type;
12592
-
12593
- if (!options || !options.root) {
12594
- type = namespace + type;
12595
- if (!store._actions[type]) {
12596
- console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
12597
- return
12598
- }
12599
- }
12600
-
12601
- return store.dispatch(type, payload)
12602
- },
12603
-
12604
- commit: noNamespace ? store.commit : function (_type, _payload, _options) {
12605
- var args = unifyObjectStyle(_type, _payload, _options);
12606
- var payload = args.payload;
12607
- var options = args.options;
12608
- var type = args.type;
12609
-
12610
- if (!options || !options.root) {
12611
- type = namespace + type;
12612
- if (!store._mutations[type]) {
12613
- console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
12614
- return
12615
- }
12616
- }
12617
-
12618
- store.commit(type, payload, options);
12619
- }
12620
- };
12621
-
12622
- // getters and state object must be gotten lazily
12623
- // because they will be changed by vm update
12624
- Object.defineProperties(local, {
12625
- getters: {
12626
- get: noNamespace
12627
- ? function () { return store.getters; }
12628
- : function () { return makeLocalGetters(store, namespace); }
12629
- },
12630
- state: {
12631
- get: function () { return getNestedState(store.state, path); }
12632
- }
12633
- });
12634
-
12635
- return local
12636
- }
12637
-
12638
- function makeLocalGetters (store, namespace) {
12639
- var gettersProxy = {};
12640
-
12641
- var splitPos = namespace.length;
12642
- Object.keys(store.getters).forEach(function (type) {
12643
- // skip if the target getter is not match this namespace
12644
- if (type.slice(0, splitPos) !== namespace) { return }
12645
-
12646
- // extract local getter type
12647
- var localType = type.slice(splitPos);
12648
-
12649
- // Add a port to the getters proxy.
12650
- // Define as getter property because
12651
- // we do not want to evaluate the getters in this time.
12652
- Object.defineProperty(gettersProxy, localType, {
12653
- get: function () { return store.getters[type]; },
12654
- enumerable: true
12655
- });
12656
- });
12657
-
12658
- return gettersProxy
12659
- }
12660
-
12661
- function registerMutation (store, type, handler, local) {
12662
- var entry = store._mutations[type] || (store._mutations[type] = []);
12663
- entry.push(function wrappedMutationHandler (payload) {
12664
- handler.call(store, local.state, payload);
12665
- });
12666
- }
12667
-
12668
- function registerAction (store, type, handler, local) {
12669
- var entry = store._actions[type] || (store._actions[type] = []);
12670
- entry.push(function wrappedActionHandler (payload, cb) {
12671
- var res = handler.call(store, {
12672
- dispatch: local.dispatch,
12673
- commit: local.commit,
12674
- getters: local.getters,
12675
- state: local.state,
12676
- rootGetters: store.getters,
12677
- rootState: store.state
12678
- }, payload, cb);
12679
- if (!isPromise(res)) {
12680
- res = Promise.resolve(res);
12681
- }
12682
- if (store._devtoolHook) {
12683
- return res.catch(function (err) {
12684
- store._devtoolHook.emit('vuex:error', err);
12685
- throw err
12686
- })
12687
- } else {
12688
- return res
12689
- }
12690
- });
12691
- }
12692
-
12693
- function registerGetter (store, type, rawGetter, local) {
12694
- if (store._wrappedGetters[type]) {
12695
- {
12696
- console.error(("[vuex] duplicate getter key: " + type));
12697
- }
12698
- return
12699
- }
12700
- store._wrappedGetters[type] = function wrappedGetter (store) {
12701
- return rawGetter(
12702
- local.state, // local state
12703
- local.getters, // local getters
12704
- store.state, // root state
12705
- store.getters // root getters
12706
- )
12707
- };
12708
- }
12709
-
12710
- function enableStrictMode (store) {
12711
- store._vm.$watch(function () { return this._data.$$state }, function () {
12712
- {
12713
- assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
12714
- }
12715
- }, { deep: true, sync: true });
12716
- }
12717
-
12718
- function getNestedState (state, path) {
12719
- return path.length
12720
- ? path.reduce(function (state, key) { return state[key]; }, state)
12721
- : state
12722
- }
12723
-
12724
- function unifyObjectStyle (type, payload, options) {
12725
- if (isObject(type) && type.type) {
12726
- options = payload;
12727
- payload = type;
12728
- type = type.type;
12729
- }
12730
-
12731
- {
12732
- assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
12733
- }
12734
-
12735
- return { type: type, payload: payload, options: options }
12736
- }
12737
-
12738
- function install (_Vue) {
12739
- if (Vue && _Vue === Vue) {
12740
- {
12741
- console.error(
12742
- '[vuex] already installed. Vue.use(Vuex) should be called only once.'
12743
- );
12744
- }
12745
- return
12746
- }
12747
- Vue = _Vue;
12748
- applyMixin(Vue);
12749
- }
12750
-
12751
- /**
12752
- * Reduce the code which written in Vue.js for getting the state.
12753
- * @param {String} [namespace] - Module's namespace
12754
- * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
12755
- * @param {Object}
12756
- */
12757
- var mapState = normalizeNamespace(function (namespace, states) {
12758
- var res = {};
12759
- normalizeMap(states).forEach(function (ref) {
12760
- var key = ref.key;
12761
- var val = ref.val;
12762
-
12763
- res[key] = function mappedState () {
12764
- var state = this.$store.state;
12765
- var getters = this.$store.getters;
12766
- if (namespace) {
12767
- var module = getModuleByNamespace(this.$store, 'mapState', namespace);
12768
- if (!module) {
12769
- return
12770
- }
12771
- state = module.context.state;
12772
- getters = module.context.getters;
12773
- }
12774
- return typeof val === 'function'
12775
- ? val.call(this, state, getters)
12776
- : state[val]
12777
- };
12778
- // mark vuex getter for devtools
12779
- res[key].vuex = true;
12780
- });
12781
- return res
12782
- });
12783
-
12784
- /**
12785
- * Reduce the code which written in Vue.js for committing the mutation
12786
- * @param {String} [namespace] - Module's namespace
12787
- * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
12788
- * @return {Object}
12789
- */
12790
- var mapMutations = normalizeNamespace(function (namespace, mutations) {
12791
- var res = {};
12792
- normalizeMap(mutations).forEach(function (ref) {
12793
- var key = ref.key;
12794
- var val = ref.val;
12795
-
12796
- res[key] = function mappedMutation () {
12797
- var args = [], len = arguments.length;
12798
- while ( len-- ) args[ len ] = arguments[ len ];
12799
-
12800
- // Get the commit method from store
12801
- var commit = this.$store.commit;
12802
- if (namespace) {
12803
- var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
12804
- if (!module) {
12805
- return
12806
- }
12807
- commit = module.context.commit;
12808
- }
12809
- return typeof val === 'function'
12810
- ? val.apply(this, [commit].concat(args))
12811
- : commit.apply(this.$store, [val].concat(args))
12812
- };
12813
- });
12814
- return res
12815
- });
12816
-
12817
- /**
12818
- * Reduce the code which written in Vue.js for getting the getters
12819
- * @param {String} [namespace] - Module's namespace
12820
- * @param {Object|Array} getters
12821
- * @return {Object}
12822
- */
12823
- var mapGetters = normalizeNamespace(function (namespace, getters) {
12824
- var res = {};
12825
- normalizeMap(getters).forEach(function (ref) {
12826
- var key = ref.key;
12827
- var val = ref.val;
12828
-
12829
- // The namespace has been mutated by normalizeNamespace
12830
- val = namespace + val;
12831
- res[key] = function mappedGetter () {
12832
- if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
12833
- return
12834
- }
12835
- if (!(val in this.$store.getters)) {
12836
- console.error(("[vuex] unknown getter: " + val));
12837
- return
12838
- }
12839
- return this.$store.getters[val]
12840
- };
12841
- // mark vuex getter for devtools
12842
- res[key].vuex = true;
12843
- });
12844
- return res
12845
- });
12846
-
12847
- /**
12848
- * Reduce the code which written in Vue.js for dispatch the action
12849
- * @param {String} [namespace] - Module's namespace
12850
- * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
12851
- * @return {Object}
12852
- */
12853
- var mapActions = normalizeNamespace(function (namespace, actions) {
12854
- var res = {};
12855
- normalizeMap(actions).forEach(function (ref) {
12856
- var key = ref.key;
12857
- var val = ref.val;
12858
-
12859
- res[key] = function mappedAction () {
12860
- var args = [], len = arguments.length;
12861
- while ( len-- ) args[ len ] = arguments[ len ];
12862
-
12863
- // get dispatch function from store
12864
- var dispatch = this.$store.dispatch;
12865
- if (namespace) {
12866
- var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
12867
- if (!module) {
12868
- return
12869
- }
12870
- dispatch = module.context.dispatch;
12871
- }
12872
- return typeof val === 'function'
12873
- ? val.apply(this, [dispatch].concat(args))
12874
- : dispatch.apply(this.$store, [val].concat(args))
12875
- };
12876
- });
12877
- return res
12878
- });
12879
-
12880
- /**
12881
- * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
12882
- * @param {String} namespace
12883
- * @return {Object}
12884
- */
12885
- var createNamespacedHelpers = function (namespace) { return ({
12886
- mapState: mapState.bind(null, namespace),
12887
- mapGetters: mapGetters.bind(null, namespace),
12888
- mapMutations: mapMutations.bind(null, namespace),
12889
- mapActions: mapActions.bind(null, namespace)
12890
- }); };
12891
-
12892
- /**
12893
- * Normalize the map
12894
- * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
12895
- * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
12896
- * @param {Array|Object} map
12897
- * @return {Object}
12898
- */
12899
- function normalizeMap (map) {
12900
- return Array.isArray(map)
12901
- ? map.map(function (key) { return ({ key: key, val: key }); })
12902
- : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
12903
- }
12904
-
12905
- /**
12906
- * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
12907
- * @param {Function} fn
12908
- * @return {Function}
12909
- */
12910
- function normalizeNamespace (fn) {
12911
- return function (namespace, map) {
12912
- if (typeof namespace !== 'string') {
12913
- map = namespace;
12914
- namespace = '';
12915
- } else if (namespace.charAt(namespace.length - 1) !== '/') {
12916
- namespace += '/';
12917
- }
12918
- return fn(namespace, map)
12919
- }
12920
- }
12921
-
12922
- /**
12923
- * Search a special module from store by namespace. if module not exist, print error message.
12924
- * @param {Object} store
12925
- * @param {String} helper
12926
- * @param {String} namespace
12927
- * @return {Object}
12928
- */
12929
- function getModuleByNamespace (store, helper, namespace) {
12930
- var module = store._modulesNamespaceMap[namespace];
12931
- if (!module) {
12932
- console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
12933
- }
12934
- return module
12935
- }
12936
-
12937
- var index = {
12938
- Store: Store,
12939
- install: install,
12940
- version: '3.1.0',
12941
- mapState: mapState,
12942
- mapMutations: mapMutations,
12943
- mapGetters: mapGetters,
12944
- mapActions: mapActions,
12945
- createNamespacedHelpers: createNamespacedHelpers
12946
- };
12947
-
12948
- return index;
12949
-
12950
- }));
12951
- /*!
12952
- * vue-resource v1.3.4
12953
- * https://github.com/pagekit/vue-resource
12954
- * Released under the MIT License.
12955
- */
12956
-
12957
- (function (global, factory) {
12958
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
12959
- typeof define === 'function' && define.amd ? define(factory) :
12960
- (global.VueResource = factory());
12961
- }(this, (function () { 'use strict';
12962
-
12963
- /**
12964
- * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
12965
- */
12966
-
12967
- var RESOLVED = 0;
12968
- var REJECTED = 1;
12969
- var PENDING = 2;
12970
-
12971
- function Promise$1(executor) {
12972
-
12973
- this.state = PENDING;
12974
- this.value = undefined;
12975
- this.deferred = [];
12976
-
12977
- var promise = this;
12978
-
12979
- try {
12980
- executor(function (x) {
12981
- promise.resolve(x);
12982
- }, function (r) {
12983
- promise.reject(r);
12984
- });
12985
- } catch (e) {
12986
- promise.reject(e);
12987
- }
12988
- }
12989
-
12990
- Promise$1.reject = function (r) {
12991
- return new Promise$1(function (resolve, reject) {
12992
- reject(r);
12993
- });
12994
- };
12995
-
12996
- Promise$1.resolve = function (x) {
12997
- return new Promise$1(function (resolve, reject) {
12998
- resolve(x);
12999
- });
13000
- };
13001
-
13002
- Promise$1.all = function all(iterable) {
13003
- return new Promise$1(function (resolve, reject) {
13004
- var count = 0, result = [];
13005
-
13006
- if (iterable.length === 0) {
13007
- resolve(result);
13008
- }
13009
-
13010
- function resolver(i) {
13011
- return function (x) {
13012
- result[i] = x;
13013
- count += 1;
13014
-
13015
- if (count === iterable.length) {
13016
- resolve(result);
13017
- }
13018
- };
13019
- }
13020
-
13021
- for (var i = 0; i < iterable.length; i += 1) {
13022
- Promise$1.resolve(iterable[i]).then(resolver(i), reject);
13023
- }
13024
- });
13025
- };
13026
-
13027
- Promise$1.race = function race(iterable) {
13028
- return new Promise$1(function (resolve, reject) {
13029
- for (var i = 0; i < iterable.length; i += 1) {
13030
- Promise$1.resolve(iterable[i]).then(resolve, reject);
13031
- }
13032
- });
13033
- };
13034
-
13035
- var p$1 = Promise$1.prototype;
13036
-
13037
- p$1.resolve = function resolve(x) {
13038
- var promise = this;
13039
-
13040
- if (promise.state === PENDING) {
13041
- if (x === promise) {
13042
- throw new TypeError('Promise settled with itself.');
13043
- }
13044
-
13045
- var called = false;
13046
-
13047
- try {
13048
- var then = x && x['then'];
13049
-
13050
- if (x !== null && typeof x === 'object' && typeof then === 'function') {
13051
- then.call(x, function (x) {
13052
- if (!called) {
13053
- promise.resolve(x);
13054
- }
13055
- called = true;
13056
-
13057
- }, function (r) {
13058
- if (!called) {
13059
- promise.reject(r);
13060
- }
13061
- called = true;
13062
- });
13063
- return;
13064
- }
13065
- } catch (e) {
13066
- if (!called) {
13067
- promise.reject(e);
13068
- }
13069
- return;
13070
- }
13071
-
13072
- promise.state = RESOLVED;
13073
- promise.value = x;
13074
- promise.notify();
13075
- }
13076
- };
13077
-
13078
- p$1.reject = function reject(reason) {
13079
- var promise = this;
13080
-
13081
- if (promise.state === PENDING) {
13082
- if (reason === promise) {
13083
- throw new TypeError('Promise settled with itself.');
13084
- }
13085
-
13086
- promise.state = REJECTED;
13087
- promise.value = reason;
13088
- promise.notify();
13089
- }
13090
- };
13091
-
13092
- p$1.notify = function notify() {
13093
- var promise = this;
13094
-
13095
- nextTick(function () {
13096
- if (promise.state !== PENDING) {
13097
- while (promise.deferred.length) {
13098
- var deferred = promise.deferred.shift(),
13099
- onResolved = deferred[0],
13100
- onRejected = deferred[1],
13101
- resolve = deferred[2],
13102
- reject = deferred[3];
13103
-
13104
- try {
13105
- if (promise.state === RESOLVED) {
13106
- if (typeof onResolved === 'function') {
13107
- resolve(onResolved.call(undefined, promise.value));
13108
- } else {
13109
- resolve(promise.value);
13110
- }
13111
- } else if (promise.state === REJECTED) {
13112
- if (typeof onRejected === 'function') {
13113
- resolve(onRejected.call(undefined, promise.value));
13114
- } else {
13115
- reject(promise.value);
13116
- }
13117
- }
13118
- } catch (e) {
13119
- reject(e);
13120
- }
13121
- }
13122
- }
13123
- });
13124
- };
13125
-
13126
- p$1.then = function then(onResolved, onRejected) {
13127
- var promise = this;
13128
-
13129
- return new Promise$1(function (resolve, reject) {
13130
- promise.deferred.push([onResolved, onRejected, resolve, reject]);
13131
- promise.notify();
13132
- });
13133
- };
13134
-
13135
- p$1.catch = function (onRejected) {
13136
- return this.then(undefined, onRejected);
13137
- };
13138
-
13139
- /**
13140
- * Promise adapter.
13141
- */
13142
-
13143
- if (typeof Promise === 'undefined') {
13144
- window.Promise = Promise$1;
13145
- }
13146
-
13147
- function PromiseObj(executor, context) {
13148
-
13149
- if (executor instanceof Promise) {
13150
- this.promise = executor;
13151
- } else {
13152
- this.promise = new Promise(executor.bind(context));
13153
- }
13154
-
13155
- this.context = context;
13156
- }
13157
-
13158
- PromiseObj.all = function (iterable, context) {
13159
- return new PromiseObj(Promise.all(iterable), context);
13160
- };
13161
-
13162
- PromiseObj.resolve = function (value, context) {
13163
- return new PromiseObj(Promise.resolve(value), context);
13164
- };
13165
-
13166
- PromiseObj.reject = function (reason, context) {
13167
- return new PromiseObj(Promise.reject(reason), context);
13168
- };
13169
-
13170
- PromiseObj.race = function (iterable, context) {
13171
- return new PromiseObj(Promise.race(iterable), context);
13172
- };
13173
-
13174
- var p = PromiseObj.prototype;
13175
-
13176
- p.bind = function (context) {
13177
- this.context = context;
13178
- return this;
13179
- };
13180
-
13181
- p.then = function (fulfilled, rejected) {
13182
-
13183
- if (fulfilled && fulfilled.bind && this.context) {
13184
- fulfilled = fulfilled.bind(this.context);
13185
- }
13186
-
13187
- if (rejected && rejected.bind && this.context) {
13188
- rejected = rejected.bind(this.context);
13189
- }
13190
-
13191
- return new PromiseObj(this.promise.then(fulfilled, rejected), this.context);
13192
- };
13193
-
13194
- p.catch = function (rejected) {
13195
-
13196
- if (rejected && rejected.bind && this.context) {
13197
- rejected = rejected.bind(this.context);
13198
- }
13199
-
13200
- return new PromiseObj(this.promise.catch(rejected), this.context);
13201
- };
13202
-
13203
- p.finally = function (callback) {
13204
-
13205
- return this.then(function (value) {
13206
- callback.call(this);
13207
- return value;
13208
- }, function (reason) {
13209
- callback.call(this);
13210
- return Promise.reject(reason);
13211
- }
13212
- );
13213
- };
13214
-
13215
- /**
13216
- * Utility functions.
13217
- */
13218
-
13219
- var ref = {};
13220
- var hasOwnProperty = ref.hasOwnProperty;
13221
-
13222
- var ref$1 = [];
13223
- var slice = ref$1.slice;
13224
- var debug = false;
13225
- var ntick;
13226
-
13227
- var inBrowser = typeof window !== 'undefined';
13228
-
13229
- var Util = function (ref) {
13230
- var config = ref.config;
13231
- var nextTick = ref.nextTick;
13232
-
13233
- ntick = nextTick;
13234
- debug = config.debug || !config.silent;
13235
- };
13236
-
13237
- function warn(msg) {
13238
- if (typeof console !== 'undefined' && debug) {
13239
- console.warn('[VueResource warn]: ' + msg);
13240
- }
13241
- }
13242
-
13243
- function error(msg) {
13244
- if (typeof console !== 'undefined') {
13245
- console.error(msg);
13246
- }
13247
- }
13248
-
13249
- function nextTick(cb, ctx) {
13250
- return ntick(cb, ctx);
13251
- }
13252
-
13253
- function trim(str) {
13254
- return str ? str.replace(/^\s*|\s*$/g, '') : '';
13255
- }
13256
-
13257
- function trimEnd(str, chars) {
13258
-
13259
- if (str && chars === undefined) {
13260
- return str.replace(/\s+$/, '');
13261
- }
13262
-
13263
- if (!str || !chars) {
13264
- return str;
13265
- }
13266
-
13267
- return str.replace(new RegExp(("[" + chars + "]+$")), '');
13268
- }
13269
-
13270
- function toLower(str) {
13271
- return str ? str.toLowerCase() : '';
13272
- }
13273
-
13274
- function toUpper(str) {
13275
- return str ? str.toUpperCase() : '';
13276
- }
13277
-
13278
- var isArray = Array.isArray;
13279
-
13280
- function isString(val) {
13281
- return typeof val === 'string';
13282
- }
13283
-
13284
-
13285
-
13286
- function isFunction(val) {
13287
- return typeof val === 'function';
13288
- }
13289
-
13290
- function isObject(obj) {
13291
- return obj !== null && typeof obj === 'object';
13292
- }
13293
-
13294
- function isPlainObject(obj) {
13295
- return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
13296
- }
13297
-
13298
- function isBlob(obj) {
13299
- return typeof Blob !== 'undefined' && obj instanceof Blob;
13300
- }
13301
-
13302
- function isFormData(obj) {
13303
- return typeof FormData !== 'undefined' && obj instanceof FormData;
13304
- }
13305
-
13306
- function when(value, fulfilled, rejected) {
13307
-
13308
- var promise = PromiseObj.resolve(value);
13309
-
13310
- if (arguments.length < 2) {
13311
- return promise;
13312
- }
13313
-
13314
- return promise.then(fulfilled, rejected);
13315
- }
13316
-
13317
- function options(fn, obj, opts) {
13318
-
13319
- opts = opts || {};
13320
-
13321
- if (isFunction(opts)) {
13322
- opts = opts.call(obj);
13323
- }
13324
-
13325
- return merge(fn.bind({$vm: obj, $options: opts}), fn, {$options: opts});
13326
- }
13327
-
13328
- function each(obj, iterator) {
13329
-
13330
- var i, key;
13331
-
13332
- if (isArray(obj)) {
13333
- for (i = 0; i < obj.length; i++) {
13334
- iterator.call(obj[i], obj[i], i);
13335
- }
13336
- } else if (isObject(obj)) {
13337
- for (key in obj) {
13338
- if (hasOwnProperty.call(obj, key)) {
13339
- iterator.call(obj[key], obj[key], key);
13340
- }
13341
- }
13342
- }
13343
-
13344
- return obj;
13345
- }
13346
-
13347
- var assign = Object.assign || _assign;
13348
-
13349
- function merge(target) {
13350
-
13351
- var args = slice.call(arguments, 1);
13352
-
13353
- args.forEach(function (source) {
13354
- _merge(target, source, true);
13355
- });
13356
-
13357
- return target;
13358
- }
13359
-
13360
- function defaults(target) {
13361
-
13362
- var args = slice.call(arguments, 1);
13363
-
13364
- args.forEach(function (source) {
13365
-
13366
- for (var key in source) {
13367
- if (target[key] === undefined) {
13368
- target[key] = source[key];
13369
- }
13370
- }
13371
-
13372
- });
13373
-
13374
- return target;
13375
- }
13376
-
13377
- function _assign(target) {
13378
-
13379
- var args = slice.call(arguments, 1);
13380
-
13381
- args.forEach(function (source) {
13382
- _merge(target, source);
13383
- });
13384
-
13385
- return target;
13386
- }
13387
-
13388
- function _merge(target, source, deep) {
13389
- for (var key in source) {
13390
- if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
13391
- if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
13392
- target[key] = {};
13393
- }
13394
- if (isArray(source[key]) && !isArray(target[key])) {
13395
- target[key] = [];
13396
- }
13397
- _merge(target[key], source[key], deep);
13398
- } else if (source[key] !== undefined) {
13399
- target[key] = source[key];
13400
- }
13401
- }
13402
- }
13403
-
13404
- /**
13405
- * Root Prefix Transform.
13406
- */
13407
-
13408
- var root = function (options$$1, next) {
13409
-
13410
- var url = next(options$$1);
13411
-
13412
- if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) {
13413
- url = trimEnd(options$$1.root, '/') + '/' + url;
13414
- }
13415
-
13416
- return url;
13417
- };
13418
-
13419
- /**
13420
- * Query Parameter Transform.
13421
- */
13422
-
13423
- var query = function (options$$1, next) {
13424
-
13425
- var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1);
13426
-
13427
- each(options$$1.params, function (value, key) {
13428
- if (urlParams.indexOf(key) === -1) {
13429
- query[key] = value;
13430
- }
13431
- });
13432
-
13433
- query = Url.params(query);
13434
-
13435
- if (query) {
13436
- url += (url.indexOf('?') == -1 ? '?' : '&') + query;
13437
- }
13438
-
13439
- return url;
13440
- };
13441
-
13442
- /**
13443
- * URL Template v2.0.6 (https://github.com/bramstein/url-template)
13444
- */
13445
-
13446
- function expand(url, params, variables) {
13447
-
13448
- var tmpl = parse(url), expanded = tmpl.expand(params);
13449
-
13450
- if (variables) {
13451
- variables.push.apply(variables, tmpl.vars);
13452
- }
13453
-
13454
- return expanded;
13455
- }
13456
-
13457
- function parse(template) {
13458
-
13459
- var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = [];
13460
-
13461
- return {
13462
- vars: variables,
13463
- expand: function expand(context) {
13464
- return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
13465
- if (expression) {
13466
-
13467
- var operator = null, values = [];
13468
-
13469
- if (operators.indexOf(expression.charAt(0)) !== -1) {
13470
- operator = expression.charAt(0);
13471
- expression = expression.substr(1);
13472
- }
13473
-
13474
- expression.split(/,/g).forEach(function (variable) {
13475
- var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
13476
- values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
13477
- variables.push(tmp[1]);
13478
- });
13479
-
13480
- if (operator && operator !== '+') {
13481
-
13482
- var separator = ',';
13483
-
13484
- if (operator === '?') {
13485
- separator = '&';
13486
- } else if (operator !== '#') {
13487
- separator = operator;
13488
- }
13489
-
13490
- return (values.length !== 0 ? operator : '') + values.join(separator);
13491
- } else {
13492
- return values.join(',');
13493
- }
13494
-
13495
- } else {
13496
- return encodeReserved(literal);
13497
- }
13498
- });
13499
- }
13500
- };
13501
- }
13502
-
13503
- function getValues(context, operator, key, modifier) {
13504
-
13505
- var value = context[key], result = [];
13506
-
13507
- if (isDefined(value) && value !== '') {
13508
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
13509
- value = value.toString();
13510
-
13511
- if (modifier && modifier !== '*') {
13512
- value = value.substring(0, parseInt(modifier, 10));
13513
- }
13514
-
13515
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
13516
- } else {
13517
- if (modifier === '*') {
13518
- if (Array.isArray(value)) {
13519
- value.filter(isDefined).forEach(function (value) {
13520
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
13521
- });
13522
- } else {
13523
- Object.keys(value).forEach(function (k) {
13524
- if (isDefined(value[k])) {
13525
- result.push(encodeValue(operator, value[k], k));
13526
- }
13527
- });
13528
- }
13529
- } else {
13530
- var tmp = [];
13531
-
13532
- if (Array.isArray(value)) {
13533
- value.filter(isDefined).forEach(function (value) {
13534
- tmp.push(encodeValue(operator, value));
13535
- });
13536
- } else {
13537
- Object.keys(value).forEach(function (k) {
13538
- if (isDefined(value[k])) {
13539
- tmp.push(encodeURIComponent(k));
13540
- tmp.push(encodeValue(operator, value[k].toString()));
13541
- }
13542
- });
13543
- }
13544
-
13545
- if (isKeyOperator(operator)) {
13546
- result.push(encodeURIComponent(key) + '=' + tmp.join(','));
13547
- } else if (tmp.length !== 0) {
13548
- result.push(tmp.join(','));
13549
- }
13550
- }
13551
- }
13552
- } else {
13553
- if (operator === ';') {
13554
- result.push(encodeURIComponent(key));
13555
- } else if (value === '' && (operator === '&' || operator === '?')) {
13556
- result.push(encodeURIComponent(key) + '=');
13557
- } else if (value === '') {
13558
- result.push('');
13559
- }
13560
- }
13561
-
13562
- return result;
13563
- }
13564
-
13565
- function isDefined(value) {
13566
- return value !== undefined && value !== null;
13567
- }
13568
-
13569
- function isKeyOperator(operator) {
13570
- return operator === ';' || operator === '&' || operator === '?';
13571
- }
13572
-
13573
- function encodeValue(operator, value, key) {
13574
-
13575
- value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeURIComponent(value);
13576
-
13577
- if (key) {
13578
- return encodeURIComponent(key) + '=' + value;
13579
- } else {
13580
- return value;
13581
- }
13582
- }
13583
-
13584
- function encodeReserved(str) {
13585
- return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
13586
- if (!/%[0-9A-Fa-f]/.test(part)) {
13587
- part = encodeURI(part);
13588
- }
13589
- return part;
13590
- }).join('');
13591
- }
13592
-
13593
- /**
13594
- * URL Template (RFC 6570) Transform.
13595
- */
13596
-
13597
- var template = function (options) {
13598
-
13599
- var variables = [], url = expand(options.url, options.params, variables);
13600
-
13601
- variables.forEach(function (key) {
13602
- delete options.params[key];
13603
- });
13604
-
13605
- return url;
13606
- };
13607
-
13608
- /**
13609
- * Service for URL templating.
13610
- */
13611
-
13612
- function Url(url, params) {
13613
-
13614
- var self = this || {}, options$$1 = url, transform;
13615
-
13616
- if (isString(url)) {
13617
- options$$1 = {url: url, params: params};
13618
- }
13619
-
13620
- options$$1 = merge({}, Url.options, self.$options, options$$1);
13621
-
13622
- Url.transforms.forEach(function (handler) {
13623
-
13624
- if (isString(handler)) {
13625
- handler = Url.transform[handler];
13626
- }
13627
-
13628
- if (isFunction(handler)) {
13629
- transform = factory(handler, transform, self.$vm);
13630
- }
13631
-
13632
- });
13633
-
13634
- return transform(options$$1);
13635
- }
13636
-
13637
- /**
13638
- * Url options.
13639
- */
13640
-
13641
- Url.options = {
13642
- url: '',
13643
- root: null,
13644
- params: {}
13645
- };
13646
-
13647
- /**
13648
- * Url transforms.
13649
- */
13650
-
13651
- Url.transform = {template: template, query: query, root: root};
13652
- Url.transforms = ['template', 'query', 'root'];
13653
-
13654
- /**
13655
- * Encodes a Url parameter string.
13656
- *
13657
- * @param {Object} obj
13658
- */
13659
-
13660
- Url.params = function (obj) {
13661
-
13662
- var params = [], escape = encodeURIComponent;
13663
-
13664
- params.add = function (key, value) {
13665
-
13666
- if (isFunction(value)) {
13667
- value = value();
13668
- }
13669
-
13670
- if (value === null) {
13671
- value = '';
13672
- }
13673
-
13674
- this.push(escape(key) + '=' + escape(value));
13675
- };
13676
-
13677
- serialize(params, obj);
13678
-
13679
- return params.join('&').replace(/%20/g, '+');
13680
- };
13681
-
13682
- /**
13683
- * Parse a URL and return its components.
13684
- *
13685
- * @param {String} url
13686
- */
13687
-
13688
- Url.parse = function (url) {
13689
-
13690
- var el = document.createElement('a');
13691
-
13692
- if (document.documentMode) {
13693
- el.href = url;
13694
- url = el.href;
13695
- }
13696
-
13697
- el.href = url;
13698
-
13699
- return {
13700
- href: el.href,
13701
- protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
13702
- port: el.port,
13703
- host: el.host,
13704
- hostname: el.hostname,
13705
- pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
13706
- search: el.search ? el.search.replace(/^\?/, '') : '',
13707
- hash: el.hash ? el.hash.replace(/^#/, '') : ''
13708
- };
13709
- };
13710
-
13711
- function factory(handler, next, vm) {
13712
- return function (options$$1) {
13713
- return handler.call(vm, options$$1, next);
13714
- };
13715
- }
13716
-
13717
- function serialize(params, obj, scope) {
13718
-
13719
- var array = isArray(obj), plain = isPlainObject(obj), hash;
13720
-
13721
- each(obj, function (value, key) {
13722
-
13723
- hash = isObject(value) || isArray(value);
13724
-
13725
- if (scope) {
13726
- key = scope + '[' + (plain || hash ? key : '') + ']';
13727
- }
13728
-
13729
- if (!scope && array) {
13730
- params.add(value.name, value.value);
13731
- } else if (hash) {
13732
- serialize(params, value, key);
13733
- } else {
13734
- params.add(key, value);
13735
- }
13736
- });
13737
- }
13738
-
13739
- /**
13740
- * XDomain client (Internet Explorer).
13741
- */
13742
-
13743
- var xdrClient = function (request) {
13744
- return new PromiseObj(function (resolve) {
13745
-
13746
- var xdr = new XDomainRequest(), handler = function (ref) {
13747
- var type = ref.type;
13748
-
13749
-
13750
- var status = 0;
13751
-
13752
- if (type === 'load') {
13753
- status = 200;
13754
- } else if (type === 'error') {
13755
- status = 500;
13756
- }
13757
-
13758
- resolve(request.respondWith(xdr.responseText, {status: status}));
13759
- };
13760
-
13761
- request.abort = function () { return xdr.abort(); };
13762
-
13763
- xdr.open(request.method, request.getUrl());
13764
-
13765
- if (request.timeout) {
13766
- xdr.timeout = request.timeout;
13767
- }
13768
-
13769
- xdr.onload = handler;
13770
- xdr.onabort = handler;
13771
- xdr.onerror = handler;
13772
- xdr.ontimeout = handler;
13773
- xdr.onprogress = function () {};
13774
- xdr.send(request.getBody());
13775
- });
13776
- };
13777
-
13778
- /**
13779
- * CORS Interceptor.
13780
- */
13781
-
13782
- var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();
13783
-
13784
- var cors = function (request, next) {
13785
-
13786
- if (inBrowser) {
13787
-
13788
- var orgUrl = Url.parse(location.href);
13789
- var reqUrl = Url.parse(request.getUrl());
13790
-
13791
- if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {
13792
-
13793
- request.crossOrigin = true;
13794
- request.emulateHTTP = false;
13795
-
13796
- if (!SUPPORTS_CORS) {
13797
- request.client = xdrClient;
13798
- }
13799
- }
13800
- }
13801
-
13802
- next();
13803
- };
13804
-
13805
- /**
13806
- * Form data Interceptor.
13807
- */
13808
-
13809
- var form = function (request, next) {
13810
-
13811
- if (isFormData(request.body)) {
13812
-
13813
- request.headers.delete('Content-Type');
13814
-
13815
- } else if (isObject(request.body) && request.emulateJSON) {
13816
-
13817
- request.body = Url.params(request.body);
13818
- request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
13819
- }
13820
-
13821
- next();
13822
- };
13823
-
13824
- /**
13825
- * JSON Interceptor.
13826
- */
13827
-
13828
- var json = function (request, next) {
13829
-
13830
- var type = request.headers.get('Content-Type') || '';
13831
-
13832
- if (isObject(request.body) && type.indexOf('application/json') === 0) {
13833
- request.body = JSON.stringify(request.body);
13834
- }
13835
-
13836
- next(function (response) {
13837
-
13838
- return response.bodyText ? when(response.text(), function (text) {
13839
-
13840
- type = response.headers.get('Content-Type') || '';
13841
-
13842
- if (type.indexOf('application/json') === 0 || isJson(text)) {
13843
-
13844
- try {
13845
- response.body = JSON.parse(text);
13846
- } catch (e) {
13847
- response.body = null;
13848
- }
13849
-
13850
- } else {
13851
- response.body = text;
13852
- }
13853
-
13854
- return response;
13855
-
13856
- }) : response;
13857
-
13858
- });
13859
- };
13860
-
13861
- function isJson(str) {
13862
-
13863
- var start = str.match(/^\[|^\{(?!\{)/), end = {'[': /]$/, '{': /}$/};
13864
-
13865
- return start && end[start[0]].test(str);
13866
- }
13867
-
13868
- /**
13869
- * JSONP client (Browser).
13870
- */
13871
-
13872
- var jsonpClient = function (request) {
13873
- return new PromiseObj(function (resolve) {
13874
-
13875
- var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script;
13876
-
13877
- handler = function (ref) {
13878
- var type = ref.type;
13879
-
13880
-
13881
- var status = 0;
13882
-
13883
- if (type === 'load' && body !== null) {
13884
- status = 200;
13885
- } else if (type === 'error') {
13886
- status = 500;
13887
- }
13888
-
13889
- if (status && window[callback]) {
13890
- delete window[callback];
13891
- document.body.removeChild(script);
13892
- }
13893
-
13894
- resolve(request.respondWith(body, {status: status}));
13895
- };
13896
-
13897
- window[callback] = function (result) {
13898
- body = JSON.stringify(result);
13899
- };
13900
-
13901
- request.abort = function () {
13902
- handler({type: 'abort'});
13903
- };
13904
-
13905
- request.params[name] = callback;
13906
-
13907
- if (request.timeout) {
13908
- setTimeout(request.abort, request.timeout);
13909
- }
13910
-
13911
- script = document.createElement('script');
13912
- script.src = request.getUrl();
13913
- script.type = 'text/javascript';
13914
- script.async = true;
13915
- script.onload = handler;
13916
- script.onerror = handler;
13917
-
13918
- document.body.appendChild(script);
13919
- });
13920
- };
13921
-
13922
- /**
13923
- * JSONP Interceptor.
13924
- */
13925
-
13926
- var jsonp = function (request, next) {
13927
-
13928
- if (request.method == 'JSONP') {
13929
- request.client = jsonpClient;
13930
- }
13931
-
13932
- next();
13933
- };
13934
-
13935
- /**
13936
- * Before Interceptor.
13937
- */
13938
-
13939
- var before = function (request, next) {
13940
-
13941
- if (isFunction(request.before)) {
13942
- request.before.call(this, request);
13943
- }
13944
-
13945
- next();
13946
- };
13947
-
13948
- /**
13949
- * HTTP method override Interceptor.
13950
- */
13951
-
13952
- var method = function (request, next) {
13953
-
13954
- if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
13955
- request.headers.set('X-HTTP-Method-Override', request.method);
13956
- request.method = 'POST';
13957
- }
13958
-
13959
- next();
13960
- };
13961
-
13962
- /**
13963
- * Header Interceptor.
13964
- */
13965
-
13966
- var header = function (request, next) {
13967
-
13968
- var headers = assign({}, Http.headers.common,
13969
- !request.crossOrigin ? Http.headers.custom : {},
13970
- Http.headers[toLower(request.method)]
13971
- );
13972
-
13973
- each(headers, function (value, name) {
13974
- if (!request.headers.has(name)) {
13975
- request.headers.set(name, value);
13976
- }
13977
- });
13978
-
13979
- next();
13980
- };
13981
-
13982
- /**
13983
- * XMLHttp client (Browser).
13984
- */
13985
-
13986
- var xhrClient = function (request) {
13987
- return new PromiseObj(function (resolve) {
13988
-
13989
- var xhr = new XMLHttpRequest(), handler = function (event) {
13990
-
13991
- var response = request.respondWith(
13992
- 'response' in xhr ? xhr.response : xhr.responseText, {
13993
- status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
13994
- statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
13995
- }
13996
- );
13997
-
13998
- each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
13999
- response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
14000
- });
14001
-
14002
- resolve(response);
14003
- };
14004
-
14005
- request.abort = function () { return xhr.abort(); };
14006
-
14007
- if (request.progress) {
14008
- if (request.method === 'GET') {
14009
- xhr.addEventListener('progress', request.progress);
14010
- } else if (/^(POST|PUT)$/i.test(request.method)) {
14011
- xhr.upload.addEventListener('progress', request.progress);
14012
- }
14013
- }
14014
-
14015
- xhr.open(request.method, request.getUrl(), true);
14016
-
14017
- if (request.timeout) {
14018
- xhr.timeout = request.timeout;
14019
- }
14020
-
14021
- if (request.responseType && 'responseType' in xhr) {
14022
- xhr.responseType = request.responseType;
14023
- }
14024
-
14025
- if (request.withCredentials || request.credentials) {
14026
- xhr.withCredentials = true;
14027
- }
14028
-
14029
- if (!request.crossOrigin) {
14030
- request.headers.set('X-Requested-With', 'XMLHttpRequest');
14031
- }
14032
-
14033
- request.headers.forEach(function (value, name) {
14034
- xhr.setRequestHeader(name, value);
14035
- });
14036
-
14037
- xhr.onload = handler;
14038
- xhr.onabort = handler;
14039
- xhr.onerror = handler;
14040
- xhr.ontimeout = handler;
14041
- xhr.send(request.getBody());
14042
- });
14043
- };
14044
-
14045
- /**
14046
- * Http client (Node).
14047
- */
14048
-
14049
- var nodeClient = function (request) {
14050
-
14051
- var client = require('got');
14052
-
14053
- return new PromiseObj(function (resolve) {
14054
-
14055
- var url = request.getUrl();
14056
- var body = request.getBody();
14057
- var method = request.method;
14058
- var headers = {}, handler;
14059
-
14060
- request.headers.forEach(function (value, name) {
14061
- headers[name] = value;
14062
- });
14063
-
14064
- client(url, {body: body, method: method, headers: headers}).then(handler = function (resp) {
14065
-
14066
- var response = request.respondWith(resp.body, {
14067
- status: resp.statusCode,
14068
- statusText: trim(resp.statusMessage)
14069
- }
14070
- );
14071
-
14072
- each(resp.headers, function (value, name) {
14073
- response.headers.set(name, value);
14074
- });
14075
-
14076
- resolve(response);
14077
-
14078
- }, function (error$$1) { return handler(error$$1.response); });
14079
- });
14080
- };
14081
-
14082
- /**
14083
- * Base client.
14084
- */
14085
-
14086
- var Client = function (context) {
14087
-
14088
- var reqHandlers = [sendRequest], resHandlers = [], handler;
14089
-
14090
- if (!isObject(context)) {
14091
- context = null;
14092
- }
14093
-
14094
- function Client(request) {
14095
- return new PromiseObj(function (resolve, reject) {
14096
-
14097
- function exec() {
14098
-
14099
- handler = reqHandlers.pop();
14100
-
14101
- if (isFunction(handler)) {
14102
- handler.call(context, request, next);
14103
- } else {
14104
- warn(("Invalid interceptor of type " + (typeof handler) + ", must be a function"));
14105
- next();
14106
- }
14107
- }
14108
-
14109
- function next(response) {
14110
-
14111
- if (isFunction(response)) {
14112
-
14113
- resHandlers.unshift(response);
14114
-
14115
- } else if (isObject(response)) {
14116
-
14117
- resHandlers.forEach(function (handler) {
14118
- response = when(response, function (response) {
14119
- return handler.call(context, response) || response;
14120
- }, reject);
14121
- });
14122
-
14123
- when(response, resolve, reject);
14124
-
14125
- return;
14126
- }
14127
-
14128
- exec();
14129
- }
14130
-
14131
- exec();
14132
-
14133
- }, context);
14134
- }
14135
-
14136
- Client.use = function (handler) {
14137
- reqHandlers.push(handler);
14138
- };
14139
-
14140
- return Client;
14141
- };
14142
-
14143
- function sendRequest(request, resolve) {
14144
-
14145
- var client = request.client || (inBrowser ? xhrClient : nodeClient);
14146
-
14147
- resolve(client(request));
14148
- }
14149
-
14150
- /**
14151
- * HTTP Headers.
14152
- */
14153
-
14154
- var Headers = function Headers(headers) {
14155
- var this$1 = this;
14156
-
14157
-
14158
- this.map = {};
14159
-
14160
- each(headers, function (value, name) { return this$1.append(name, value); });
14161
- };
14162
-
14163
- Headers.prototype.has = function has (name) {
14164
- return getName(this.map, name) !== null;
14165
- };
14166
-
14167
- Headers.prototype.get = function get (name) {
14168
-
14169
- var list = this.map[getName(this.map, name)];
14170
-
14171
- return list ? list.join() : null;
14172
- };
14173
-
14174
- Headers.prototype.getAll = function getAll (name) {
14175
- return this.map[getName(this.map, name)] || [];
14176
- };
14177
-
14178
- Headers.prototype.set = function set (name, value) {
14179
- this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
14180
- };
14181
-
14182
- Headers.prototype.append = function append (name, value){
14183
-
14184
- var list = this.map[getName(this.map, name)];
14185
-
14186
- if (list) {
14187
- list.push(trim(value));
14188
- } else {
14189
- this.set(name, value);
14190
- }
14191
- };
14192
-
14193
- Headers.prototype.delete = function delete$1 (name){
14194
- delete this.map[getName(this.map, name)];
14195
- };
14196
-
14197
- Headers.prototype.deleteAll = function deleteAll (){
14198
- this.map = {};
14199
- };
14200
-
14201
- Headers.prototype.forEach = function forEach (callback, thisArg) {
14202
- var this$1 = this;
14203
-
14204
- each(this.map, function (list, name) {
14205
- each(list, function (value) { return callback.call(thisArg, value, name, this$1); });
14206
- });
14207
- };
14208
-
14209
- function getName(map, name) {
14210
- return Object.keys(map).reduce(function (prev, curr) {
14211
- return toLower(name) === toLower(curr) ? curr : prev;
14212
- }, null);
14213
- }
14214
-
14215
- function normalizeName(name) {
14216
-
14217
- if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
14218
- throw new TypeError('Invalid character in header field name');
14219
- }
14220
-
14221
- return trim(name);
14222
- }
14223
-
14224
- /**
14225
- * HTTP Response.
14226
- */
14227
-
14228
- var Response = function Response(body, ref) {
14229
- var url = ref.url;
14230
- var headers = ref.headers;
14231
- var status = ref.status;
14232
- var statusText = ref.statusText;
14233
-
14234
-
14235
- this.url = url;
14236
- this.ok = status >= 200 && status < 300;
14237
- this.status = status || 0;
14238
- this.statusText = statusText || '';
14239
- this.headers = new Headers(headers);
14240
- this.body = body;
14241
-
14242
- if (isString(body)) {
14243
-
14244
- this.bodyText = body;
14245
-
14246
- } else if (isBlob(body)) {
14247
-
14248
- this.bodyBlob = body;
14249
-
14250
- if (isBlobText(body)) {
14251
- this.bodyText = blobText(body);
14252
- }
14253
- }
14254
- };
14255
-
14256
- Response.prototype.blob = function blob () {
14257
- return when(this.bodyBlob);
14258
- };
14259
-
14260
- Response.prototype.text = function text () {
14261
- return when(this.bodyText);
14262
- };
14263
-
14264
- Response.prototype.json = function json () {
14265
- return when(this.text(), function (text) { return JSON.parse(text); });
14266
- };
14267
-
14268
- Object.defineProperty(Response.prototype, 'data', {
14269
-
14270
- get: function get() {
14271
- return this.body;
14272
- },
14273
-
14274
- set: function set(body) {
14275
- this.body = body;
14276
- }
14277
-
14278
- });
14279
-
14280
- function blobText(body) {
14281
- return new PromiseObj(function (resolve) {
14282
-
14283
- var reader = new FileReader();
14284
-
14285
- reader.readAsText(body);
14286
- reader.onload = function () {
14287
- resolve(reader.result);
14288
- };
14289
-
14290
- });
14291
- }
14292
-
14293
- function isBlobText(body) {
14294
- return body.type.indexOf('text') === 0 || body.type.indexOf('json') !== -1;
14295
- }
14296
-
14297
- /**
14298
- * HTTP Request.
14299
- */
14300
-
14301
- var Request = function Request(options$$1) {
14302
-
14303
- this.body = null;
14304
- this.params = {};
14305
-
14306
- assign(this, options$$1, {
14307
- method: toUpper(options$$1.method || 'GET')
14308
- });
14309
-
14310
- if (!(this.headers instanceof Headers)) {
14311
- this.headers = new Headers(this.headers);
14312
- }
14313
- };
14314
-
14315
- Request.prototype.getUrl = function getUrl (){
14316
- return Url(this);
14317
- };
14318
-
14319
- Request.prototype.getBody = function getBody (){
14320
- return this.body;
14321
- };
14322
-
14323
- Request.prototype.respondWith = function respondWith (body, options$$1) {
14324
- return new Response(body, assign(options$$1 || {}, {url: this.getUrl()}));
14325
- };
14326
-
14327
- /**
14328
- * Service for sending network requests.
14329
- */
14330
-
14331
- var COMMON_HEADERS = {'Accept': 'application/json, text/plain, */*'};
14332
- var JSON_CONTENT_TYPE = {'Content-Type': 'application/json;charset=utf-8'};
14333
-
14334
- function Http(options$$1) {
14335
-
14336
- var self = this || {}, client = Client(self.$vm);
14337
-
14338
- defaults(options$$1 || {}, self.$options, Http.options);
14339
-
14340
- Http.interceptors.forEach(function (handler) {
14341
-
14342
- if (isString(handler)) {
14343
- handler = Http.interceptor[handler];
14344
- }
14345
-
14346
- if (isFunction(handler)) {
14347
- client.use(handler);
14348
- }
14349
-
14350
- });
14351
-
14352
- return client(new Request(options$$1)).then(function (response) {
14353
-
14354
- return response.ok ? response : PromiseObj.reject(response);
14355
-
14356
- }, function (response) {
14357
-
14358
- if (response instanceof Error) {
14359
- error(response);
14360
- }
14361
-
14362
- return PromiseObj.reject(response);
14363
- });
14364
- }
14365
-
14366
- Http.options = {};
14367
-
14368
- Http.headers = {
14369
- put: JSON_CONTENT_TYPE,
14370
- post: JSON_CONTENT_TYPE,
14371
- patch: JSON_CONTENT_TYPE,
14372
- delete: JSON_CONTENT_TYPE,
14373
- common: COMMON_HEADERS,
14374
- custom: {}
14375
- };
14376
-
14377
- Http.interceptor = {before: before, method: method, jsonp: jsonp, json: json, form: form, header: header, cors: cors};
14378
- Http.interceptors = ['before', 'method', 'jsonp', 'json', 'form', 'header', 'cors'];
14379
-
14380
- ['get', 'delete', 'head', 'jsonp'].forEach(function (method$$1) {
14381
-
14382
- Http[method$$1] = function (url, options$$1) {
14383
- return this(assign(options$$1 || {}, {url: url, method: method$$1}));
14384
- };
14385
-
14386
- });
14387
-
14388
- ['post', 'put', 'patch'].forEach(function (method$$1) {
14389
-
14390
- Http[method$$1] = function (url, body, options$$1) {
14391
- return this(assign(options$$1 || {}, {url: url, method: method$$1, body: body}));
14392
- };
14393
-
14394
- });
14395
-
14396
- /**
14397
- * Service for interacting with RESTful services.
14398
- */
14399
-
14400
- function Resource(url, params, actions, options$$1) {
14401
-
14402
- var self = this || {}, resource = {};
14403
-
14404
- actions = assign({},
14405
- Resource.actions,
14406
- actions
14407
- );
14408
-
14409
- each(actions, function (action, name) {
14410
-
14411
- action = merge({url: url, params: assign({}, params)}, options$$1, action);
14412
-
14413
- resource[name] = function () {
14414
- return (self.$http || Http)(opts(action, arguments));
14415
- };
14416
- });
14417
-
14418
- return resource;
14419
- }
14420
-
14421
- function opts(action, args) {
14422
-
14423
- var options$$1 = assign({}, action), params = {}, body;
14424
-
14425
- switch (args.length) {
14426
-
14427
- case 2:
14428
-
14429
- params = args[0];
14430
- body = args[1];
14431
-
14432
- break;
14433
-
14434
- case 1:
14435
-
14436
- if (/^(POST|PUT|PATCH)$/i.test(options$$1.method)) {
14437
- body = args[0];
14438
- } else {
14439
- params = args[0];
14440
- }
14441
-
14442
- break;
14443
-
14444
- case 0:
14445
-
14446
- break;
14447
-
14448
- default:
14449
-
14450
- throw 'Expected up to 2 arguments [params, body], got ' + args.length + ' arguments';
14451
- }
14452
-
14453
- options$$1.body = body;
14454
- options$$1.params = assign({}, options$$1.params, params);
14455
-
14456
- return options$$1;
14457
- }
14458
-
14459
- Resource.actions = {
14460
-
14461
- get: {method: 'GET'},
14462
- save: {method: 'POST'},
14463
- query: {method: 'GET'},
14464
- update: {method: 'PUT'},
14465
- remove: {method: 'DELETE'},
14466
- delete: {method: 'DELETE'}
14467
-
14468
- };
14469
-
14470
- /**
14471
- * Install plugin.
14472
- */
14473
-
14474
- function plugin(Vue) {
14475
-
14476
- if (plugin.installed) {
14477
- return;
14478
- }
14479
-
14480
- Util(Vue);
14481
-
14482
- Vue.url = Url;
14483
- Vue.http = Http;
14484
- Vue.resource = Resource;
14485
- Vue.Promise = PromiseObj;
14486
-
14487
- Object.defineProperties(Vue.prototype, {
14488
-
14489
- $url: {
14490
- get: function get() {
14491
- return options(Vue.url, this, this.$options.url);
14492
- }
14493
- },
14494
-
14495
- $http: {
14496
- get: function get() {
14497
- return options(Vue.http, this, this.$options.http);
14498
- }
14499
- },
14500
-
14501
- $resource: {
14502
- get: function get() {
14503
- return Vue.resource.bind(this);
14504
- }
14505
- },
14506
-
14507
- $promise: {
14508
- get: function get() {
14509
- var this$1 = this;
14510
-
14511
- return function (executor) { return new Vue.Promise(executor, this$1); };
14512
- }
14513
- }
14514
-
14515
- });
14516
- }
14517
-
14518
- if (typeof window !== 'undefined' && window.Vue) {
14519
- window.Vue.use(plugin);
14520
- }
14521
-
14522
- return plugin;
14523
-
14524
- })));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,(function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function o(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function i(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return a.call(e).slice(8,-1)}function c(e){return"[object Object]"===a.call(e)}function u(e){return"[object RegExp]"===a.call(e)}function l(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function f(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function p(e){return null==e?"":Array.isArray(e)||c(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function d(e){var t=parseFloat(e);return isNaN(t)?e:t}function v(e,t){for(var n=Object.create(null),r=e.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var h=v("slot,component",!0),m=v("key,ref,slot,slot-scope,is");function y(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var g=Object.prototype.hasOwnProperty;function b(e,t){return g.call(e,t)}function _(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var w=/-(\w)/g,x=_((function(e){return e.replace(w,(function(e,t){return t?t.toUpperCase():""}))})),$=_((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),C=/\B([A-Z])/g,k=_((function(e){return e.replace(C,"-$1").toLowerCase()})),A=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function O(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function S(e,t){for(var n in t)e[n]=t[n];return e}function T(e){for(var t={},n=0;n<e.length;n++)e[n]&&S(t,e[n]);return t}function j(e,t,n){}var E=function(e,t,n){return!1},M=function(e){return e};function N(e,t){if(e===t)return!0;var n=i(e),r=i(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var o=Array.isArray(e),a=Array.isArray(t);if(o&&a)return e.length===t.length&&e.every((function(e,n){return N(e,t[n])}));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(o||a)return!1;var s=Object.keys(e),c=Object.keys(t);return s.length===c.length&&s.every((function(n){return N(e[n],t[n])}))}catch(e){return!1}}function P(e,t){for(var n=0;n<e.length;n++)if(N(e[n],t))return n;return-1}function I(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var L="data-server-rendered",D=["component","directive","filter"],R=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],F={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!0,devtools:!0,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:E,isReservedAttr:E,isUnknownElement:E,getTagNamespace:j,parsePlatformTagName:M,mustUseProp:E,async:!0,_lifecycleHooks:R},U=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function H(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function V(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var B,q=new RegExp("[^"+U.source+".$_\\d]"),z="__proto__"in{},J="undefined"!=typeof window,G="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,K=G&&WXEnvironment.platform.toLowerCase(),W=J&&window.navigator.userAgent.toLowerCase(),X=W&&/msie|trident/.test(W),Z=W&&W.indexOf("msie 9.0")>0,Y=W&&W.indexOf("edge/")>0,Q=(W&&W.indexOf("android"),W&&/iphone|ipad|ipod|ios/.test(W)||"ios"===K),ee=(W&&/chrome\/\d+/.test(W),W&&/phantomjs/.test(W),W&&W.match(/firefox\/(\d+)/)),te={}.watch,ne=!1;if(J)try{var re={};Object.defineProperty(re,"passive",{get:function(){ne=!0}}),window.addEventListener("test-passive",null,re)}catch(e){}var oe=function(){return void 0===B&&(B=!J&&!G&&"undefined"!=typeof global&&global.process&&"server"===global.process.env.VUE_ENV),B},ie=J&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ae(e){return"function"==typeof e&&/native code/.test(e.toString())}var se,ce="undefined"!=typeof Symbol&&ae(Symbol)&&"undefined"!=typeof Reflect&&ae(Reflect.ownKeys);se="undefined"!=typeof Set&&ae(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ue,le,fe,pe=j,de="undefined"!=typeof console,ve=/(?:^|[-_])(\w)/g;ue=function(e,t){var n=t?pe(t):"";F.warnHandler?F.warnHandler.call(null,e,t,n):de&&!F.silent&&console.error("[Vue warn]: "+e+n)},le=function(e,t){de&&!F.silent&&console.warn("[Vue tip]: "+e+(t?pe(t):""))},fe=function(e,t){if(e.$root===e)return"<Root>";var n="function"==typeof e&&null!=e.cid?e.options:e._isVue?e.$options||e.constructor.options:e,r=n.name||n._componentTag,o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<"+function(e){return e.replace(ve,(function(e){return e.toUpperCase()})).replace(/[-_]/g,"")}(r)+">":"<Anonymous>")+(o&&!1!==t?" at "+o:"")},pe=function(e){if(e._isVue&&e.$parent){for(var t=[],n=0;e;){if(t.length>0){var r=t[t.length-1];if(r.constructor===e.constructor){n++,e=e.$parent;continue}n>0&&(t[t.length-1]=[r,n],n=0)}t.push(e),e=e.$parent}return"\n\nfound in\n\n"+t.map((function(e,t){return""+(0===t?"---\x3e ":function(e,t){for(var n="";t;)t%2==1&&(n+=e),t>1&&(e+=e),t>>=1;return n}(" ",5+2*t))+(Array.isArray(e)?fe(e[0])+"... ("+e[1]+" recursive calls)":fe(e))})).join("\n")}return"\n\n(found in "+fe(e)+")"};var he=0,me=function(){this.id=he++,this.subs=[]};me.prototype.addSub=function(e){this.subs.push(e)},me.prototype.removeSub=function(e){y(this.subs,e)},me.prototype.depend=function(){me.target&&me.target.addDep(this)},me.prototype.notify=function(){var e=this.subs.slice();F.async||e.sort((function(e,t){return e.id-t.id}));for(var t=0,n=e.length;t<n;t++)e[t].update()},me.target=null;var ye=[];function ge(e){ye.push(e),me.target=e}function be(){ye.pop(),me.target=ye[ye.length-1]}var _e=function(e,t,n,r,o,i,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},we={child:{configurable:!0}};we.child.get=function(){return this.componentInstance},Object.defineProperties(_e.prototype,we);var xe=function(e){void 0===e&&(e="");var t=new _e;return t.text=e,t.isComment=!0,t};function $e(e){return new _e(void 0,void 0,void 0,String(e))}function Ce(e){var t=new _e(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ke=Array.prototype,Ae=Object.create(ke);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(e){var t=ke[e];V(Ae,e,(function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var o,i=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":o=n;break;case"splice":o=n.slice(2)}return o&&a.observeArray(o),a.dep.notify(),i}))}));var Oe=Object.getOwnPropertyNames(Ae),Se=!0;function Te(e){Se=e}var je=function(e){this.value=e,this.dep=new me,this.vmCount=0,V(e,"__ob__",this),Array.isArray(e)?(z?function(e,t){e.__proto__=t}(e,Ae):function(e,t,n){for(var r=0,o=n.length;r<o;r++){var i=n[r];V(e,i,t[i])}}(e,Ae,Oe),this.observeArray(e)):this.walk(e)};function Ee(e,t){var n;if(i(e)&&!(e instanceof _e))return b(e,"__ob__")&&e.__ob__ instanceof je?n=e.__ob__:Se&&!oe()&&(Array.isArray(e)||c(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new je(e)),t&&n&&n.vmCount++,n}function Me(e,t,n,r,o){var i=new me,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!o&&Ee(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return me.target&&(i.depend(),u&&(u.dep.depend(),Array.isArray(t)&&Ie(t))),t},set:function(t){var a=s?s.call(e):n;t===a||t!=t&&a!=a||(r&&r(),s&&!c||(c?c.call(e,t):n=t,u=!o&&Ee(t),i.notify()))}})}}function Ne(e,n,r){if((t(e)||o(e))&&ue("Cannot set reactive property on undefined, null, or primitive value: "+e),Array.isArray(e)&&l(n))return e.length=Math.max(e.length,n),e.splice(n,1,r),r;if(n in e&&!(n in Object.prototype))return e[n]=r,r;var i=e.__ob__;return e._isVue||i&&i.vmCount?(ue("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),r):i?(Me(i.value,n,r),i.dep.notify(),r):(e[n]=r,r)}function Pe(e,n){if((t(e)||o(e))&&ue("Cannot delete reactive property on undefined, null, or primitive value: "+e),Array.isArray(e)&&l(n))e.splice(n,1);else{var r=e.__ob__;e._isVue||r&&r.vmCount?ue("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):b(e,n)&&(delete e[n],r&&r.dep.notify())}}function Ie(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&Ie(t)}je.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Me(e,t[n])},je.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ee(e[t])};var Le=F.optionMergeStrategies;function De(e,t){if(!t)return e;for(var n,r,o,i=ce?Reflect.ownKeys(t):Object.keys(t),a=0;a<i.length;a++)"__ob__"!==(n=i[a])&&(r=e[n],o=t[n],b(e,n)?r!==o&&c(r)&&c(o)&&De(r,o):Ne(e,n,o));return e}function Re(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,o="function"==typeof e?e.call(n,n):e;return r?De(r,o):o}:t?e?function(){return De("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function Fe(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Ue(e,t,n,r){var o=Object.create(e||null);return t?(Be(r,t,n),S(o,t)):o}Le.el=Le.propsData=function(e,t,n,r){return n||ue('option "'+r+'" can only be used during instance creation with the `new` keyword.'),He(e,t)},Le.data=function(e,t,n){return n?Re(e,t,n):t&&"function"!=typeof t?(ue('The "data" option should be a function that returns a per-instance value in component definitions.',n),e):Re(e,t)},R.forEach((function(e){Le[e]=Fe})),D.forEach((function(e){Le[e+"s"]=Ue})),Le.watch=function(e,t,n,r){if(e===te&&(e=void 0),t===te&&(t=void 0),!t)return Object.create(e||null);if(Be(r,t,n),!e)return t;var o={};for(var i in S(o,e),t){var a=o[i],s=t[i];a&&!Array.isArray(a)&&(a=[a]),o[i]=a?a.concat(s):Array.isArray(s)?s:[s]}return o},Le.props=Le.methods=Le.inject=Le.computed=function(e,t,n,r){if(t&&Be(r,t,n),!e)return t;var o=Object.create(null);return S(o,e),t&&S(o,t),o},Le.provide=Re;var He=function(e,t){return void 0===t?e:t};function Ve(e){new RegExp("^[a-zA-Z][\\-\\.0-9_"+U.source+"]*$").test(e)||ue('Invalid component name: "'+e+'". Component names should conform to valid custom element name in html5 specification.'),(h(e)||F.isReservedTag(e))&&ue("Do not use built-in or reserved HTML elements as component id: "+e)}function Be(e,t,n){c(t)||ue('Invalid value for option "'+e+'": expected an Object, but got '+s(t)+".",n)}function qe(e,t,n){if(function(e){for(var t in e.components)Ve(t)}(t),"function"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,o,i={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(o=n[r])?i[x(o)]={type:null}:ue("props must be strings when using array syntax.");else if(c(n))for(var a in n)o=n[a],i[x(a)]=c(o)?o:{type:o};else ue('Invalid value for option "props": expected an Array or an Object, but got '+s(n)+".",t);e.props=i}}(t,n),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(c(n))for(var i in n){var a=n[i];r[i]=c(a)?S({from:i},a):{from:a}}else ue('Invalid value for option "inject": expected an Array or an Object, but got '+s(n)+".",t)}}(t,n),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=qe(e,t.extends,n)),t.mixins))for(var r=0,o=t.mixins.length;r<o;r++)e=qe(e,t.mixins[r],n);var i,a={};for(i in e)u(i);for(i in t)b(e,i)||u(i);function u(r){var o=Le[r]||He;a[r]=o(e[r],t[r],n,r)}return a}function ze(e,t,n,r){if("string"==typeof n){var o=e[t];if(b(o,n))return o[n];var i=x(n);if(b(o,i))return o[i];var a=$(i);if(b(o,a))return o[a];var s=o[n]||o[i]||o[a];return r&&!s&&ue("Failed to resolve "+t.slice(0,-1)+": "+n,e),s}}function Je(e,t,n,r){var o=t[e],a=!b(n,e),c=n[e],u=Ze(Boolean,o.type);if(u>-1)if(a&&!b(o,"default"))c=!1;else if(""===c||c===k(e)){var l=Ze(String,o.type);(l<0||u<l)&&(c=!0)}if(void 0===c){c=function(e,t,n){if(b(t,"default")){var r=t.default;return i(r)&&ue('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',e),e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==We(t.type)?r.call(e):r}}(r,o,e);var f=Se;Te(!0),Ee(c),Te(f)}return function(e,t,n,r,o){if(e.required&&o)ue('Missing required prop: "'+t+'"',r);else if(null!=n||e.required){var i=e.type,a=!i||!0===i,c=[];if(i){Array.isArray(i)||(i=[i]);for(var u=0;u<i.length&&!a;u++){var l=Ke(n,i[u]);c.push(l.expectedType||""),a=l.valid}}if(a){var f=e.validator;f&&(f(n)||ue('Invalid prop: custom validator check failed for prop "'+t+'".',r))}else ue(function(e,t,n){var r='Invalid prop: type check failed for prop "'+e+'". Expected '+n.map($).join(", "),o=n[0],i=s(t),a=Ye(t,o),c=Ye(t,i);return 1===n.length&&Qe(o)&&!function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.some((function(e){return"boolean"===e.toLowerCase()}))}(o,i)&&(r+=" with value "+a),r+=", got "+i+" ",Qe(i)&&(r+="with value "+c+"."),r}(t,n,c),r)}}(o,e,c,r,a),c}var Ge=/^(String|Number|Boolean|Function|Symbol)$/;function Ke(e,t){var n,r=We(t);if(Ge.test(r)){var o=typeof e;(n=o===r.toLowerCase())||"object"!==o||(n=e instanceof t)}else n="Object"===r?c(e):"Array"===r?Array.isArray(e):e instanceof t;return{valid:n,expectedType:r}}function We(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function Xe(e,t){return We(e)===We(t)}function Ze(e,t){if(!Array.isArray(t))return Xe(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Xe(t[n],e))return n;return-1}function Ye(e,t){return"String"===t?'"'+e+'"':"Number"===t?""+Number(e):""+e}function Qe(e){return["string","number","boolean"].some((function(t){return e.toLowerCase()===t}))}function et(e,t,n){ge();try{if(t)for(var r=t;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,e,t,n))return}catch(e){nt(e,r,"errorCaptured hook")}}nt(e,t,n)}finally{be()}}function tt(e,t,n,r,o){var i;try{(i=n?e.apply(t,n):e.call(t))&&!i._isVue&&f(i)&&!i._handled&&(i.catch((function(e){return et(e,r,o+" (Promise/async)")})),i._handled=!0)}catch(e){et(e,r,o)}return i}function nt(e,t,n){if(F.errorHandler)try{return F.errorHandler.call(null,e,t,n)}catch(t){t!==e&&rt(t,null,"config.errorHandler")}rt(e,t,n)}function rt(e,t,n){if(ue("Error in "+n+': "'+e.toString()+'"',t),!J&&!G||"undefined"==typeof console)throw e;console.error(e)}var ot,it,at,st=!1,ct=[],ut=!1;function lt(){ut=!1;var e=ct.slice(0);ct.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&ae(Promise)){var ft=Promise.resolve();ot=function(){ft.then(lt),Q&&setTimeout(j)},st=!0}else if(X||"undefined"==typeof MutationObserver||!ae(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())ot="undefined"!=typeof setImmediate&&ae(setImmediate)?function(){setImmediate(lt)}:function(){setTimeout(lt,0)};else{var pt=1,dt=new MutationObserver(lt),vt=document.createTextNode(String(pt));dt.observe(vt,{characterData:!0}),ot=function(){pt=(pt+1)%2,vt.data=String(pt)},st=!0}function ht(e,t){var n;if(ct.push((function(){if(e)try{e.call(t)}catch(e){et(e,t,"nextTick")}else n&&n(t)})),ut||(ut=!0,ot()),!e&&"undefined"!=typeof Promise)return new Promise((function(e){n=e}))}var mt,yt=J&&window.performance;yt&&yt.mark&&yt.measure&&yt.clearMarks&&yt.clearMeasures&&(it=function(e){return yt.mark(e)},at=function(e,t,n){yt.measure(e,t,n),yt.clearMarks(t),yt.clearMarks(n)});var gt=v("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,require"),bt=function(e,t){ue('Property or method "'+t+'" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',e)},_t=function(e,t){ue('Property "'+t+'" must be accessed with "$data.'+t+'" because properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internalsSee: https://vuejs.org/v2/api/#data',e)},wt="undefined"!=typeof Proxy&&ae(Proxy);if(wt){var xt=v("stop,prevent,self,ctrl,shift,alt,meta,exact");F.keyCodes=new Proxy(F.keyCodes,{set:function(e,t,n){return xt(t)?(ue("Avoid overwriting built-in modifier in config.keyCodes: ."+t),!1):(e[t]=n,!0)}})}var $t={has:function(e,t){var n=t in e,r=gt(t)||"string"==typeof t&&"_"===t.charAt(0)&&!(t in e.$data);return n||r||(t in e.$data?_t(e,t):bt(e,t)),n||!r}},Ct={get:function(e,t){return"string"!=typeof t||t in e||(t in e.$data?_t(e,t):bt(e,t)),e[t]}};mt=function(e){if(wt){var t=e.$options,n=t.render&&t.render._withStripped?Ct:$t;e._renderProxy=new Proxy(e,n)}else e._renderProxy=e};var kt=new se;function At(e){Ot(e,kt),kt.clear()}function Ot(e,t){var n,r,o=Array.isArray(e);if(!(!o&&!i(e)||Object.isFrozen(e)||e instanceof _e)){if(e.__ob__){var a=e.__ob__.dep.id;if(t.has(a))return;t.add(a)}if(o)for(n=e.length;n--;)Ot(e[n],t);else for(n=(r=Object.keys(e)).length;n--;)Ot(e[r[n]],t)}}var St=_((function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}}));function Tt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return tt(r,null,arguments,t,"v-on handler");for(var o=r.slice(),i=0;i<o.length;i++)tt(o[i],null,e,t,"v-on handler")}return n.fns=e,n}function jt(e,n,o,i,a,s){var c,u,l,f;for(c in e)u=e[c],l=n[c],f=St(c),t(u)?ue('Invalid handler for event "'+f.name+'": got '+String(u),s):t(l)?(t(u.fns)&&(u=e[c]=Tt(u,s)),r(f.once)&&(u=e[c]=a(f.name,u,f.capture)),o(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l);for(c in n)t(e[c])&&i((f=St(c)).name,n[c],f.capture)}function Et(e,o,i){var a;e instanceof _e&&(e=e.data.hook||(e.data.hook={}));var s=e[o];function c(){i.apply(this,arguments),y(a.fns,c)}t(s)?a=Tt([c]):n(s.fns)&&r(s.merged)?(a=s).fns.push(c):a=Tt([s,c]),a.merged=!0,e[o]=a}function Mt(e,t,r,o,i){if(n(t)){if(b(t,r))return e[r]=t[r],i||delete t[r],!0;if(b(t,o))return e[r]=t[o],i||delete t[o],!0}return!1}function Nt(e){return o(e)?[$e(e)]:Array.isArray(e)?It(e):void 0}function Pt(e){return n(e)&&n(e.text)&&!1===e.isComment}function It(e,i){var a,s,c,u,l=[];for(a=0;a<e.length;a++)t(s=e[a])||"boolean"==typeof s||(u=l[c=l.length-1],Array.isArray(s)?s.length>0&&(Pt((s=It(s,(i||"")+"_"+a))[0])&&Pt(u)&&(l[c]=$e(u.text+s[0].text),s.shift()),l.push.apply(l,s)):o(s)?Pt(u)?l[c]=$e(u.text+s):""!==s&&l.push($e(s)):Pt(s)&&Pt(u)?l[c]=$e(u.text+s.text):(r(e._isVList)&&n(s.tag)&&t(s.key)&&n(i)&&(s.key="__vlist"+i+"_"+a+"__"),l.push(s)));return l}function Lt(e,t){if(e){for(var n=Object.create(null),r=ce?Reflect.ownKeys(e):Object.keys(e),o=0;o<r.length;o++){var i=r[o];if("__ob__"!==i){for(var a=e[i].from,s=t;s;){if(s._provided&&b(s._provided,a)){n[i]=s._provided[a];break}s=s.$parent}if(!s)if("default"in e[i]){var c=e[i].default;n[i]="function"==typeof c?c.call(t):c}else ue('Injection "'+i+'" not found',t)}}return n}}function Dt(e,t){if(!e||!e.length)return{};for(var n={},r=0,o=e.length;r<o;r++){var i=e[r],a=i.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,i.context!==t&&i.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(i);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===i.tag?c.push.apply(c,i.children||[]):c.push(i)}}for(var u in n)n[u].every(Rt)&&delete n[u];return n}function Rt(e){return e.isComment&&!e.asyncFactory||" "===e.text}function Ft(t,n,r){var o,i=Object.keys(n).length>0,a=t?!!t.$stable:!i,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!i&&!r.$hasNormal)return r;for(var c in o={},t)t[c]&&"$"!==c[0]&&(o[c]=Ut(n,c,t[c]))}else o={};for(var u in n)u in o||(o[u]=Ht(n,u));return t&&Object.isExtensible(t)&&(t._normalized=o),V(o,"$stable",a),V(o,"$key",s),V(o,"$hasNormal",i),o}function Ut(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:Nt(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function Ht(e,t){return function(){return e[t]}}function Vt(e,t){var r,o,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),o=0,a=e.length;o<a;o++)r[o]=t(e[o],o);else if("number"==typeof e)for(r=new Array(e),o=0;o<e;o++)r[o]=t(o+1,o);else if(i(e))if(ce&&e[Symbol.iterator]){r=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)r.push(t(l.value,r.length)),l=u.next()}else for(s=Object.keys(e),r=new Array(s.length),o=0,a=s.length;o<a;o++)c=s[o],r[o]=t(e[c],c,o);return n(r)||(r=[]),r._isVList=!0,r}function Bt(e,t,n,r){var o,a=this.$scopedSlots[e];a?(n=n||{},r&&(i(r)||ue("slot v-bind without argument expects an Object",this),n=S(S({},r),n)),o=a(n)||t):o=this.$slots[e]||t;var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function qt(e){return ze(this.$options,"filters",e,!0)||M}function zt(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function Jt(e,t,n,r,o){var i=F.keyCodes[t]||n;return o&&r&&!F.keyCodes[t]?zt(o,r):i?zt(i,e):r?k(r)!==t:void 0}function Gt(e,t,n,r,o){if(n)if(i(n)){var a;Array.isArray(n)&&(n=T(n));var s=function(i){if("class"===i||"style"===i||m(i))a=e;else{var s=e.attrs&&e.attrs.type;a=r||F.mustUseProp(t,s,i)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=x(i),u=k(i);c in a||u in a||(a[i]=n[i],o&&((e.on||(e.on={}))["update:"+i]=function(e){n[i]=e}))};for(var c in n)s(c)}else ue("v-bind without argument expects an Object or Array value",this);return e}function Kt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t||Xt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r}function Wt(e,t,n){return Xt(e,"__once__"+t+(n?"_"+n:""),!0),e}function Xt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&Zt(e[r],t+"_"+r,n);else Zt(e,t,n)}function Zt(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function Yt(e,t){if(t)if(c(t)){var n=e.on=e.on?S({},e.on):{};for(var r in t){var o=n[r],i=t[r];n[r]=o?[].concat(o,i):i}}else ue("v-on without argument expects an Object value",this);return e}function Qt(e,t,n,r){t=t||{$stable:!n};for(var o=0;o<e.length;o++){var i=e[o];Array.isArray(i)?Qt(i,t,n):i&&(i.proxy&&(i.fn.proxy=!0),t[i.key]=i.fn)}return r&&(t.$key=r),t}function en(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r?e[t[n]]=t[n+1]:""!==r&&null!==r&&ue("Invalid value for dynamic directive argument (expected string or null): "+r,this)}return e}function tn(e,t){return"string"==typeof e?t+e:e}function nn(e){e._o=Wt,e._n=d,e._s=p,e._l=Vt,e._t=Bt,e._q=N,e._i=P,e._m=Kt,e._f=qt,e._k=Jt,e._b=Gt,e._v=$e,e._e=xe,e._u=Qt,e._g=Yt,e._d=en,e._p=tn}function rn(t,n,o,i,a){var s,c=this,u=a.options;b(i,"_uid")?(s=Object.create(i))._original=i:(s=i,i=i._original);var l=r(u._compiled),f=!l;this.data=t,this.props=n,this.children=o,this.parent=i,this.listeners=t.on||e,this.injections=Lt(u.inject,i),this.slots=function(){return c.$slots||Ft(t.scopedSlots,c.$slots=Dt(o,i)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return Ft(t.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=Ft(t.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var o=fn(s,e,t,n,r,f);return o&&!Array.isArray(o)&&(o.fnScopeId=u._scopeId,o.fnContext=i),o}:this._c=function(e,t,n,r){return fn(s,e,t,n,r,f)}}function on(e,t,n,r,o){var i=Ce(e);return i.fnContext=n,i.fnOptions=r,(i.devtoolsMeta=i.devtoolsMeta||{}).renderContext=o,t.slot&&((i.data||(i.data={})).slot=t.slot),i}function an(e,t){for(var n in t)e[x(n)]=t[n]}nn(rn.prototype);var sn={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var r=e;sn.prepatch(r,r)}else(e.componentInstance=function(e,t){var r={_isComponent:!0,_parentVnode:e,parent:t},o=e.data.inlineTemplate;return n(o)&&(r.render=o.render,r.staticRenderFns=o.staticRenderFns),new e.componentOptions.Ctor(r)}(e,$n)).$mount(t?e.elm:void 0,t)},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,o,i){Cn=!0;var a=o.data.scopedSlots,s=t.$scopedSlots,c=!!(a&&!a.$stable||s!==e&&!s.$stable||a&&t.$scopedSlots.$key!==a.$key),u=!!(i||t.$options._renderChildren||c);if(t.$options._parentVnode=o,t.$vnode=o,t._vnode&&(t._vnode.parent=o),t.$options._renderChildren=i,t.$attrs=o.data.attrs||e,t.$listeners=r||e,n&&t.$options.props){Te(!1);for(var l=t._props,f=t.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=t.$options.props;l[d]=Je(d,v,n,t)}Te(!0),t.$options.propsData=n}r=r||e;var h=t.$options._parentListeners;t.$options._parentListeners=r,xn(t,r,h),u&&(t.$slots=Dt(i,o.context),t.$forceUpdate()),Cn=!1}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,Tn(r,"mounted")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,En.push(t)):On(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?Sn(t,!0):t.$destroy())}},cn=Object.keys(sn);function un(o,a,s,c,u){if(!t(o)){var l=s.$options._base;if(i(o)&&(o=l.extend(o)),"function"==typeof o){var p;if(t(o.cid)&&(o=function(e,o){if(r(e.error)&&n(e.errorComp))return e.errorComp;if(n(e.resolved))return e.resolved;var a=vn;if(a&&n(e.owners)&&-1===e.owners.indexOf(a)&&e.owners.push(a),r(e.loading)&&n(e.loadingComp))return e.loadingComp;if(a&&!n(e.owners)){var s=e.owners=[a],c=!0,u=null,l=null;a.$on("hook:destroyed",(function(){return y(s,a)}));var p=function(e){for(var t=0,n=s.length;t<n;t++)s[t].$forceUpdate();e&&(s.length=0,null!==u&&(clearTimeout(u),u=null),null!==l&&(clearTimeout(l),l=null))},d=I((function(t){e.resolved=hn(t,o),c?s.length=0:p(!0)})),v=I((function(t){ue("Failed to resolve async component: "+String(e)+(t?"\nReason: "+t:"")),n(e.errorComp)&&(e.error=!0,p(!0))})),h=e(d,v);return i(h)&&(f(h)?t(e.resolved)&&h.then(d,v):f(h.component)&&(h.component.then(d,v),n(h.error)&&(e.errorComp=hn(h.error,o)),n(h.loading)&&(e.loadingComp=hn(h.loading,o),0===h.delay?e.loading=!0:u=setTimeout((function(){u=null,t(e.resolved)&&t(e.error)&&(e.loading=!0,p(!1))}),h.delay||200)),n(h.timeout)&&(l=setTimeout((function(){l=null,t(e.resolved)&&v("timeout ("+h.timeout+"ms)")}),h.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}(p=o,l),void 0===o))return function(e,t,n,r,o){var i=xe();return i.asyncFactory=e,i.asyncMeta={data:t,context:n,children:r,tag:o},i}(p,a,s,c,u);a=a||{},Zn(o),n(a.model)&&function(e,t){var r=e.model&&e.model.prop||"value",o=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[r]=t.model.value;var i=t.on||(t.on={}),a=i[o],s=t.model.callback;n(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(i[o]=[s].concat(a)):i[o]=s}(o.options,a);var d=function(e,r,o){var i=r.options.props;if(!t(i)){var a={},s=e.attrs,c=e.props;if(n(s)||n(c))for(var u in i){var l=k(u),f=u.toLowerCase();u!==f&&s&&b(s,f)&&le('Prop "'+f+'" is passed to component '+fe(o||r)+', but the declared prop name is "'+u+'". Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM templates. You should probably use "'+l+'" instead of "'+u+'".'),Mt(a,c,u,l,!0)||Mt(a,s,u,l,!1)}return a}}(a,o,u);if(r(o.options.functional))return function(t,r,o,i,a){var s=t.options,c={},u=s.props;if(n(u))for(var l in u)c[l]=Je(l,u,r||e);else n(o.attrs)&&an(c,o.attrs),n(o.props)&&an(c,o.props);var f=new rn(o,c,a,i,t),p=s.render.call(null,f._c,f);if(p instanceof _e)return on(p,o,f.parent,s,f);if(Array.isArray(p)){for(var d=Nt(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=on(d[h],o,f.parent,s,f);return v}}(o,d,a,s,c);var v=a.on;if(a.on=a.nativeOn,r(o.options.abstract)){var h=a.slot;a={},h&&(a.slot=h)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<cn.length;n++){var r=cn[n],o=t[r],i=sn[r];o===i||o&&o._merged||(t[r]=o?ln(i,o):i)}}(a);var m=o.options.name||u;return new _e("vue-component-"+o.cid+(m?"-"+m:""),a,void 0,void 0,void 0,s,{Ctor:o,propsData:d,listeners:v,tag:u,children:c},p)}ue("Invalid Component definition: "+String(o),s)}}function ln(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}function fn(e,t,a,s,c,u){return(Array.isArray(a)||o(a))&&(c=s,s=a,a=void 0),r(u)&&(c=2),function(e,t,r,a,s){if(n(r)&&n(r.__ob__))return ue("Avoid using observed data object as vnode data: "+JSON.stringify(r)+"\nAlways create fresh vnode data objects in each render!",e),xe();if(n(r)&&n(r.is)&&(t=r.is),!t)return xe();var c,u,l;(n(r)&&n(r.key)&&!o(r.key)&&ue("Avoid using non-primitive value as key, use string/number value instead.",e),Array.isArray(a)&&"function"==typeof a[0]&&((r=r||{}).scopedSlots={default:a[0]},a.length=0),2===s?a=Nt(a):1===s&&(a=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(a)),"string"==typeof t)?(u=e.$vnode&&e.$vnode.ns||F.getTagNamespace(t),c=F.isReservedTag(t)?new _e(F.parsePlatformTagName(t),r,a,void 0,void 0,e):r&&r.pre||!n(l=ze(e.$options,"components",t))?new _e(t,r,a,void 0,void 0,e):un(l,r,e,a,t)):c=un(t,r,e,a);return Array.isArray(c)?c:n(c)?(n(u)&&pn(c,u),n(r)&&function(e){i(e.style)&&At(e.style),i(e.class)&&At(e.class)}(r),c):xe()}(e,t,a,s,c)}function pn(e,o,i){if(e.ns=o,"foreignObject"===e.tag&&(o=void 0,i=!0),n(e.children))for(var a=0,s=e.children.length;a<s;a++){var c=e.children[a];n(c.tag)&&(t(c.ns)||r(i)&&"svg"!==c.tag)&&pn(c,o,i)}}var dn,vn=null;function hn(e,t){return(e.__esModule||ce&&"Module"===e[Symbol.toStringTag])&&(e=e.default),i(e)?t.extend(e):e}function mn(e){return e.isComment&&e.asyncFactory}function yn(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];if(n(r)&&(n(r.componentOptions)||mn(r)))return r}}function gn(e,t){dn.$on(e,t)}function bn(e,t){dn.$off(e,t)}function wn(e,t){var n=dn;return function r(){var o=t.apply(null,arguments);null!==o&&n.$off(e,r)}}function xn(e,t,n){dn=e,jt(t,n||{},gn,bn,wn,e),dn=void 0}var $n=null,Cn=!1;function kn(e){var t=$n;return $n=e,function(){$n=t}}function An(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function On(e,t){if(t){if(e._directInactive=!1,An(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)On(e.$children[n]);Tn(e,"activated")}}function Sn(e,t){if(!(t&&(e._directInactive=!0,An(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)Sn(e.$children[n]);Tn(e,"deactivated")}}function Tn(e,t){ge();var n=e.$options[t],r=t+" hook";if(n)for(var o=0,i=n.length;o<i;o++)tt(n[o],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),be()}var jn=[],En=[],Mn={},Nn={},Pn=!1,In=!1,Ln=0,Dn=0,Rn=Date.now;if(J&&!X){var Fn=window.performance;Fn&&"function"==typeof Fn.now&&Rn()>document.createEvent("Event").timeStamp&&(Rn=function(){return Fn.now()})}function Un(){var e,t;for(Dn=Rn(),In=!0,jn.sort((function(e,t){return e.id-t.id})),Ln=0;Ln<jn.length;Ln++)if((e=jn[Ln]).before&&e.before(),t=e.id,Mn[t]=null,e.run(),null!=Mn[t]&&(Nn[t]=(Nn[t]||0)+1,Nn[t]>100)){ue("You may have an infinite update loop "+(e.user?'in watcher with expression "'+e.expression+'"':"in a component render function."),e.vm);break}var n=En.slice(),r=jn.slice();Ln=jn.length=En.length=0,Mn={},Nn={},Pn=In=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,On(e[t],!0)}(n),function(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Tn(r,"updated")}}(r),ie&&F.devtools&&ie.emit("flush")}var Hn=0,Vn=function(e,t,n,r,o){this.vm=e,o&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Hn,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new se,this.newDepIds=new se,this.expression=t.toString(),"function"==typeof t?this.getter=t:(this.getter=function(e){if(!q.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=j,ue('Failed watching path: "'+t+'" Watcher only accepts simple dot-delimited paths. For full control, use a function instead.',e))),this.value=this.lazy?void 0:this.get()};Vn.prototype.get=function(){var e;ge(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;et(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&At(e),be(),this.cleanupDeps()}return e},Vn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},Vn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Vn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==Mn[t]){if(Mn[t]=!0,In){for(var n=jn.length-1;n>Ln&&jn[n].id>e.id;)n--;jn.splice(n+1,0,e)}else jn.push(e);if(!Pn){if(Pn=!0,!F.async)return void Un();ht(Un)}}}(this)},Vn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||i(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){et(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Vn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Vn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Vn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Bn={enumerable:!0,configurable:!0,get:j,set:j};function qn(e,t,n){Bn.get=function(){return this[t][n]},Bn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Bn)}var zn={lazy:!0};function Jn(e,t,n){var r=!oe();"function"==typeof n?(Bn.get=r?Gn(t):Kn(n),Bn.set=j):(Bn.get=n.get?r&&!1!==n.cache?Gn(t):Kn(n.get):j,Bn.set=n.set||j),Bn.set===j&&(Bn.set=function(){ue('Computed property "'+t+'" was assigned to but it has no setter.',this)}),Object.defineProperty(e,t,Bn)}function Gn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),me.target&&t.depend(),t.value}}function Kn(e){return function(){return e.call(this,this)}}function Wn(e,t,n,r){return c(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var Xn=0;function Zn(e){var t=e.options;if(e.super){var n=Zn(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var o in n)n[o]!==r[o]&&(t||(t={}),t[o]=n[o]);return t}(e);r&&S(e.extendOptions,r),(t=e.options=qe(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Yn(e){this instanceof Yn||ue("Vue is a constructor and should be called with the `new` keyword"),this._init(e)}function Qn(e){return e&&(e.Ctor.options.name||e.tag)}function er(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!u(e)&&e.test(t)}function tr(e,t){var n=e.cache,r=e.keys,o=e._vnode;for(var i in n){var a=n[i];if(a){var s=Qn(a.componentOptions);s&&!t(s)&&nr(n,i,r,o)}}}function nr(e,t,n,r){var o=e[t];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),e[t]=null,y(n,t)}!function(t){t.prototype._init=function(t){var n,r,o=this;o._uid=Xn++,F.performance&&it&&(n="vue-perf-start:"+o._uid,r="vue-perf-end:"+o._uid,it(n)),o._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(o,t):o.$options=qe(Zn(o.constructor),t||{},o),mt(o),o._self=o,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(o),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&xn(e,t)}(o),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,o=r&&r.context;t.$slots=Dt(n._renderChildren,o),t.$scopedSlots=e,t._c=function(e,n,r,o){return fn(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return fn(t,e,n,r,o,!0)};var i=r&&r.data;Me(t,"$attrs",i&&i.attrs||e,(function(){!Cn&&ue("$attrs is readonly.",t)}),!0),Me(t,"$listeners",n._parentListeners||e,(function(){!Cn&&ue("$listeners is readonly.",t)}),!0)}(o),Tn(o,"beforeCreate"),function(e){var t=Lt(e.$options.inject,e);t&&(Te(!1),Object.keys(t).forEach((function(n){Me(e,n,t[n],(function(){ue('Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. injection being mutated: "'+n+'"',e)}))})),Te(!0))}(o),function(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},o=e.$options._propKeys=[],i=!e.$parent;i||Te(!1);var a=function(a){o.push(a);var s=Je(a,t,n,e),c=k(a);(m(c)||F.isReservedAttr(c))&&ue('"'+c+'" is a reserved attribute and cannot be used as component prop.',e),Me(r,a,s,(function(){i||Cn||ue("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: \""+a+'"',e)})),a in e||qn(e,"_props",a)};for(var s in t)a(s);Te(!0)}(e,t.props),t.methods&&function(e,t){var n=e.$options.props;for(var r in t)"function"!=typeof t[r]&&ue('Method "'+r+'" has type "'+typeof t[r]+'" in the component definition. Did you reference the function correctly?',e),n&&b(n,r)&&ue('Method "'+r+'" has already been defined as a prop.',e),r in e&&H(r)&&ue('Method "'+r+'" conflicts with an existing Vue instance method. Avoid defining component methods that start with _ or $.'),e[r]="function"!=typeof t[r]?j:A(t[r],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;c(t=e._data="function"==typeof t?function(e,t){ge();try{return e.call(t,t)}catch(e){return et(e,t,"data()"),{}}finally{be()}}(t,e):t||{})||(t={},ue("data functions should return an object:\nhttps://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",e));for(var n=Object.keys(t),r=e.$options.props,o=e.$options.methods,i=n.length;i--;){var a=n[i];o&&b(o,a)&&ue('Method "'+a+'" has already been defined as a data property.',e),r&&b(r,a)?ue('The data property "'+a+'" is already declared as a prop. Use prop default value instead.',e):H(a)||qn(e,"_data",a)}Ee(t,!0)}(e):Ee(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=oe();for(var o in t){var i=t[o],a="function"==typeof i?i:i.get;null==a&&ue('Getter is missing for computed property "'+o+'".',e),r||(n[o]=new Vn(e,a||j,j,zn)),o in e?o in e.$data?ue('The computed property "'+o+'" is already defined in data.',e):e.$options.props&&o in e.$options.props&&ue('The computed property "'+o+'" is already defined as a prop.',e):Jn(e,o,i)}}(e,t.computed),t.watch&&t.watch!==te&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var o=0;o<r.length;o++)Wn(e,n,r[o]);else Wn(e,n,r)}}(e,t.watch)}(o),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(o),Tn(o,"created"),F.performance&&it&&(o._name=fe(o,!1),it(r),at("vue "+o._name+" init",n,r)),o.$options.el&&o.$mount(o.$options.el)}}(Yn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};t.set=function(){ue("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){ue("$props is readonly.",this)},Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Ne,e.prototype.$delete=Pe,e.prototype.$watch=function(e,t,n){var r=this;if(c(t))return Wn(r,e,t,n);(n=n||{}).user=!0;var o=new Vn(r,e,t,n);if(n.immediate)try{t.call(r,o.value)}catch(e){et(e,r,'callback for immediate watcher "'+o.expression+'"')}return function(){o.teardown()}}}(Yn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var o=0,i=e.length;o<i;o++)r.$on(e[o],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,o=e.length;r<o;r++)n.$off(e[r],t);return n}var i,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((i=a[s])===t||i.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this,n=e.toLowerCase();n!==e&&t._events[n]&&le('Event "'+n+'" is emitted in component '+fe(t)+' but the handler is registered for "'+e+'". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "'+k(e)+'" instead of "'+e+'".');var r=t._events[e];if(r){r=r.length>1?O(r):r;for(var o=O(arguments,1),i='event handler for "'+e+'"',a=0,s=r.length;a<s;a++)tt(r[a],t,o,t,i)}return t}}(Yn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,o=n._vnode,i=kn(n);n._vnode=e,n.$el=o?n.__patch__(o,e):n.__patch__(n.$el,e,t,!1),i(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Tn(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||y(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Tn(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(Yn),function(e){nn(e.prototype),e.prototype.$nextTick=function(e){return ht(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,o=n._parentVnode;o&&(t.$scopedSlots=Ft(o.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=o;try{vn=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){if(et(n,t,"render"),t.$options.renderError)try{e=t.$options.renderError.call(t._renderProxy,t.$createElement,n)}catch(n){et(n,t,"renderError"),e=t._vnode}else e=t._vnode}finally{vn=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof _e||(Array.isArray(e)&&ue("Multiple root nodes returned from render function. Render function should return a single root node.",t),e=xe()),e.parent=o,e}}(Yn);var rr=[String,RegExp,Array],or={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:rr,exclude:rr,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)nr(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",(function(t){tr(e,(function(e){return er(t,e)}))})),this.$watch("exclude",(function(t){tr(e,(function(e){return!er(t,e)}))}))},render:function(){var e=this.$slots.default,t=yn(e),n=t&&t.componentOptions;if(n){var r=Qn(n),o=this.include,i=this.exclude;if(o&&(!r||!er(o,r))||i&&r&&er(i,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,y(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&nr(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F},set:function(){ue("Do not replace the Vue.config object, set individual fields instead.")}};Object.defineProperty(e,"config",t),e.util={warn:ue,extend:S,mergeOptions:qe,defineReactive:Me},e.set=Ne,e.delete=Pe,e.nextTick=ht,e.observable=function(e){return Ee(e),e},e.options=Object.create(null),D.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,S(e.options.components,or),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=O(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=qe(this.options,e),this}}(e),function(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,o=e._Ctor||(e._Ctor={});if(o[r])return o[r];var i=e.name||n.options.name;i&&Ve(i);var a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=qe(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)qn(e.prototype,"_props",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)Jn(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,D.forEach((function(e){a[e]=n[e]})),i&&(a.options.components[i]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=S({},a.options),o[r]=a,a}}(e),function(e){D.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&Ve(e),"component"===t&&c(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Yn),Object.defineProperty(Yn.prototype,"$isServer",{get:oe}),Object.defineProperty(Yn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Yn,"FunctionalRenderContext",{value:rn}),Yn.version="2.6.10";var ir=v("style,class"),ar=v("input,textarea,option,select,progress"),sr=function(e,t,n){return"value"===n&&ar(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},cr=v("contenteditable,draggable,spellcheck"),ur=v("events,caret,typing,plaintext-only"),lr=v("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"),fr="http://www.w3.org/1999/xlink",pr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},dr=function(e){return pr(e)?e.slice(6,e.length):""},vr=function(e){return null==e||!1===e};function hr(e,t){return{staticClass:mr(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function mr(e,t){return e?t?e+" "+t:e:t||""}function yr(e){return Array.isArray(e)?function(e){for(var t,r="",o=0,i=e.length;o<i;o++)n(t=yr(e[o]))&&""!==t&&(r&&(r+=" "),r+=t);return r}(e):i(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}var gr={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},br=v("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),_r=v("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),wr=function(e){return br(e)||_r(e)};function xr(e){return _r(e)?"svg":"math"===e?"math":void 0}var $r=Object.create(null),Cr=v("text,number,password,search,email,tel,url");function kr(e){return"string"==typeof e?document.querySelector(e)||(ue("Cannot find element: "+e),document.createElement("div")):e}var Ar=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(e,t){return document.createElementNS(gr[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,"")}}),Or={create:function(e,t){Sr(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Sr(e,!0),Sr(t))},destroy:function(e){Sr(e,!0)}};function Sr(e,t){var r=e.data.ref;if(n(r)){var o=e.context,i=e.componentInstance||e.elm,a=o.$refs;t?Array.isArray(a[r])?y(a[r],i):a[r]===i&&(a[r]=void 0):e.data.refInFor?Array.isArray(a[r])?a[r].indexOf(i)<0&&a[r].push(i):a[r]=[i]:a[r]=i}}var Tr=new _e("",{},[]),jr=["create","activate","update","remove","destroy"];function Er(e,o){return e.key===o.key&&(e.tag===o.tag&&e.isComment===o.isComment&&n(e.data)===n(o.data)&&function(e,t){if("input"!==e.tag)return!0;var r,o=n(r=e.data)&&n(r=r.attrs)&&r.type,i=n(r=t.data)&&n(r=r.attrs)&&r.type;return o===i||Cr(o)&&Cr(i)}(e,o)||r(e.isAsyncPlaceholder)&&e.asyncFactory===o.asyncFactory&&t(o.asyncFactory.error))}function Mr(e,t,r){var o,i,a={};for(o=t;o<=r;++o)n(i=e[o].key)&&(a[i]=o);return a}var Nr={create:Pr,update:Pr,destroy:function(e){Pr(e,Tr)}};function Pr(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,o,i=e===Tr,a=t===Tr,s=Lr(e.data.directives,e.context),c=Lr(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],o=c[n],r?(o.oldValue=r.value,o.oldArg=r.arg,Rr(o,"update",t,e),o.def&&o.def.componentUpdated&&l.push(o)):(Rr(o,"bind",t,e),o.def&&o.def.inserted&&u.push(o));if(u.length){var f=function(){for(var n=0;n<u.length;n++)Rr(u[n],"inserted",t,e)};i?Et(t,"insert",f):f()}if(l.length&&Et(t,"postpatch",(function(){for(var n=0;n<l.length;n++)Rr(l[n],"componentUpdated",t,e)})),!i)for(n in s)c[n]||Rr(s[n],"unbind",e,e,a)}(e,t)}var Ir=Object.create(null);function Lr(e,t){var n,r,o=Object.create(null);if(!e)return o;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=Ir),o[Dr(r)]=r,r.def=ze(t.$options,"directives",r.name,!0);return o}function Dr(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function Rr(e,t,n,r,o){var i=e.def&&e.def[t];if(i)try{i(n.elm,e,n,r,o)}catch(r){et(r,n.context,"directive "+e.name+" "+t+" hook")}}var Fr=[Or,Nr];function Ur(e,r){var o=r.componentOptions;if(!(n(o)&&!1===o.Ctor.options.inheritAttrs||t(e.data.attrs)&&t(r.data.attrs))){var i,a,s=r.elm,c=e.data.attrs||{},u=r.data.attrs||{};for(i in n(u.__ob__)&&(u=r.data.attrs=S({},u)),u)a=u[i],c[i]!==a&&Hr(s,i,a);for(i in(X||Y)&&u.value!==c.value&&Hr(s,"value",u.value),c)t(u[i])&&(pr(i)?s.removeAttributeNS(fr,dr(i)):cr(i)||s.removeAttribute(i))}}function Hr(e,t,n){e.tagName.indexOf("-")>-1?Vr(e,t,n):lr(t)?vr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):cr(t)?e.setAttribute(t,function(e,t){return vr(t)||"false"===t?"false":"contenteditable"===e&&ur(t)?t:"true"}(t,n)):pr(t)?vr(n)?e.removeAttributeNS(fr,dr(t)):e.setAttributeNS(fr,t,n):Vr(e,t,n)}function Vr(e,t,n){if(vr(n))e.removeAttribute(t);else{if(X&&!Z&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Br={create:Ur,update:Ur};function qr(e,r){var o=r.elm,i=r.data,a=e.data;if(!(t(i.staticClass)&&t(i.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=function(e){for(var t=e.data,r=e,o=e;n(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(t=hr(o.data,t));for(;n(r=r.parent);)r&&r.data&&(t=hr(t,r.data));return i=t.staticClass,a=t.class,n(i)||n(a)?mr(i,yr(a)):"";var i,a}(r),c=o._transitionClasses;n(c)&&(s=mr(s,yr(c))),s!==o._prevClass&&(o.setAttribute("class",s),o._prevClass=s)}}var zr,Jr,Gr,Kr,Wr,Xr,Zr,Yr={create:qr,update:qr},Qr=/[\w).+\-_$\]]/;function eo(e){var t,n,r,o,i,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&" "===(h=e.charAt(v));v--);h&&Qr.test(h)||(u=!0)}}else void 0===o?(d=r+1,o=e.slice(0,r).trim()):m();function m(){(i||(i=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===o?o=e.slice(0,r).trim():0!==d&&m(),i)for(r=0;r<i.length;r++)o=to(o,i[r]);return o}function to(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),o=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==o?","+o:o)}function no(e,t){console.error("[Vue compiler]: "+e)}function ro(e,t){return e?e.map((function(e){return e[t]})).filter((function(e){return e})):[]}function oo(e,t,n,r,o){(e.props||(e.props=[])).push(ho({name:t,value:n,dynamic:o},r)),e.plain=!1}function io(e,t,n,r,o){(o?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(ho({name:t,value:n,dynamic:o},r)),e.plain=!1}function ao(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(ho({name:t,value:n},r))}function so(e,t,n,r,o,i,a,s){(e.directives||(e.directives=[])).push(ho({name:t,rawName:n,value:r,arg:o,isDynamicArg:i,modifiers:a},s)),e.plain=!1}function co(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function uo(t,n,r,o,i,a,s,c){var u;o=o||e,a&&o.prevent&&o.passive&&a("passive and prevent can't be used together. Passive handler can't prevent default event.",s),o.right?c?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete o.right):o.middle&&(c?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),o.capture&&(delete o.capture,n=co("!",n,c)),o.once&&(delete o.once,n=co("~",n,c)),o.passive&&(delete o.passive,n=co("&",n,c)),o.native?(delete o.native,u=t.nativeEvents||(t.nativeEvents={})):u=t.events||(t.events={});var l=ho({value:r.trim(),dynamic:c},s);o!==e&&(l.modifiers=o);var f=u[n];Array.isArray(f)?i?f.unshift(l):f.push(l):u[n]=f?i?[l,f]:[f,l]:l,t.plain=!1}function lo(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}function fo(e,t,n){var r=po(e,":"+t)||po(e,"v-bind:"+t);if(null!=r)return eo(r);if(!1!==n){var o=po(e,t);if(null!=o)return JSON.stringify(o)}}function po(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var o=e.attrsList,i=0,a=o.length;i<a;i++)if(o[i].name===t){o.splice(i,1);break}return n&&delete e.attrsMap[t],r}function vo(e,t){for(var n=e.attrsList,r=0,o=n.length;r<o;r++){var i=n[r];if(t.test(i.name))return n.splice(r,1),i}}function ho(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function mo(e,t,n){var r=n||{},o=r.number,i="$$v";r.trim&&(i="(typeof $$v === 'string'? $$v.trim(): $$v)"),o&&(i="_n("+i+")");var a=yo(t,i);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function yo(e,t){var n=function(e){if(e=e.trim(),zr=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<zr-1)return(Kr=e.lastIndexOf("."))>-1?{exp:e.slice(0,Kr),key:'"'+e.slice(Kr+1)+'"'}:{exp:e,key:null};for(Jr=e,Kr=Wr=Xr=0;!bo();)_o(Gr=go())?xo(Gr):91===Gr&&wo(Gr);return{exp:e.slice(0,Wr),key:e.slice(Wr+1,Xr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function go(){return Jr.charCodeAt(++Kr)}function bo(){return Kr>=zr}function _o(e){return 34===e||39===e}function wo(e){var t=1;for(Wr=Kr;!bo();)if(_o(e=go()))xo(e);else if(91===e&&t++,93===e&&t--,0===t){Xr=Kr;break}}function xo(e){for(var t=e;!bo()&&(e=go())!==t;);}var $o;function Co(e,t,n){var r=$o;return function o(){var i=t.apply(null,arguments);null!==i&&Oo(e,o,n,r)}}var ko=st&&!(ee&&Number(ee[1])<=53);function Ao(e,t,n,r){if(ko){var o=Dn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=o||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}$o.addEventListener(e,t,ne?{capture:n,passive:r}:n)}function Oo(e,t,n,r){(r||$o).removeEventListener(e,t._wrapper||t,n)}function So(e,r){if(!t(e.data.on)||!t(r.data.on)){var o=r.data.on||{},i=e.data.on||{};$o=r.elm,function(e){if(n(e.__r)){var t=X?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}n(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(o),jt(o,i,Ao,Oo,Co,r.context),$o=void 0}}var To,jo={create:So,update:So};function Eo(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var o,i,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(o in n(c.__ob__)&&(c=r.data.domProps=S({},c)),s)o in c||(a[o]="");for(o in c){if(i=c[o],"textContent"===o||"innerHTML"===o){if(r.children&&(r.children.length=0),i===s[o])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===o&&"PROGRESS"!==a.tagName){a._value=i;var u=t(i)?"":String(i);Mo(a,u)&&(a.value=u)}else if("innerHTML"===o&&_r(a.tagName)&&t(a.innerHTML)){(To=To||document.createElement("div")).innerHTML="<svg>"+i+"</svg>";for(var l=To.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(i!==s[o])try{a[o]=i}catch(e){}}}}function Mo(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,o=e._vModifiers;if(n(o)){if(o.number)return d(r)!==d(t);if(o.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var No={create:Eo,update:Eo},Po=_((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function Io(e){var t=Lo(e.style);return e.staticStyle?S(e.staticStyle,t):t}function Lo(e){return Array.isArray(e)?T(e):"string"==typeof e?Po(e):e}var Do,Ro=/^--/,Fo=/\s*!important$/,Uo=function(e,t,n){if(Ro.test(t))e.style.setProperty(t,n);else if(Fo.test(n))e.style.setProperty(k(t),n.replace(Fo,""),"important");else{var r=Vo(t);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)e.style[r]=n[o];else e.style[r]=n}},Ho=["Webkit","Moz","ms"],Vo=_((function(e){if(Do=Do||document.createElement("div").style,"filter"!==(e=x(e))&&e in Do)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Ho.length;n++){var r=Ho[n]+t;if(r in Do)return r}}));function Bo(e,r){var o=r.data,i=e.data;if(!(t(o.staticStyle)&&t(o.style)&&t(i.staticStyle)&&t(i.style))){var a,s,c=r.elm,u=i.staticStyle,l=i.normalizedStyle||i.style||{},f=u||l,p=Lo(r.data.style)||{};r.data.normalizedStyle=n(p.__ob__)?S({},p):p;var d=function(e,t){for(var n,r={},o=e;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=Io(o.data))&&S(r,n);(n=Io(e.data))&&S(r,n);for(var i=e;i=i.parent;)i.data&&(n=Io(i.data))&&S(r,n);return r}(r);for(s in f)t(d[s])&&Uo(c,s,"");for(s in d)(a=d[s])!==f[s]&&Uo(c,s,null==a?"":a)}}var qo={create:Bo,update:Bo},zo=/\s+/;function Jo(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(zo).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Go(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(zo).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function Ko(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&S(t,Wo(e.name||"v")),S(t,e),t}return"string"==typeof e?Wo(e):void 0}}var Wo=_((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),Xo=J&&!Z,Zo="transition",Yo="animation",Qo="transition",ei="transitionend",ti="animation",ni="animationend";Xo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Qo="WebkitTransition",ei="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ti="WebkitAnimation",ni="webkitAnimationEnd"));var ri=J?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function oi(e){ri((function(){ri(e)}))}function ii(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Jo(e,t))}function ai(e,t){e._transitionClasses&&y(e._transitionClasses,t),Go(e,t)}function si(e,t,n){var r=ui(e,t),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s=o===Zo?ei:ni,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout((function(){c<a&&u()}),i+1),e.addEventListener(s,l)}var ci=/\b(transform|all)(,|$)/;function ui(e,t){var n,r=window.getComputedStyle(e),o=(r[Qo+"Delay"]||"").split(", "),i=(r[Qo+"Duration"]||"").split(", "),a=li(o,i),s=(r[ti+"Delay"]||"").split(", "),c=(r[ti+"Duration"]||"").split(", "),u=li(s,c),l=0,f=0;return t===Zo?a>0&&(n=Zo,l=a,f=i.length):t===Yo?u>0&&(n=Yo,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Zo:Yo:null)?n===Zo?i.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Zo&&ci.test(r[Qo+"Property"])}}function li(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map((function(t,n){return fi(t)+fi(e[n])})))}function fi(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function pi(e,r){var o=e.elm;n(o._leaveCb)&&(o._leaveCb.cancelled=!0,o._leaveCb());var a=Ko(e.data.transition);if(!t(a)&&!n(o._enterCb)&&1===o.nodeType){for(var s=a.css,c=a.type,u=a.enterClass,l=a.enterToClass,f=a.enterActiveClass,p=a.appearClass,v=a.appearToClass,h=a.appearActiveClass,m=a.beforeEnter,y=a.enter,g=a.afterEnter,b=a.enterCancelled,_=a.beforeAppear,w=a.appear,x=a.afterAppear,$=a.appearCancelled,C=a.duration,k=$n,A=$n.$vnode;A&&A.parent;)k=A.context,A=A.parent;var O=!k._isMounted||!e.isRootInsert;if(!O||w||""===w){var S=O&&p?p:u,T=O&&h?h:f,j=O&&v?v:l,E=O&&_||m,M=O&&"function"==typeof w?w:y,N=O&&x||g,P=O&&$||b,L=d(i(C)?C.enter:C);null!=L&&vi(L,"enter",e);var D=!1!==s&&!Z,R=mi(M),F=o._enterCb=I((function(){D&&(ai(o,j),ai(o,T)),F.cancelled?(D&&ai(o,S),P&&P(o)):N&&N(o),o._enterCb=null}));e.data.show||Et(e,"insert",(function(){var t=o.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),M&&M(o,F)})),E&&E(o),D&&(ii(o,S),ii(o,T),oi((function(){ai(o,S),F.cancelled||(ii(o,j),R||(hi(L)?setTimeout(F,L):si(o,c,F)))}))),e.data.show&&(r&&r(),M&&M(o,F)),D||R||F()}}}function di(e,r){var o=e.elm;n(o._enterCb)&&(o._enterCb.cancelled=!0,o._enterCb());var a=Ko(e.data.transition);if(t(a)||1!==o.nodeType)return r();if(!n(o._leaveCb)){var s=a.css,c=a.type,u=a.leaveClass,l=a.leaveToClass,f=a.leaveActiveClass,p=a.beforeLeave,v=a.leave,h=a.afterLeave,m=a.leaveCancelled,y=a.delayLeave,g=a.duration,b=!1!==s&&!Z,_=mi(v),w=d(i(g)?g.leave:g);n(w)&&vi(w,"leave",e);var x=o._leaveCb=I((function(){o.parentNode&&o.parentNode._pending&&(o.parentNode._pending[e.key]=null),b&&(ai(o,l),ai(o,f)),x.cancelled?(b&&ai(o,u),m&&m(o)):(r(),h&&h(o)),o._leaveCb=null}));y?y($):$()}function $(){x.cancelled||(!e.data.show&&o.parentNode&&((o.parentNode._pending||(o.parentNode._pending={}))[e.key]=e),p&&p(o),b&&(ii(o,u),ii(o,f),oi((function(){ai(o,u),x.cancelled||(ii(o,l),_||(hi(w)?setTimeout(x,w):si(o,c,x)))}))),v&&v(o,x),b||_||x())}}function vi(e,t,n){"number"!=typeof e?ue("<transition> explicit "+t+" duration is not a valid number - got "+JSON.stringify(e)+".",n.context):isNaN(e)&&ue("<transition> explicit "+t+" duration is NaN - the duration expression might be incorrect.",n.context)}function hi(e){return"number"==typeof e&&!isNaN(e)}function mi(e){if(t(e))return!1;var r=e.fns;return n(r)?mi(Array.isArray(r)?r[0]:r):(e._length||e.length)>1}function yi(e,t){!0!==t.data.show&&pi(t)}var gi=function(e){var i,a,s={},c=e.modules,l=e.nodeOps;for(i=0;i<jr.length;++i)for(s[jr[i]]=[],a=0;a<c.length;++a)n(c[a][jr[i]])&&s[jr[i]].push(c[a][jr[i]]);function f(e){var t=l.parentNode(e);n(t)&&l.removeChild(t,e)}function p(e,t){return!t&&!e.ns&&!(F.ignoredElements.length&&F.ignoredElements.some((function(t){return u(t)?t.test(e.tag):t===e.tag})))&&F.isUnknownElement(e.tag)}var d=0;function h(e,t,o,i,a,c,u){if(n(e.elm)&&n(c)&&(e=c[u]=Ce(e)),e.isRootInsert=!a,!function(e,t,o,i){var a=e.data;if(n(a)){var c=n(e.componentInstance)&&a.keepAlive;if(n(a=a.hook)&&n(a=a.init)&&a(e,!1),n(e.componentInstance))return m(e,t),y(o,e.elm,i),r(c)&&function(e,t,r,o){for(var i,a=e;a.componentInstance;)if(n(i=(a=a.componentInstance._vnode).data)&&n(i=i.transition)){for(i=0;i<s.activate.length;++i)s.activate[i](Tr,a);t.push(a);break}y(r,e.elm,o)}(e,t,o,i),!0}}(e,t,o,i)){var f=e.data,v=e.children,h=e.tag;n(h)?(f&&f.pre&&d++,p(e,d)&&ue("Unknown custom element: <"+h+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',e.context),e.elm=e.ns?l.createElementNS(e.ns,h):l.createElement(h,e),w(e),g(e,v,t),n(f)&&_(e,t),y(o,e.elm,i),f&&f.pre&&d--):r(e.isComment)?(e.elm=l.createComment(e.text),y(o,e.elm,i)):(e.elm=l.createTextNode(e.text),y(o,e.elm,i))}}function m(e,t){n(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,b(e)?(_(e,t),w(e)):(Sr(e),t.push(e))}function y(e,t,r){n(e)&&(n(r)?l.parentNode(r)===e&&l.insertBefore(e,t,r):l.appendChild(e,t))}function g(e,t,n){if(Array.isArray(t)){A(t);for(var r=0;r<t.length;++r)h(t[r],n,e.elm,null,!0,t,r)}else o(e.text)&&l.appendChild(e.elm,l.createTextNode(String(e.text)))}function b(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return n(e.tag)}function _(e,t){for(var r=0;r<s.create.length;++r)s.create[r](Tr,e);n(i=e.data.hook)&&(n(i.create)&&i.create(Tr,e),n(i.insert)&&t.push(e))}function w(e){var t;if(n(t=e.fnScopeId))l.setStyleScope(e.elm,t);else for(var r=e;r;)n(t=r.context)&&n(t=t.$options._scopeId)&&l.setStyleScope(e.elm,t),r=r.parent;n(t=$n)&&t!==e.context&&t!==e.fnContext&&n(t=t.$options._scopeId)&&l.setStyleScope(e.elm,t)}function x(e,t,n,r,o,i){for(;r<=o;++r)h(n[r],i,e,t,!1,n,r)}function $(e){var t,r,o=e.data;if(n(o))for(n(t=o.hook)&&n(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(n(t=e.children))for(r=0;r<e.children.length;++r)$(e.children[r])}function C(e,t,r,o){for(;r<=o;++r){var i=t[r];n(i)&&(n(i.tag)?(k(i),$(i)):f(i.elm))}}function k(e,t){if(n(t)||n(e.data)){var r,o=s.remove.length+1;for(n(t)?t.listeners+=o:t=function(e,t){function n(){0==--n.listeners&&f(e)}return n.listeners=t,n}(e.elm,o),n(r=e.componentInstance)&&n(r=r._vnode)&&n(r.data)&&k(r,t),r=0;r<s.remove.length;++r)s.remove[r](e,t);n(r=e.data.hook)&&n(r=r.remove)?r(e,t):t()}else f(e.elm)}function A(e){for(var t={},r=0;r<e.length;r++){var o=e[r],i=o.key;n(i)&&(t[i]?ue("Duplicate keys detected: '"+i+"'. This may cause an update error.",o.context):t[i]=!0)}}function O(e,t,r,o){for(var i=r;i<o;i++){var a=t[i];if(n(a)&&Er(e,a))return i}}function S(e,o,i,a,c,u){if(e!==o){n(o.elm)&&n(a)&&(o=a[c]=Ce(o));var f=o.elm=e.elm;if(r(e.isAsyncPlaceholder))n(o.asyncFactory.resolved)?M(e.elm,o,i):o.isAsyncPlaceholder=!0;else if(r(o.isStatic)&&r(e.isStatic)&&o.key===e.key&&(r(o.isCloned)||r(o.isOnce)))o.componentInstance=e.componentInstance;else{var p,d=o.data;n(d)&&n(p=d.hook)&&n(p=p.prepatch)&&p(e,o);var v=e.children,m=o.children;if(n(d)&&b(o)){for(p=0;p<s.update.length;++p)s.update[p](e,o);n(p=d.hook)&&n(p=p.update)&&p(e,o)}t(o.text)?n(v)&&n(m)?v!==m&&function(e,r,o,i,a){var s,c,u,f=0,p=0,d=r.length-1,v=r[0],m=r[d],y=o.length-1,g=o[0],b=o[y],_=!a;for(A(o);f<=d&&p<=y;)t(v)?v=r[++f]:t(m)?m=r[--d]:Er(v,g)?(S(v,g,i,o,p),v=r[++f],g=o[++p]):Er(m,b)?(S(m,b,i,o,y),m=r[--d],b=o[--y]):Er(v,b)?(S(v,b,i,o,y),_&&l.insertBefore(e,v.elm,l.nextSibling(m.elm)),v=r[++f],b=o[--y]):Er(m,g)?(S(m,g,i,o,p),_&&l.insertBefore(e,m.elm,v.elm),m=r[--d],g=o[++p]):(t(s)&&(s=Mr(r,f,d)),t(c=n(g.key)?s[g.key]:O(g,r,f,d))?h(g,i,e,v.elm,!1,o,p):Er(u=r[c],g)?(S(u,g,i,o,p),r[c]=void 0,_&&l.insertBefore(e,u.elm,v.elm)):h(g,i,e,v.elm,!1,o,p),g=o[++p]);f>d?x(e,t(o[y+1])?null:o[y+1].elm,o,p,y,i):p>y&&C(0,r,f,d)}(f,v,m,i,u):n(m)?(A(m),n(e.text)&&l.setTextContent(f,""),x(f,null,m,0,m.length-1,i)):n(v)?C(0,v,0,v.length-1):n(e.text)&&l.setTextContent(f,""):e.text!==o.text&&l.setTextContent(f,o.text),n(d)&&n(p=d.hook)&&n(p=p.postpatch)&&p(e,o)}}}function T(e,t,o){if(r(o)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var i=0;i<t.length;++i)t[i].data.hook.insert(t[i])}var j=!1,E=v("attrs,class,staticClass,staticStyle,key");function M(e,t,o,i){var a,s=t.tag,c=t.data,u=t.children;if(i=i||c&&c.pre,t.elm=e,r(t.isComment)&&n(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(!function(e,t,r){return n(t.tag)?0===t.tag.indexOf("vue-component")||!p(t,r)&&t.tag.toLowerCase()===(e.tagName&&e.tagName.toLowerCase()):e.nodeType===(t.isComment?8:3)}(e,t,i))return!1;if(n(c)&&(n(a=c.hook)&&n(a=a.init)&&a(t,!0),n(a=t.componentInstance)))return m(t,o),!0;if(n(s)){if(n(u))if(e.hasChildNodes())if(n(a=c)&&n(a=a.domProps)&&n(a=a.innerHTML)){if(a!==e.innerHTML)return"undefined"==typeof console||j||(j=!0,console.warn("Parent: ",e),console.warn("server innerHTML: ",a),console.warn("client innerHTML: ",e.innerHTML)),!1}else{for(var l=!0,f=e.firstChild,d=0;d<u.length;d++){if(!f||!M(f,u[d],o,i)){l=!1;break}f=f.nextSibling}if(!l||f)return"undefined"==typeof console||j||(j=!0,console.warn("Parent: ",e),console.warn("Mismatching childNodes vs. VNodes: ",e.childNodes,u)),!1}else g(t,u,o);if(n(c)){var v=!1;for(var h in c)if(!E(h)){v=!0,_(t,o);break}!v&&c.class&&At(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,o,i,a){if(!t(o)){var c,u=!1,f=[];if(t(e))u=!0,h(o,f);else{var p=n(e.nodeType);if(!p&&Er(e,o))S(e,o,f,null,null,a);else{if(p){if(1===e.nodeType&&e.hasAttribute(L)&&(e.removeAttribute(L),i=!0),r(i)){if(M(e,o,f))return T(o,f,!0),e;ue("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}c=e,e=new _e(l.tagName(c).toLowerCase(),{},[],void 0,c)}var d=e.elm,v=l.parentNode(d);if(h(o,f,d._leaveCb?null:v,l.nextSibling(d)),n(o.parent))for(var m=o.parent,y=b(o);m;){for(var g=0;g<s.destroy.length;++g)s.destroy[g](m);if(m.elm=o.elm,y){for(var _=0;_<s.create.length;++_)s.create[_](Tr,m);var w=m.data.hook.insert;if(w.merged)for(var x=1;x<w.fns.length;x++)w.fns[x]()}else Sr(m);m=m.parent}n(v)?C(0,[e],0,0):n(e.tag)&&$(e)}}return T(o,f,u),o.elm}n(e)&&$(e)}}({nodeOps:Ar,modules:[Br,Yr,jo,No,qo,J?{create:yi,activate:yi,remove:function(e,t){!0!==e.data.show?di(e,t):t()}}:{}].concat(Fr)});Z&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&Ai(e,"input")}));var bi={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?Et(n,"postpatch",(function(){bi.componentUpdated(e,t,n)})):_i(e,t,n.context),e._vOptions=[].map.call(e.options,$i)):("textarea"===n.tag||Cr(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",Ci),e.addEventListener("compositionend",ki),e.addEventListener("change",ki),Z&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){_i(e,t,n.context);var r=e._vOptions,o=e._vOptions=[].map.call(e.options,$i);o.some((function(e,t){return!N(e,r[t])}))&&(e.multiple?t.value.some((function(e){return xi(e,o)})):t.value!==t.oldValue&&xi(t.value,o))&&Ai(e,"change")}}};function _i(e,t,n){wi(e,t,n),(X||Y)&&setTimeout((function(){wi(e,t,n)}),0)}function wi(e,t,n){var r=t.value,o=e.multiple;if(!o||Array.isArray(r)){for(var i,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],o)i=P(r,$i(a))>-1,a.selected!==i&&(a.selected=i);else if(N($i(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));o||(e.selectedIndex=-1)}else ue('<select multiple v-model="'+t.expression+'"> expects an Array value for its binding, but got '+Object.prototype.toString.call(r).slice(8,-1),n)}function xi(e,t){return t.every((function(t){return!N(t,e)}))}function $i(e){return"_value"in e?e._value:e.value}function Ci(e){e.target.composing=!0}function ki(e){e.target.composing&&(e.target.composing=!1,Ai(e.target,"input"))}function Ai(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Oi(e){return!e.componentInstance||e.data&&e.data.transition?e:Oi(e.componentInstance._vnode)}var Si={bind:function(e,t,n){var r=t.value,o=(n=Oi(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&o?(n.data.show=!0,pi(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Oi(n)).data&&n.data.transition?(n.data.show=!0,r?pi(n,(function(){e.style.display=e.__vOriginalDisplay})):di(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,o){o||(e.style.display=e.__vOriginalDisplay)}},Ti={model:bi,show:Si},ji={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 Ei(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ei(yn(t.children)):e}function Mi(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var o=n._parentListeners;for(var i in o)t[x(i)]=o[i];return t}function Ni(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Pi=function(e){return e.tag||mn(e)},Ii=function(e){return"show"===e.name},Li={name:"transition",props:ji,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Pi)).length){n.length>1&&ue("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;r&&"in-out"!==r&&"out-in"!==r&&ue("invalid <transition> mode: "+r,this.$parent);var i=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return i;var a=Ei(i);if(!a)return i;if(this._leaving)return Ni(e,i);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:o(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Mi(this),u=this._vnode,l=Ei(u);if(a.data.directives&&a.data.directives.some(Ii)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!mn(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=S({},c);if("out-in"===r)return this._leaving=!0,Et(f,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Ni(e,i);if("in-out"===r){if(mn(a))return u;var p,d=function(){p()};Et(c,"afterEnter",d),Et(c,"enterCancelled",d),Et(f,"delayLeave",(function(e){p=e}))}}return i}}},Di=S({tag:String,moveClass:String},ji);delete Di.mode;var Ri={props:Di,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var o=kn(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,o(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=Mi(this),s=0;s<o.length;s++){var c=o[s];if(c.tag)if(null!=c.key&&0!==String(c.key).indexOf("__vlist"))i.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a;else{var u=c.componentOptions,l=u?u.Ctor.options.name||u.tag||"":c.tag;ue("<transition-group> children must be keyed: <"+l+">")}}if(r){for(var f=[],p=[],d=0;d<r.length;d++){var v=r[d];v.data.transition=a,v.data.pos=v.elm.getBoundingClientRect(),n[v.key]?f.push(v):p.push(v)}this.kept=e(t,null,f),this.removed=p}return e(t,null,i)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Fi),e.forEach(Ui),e.forEach(Hi),this._reflow=document.body.offsetHeight,e.forEach((function(e){if(e.data.moved){var n=e.elm,r=n.style;ii(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(ei,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(ei,e),n._moveCb=null,ai(n,t))})}})))},methods:{hasMove:function(e,t){if(!Xo)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach((function(e){Go(n,e)})),Jo(n,t),n.style.display="none",this.$el.appendChild(n);var r=ui(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Fi(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Ui(e){e.data.newPos=e.elm.getBoundingClientRect()}function Hi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,o=t.top-n.top;if(r||o){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+o+"px)",i.transitionDuration="0s"}}var Vi={Transition:Li,TransitionGroup:Ri};Yn.config.mustUseProp=sr,Yn.config.isReservedTag=wr,Yn.config.isReservedAttr=ir,Yn.config.getTagNamespace=xr,Yn.config.isUnknownElement=function(e){if(!J)return!0;if(wr(e))return!1;if(e=e.toLowerCase(),null!=$r[e])return $r[e];var t=document.createElement(e);return e.indexOf("-")>-1?$r[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:$r[e]=/HTMLUnknownElement/.test(t.toString())},S(Yn.options.directives,Ti),S(Yn.options.components,Vi),Yn.prototype.__patch__=J?gi:j,Yn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=xe,e.$options.template&&"#"!==e.$options.template.charAt(0)||e.$options.el||t?ue("You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",e):ue("Failed to mount component: template or render function not defined.",e)),Tn(e,"beforeMount"),r=F.performance&&it?function(){var t=e._name,r=e._uid,o="vue-perf-start:"+r,i="vue-perf-end:"+r;it(o);var a=e._render();it(i),at("vue "+t+" render",o,i),it(o),e._update(a,n),it(i),at("vue "+t+" patch",o,i)}:function(){e._update(e._render(),n)},new Vn(e,r,j,{before:function(){e._isMounted&&!e._isDestroyed&&Tn(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Tn(e,"mounted")),e}(this,e=e&&J?kr(e):void 0,t)},J&&setTimeout((function(){F.devtools&&(ie?ie.emit("init",Yn):console[console.info?"info":"log"]("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")),!1!==F.productionTip&&"undefined"!=typeof console&&console[console.info?"info":"log"]("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html")}),0);var Bi=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,zi=_((function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}));function Ji(e,t){var n=t?zi(t):Bi;if(n.test(e)){for(var r,o,i,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(o=r.index)>c&&(s.push(i=e.slice(c,o)),a.push(JSON.stringify(i)));var u=eo(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=o+r[0].length}return c<e.length&&(s.push(i=e.slice(c)),a.push(JSON.stringify(i))),{expression:a.join("+"),tokens:s}}}var Gi,Ki={staticKeys:["staticClass"],transformNode:function(e,t){var n=t.warn||no,r=po(e,"class");r&&Ji(r,t.delimiters)&&n('class="'+r+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div class="{{ val }}">, use <div :class="val">.',e.rawAttrsMap.class),r&&(e.staticClass=JSON.stringify(r));var o=fo(e,"class",!1);o&&(e.classBinding=o)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},Wi={staticKeys:["staticStyle"],transformNode:function(e,t){var n=t.warn||no,r=po(e,"style");r&&(Ji(r,t.delimiters)&&n('style="'+r+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div style="{{ val }}">, use <div :style="val">.',e.rawAttrsMap.style),e.staticStyle=JSON.stringify(Po(r)));var o=fo(e,"style",!1);o&&(e.styleBinding=o)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Xi=v("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Zi=v("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Yi=v("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"),Qi=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ea=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ta="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+U.source+"]*",na="((?:"+ta+"\\:)?"+ta+")",ra=new RegExp("^<"+na),oa=/^\s*(\/?)>/,ia=new RegExp("^<\\/"+na+"[^>]*>"),aa=/^<!DOCTYPE [^>]+>/i,sa=/^<!\--/,ca=/^<!\[/,ua=v("script,style,textarea",!0),la={},fa={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t","&#39;":"'"},pa=/&(?:lt|gt|quot|amp|#39);/g,da=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,va=v("pre,textarea",!0),ha=function(e,t){return e&&va(e)&&"\n"===t[0]};function ma(e,t){var n=t?da:pa;return e.replace(n,(function(e){return fa[e]}))}var ya,ga,ba,_a,wa,xa,$a,Ca,ka,Aa=/^@|^v-on:/,Oa=/^v-|^@|^:/,Sa=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Ta=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ja=/^\(|\)$/g,Ea=/^\[.*\]$/,Ma=/:(.*)$/,Na=/^:|^\.|^v-bind:/,Pa=/\.[^.\]]+(?=[^\]]*$)/g,Ia=/^v-slot(:|$)|^#/,La=/[\r\n]/,Da=/\s+/g,Ra=/[\s"'<>\/=]/,Fa=_((function(e){return(Gi=Gi||document.createElement("div")).innerHTML=e,Gi.textContent})),Ua="_empty_";function Ha(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:Ga(t),rawAttrsMap:{},parent:n,children:[]}}function Va(e,t){var n;!function(e){var t=fo(e,"key");if(t){if("template"===e.tag&&ya("<template> cannot be keyed. Place the key on real elements instead.",lo(e,"key")),e.for){var n=e.iterator2||e.iterator1,r=e.parent;n&&n===t&&r&&"transition-group"===r.tag&&ya("Do not use v-for index as key on <transition-group> children, this is the same as not using keys.",lo(e,"key"),!0)}e.key=t}}(e),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=fo(e,"ref");t&&(e.ref=t,e.refInFor=function(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;"template"===e.tag?((t=po(e,"scope"))&&ya('the "scope" attribute for scoped slots have been deprecated and replaced by "slot-scope" since 2.5. The new "slot-scope" attribute can also be used on plain elements in addition to <template> to denote scoped slots.',e.rawAttrsMap.scope,!0),e.slotScope=t||po(e,"slot-scope")):(t=po(e,"slot-scope"))&&(e.attrsMap["v-for"]&&ya("Ambiguous combined usage of slot-scope and v-for on <"+e.tag+"> (v-for takes higher priority). Use a wrapper <template> for the scoped slot to make it clearer.",e.rawAttrsMap["slot-scope"],!0),e.slotScope=t);var n=fo(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||io(e,"slot",n,lo(e,"slot"))),"template"===e.tag){var r=vo(e,Ia);if(r){(e.slotTarget||e.slotScope)&&ya("Unexpected mixed usage of different slot syntaxes.",e),e.parent&&!ka(e.parent)&&ya("<template v-slot> can only appear at the root level inside the receiving the component",e);var o=za(r),i=o.name,a=o.dynamic;e.slotTarget=i,e.slotTargetDynamic=a,e.slotScope=r.value||Ua}}else{var s=vo(e,Ia);if(s){ka(e)||ya("v-slot can only be used on components or <template>.",s),(e.slotScope||e.slotTarget)&&ya("Unexpected mixed usage of different slot syntaxes.",e),e.scopedSlots&&ya("To avoid scope ambiguity, the default slot should also use <template> syntax when there are other named slots.",s);var c=e.scopedSlots||(e.scopedSlots={}),u=za(s),l=u.name,f=u.dynamic,p=c[l]=Ha("template",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter((function(e){if(!e.slotScope)return e.parent=p,!0})),p.slotScope=s.value||Ua,e.children=[],e.plain=!1}}}(e),"slot"===(n=e).tag&&(n.slotName=fo(n,"name"),n.key&&ya("`key` does not work on <slot> because slots are abstract outlets and can possibly expand into multiple elements. Use the key on a wrapping element instead.",lo(n,"key"))),function(e){var t;(t=fo(e,"is"))&&(e.component=t),null!=po(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var r=0;r<ba.length;r++)e=ba[r](e,t)||e;return function(e){var t,n,r,o,i,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++)if(r=o=u[t].name,i=u[t].value,Oa.test(r))if(e.hasBindings=!0,(a=Ja(r.replace(Oa,"")))&&(r=r.replace(Pa,"")),Na.test(r))r=r.replace(Na,""),i=eo(i),(c=Ea.test(r))&&(r=r.slice(1,-1)),0===i.trim().length&&ya('The value for a v-bind expression cannot be empty. Found in "v-bind:'+r+'"'),a&&(a.prop&&!c&&"innerHtml"===(r=x(r))&&(r="innerHTML"),a.camel&&!c&&(r=x(r)),a.sync&&(s=yo(i,"$event"),c?uo(e,'"update:"+('+r+")",s,null,!1,ya,u[t],!0):(uo(e,"update:"+x(r),s,null,!1,ya,u[t]),k(r)!==x(r)&&uo(e,"update:"+k(r),s,null,!1,ya,u[t])))),a&&a.prop||!e.component&&$a(e.tag,e.attrsMap.type,r)?oo(e,r,i,u[t],c):io(e,r,i,u[t],c);else if(Aa.test(r))r=r.replace(Aa,""),(c=Ea.test(r))&&(r=r.slice(1,-1)),uo(e,r,i,a,!1,ya,u[t],c);else{var l=(r=r.replace(Oa,"")).match(Ma),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),Ea.test(f)&&(f=f.slice(1,-1),c=!0)),so(e,r,o,i,f,c,a,u[t]),"model"===r&&Xa(e,i)}else Ji(i,ga)&&ya(r+'="'+i+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.',u[t]),io(e,r,JSON.stringify(i),u[t]),!e.component&&"muted"===r&&$a(e.tag,e.attrsMap.type,r)&&oo(e,r,"true",u[t])}(e),e}function Ba(e){var t;if(t=po(e,"v-for")){var n=function(e){var t=e.match(Sa);if(t){var n={};n.for=t[2].trim();var r=t[1].trim().replace(ja,""),o=r.match(Ta);return o?(n.alias=r.replace(Ta,"").trim(),n.iterator1=o[1].trim(),o[2]&&(n.iterator2=o[2].trim())):n.alias=r,n}}(t);n?S(e,n):ya("Invalid v-for expression: "+t,e.rawAttrsMap["v-for"])}}function qa(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function za(e){var t=e.name.replace(Ia,"");return t||("#"!==e.name[0]?t="default":ya("v-slot shorthand syntax requires a slot name.",e)),Ea.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function Ja(e){var t=e.match(Pa);if(t){var n={};return t.forEach((function(e){n[e.slice(1)]=!0})),n}}function Ga(e){for(var t={},n=0,r=e.length;n<r;n++)!t[e[n].name]||X||Y||ya("duplicate attribute: "+e[n].name,e[n]),t[e[n].name]=e[n].value;return t}var Ka=/^xmlns:NS\d+/,Wa=/^NS\d+:/;function Xa(e,t){for(var n=e;n;)n.for&&n.alias===t&&ya("<"+e.tag+' v-model="'+t+'">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.',e.rawAttrsMap["v-model"]),n=n.parent}function Za(e){return Ha(e.tag,e.attrsList.slice(),e.parent)}var Ya,Qa,es,ts=[Ki,Wi,{preTransformNode:function(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=fo(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var o=po(e,"v-if",!0),i=o?"&&("+o+")":"",a=null!=po(e,"v-else",!0),s=po(e,"v-else-if",!0),c=Za(e);Ba(c),ao(c,"type","checkbox"),Va(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+i,qa(c,{exp:c.if,block:c});var u=Za(e);po(u,"v-for",!0),ao(u,"type","radio"),Va(u,t),qa(c,{exp:"("+n+")==='radio'"+i,block:u});var l=Za(e);return po(l,"v-for",!0),ao(l,":type",n),Va(l,t),qa(c,{exp:o,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}}],ns={model:function(e,t,n){Zr=n;var r=t.value,o=t.modifiers,i=e.tag,a=e.attrsMap.type;if("input"===i&&"file"===a&&Zr("<"+e.tag+' v-model="'+r+'" type="file">:\nFile inputs are read only. Use a v-on:change listener instead.',e.rawAttrsMap["v-model"]),e.component)return mo(e,r,o),!1;if("select"===i)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";uo(e,"change",r=r+" "+yo(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),null,!0)}(e,r,o);else if("input"===i&&"checkbox"===a)!function(e,t,n){var r=n&&n.number,o=fo(e,"value")||"null",i=fo(e,"true-value")||"true",a=fo(e,"false-value")||"false";oo(e,"checked","Array.isArray("+t+")?_i("+t+","+o+")>-1"+("true"===i?":("+t+")":":_q("+t+","+i+")")),uo(e,"change","var $$a="+t+",$$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&&("+yo(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+yo(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+yo(t,"$$c")+"}",null,!0)}(e,r,o);else if("input"===i&&"radio"===a)!function(e,t,n){var r=n&&n.number,o=fo(e,"value")||"null";oo(e,"checked","_q("+t+","+(o=r?"_n("+o+")":o)+")"),uo(e,"change",yo(t,o),null,!0)}(e,r,o);else if("input"===i||"textarea"===i)!function(e,t,n){var r=e.attrsMap.type,o=e.attrsMap["v-bind:value"]||e.attrsMap[":value"],i=e.attrsMap["v-bind:type"]||e.attrsMap[":type"];if(o&&!i){var a=e.attrsMap["v-bind:value"]?"v-bind:value":":value";Zr(a+'="'+o+'" conflicts with v-model on the same element because the latter already expands to a value binding internally',e.rawAttrsMap[a])}var s=n||{},c=s.lazy,u=s.number,l=s.trim,f=!c&&"range"!==r,p=c?"change":"range"===r?"__r":"input",d="$event.target.value";l&&(d="$event.target.value.trim()"),u&&(d="_n("+d+")");var v=yo(t,d);f&&(v="if($event.target.composing)return;"+v),oo(e,"value","("+t+")"),uo(e,p,v,null,!0),(l||u)&&uo(e,"blur","$forceUpdate()")}(e,r,o);else{if(!F.isReservedTag(i))return mo(e,r,o),!1;Zr("<"+e.tag+' v-model="'+r+"\">: v-model is not supported on this element type. If you are working with contenteditable, it's recommended to wrap a library dedicated for that purpose inside a custom component.",e.rawAttrsMap["v-model"])}return!0},text:function(e,t){t.value&&oo(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&oo(e,"innerHTML","_s("+t.value+")",t)}},rs={expectHTML:!0,modules:ts,directives:ns,isPreTag:function(e){return"pre"===e},isUnaryTag:Xi,mustUseProp:sr,canBeLeftOpenTag:Zi,isReservedTag:wr,getTagNamespace:xr,staticKeys:(es=ts,es.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(","))},os=_((function(e){return v("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));function is(e,t){e&&(Ya=os(t.staticKeys||""),Qa=t.isReservedTag||E,as(e),ss(e,!1))}function as(e){if(e.static=function(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||h(e.tag)||!Qa(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Ya))))}(e),1===e.type){if(!Qa(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];as(r),r.static||(e.static=!1)}if(e.ifConditions)for(var o=1,i=e.ifConditions.length;o<i;o++){var a=e.ifConditions[o].block;as(a),a.static||(e.static=!1)}}}function ss(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)ss(e.children[n],t||!!e.for);if(e.ifConditions)for(var o=1,i=e.ifConditions.length;o<i;o++)ss(e.ifConditions[o].block,t)}}var cs=/^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/,us=/\([^)]*?\);*$/,ls=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,fs={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ps={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"]},ds=function(e){return"if("+e+")return null;"},vs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:ds("$event.target !== $event.currentTarget"),ctrl:ds("!$event.ctrlKey"),shift:ds("!$event.shiftKey"),alt:ds("!$event.altKey"),meta:ds("!$event.metaKey"),left:ds("'button' in $event && $event.button !== 0"),middle:ds("'button' in $event && $event.button !== 1"),right:ds("'button' in $event && $event.button !== 2")};function hs(e,t){var n=t?"nativeOn:":"on:",r="",o="";for(var i in e){var a=ms(e[i]);e[i]&&e[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 ms(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return ms(e)})).join(",")+"]";var t=ls.test(e.value),n=cs.test(e.value),r=ls.test(e.value.replace(us,""));if(e.modifiers){var o="",i="",a=[];for(var s in e.modifiers)if(vs[s])i+=vs[s],fs[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;i+=ds(["ctrl","shift","alt","meta"].filter((function(e){return!c[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else a.push(s);return a.length&&(o+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(ys).join("&&")+")return null;"}(a)),i&&(o+=i),"function($event){"+o+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function ys(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=fs[e],r=ps[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var gs={on:function(e,t){t.modifiers&&ue("v-on without argument does not support modifiers."),e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:j},bs=function(e){this.options=e,this.warn=e.warn||no,this.transforms=ro(e.modules,"transformCode"),this.dataGenFns=ro(e.modules,"genData"),this.directives=S(S({},gs),e.directives);var t=e.isReservedTag||E;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function _s(e,t){var n=new bs(t);return{render:"with(this){return "+(e?ws(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function ws(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return xs(e,t);if(e.once&&!e.onceProcessed)return $s(e,t);if(e.for&&!e.forProcessed)return As(e,t);if(e.if&&!e.ifProcessed)return Cs(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=js(e,t),o="_t("+n+(r?","+r:""),i=e.attrs||e.dynamicAttrs?Ns((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:x(e.name),value:e.value,dynamic:e.dynamic}}))):null,a=e.attrsMap["v-bind"];return!i&&!a||r||(o+=",null"),i&&(o+=","+i),a&&(o+=(i?"":",null")+","+a),o+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:js(t,n,!0);return"_c("+e+","+Os(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Os(e,t));var o=e.inlineTemplate?null:js(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(o?","+o:"")+")"}for(var i=0;i<t.transforms.length;i++)n=t.transforms[i](e,n);return n}return js(e,t)||"void 0"}function xs(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+ws(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function $s(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Cs(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+ws(e,t)+","+t.onceId+++","+n+")":(t.warn("v-once can only be used inside v-for that is keyed. ",e.rawAttrsMap["v-once"]),ws(e,t))}return xs(e,t)}function Cs(e,t,n,r){return e.ifProcessed=!0,ks(e.ifConditions.slice(),t,n,r)}function ks(e,t,n,r){if(!e.length)return r||"_e()";var o=e.shift();return o.exp?"("+o.exp+")?"+i(o.block)+":"+ks(e,t,n,r):""+i(o.block);function i(e){return n?n(e,t):e.once?$s(e,t):ws(e,t)}}function As(e,t,n,r){var o=e.for,i=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return t.maybeComponent(e)&&"slot"!==e.tag&&"template"!==e.tag&&!e.key&&t.warn("<"+e.tag+' v-for="'+i+" in "+o+'">: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.',e.rawAttrsMap["v-for"],!0),e.forProcessed=!0,(r||"_l")+"(("+o+"),function("+i+a+s+"){return "+(n||ws)(e,t)+"})"}function Os(e,t){var n="{",r=function(e,t){var n=e.directives;if(n){var r,o,i,a,s="directives:[",c=!1;for(r=0,o=n.length;r<o;r++){i=n[r],a=!0;var u=t.directives[i.name];u&&(a=!!u(e,i,t.warn)),a&&(c=!0,s+='{name:"'+i.name+'",rawName:"'+i.rawName+'"'+(i.value?",value:("+i.value+"),expression:"+JSON.stringify(i.value):"")+(i.arg?",arg:"+(i.isDynamicArg?i.arg:'"'+i.arg+'"'):"")+(i.modifiers?",modifiers:"+JSON.stringify(i.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var o=0;o<t.dataGenFns.length;o++)n+=t.dataGenFns[o](e);if(e.attrs&&(n+="attrs:"+Ns(e.attrs)+","),e.props&&(n+="domProps:"+Ns(e.props)+","),e.events&&(n+=hs(e.events,!1)+","),e.nativeEvents&&(n+=hs(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some((function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||Ss(n)})),o=!!e.if;if(!r)for(var i=e.parent;i;){if(i.slotScope&&i.slotScope!==Ua||i.for){r=!0;break}i.if&&(o=!0),i=i.parent}var a=Object.keys(t).map((function(e){return Ts(t[e],n)})).join(",");return"scopedSlots:_u(["+a+"]"+(r?",null,true":"")+(!r&&o?",null,false,"+function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var i=function(e,t){var n=e.children[0];if(1===e.children.length&&1===n.type||t.warn("Inline-template components must have exactly one child element.",{start:e.start}),n&&1===n.type){var r=_s(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);i&&(n+=i+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Ns(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ss(e){return 1===e.type&&("slot"===e.tag||e.children.some(Ss))}function Ts(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Cs(e,t,Ts,"null");if(e.for&&!e.forProcessed)return As(e,t,Ts);var r=e.slotScope===Ua?"":String(e.slotScope),o="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(js(e,t)||"undefined")+":undefined":js(e,t)||"undefined":ws(e,t))+"}",i=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+o+i+"}"}function js(e,t,n,r,o){var i=e.children;if(i.length){var a=i[0];if(1===i.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||ws)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var o=e[r];if(1===o.type){if(Es(o)||o.ifConditions&&o.ifConditions.some((function(e){return Es(e.block)}))){n=2;break}(t(o)||o.ifConditions&&o.ifConditions.some((function(e){return t(e.block)})))&&(n=1)}}return n}(i,t.maybeComponent):0,u=o||Ms;return"["+i.map((function(e){return u(e,t)})).join(",")+"]"+(c?","+c:"")}}function Es(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function Ms(e,t){return 1===e.type?ws(e,t):3===e.type&&e.isComment?function(e){return"_e("+JSON.stringify(e.text)+")"}(e):"_v("+(2===(n=e).type?n.expression:Ps(JSON.stringify(n.text)))+")";var n}function Ns(e){for(var t="",n="",r=0;r<e.length;r++){var o=e[r],i=Ps(o.value);o.dynamic?n+=o.name+","+i+",":t+='"'+o.name+'":'+i+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function Ps(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var Is=new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),Ls=new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),Ds=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function Rs(e,t){e&&Fs(e,t)}function Fs(e,t){if(1===e.type){for(var n in e.attrsMap)if(Oa.test(n)){var r=e.attrsMap[n];if(r){var o=e.rawAttrsMap[n];"v-for"===n?Hs(e,'v-for="'+r+'"',t,o):Aa.test(n)?Us(r,n+'="'+r+'"',t,o):Bs(r,n+'="'+r+'"',t,o)}}if(e.children)for(var i=0;i<e.children.length;i++)Fs(e.children[i],t)}else 2===e.type&&Bs(e.expression,e.text,t,e)}function Us(e,t,n,r){var o=e.replace(Ds,""),i=o.match(Ls);i&&"$"!==o.charAt(i.index-1)&&n('avoid using JavaScript unary operator as property name: "'+i[0]+'" in expression '+t.trim(),r),Bs(e,t,n,r)}function Hs(e,t,n,r){Bs(e.for||"",t,n,r),Vs(e.alias,"v-for alias",t,n,r),Vs(e.iterator1,"v-for iterator",t,n,r),Vs(e.iterator2,"v-for iterator",t,n,r)}function Vs(e,t,n,r,o){if("string"==typeof e)try{new Function("var "+e+"=_")}catch(i){r("invalid "+t+' "'+e+'" in expression: '+n.trim(),o)}}function Bs(e,t,n,r){try{new Function("return "+e)}catch(i){var o=e.replace(Ds,"").match(Is);n(o?'avoid using JavaScript keyword as property name: "'+o[0]+'"\n Raw expression: '+t.trim():"invalid expression: "+i.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}function qs(e,t){var n="";if(t>0)for(;1&t&&(n+=e),!((t>>>=1)<=0);)e+=e;return n}function zs(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),j}}function Js(e){var t=Object.create(null);return function(n,r,o){var i=(r=S({},r)).warn||ue;delete r.warn;try{new Function("return 1")}catch(e){e.toString().match(/unsafe-eval|CSP/)&&i("It seems you are using the standalone build of Vue.js in an environment with Content Security Policy that prohibits unsafe-eval. The template compiler cannot work in this environment. Consider relaxing the policy to allow unsafe-eval or pre-compiling your templates into render functions.")}var a=r.delimiters?String(r.delimiters)+n:n;if(t[a])return t[a];var s=e(n,r);s.errors&&s.errors.length&&(r.outputSourceRange?s.errors.forEach((function(e){i("Error compiling template:\n\n"+e.msg+"\n\n"+function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length);for(var r=e.split(/\r?\n/),o=0,i=[],a=0;a<r.length;a++)if((o+=r[a].length+1)>=t){for(var s=a-2;s<=a+2||n>o;s++)if(!(s<0||s>=r.length)){i.push(""+(s+1)+qs(" ",3-String(s+1).length)+"| "+r[s]);var c=r[s].length;if(s===a){var u=t-(o-c)+1,l=n>o?c-u:n-t;i.push(" | "+qs(" ",u)+qs("^",l))}else if(s>a){if(n>o){var f=Math.min(n-o,c);i.push(" | "+qs("^",f))}o+=c+1}}break}return i.join("\n")}(n,e.start,e.end),o)})):i("Error compiling template:\n\n"+n+"\n\n"+s.errors.map((function(e){return"- "+e})).join("\n")+"\n",o)),s.tips&&s.tips.length&&(r.outputSourceRange?s.tips.forEach((function(e){return le(e.msg,o)})):s.tips.forEach((function(e){return le(e,o)})));var c={},u=[];return c.render=zs(s.render,u),c.staticRenderFns=s.staticRenderFns.map((function(e){return zs(e,u)})),s.errors&&s.errors.length||!u.length||i("Failed to generate render function:\n\n"+u.map((function(e){var t=e.err,n=e.code;return t.toString()+" in\n\n"+n+"\n"})).join("\n"),o),t[a]=c}}var Gs,Ks,Ws=(Gs=function(e,t){var n=function(e,t){ya=t.warn||no,xa=t.isPreTag||E,$a=t.mustUseProp||E,Ca=t.getTagNamespace||E;var n=t.isReservedTag||E;ka=function(e){return!!e.component||!n(e.tag)},ba=ro(t.modules,"transformNode"),_a=ro(t.modules,"preTransformNode"),wa=ro(t.modules,"postTransformNode"),ga=t.delimiters;var r,o,i=[],a=!1!==t.preserveWhitespace,s=t.whitespace,c=!1,u=!1,l=!1;function f(e,t){l||(l=!0,ya(e,t))}function p(e){if(d(e),c||e.processed||(e=Va(e,t)),i.length||e===r||(r.if&&(e.elseif||e.else)?(v(e),qa(r,{exp:e.elseif,block:e})):f("Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.",{start:e.start})),o&&!e.forbidden)if(e.elseif||e.else)a=e,s=function(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];" "!==e[t].text&&ya('text "'+e[t].text.trim()+'" between v-if and v-else(-if) will be ignored.',e[t]),e.pop()}}(o.children),s&&s.if?qa(s,{exp:a.elseif,block:a}):ya("v-"+(a.elseif?'else-if="'+a.elseif+'"':"else")+" used on element <"+a.tag+"> without corresponding v-if.",a.rawAttrsMap[a.elseif?"v-else-if":"v-else"]);else{if(e.slotScope){var n=e.slotTarget||'"default"';(o.scopedSlots||(o.scopedSlots={}))[n]=e}o.children.push(e),e.parent=o}var a,s;e.children=e.children.filter((function(e){return!e.slotScope})),d(e),e.pre&&(c=!1),xa(e.tag)&&(u=!1);for(var l=0;l<wa.length;l++)wa[l](e,t)}function d(e){if(!u)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}function v(e){"slot"!==e.tag&&"template"!==e.tag||f("Cannot use <"+e.tag+"> as component root element because it may contain multiple nodes.",{start:e.start}),e.attrsMap.hasOwnProperty("v-for")&&f("Cannot use v-for on stateful component root element because it renders multiple elements.",e.rawAttrsMap["v-for"])}return function(e,t){for(var n,r,o=[],i=t.expectHTML,a=t.isUnaryTag||E,s=t.canBeLeftOpenTag||E,c=0;e;){if(n=e,r&&ua(r)){var u=0,l=r.toLowerCase(),f=la[l]||(la[l]=new RegExp("([\\s\\S]*?)(</"+l+"[^>]*>)","i")),p=e.replace(f,(function(e,n,r){return u=r.length,ua(l)||"noscript"===l||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),ha(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(sa.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),$(v+3);continue}}if(ca.test(e)){var h=e.indexOf("]>");if(h>=0){$(h+2);continue}}var m=e.match(aa);if(m){$(m[0].length);continue}var y=e.match(ia);if(y){var g=c;$(y[0].length),A(y[1],g,c);continue}var b=C();if(b){k(b),ha(b.tagName,e)&&$(1);continue}}var _=void 0,w=void 0,x=void 0;if(d>=0){for(w=e.slice(d);!(ia.test(w)||ra.test(w)||sa.test(w)||ca.test(w)||(x=w.indexOf("<",1))<0);)d+=x,w=e.slice(d);_=e.substring(0,d)}d<0&&(_=e),_&&$(_.length),t.chars&&_&&t.chars(_,c-_.length,c)}if(e===n){t.chars&&t.chars(e),!o.length&&t.warn&&t.warn('Mal-formatted tag at end of template: "'+e+'"',{start:c+e.length});break}}function $(t){c+=t,e=e.substring(t)}function C(){var t=e.match(ra);if(t){var n,r,o={tagName:t[1],attrs:[],start:c};for($(t[0].length);!(n=e.match(oa))&&(r=e.match(ea)||e.match(Qi));)r.start=c,$(r[0].length),r.end=c,o.attrs.push(r);if(n)return o.unarySlash=n[1],$(n[0].length),o.end=c,o}}function k(e){var n=e.tagName,c=e.unarySlash;i&&("p"===r&&Yi(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||"",h="a"===n&&"href"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:ma(v,h)},t.outputSourceRange&&(f[p].start=d.start+d[0].match(/^\s*/).length,f[p].end=d.end)}u||(o.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function A(e,n,i){var a,s;if(null==n&&(n=c),null==i&&(i=c),e)for(s=e.toLowerCase(),a=o.length-1;a>=0&&o[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=o.length-1;u>=a;u--)(u>a||!e&&t.warn)&&t.warn("tag <"+o[u].tag+"> has no matching end tag.",{start:o[u].start,end:o[u].end}),t.end&&t.end(o[u].tag,n,i);o.length=a,r=a&&o[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,i):"p"===s&&(t.start&&t.start(e,[],!1,n,i),t.end&&t.end(e,n,i))}A()}(e,{warn:ya,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,n,a,s,l){var f=o&&o.ns||Ca(e);X&&"svg"===f&&(n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Ka.test(r.name)||(r.name=r.name.replace(Wa,""),t.push(r))}return t}(n));var d,h=Ha(e,n,o);f&&(h.ns=f),t.outputSourceRange&&(h.start=s,h.end=l,h.rawAttrsMap=h.attrsList.reduce((function(e,t){return e[t.name]=t,e}),{})),n.forEach((function(e){Ra.test(e.name)&&ya("Invalid dynamic argument expression: attribute names cannot contain spaces, quotes, <, >, / or =.",{start:e.start+e.name.indexOf("["),end:e.start+e.name.length})})),"style"!==(d=h).tag&&("script"!==d.tag||d.attrsMap.type&&"text/javascript"!==d.attrsMap.type)||oe()||(h.forbidden=!0,ya("Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <"+e+">, as they will not be parsed.",{start:h.start}));for(var m=0;m<_a.length;m++)h=_a[m](h,t)||h;c||(function(e){null!=po(e,"v-pre")&&(e.pre=!0)}(h),h.pre&&(c=!0)),xa(h.tag)&&(u=!0),c?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),o=0;o<n;o++)r[o]={name:t[o].name,value:JSON.stringify(t[o].value)},null!=t[o].start&&(r[o].start=t[o].start,r[o].end=t[o].end);else e.pre||(e.plain=!0)}(h):h.processed||(Ba(h),function(e){var t=po(e,"v-if");if(t)e.if=t,qa(e,{exp:t,block:e});else{null!=po(e,"v-else")&&(e.else=!0);var n=po(e,"v-else-if");n&&(e.elseif=n)}}(h),function(e){null!=po(e,"v-once")&&(e.once=!0)}(h)),r||v(r=h),a?p(h):(o=h,i.push(h))},end:function(e,n,r){var a=i[i.length-1];i.length-=1,o=i[i.length-1],t.outputSourceRange&&(a.end=r),p(a)},chars:function(n,r,i){if(o){if(!X||"textarea"!==o.tag||o.attrsMap.placeholder!==n){var l,p,d,v=o.children;(n=u||n.trim()?"script"===(l=o).tag||"style"===l.tag?n:Fa(n):v.length?s?"condense"===s&&La.test(n)?"":" ":a?" ":"":"")&&(u||"condense"!==s||(n=n.replace(Da," ")),!c&&" "!==n&&(p=Ji(n,ga))?d={type:2,expression:p.expression,tokens:p.tokens,text:n}:" "===n&&v.length&&" "===v[v.length-1].text||(d={type:3,text:n}),d&&(t.outputSourceRange&&(d.start=r,d.end=i),v.push(d)))}}else n===e?f("Component template requires a root element, rather than just text.",{start:r}):(n=n.trim())&&f('text "'+n+'" outside root element will be ignored.',{start:r})},comment:function(e,n,r){if(o){var i={type:3,text:e,isComment:!0};t.outputSourceRange&&(i.start=n,i.end=r),o.children.push(i)}}}),r}(e.trim(),t);!1!==t.optimize&&is(n,t);var r=_s(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),o=[],i=[],a=function(e,t,n){(n?i:o).push(e)};if(n){if(n.outputSourceRange){var s=t.match(/^\s*/)[0].length;a=function(e,t,n){var r={msg:e};t&&(null!=t.start&&(r.start=t.start+s),null!=t.end&&(r.end=t.end+s)),(n?i:o).push(r)}}for(var c in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=S(Object.create(e.directives||null),n.directives)),n)"modules"!==c&&"directives"!==c&&(r[c]=n[c])}r.warn=a;var u=Gs(t.trim(),r);return Rs(u.ast,a),u.errors=o,u.tips=i,u}return{compile:t,compileToFunctions:Js(t)}}),Xs=Ws(rs),Zs=(Xs.compile,Xs.compileToFunctions);function Ys(e){return(Ks=Ks||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',Ks.innerHTML.indexOf("&#10;")>0}var Qs=!!J&&Ys(!1),ec=!!J&&Ys(!0),tc=_((function(e){var t=kr(e);return t&&t.innerHTML})),nc=Yn.prototype.$mount;return Yn.prototype.$mount=function(e,t){if((e=e&&kr(e))===document.body||e===document.documentElement)return ue("Do not mount Vue to <html> or <body> - mount to normal elements instead."),this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&((r=tc(r))||ue("Template element not found or is empty: "+n.template,this));else{if(!r.nodeType)return ue("invalid template option:"+r,this),this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){F.performance&&it&&it("compile");var o=Zs(r,{outputSourceRange:!0,shouldDecodeNewlines:Qs,shouldDecodeNewlinesForHref:ec,delimiters:n.delimiters,comments:n.comments},this),i=o.render,a=o.staticRenderFns;n.render=i,n.staticRenderFns=a,F.performance&&it&&(it("compile end"),at("vue "+this._name+" compile","compile","compile end"))}}return nc.call(this,e,t)},Yn.compile=Zs,Yn})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vuex=t()}(this,(function(){"use strict";var e="undefined"!=typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function t(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function n(e,t){if(!e)throw new Error("[vuex] "+t)}var r=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"==typeof n?n():n)||{}},o={namespaced:{configurable:!0}};o.namespaced.get=function(){return!!this._rawModule.namespaced},r.prototype.addChild=function(e,t){this._children[e]=t},r.prototype.removeChild=function(e){delete this._children[e]},r.prototype.getChild=function(e){return this._children[e]},r.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},r.prototype.forEachChild=function(e){t(this._children,e)},r.prototype.forEachGetter=function(e){this._rawModule.getters&&t(this._rawModule.getters,e)},r.prototype.forEachAction=function(e){this._rawModule.actions&&t(this._rawModule.actions,e)},r.prototype.forEachMutation=function(e){this._rawModule.mutations&&t(this._rawModule.mutations,e)},Object.defineProperties(r.prototype,o);var i=function(e){this.register([],e,!1)};function a(e,t,n){if(l(e,n),t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return void console.warn("[vuex] trying to add a new module '"+r+"' on hot reloading, manual reload is needed");a(e.concat(r),t.getChild(r),n.modules[r])}}i.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},i.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return e+((t=t.getChild(n)).namespaced?n+"/":"")}),"")},i.prototype.update=function(e){a([],this.root,e)},i.prototype.register=function(e,n,o){var i=this;void 0===o&&(o=!0),l(e,n);var a=new r(n,o);0===e.length?this.root=a:this.get(e.slice(0,-1)).addChild(e[e.length-1],a),n.modules&&t(n.modules,(function(t,n){i.register(e.concat(n),t,o)}))},i.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];t.getChild(n).runtime&&t.removeChild(n)};var s,c={assert:function(e){return"function"==typeof e},expected:"function"},u={getters:c,mutations:c,actions:{assert:function(e){return"function"==typeof e||"object"==typeof e&&"function"==typeof e.handler},expected:'function or object with "handler" function'}};function l(e,r){Object.keys(u).forEach((function(o){if(r[o]){var i=u[o];t(r[o],(function(t,r){n(i.assert(t),function(e,t,n,r,o){var i=t+" should be "+o+' but "'+t+"."+n+'"';return e.length>0&&(i+=' in module "'+e.join(".")+'"'),i+" is "+JSON.stringify(r)+"."}(e,o,r,t,i.expected))}))}}))}var f=function t(r){var o=this;void 0===r&&(r={}),!s&&"undefined"!=typeof window&&window.Vue&&b(window.Vue),n(s,"must call Vue.use(Vuex) before creating a store instance."),n("undefined"!=typeof Promise,"vuex requires a Promise polyfill in this browser."),n(this instanceof t,"store must be called with the new operator.");var a=r.plugins;void 0===a&&(a=[]);var c=r.strict;void 0===c&&(c=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new i(r),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new s;var u=this,l=this.dispatch,f=this.commit;this.dispatch=function(e,t){return l.call(u,e,t)},this.commit=function(e,t,n){return f.call(u,e,t,n)},this.strict=c;var p=this._modules.root.state;m(this,p,[],this._modules.root),h(this,p),a.forEach((function(e){return e(o)})),(void 0!==r.devtools?r.devtools:s.config.devtools)&&function(t){e&&(t._devtoolHook=e,e.emit("vuex:init",t),e.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,n){e.emit("vuex:mutation",t,n)})))}(this)},p={state:{configurable:!0}};function d(e,t){return t.indexOf(e)<0&&t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function v(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;m(e,n,[],e._modules.root,!0),h(e,n,t)}function h(e,r,o){var i=e._vm;e.getters={};var a=e._wrappedGetters,c={};t(a,(function(t,n){c[n]=function(){return t(e)},Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})}));var u=s.config.silent;s.config.silent=!0,e._vm=new s({data:{$$state:r},computed:c}),s.config.silent=u,e.strict&&function(e){e._vm.$watch((function(){return this._data.$$state}),(function(){n(e._committing,"do not mutate vuex store state outside mutation handlers.")}),{deep:!0,sync:!0})}(e),i&&(o&&e._withCommit((function(){i._data.$$state=null})),s.nextTick((function(){return i.$destroy()})))}function m(e,t,n,r,o){var i=!n.length,a=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[a]=r),!i&&!o){var c=y(t,n.slice(0,-1)),u=n[n.length-1];e._withCommit((function(){s.set(c,u,r.state)}))}var l=r.context=function(e,t,n){var r=""===t,o={dispatch:r?e.dispatch:function(n,r,o){var i=g(n,r,o),a=i.payload,s=i.options,c=i.type;if(s&&s.root||(c=t+c,e._actions[c]))return e.dispatch(c,a);console.error("[vuex] unknown local action type: "+i.type+", global type: "+c)},commit:r?e.commit:function(n,r,o){var i=g(n,r,o),a=i.payload,s=i.options,c=i.type;s&&s.root||(c=t+c,e._mutations[c])?e.commit(c,a,s):console.error("[vuex] unknown local mutation type: "+i.type+", global type: "+c)}};return Object.defineProperties(o,{getters:{get:r?function(){return e.getters}:function(){return function(e,t){var n={},r=t.length;return Object.keys(e.getters).forEach((function(o){if(o.slice(0,r)===t){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return e.getters[o]},enumerable:!0})}})),n}(e,t)}},state:{get:function(){return y(e.state,n)}}}),o}(e,a,n);r.forEachMutation((function(t,n){!function(e,t,n,r){(e._mutations[t]||(e._mutations[t]=[])).push((function(t){n.call(e,r.state,t)}))}(e,a+n,t,l)})),r.forEachAction((function(t,n){var r=t.root?n:a+n,o=t.handler||t;!function(e,t,n,r){(e._actions[t]||(e._actions[t]=[])).push((function(t,o){var i,a=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t,o);return(i=a)&&"function"==typeof i.then||(a=Promise.resolve(a)),e._devtoolHook?a.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):a}))}(e,r,o,l)})),r.forEachGetter((function(t,n){!function(e,t,n,r){e._wrappedGetters[t]?console.error("[vuex] duplicate getter key: "+t):e._wrappedGetters[t]=function(e){return n(r.state,r.getters,e.state,e.getters)}}(e,a+n,t,l)})),r.forEachChild((function(r,i){m(e,t,n.concat(i),r,o)}))}function y(e,t){return t.length?t.reduce((function(e,t){return e[t]}),e):e}function g(e,t,r){var o;return null!==(o=e)&&"object"==typeof o&&e.type&&(r=t,t=e,e=e.type),n("string"==typeof e,"expects string as the type, but found "+typeof e+"."),{type:e,payload:t,options:r}}function b(e){s&&e===s?console.error("[vuex] already installed. Vue.use(Vuex) should be called only once."):function(e){if(Number(e.version.split(".")[0])>=2)e.mixin({beforeCreate:n});else{var t=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[n].concat(e.init):n,t.call(this,e)}}function n(){var e=this.$options;e.store?this.$store="function"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}(s=e)}p.state.get=function(){return this._vm._data.$$state},p.state.set=function(e){n(!1,"use store.replaceState() to explicit replace store state.")},f.prototype.commit=function(e,t,n){var r=this,o=g(e,t,n),i=o.type,a=o.payload,s=o.options,c={type:i,payload:a},u=this._mutations[i];u?(this._withCommit((function(){u.forEach((function(e){e(a)}))})),this._subscribers.forEach((function(e){return e(c,r.state)})),s&&s.silent&&console.warn("[vuex] mutation type: "+i+". Silent option has been removed. Use the filter functionality in the vue-devtools")):console.error("[vuex] unknown mutation type: "+i)},f.prototype.dispatch=function(e,t){var n=this,r=g(e,t),o=r.type,i=r.payload,a={type:o,payload:i},s=this._actions[o];if(s){try{this._actionSubscribers.filter((function(e){return e.before})).forEach((function(e){return e.before(a,n.state)}))}catch(e){console.warn("[vuex] error in before action subscribers: "),console.error(e)}return(s.length>1?Promise.all(s.map((function(e){return e(i)}))):s[0](i)).then((function(e){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(a,n.state)}))}catch(e){console.warn("[vuex] error in after action subscribers: "),console.error(e)}return e}))}console.error("[vuex] unknown action type: "+o)},f.prototype.subscribe=function(e){return d(e,this._subscribers)},f.prototype.subscribeAction=function(e){return d("function"==typeof e?{before:e}:e,this._actionSubscribers)},f.prototype.watch=function(e,t,r){var o=this;return n("function"==typeof e,"store.watch only accepts a function."),this._watcherVM.$watch((function(){return e(o.state,o.getters)}),t,r)},f.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},f.prototype.registerModule=function(e,t,r){void 0===r&&(r={}),"string"==typeof e&&(e=[e]),n(Array.isArray(e),"module path must be a string or an Array."),n(e.length>0,"cannot register the root module by using registerModule."),this._modules.register(e,t),m(this,this.state,e,this._modules.get(e),r.preserveState),h(this,this.state)},f.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),n(Array.isArray(e),"module path must be a string or an Array."),this._modules.unregister(e),this._withCommit((function(){var n=y(t.state,e.slice(0,-1));s.delete(n,e[e.length-1])})),v(this)},f.prototype.hotUpdate=function(e){this._modules.update(e),v(this,!0)},f.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(f.prototype,p);var _=k((function(e,t){var n={};return C(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=A(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"==typeof o?o.call(this,t,n):t[o]},n[r].vuex=!0})),n})),w=k((function(e,t){var n={};return C(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.commit;if(e){var i=A(this.$store,"mapMutations",e);if(!i)return;r=i.context.commit}return"function"==typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),x=k((function(e,t){var n={};return C(t).forEach((function(t){var r=t.key,o=t.val;o=e+o,n[r]=function(){if(!e||A(this.$store,"mapGetters",e)){if(o in this.$store.getters)return this.$store.getters[o];console.error("[vuex] unknown getter: "+o)}},n[r].vuex=!0})),n})),$=k((function(e,t){var n={};return C(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var i=A(this.$store,"mapActions",e);if(!i)return;r=i.context.dispatch}return"function"==typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n}));function C(e){return Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}}))}function k(e){return function(t,n){return"string"!=typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function A(e,t,n){var r=e._modulesNamespaceMap[n];return r||console.error("[vuex] module namespace not found in "+t+"(): "+n),r}return{Store:f,install:b,version:"3.1.0",mapState:_,mapMutations:w,mapGetters:x,mapActions:$,createNamespacedHelpers:function(e){return{mapState:_.bind(null,e),mapGetters:x.bind(null,e),mapMutations:w.bind(null,e),mapActions:$.bind(null,e)}}}})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.VueResource=t()}(this,(function(){"use strict";function e(e){this.state=2,this.value=void 0,this.deferred=[];var t=this;try{e((function(e){t.resolve(e)}),(function(e){t.reject(e)}))}catch(e){t.reject(e)}}e.reject=function(t){return new e((function(e,n){n(t)}))},e.resolve=function(t){return new e((function(e,n){e(t)}))},e.all=function(t){return new e((function(n,r){var o=0,i=[];function a(e){return function(r){i[e]=r,(o+=1)===t.length&&n(i)}}0===t.length&&n(i);for(var s=0;s<t.length;s+=1)e.resolve(t[s]).then(a(s),r)}))},e.race=function(t){return new e((function(n,r){for(var o=0;o<t.length;o+=1)e.resolve(t[o]).then(n,r)}))};var t=e.prototype;function n(e,t){this.promise=e instanceof Promise?e:new Promise(e.bind(t)),this.context=t}t.resolve=function(e){var t=this;if(2===t.state){if(e===t)throw new TypeError("Promise settled with itself.");var n=!1;try{var r=e&&e.then;if(null!==e&&"object"==typeof e&&"function"==typeof r)return void r.call(e,(function(e){n||t.resolve(e),n=!0}),(function(e){n||t.reject(e),n=!0}))}catch(e){return void(n||t.reject(e))}t.state=0,t.value=e,t.notify()}},t.reject=function(e){var t=this;if(2===t.state){if(e===t)throw new TypeError("Promise settled with itself.");t.state=1,t.value=e,t.notify()}},t.notify=function(){var e=this;o((function(){if(2!==e.state)for(;e.deferred.length;){var t=e.deferred.shift(),n=t[0],r=t[1],o=t[2],i=t[3];try{0===e.state?o("function"==typeof n?n.call(void 0,e.value):e.value):1===e.state&&("function"==typeof r?o(r.call(void 0,e.value)):i(e.value))}catch(e){i(e)}}}),undefined)},t.then=function(t,n){var r=this;return new e((function(e,o){r.deferred.push([t,n,e,o]),r.notify()}))},t.catch=function(e){return this.then(void 0,e)},"undefined"==typeof Promise&&(window.Promise=e),n.all=function(e,t){return new n(Promise.all(e),t)},n.resolve=function(e,t){return new n(Promise.resolve(e),t)},n.reject=function(e,t){return new n(Promise.reject(e),t)},n.race=function(e,t){return new n(Promise.race(e),t)};var r=n.prototype;r.bind=function(e){return this.context=e,this},r.then=function(e,t){return e&&e.bind&&this.context&&(e=e.bind(this.context)),t&&t.bind&&this.context&&(t=t.bind(this.context)),new n(this.promise.then(e,t),this.context)},r.catch=function(e){return e&&e.bind&&this.context&&(e=e.bind(this.context)),new n(this.promise.catch(e),this.context)},r.finally=function(e){return this.then((function(t){return e.call(this),t}),(function(t){return e.call(this),Promise.reject(t)}))};var o,i={}.hasOwnProperty,a=[].slice,s=!1,c="undefined"!=typeof window;function u(e){return e?e.replace(/^\s*|\s*$/g,""):""}function l(e){return e?e.toLowerCase():""}var f=Array.isArray;function p(e){return"string"==typeof e}function d(e){return"function"==typeof e}function v(e){return null!==e&&"object"==typeof e}function h(e){return v(e)&&Object.getPrototypeOf(e)==Object.prototype}function m(e,t,r){var o=n.resolve(e);return arguments.length<2?o:o.then(t,r)}function y(e,t,n){return d(n=n||{})&&(n=n.call(t)),_(e.bind({$vm:t,$options:n}),e,{$options:n})}function g(e,t){var n,r;if(f(e))for(n=0;n<e.length;n++)t.call(e[n],e[n],n);else if(v(e))for(r in e)i.call(e,r)&&t.call(e[r],e[r],r);return e}var b=Object.assign||function(e){var t=a.call(arguments,1);return t.forEach((function(t){w(e,t)})),e};function _(e){var t=a.call(arguments,1);return t.forEach((function(t){w(e,t,!0)})),e}function w(e,t,n){for(var r in t)n&&(h(t[r])||f(t[r]))?(h(t[r])&&!h(e[r])&&(e[r]={}),f(t[r])&&!f(e[r])&&(e[r]=[]),w(e[r],t[r],n)):void 0!==t[r]&&(e[r]=t[r])}function x(e){return null!=e}function $(e){return";"===e||"&"===e||"?"===e}function C(e,t,n){return t="+"===e||"#"===e?k(t):encodeURIComponent(t),n?encodeURIComponent(n)+"="+t:t}function k(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map((function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e)),e})).join("")}function A(e,t){var n,r=this||{},o=e;return p(e)&&(o={url:e,params:t}),o=_({},A.options,r.$options,o),A.transforms.forEach((function(e){p(e)&&(e=A.transform[e]),d(e)&&(n=function(e,t,n){return function(r){return e.call(n,r,t)}}(e,n,r.$vm))})),n(o)}function O(e,t,n){var r,o=f(t),i=h(t);g(t,(function(t,a){r=v(t)||f(t),n&&(a=n+"["+(i||r?a:"")+"]"),!n&&o?e.add(t.name,t.value):r?O(e,t,a):e.add(a,t)}))}A.options={url:"",root:null,params:{}},A.transform={template:function(e){var t=[],n=function(e,t,n){var r=function(e){var t=["+","#",".","/",";","?","&"],n=[];return{vars:n,expand:function(r){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,o,i){if(o){var a=null,s=[];if(-1!==t.indexOf(o.charAt(0))&&(a=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach((function(e){var t=/([^:\*]*)(?::(\d+)|(\*))?/.exec(e);s.push.apply(s,function(e,t,n,r){var o=e[n],i=[];if(x(o)&&""!==o)if("string"==typeof o||"number"==typeof o||"boolean"==typeof o)o=o.toString(),r&&"*"!==r&&(o=o.substring(0,parseInt(r,10))),i.push(C(t,o,$(t)?n:null));else if("*"===r)Array.isArray(o)?o.filter(x).forEach((function(e){i.push(C(t,e,$(t)?n:null))})):Object.keys(o).forEach((function(e){x(o[e])&&i.push(C(t,o[e],e))}));else{var a=[];Array.isArray(o)?o.filter(x).forEach((function(e){a.push(C(t,e))})):Object.keys(o).forEach((function(e){x(o[e])&&(a.push(encodeURIComponent(e)),a.push(C(t,o[e].toString())))})),$(t)?i.push(encodeURIComponent(n)+"="+a.join(",")):0!==a.length&&i.push(a.join(","))}else";"===t?i.push(encodeURIComponent(n)):""!==o||"&"!==t&&"?"!==t?""===o&&i.push(""):i.push(encodeURIComponent(n)+"=");return i}(r,a,t[1],t[2]||t[3])),n.push(t[1])})),a&&"+"!==a){var c=",";return"?"===a?c="&":"#"!==a&&(c=a),(0!==s.length?a:"")+s.join(c)}return s.join(",")}return k(i)}))}}}(e),o=r.expand(t);return n&&n.push.apply(n,r.vars),o}(e.url,e.params,t);return t.forEach((function(t){delete e.params[t]})),n},query:function(e,t){var n=Object.keys(A.options.params),r={},o=t(e);return g(e.params,(function(e,t){-1===n.indexOf(t)&&(r[t]=e)})),(r=A.params(r))&&(o+=(-1==o.indexOf("?")?"?":"&")+r),o},root:function(e,t){var n,r=t(e);return p(e.root)&&!/^(https?:)?\//.test(r)&&("/",r=((n=e.root)?n.replace(new RegExp("[/]+$"),""):n)+"/"+r),r}},A.transforms=["template","query","root"],A.params=function(e){var t=[],n=encodeURIComponent;return t.add=function(e,t){d(t)&&(t=t()),null===t&&(t=""),this.push(n(e)+"="+n(t))},O(t,e),t.join("&").replace(/%20/g,"+")},A.parse=function(e){var t=document.createElement("a");return document.documentMode&&(t.href=e,e=t.href),t.href=e,{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",port:t.port,host:t.host,hostname:t.hostname,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):""}};var S=function(e){return new n((function(t){var n=new XDomainRequest,r=function(r){var o=r.type,i=0;"load"===o?i=200:"error"===o&&(i=500),t(e.respondWith(n.responseText,{status:i}))};e.abort=function(){return n.abort()},n.open(e.method,e.getUrl()),e.timeout&&(n.timeout=e.timeout),n.onload=r,n.onabort=r,n.onerror=r,n.ontimeout=r,n.onprogress=function(){},n.send(e.getBody())}))},T=c&&"withCredentials"in new XMLHttpRequest,j=function(e){return new n((function(t){var n,r,o=e.jsonp||"callback",i=e.jsonpCallback||"_jsonp"+Math.random().toString(36).substr(2),a=null;n=function(n){var o=n.type,s=0;"load"===o&&null!==a?s=200:"error"===o&&(s=500),s&&window[i]&&(delete window[i],document.body.removeChild(r)),t(e.respondWith(a,{status:s}))},window[i]=function(e){a=JSON.stringify(e)},e.abort=function(){n({type:"abort"})},e.params[o]=i,e.timeout&&setTimeout(e.abort,e.timeout),(r=document.createElement("script")).src=e.getUrl(),r.type="text/javascript",r.async=!0,r.onload=n,r.onerror=n,document.body.appendChild(r)}))},E=function(e){return new n((function(t){var n=new XMLHttpRequest,r=function(r){var o=e.respondWith("response"in n?n.response:n.responseText,{status:1223===n.status?204:n.status,statusText:1223===n.status?"No Content":u(n.statusText)});g(u(n.getAllResponseHeaders()).split("\n"),(function(e){o.headers.append(e.slice(0,e.indexOf(":")),e.slice(e.indexOf(":")+1))})),t(o)};e.abort=function(){return n.abort()},e.progress&&("GET"===e.method?n.addEventListener("progress",e.progress):/^(POST|PUT)$/i.test(e.method)&&n.upload.addEventListener("progress",e.progress)),n.open(e.method,e.getUrl(),!0),e.timeout&&(n.timeout=e.timeout),e.responseType&&"responseType"in n&&(n.responseType=e.responseType),(e.withCredentials||e.credentials)&&(n.withCredentials=!0),e.crossOrigin||e.headers.set("X-Requested-With","XMLHttpRequest"),e.headers.forEach((function(e,t){n.setRequestHeader(t,e)})),n.onload=r,n.onabort=r,n.onerror=r,n.ontimeout=r,n.send(e.getBody())}))},M=function(e){var t=require("got");return new n((function(n){var r,o=e.getUrl(),i=e.getBody(),a=e.method,s={};e.headers.forEach((function(e,t){s[t]=e})),t(o,{body:i,method:a,headers:s}).then(r=function(t){var r=e.respondWith(t.body,{status:t.statusCode,statusText:u(t.statusMessage)});g(t.headers,(function(e,t){r.headers.set(t,e)})),n(r)},(function(e){return r(e.response)}))}))};function N(e,t){t((e.client||(c?E:M))(e))}var P=function(e){var t=this;this.map={},g(e,(function(e,n){return t.append(n,e)}))};function I(e,t){return Object.keys(e).reduce((function(e,n){return l(t)===l(n)?n:e}),null)}P.prototype.has=function(e){return null!==I(this.map,e)},P.prototype.get=function(e){var t=this.map[I(this.map,e)];return t?t.join():null},P.prototype.getAll=function(e){return this.map[I(this.map,e)]||[]},P.prototype.set=function(e,t){this.map[function(e){if(/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return u(e)}(I(this.map,e)||e)]=[u(t)]},P.prototype.append=function(e,t){var n=this.map[I(this.map,e)];n?n.push(u(t)):this.set(e,t)},P.prototype.delete=function(e){delete this.map[I(this.map,e)]},P.prototype.deleteAll=function(){this.map={}},P.prototype.forEach=function(e,t){var n=this;g(this.map,(function(r,o){g(r,(function(r){return e.call(t,r,o,n)}))}))};var L=function(e,t){var r=t.url,o=t.headers,i=t.status,a=t.statusText;this.url=r,this.ok=i>=200&&i<300,this.status=i||0,this.statusText=a||"",this.headers=new P(o),this.body=e,p(e)?this.bodyText=e:"undefined"!=typeof Blob&&e instanceof Blob&&(this.bodyBlob=e,function(e){return 0===e.type.indexOf("text")||-1!==e.type.indexOf("json")}(e)&&(this.bodyText=function(e){return new n((function(t){var n=new FileReader;n.readAsText(e),n.onload=function(){t(n.result)}}))}(e)))};L.prototype.blob=function(){return m(this.bodyBlob)},L.prototype.text=function(){return m(this.bodyText)},L.prototype.json=function(){return m(this.text(),(function(e){return JSON.parse(e)}))},Object.defineProperty(L.prototype,"data",{get:function(){return this.body},set:function(e){this.body=e}});var D=function(e){var t;this.body=null,this.params={},b(this,e,{method:(t=e.method||"GET",t?t.toUpperCase():"")}),this.headers instanceof P||(this.headers=new P(this.headers))};D.prototype.getUrl=function(){return A(this)},D.prototype.getBody=function(){return this.body},D.prototype.respondWith=function(e,t){return new L(e,b(t||{},{url:this.getUrl()}))};var R={"Content-Type":"application/json;charset=utf-8"};function F(e){var t=this||{},r=function(e){var t,r=[N],o=[];function i(i){return new n((function(n,a){function c(){var n;d(t=r.pop())?t.call(e,i,u):(n="Invalid interceptor of type "+typeof t+", must be a function","undefined"!=typeof console&&s&&console.warn("[VueResource warn]: "+n),u())}function u(t){if(d(t))o.unshift(t);else if(v(t))return o.forEach((function(n){t=m(t,(function(t){return n.call(e,t)||t}),a)})),void m(t,n,a);c()}c()}),e)}return v(e)||(e=null),i.use=function(e){r.push(e)},i}(t.$vm);return function(e){a.call(arguments,1).forEach((function(t){for(var n in t)void 0===e[n]&&(e[n]=t[n])}))}(e||{},t.$options,F.options),F.interceptors.forEach((function(e){p(e)&&(e=F.interceptor[e]),d(e)&&r.use(e)})),r(new D(e)).then((function(e){return e.ok?e:n.reject(e)}),(function(e){var t;return e instanceof Error&&(t=e,"undefined"!=typeof console&&console.error(t)),n.reject(e)}))}function U(e,t,n,r){var o=this||{},i={};return g(n=b({},U.actions,n),(function(n,a){n=_({url:e,params:b({},t)},r,n),i[a]=function(){return(o.$http||F)(H(n,arguments))}})),i}function H(e,t){var n,r=b({},e),o={};switch(t.length){case 2:o=t[0],n=t[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(r.method)?n=t[0]:o=t[0];break;case 0:break;default:throw"Expected up to 2 arguments [params, body], got "+t.length+" arguments"}return r.body=n,r.params=b({},r.params,o),r}function V(e){var t,r,i;V.installed||(r=(t=e).config,i=t.nextTick,o=i,s=r.debug||!r.silent,e.url=A,e.http=F,e.resource=U,e.Promise=n,Object.defineProperties(e.prototype,{$url:{get:function(){return y(e.url,this,this.$options.url)}},$http:{get:function(){return y(e.http,this,this.$options.http)}},$resource:{get:function(){return e.resource.bind(this)}},$promise:{get:function(){var t=this;return function(n){return new e.Promise(n,t)}}}}))}return F.options={},F.headers={put:R,post:R,patch:R,delete:R,common:{Accept:"application/json, text/plain, */*"},custom:{}},F.interceptor={before:function(e,t){d(e.before)&&e.before.call(this,e),t()},method:function(e,t){e.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(e.method)&&(e.headers.set("X-HTTP-Method-Override",e.method),e.method="POST"),t()},jsonp:function(e,t){"JSONP"==e.method&&(e.client=j),t()},json:function(e,t){var n=e.headers.get("Content-Type")||"";v(e.body)&&0===n.indexOf("application/json")&&(e.body=JSON.stringify(e.body)),t((function(e){return e.bodyText?m(e.text(),(function(t){if(0===(n=e.headers.get("Content-Type")||"").indexOf("application/json")||(o=(r=t).match(/^\[|^\{(?!\{)/))&&{"[":/]$/,"{":/}$/}[o[0]].test(r))try{e.body=JSON.parse(t)}catch(t){e.body=null}else e.body=t;var r,o;return e})):e}))},form:function(e,t){var n;n=e.body,"undefined"!=typeof FormData&&n instanceof FormData?e.headers.delete("Content-Type"):v(e.body)&&e.emulateJSON&&(e.body=A.params(e.body),e.headers.set("Content-Type","application/x-www-form-urlencoded")),t()},header:function(e,t){g(b({},F.headers.common,e.crossOrigin?{}:F.headers.custom,F.headers[l(e.method)]),(function(t,n){e.headers.has(n)||e.headers.set(n,t)})),t()},cors:function(e,t){if(c){var n=A.parse(location.href),r=A.parse(e.getUrl());r.protocol===n.protocol&&r.host===n.host||(e.crossOrigin=!0,e.emulateHTTP=!1,T||(e.client=S))}t()}},F.interceptors=["before","method","jsonp","json","form","header","cors"],["get","delete","head","jsonp"].forEach((function(e){F[e]=function(t,n){return this(b(n||{},{url:t,method:e}))}})),["post","put","patch"].forEach((function(e){F[e]=function(t,n,r){return this(b(r||{},{url:t,method:e,body:n}))}})),U.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&window.Vue.use(V),V}));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/src/apps/js/frontend/quiz/index.js CHANGED
@@ -18,7 +18,7 @@ class Quiz extends Component {
18
  }
19
 
20
  componentDidMount() {
21
- const { settings, setQuizData } = this.props;
22
 
23
  const { question_ids, questions_per_page } = settings;
24
 
@@ -37,6 +37,19 @@ class Quiz extends Component {
37
  setQuizData( settings );
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  startQuiz = ( event ) => {
41
  this.props.startQuiz();
42
  };
@@ -59,7 +72,6 @@ class Quiz extends Component {
59
  ) }
60
 
61
  { ! isReviewing && notStarted && <Meta /> }
62
- { ! isReviewing && notStarted && <Content /> }
63
 
64
  { 'started' === status && <Status /> }
65
 
18
  }
19
 
20
  componentDidMount() {
21
+ const { settings, setQuizData, status, isReviewing } = this.props;
22
 
23
  const { question_ids, questions_per_page } = settings;
24
 
37
  setQuizData( settings );
38
  }
39
 
40
+ componentDidUpdate( prevProps, prevState ) {
41
+ const { status, isReviewing } = this.props;
42
+
43
+ const notStarted = -1 !== [ '', 'viewed', undefined ].indexOf( status ) || ! status;
44
+
45
+ if ( isReviewing || ! notStarted ) {
46
+ const elQuiz = document.querySelector( '.quiz-content' );
47
+ if ( elQuiz ) {
48
+ elQuiz.style.display = 'none';
49
+ }
50
+ }
51
+ }
52
+
53
  startQuiz = ( event ) => {
54
  this.props.startQuiz();
55
  };
72
  ) }
73
 
74
  { ! isReviewing && notStarted && <Meta /> }
 
75
 
76
  { 'started' === status && <Status /> }
77
 
inc/abstracts/abstract-post-data.php CHANGED
@@ -143,9 +143,9 @@ if ( ! class_exists( 'LP_Abstract_Post_Data' ) ) {
143
  setup_postdata( $post );
144
  }
145
 
146
- $content_post = get_the_content();
147
- /*$content_post = apply_filters( 'the_content', $content_post );
148
- $content_post = str_replace( ']]>', ']]&gt;', $content_post );*/
149
  $this->_content = $content_post;
150
  wp_reset_postdata();
151
  }
143
  setup_postdata( $post );
144
  }
145
 
146
+ $content_post = get_the_content();
147
+ $content_post = apply_filters( 'the_content', $content_post );
148
+ $content_post = str_replace( ']]>', ']]&gt;', $content_post );
149
  $this->_content = $content_post;
150
  wp_reset_postdata();
151
  }
inc/jwt/responsive.http DELETED
@@ -1,263 +0,0 @@
1
- ###
2
- POST http://learnpress4.local/wp-json/learnpress/v1/token
3
- Content-Type: application/json
4
-
5
- {
6
- "username": "admin",
7
- "password": "admin"
8
- }
9
-
10
- ###
11
- POST http://learnpress4.local/wp-json/learnpress/v1/token
12
- Content-Type: application/json
13
-
14
- {
15
- "username": "student",
16
- "password": "student"
17
- }
18
-
19
- ###
20
- POST http://learnpress4.local/wp-json/learnpress/v1/token/register
21
- Content-Type: application/json
22
-
23
- {
24
- "username": "student4",
25
- "password": "student4",
26
- "confirm_password": "student4",
27
- "email": "student4@gmail.com"
28
- }
29
-
30
- ###
31
- POST http://learnpress4.local/wp-json/learnpress/v1/token/validate
32
- Content-Type: application/json
33
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNDU4NzE3MiwibmJmIjoxNjI0NTg3MTcyLCJleHAiOjE2MjUxOTE5NzIsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.czBrKpTMrlUt5nGc5DXbNsAhkhg2od1xnlSHcgzBG6U
34
-
35
- ## Get list Course learned by user, if not learned will get all course
36
- ## add param: learned, course_filter: in-progress, passed, failed.
37
- ###
38
- GET http://lp/wp-json/learnpress/v1/courses?on_sale=true
39
- Content-Type: application/json
40
-
41
- ## Get list Course learned by user, if not learned will get all course
42
- ## add param: learned, course_filter: in-progress, passed, failed.
43
- ###
44
- GET http://learnpress4.local/wp-json/learnpress/v1/courses?learned=true&per_page=1&order=desc&course_filter=in-progress
45
- Content-Type: application/json
46
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0MTg3MTM3NSwibmJmIjoxNjQxODcxMzc1LCJleHAiOjE2NDI0NzYxNzUsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.NvKdO6v4ylCjLNc06Q7S6T9GIdNL5i4YAyPC0p776lE
47
-
48
- ###
49
- GET http://learnpress4.local/wp-json/learnpress/v1/courses/86?v=123213
50
- Content-Type: application/json
51
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0NDgyOTQxOSwibmJmIjoxNjQ0ODI5NDE5LCJleHAiOjE2NDU0MzQyMTksImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.jllFuVONx23EL_614lSK2OVFiIMDfajeFVWtg4maJOc
52
-
53
- ### Get content Course
54
- ## If have token will show course_data for this user: course_data: graduation, status....
55
- GET http://learnpress4.local/wp-json/learnpress/v1/courses/196
56
- Content-Type: application/json
57
-
58
-
59
- ## Enroll course.
60
- ###
61
- POST http://learnpress4.local/wp-json/learnpress/v1/courses/enroll
62
- Content-Type: application/json
63
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNjIzNDYxMiwibmJmIjoxNjI2MjM0NjEyLCJleHAiOjE2MjY4Mzk0MTIsImRhdGEiOnsidXNlciI6eyJpZCI6IjIifX19.qxB0-uGPBk52QyjVAAoqceizynMp8BUt3eOrBB3MF2c
64
-
65
- {
66
- "id": "196"
67
- }
68
-
69
- ## Finish course.
70
- ###
71
- POST http://learnpress4.local/wp-json/learnpress/v1/courses/finish
72
- Content-Type: application/json
73
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNjIzNDYxMiwibmJmIjoxNjI2MjM0NjEyLCJleHAiOjE2MjY4Mzk0MTIsImRhdGEiOnsidXNlciI6eyJpZCI6IjIifX19.qxB0-uGPBk52QyjVAAoqceizynMp8BUt3eOrBB3MF2c
74
-
75
- {
76
- "id": "196"
77
- }
78
-
79
- ## Retake course.
80
- ###
81
- POST http://learnpress4.local/wp-json/learnpress/v1/courses/retake
82
- Content-Type: application/json
83
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNjIzNDYxMiwibmJmIjoxNjI2MjM0NjEyLCJleHAiOjE2MjY4Mzk0MTIsImRhdGEiOnsidXNlciI6eyJpZCI6IjIifX19.qxB0-uGPBk52QyjVAAoqceizynMp8BUt3eOrBB3MF2c
84
-
85
-
86
- {
87
- "id": "196"
88
- }
89
-
90
- ## Get All lesson: is administration, student cannot get list.
91
- ###
92
- GET http://learnpress4.local/wp-json/learnpress/v1/lessons
93
- Content-Type: application/json
94
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0NDgzNjQ0NSwibmJmIjoxNjQ0ODM2NDQ1LCJleHAiOjE2NDU0NDEyNDUsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.e_tX-kD-51vLUMdt0TBSzZ1rt6Zea9QzOdat5N6K6bY
95
-
96
- ## In student: You can get lesson by course is enrolled
97
- ###
98
- GET http://learnpress4.local/wp-json/learnpress/v1/lessons/545
99
- Content-Type: application/json
100
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYzNTEzNjYxMCwibmJmIjoxNjM1MTM2NjEwLCJleHAiOjE2MzU3NDE0MTAsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19._eGVoYIw1YHxH9qB6IhIYiPUwJnMFi-lPtjBVASzTBc
101
-
102
- ## Action Complete Lesson.
103
- ###
104
- POST http://learnpress4.local/wp-json/learnpress/v1/lessons/finish
105
- Content-Type: application/json
106
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNTgwMDYxMywibmJmIjoxNjI1ODAwNjEzLCJleHAiOjE2MjY0MDU0MTMsImRhdGEiOnsidXNlciI6eyJpZCI6IjIifX19.4IQCUUcgZG5KH335evg8ZkDADVC0KCte8zFfENtQ0FA
107
-
108
- {
109
- "id": "545"
110
- }
111
-
112
- ## In student: You can get quiz by course is enrolled
113
- ###
114
- GET http://learnpress4.local/wp-json/learnpress/v1/quiz/197
115
- Content-Type: application/json
116
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYzNTEzNjYxMCwibmJmIjoxNjM1MTM2NjEwLCJleHAiOjE2MzU3NDE0MTAsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19._eGVoYIw1YHxH9qB6IhIYiPUwJnMFi-lPtjBVASzTBc
117
-
118
- ## Start Quiz.
119
- ###
120
- POST http://learnpress4.local/wp-json/learnpress/v1/quiz/start
121
- Content-Type: application/json
122
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0NDgwNDUyMiwibmJmIjoxNjQ0ODA0NTIyLCJleHAiOjE2NDU0MDkzMjIsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.zWvrzrAiMdd7oyU9P2E-vTNWxlvcQ3IZjlswXWpyPgk
123
-
124
- {
125
- "id": "11"
126
- }
127
-
128
- ## Check Answer Quiz.
129
- ###
130
- POST http://learnpress4.local/wp-json/learnpress/v1/quiz/check_answer
131
- Content-Type: application/json
132
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNTgwMDYxMywibmJmIjoxNjI1ODAwNjEzLCJleHAiOjE2MjY0MDU0MTMsImRhdGEiOnsidXNlciI6eyJpZCI6IjIifX19.4IQCUUcgZG5KH335evg8ZkDADVC0KCte8zFfENtQ0FA
133
-
134
- {
135
- "id": "197",
136
- "question_id": "198",
137
- "answered": "5f2674eb"
138
- }
139
-
140
- ## Finish Quiz.
141
- ###
142
- POST http://learnpress4.local/wp-json/learnpress/v1/quiz/finish
143
- Content-Type: application/json
144
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0NDgzNTY1NywibmJmIjoxNjQ0ODM1NjU3LCJleHAiOjE2NDU0NDA0NTcsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.Zm_-2CyEYeuiEiTkbxX4q4dKYGBFYFna77XKUGYTAEk
145
-
146
- {
147
- "id": 11,
148
- "answered": {
149
- "12": "eaf33d04"
150
- }
151
- }
152
-
153
- ###
154
- GET http://learnpress4.local/wp-json/wp/v2/categories
155
- Content-Type: application/json
156
-
157
- ### END.
158
-
159
- ###
160
- GET http://learnpress4.local/wp-json/learnpress/v1/quiz?per_page=2
161
- Content-Type: application/json
162
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNTE5NDUzMCwibmJmIjoxNjI1MTk0NTMwLCJleHAiOjE2MjU3OTkzMzAsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.GXI49miNfrGgatf9EjcFiciJHdB8jvmIr_jtedBnWQ4
163
-
164
-
165
- ###
166
- GET http://learnpress4.local/wp-json/learnpress/v1/questions
167
- Content-Type: application/json
168
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNDU4NzE3MiwibmJmIjoxNjI0NTg3MTcyLCJleHAiOjE2MjUxOTE5NzIsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.czBrKpTMrlUt5nGc5DXbNsAhkhg2od1xnlSHcgzBG6U
169
-
170
-
171
- ###
172
- GET http://learnpress4.local/wp-json/wp/v2/users
173
- Content-Type: application/json
174
-
175
- ###
176
- GET http://learnpress4.local/wp-json/learnpress/v1/users/?roles[]=lp_teacher&roles[]=administrator
177
- Content-Type: application/json
178
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYzNTIxNzM5MiwibmJmIjoxNjM1MjE3MzkyLCJleHAiOjE2MzU4MjIxOTIsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.d68sBM5k8dYqWb-3MBs1fBzdgldCfCG-rh_ZbdAYP2U
179
-
180
- ###
181
- GET http://learnpress4.local/wp-json/learnpress/v1/users/1
182
- Content-Type: application/json
183
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0NDgwNDUyMiwibmJmIjoxNjQ0ODA0NTIyLCJleHAiOjE2NDU0MDkzMjIsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.zWvrzrAiMdd7oyU9P2E-vTNWxlvcQ3IZjlswXWpyPgk
184
-
185
- ### Change Password
186
- POST http://learnpress4.local/wp-json/learnpress/v1/users/change-password/
187
- Content-Type: application/json
188
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0NDgwNDUyMiwibmJmIjoxNjQ0ODA0NTIyLCJleHAiOjE2NDU0MDkzMjIsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.zWvrzrAiMdd7oyU9P2E-vTNWxlvcQ3IZjlswXWpyPgk
189
-
190
- {
191
- "old_password": "123456",
192
- "new_password": "admin"
193
- }
194
-
195
- ###
196
- POST http://learnpress4.local/wp-json/learnpress/v1/users/1/
197
- Content-Type: application/json
198
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0NDgwNDUyMiwibmJmIjoxNjQ0ODA0NTIyLCJleHAiOjE2NDU0MDkzMjIsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.zWvrzrAiMdd7oyU9P2E-vTNWxlvcQ3IZjlswXWpyPgk
199
-
200
- {
201
- "first_name": "dao",
202
- "last_name": "nham",
203
- "nickname": "admin",
204
- "email": "admin@g.com",
205
- "description": "Hello Bio admin",
206
- "avatar_url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZX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pk0FbPTGeuZDKYZHM343c2OweLT2g8F9JFJGC4i/E6faSCxBtlxUS6QYSzCKrZRuJaRcX3jw8fRERFl1gkRERERERERERF//Z"
207
- }
208
-
209
- ###
210
- GET http://learnpress4.local/wp-json/learnpress/v1/users/2
211
- Content-Type: application/json
212
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyMzI5MTgzNiwibmJmIjoxNjIzMjkxODM2LCJleHAiOjE2MjM4OTY2MzYsImRhdGEiOnsidXNlciI6eyJpZCI6IjIifX19.Ls7Q3EiFE5ZHn78Exe6CdnfZJ2JZaPcuJBI0wQHdvzk
213
-
214
- ###
215
- POST http://learnpress4.local/wp-json/learnpress/v1/users/2
216
- Content-Type: application/json
217
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTYyNTQ2MDU4MSwibmJmIjoxNjI1NDYwNTgxLCJleHAiOjE2MjYwNjUzODEsImRhdGEiOnsidXNlciI6eyJpZCI6IjIifX19.-vPZer6A5impVQ_pHa2tUmvWmEDdQXL166pKHGlOv6U
218
-
219
- {
220
- "first_name": "nham",
221
- "last_name": "kin",
222
- "email": "studentsss@gmail.com",
223
- "password": "student"
224
- }
225
-
226
- ####
227
- GET http://learnpress4.local/wp-json/wp/v2/users/
228
- Content-Type: application/json
229
-
230
- ###
231
- POST http://learnpress4.local/wp-json/learnpress/v1/users/reset-password
232
- Content-Type: application/json
233
-
234
- {
235
- "user_login" : "daonham95@gmail.com"
236
- }
237
-
238
- ###
239
- POST https://test.thimpress.com/wp-json/learnpress/v1/token?v=asdasdsdd
240
- Content-Type: application/json
241
-
242
- {
243
- "username": "pensive-tesla",
244
- "password": "FXIOajZUlYoOrhT6kd"
245
- }
246
-
247
- ###
248
- GET https://test.thimpress.com/wp-json/wp/v2/posts?v=qweqwedsfdsfds
249
- Content-Type: application/json
250
-
251
- ###
252
- GET http://learnpress4.local/wp-json/learnpress/v1/sections/sections-by-course-id/205
253
- Content-Type: application/json
254
-
255
- ###
256
- GET http://learnpress4.local/wp-json/learnpress/v1/section-items/items/8
257
- Content-Type: application/json
258
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sZWFybnByZXNzNC5sb2NhbCIsImlhdCI6MTY0MDkyMTQ5OCwibmJmIjoxNjQwOTIxNDk4LCJleHAiOjE2NDE1MjYyOTgsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.nv7SgzB0JDQLSipszofbamoXyQHPPhx8IuO7-ISAGVU
259
-
260
- ###
261
- GET https://test.thimpress.com/wp-json/learnpress/v1/courses?learned=true&per_page=1&order=desc&course_filter=in-progress?v=ddsadsadios
262
- Content-Type: application/json
263
- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdGVzdC50aGltcHJlc3MuY29tIiwiaWF0IjoxNjQyMDY4NTk0LCJuYmYiOjE2NDIwNjg1OTQsImV4cCI6MTY0MjY3MzM5NCwiZGF0YSI6eyJ1c2VyIjp7ImlkIjoiMSJ9fX0.rRRLon3MJel4MFjm6O5XqwdDqfr3s0xlNjVIeghW2Js
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
learnpress.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://thimpress.com/learnpress
5
  * Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
6
  * Author: ThimPress
7
- * Version: 4.1.6.9.2
8
  * Author URI: http://thimpress.com
9
  * Requires at least: 5.6
10
  * Tested up to: 6.0
4
  * Plugin URI: http://thimpress.com/learnpress
5
  * Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
6
  * Author: ThimPress
7
+ * Version: 4.1.6.9.3
8
  * Author URI: http://thimpress.com
9
  * Requires at least: 5.6
10
  * Tested up to: 6.0
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: elearning, education, course, lms, learning management system
5
  Requires at least: 5.6
6
  Tested up to: 6.0
7
  Requires PHP: 7.0
8
- Stable tag: 4.1.6.9.2
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -203,6 +203,9 @@ https://www.transifex.com/projects/p/learnpress/
203
 
204
  == Changelog ==
205
 
 
 
 
206
  = 4.1.6.9.2 (2022-08-09) =
207
  ~ Fixed: show wrong special character (Ex: ü) on Section title, description.
208
  ~ Fixed: error on duplicate course, item function not same content old course, item.
5
  Requires at least: 5.6
6
  Tested up to: 6.0
7
  Requires PHP: 7.0
8
+ Stable tag: 4.1.6.9.1
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
203
 
204
  == Changelog ==
205
 
206
+ = 4.1.6.9.3 (2022-08-10) =
207
+ ~ Fixed: show wrong shortcode on course, item's course.
208
+
209
  = 4.1.6.9.2 (2022-08-09) =
210
  ~ Fixed: show wrong special character (Ex: ü) on Section title, description.
211
  ~ Fixed: error on duplicate course, item function not same content old course, item.
templates/content-lesson/content.php CHANGED
@@ -34,8 +34,6 @@ if ( ! $content ) {
34
 
35
  <div class="content-item-description lesson-description">
36
  <?php
37
- /*$content = apply_filters( 'the_content', $content );
38
- echo str_replace( ']]>', ']]&gt;', $content );*/
39
  learn_press_echo_vuejs_write_on_php( $content );
40
  ?>
41
  </div>
34
 
35
  <div class="content-item-description lesson-description">
36
  <?php
 
 
37
  learn_press_echo_vuejs_write_on_php( $content );
38
  ?>
39
  </div>
templates/content-quiz/js.php CHANGED
@@ -69,6 +69,11 @@ if ( $user_quiz ) {
69
  $user_js['results'] = $quiz_results;
70
  $answered = $quiz_results['questions'];
71
  }
 
 
 
 
 
72
  }
73
 
74
  $questions = learn_press_rest_prepare_user_questions(
@@ -90,7 +95,7 @@ $js = array(
90
  'nonce' => wp_create_nonce( sprintf( 'user-quiz-%d', get_current_user_id() ) ),
91
  'id' => $quiz->get_id(),
92
  'title' => $quiz->get_title(),
93
- 'content' => $quiz->get_content(),
94
  'questions' => $questions,
95
  'question_ids' => array_map( 'absint', array_values( $question_ids ) ),
96
  'current_question' => absint( reset( $question_ids ) ),
69
  $user_js['results'] = $quiz_results;
70
  $answered = $quiz_results['questions'];
71
  }
72
+ } else {
73
+ // Display quiz content.
74
+ echo '<div class="quiz-content">';
75
+ learn_press_echo_vuejs_write_on_php( $quiz->get_content() );
76
+ echo '</div>';
77
  }
78
 
79
  $questions = learn_press_rest_prepare_user_questions(
95
  'nonce' => wp_create_nonce( sprintf( 'user-quiz-%d', get_current_user_id() ) ),
96
  'id' => $quiz->get_id(),
97
  'title' => $quiz->get_title(),
98
+ 'content' => '',
99
  'questions' => $questions,
100
  'question_ids' => array_map( 'absint', array_values( $question_ids ) ),
101
  'current_question' => absint( reset( $question_ids ) ),