2022-08-08 17:12:34 +08:00

9 lines
146 KiB
JavaScript

(function(){function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}System.register([],(function(){"use strict";return{execute:function(){const p=function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerpolicy&&(t.referrerPolicy=e.referrerpolicy),"use-credentials"===e.crossorigin?t.credentials="include":"anonymous"===e.crossorigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var events={exports:{}},R="object"==typeof Reflect?Reflect:null,ReflectApply=R&&"function"==typeof R.apply?R.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},ReflectOwnKeys;function ProcessEmitWarning(e){console&&console.warn&&console.warn(e)}ReflectOwnKeys=R&&"function"==typeof R.ownKeys?R.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var NumberIsNaN=Number.isNaN||function(e){return e!=e};function EventEmitter(){EventEmitter.init.call(this)}events.exports=EventEmitter,events.exports.once=once,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function _getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function _addListener(e,t,n,r){var o,a,i;if(checkListener(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),i=a[t]),void 0===i)i=a[t]=n,++e._eventsCount;else if("function"==typeof i?i=a[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(o=_getMaxListeners(e))>0&&i.length>o&&!i.warned){i.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=i.length,ProcessEmitWarning(s)}return e}function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=onceWrapper.bind(r);return o.listener=n,r.wrapFn=o,o}function _listeners(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?unwrapListeners(o):arrayClone(o,o.length)}function listenerCount(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function arrayClone(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function once(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}eventTargetAgnosticAddListener(e,t,a,{once:!0}),"error"!==t&&addErrorHandlerIfEventEmitter(e,o,{once:!0})}))}function addErrorHandlerIfEventEmitter(e,t,n){"function"==typeof e.on&&eventTargetAgnosticAddListener(e,"error",t,n)}function eventTargetAgnosticAddListener(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(a){r.once&&e.removeEventListener(t,o),n(a)}))}}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(e){if("number"!=typeof e||e<0||NumberIsNaN(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");defaultMaxListeners=e}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||NumberIsNaN(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},EventEmitter.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var i=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw i.context=a,i}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)ReflectApply(s,this,t);else{var l=s.length,c=arrayClone(s,l);for(n=0;n<l;++n)ReflectApply(c[n],this,t)}return!0},EventEmitter.prototype.addListener=function(e,t){return _addListener(this,e,t,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function(e,t){return _addListener(this,e,t,!0)},EventEmitter.prototype.once=function(e,t){return checkListener(t),this.on(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.prependOnceListener=function(e,t){return checkListener(t),this.prependListener(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.removeListener=function(e,t){var n,r,o,a,i;if(checkListener(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){i=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():spliceOne(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,i||t)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(o=a[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},EventEmitter.prototype.listeners=function(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};class Env{constructor(e=globalThis.navigator.userAgent,t={}){_defineProperty(this,"isIos",!1),_defineProperty(this,"isIphone",!1),_defineProperty(this,"isIpad",!1),_defineProperty(this,"isAndroid",!1),_defineProperty(this,"isAndroidPad",!1),_defineProperty(this,"isMac",!1),_defineProperty(this,"isWin",!1),_defineProperty(this,"isMqq",!1),_defineProperty(this,"isWechat",!1),_defineProperty(this,"isWeb",!1),this.isIphone=e.indexOf("iPhone")>=0,this.isIpad=/(iPad).*OS\s([\d_]+)/.test(e),this.isIos=this.isIphone||this.isIpad,this.isAndroid=e.indexOf("Android")>=0,this.isAndroidPad=this.isAndroid&&e.indexOf("Mobile")<0,this.isMac=e.indexOf("Macintosh")>=0,this.isWin=e.indexOf("Windows")>=0,this.isMqq=/QQ\/([\d.]+)/.test(e),this.isWechat=e.indexOf("MicroMessenger")>=0&&e.indexOf("wxwork")<0,this.isWeb=!this.isIos&&!this.isAndroid&&!/(WebOS|BlackBerry)/.test(e),Object.entries(t).forEach((([e,t])=>{this[e]=t}))}}const COMMON_EVENT_PREFIX="magic:common:events:",COMMON_METHOD_PREFIX="magic:common:actions:",CommonMethod={SHOW:"show",HIDE:"hide",SCROLL_TO_VIEW:"scrollIntoView",SCROLL_TO_TOP:"scrollToTop"},DEFAULT_EVENTS=[{label:"点击",value:`${COMMON_EVENT_PREFIX}click`}],getCommonEventName=(e,t)=>{const n=`${e}:${t}`;return e.startsWith(COMMON_EVENT_PREFIX)?n:`${COMMON_EVENT_PREFIX}${n}`},isCommonMethod=e=>e.startsWith(COMMON_METHOD_PREFIX),getDirectComponent=(e,t)=>{var n;if(!e)return!1;if(!e.id)return getDirectComponent(e.parentElement,t);const r=null===(n=t.page)||void 0===n?void 0:n.getNode(e.id);return r||!1},commonClickEventHandler=(e,t,n)=>{const r=getDirectComponent(n.target,e);if(r){const{instance:n,data:o}=r;e.emit(getCommonEventName(t,o.id),n)}},bindCommonEventListener=e=>{window.document.body.addEventListener("click",(t=>{commonClickEventHandler(e,"click",t)})),window.document.body.addEventListener("click",(t=>{commonClickEventHandler(e,"click:capture",t)}),!0)},triggerCommonMethod=(e,t)=>{const{instance:n}=t;switch(e.replace(COMMON_METHOD_PREFIX,"")){case CommonMethod.SHOW:n.show();break;case CommonMethod.HIDE:n.hide();break;case CommonMethod.SCROLL_TO_VIEW:n.$el.scrollIntoView({behavior:"smooth"});break;case CommonMethod.SCROLL_TO_TOP:window.scrollTo({top:0,behavior:"smooth"})}};class Node extends events.exports.EventEmitter{constructor(e){super(),_defineProperty(this,"data",void 0),_defineProperty(this,"style",void 0),_defineProperty(this,"events",void 0),_defineProperty(this,"instance",void 0),_defineProperty(this,"page",void 0),_defineProperty(this,"parent",void 0),_defineProperty(this,"app",void 0),this.page=e.page,this.parent=e.parent,this.app=e.app;const{events:t}=e.config;this.data=e.config,this.events=t,this.listenLifeSafe(),this.once("destroy",(()=>{this.instance=null,"function"==typeof this.data.destroy&&this.data.destroy(this),this.listenLifeSafe()}))}listenLifeSafe(){this.once("created",(e=>{this.instance=e,"function"==typeof this.data.created&&this.data.created(this)})),this.once("mounted",(e=>{this.instance=e;const t=this.app.eventQueueMap[e.config.id]||[];for(let n=t.shift();n;n=t.shift())this.app.eventHandler(n.eventConfig,n.fromCpt,n.args);"function"==typeof this.data.mounted&&this.data.mounted(this)}))}}class Page extends Node{constructor(e){super(e),_defineProperty(this,"nodes",new Map),this.setNode(e.config.id,this),this.initNode(e.config,this)}initNode(e,t){var n;const r=new Node({config:e,parent:t,page:this,app:this.app});this.setNode(e.id,r),null===(n=e.items)||void 0===n||n.forEach((e=>{this.initNode(e,r)}))}getNode(e){return this.nodes.get(e)}setNode(e,t){this.nodes.set(e,t)}deleteNode(e){this.nodes.delete(e)}}const style2Obj=e=>{if("string"!=typeof e)return e;const t={};return e.split(";").forEach((e=>{if(!e)return;const n=e.split(":");let r=n.shift(),o=n.join(":");r&&(r=r.replace(/^\s*/,"").replace(/\s*$/,""),o=o.replace(/^\s*/,"").replace(/\s*$/,""),r=r.split("-").map(((e,t)=>t>0?`${e[0].toUpperCase()}${e.substr(1)}`:e)).join(""),t[r]=o)})),t},fillBackgroundImage=e=>!e||/^url/.test(e)||/^linear-gradient/.test(e)?e:`url(${e})`;class App extends events.exports.EventEmitter{constructor(e){if(super(),_defineProperty(this,"env",void 0),_defineProperty(this,"pages",new Map),_defineProperty(this,"page",void 0),_defineProperty(this,"platform","mobile"),_defineProperty(this,"jsEngine","browser"),_defineProperty(this,"designWidth",375),_defineProperty(this,"components",new Map),_defineProperty(this,"eventQueueMap",{}),this.env=new Env(e.ua),e.platform&&(this.platform=e.platform),e.jsEngine&&(this.jsEngine=e.jsEngine),e.designWidth&&(this.designWidth=e.designWidth),"mobile"===this.platform||"editor"===this.platform){const e=()=>{let{width:e}=document.documentElement.getBoundingClientRect();e=Math.min(800,e);const t=e/(this.designWidth/100);document.documentElement.style.fontSize=`${t}px`};e(),document.body.style.fontSize="14px",globalThis.addEventListener("resize",e)}e.transformStyle&&(this.transformStyle=e.transformStyle),e.config&&this.setConfig(e.config,e.curPage),bindCommonEventListener(this)}transformStyle(e){if(!e)return{};let t={};const n={};t="string"==typeof e?style2Obj(e):{...e};const r=["zIndex","opacity","fontWeight"];return Object.entries(t).forEach((([e,t])=>{"backgroundImage"===e?t&&(n[e]=fillBackgroundImage(t)):"transform"===e&&"string"!=typeof t?n[e]=Object.entries(t).map((([e,t])=>{let n=0;return"scale"===e&&(n=1),`${e}(${t||n})`})).join(" "):!r.includes(e)&&t&&/^[-]?[0-9]*[.]?[0-9]*$/.test(t)?n[e]=t/100+"rem":n[e]=t})),n}setConfig(e,t){var n,r,o;this.pages=new Map,null===(n=e.items)||void 0===n||n.forEach((e=>{this.pages.set(e.id,new Page({config:e,app:this}))})),this.setPage(t||(null===(r=this.page)||void 0===r||null===(o=r.data)||void 0===o?void 0:o.id))}setPage(e){let t;e&&(t=this.pages.get(e)),t||(t=this.pages.get(this.pages.keys().next().value)),this.page=t,"magic"!==this.platform&&this.bindEvents()}registerComponent(e,t){this.components.set(e,t)}unregisterComponent(e){this.components.delete(e)}resolveComponent(e){return this.components.get(e)}bindEvents(){if(this.page){this.removeAllListeners();for(const[,t]of this.page.nodes){var e;null===(e=t.events)||void 0===e||e.forEach((e=>this.bindEvent(e,`${t.data.id}`)))}}}bindEvent(e,t){let{name:n}=e;DEFAULT_EVENTS.findIndex((e=>e.value===n))>-1&&(n=getCommonEventName(n,t)),this.on(n,((t,...n)=>{this.eventHandler(e,t,n)}))}eventHandler(e,t,n){if(!this.page)throw new Error("当前没有页面");const{method:r,to:o}=e,a=this.page.getNode(o);if(!a)throw`ID为${o}的组件不存在`;if(isCommonMethod(r))return triggerCommonMethod(r,a);a.instance?"function"==typeof a.instance[r]&&a.instance[r](t,...n):this.addEventToMap({eventConfig:e,fromCpt:t,args:n})}destroy(){this.removeAllListeners(),this.pages.clear()}addEventToMap(e){this.eventQueueMap[e.eventConfig.to]?this.eventQueueMap[e.eventConfig.to].push(e):this.eventQueueMap[e.eventConfig.to]=[e]}}//! moment.js
//! version : 2.29.3
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
var hookCallback,some;function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(e){hookCallback=e}function isArray$1(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function isObject$1(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function hasOwnProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function isObjectEmpty(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(hasOwnProp(e,t))return!1;return!0}function isUndefined$1(e){return void 0===e}function isNumber$1(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function isDate$1(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function map(e,t){var n,r=[],o=e.length;for(n=0;n<o;++n)r.push(t(e[n],n));return r}function extend$1(e,t){for(var n in t)hasOwnProp(t,n)&&(e[n]=t[n]);return hasOwnProp(t,"toString")&&(e.toString=t.toString),hasOwnProp(t,"valueOf")&&(e.valueOf=t.valueOf),e}function createUTC(e,t,n,r){return createLocalOrUTC(e,t,n,r,!0).utc()}function defaultParsingFlags(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function getParsingFlags(e){return null==e._pf&&(e._pf=defaultParsingFlags()),e._pf}function isValid(e){if(null==e._isValid){var t=getParsingFlags(e),n=some.call(t.parsedDateParts,(function(e){return null!=e})),r=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return r;e._isValid=r}return e._isValid}function createInvalid(e){var t=createUTC(NaN);return null!=e?extend$1(getParsingFlags(t),e):getParsingFlags(t).userInvalidated=!0,t}some=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var momentProperties=hooks.momentProperties=[],updateInProgress=!1;function copyConfig(e,t){var n,r,o,a=momentProperties.length;if(isUndefined$1(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),isUndefined$1(t._i)||(e._i=t._i),isUndefined$1(t._f)||(e._f=t._f),isUndefined$1(t._l)||(e._l=t._l),isUndefined$1(t._strict)||(e._strict=t._strict),isUndefined$1(t._tzm)||(e._tzm=t._tzm),isUndefined$1(t._isUTC)||(e._isUTC=t._isUTC),isUndefined$1(t._offset)||(e._offset=t._offset),isUndefined$1(t._pf)||(e._pf=getParsingFlags(t)),isUndefined$1(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)isUndefined$1(o=t[r=momentProperties[n]])||(e[r]=o);return e}function Moment(e){copyConfig(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===updateInProgress&&(updateInProgress=!0,hooks.updateOffset(this),updateInProgress=!1)}function isMoment(e){return e instanceof Moment||null!=e&&null!=e._isAMomentObject}function warn(e){!1===hooks.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function deprecate(e,t){var n=!0;return extend$1((function(){if(null!=hooks.deprecationHandler&&hooks.deprecationHandler(null,e),n){var r,o,a,i=[],s=arguments.length;for(o=0;o<s;o++){if(r="","object"==typeof arguments[o]){for(a in r+="\n["+o+"] ",arguments[0])hasOwnProp(arguments[0],a)&&(r+=a+": "+arguments[0][a]+", ");r=r.slice(0,-2)}else r=arguments[o];i.push(r)}warn(e+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var deprecations={},keys;function deprecateSimple(e,t){null!=hooks.deprecationHandler&&hooks.deprecationHandler(e,t),deprecations[e]||(warn(t),deprecations[e]=!0)}function isFunction$1(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function set(e){var t,n;for(n in e)hasOwnProp(e,n)&&(isFunction$1(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(e,t){var n,r=extend$1({},e);for(n in t)hasOwnProp(t,n)&&(isObject$1(e[n])&&isObject$1(t[n])?(r[n]={},extend$1(r[n],e[n]),extend$1(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)hasOwnProp(e,n)&&!hasOwnProp(t,n)&&isObject$1(e[n])&&(r[n]=extend$1({},r[n]));return r}function Locale(e){null!=e&&this.set(e)}hooks.suppressDeprecationWarnings=!1,hooks.deprecationHandler=null,keys=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)hasOwnProp(e,t)&&n.push(t);return n};var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return isFunction$1(r)?r.call(t,n):r}function zeroFill(e,t,n){var r=""+Math.abs(e),o=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(e,t,n,r){var o=r;"string"==typeof r&&(o=function(){return this[r]()}),e&&(formatTokenFunctions[e]=o),t&&(formatTokenFunctions[t[0]]=function(){return zeroFill(o.apply(this,arguments),t[1],t[2])}),n&&(formatTokenFunctions[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function removeFormattingTokens(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function makeFormatFunction(e){var t,n,r=e.match(formattingTokens);for(t=0,n=r.length;t<n;t++)formatTokenFunctions[r[t]]?r[t]=formatTokenFunctions[r[t]]:r[t]=removeFormattingTokens(r[t]);return function(t){var o,a="";for(o=0;o<n;o++)a+=isFunction$1(r[o])?r[o].call(t,e):r[o];return a}}function formatMoment(e,t){return e.isValid()?(t=expandFormat(t,e.localeData()),formatFunctions[t]=formatFunctions[t]||makeFormatFunction(t),formatFunctions[t](e)):e.localeData().invalidDate()}function expandFormat(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(localFormattingTokens.lastIndex=0;n>=0&&localFormattingTokens.test(e);)e=e.replace(localFormattingTokens,r),localFormattingTokens.lastIndex=0,n-=1;return e}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(formattingTokens).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(e){return this._ordinal.replace("%d",e)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(e,t,n,r){var o=this._relativeTime[n];return isFunction$1(o)?o(e,t,n,r):o.replace(/%d/i,e)}function pastFuture(e,t){var n=this._relativeTime[e>0?"future":"past"];return isFunction$1(n)?n(t):n.replace(/%s/i,t)}var aliases={};function addUnitAlias(e,t){var n=e.toLowerCase();aliases[n]=aliases[n+"s"]=aliases[t]=e}function normalizeUnits(e){return"string"==typeof e?aliases[e]||aliases[e.toLowerCase()]:void 0}function normalizeObjectUnits(e){var t,n,r={};for(n in e)hasOwnProp(e,n)&&(t=normalizeUnits(n))&&(r[t]=e[n]);return r}var priorities={};function addUnitPriority(e,t){priorities[e]=t}function getPrioritizedUnits(e){var t,n=[];for(t in e)hasOwnProp(e,t)&&n.push({unit:t,priority:priorities[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}function isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}function absFloor(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function toInt(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=absFloor(t)),n}function makeGetSet(e,t){return function(n){return null!=n?(set$1(this,e,n),hooks.updateOffset(this,t),this):get(this,e)}}function get(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function set$1(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&isLeapYear(e.year())&&1===e.month()&&29===e.date()?(n=toInt(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),daysInMonth(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function stringGet(e){return isFunction$1(this[e=normalizeUnits(e)])?this[e]():this}function stringSet(e,t){if("object"==typeof e){var n,r=getPrioritizedUnits(e=normalizeObjectUnits(e)),o=r.length;for(n=0;n<o;n++)this[r[n].unit](e[r[n].unit])}else if(isFunction$1(this[e=normalizeUnits(e)]))return this[e](t);return this}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,regexes;function addRegexToken(e,t,n){regexes[e]=isFunction$1(t)?t:function(e,r){return e&&n?n:t}}function getParseRegexForToken(e,t){return hasOwnProp(regexes,e)?regexes[e](t._strict,t._locale):new RegExp(unescapeFormat(e))}function unescapeFormat(e){return regexEscape(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,o){return t||n||r||o})))}function regexEscape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}regexes={};var tokens={};function addParseToken(e,t){var n,r,o=t;for("string"==typeof e&&(e=[e]),isNumber$1(t)&&(o=function(e,n){n[t]=toInt(e)}),r=e.length,n=0;n<r;n++)tokens[e[n]]=o}function addWeekParseToken(e,t){addParseToken(e,(function(e,n,r,o){r._w=r._w||{},t(e,r._w,r,o)}))}function addTimeToArrayFromToken(e,t,n){null!=t&&hasOwnProp(tokens,e)&&tokens[e](t,n._a,n,e)}var YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8,indexOf;function mod(e,t){return(e%t+t)%t}function daysInMonth(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=mod(t,12);return e+=(t-n)/12,1===n?isLeapYear(e)?29:28:31-n%7%2}indexOf=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},addFormatToken("M",["MM",2],"Mo",(function(){return this.month()+1})),addFormatToken("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),addFormatToken("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),addUnitAlias("month","M"),addUnitPriority("month",8),addRegexToken("M",match1to2),addRegexToken("MM",match1to2,match2),addRegexToken("MMM",(function(e,t){return t.monthsShortRegex(e)})),addRegexToken("MMMM",(function(e,t){return t.monthsRegex(e)})),addParseToken(["M","MM"],(function(e,t){t[MONTH]=toInt(e)-1})),addParseToken(["MMM","MMMM"],(function(e,t,n,r){var o=n._locale.monthsParse(e,r,n._strict);null!=o?t[MONTH]=o:getParsingFlags(n).invalidMonth=e}));var defaultLocaleMonths="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),defaultLocaleMonthsShort="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,defaultMonthsShortRegex=matchWord,defaultMonthsRegex=matchWord;function localeMonths(e,t){return e?isArray$1(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(t)?"format":"standalone"][e.month()]:isArray$1(this._months)?this._months:this._months.standalone}function localeMonthsShort(e,t){return e?isArray$1(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(t)?"format":"standalone"][e.month()]:isArray$1(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function handleStrictParse(e,t,n){var r,o,a,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=createUTC([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(o=indexOf.call(this._shortMonthsParse,i))?o:null:-1!==(o=indexOf.call(this._longMonthsParse,i))?o:null:"MMM"===t?-1!==(o=indexOf.call(this._shortMonthsParse,i))||-1!==(o=indexOf.call(this._longMonthsParse,i))?o:null:-1!==(o=indexOf.call(this._longMonthsParse,i))||-1!==(o=indexOf.call(this._shortMonthsParse,i))?o:null}function localeMonthsParse(e,t,n){var r,o,a;if(this._monthsParseExact)return handleStrictParse.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(o=createUTC([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function setMonth(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=toInt(t);else if(!isNumber$1(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),daysInMonth(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function getSetMonth(e){return null!=e?(setMonth(this,e),hooks.updateOffset(this,!0),this):get(this,"Month")}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(hasOwnProp(this,"_monthsShortRegex")||(this._monthsShortRegex=defaultMonthsShortRegex),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function monthsRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsStrictRegex:this._monthsRegex):(hasOwnProp(this,"_monthsRegex")||(this._monthsRegex=defaultMonthsRegex),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function computeMonthsParse(){function e(e,t){return t.length-e.length}var t,n,r=[],o=[],a=[];for(t=0;t<12;t++)n=createUTC([2e3,t]),r.push(this.monthsShort(n,"")),o.push(this.months(n,"")),a.push(this.months(n,"")),a.push(this.monthsShort(n,""));for(r.sort(e),o.sort(e),a.sort(e),t=0;t<12;t++)r[t]=regexEscape(r[t]),o[t]=regexEscape(o[t]);for(t=0;t<24;t++)a[t]=regexEscape(a[t]);this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function daysInYear(e){return isLeapYear(e)?366:365}addFormatToken("Y",0,0,(function(){var e=this.year();return e<=9999?zeroFill(e,4):"+"+e})),addFormatToken(0,["YY",2],0,(function(){return this.year()%100})),addFormatToken(0,["YYYY",4],0,"year"),addFormatToken(0,["YYYYY",5],0,"year"),addFormatToken(0,["YYYYYY",6,!0],0,"year"),addUnitAlias("year","y"),addUnitPriority("year",1),addRegexToken("Y",matchSigned),addRegexToken("YY",match1to2,match2),addRegexToken("YYYY",match1to4,match4),addRegexToken("YYYYY",match1to6,match6),addRegexToken("YYYYYY",match1to6,match6),addParseToken(["YYYYY","YYYYYY"],YEAR),addParseToken("YYYY",(function(e,t){t[YEAR]=2===e.length?hooks.parseTwoDigitYear(e):toInt(e)})),addParseToken("YY",(function(e,t){t[YEAR]=hooks.parseTwoDigitYear(e)})),addParseToken("Y",(function(e,t){t[YEAR]=parseInt(e,10)})),hooks.parseTwoDigitYear=function(e){return toInt(e)+(toInt(e)>68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear(this.year())}function createDate(e,t,n,r,o,a,i){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,o,a,i),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,o,a,i),s}function createUTCDate(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function firstWeekOffset(e,t,n){var r=7+t-n;return-((7+createUTCDate(e,0,r).getUTCDay()-t)%7)+r-1}function dayOfYearFromWeeks(e,t,n,r,o){var a,i,s=1+7*(t-1)+(7+n-r)%7+firstWeekOffset(e,r,o);return s<=0?i=daysInYear(a=e-1)+s:s>daysInYear(e)?(a=e+1,i=s-daysInYear(e)):(a=e,i=s),{year:a,dayOfYear:i}}function weekOfYear(e,t,n){var r,o,a=firstWeekOffset(e.year(),t,n),i=Math.floor((e.dayOfYear()-a-1)/7)+1;return i<1?r=i+weeksInYear(o=e.year()-1,t,n):i>weeksInYear(e.year(),t,n)?(r=i-weeksInYear(e.year(),t,n),o=e.year()+1):(o=e.year(),r=i),{week:r,year:o}}function weeksInYear(e,t,n){var r=firstWeekOffset(e,t,n),o=firstWeekOffset(e+1,t,n);return(daysInYear(e)-r+o)/7}function localeWeek(e){return weekOfYear(e,this._week.dow,this._week.doy).week}addFormatToken("w",["ww",2],"wo","week"),addFormatToken("W",["WW",2],"Wo","isoWeek"),addUnitAlias("week","w"),addUnitAlias("isoWeek","W"),addUnitPriority("week",5),addUnitPriority("isoWeek",5),addRegexToken("w",match1to2),addRegexToken("ww",match1to2,match2),addRegexToken("W",match1to2),addRegexToken("WW",match1to2,match2),addWeekParseToken(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=toInt(e)}));var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function getSetISOWeek(e){var t=weekOfYear(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function parseWeekday(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function parseIsoWeekday(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function shiftWeekdays(e,t){return e.slice(t,7).concat(e.slice(0,t))}addFormatToken("d",0,"do","day"),addFormatToken("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),addFormatToken("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),addFormatToken("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),addFormatToken("e",0,0,"weekday"),addFormatToken("E",0,0,"isoWeekday"),addUnitAlias("day","d"),addUnitAlias("weekday","e"),addUnitAlias("isoWeekday","E"),addUnitPriority("day",11),addUnitPriority("weekday",11),addUnitPriority("isoWeekday",11),addRegexToken("d",match1to2),addRegexToken("e",match1to2),addRegexToken("E",match1to2),addRegexToken("dd",(function(e,t){return t.weekdaysMinRegex(e)})),addRegexToken("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),addRegexToken("dddd",(function(e,t){return t.weekdaysRegex(e)})),addWeekParseToken(["dd","ddd","dddd"],(function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);null!=o?t.d=o:getParsingFlags(n).invalidWeekday=e})),addWeekParseToken(["d","e","E"],(function(e,t,n,r){t[r]=toInt(e)}));var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(e,t){var n=isArray$1(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?shiftWeekdays(n,this._week.dow):e?n[e.day()]:n}function localeWeekdaysShort(e){return!0===e?shiftWeekdays(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function localeWeekdaysMin(e){return!0===e?shiftWeekdays(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function handleStrictParse$1(e,t,n){var r,o,a,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=createUTC([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(o=indexOf.call(this._weekdaysParse,i))?o:null:"ddd"===t?-1!==(o=indexOf.call(this._shortWeekdaysParse,i))?o:null:-1!==(o=indexOf.call(this._minWeekdaysParse,i))?o:null:"dddd"===t?-1!==(o=indexOf.call(this._weekdaysParse,i))||-1!==(o=indexOf.call(this._shortWeekdaysParse,i))||-1!==(o=indexOf.call(this._minWeekdaysParse,i))?o:null:"ddd"===t?-1!==(o=indexOf.call(this._shortWeekdaysParse,i))||-1!==(o=indexOf.call(this._weekdaysParse,i))||-1!==(o=indexOf.call(this._minWeekdaysParse,i))?o:null:-1!==(o=indexOf.call(this._minWeekdaysParse,i))||-1!==(o=indexOf.call(this._weekdaysParse,i))||-1!==(o=indexOf.call(this._shortWeekdaysParse,i))?o:null}function localeWeekdaysParse(e,t,n){var r,o,a;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=createUTC([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function getSetDayOfWeek(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=parseWeekday(e,this.localeData()),this.add(e-t,"d")):t}function getSetLocaleDayOfWeek(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function getSetISODayOfWeek(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=parseIsoWeekday(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function weekdaysRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function e(e,t){return t.length-e.length}var t,n,r,o,a,i=[],s=[],l=[],c=[];for(t=0;t<7;t++)n=createUTC([2e3,1]).day(t),r=regexEscape(this.weekdaysMin(n,"")),o=regexEscape(this.weekdaysShort(n,"")),a=regexEscape(this.weekdays(n,"")),i.push(r),s.push(o),l.push(a),c.push(r),c.push(o),c.push(a);i.sort(e),s.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}function meridiem(e,t){addFormatToken(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function matchMeridiem(e,t){return t._meridiemParse}function localeIsPM(e){return"p"===(e+"").toLowerCase().charAt(0)}addFormatToken("H",["HH",2],0,"hour"),addFormatToken("h",["hh",2],0,hFormat),addFormatToken("k",["kk",2],0,kFormat),addFormatToken("hmm",0,0,(function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)})),addFormatToken("hmmss",0,0,(function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)})),addFormatToken("Hmm",0,0,(function(){return""+this.hours()+zeroFill(this.minutes(),2)})),addFormatToken("Hmmss",0,0,(function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)})),meridiem("a",!0),meridiem("A",!1),addUnitAlias("hour","h"),addUnitPriority("hour",13),addRegexToken("a",matchMeridiem),addRegexToken("A",matchMeridiem),addRegexToken("H",match1to2),addRegexToken("h",match1to2),addRegexToken("k",match1to2),addRegexToken("HH",match1to2,match2),addRegexToken("hh",match1to2,match2),addRegexToken("kk",match1to2,match2),addRegexToken("hmm",match3to4),addRegexToken("hmmss",match5to6),addRegexToken("Hmm",match3to4),addRegexToken("Hmmss",match5to6),addParseToken(["H","HH"],HOUR),addParseToken(["k","kk"],(function(e,t,n){var r=toInt(e);t[HOUR]=24===r?0:r})),addParseToken(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),addParseToken(["h","hh"],(function(e,t,n){t[HOUR]=toInt(e),getParsingFlags(n).bigHour=!0})),addParseToken("hmm",(function(e,t,n){var r=e.length-2;t[HOUR]=toInt(e.substr(0,r)),t[MINUTE]=toInt(e.substr(r)),getParsingFlags(n).bigHour=!0})),addParseToken("hmmss",(function(e,t,n){var r=e.length-4,o=e.length-2;t[HOUR]=toInt(e.substr(0,r)),t[MINUTE]=toInt(e.substr(r,2)),t[SECOND]=toInt(e.substr(o)),getParsingFlags(n).bigHour=!0})),addParseToken("Hmm",(function(e,t,n){var r=e.length-2;t[HOUR]=toInt(e.substr(0,r)),t[MINUTE]=toInt(e.substr(r))})),addParseToken("Hmmss",(function(e,t,n){var r=e.length-4,o=e.length-2;t[HOUR]=toInt(e.substr(0,r)),t[MINUTE]=toInt(e.substr(r,2)),t[SECOND]=toInt(e.substr(o))}));var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},globalLocale;function commonPrefix(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function normalizeLocale(e){return e?e.toLowerCase().replace("_","-"):e}function chooseLocale(e){for(var t,n,r,o,a=0;a<e.length;){for(t=(o=normalizeLocale(e[a]).split("-")).length,n=(n=normalizeLocale(e[a+1]))?n.split("-"):null;t>0;){if(r=loadLocale(o.slice(0,t).join("-")))return r;if(n&&n.length>=t&&commonPrefix(o,n)>=t-1)break;t--}a++}return globalLocale}function isLocaleNameSane(e){return null!=e.match("^[^/\\\\]*$")}function loadLocale(e){var t=null;if(void 0===locales[e]&&"undefined"!=typeof module&&module&&module.exports&&isLocaleNameSane(e))try{t=globalLocale._abbr,require("./locale/"+e),getSetGlobalLocale(t)}catch(n){locales[e]=null}return locales[e]}function getSetGlobalLocale(e,t){var n;return e&&((n=isUndefined$1(t)?getLocale(e):defineLocale(e,t))?globalLocale=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(e,t){if(null!==t){var n,r=baseConfig;if(t.abbr=e,null!=locales[e])deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=locales[e]._config;else if(null!=t.parentLocale)if(null!=locales[t.parentLocale])r=locales[t.parentLocale]._config;else{if(null==(n=loadLocale(t.parentLocale)))return localeFamilies[t.parentLocale]||(localeFamilies[t.parentLocale]=[]),localeFamilies[t.parentLocale].push({name:e,config:t}),null;r=n._config}return locales[e]=new Locale(mergeConfigs(r,t)),localeFamilies[e]&&localeFamilies[e].forEach((function(e){defineLocale(e.name,e.config)})),getSetGlobalLocale(e),locales[e]}return delete locales[e],null}function updateLocale(e,t){if(null!=t){var n,r,o=baseConfig;null!=locales[e]&&null!=locales[e].parentLocale?locales[e].set(mergeConfigs(locales[e]._config,t)):(null!=(r=loadLocale(e))&&(o=r._config),t=mergeConfigs(o,t),null==r&&(t.abbr=e),(n=new Locale(t)).parentLocale=locales[e],locales[e]=n),getSetGlobalLocale(e)}else null!=locales[e]&&(null!=locales[e].parentLocale?(locales[e]=locales[e].parentLocale,e===getSetGlobalLocale()&&getSetGlobalLocale(e)):null!=locales[e]&&delete locales[e]);return locales[e]}function getLocale(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return globalLocale;if(!isArray$1(e)){if(t=loadLocale(e))return t;e=[e]}return chooseLocale(e)}function listLocales(){return keys(locales)}function checkOverflow(e){var t,n=e._a;return n&&-2===getParsingFlags(e).overflow&&(t=n[MONTH]<0||n[MONTH]>11?MONTH:n[DATE]<1||n[DATE]>daysInMonth(n[YEAR],n[MONTH])?DATE:n[HOUR]<0||n[HOUR]>24||24===n[HOUR]&&(0!==n[MINUTE]||0!==n[SECOND]||0!==n[MILLISECOND])?HOUR:n[MINUTE]<0||n[MINUTE]>59?MINUTE:n[SECOND]<0||n[SECOND]>59?SECOND:n[MILLISECOND]<0||n[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(e)._overflowDayOfYear&&(t<YEAR||t>DATE)&&(t=DATE),getParsingFlags(e)._overflowWeeks&&-1===t&&(t=WEEK),getParsingFlags(e)._overflowWeekday&&-1===t&&(t=WEEKDAY),getParsingFlags(e).overflow=t),e}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function configFromISO(e){var t,n,r,o,a,i,s=e._i,l=extendedIsoRegex.exec(s)||basicIsoRegex.exec(s),c=isoDates.length,u=isoTimes.length;if(l){for(getParsingFlags(e).iso=!0,t=0,n=c;t<n;t++)if(isoDates[t][1].exec(l[1])){o=isoDates[t][0],r=!1!==isoDates[t][2];break}if(null==o)return void(e._isValid=!1);if(l[3]){for(t=0,n=u;t<n;t++)if(isoTimes[t][1].exec(l[3])){a=(l[2]||" ")+isoTimes[t][0];break}if(null==a)return void(e._isValid=!1)}if(!r&&null!=a)return void(e._isValid=!1);if(l[4]){if(!tzRegex.exec(l[4]))return void(e._isValid=!1);i="Z"}e._f=o+(a||"")+(i||""),configFromStringAndFormat(e)}else e._isValid=!1}function extractFromRFC2822Strings(e,t,n,r,o,a){var i=[untruncateYear(e),defaultLocaleMonthsShort.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(o,10)];return a&&i.push(parseInt(a,10)),i}function untruncateYear(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function preprocessRFC2822(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(e,t,n){if(e&&defaultLocaleWeekdaysShort.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay())return getParsingFlags(n).weekdayMismatch=!0,n._isValid=!1,!1;return!0}function calculateOffset(e,t,n){if(e)return obsOffsets[e];if(t)return 0;var r=parseInt(n,10),o=r%100;return 60*((r-o)/100)+o}function configFromRFC2822(e){var t,n=rfc2822.exec(preprocessRFC2822(e._i));if(n){if(t=extractFromRFC2822Strings(n[4],n[3],n[2],n[5],n[6],n[7]),!checkWeekday(n[1],t,e))return;e._a=t,e._tzm=calculateOffset(n[8],n[9],n[10]),e._d=createUTCDate.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),getParsingFlags(e).rfc2822=!0}else e._isValid=!1}function configFromString(e){var t=aspNetJsonRegex.exec(e._i);null===t?(configFromISO(e),!1===e._isValid&&(delete e._isValid,configFromRFC2822(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:hooks.createFromInputFallback(e)))):e._d=new Date(+t[1])}function defaults$3(e,t,n){return null!=e?e:null!=t?t:n}function currentDateArray(e){var t=new Date(hooks.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function configFromArray(e){var t,n,r,o,a,i=[];if(!e._d){for(r=currentDateArray(e),e._w&&null==e._a[DATE]&&null==e._a[MONTH]&&dayOfYearFromWeekInfo(e),null!=e._dayOfYear&&(a=defaults$3(e._a[YEAR],r[YEAR]),(e._dayOfYear>daysInYear(a)||0===e._dayOfYear)&&(getParsingFlags(e)._overflowDayOfYear=!0),n=createUTCDate(a,0,e._dayOfYear),e._a[MONTH]=n.getUTCMonth(),e._a[DATE]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=i[t]=r[t];for(;t<7;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[HOUR]&&0===e._a[MINUTE]&&0===e._a[SECOND]&&0===e._a[MILLISECOND]&&(e._nextDay=!0,e._a[HOUR]=0),e._d=(e._useUTC?createUTCDate:createDate).apply(null,i),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[HOUR]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(getParsingFlags(e).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(e){var t,n,r,o,a,i,s,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(a=1,i=4,n=defaults$3(t.GG,e._a[YEAR],weekOfYear(createLocal(),1,4).year),r=defaults$3(t.W,1),((o=defaults$3(t.E,1))<1||o>7)&&(l=!0)):(a=e._locale._week.dow,i=e._locale._week.doy,c=weekOfYear(createLocal(),a,i),n=defaults$3(t.gg,e._a[YEAR],c.year),r=defaults$3(t.w,c.week),null!=t.d?((o=t.d)<0||o>6)&&(l=!0):null!=t.e?(o=t.e+a,(t.e<0||t.e>6)&&(l=!0)):o=a),r<1||r>weeksInYear(n,a,i)?getParsingFlags(e)._overflowWeeks=!0:null!=l?getParsingFlags(e)._overflowWeekday=!0:(s=dayOfYearFromWeeks(n,r,o,a,i),e._a[YEAR]=s.year,e._dayOfYear=s.dayOfYear)}function configFromStringAndFormat(e){if(e._f!==hooks.ISO_8601)if(e._f!==hooks.RFC_2822){e._a=[],getParsingFlags(e).empty=!0;var t,n,r,o,a,i,s,l=""+e._i,c=l.length,u=0;for(s=(r=expandFormat(e._f,e._locale).match(formattingTokens)||[]).length,t=0;t<s;t++)o=r[t],(n=(l.match(getParseRegexForToken(o,e))||[])[0])&&((a=l.substr(0,l.indexOf(n))).length>0&&getParsingFlags(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),u+=n.length),formatTokenFunctions[o]?(n?getParsingFlags(e).empty=!1:getParsingFlags(e).unusedTokens.push(o),addTimeToArrayFromToken(o,n,e)):e._strict&&!n&&getParsingFlags(e).unusedTokens.push(o);getParsingFlags(e).charsLeftOver=c-u,l.length>0&&getParsingFlags(e).unusedInput.push(l),e._a[HOUR]<=12&&!0===getParsingFlags(e).bigHour&&e._a[HOUR]>0&&(getParsingFlags(e).bigHour=void 0),getParsingFlags(e).parsedDateParts=e._a.slice(0),getParsingFlags(e).meridiem=e._meridiem,e._a[HOUR]=meridiemFixWrap(e._locale,e._a[HOUR],e._meridiem),null!==(i=getParsingFlags(e).era)&&(e._a[YEAR]=e._locale.erasConvertYear(i,e._a[YEAR])),configFromArray(e),checkOverflow(e)}else configFromRFC2822(e);else configFromISO(e)}function meridiemFixWrap(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function configFromStringAndArray(e){var t,n,r,o,a,i,s=!1,l=e._f.length;if(0===l)return getParsingFlags(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;o<l;o++)a=0,i=!1,t=copyConfig({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],configFromStringAndFormat(t),isValid(t)&&(i=!0),a+=getParsingFlags(t).charsLeftOver,a+=10*getParsingFlags(t).unusedTokens.length,getParsingFlags(t).score=a,s?a<r&&(r=a,n=t):(null==r||a<r||i)&&(r=a,n=t,i&&(s=!0));extend$1(e,n||t)}function configFromObject(e){if(!e._d){var t=normalizeObjectUnits(e._i),n=void 0===t.day?t.date:t.day;e._a=map([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),configFromArray(e)}}function createFromConfig(e){var t=new Moment(checkOverflow(prepareConfig(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function prepareConfig(e){var t=e._i,n=e._f;return e._locale=e._locale||getLocale(e._l),null===t||void 0===n&&""===t?createInvalid({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),isMoment(t)?new Moment(checkOverflow(t)):(isDate$1(t)?e._d=t:isArray$1(n)?configFromStringAndArray(e):n?configFromStringAndFormat(e):configFromInput(e),isValid(e)||(e._d=null),e))}function configFromInput(e){var t=e._i;isUndefined$1(t)?e._d=new Date(hooks.now()):isDate$1(t)?e._d=new Date(t.valueOf()):"string"==typeof t?configFromString(e):isArray$1(t)?(e._a=map(t.slice(0),(function(e){return parseInt(e,10)})),configFromArray(e)):isObject$1(t)?configFromObject(e):isNumber$1(t)?e._d=new Date(t):hooks.createFromInputFallback(e)}function createLocalOrUTC(e,t,n,r,o){var a={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(isObject$1(e)&&isObjectEmpty(e)||isArray$1(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=o,a._l=n,a._i=e,a._f=t,a._strict=r,createFromConfig(a)}function createLocal(e,t,n,r){return createLocalOrUTC(e,t,n,r,!1)}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),hooks.ISO_8601=function(){},hooks.RFC_2822=function(){};var prototypeMin=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:createInvalid()})),prototypeMax=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:createInvalid()}));function pickBy(e,t){var n,r;if(1===t.length&&isArray$1(t[0])&&(t=t[0]),!t.length)return createLocal();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}function min(){var e=[].slice.call(arguments,0);return pickBy("isBefore",e)}function max(){var e=[].slice.call(arguments,0);return pickBy("isAfter",e)}var now=function(){return Date.now?Date.now():+new Date},ordering=["year","quarter","month","week","day","hour","minute","second","millisecond"];function isDurationValid(e){var t,n,r=!1,o=ordering.length;for(t in e)if(hasOwnProp(e,t)&&(-1===indexOf.call(ordering,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<o;++n)if(e[ordering[n]]){if(r)return!1;parseFloat(e[ordering[n]])!==toInt(e[ordering[n]])&&(r=!0)}return!0}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(e){var t=normalizeObjectUnits(e),n=t.year||0,r=t.quarter||0,o=t.month||0,a=t.week||t.isoWeek||0,i=t.day||0,s=t.hour||0,l=t.minute||0,c=t.second||0,u=t.millisecond||0;this._isValid=isDurationValid(t),this._milliseconds=+u+1e3*c+6e4*l+1e3*s*60*60,this._days=+i+7*a,this._months=+o+3*r+12*n,this._data={},this._locale=getLocale(),this._bubble()}function isDuration(e){return e instanceof Duration}function absRound(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function compareArrays(e,t,n){var r,o=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),i=0;for(r=0;r<o;r++)(n&&e[r]!==t[r]||!n&&toInt(e[r])!==toInt(t[r]))&&i++;return i+a}function offset(e,t){addFormatToken(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+zeroFill(~~(e/60),2)+t+zeroFill(~~e%60,2)}))}offset("Z",":"),offset("ZZ",""),addRegexToken("Z",matchShortOffset),addRegexToken("ZZ",matchShortOffset),addParseToken(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=offsetFromString(matchShortOffset,e)}));var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(e,t){var n,r,o=(t||"").match(e);return null===o?null:0===(r=60*(n=((o[o.length-1]||[])+"").match(chunkOffset)||["-",0,0])[1]+toInt(n[2]))?0:"+"===n[0]?r:-r}function cloneWithOffset(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(isMoment(e)||isDate$1(e)?e.valueOf():createLocal(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),hooks.updateOffset(n,!1),n):createLocal(e).local()}function getDateOffset(e){return-Math.round(e._d.getTimezoneOffset())}function getSetOffset(e,t,n){var r,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=offsetFromString(matchShortOffset,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=getDateOffset(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),o!==e&&(!t||this._changeInProgress?addSubtract(this,createDuration(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,hooks.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:getDateOffset(this)}function getSetZone(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function setOffsetToUTC(e){return this.utcOffset(0,e)}function setOffsetToLocal(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(getDateOffset(this),"m")),this}function setOffsetToParsedOffset(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=offsetFromString(matchOffset,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function hasAlignedHourOffset(e){return!!this.isValid()&&(e=e?createLocal(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined$1(this._isDSTShifted))return this._isDSTShifted;var e,t={};return copyConfig(t,this),(t=prepareConfig(t))._a?(e=t._isUTC?createUTC(t._a):createLocal(t._a),this._isDSTShifted=this.isValid()&&compareArrays(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return!!this.isValid()&&!this._isUTC}function isUtcOffset(){return!!this.isValid()&&this._isUTC}function isUtc(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}hooks.updateOffset=function(){};var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(e,t){var n,r,o,a=e,i=null;return isDuration(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:isNumber$1(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(i=aspNetRegex.exec(e))?(n="-"===i[1]?-1:1,a={y:0,d:toInt(i[DATE])*n,h:toInt(i[HOUR])*n,m:toInt(i[MINUTE])*n,s:toInt(i[SECOND])*n,ms:toInt(absRound(1e3*i[MILLISECOND]))*n}):(i=isoRegex.exec(e))?(n="-"===i[1]?-1:1,a={y:parseIso(i[2],n),M:parseIso(i[3],n),w:parseIso(i[4],n),d:parseIso(i[5],n),h:parseIso(i[6],n),m:parseIso(i[7],n),s:parseIso(i[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(o=momentsDifference(createLocal(a.from),createLocal(a.to)),(a={}).ms=o.milliseconds,a.M=o.months),r=new Duration(a),isDuration(e)&&hasOwnProp(e,"_locale")&&(r._locale=e._locale),isDuration(e)&&hasOwnProp(e,"_isValid")&&(r._isValid=e._isValid),r}function parseIso(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function positiveMomentsDifference(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function momentsDifference(e,t){var n;return e.isValid()&&t.isValid()?(t=cloneWithOffset(t,e),e.isBefore(t)?n=positiveMomentsDifference(e,t):((n=positiveMomentsDifference(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function createAdder(e,t){return function(n,r){var o;return null===r||isNaN(+r)||(deprecateSimple(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),addSubtract(this,createDuration(n,r),e),this}}function addSubtract(e,t,n,r){var o=t._milliseconds,a=absRound(t._days),i=absRound(t._months);e.isValid()&&(r=null==r||r,i&&setMonth(e,get(e,"Month")+i*n),a&&set$1(e,"Date",get(e,"Date")+a*n),o&&e._d.setTime(e._d.valueOf()+o*n),r&&hooks.updateOffset(e,a||i))}createDuration.fn=Duration.prototype,createDuration.invalid=createInvalid$1;var add=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString$1(e){return"string"==typeof e||e instanceof String}function isMomentInput(e){return isMoment(e)||isDate$1(e)||isString$1(e)||isNumber$1(e)||isNumberOrStringArray(e)||isMomentInputObject(e)||null==e}function isMomentInputObject(e){var t,n=isObject$1(e)&&!isObjectEmpty(e),r=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a=o.length;for(t=0;t<a;t+=1)r=r||hasOwnProp(e,o[t]);return n&&r}function isNumberOrStringArray(e){var t=isArray$1(e),n=!1;return t&&(n=0===e.filter((function(t){return!isNumber$1(t)&&isString$1(e)})).length),t&&n}function isCalendarSpec(e){var t,n=isObject$1(e)&&!isObjectEmpty(e),r=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<o.length;t+=1)r=r||hasOwnProp(e,o[t]);return n&&r}function getCalendarFormat(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function calendar$1(e,t){1===arguments.length&&(arguments[0]?isMomentInput(arguments[0])?(e=arguments[0],t=void 0):isCalendarSpec(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||createLocal(),r=cloneWithOffset(n,this).startOf("day"),o=hooks.calendarFormat(this,r)||"sameElse",a=t&&(isFunction$1(t[o])?t[o].call(this,n):t[o]);return this.format(a||this.localeData().calendar(o,this,createLocal(n)))}function clone(){return new Moment(this)}function isAfter(e,t){var n=isMoment(e)?e:createLocal(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=normalizeUnits(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function isBefore(e,t){var n=isMoment(e)?e:createLocal(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=normalizeUnits(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function isBetween(e,t,n,r){var o=isMoment(e)?e:createLocal(e),a=isMoment(t)?t:createLocal(t);return!!(this.isValid()&&o.isValid()&&a.isValid())&&(("("===(r=r||"()")[0]?this.isAfter(o,n):!this.isBefore(o,n))&&(")"===r[1]?this.isBefore(a,n):!this.isAfter(a,n)))}function isSame(e,t){var n,r=isMoment(e)?e:createLocal(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=normalizeUnits(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function isSameOrAfter(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function isSameOrBefore(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function diff(e,t,n){var r,o,a;if(!this.isValid())return NaN;if(!(r=cloneWithOffset(e,this)).isValid())return NaN;switch(o=6e4*(r.utcOffset()-this.utcOffset()),t=normalizeUnits(t)){case"year":a=monthDiff(this,r)/12;break;case"month":a=monthDiff(this,r);break;case"quarter":a=monthDiff(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-o)/864e5;break;case"week":a=(this-r-o)/6048e5;break;default:a=this-r}return n?a:absFloor(a)}function monthDiff(e,t){if(e.date()<t.date())return-monthDiff(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function toString$1(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function toISOString(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?formatMoment(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction$1(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",formatMoment(n,"Z")):formatMoment(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r="moment",o="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY","-MM-DD[T]HH:mm:ss.SSS",n=o+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)}function format(e){e||(e=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var t=formatMoment(this,e);return this.localeData().postformat(t)}function from(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function fromNow(e){return this.from(createLocal(),e)}function to(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function toNow(e){return this.to(createLocal(),e)}function locale(e){var t;return void 0===e?this._locale._abbr:(null!=(t=getLocale(e))&&(this._locale=t),this)}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=3506328*MS_PER_HOUR;function mod$1(e,t){return(e%t+t)%t}function localStartOfDate(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-MS_PER_400_YEARS:new Date(e,t,n).valueOf()}function utcStartOfDate(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-MS_PER_400_YEARS:Date.UTC(e,t,n)}function startOf(e){var t,n;if(void 0===(e=normalizeUnits(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=mod$1(t+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":t=this._d.valueOf(),t-=mod$1(t,MS_PER_MINUTE);break;case"second":t=this._d.valueOf(),t-=mod$1(t,MS_PER_SECOND)}return this._d.setTime(t),hooks.updateOffset(this,!0),this}function endOf(e){var t,n;if(void 0===(e=normalizeUnits(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?utcStartOfDate:localStartOfDate,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=MS_PER_HOUR-mod$1(t+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":t=this._d.valueOf(),t+=MS_PER_MINUTE-mod$1(t,MS_PER_MINUTE)-1;break;case"second":t=this._d.valueOf(),t+=MS_PER_SECOND-mod$1(t,MS_PER_SECOND)-1}return this._d.setTime(t),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-6e4*(this._offset||0)}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function toObject(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend$1({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function localeEras(e,t){var n,r,o,a=this._eras||getLocale("en")._eras;for(n=0,r=a.length;n<r;++n){if("string"==typeof a[n].since)o=hooks(a[n].since).startOf("day"),a[n].since=o.valueOf();switch(typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":o=hooks(a[n].until).startOf("day").valueOf(),a[n].until=o.valueOf()}}return a}function localeErasParse(e,t,n){var r,o,a,i,s,l=this.eras();for(e=e.toUpperCase(),r=0,o=l.length;r<o;++r)if(a=l[r].name.toUpperCase(),i=l[r].abbr.toUpperCase(),s=l[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(i===e)return l[r];break;case"NNNN":if(a===e)return l[r];break;case"NNNNN":if(s===e)return l[r]}else if([a,i,s].indexOf(e)>=0)return l[r]}function localeErasConvertYear(e,t){var n=e.since<=e.until?1:-1;return void 0===t?hooks(e.since).year():hooks(e.since).year()+(t-e.offset)*n}function getEraName(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].name;if(r[e].until<=n&&n<=r[e].since)return r[e].name}return""}function getEraNarrow(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].narrow;if(r[e].until<=n&&n<=r[e].since)return r[e].narrow}return""}function getEraAbbr(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].abbr;if(r[e].until<=n&&n<=r[e].since)return r[e].abbr}return""}function getEraYear(){var e,t,n,r,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e)if(n=o[e].since<=o[e].until?1:-1,r=this.clone().startOf("day").valueOf(),o[e].since<=r&&r<=o[e].until||o[e].until<=r&&r<=o[e].since)return(this.year()-hooks(o[e].since).year())*n+o[e].offset;return this.year()}function erasNameRegex(e){return hasOwnProp(this,"_erasNameRegex")||computeErasParse.call(this),e?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(e){return hasOwnProp(this,"_erasAbbrRegex")||computeErasParse.call(this),e?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(e){return hasOwnProp(this,"_erasNarrowRegex")||computeErasParse.call(this),e?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(e,t){return t.erasAbbrRegex(e)}function matchEraName(e,t){return t.erasNameRegex(e)}function matchEraNarrow(e,t){return t.erasNarrowRegex(e)}function matchEraYearOrdinal(e,t){return t._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var e,t,n=[],r=[],o=[],a=[],i=this.eras();for(e=0,t=i.length;e<t;++e)r.push(regexEscape(i[e].name)),n.push(regexEscape(i[e].abbr)),o.push(regexEscape(i[e].narrow)),a.push(regexEscape(i[e].name)),a.push(regexEscape(i[e].abbr)),a.push(regexEscape(i[e].narrow));this._erasRegex=new RegExp("^("+a.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+r.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+o.join("|")+")","i")}function addWeekYearFormatToken(e,t){addFormatToken(0,[e,e.length],0,t)}function getSetWeekYear(e){return getSetWeekYearHelper.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(e){return getSetWeekYearHelper.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)}function getISOWeeksInISOWeekYear(){return weeksInYear(this.isoWeekYear(),1,4)}function getWeeksInYear(){var e=this.localeData()._week;return weeksInYear(this.year(),e.dow,e.doy)}function getWeeksInWeekYear(){var e=this.localeData()._week;return weeksInYear(this.weekYear(),e.dow,e.doy)}function getSetWeekYearHelper(e,t,n,r,o){var a;return null==e?weekOfYear(this,r,o).year:(t>(a=weeksInYear(e,r,o))&&(t=a),setWeekAll.call(this,e,t,n,r,o))}function setWeekAll(e,t,n,r,o){var a=dayOfYearFromWeeks(e,t,n,r,o),i=createUTCDate(a.year,0,a.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}function getSetQuarter(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}addFormatToken("N",0,0,"eraAbbr"),addFormatToken("NN",0,0,"eraAbbr"),addFormatToken("NNN",0,0,"eraAbbr"),addFormatToken("NNNN",0,0,"eraName"),addFormatToken("NNNNN",0,0,"eraNarrow"),addFormatToken("y",["y",1],"yo","eraYear"),addFormatToken("y",["yy",2],0,"eraYear"),addFormatToken("y",["yyy",3],0,"eraYear"),addFormatToken("y",["yyyy",4],0,"eraYear"),addRegexToken("N",matchEraAbbr),addRegexToken("NN",matchEraAbbr),addRegexToken("NNN",matchEraAbbr),addRegexToken("NNNN",matchEraName),addRegexToken("NNNNN",matchEraNarrow),addParseToken(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var o=n._locale.erasParse(e,r,n._strict);o?getParsingFlags(n).era=o:getParsingFlags(n).invalidEra=e})),addRegexToken("y",matchUnsigned),addRegexToken("yy",matchUnsigned),addRegexToken("yyy",matchUnsigned),addRegexToken("yyyy",matchUnsigned),addRegexToken("yo",matchEraYearOrdinal),addParseToken(["y","yy","yyy","yyyy"],YEAR),addParseToken(["yo"],(function(e,t,n,r){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[YEAR]=n._locale.eraYearOrdinalParse(e,o):t[YEAR]=parseInt(e,10)})),addFormatToken(0,["gg",2],0,(function(){return this.weekYear()%100})),addFormatToken(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),addWeekYearFormatToken("gggg","weekYear"),addWeekYearFormatToken("ggggg","weekYear"),addWeekYearFormatToken("GGGG","isoWeekYear"),addWeekYearFormatToken("GGGGG","isoWeekYear"),addUnitAlias("weekYear","gg"),addUnitAlias("isoWeekYear","GG"),addUnitPriority("weekYear",1),addUnitPriority("isoWeekYear",1),addRegexToken("G",matchSigned),addRegexToken("g",matchSigned),addRegexToken("GG",match1to2,match2),addRegexToken("gg",match1to2,match2),addRegexToken("GGGG",match1to4,match4),addRegexToken("gggg",match1to4,match4),addRegexToken("GGGGG",match1to6,match6),addRegexToken("ggggg",match1to6,match6),addWeekParseToken(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=toInt(e)})),addWeekParseToken(["gg","GG"],(function(e,t,n,r){t[r]=hooks.parseTwoDigitYear(e)})),addFormatToken("Q",0,"Qo","quarter"),addUnitAlias("quarter","Q"),addUnitPriority("quarter",7),addRegexToken("Q",match1),addParseToken("Q",(function(e,t){t[MONTH]=3*(toInt(e)-1)})),addFormatToken("D",["DD",2],"Do","date"),addUnitAlias("date","D"),addUnitPriority("date",9),addRegexToken("D",match1to2),addRegexToken("DD",match1to2,match2),addRegexToken("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),addParseToken(["D","DD"],DATE),addParseToken("Do",(function(e,t){t[DATE]=toInt(e.match(match1to2)[0])}));var getSetDayOfMonth=makeGetSet("Date",!0);function getSetDayOfYear(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear"),addUnitAlias("dayOfYear","DDD"),addUnitPriority("dayOfYear",4),addRegexToken("DDD",match1to3),addRegexToken("DDDD",match3),addParseToken(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=toInt(e)})),addFormatToken("m",["mm",2],0,"minute"),addUnitAlias("minute","m"),addUnitPriority("minute",14),addRegexToken("m",match1to2),addRegexToken("mm",match1to2,match2),addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second"),addUnitAlias("second","s"),addUnitPriority("second",15),addRegexToken("s",match1to2),addRegexToken("ss",match1to2,match2),addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",!1),token,getSetMillisecond;for(addFormatToken("S",0,0,(function(){return~~(this.millisecond()/100)})),addFormatToken(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),addFormatToken(0,["SSS",3],0,"millisecond"),addFormatToken(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),addFormatToken(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),addFormatToken(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),addFormatToken(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),addFormatToken(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),addFormatToken(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),addUnitAlias("millisecond","ms"),addUnitPriority("millisecond",16),addRegexToken("S",match1to3,match1),addRegexToken("SS",match1to3,match2),addRegexToken("SSS",match1to3,match3),token="SSSS";token.length<=9;token+="S")addRegexToken(token,matchUnsigned);function parseMs(e,t){t[MILLISECOND]=toInt(1e3*("0."+e))}for(token="S";token.length<=9;token+="S")addParseToken(token,parseMs);function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}getSetMillisecond=makeGetSet("Milliseconds",!1),addFormatToken("z",0,0,"zoneAbbr"),addFormatToken("zz",0,0,"zoneName");var proto=Moment.prototype;function createUnix(e){return createLocal(1e3*e)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(e){return e}proto.add=add,proto.calendar=calendar$1,proto.clone=clone,proto.diff=diff,proto.endOf=endOf,proto.format=format,proto.from=from,proto.fromNow=fromNow,proto.to=to,proto.toNow=toNow,proto.get=stringGet,proto.invalidAt=invalidAt,proto.isAfter=isAfter,proto.isBefore=isBefore,proto.isBetween=isBetween,proto.isSame=isSame,proto.isSameOrAfter=isSameOrAfter,proto.isSameOrBefore=isSameOrBefore,proto.isValid=isValid$2,proto.lang=lang,proto.locale=locale,proto.localeData=localeData,proto.max=prototypeMax,proto.min=prototypeMin,proto.parsingFlags=parsingFlags,proto.set=stringSet,proto.startOf=startOf,proto.subtract=subtract,proto.toArray=toArray,proto.toObject=toObject,proto.toDate=toDate,proto.toISOString=toISOString,proto.inspect=inspect,"undefined"!=typeof Symbol&&null!=Symbol.for&&(proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),proto.toJSON=toJSON,proto.toString=toString$1,proto.unix=unix,proto.valueOf=valueOf,proto.creationData=creationData,proto.eraName=getEraName,proto.eraNarrow=getEraNarrow,proto.eraAbbr=getEraAbbr,proto.eraYear=getEraYear,proto.year=getSetYear,proto.isLeapYear=getIsLeapYear,proto.weekYear=getSetWeekYear,proto.isoWeekYear=getSetISOWeekYear,proto.quarter=proto.quarters=getSetQuarter,proto.month=getSetMonth,proto.daysInMonth=getDaysInMonth,proto.week=proto.weeks=getSetWeek,proto.isoWeek=proto.isoWeeks=getSetISOWeek,proto.weeksInYear=getWeeksInYear,proto.weeksInWeekYear=getWeeksInWeekYear,proto.isoWeeksInYear=getISOWeeksInYear,proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear,proto.date=getSetDayOfMonth,proto.day=proto.days=getSetDayOfWeek,proto.weekday=getSetLocaleDayOfWeek,proto.isoWeekday=getSetISODayOfWeek,proto.dayOfYear=getSetDayOfYear,proto.hour=proto.hours=getSetHour,proto.minute=proto.minutes=getSetMinute,proto.second=proto.seconds=getSetSecond,proto.millisecond=proto.milliseconds=getSetMillisecond,proto.utcOffset=getSetOffset,proto.utc=setOffsetToUTC,proto.local=setOffsetToLocal,proto.parseZone=setOffsetToParsedOffset,proto.hasAlignedHourOffset=hasAlignedHourOffset,proto.isDST=isDaylightSavingTime,proto.isLocal=isLocal,proto.isUtcOffset=isUtcOffset,proto.isUtc=isUtc,proto.isUTC=isUtc,proto.zoneAbbr=getZoneAbbr,proto.zoneName=getZoneName,proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth),proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth),proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear),proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone),proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);var proto$1=Locale.prototype;function get$1(e,t,n,r){var o=getLocale(),a=createUTC().set(r,t);return o[n](a,e)}function listMonthsImpl(e,t,n){if(isNumber$1(e)&&(t=e,e=void 0),e=e||"",null!=t)return get$1(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=get$1(e,r,n,"month");return o}function listWeekdaysImpl(e,t,n,r){"boolean"==typeof e?(isNumber$1(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,isNumber$1(t)&&(n=t,t=void 0),t=t||"");var o,a=getLocale(),i=e?a._week.dow:0,s=[];if(null!=n)return get$1(t,(n+i)%7,r,"day");for(o=0;o<7;o++)s[o]=get$1(t,(o+i)%7,r,"day");return s}function listMonths(e,t){return listMonthsImpl(e,t,"months")}function listMonthsShort(e,t){return listMonthsImpl(e,t,"monthsShort")}function listWeekdays(e,t,n){return listWeekdaysImpl(e,t,n,"weekdays")}function listWeekdaysShort(e,t,n){return listWeekdaysImpl(e,t,n,"weekdaysShort")}function listWeekdaysMin(e,t,n){return listWeekdaysImpl(e,t,n,"weekdaysMin")}proto$1.calendar=calendar,proto$1.longDateFormat=longDateFormat,proto$1.invalidDate=invalidDate,proto$1.ordinal=ordinal,proto$1.preparse=preParsePostFormat,proto$1.postformat=preParsePostFormat,proto$1.relativeTime=relativeTime,proto$1.pastFuture=pastFuture,proto$1.set=set,proto$1.eras=localeEras,proto$1.erasParse=localeErasParse,proto$1.erasConvertYear=localeErasConvertYear,proto$1.erasAbbrRegex=erasAbbrRegex,proto$1.erasNameRegex=erasNameRegex,proto$1.erasNarrowRegex=erasNarrowRegex,proto$1.months=localeMonths,proto$1.monthsShort=localeMonthsShort,proto$1.monthsParse=localeMonthsParse,proto$1.monthsRegex=monthsRegex,proto$1.monthsShortRegex=monthsShortRegex,proto$1.week=localeWeek,proto$1.firstDayOfYear=localeFirstDayOfYear,proto$1.firstDayOfWeek=localeFirstDayOfWeek,proto$1.weekdays=localeWeekdays,proto$1.weekdaysMin=localeWeekdaysMin,proto$1.weekdaysShort=localeWeekdaysShort,proto$1.weekdaysParse=localeWeekdaysParse,proto$1.weekdaysRegex=weekdaysRegex,proto$1.weekdaysShortRegex=weekdaysShortRegex,proto$1.weekdaysMinRegex=weekdaysMinRegex,proto$1.isPM=localeIsPM,proto$1.meridiem=localeMeridiem,getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===toInt(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale),hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var e=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),e.milliseconds=mathAbs(e.milliseconds),e.seconds=mathAbs(e.seconds),e.minutes=mathAbs(e.minutes),e.hours=mathAbs(e.hours),e.months=mathAbs(e.months),e.years=mathAbs(e.years),this}function addSubtract$1(e,t,n,r){var o=createDuration(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function add$1(e,t){return addSubtract$1(this,e,t,1)}function subtract$1(e,t){return addSubtract$1(this,e,t,-1)}function absCeil(e){return e<0?Math.floor(e):Math.ceil(e)}function bubble(){var e,t,n,r,o,a=this._milliseconds,i=this._days,s=this._months,l=this._data;return a>=0&&i>=0&&s>=0||a<=0&&i<=0&&s<=0||(a+=864e5*absCeil(monthsToDays(s)+i),i=0,s=0),l.milliseconds=a%1e3,e=absFloor(a/1e3),l.seconds=e%60,t=absFloor(e/60),l.minutes=t%60,n=absFloor(t/60),l.hours=n%24,i+=absFloor(n/24),s+=o=absFloor(daysToMonths(i)),i-=absCeil(monthsToDays(o)),r=absFloor(s/12),s%=12,l.days=i,l.months=s,l.years=r,this}function daysToMonths(e){return 4800*e/146097}function monthsToDays(e){return 146097*e/4800}function as(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=normalizeUnits(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+daysToMonths(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(monthsToDays(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function valueOf$1(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*toInt(this._months/12):NaN}function makeAs(e){return function(){return this.as(e)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y");function clone$1(){return createDuration(this)}function get$2(e){return e=normalizeUnits(e),this.isValid()?this[e+"s"]():NaN}function makeGetter(e){return function(){return this.isValid()?this._data[e]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function relativeTime$1(e,t,n,r){var o=createDuration(e).abs(),a=round(o.as("s")),i=round(o.as("m")),s=round(o.as("h")),l=round(o.as("d")),c=round(o.as("M")),u=round(o.as("w")),d=round(o.as("y")),f=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||i<=1&&["m"]||i<n.m&&["mm",i]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(f=f||u<=1&&["w"]||u<n.w&&["ww",u]),(f=f||c<=1&&["M"]||c<n.M&&["MM",c]||d<=1&&["y"]||["yy",d])[2]=t,f[3]=+e>0,f[4]=r,substituteTimeAgo.apply(null,f)}function getSetRelativeTimeRounding(e){return void 0===e?round:"function"==typeof e&&(round=e,!0)}function getSetRelativeTimeThreshold(e,t){return void 0!==thresholds[e]&&(void 0===t?thresholds[e]:(thresholds[e]=t,"s"===e&&(thresholds.ss=t-1),!0))}function humanize(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,o=!1,a=thresholds;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(o=e),"object"==typeof t&&(a=Object.assign({},thresholds,t),null!=t.s&&null==t.ss&&(a.ss=t.s-1)),r=relativeTime$1(this,!o,a,n=this.localeData()),o&&(r=n.pastFuture(+this,r)),n.postformat(r)}var abs$1=Math.abs;function sign(e){return(e>0)-(e<0)||+e}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,o,a,i,s,l=abs$1(this._milliseconds)/1e3,c=abs$1(this._days),u=abs$1(this._months),d=this.asSeconds();return d?(e=absFloor(l/60),t=absFloor(e/60),l%=60,e%=60,n=absFloor(u/12),u%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",o=d<0?"-":"",a=sign(this._months)!==sign(d)?"-":"",i=sign(this._days)!==sign(d)?"-":"",s=sign(this._milliseconds)!==sign(d)?"-":"",o+"P"+(n?a+n+"Y":"")+(u?a+u+"M":"")+(c?i+c+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1,proto$2.abs=abs,proto$2.add=add$1,proto$2.subtract=subtract$1,proto$2.as=as,proto$2.asMilliseconds=asMilliseconds,proto$2.asSeconds=asSeconds,proto$2.asMinutes=asMinutes,proto$2.asHours=asHours,proto$2.asDays=asDays,proto$2.asWeeks=asWeeks,proto$2.asMonths=asMonths,proto$2.asQuarters=asQuarters,proto$2.asYears=asYears,proto$2.valueOf=valueOf$1,proto$2._bubble=bubble,proto$2.clone=clone$1,proto$2.get=get$2,proto$2.milliseconds=milliseconds,proto$2.seconds=seconds,proto$2.minutes=minutes,proto$2.hours=hours,proto$2.days=days,proto$2.weeks=weeks,proto$2.months=months,proto$2.years=years,proto$2.humanize=humanize,proto$2.toISOString=toISOString$1,proto$2.toString=toISOString$1,proto$2.toJSON=toISOString$1,proto$2.locale=locale,proto$2.localeData=localeData,proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1),proto$2.lang=lang,addFormatToken("X",0,0,"unix"),addFormatToken("x",0,0,"valueOf"),addRegexToken("x",matchSigned),addRegexToken("X",matchTimestamp),addParseToken("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),addParseToken("x",(function(e,t,n){n._d=new Date(toInt(e))})),//! moment.js
hooks.version="2.29.3",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min,hooks.max=max,hooks.now=now,hooks.utc=createUTC,hooks.unix=createUnix,hooks.months=listMonths,hooks.isDate=isDate$1,hooks.locale=getSetGlobalLocale,hooks.invalid=createInvalid,hooks.duration=createDuration,hooks.isMoment=isMoment,hooks.weekdays=listWeekdays,hooks.parseZone=createInZone,hooks.localeData=getLocale,hooks.isDuration=isDuration,hooks.monthsShort=listMonthsShort,hooks.weekdaysMin=listWeekdaysMin,hooks.defineLocale=defineLocale,hooks.updateLocale=updateLocale,hooks.locales=listLocales,hooks.weekdaysShort=listWeekdaysShort,hooks.normalizeUnits=normalizeUnits,hooks.relativeTimeRounding=getSetRelativeTimeRounding,hooks.relativeTimeThreshold=getSetRelativeTimeThreshold,hooks.calendarFormat=getCalendarFormat,hooks.prototype=proto,hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const toLine=(e="")=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),filterXSS=e=>e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"),getUrlParam=(e,t)=>{const n=t||location.href,r=new RegExp(`[?&#]${e}=([^&#]+)`,"gi"),o=n.match(r);let a;return o&&o.length>0?(a=o[o.length-1].split("="),a&&a.length>1?filterXSS(a[1]):""):""},_sfc_main$8=Vue.defineComponent({name:"magic-ui-component",props:{config:{type:Object,default:()=>({})}},setup(e){var t;const n=null===(t=Vue.getCurrentInstance())||void 0===t?void 0:t.proxy,r=Vue.inject("app");return Vue.provide("hoc",n),{tagName:Vue.computed((()=>`magic-ui-${toLine(e.config.type)}`)),style:Vue.computed((()=>null==r?void 0:r.transformStyle(e.config.style))),display:()=>{var t;const n=null===(t=e.config)||void 0===t?void 0:t.display;return"function"==typeof n?n(r):!1!==n}}}}),_export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n};function _sfc_render$7(e,t,n,r,o,a){return e.display()?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.tagName),{key:0,id:e.config.id,class:Vue.normalizeClass("magic-ui-component"+(e.config.className?` ${e.config.className}`:"")),style:Vue.normalizeStyle(e.style),config:e.config},null,8,["id","class","style","config"])):Vue.createCommentVNode("v-if",!0)}const Component=_export_sfc(_sfc_main$8,[["render",_sfc_render$7],["__file","/data/magic/tmagic-editor/packages/ui/src/Component.vue"]]),useApp=e=>{var t,n;const r=Vue.inject("app"),o=null==r||null===(t=r.page)||void 0===t?void 0:t.getNode(e.config.id),a=null===(n=Vue.getCurrentInstance())||void 0===n?void 0:n.proxy;return null==o||o.emit("created",a),Vue.onMounted((()=>{null==o||o.emit("mounted",a)})),Vue.onUnmounted((()=>{null==o||o.emit("destroy",a)})),r},_sfc_main$7=Vue.defineComponent({name:"magic-ui-page",components:{"magic-ui-component":Component},props:{config:{type:Object,default:()=>({})}},setup(e){const t=useApp(e);return{style:Vue.computed((()=>null==t?void 0:t.transformStyle(e.config.style||{}))),refresh(){window.location.reload()}}}}),_hoisted_1$3=["id"];function _sfc_render$6(e,t,n,r,o,a){const i=Vue.resolveComponent("magic-ui-component");return Vue.openBlock(),Vue.createElementBlock("div",{id:`${e.config.id||""}`,class:Vue.normalizeClass("magic-ui-page magic-ui-container"+(e.config.className?` ${e.config.className}`:"")),style:Vue.normalizeStyle(e.style)},[Vue.renderSlot(e.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.config.items,(e=>(Vue.openBlock(),Vue.createBlock(i,{key:e.id,config:e},null,8,["config"])))),128))],14,_hoisted_1$3)}const page=_export_sfc(_sfc_main$7,[["render",_sfc_render$6],["__file","/data/magic/tmagic-editor/packages/ui/src/page/src/index.vue"]]),useCommonMethod=e=>({show:()=>{e.config.style.display="initial"},hide:()=>{e.config.style.display="none"}}),_sfc_main$6=Vue.defineComponent({name:"magic-ui-container",components:{"magic-ui-component":Component},props:{config:{type:Object,default:()=>({})}},setup(e){const t=useApp(e);return{style:Vue.computed((()=>null==t?void 0:t.transformStyle(e.config.style||{}))),display:()=>{var n;const r=null===(n=e.config)||void 0===n?void 0:n.display;return"function"==typeof r?r(t):!1!==r},...useCommonMethod(e)}}}),_hoisted_1$2=["id"];function _sfc_render$5(e,t,n,r,o,a){const i=Vue.resolveComponent("magic-ui-component");return e.display()?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,id:`${e.config.id||""}`,class:Vue.normalizeClass("magic-ui-container"+(e.config.className?` ${e.config.className}`:"")),style:Vue.normalizeStyle(e.style)},[Vue.renderSlot(e.$slots,"default"),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.config.items,(e=>(Vue.openBlock(),Vue.createBlock(i,{key:e.id,config:e},null,8,["config"])))),128))],14,_hoisted_1$2)):Vue.createCommentVNode("v-if",!0)}const container=_export_sfc(_sfc_main$6,[["render",_sfc_render$5],["__file","/data/magic/tmagic-editor/packages/ui/src/container/src/Container.vue"]]),_sfc_main$5=Vue.defineComponent({name:"magic-ui-button",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){var t;useApp(e);const n=null===(t=Vue.getCurrentInstance())||void 0===t?void 0:t.proxy,r=Vue.reactive([]),o=Vue.computed((()=>["function"==typeof e.config.preAction?e.config.preAction:()=>!0,...r,"function"==typeof e.config.postAction?e.config.postAction:()=>!0]));return{pushAction:function(e){r.push(e)},clickHandler:async function(){for(const t of o.value)if("function"==typeof t){if(!1===await t(n,{model:e.model}))break}},textConfig:Vue.computed((()=>{var t,n,r;return{type:"text",text:(null===(t=e.config)||void 0===t?void 0:t.text)||"",disabledText:(null===(n=e.config)||void 0===n?void 0:n.disabledText)||"",html:(null===(r=e.config)||void 0===r?void 0:r.html)||""}}))}}});function _sfc_render$4(e,t,n,r,o,a){const i=Vue.resolveComponent("magic-ui-text");return Vue.openBlock(),Vue.createElementBlock("button",{class:"magic-ui-button",onClick:t[0]||(t[0]=(...t)=>e.clickHandler&&e.clickHandler(...t))},[Vue.renderSlot(e.$slots,"default",{},(()=>[Vue.createVNode(i,{config:e.textConfig},null,8,["config"])]))])}const button=_export_sfc(_sfc_main$5,[["render",_sfc_render$4],["__file","/data/magic/tmagic-editor/packages/ui/src/button/src/index.vue"]]),_sfc_main$4=Vue.defineComponent({name:"magic-ui-text",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})},vars:{type:Object,default:()=>({})}},setup(e){var t;useApp(e);const n=null===(t=Vue.getCurrentInstance())||void 0===t?void 0:t.proxy,r=Vue.inject("hoc"),o=Vue.computed((()=>{var t,o;let a=(null===(t=e.config)||void 0===t?void 0:t.text)||"";const{vars:i}=e;if(null!=r&&r.disabled&&null!==(o=e.config)&&void 0!==o&&o.disabledText&&(a=e.config.disabledText),"function"==typeof a)return a.bind(n)(n,{model:e.model});if("[object Object]"===Object.prototype.toString.call(i)){let e=a;return Object.entries(i).forEach((([t,n])=>{e=e.replace(new RegExp(`{{${t}}}`,"g"),n)})),e}return a||""}));return{displayText:o}},render(){var e,t;const n=null!==(e=this.config)&&void 0!==e&&e.multiple?"magic-ui-text":"magic-ui-text magic-ui-text--single-line";var r,o;return"function"==typeof(null===(t=this.$slots)||void 0===t?void 0:t.default)?Vue.h("span",{class:n},[(null===(r=this.$slots)||void 0===r||null===(o=r.default)||void 0===o?void 0:o.call(r))||""]):Vue.h("span",{class:n,...this.displayText?{innerHTML:this.displayText}:{}})}}),text=_export_sfc(_sfc_main$4,[["__file","/data/magic/tmagic-editor/packages/ui/src/text/src/index.vue"]]),_sfc_main$3=Vue.defineComponent({name:"magic-ui-img",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup:e=>(useApp(e),{clickHandler(){e.config.url&&(window.location.href=e.config.url)}})}),_hoisted_1$1=["src"];function _sfc_render$3(e,t,n,r,o,a){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-img",src:e.config.src,onClick:t[0]||(t[0]=(...t)=>e.clickHandler&&e.clickHandler(...t))},null,8,_hoisted_1$1)}const img=_export_sfc(_sfc_main$3,[["render",_sfc_render$3],["__file","/data/magic/tmagic-editor/packages/ui/src/img/src/index.vue"]]);var browser={},canPromise$1=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},qrcode$1={},utils$a={};let toSJISFunction;const CODEWORDS_COUNT=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];utils$a.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},utils$a.getSymbolTotalCodewords=function(e){return CODEWORDS_COUNT[e]},utils$a.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},utils$a.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');toSJISFunction=e},utils$a.isKanjiModeEnabled=function(){return void 0!==toSJISFunction},utils$a.toSJIS=function(e){return toSJISFunction(e)};var errorCorrectionLevel={},exports;function BitBuffer$1(){this.buffer=[],this.length=0}exports=errorCorrectionLevel,exports.L={bit:1},exports.M={bit:0},exports.Q={bit:3},exports.H={bit:2},exports.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},exports.from=function(e,t){if(exports.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return exports.L;case"m":case"medium":return exports.M;case"q":case"quartile":return exports.Q;case"h":case"high":return exports.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(n){return t}},BitBuffer$1.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var bitBuffer=BitBuffer$1;function BitMatrix$1(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}BitMatrix$1.prototype.set=function(e,t,n,r){const o=e*this.size+t;this.data[o]=n,r&&(this.reservedBit[o]=!0)},BitMatrix$1.prototype.get=function(e,t){return this.data[e*this.size+t]},BitMatrix$1.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},BitMatrix$1.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var bitMatrix=BitMatrix$1,alignmentPattern={};!function(e){const t=utils$a.getSymbolSize;e.getRowColCoords=function(e){if(1===e)return[];const n=Math.floor(e/7)+2,r=t(e),o=145===r?26:2*Math.ceil((r-13)/(2*n-2)),a=[r-7];for(let t=1;t<n-1;t++)a[t]=a[t-1]-o;return a.push(6),a.reverse()},e.getPositions=function(t){const n=[],r=e.getRowColCoords(t),o=r.length;for(let e=0;e<o;e++)for(let t=0;t<o;t++)0===e&&0===t||0===e&&t===o-1||e===o-1&&0===t||n.push([r[e],r[t]]);return n}}(alignmentPattern);var finderPattern={};const getSymbolSize=utils$a.getSymbolSize,FINDER_PATTERN_SIZE=7;finderPattern.getPositions=function(e){const t=getSymbolSize(e);return[[0,0],[t-FINDER_PATTERN_SIZE,0],[0,t-FINDER_PATTERN_SIZE]]};var maskPattern={};!function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,r=40,o=10;function a(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){const n=e.size;let r=0,o=0,a=0,i=null,s=null;for(let l=0;l<n;l++){o=a=0,i=s=null;for(let c=0;c<n;c++){let n=e.get(l,c);n===i?o++:(o>=5&&(r+=t+(o-5)),i=n,o=1),n=e.get(c,l),n===s?a++:(a>=5&&(r+=t+(a-5)),s=n,a=1)}o>=5&&(r+=t+(o-5)),a>=5&&(r+=t+(a-5))}return r},e.getPenaltyN2=function(e){const t=e.size;let r=0;for(let n=0;n<t-1;n++)for(let o=0;o<t-1;o++){const t=e.get(n,o)+e.get(n,o+1)+e.get(n+1,o)+e.get(n+1,o+1);4!==t&&0!==t||r++}return r*n},e.getPenaltyN3=function(e){const t=e.size;let n=0,o=0,a=0;for(let r=0;r<t;r++){o=a=0;for(let i=0;i<t;i++)o=o<<1&2047|e.get(r,i),i>=10&&(1488===o||93===o)&&n++,a=a<<1&2047|e.get(i,r),i>=10&&(1488===a||93===a)&&n++}return n*r},e.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return Math.abs(Math.ceil(100*t/n/5)-10)*o},e.applyMask=function(e,t){const n=t.size;for(let r=0;r<n;r++)for(let o=0;o<n;o++)t.isReserved(o,r)||t.xor(o,r,a(e,o,r))},e.getBestMask=function(t,n){const r=Object.keys(e.Patterns).length;let o=0,a=1/0;for(let i=0;i<r;i++){n(i),e.applyMask(i,t);const r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(i,t),r<a&&(a=r,o=i)}return o}}(maskPattern);var errorCorrectionCode={};const ECLevel$1=errorCorrectionLevel,EC_BLOCKS_TABLE=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],EC_CODEWORDS_TABLE=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];errorCorrectionCode.getBlocksCount=function(e,t){switch(t){case ECLevel$1.L:return EC_BLOCKS_TABLE[4*(e-1)+0];case ECLevel$1.M:return EC_BLOCKS_TABLE[4*(e-1)+1];case ECLevel$1.Q:return EC_BLOCKS_TABLE[4*(e-1)+2];case ECLevel$1.H:return EC_BLOCKS_TABLE[4*(e-1)+3];default:return}},errorCorrectionCode.getTotalCodewordsCount=function(e,t){switch(t){case ECLevel$1.L:return EC_CODEWORDS_TABLE[4*(e-1)+0];case ECLevel$1.M:return EC_CODEWORDS_TABLE[4*(e-1)+1];case ECLevel$1.Q:return EC_CODEWORDS_TABLE[4*(e-1)+2];case ECLevel$1.H:return EC_CODEWORDS_TABLE[4*(e-1)+3];default:return}};var polynomial={},galoisField={};const EXP_TABLE=new Uint8Array(512),LOG_TABLE=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)EXP_TABLE[t]=e,LOG_TABLE[e]=t,e<<=1,256&e&&(e^=285);for(let t=255;t<512;t++)EXP_TABLE[t]=EXP_TABLE[t-255]}(),galoisField.log=function(e){if(e<1)throw new Error("log("+e+")");return LOG_TABLE[e]},galoisField.exp=function(e){return EXP_TABLE[e]},galoisField.mul=function(e,t){return 0===e||0===t?0:EXP_TABLE[LOG_TABLE[e]+LOG_TABLE[t]]},function(e){const t=galoisField;e.mul=function(e,n){const r=new Uint8Array(e.length+n.length-1);for(let o=0;o<e.length;o++)for(let a=0;a<n.length;a++)r[o+a]^=t.mul(e[o],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){const e=r[0];for(let a=0;a<n.length;a++)r[a]^=t.mul(n[a],e);let o=0;for(;o<r.length&&0===r[o];)o++;r=r.slice(o)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let o=0;o<n;o++)r=e.mul(r,new Uint8Array([1,t.exp(o)]));return r}}(polynomial);const Polynomial=polynomial;function ReedSolomonEncoder$1(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}ReedSolomonEncoder$1.prototype.initialize=function(e){this.degree=e,this.genPoly=Polynomial.generateECPolynomial(this.degree)},ReedSolomonEncoder$1.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=Polynomial.mod(t,this.genPoly),r=this.degree-n.length;if(r>0){const e=new Uint8Array(this.degree);return e.set(n,r),e}return n};var reedSolomonEncoder=ReedSolomonEncoder$1,version={},mode={},versionCheck={isValid:function(e){return!isNaN(e)&&e>=1&&e<=40}},regex={};const numeric="[0-9]+",alphanumeric="[A-Z $%*+\\-./:]+";let kanji="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kanji=kanji.replace(/u/g,"\\u");const byte="(?:(?![A-Z0-9 $%*+\\-./:]|"+kanji+")(?:.|[\r\n]))+";regex.KANJI=new RegExp(kanji,"g"),regex.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),regex.BYTE=new RegExp(byte,"g"),regex.NUMERIC=new RegExp(numeric,"g"),regex.ALPHANUMERIC=new RegExp(alphanumeric,"g");const TEST_KANJI=new RegExp("^"+kanji+"$"),TEST_NUMERIC=new RegExp("^"+numeric+"$"),TEST_ALPHANUMERIC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");regex.testKanji=function(e){return TEST_KANJI.test(e)},regex.testNumeric=function(e){return TEST_NUMERIC.test(e)},regex.testAlphanumeric=function(e){return TEST_ALPHANUMERIC.test(e)},function(e){const t=versionCheck,n=regex;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!t.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(r){return n}}}(mode),function(e){const t=utils$a,n=errorCorrectionCode,r=errorCorrectionLevel,o=mode,a=versionCheck,i=t.getBCHDigit(7973);function s(e,t){return o.getCharCountIndicator(e,t)+4}function l(e,t){let n=0;return e.forEach((function(e){const r=s(e.mode,t);n+=r+e.getBitsLength()})),n}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,i){if(!a.isValid(e))throw new Error("Invalid QR Code version");void 0===i&&(i=o.BYTE);const l=8*(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r));if(i===o.MIXED)return l;const c=l-s(i,e);switch(i){case o.NUMERIC:return Math.floor(c/10*3);case o.ALPHANUMERIC:return Math.floor(c/11*2);case o.KANJI:return Math.floor(c/13);case o.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(t,n){let a;const i=r.from(n,r.M);if(Array.isArray(t)){if(t.length>1)return function(t,n){for(let r=1;r<=40;r++)if(l(t,r)<=e.getCapacity(r,n,o.MIXED))return r}(t,i);if(0===t.length)return 1;a=t[0]}else a=t;return function(t,n,r){for(let o=1;o<=40;o++)if(n<=e.getCapacity(o,r,t))return o}(a.mode,a.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw new Error("Invalid QR Code version");let n=e<<12;for(;t.getBCHDigit(n)-i>=0;)n^=7973<<t.getBCHDigit(n)-i;return e<<12|n}}(version);var formatInfo={};const Utils$3=utils$a,G15=1335,G15_MASK=21522,G15_BCH=Utils$3.getBCHDigit(G15);formatInfo.getEncodedBits=function(e,t){const n=e.bit<<3|t;let r=n<<10;for(;Utils$3.getBCHDigit(r)-G15_BCH>=0;)r^=G15<<Utils$3.getBCHDigit(r)-G15_BCH;return(n<<10|r)^G15_MASK};var segments={};const Mode$4=mode;function NumericData(e){this.mode=Mode$4.NUMERIC,this.data=e.toString()}NumericData.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},NumericData.prototype.getLength=function(){return this.data.length},NumericData.prototype.getBitsLength=function(){return NumericData.getBitsLength(this.data.length)},NumericData.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);const o=this.data.length-t;o>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,3*o+1))};var numericData=NumericData;const Mode$3=mode,ALPHA_NUM_CHARS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(e){this.mode=Mode$3.ALPHANUMERIC,this.data=e}AlphanumericData.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},AlphanumericData.prototype.getLength=function(){return this.data.length},AlphanumericData.prototype.getBitsLength=function(){return AlphanumericData.getBitsLength(this.data.length)},AlphanumericData.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*ALPHA_NUM_CHARS.indexOf(this.data[t]);n+=ALPHA_NUM_CHARS.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(ALPHA_NUM_CHARS.indexOf(this.data[t]),6)};var alphanumericData=AlphanumericData,encodeUtf8$1=function(e){for(var t=[],n=e.length,r=0;r<n;r++){var o=e.charCodeAt(r);if(o>=55296&&o<=56319&&n>r+1){var a=e.charCodeAt(r+1);a>=56320&&a<=57343&&(o=1024*(o-55296)+a-56320+65536,r+=1)}o<128?t.push(o):o<2048?(t.push(o>>6|192),t.push(63&o|128)):o<55296||o>=57344&&o<65536?(t.push(o>>12|224),t.push(o>>6&63|128),t.push(63&o|128)):o>=65536&&o<=1114111?(t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(63&o|128)):t.push(239,191,189)}return new Uint8Array(t).buffer};const encodeUtf8=encodeUtf8$1,Mode$2=mode;function ByteData(e){this.mode=Mode$2.BYTE,this.data=new Uint8Array(encodeUtf8(e))}ByteData.getBitsLength=function(e){return 8*e},ByteData.prototype.getLength=function(){return this.data.length},ByteData.prototype.getBitsLength=function(){return ByteData.getBitsLength(this.data.length)},ByteData.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var byteData=ByteData;const Mode$1=mode,Utils$2=utils$a;function KanjiData(e){this.mode=Mode$1.KANJI,this.data=e}KanjiData.getBitsLength=function(e){return 13*e},KanjiData.prototype.getLength=function(){return this.data.length},KanjiData.prototype.getBitsLength=function(){return KanjiData.getBitsLength(this.data.length)},KanjiData.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Utils$2.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var kanjiData=KanjiData,dijkstra={exports:{}};!function(e){var t={single_source_shortest_paths:function(e,n,r){var o={},a={};a[n]=0;var i,s,l,c,u,d,f,h=t.PriorityQueue.make();for(h.push(n,0);!h.empty();)for(l in s=(i=h.pop()).value,c=i.cost,u=e[s]||{})u.hasOwnProperty(l)&&(d=c+u[l],f=a[l],(void 0===a[l]||f>d)&&(a[l]=d,h.push(l,d),o[l]=s));if(void 0!==r&&void 0===a[r]){var m=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(m)}return o},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,n,r){var o=t.single_source_shortest_paths(e,n,r);return t.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(e){var n,r=t.PriorityQueue,o={};for(n in e=e||{},r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=e.sorter||r.default_sorter,o},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}(dijkstra),function(e){const t=mode,n=numericData,r=alphanumericData,o=byteData,a=kanjiData,i=regex,s=utils$a,l=dijkstra.exports;function c(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){const r=[];let o;for(;null!==(o=e.exec(n));)r.push({data:o[0],index:o.index,mode:t,length:o[0].length});return r}function d(e){const n=u(i.NUMERIC,t.NUMERIC,e),r=u(i.ALPHANUMERIC,t.ALPHANUMERIC,e);let o,a;s.isKanjiModeEnabled()?(o=u(i.BYTE,t.BYTE,e),a=u(i.KANJI,t.KANJI,e)):(o=u(i.BYTE_KANJI,t.BYTE,e),a=[]);return n.concat(r,o,a).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function f(e,i){switch(i){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return o.getBitsLength(e)}}function h(e,i){let l;const c=t.getBestModeForData(e);if(l=t.from(i,c),l!==t.BYTE&&l.bit<c.bit)throw new Error('"'+e+'" cannot be encoded with mode '+t.toString(l)+".\n Suggested mode is: "+t.toString(c));switch(l!==t.KANJI||s.isKanjiModeEnabled()||(l=t.BYTE),l){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new o(e)}}e.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(h(t,null)):t.data&&e.push(h(t.data,t.mode)),e}),[])},e.fromString=function(n,r){const o=function(e){const n=[];for(let r=0;r<e.length;r++){const o=e[r];switch(o.mode){case t.NUMERIC:n.push([o,{data:o.data,mode:t.ALPHANUMERIC,length:o.length},{data:o.data,mode:t.BYTE,length:o.length}]);break;case t.ALPHANUMERIC:n.push([o,{data:o.data,mode:t.BYTE,length:o.length}]);break;case t.KANJI:n.push([o,{data:o.data,mode:t.BYTE,length:c(o.data)}]);break;case t.BYTE:n.push([{data:o.data,mode:t.BYTE,length:c(o.data)}])}}return n}(d(n,s.isKanjiModeEnabled())),a=function(e,n){const r={},o={start:{}};let a=["start"];for(let i=0;i<e.length;i++){const s=e[i],l=[];for(let e=0;e<s.length;e++){const c=s[e],u=""+i+e;l.push(u),r[u]={node:c,lastCount:0},o[u]={};for(let e=0;e<a.length;e++){const i=a[e];r[i]&&r[i].node.mode===c.mode?(o[i][u]=f(r[i].lastCount+c.length,c.mode)-f(r[i].lastCount,c.mode),r[i].lastCount+=c.length):(r[i]&&(r[i].lastCount=c.length),o[i][u]=f(c.length,c.mode)+4+t.getCharCountIndicator(c.mode,n))}}a=l}for(let t=0;t<a.length;t++)o[a[t]].end=0;return{map:o,table:r}}(o,r),i=l.find_path(a.map,"start","end"),u=[];for(let e=1;e<i.length-1;e++)u.push(a.table[i[e]].node);return e.fromArray(function(e){return e.reduce((function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(u))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}}(segments);const Utils$1=utils$a,ECLevel=errorCorrectionLevel,BitBuffer=bitBuffer,BitMatrix=bitMatrix,AlignmentPattern=alignmentPattern,FinderPattern=finderPattern,MaskPattern=maskPattern,ECCode=errorCorrectionCode,ReedSolomonEncoder=reedSolomonEncoder,Version=version,FormatInfo=formatInfo,Mode=mode,Segments=segments;function setupFinderPattern(e,t){const n=e.size,r=FinderPattern.getPositions(t);for(let o=0;o<r.length;o++){const t=r[o][0],a=r[o][1];for(let r=-1;r<=7;r++)if(!(t+r<=-1||n<=t+r))for(let o=-1;o<=7;o++)a+o<=-1||n<=a+o||(r>=0&&r<=6&&(0===o||6===o)||o>=0&&o<=6&&(0===r||6===r)||r>=2&&r<=4&&o>=2&&o<=4?e.set(t+r,a+o,!0,!0):e.set(t+r,a+o,!1,!0))}}function setupTimingPattern(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function setupAlignmentPattern(e,t){const n=AlignmentPattern.getPositions(t);for(let r=0;r<n.length;r++){const t=n[r][0],o=n[r][1];for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)-2===n||2===n||-2===r||2===r||0===n&&0===r?e.set(t+n,o+r,!0,!0):e.set(t+n,o+r,!1,!0)}}function setupVersionInfo(e,t){const n=e.size,r=Version.getEncodedBits(t);let o,a,i;for(let s=0;s<18;s++)o=Math.floor(s/3),a=s%3+n-8-3,i=1==(r>>s&1),e.set(o,a,i,!0),e.set(a,o,i,!0)}function setupFormatInfo(e,t,n){const r=e.size,o=FormatInfo.getEncodedBits(t,n);let a,i;for(a=0;a<15;a++)i=1==(o>>a&1),a<6?e.set(a,8,i,!0):a<8?e.set(a+1,8,i,!0):e.set(r-15+a,8,i,!0),a<8?e.set(8,r-a-1,i,!0):a<9?e.set(8,15-a-1+1,i,!0):e.set(8,15-a-1,i,!0);e.set(r-8,8,1,!0)}function setupData(e,t){const n=e.size;let r=-1,o=n-1,a=7,i=0;for(let s=n-1;s>0;s-=2)for(6===s&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(o,s-n)){let r=!1;i<t.length&&(r=1==(t[i]>>>a&1)),e.set(o,s-n,r),a--,-1===a&&(i++,a=7)}if(o+=r,o<0||n<=o){o-=r,r=-r;break}}}function createData(e,t,n){const r=new BitBuffer;n.forEach((function(t){r.put(t.mode.bit,4),r.put(t.getLength(),Mode.getCharCountIndicator(t.mode,e)),t.write(r)}));const o=8*(Utils$1.getSymbolTotalCodewords(e)-ECCode.getTotalCodewordsCount(e,t));for(r.getLengthInBits()+4<=o&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(0);const a=(o-r.getLengthInBits())/8;for(let i=0;i<a;i++)r.put(i%2?17:236,8);return createCodewords(r,e,t)}function createCodewords(e,t,n){const r=Utils$1.getSymbolTotalCodewords(t),o=r-ECCode.getTotalCodewordsCount(t,n),a=ECCode.getBlocksCount(t,n),i=a-r%a,s=Math.floor(r/a),l=Math.floor(o/a),c=l+1,u=s-l,d=new ReedSolomonEncoder(u);let f=0;const h=new Array(a),m=new Array(a);let g=0;const p=new Uint8Array(e.buffer);for(let S=0;S<a;S++){const e=S<i?l:c;h[S]=p.slice(f,f+e),m[S]=d.encode(h[S]),f+=e,g=Math.max(g,e)}const y=new Uint8Array(r);let _,v,k=0;for(_=0;_<g;_++)for(v=0;v<a;v++)_<h[v].length&&(y[k++]=h[v][_]);for(_=0;_<u;_++)for(v=0;v<a;v++)y[k++]=m[v][_];return y}function createSymbol(e,t,n,r){let o;if(Array.isArray(e))o=Segments.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let r=t;if(!r){const t=Segments.rawSplit(e);r=Version.getBestVersionForData(t,n)}o=Segments.fromString(e,r||40)}}const a=Version.getBestVersionForData(o,n);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<a)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+a+".\n")}else t=a;const i=createData(t,n,o),s=Utils$1.getSymbolSize(t),l=new BitMatrix(s);return setupFinderPattern(l,t),setupTimingPattern(l),setupAlignmentPattern(l,t),setupFormatInfo(l,n,0),t>=7&&setupVersionInfo(l,t),setupData(l,i),isNaN(r)&&(r=MaskPattern.getBestMask(l,setupFormatInfo.bind(null,l,n))),MaskPattern.applyMask(r,l),setupFormatInfo(l,n,r),{modules:l,version:t,errorCorrectionLevel:n,maskPattern:r,segments:o}}qrcode$1.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,r,o=ECLevel.M;return void 0!==t&&(o=ECLevel.from(t.errorCorrectionLevel,ECLevel.M),n=Version.from(t.version),r=MaskPattern.from(t.maskPattern),t.toSJISFunc&&Utils$1.setToSJISFunction(t.toSJISFunc)),createSymbol(e,n,o,r)};var canvas={},utils$9={};!function(e){function t(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(e){e||(e={}),e.color||(e.color={});const n=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,o=e.scale||4;return{width:r,scale:r?4:o,margin:n,color:{dark:t(e.color.dark||"#000000ff"),light:t(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},e.getImageWidth=function(t,n){const r=e.getScale(t,n);return Math.floor((t+2*n.margin)*r)},e.qrToImageData=function(t,n,r){const o=n.modules.size,a=n.modules.data,i=e.getScale(o,r),s=Math.floor((o+2*r.margin)*i),l=r.margin*i,c=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=4*(e*s+n),d=r.color.light;if(e>=l&&n>=l&&e<s-l&&n<s-l){d=c[a[Math.floor((e-l)/i)*o+Math.floor((n-l)/i)]?1:0]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}}(utils$9),function(e){const t=utils$9;e.render=function(e,n,r){let o=r,a=n;void 0!==o||n&&n.getContext||(o=n,n=void 0),n||(a=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),o=t.getOptions(o);const i=t.getImageWidth(e.modules.size,o),s=a.getContext("2d"),l=s.createImageData(i,i);return t.qrToImageData(l.data,e,o),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(s,a,i),s.putImageData(l,0,0),a},e.renderToDataURL=function(t,n,r){let o=r;void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={});const a=e.render(t,n,o),i=o.type||"image/png",s=o.rendererOpts||{};return a.toDataURL(i,s.quality)}}(canvas);var svgTag={};const Utils=utils$9;function getColorAttrib(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function svgCmd(e,t,n){let r=e+t;return void 0!==n&&(r+=" "+n),r}function qrToPath(e,t,n){let r="",o=0,a=!1,i=0;for(let s=0;s<e.length;s++){const l=Math.floor(s%t),c=Math.floor(s/t);l||a||(a=!0),e[s]?(i++,s>0&&l>0&&e[s-1]||(r+=a?svgCmd("M",l+n,.5+c+n):svgCmd("m",o,0),o=0,a=!1),l+1<t&&e[s+1]||(r+=svgCmd("h",i),i=0)):o++}return r}svgTag.render=function(e,t,n){const r=Utils.getOptions(t),o=e.modules.size,a=e.modules.data,i=o+2*r.margin,s=r.color.light.a?"<path "+getColorAttrib(r.color.light,"fill")+' d="M0 0h'+i+"v"+i+'H0z"/>':"",l="<path "+getColorAttrib(r.color.dark,"stroke")+' d="'+qrToPath(a,o,r.margin)+'"/>',c='viewBox="0 0 '+i+" "+i+'"',u='<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+c+' shape-rendering="crispEdges">'+s+l+"</svg>\n";return"function"==typeof n&&n(null,u),u};const canPromise=canPromise$1,QRCode=qrcode$1,CanvasRenderer=canvas,SvgRenderer=svgTag;function renderCanvas(e,t,n,r,o){const a=[].slice.call(arguments,1),i=a.length,s="function"==typeof a[i-1];if(!s&&!canPromise())throw new Error("Callback required as last argument");if(!s){if(i<1)throw new Error("Too few arguments provided");return 1===i?(n=t,t=r=void 0):2!==i||t.getContext||(r=n,n=t,t=void 0),new Promise((function(o,a){try{const a=QRCode.create(n,r);o(e(a,t,r))}catch(i){a(i)}}))}if(i<2)throw new Error("Too few arguments provided");2===i?(o=n,n=t,t=r=void 0):3===i&&(t.getContext&&void 0===o?(o=r,r=void 0):(o=r,r=n,n=t,t=void 0));try{const a=QRCode.create(n,r);o(null,e(a,t,r))}catch(l){o(l)}}browser.create=QRCode.create,browser.toCanvas=renderCanvas.bind(null,CanvasRenderer.render),browser.toDataURL=renderCanvas.bind(null,CanvasRenderer.renderToDataURL),browser.toString=renderCanvas.bind(null,(function(e,t,n){return SvgRenderer.render(e,n)}));const _sfc_main$2=Vue.defineComponent({name:"magic-ui-qrcode",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){useApp(e);const t=Vue.ref();return Vue.watch((()=>e.config.url),((e="")=>{browser.toDataURL(e,((e,n)=>{e&&console.error(e),t.value=n}))}),{immediate:!0}),{imgUrl:t}}}),_hoisted_1=["src"];function _sfc_render$2(e,t,n,r,o,a){return Vue.openBlock(),Vue.createElementBlock("img",{class:"magic-ui-qrcode",src:e.imgUrl},null,8,_hoisted_1)}const qrcode=_export_sfc(_sfc_main$2,[["render",_sfc_render$2],["__file","/data/magic/tmagic-editor/packages/ui/src/qrcode/src/index.vue"]]),_sfc_main$1=Vue.defineComponent({name:"magic-ui-overlay",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){var t;const n=Vue.ref(!1),r=useApp(e),o=null==r||null===(t=r.page)||void 0===t?void 0:t.getNode(e.config.id),a=()=>{n.value=!0,r&&r.emit("overlay:open",o)},i=()=>{n.value=!1,r&&r.emit("overlay:close",o)};return null==r||r.on("editor:select",((t,n)=>{n.find((t=>t.id===e.config.id))?a():i()})),{visible:n,openOverlay:a,closeOverlay:i}}});function _sfc_render$1(e,t,n,r,o,a){const i=Vue.resolveComponent("magic-ui-container");return e.visible?(Vue.openBlock(),Vue.createBlock(i,{key:0,class:"magic-ui-overlay",config:{items:e.config.items}},{default:Vue.withCtx((()=>[Vue.renderSlot(e.$slots,"default")])),_:3},8,["config"])):Vue.createCommentVNode("v-if",!0)}const overlay=_export_sfc(_sfc_main$1,[["render",_sfc_render$1],["__file","/data/magic/tmagic-editor/packages/ui/src/overlay/src/index.vue"]]),components={page:page,container:container,button:button,text:text,img:img,qrcode:qrcode,overlay:overlay},plugins={};var axios$3={exports:{}},axios$2={exports:{}},bind$2=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},bind$1=bind$2,toString=Object.prototype.toString;function isArray(e){return Array.isArray(e)}function isUndefined(e){return void 0===e}function isBuffer(e){return null!==e&&!isUndefined(e)&&null!==e.constructor&&!isUndefined(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function isArrayBuffer(e){return"[object ArrayBuffer]"===toString.call(e)}function isFormData(e){return"[object FormData]"===toString.call(e)}function isArrayBufferView(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&isArrayBuffer(e.buffer)}function isString(e){return"string"==typeof e}function isNumber(e){return"number"==typeof e}function isObject(e){return null!==e&&"object"==typeof e}function isPlainObject(e){if("[object Object]"!==toString.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function isDate(e){return"[object Date]"===toString.call(e)}function isFile(e){return"[object File]"===toString.call(e)}function isBlob(e){return"[object Blob]"===toString.call(e)}function isFunction(e){return"[object Function]"===toString.call(e)}function isStream(e){return isObject(e)&&isFunction(e.pipe)}function isURLSearchParams(e){return"[object URLSearchParams]"===toString.call(e)}function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function forEach(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),isArray(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}function merge(){var e={};function t(t,n){isPlainObject(e[n])&&isPlainObject(t)?e[n]=merge(e[n],t):isPlainObject(t)?e[n]=merge({},t):isArray(t)?e[n]=t.slice():e[n]=t}for(var n=0,r=arguments.length;n<r;n++)forEach(arguments[n],t);return e}function extend(e,t,n){return forEach(t,(function(t,r){e[r]=n&&"function"==typeof t?bind$1(t,n):t})),e}function stripBOM(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}var utils$8={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isStandardBrowserEnv:isStandardBrowserEnv,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM},utils$7=utils$8;function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(utils$7.isURLSearchParams(t))r=t.toString();else{var o=[];utils$7.forEach(t,(function(e,t){null!=e&&(utils$7.isArray(e)?t+="[]":e=[e],utils$7.forEach(e,(function(e){utils$7.isDate(e)?e=e.toISOString():utils$7.isObject(e)&&(e=JSON.stringify(e)),o.push(encode(t)+"="+encode(e))})))})),r=o.join("&")}if(r){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},utils$6=utils$8;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},InterceptorManager$1.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager$1.prototype.forEach=function(e){utils$6.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var InterceptorManager_1=InterceptorManager$1,utils$5=utils$8,normalizeHeaderName=function(e,t){utils$5.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},enhanceError=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},createError,hasRequiredCreateError,settle,hasRequiredSettle,cookies,hasRequiredCookies,isAbsoluteURL,hasRequiredIsAbsoluteURL,combineURLs,hasRequiredCombineURLs,buildFullPath,hasRequiredBuildFullPath,parseHeaders,hasRequiredParseHeaders,isURLSameOrigin,hasRequiredIsURLSameOrigin,Cancel_1,hasRequiredCancel,xhr,hasRequiredXhr,defaults_1,hasRequiredDefaults;function requireCreateError(){if(hasRequiredCreateError)return createError;hasRequiredCreateError=1;var e=enhanceError;return createError=function(t,n,r,o,a){var i=new Error(t);return e(i,n,r,o,a)},createError}function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var e=requireCreateError();return settle=function(t,n,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?n(e("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}}function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var e=utils$8;return cookies=e.isStandardBrowserEnv()?{write:function(t,n,r,o,a,i){var s=[];s.push(t+"="+encodeURIComponent(n)),e.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),e.isString(o)&&s.push("path="+o),e.isString(a)&&s.push("domain="+a),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}}function requireIsAbsoluteURL(){return hasRequiredIsAbsoluteURL?isAbsoluteURL:(hasRequiredIsAbsoluteURL=1,isAbsoluteURL=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)})}function requireCombineURLs(){return hasRequiredCombineURLs?combineURLs:(hasRequiredCombineURLs=1,combineURLs=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e})}function requireBuildFullPath(){if(hasRequiredBuildFullPath)return buildFullPath;hasRequiredBuildFullPath=1;var e=requireIsAbsoluteURL(),t=requireCombineURLs();return buildFullPath=function(n,r){return n&&!e(r)?t(n,r):r}}function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var e=utils$8,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(n){var r,o,a,i={};return n?(e.forEach(n.split("\n"),(function(n){if(a=n.indexOf(":"),r=e.trim(n.substr(0,a)).toLowerCase(),o=e.trim(n.substr(a+1)),r){if(i[r]&&t.indexOf(r)>=0)return;i[r]="set-cookie"===r?(i[r]?i[r]:[]).concat([o]):i[r]?i[r]+", "+o:o}})),i):i}}function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var e=utils$8;return isURLSameOrigin=e.isStandardBrowserEnv()?function(){var t,n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var t=e;return n&&(r.setAttribute("href",t),t=r.href),r.setAttribute("href",t),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=o(window.location.href),function(n){var r=e.isString(n)?o(n):n;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}}function requireCancel(){if(hasRequiredCancel)return Cancel_1;function e(e){this.message=e}return hasRequiredCancel=1,e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,Cancel_1=e}function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var e=utils$8,t=requireSettle(),n=requireCookies(),r=buildURL$1,o=requireBuildFullPath(),a=requireParseHeaders(),i=requireIsURLSameOrigin(),s=requireCreateError(),l=requireDefaults(),c=requireCancel();return xhr=function(u){return new Promise((function(d,f){var h,m=u.data,g=u.headers,p=u.responseType;function y(){u.cancelToken&&u.cancelToken.unsubscribe(h),u.signal&&u.signal.removeEventListener("abort",h)}e.isFormData(m)&&delete g["Content-Type"];var _=new XMLHttpRequest;if(u.auth){var v=u.auth.username||"",k=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"";g.Authorization="Basic "+btoa(v+":"+k)}var S=o(u.baseURL,u.url);function w(){if(_){var e="getAllResponseHeaders"in _?a(_.getAllResponseHeaders()):null,n={data:p&&"text"!==p&&"json"!==p?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:e,config:u,request:_};t((function(e){d(e),y()}),(function(e){f(e),y()}),n),_=null}}if(_.open(u.method.toUpperCase(),r(S,u.params,u.paramsSerializer),!0),_.timeout=u.timeout,"onloadend"in _?_.onloadend=w:_.onreadystatechange=function(){_&&4===_.readyState&&(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))&&setTimeout(w)},_.onabort=function(){_&&(f(s("Request aborted",u,"ECONNABORTED",_)),_=null)},_.onerror=function(){f(s("Network Error",u,null,_)),_=null},_.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",t=u.transitional||l.transitional;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),f(s(e,u,t.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",_)),_=null},e.isStandardBrowserEnv()){var E=(u.withCredentials||i(S))&&u.xsrfCookieName?n.read(u.xsrfCookieName):void 0;E&&(g[u.xsrfHeaderName]=E)}"setRequestHeader"in _&&e.forEach(g,(function(e,t){void 0===m&&"content-type"===t.toLowerCase()?delete g[t]:_.setRequestHeader(t,e)})),e.isUndefined(u.withCredentials)||(_.withCredentials=!!u.withCredentials),p&&"json"!==p&&(_.responseType=u.responseType),"function"==typeof u.onDownloadProgress&&_.addEventListener("progress",u.onDownloadProgress),"function"==typeof u.onUploadProgress&&_.upload&&_.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(h=function(e){_&&(f(!e||e&&e.type?new c("canceled"):e),_.abort(),_=null)},u.cancelToken&&u.cancelToken.subscribe(h),u.signal&&(u.signal.aborted?h():u.signal.addEventListener("abort",h))),m||(m=null),_.send(m)}))},xhr}function requireDefaults(){if(hasRequiredDefaults)return defaults_1;hasRequiredDefaults=1;var e=utils$8,t=normalizeHeaderName,n=enhanceError,r={"Content-Type":"application/x-www-form-urlencoded"};function o(t,n){!e.isUndefined(t)&&e.isUndefined(t["Content-Type"])&&(t["Content-Type"]=n)}var a,i={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(a=requireXhr()),a),transformRequest:[function(n,r){return t(r,"Accept"),t(r,"Content-Type"),e.isFormData(n)||e.isArrayBuffer(n)||e.isBuffer(n)||e.isStream(n)||e.isFile(n)||e.isBlob(n)?n:e.isArrayBufferView(n)?n.buffer:e.isURLSearchParams(n)?(o(r,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):e.isObject(n)||r&&"application/json"===r["Content-Type"]?(o(r,"application/json"),function(t,n,r){if(e.isString(t))try{return(n||JSON.parse)(t),e.trim(t)}catch(o){if("SyntaxError"!==o.name)throw o}return(r||JSON.stringify)(t)}(n)):n}],transformResponse:[function(t){var r=this.transitional||i.transitional,o=r&&r.silentJSONParsing,a=r&&r.forcedJSONParsing,s=!o&&"json"===this.responseType;if(s||a&&e.isString(t)&&t.length)try{return JSON.parse(t)}catch(l){if(s){if("SyntaxError"===l.name)throw n(l,this,"E_JSON_PARSE");throw l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return e.forEach(["delete","get","head"],(function(e){i.headers[e]={}})),e.forEach(["post","put","patch"],(function(t){i.headers[t]=e.merge(r)})),defaults_1=i}var utils$4=utils$8,defaults$2=requireDefaults(),transformData$1=function(e,t,n){var r=this||defaults$2;return utils$4.forEach(n,(function(n){e=n.call(r,e,t)})),e},isCancel$1,hasRequiredIsCancel;function requireIsCancel(){return hasRequiredIsCancel?isCancel$1:(hasRequiredIsCancel=1,isCancel$1=function(e){return!(!e||!e.__CANCEL__)})}var utils$3=utils$8,transformData=transformData$1,isCancel=requireIsCancel(),defaults$1=requireDefaults(),Cancel=requireCancel();function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Cancel("canceled")}var dispatchRequest$1=function(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=transformData.call(e,e.data,e.headers,e.transformRequest),e.headers=utils$3.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||defaults$1.adapter)(e).then((function(t){return throwIfCancellationRequested(e),t.data=transformData.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return isCancel(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=transformData.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},utils$2=utils$8,mergeConfig$2=function(e,t){t=t||{};var n={};function r(e,t){return utils$2.isPlainObject(e)&&utils$2.isPlainObject(t)?utils$2.merge(e,t):utils$2.isPlainObject(t)?utils$2.merge({},t):utils$2.isArray(t)?t.slice():t}function o(n){return utils$2.isUndefined(t[n])?utils$2.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function a(e){if(!utils$2.isUndefined(t[e]))return r(void 0,t[e])}function i(n){return utils$2.isUndefined(t[n])?utils$2.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function s(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s};return utils$2.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||o,r=t(e);utils$2.isUndefined(r)&&t!==s||(n[e]=r)})),n},data,hasRequiredData;function requireData(){return hasRequiredData?data:(hasRequiredData=1,data={version:"0.25.0"})}var VERSION=requireData().version,validators$1={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){validators$1[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var deprecatedWarnings={};function assertOptions(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var a=r[o],i=t[a];if(i){var s=e[a],l=void 0===s||i(s,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}}validators$1.transitional=function(e,t,n){function r(e,t){return"[Axios v"+VERSION+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,a){if(!1===e)throw new Error(r(o," has been removed"+(t?" in "+t:"")));return t&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,a)}};var validator$1={assertOptions:assertOptions,validators:validators$1},utils$1=utils$8,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2,validator=validator$1,validators=validator.validators;function Axios$1(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=mergeConfig$1(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var a,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!o){var s=[dispatchRequest,void 0];for(Array.prototype.unshift.apply(s,r),s=s.concat(i),a=Promise.resolve(t);s.length;)a=a.then(s.shift(),s.shift());return a}for(var l=t;r.length;){var c=r.shift(),u=r.shift();try{l=c(l)}catch(d){u(d);break}}try{a=dispatchRequest(l)}catch(d){return Promise.reject(d)}for(;i.length;)a=a.then(i.shift(),i.shift());return a},Axios$1.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=mergeConfig$1(this.defaults,e),buildURL(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},utils$1.forEach(["delete","get","head","options"],(function(e){Axios$1.prototype[e]=function(t,n){return this.request(mergeConfig$1(n||{},{method:e,url:t,data:(n||{}).data}))}})),utils$1.forEach(["post","put","patch"],(function(e){Axios$1.prototype[e]=function(t,n,r){return this.request(mergeConfig$1(r||{},{method:e,url:t,data:n}))}}));var Axios_1=Axios$1,CancelToken_1,hasRequiredCancelToken,spread,hasRequiredSpread,isAxiosError,hasRequiredIsAxiosError;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var e=requireCancel();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(t){r.reason||(r.reason=new e(t),n(r.reason))}))}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},t.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},t.source=function(){var e;return{token:new t((function(t){e=t})),cancel:e}},CancelToken_1=t}function requireSpread(){return hasRequiredSpread?spread:(hasRequiredSpread=1,spread=function(e){return function(t){return e.apply(null,t)}})}function requireIsAxiosError(){if(hasRequiredIsAxiosError)return isAxiosError;hasRequiredIsAxiosError=1;var e=utils$8;return isAxiosError=function(t){return e.isObject(t)&&!0===t.isAxiosError}}var utils=utils$8,bind=bind$2,Axios=Axios_1,mergeConfig=mergeConfig$2,defaults=requireDefaults();function createInstance(e){var t=new Axios(e),n=bind(Axios.prototype.request,t);return utils.extend(n,Axios.prototype,t),utils.extend(n,t),n.create=function(t){return createInstance(mergeConfig(e,t))},n}var axios$1=createInstance(defaults);axios$1.Axios=Axios,axios$1.Cancel=requireCancel(),axios$1.CancelToken=requireCancelToken(),axios$1.isCancel=requireIsCancel(),axios$1.VERSION=requireData().version,axios$1.all=function(e){return Promise.all(e)},axios$1.spread=requireSpread(),axios$1.isAxiosError=requireIsAxiosError(),axios$2.exports=axios$1,axios$2.exports.default=axios$1,function(e){e.exports=axios$2.exports}(axios$3);const axios=getDefaultExportFromCjs(axios$3.exports),service=axios.create({withCredentials:!0,timeout:7e3}),requestHandler=function(e){return e},responseHandler=function(e){return e};service.interceptors.request.use(requestHandler),service.interceptors.response.use(responseHandler);const request={install(e){e.provide("request",service)}},_sfc_main=Vue.defineComponent({name:"App",setup(){var e;const t=Vue.inject("app");return{pageConfig:Vue.reactive((null==t||null===(e=t.page)||void 0===e?void 0:e.data)||{})}}});function _sfc_render(e,t,n,r,o,a){const i=Vue.resolveComponent("magic-ui-page");return Vue.openBlock(),Vue.createBlock(i,{config:e.pageConfig},null,8,["config"])}const AppComponent=_export_sfc(_sfc_main,[["render",_sfc_render],["__file","/data/magic/tmagic-editor/runtime/vue3/page/App.vue"]]),getLocalConfig=()=>{const configStr=localStorage.getItem("magicDSL");if(!configStr)return[];try{return[eval(`(${configStr})`)]}catch(err){return[]}},magicApp=Vue.createApp(AppComponent);magicApp.use(request),Object.values(components).forEach((e=>{magicApp.component(e.name,e)})),Object.values(plugins).forEach((e=>{magicApp.use(e)}));const app=new App({config:((getUrlParam("localPreview")?getLocalConfig():window.magicDSL)||[])[0]||{},curPage:getUrlParam("page")});magicApp.config.globalProperties.app=app,magicApp.provide("app",app),magicApp.mount("#app")}}}))})();
//# sourceMappingURL=index-legacy.9fd49d9c.js.map