vendor-legacy.4c261739.js 233 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414
  1. ;(function(){function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e2){throw _e2;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e3){didErr=true;err=_e3;},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}System.register([],function(exports){'use strict';return{execute:function execute(){exports({a:createTextVNode,b:createRouter,d:defineComponent,e:createWebHashHistory});/**
  2. * Make a map and return a function for checking if a key
  3. * is in that map.
  4. * IMPORTANT: all calls of this function must be prefixed with
  5. * \/\*#\_\_PURE\_\_\*\/
  6. * So that rollup can tree-shake them if necessary.
  7. */function makeMap(str,expectsLowerCase){var map=Object.create(null);var list=str.split(',');for(var i=0;i<list.length;i++){map[list[i]]=true;}return expectsLowerCase?function(val){return!!map[val.toLowerCase()];}:function(val){return!!map[val];};}/**
  8. * On the client we only need to offer special cases for boolean attributes that
  9. * have different names from their corresponding dom properties:
  10. * - itemscope -> N/A
  11. * - allowfullscreen -> allowFullscreen
  12. * - formnovalidate -> formNoValidate
  13. * - ismap -> isMap
  14. * - nomodule -> noModule
  15. * - novalidate -> noValidate
  16. * - readonly -> readOnly
  17. */var specialBooleanAttrs="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var isSpecialBooleanAttr=/*#__PURE__*/makeMap(specialBooleanAttrs);/**
  18. * Boolean attributes should be included if the value is truthy or ''.
  19. * e.g. `<select multiple>` compiles to `{ multiple: '' }`
  20. */function includeBooleanAttr(value){return!!value||value==='';}function normalizeStyle(value){if(isArray(value)){var res={};for(var i=0;i<value.length;i++){var item=value[i];var normalized=isString(item)?parseStringStyle(item):normalizeStyle(item);if(normalized){for(var key in normalized){res[key]=normalized[key];}}}return res;}else if(isString(value)){return value;}else if(isObject(value)){return value;}}var listDelimiterRE=/;(?![^(]*\))/g;var propertyDelimiterRE=/:(.+)/;function parseStringStyle(cssText){var ret={};cssText.split(listDelimiterRE).forEach(function(item){if(item){var tmp=item.split(propertyDelimiterRE);tmp.length>1&&(ret[tmp[0].trim()]=tmp[1].trim());}});return ret;}function normalizeClass(value){var res='';if(isString(value)){res=value;}else if(isArray(value)){for(var i=0;i<value.length;i++){var normalized=normalizeClass(value[i]);if(normalized){res+=normalized+' ';}}}else if(isObject(value)){for(var name in value){if(value[name]){res+=name+' ';}}}return res.trim();}var EMPTY_OBJ={};var EMPTY_ARR=[];var NOOP=function NOOP(){};/**
  21. * Always return false.
  22. */var NO=function NO(){return false;};var onRE=/^on[^a-z]/;var isOn=function isOn(key){return onRE.test(key);};var isModelListener=function isModelListener(key){return key.startsWith('onUpdate:');};var extend=Object.assign;var remove=function remove(arr,el){var i=arr.indexOf(el);if(i>-1){arr.splice(i,1);}};var hasOwnProperty=Object.prototype.hasOwnProperty;var hasOwn=function hasOwn(val,key){return hasOwnProperty.call(val,key);};var isArray=Array.isArray;var isMap=function isMap(val){return toTypeString(val)==='[object Map]';};var isSet=function isSet(val){return toTypeString(val)==='[object Set]';};var isFunction=function isFunction(val){return typeof val==='function';};var isString=function isString(val){return typeof val==='string';};var isSymbol=function isSymbol(val){return _typeof(val)==='symbol';};var isObject=function isObject(val){return val!==null&&_typeof(val)==='object';};var isPromise=function isPromise(val){return isObject(val)&&isFunction(val.then)&&isFunction(val.catch);};var objectToString=Object.prototype.toString;var toTypeString=function toTypeString(value){return objectToString.call(value);};var toRawType=function toRawType(value){// extract "RawType" from strings like "[object RawType]"
  23. return toTypeString(value).slice(8,-1);};var isPlainObject=function isPlainObject(val){return toTypeString(val)==='[object Object]';};var isIntegerKey=function isIntegerKey(key){return isString(key)&&key!=='NaN'&&key[0]!=='-'&&''+parseInt(key,10)===key;};var isReservedProp=/*#__PURE__*/makeMap(// the leading comma is intentional so empty string "" is also included
  24. ',key,ref,ref_for,ref_key,'+'onVnodeBeforeMount,onVnodeMounted,'+'onVnodeBeforeUpdate,onVnodeUpdated,'+'onVnodeBeforeUnmount,onVnodeUnmounted');var cacheStringFunction=function cacheStringFunction(fn){var cache=Object.create(null);return function(str){var hit=cache[str];return hit||(cache[str]=fn(str));};};var camelizeRE=/-(\w)/g;/**
  25. * @private
  26. */var camelize=cacheStringFunction(function(str){return str.replace(camelizeRE,function(_,c){return c?c.toUpperCase():'';});});var hyphenateRE=/\B([A-Z])/g;/**
  27. * @private
  28. */var hyphenate=cacheStringFunction(function(str){return str.replace(hyphenateRE,'-$1').toLowerCase();});/**
  29. * @private
  30. */var capitalize=cacheStringFunction(function(str){return str.charAt(0).toUpperCase()+str.slice(1);});/**
  31. * @private
  32. */var toHandlerKey=cacheStringFunction(function(str){return str?"on".concat(capitalize(str)):"";});// compare whether a value has changed, accounting for NaN.
  33. var hasChanged=function hasChanged(value,oldValue){return!Object.is(value,oldValue);};var invokeArrayFns=function invokeArrayFns(fns,arg){for(var i=0;i<fns.length;i++){fns[i](arg);}};var def=function def(obj,key,value){Object.defineProperty(obj,key,{configurable:true,enumerable:false,value:value});};var toNumber=function toNumber(val){var n=parseFloat(val);return isNaN(n)?val:n;};var _globalThis;var getGlobalThis=function getGlobalThis(){return _globalThis||(_globalThis=typeof globalThis!=='undefined'?globalThis:typeof self!=='undefined'?self:typeof window!=='undefined'?window:typeof global!=='undefined'?global:{});};var activeEffectScope;var effectScopeStack=[];var EffectScope=/*#__PURE__*/function(){function EffectScope(){var detached=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;_classCallCheck(this,EffectScope);this.active=true;this.effects=[];this.cleanups=[];if(!detached&&activeEffectScope){this.parent=activeEffectScope;this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1;}}_createClass(EffectScope,[{key:"run",value:function run(fn){if(this.active){try{this.on();return fn();}finally{this.off();}}}},{key:"on",value:function on(){if(this.active){effectScopeStack.push(this);activeEffectScope=this;}}},{key:"off",value:function off(){if(this.active){effectScopeStack.pop();activeEffectScope=effectScopeStack[effectScopeStack.length-1];}}},{key:"stop",value:function stop(fromParent){if(this.active){this.effects.forEach(function(e){return e.stop();});this.cleanups.forEach(function(cleanup){return cleanup();});if(this.scopes){this.scopes.forEach(function(e){return e.stop(true);});}// nested scope, dereference from parent to avoid memory leaks
  34. if(this.parent&&!fromParent){// optimized O(1) removal
  35. var last=this.parent.scopes.pop();if(last&&last!==this){this.parent.scopes[this.index]=last;last.index=this.index;}}this.active=false;}}}]);return EffectScope;}();function recordEffectScope(effect,scope){scope=scope||activeEffectScope;if(scope&&scope.active){scope.effects.push(effect);}}var createDep=function createDep(effects){var dep=new Set(effects);dep.w=0;dep.n=0;return dep;};var wasTracked=function wasTracked(dep){return(dep.w&trackOpBit)>0;};var newTracked=function newTracked(dep){return(dep.n&trackOpBit)>0;};var initDepMarkers=function initDepMarkers(_ref){var deps=_ref.deps;if(deps.length){for(var i=0;i<deps.length;i++){deps[i].w|=trackOpBit;// set was tracked
  36. }}};var finalizeDepMarkers=function finalizeDepMarkers(effect){var deps=effect.deps;if(deps.length){var ptr=0;for(var i=0;i<deps.length;i++){var dep=deps[i];if(wasTracked(dep)&&!newTracked(dep)){dep.delete(effect);}else{deps[ptr++]=dep;}// clear bits
  37. dep.w&=~trackOpBit;dep.n&=~trackOpBit;}deps.length=ptr;}};var targetMap=new WeakMap();// The number of effects currently being tracked recursively.
  38. var effectTrackDepth=0;var trackOpBit=1;/**
  39. * The bitwise track markers support at most 30 levels of recursion.
  40. * This value is chosen to enable modern JS engines to use a SMI on all platforms.
  41. * When recursion depth is greater, fall back to using a full cleanup.
  42. */var maxMarkerBits=30;var effectStack=[];var activeEffect;var ITERATE_KEY=Symbol('');var MAP_KEY_ITERATE_KEY=Symbol('');var ReactiveEffect=/*#__PURE__*/function(){function ReactiveEffect(fn){var scheduler=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var scope=arguments.length>2?arguments[2]:undefined;_classCallCheck(this,ReactiveEffect);this.fn=fn;this.scheduler=scheduler;this.active=true;this.deps=[];recordEffectScope(this,scope);}_createClass(ReactiveEffect,[{key:"run",value:function run(){if(!this.active){return this.fn();}if(!effectStack.includes(this)){try{effectStack.push(activeEffect=this);enableTracking();trackOpBit=1<<++effectTrackDepth;if(effectTrackDepth<=maxMarkerBits){initDepMarkers(this);}else{cleanupEffect(this);}return this.fn();}finally{if(effectTrackDepth<=maxMarkerBits){finalizeDepMarkers(this);}trackOpBit=1<<--effectTrackDepth;resetTracking();effectStack.pop();var n=effectStack.length;activeEffect=n>0?effectStack[n-1]:undefined;}}}},{key:"stop",value:function stop(){if(this.active){cleanupEffect(this);if(this.onStop){this.onStop();}this.active=false;}}}]);return ReactiveEffect;}();function cleanupEffect(effect){var deps=effect.deps;if(deps.length){for(var i=0;i<deps.length;i++){deps[i].delete(effect);}deps.length=0;}}var shouldTrack=true;var trackStack=[];function pauseTracking(){trackStack.push(shouldTrack);shouldTrack=false;}function enableTracking(){trackStack.push(shouldTrack);shouldTrack=true;}function resetTracking(){var last=trackStack.pop();shouldTrack=last===undefined?true:last;}function track(target,type,key){if(!isTracking()){return;}var depsMap=targetMap.get(target);if(!depsMap){targetMap.set(target,depsMap=new Map());}var dep=depsMap.get(key);if(!dep){depsMap.set(key,dep=createDep());}trackEffects(dep);}function isTracking(){return shouldTrack&&activeEffect!==undefined;}function trackEffects(dep,debuggerEventExtraInfo){var shouldTrack=false;if(effectTrackDepth<=maxMarkerBits){if(!newTracked(dep)){dep.n|=trackOpBit;// set newly tracked
  43. shouldTrack=!wasTracked(dep);}}else{// Full cleanup mode.
  44. shouldTrack=!dep.has(activeEffect);}if(shouldTrack){dep.add(activeEffect);activeEffect.deps.push(dep);}}function trigger(target,type,key,newValue,oldValue,oldTarget){var depsMap=targetMap.get(target);if(!depsMap){// never been tracked
  45. return;}var deps=[];if(type==="clear"/* CLEAR */){// collection being cleared
  46. // trigger all effects for target
  47. deps=_toConsumableArray(depsMap.values());}else if(key==='length'&&isArray(target)){depsMap.forEach(function(dep,key){if(key==='length'||key>=newValue){deps.push(dep);}});}else{// schedule runs for SET | ADD | DELETE
  48. if(key!==void 0){deps.push(depsMap.get(key));}// also run for iteration key on ADD | DELETE | Map.SET
  49. switch(type){case"add"/* ADD */:if(!isArray(target)){deps.push(depsMap.get(ITERATE_KEY));if(isMap(target)){deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));}}else if(isIntegerKey(key)){// new index added to array -> length changes
  50. deps.push(depsMap.get('length'));}break;case"delete"/* DELETE */:if(!isArray(target)){deps.push(depsMap.get(ITERATE_KEY));if(isMap(target)){deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));}}break;case"set"/* SET */:if(isMap(target)){deps.push(depsMap.get(ITERATE_KEY));}break;}}if(deps.length===1){if(deps[0]){{triggerEffects(deps[0]);}}}else{var effects=[];var _iterator=_createForOfIteratorHelper(deps),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var dep=_step.value;if(dep){effects.push.apply(effects,_toConsumableArray(dep));}}}catch(err){_iterator.e(err);}finally{_iterator.f();}{triggerEffects(createDep(effects));}}}function triggerEffects(dep,debuggerEventExtraInfo){// spread into array for stabilization
  51. var _iterator2=_createForOfIteratorHelper(isArray(dep)?dep:_toConsumableArray(dep)),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var effect=_step2.value;if(effect!==activeEffect||effect.allowRecurse){if(effect.scheduler){effect.scheduler();}else{effect.run();}}}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}var isNonTrackableKeys=/*#__PURE__*/makeMap("__proto__,__v_isRef,__isVue");var builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(function(key){return Symbol[key];}).filter(isSymbol));var get=/*#__PURE__*/createGetter();var shallowGet=/*#__PURE__*/createGetter(false,true);var readonlyGet=/*#__PURE__*/createGetter(true);var arrayInstrumentations=/*#__PURE__*/createArrayInstrumentations();function createArrayInstrumentations(){var instrumentations={};['includes','indexOf','lastIndexOf'].forEach(function(key){instrumentations[key]=function(){var arr=toRaw(this);for(var i=0,l=this.length;i<l;i++){track(arr,"get"/* GET */,i+'');}// we run the method using the original args first (which may be reactive)
  52. for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}var res=arr[key].apply(arr,args);if(res===-1||res===false){// if that didn't work, run it again using raw values.
  53. return arr[key].apply(arr,_toConsumableArray(args.map(toRaw)));}else{return res;}};});['push','pop','shift','unshift','splice'].forEach(function(key){instrumentations[key]=function(){pauseTracking();for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}var res=toRaw(this)[key].apply(this,args);resetTracking();return res;};});return instrumentations;}function createGetter(){var isReadonly=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var shallow=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return function get(target,key,receiver){if(key==="__v_isReactive"/* IS_REACTIVE */){return!isReadonly;}else if(key==="__v_isReadonly"/* IS_READONLY */){return isReadonly;}else if(key==="__v_raw"/* RAW */&&receiver===(isReadonly?shallow?shallowReadonlyMap:readonlyMap:shallow?shallowReactiveMap:reactiveMap).get(target)){return target;}var targetIsArray=isArray(target);if(!isReadonly&&targetIsArray&&hasOwn(arrayInstrumentations,key)){return Reflect.get(arrayInstrumentations,key,receiver);}var res=Reflect.get(target,key,receiver);if(isSymbol(key)?builtInSymbols.has(key):isNonTrackableKeys(key)){return res;}if(!isReadonly){track(target,"get"/* GET */,key);}if(shallow){return res;}if(isRef(res)){// ref unwrapping - does not apply for Array + integer key.
  54. var shouldUnwrap=!targetIsArray||!isIntegerKey(key);return shouldUnwrap?res.value:res;}if(isObject(res)){// Convert returned value into a proxy as well. we do the isObject check
  55. // here to avoid invalid value warning. Also need to lazy access readonly
  56. // and reactive here to avoid circular dependency.
  57. return isReadonly?readonly(res):reactive(res);}return res;};}var set=/*#__PURE__*/createSetter();var shallowSet=/*#__PURE__*/createSetter(true);function createSetter(){var shallow=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;return function set(target,key,value,receiver){var oldValue=target[key];if(!shallow&&!isReadonly(value)){value=toRaw(value);oldValue=toRaw(oldValue);if(!isArray(target)&&isRef(oldValue)&&!isRef(value)){oldValue.value=value;return true;}}var hadKey=isArray(target)&&isIntegerKey(key)?Number(key)<target.length:hasOwn(target,key);var result=Reflect.set(target,key,value,receiver);// don't trigger if target is something up in the prototype chain of original
  58. if(target===toRaw(receiver)){if(!hadKey){trigger(target,"add"/* ADD */,key,value);}else if(hasChanged(value,oldValue)){trigger(target,"set"/* SET */,key,value);}}return result;};}function deleteProperty(target,key){var hadKey=hasOwn(target,key);target[key];var result=Reflect.deleteProperty(target,key);if(result&&hadKey){trigger(target,"delete"/* DELETE */,key,undefined);}return result;}function has(target,key){var result=Reflect.has(target,key);if(!isSymbol(key)||!builtInSymbols.has(key)){track(target,"has"/* HAS */,key);}return result;}function ownKeys(target){track(target,"iterate"/* ITERATE */,isArray(target)?'length':ITERATE_KEY);return Reflect.ownKeys(target);}var mutableHandlers={get:get,set:set,deleteProperty:deleteProperty,has:has,ownKeys:ownKeys};var readonlyHandlers={get:readonlyGet,set:function set(target,key){return true;},deleteProperty:function deleteProperty(target,key){return true;}};var shallowReactiveHandlers=/*#__PURE__*/extend({},mutableHandlers,{get:shallowGet,set:shallowSet});var toShallow=function toShallow(value){return value;};var getProto=function getProto(v){return Reflect.getPrototypeOf(v);};function get$1(target,key){var isReadonly=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var isShallow=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;// #1772: readonly(reactive(Map)) should return readonly + reactive version
  59. // of the value
  60. target=target["__v_raw"/* RAW */];var rawTarget=toRaw(target);var rawKey=toRaw(key);if(key!==rawKey){!isReadonly&&track(rawTarget,"get"/* GET */,key);}!isReadonly&&track(rawTarget,"get"/* GET */,rawKey);var _getProto=getProto(rawTarget),has=_getProto.has;var wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;if(has.call(rawTarget,key)){return wrap(target.get(key));}else if(has.call(rawTarget,rawKey)){return wrap(target.get(rawKey));}else if(target!==rawTarget){// #3602 readonly(reactive(Map))
  61. // ensure that the nested reactive `Map` can do tracking for itself
  62. target.get(key);}}function has$1(key){var isReadonly=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var target=this["__v_raw"/* RAW */];var rawTarget=toRaw(target);var rawKey=toRaw(key);if(key!==rawKey){!isReadonly&&track(rawTarget,"has"/* HAS */,key);}!isReadonly&&track(rawTarget,"has"/* HAS */,rawKey);return key===rawKey?target.has(key):target.has(key)||target.has(rawKey);}function size(target){var isReadonly=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;target=target["__v_raw"/* RAW */];!isReadonly&&track(toRaw(target),"iterate"/* ITERATE */,ITERATE_KEY);return Reflect.get(target,'size',target);}function add(value){value=toRaw(value);var target=toRaw(this);var proto=getProto(target);var hadKey=proto.has.call(target,value);if(!hadKey){target.add(value);trigger(target,"add"/* ADD */,value,value);}return this;}function set$1(key,value){value=toRaw(value);var target=toRaw(this);var _getProto2=getProto(target),has=_getProto2.has,get=_getProto2.get;var hadKey=has.call(target,key);if(!hadKey){key=toRaw(key);hadKey=has.call(target,key);}var oldValue=get.call(target,key);target.set(key,value);if(!hadKey){trigger(target,"add"/* ADD */,key,value);}else if(hasChanged(value,oldValue)){trigger(target,"set"/* SET */,key,value);}return this;}function deleteEntry(key){var target=toRaw(this);var _getProto3=getProto(target),has=_getProto3.has,get=_getProto3.get;var hadKey=has.call(target,key);if(!hadKey){key=toRaw(key);hadKey=has.call(target,key);}get?get.call(target,key):undefined;// forward the operation before queueing reactions
  63. var result=target.delete(key);if(hadKey){trigger(target,"delete"/* DELETE */,key,undefined);}return result;}function clear(){var target=toRaw(this);var hadItems=target.size!==0;// forward the operation before queueing reactions
  64. var result=target.clear();if(hadItems){trigger(target,"clear"/* CLEAR */,undefined,undefined);}return result;}function createForEach(isReadonly,isShallow){return function forEach(callback,thisArg){var observed=this;var target=observed["__v_raw"/* RAW */];var rawTarget=toRaw(target);var wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;!isReadonly&&track(rawTarget,"iterate"/* ITERATE */,ITERATE_KEY);return target.forEach(function(value,key){// important: make sure the callback is
  65. // 1. invoked with the reactive map as `this` and 3rd arg
  66. // 2. the value received should be a corresponding reactive/readonly.
  67. return callback.call(thisArg,wrap(value),wrap(key),observed);});};}function createIterableMethod(method,isReadonly,isShallow){return function(){var target=this["__v_raw"/* RAW */];var rawTarget=toRaw(target);var targetIsMap=isMap(rawTarget);var isPair=method==='entries'||method===Symbol.iterator&&targetIsMap;var isKeyOnly=method==='keys'&&targetIsMap;var innerIterator=target[method].apply(target,arguments);var wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;!isReadonly&&track(rawTarget,"iterate"/* ITERATE */,isKeyOnly?MAP_KEY_ITERATE_KEY:ITERATE_KEY);// return a wrapped iterator which returns observed versions of the
  68. // values emitted from the real iterator
  69. return _defineProperty({// iterator protocol
  70. next:function next(){var _innerIterator$next=innerIterator.next(),value=_innerIterator$next.value,done=_innerIterator$next.done;return done?{value:value,done:done}:{value:isPair?[wrap(value[0]),wrap(value[1])]:wrap(value),done:done};}},Symbol.iterator,function(){return this;});};}function createReadonlyMethod(type){return function(){return type==="delete"/* DELETE */?false:this;};}function createInstrumentations(){var mutableInstrumentations={get:function get(key){return get$1(this,key);},get size(){return size(this);},has:has$1,add:add,set:set$1,delete:deleteEntry,clear:clear,forEach:createForEach(false,false)};var shallowInstrumentations={get:function get(key){return get$1(this,key,false,true);},get size(){return size(this);},has:has$1,add:add,set:set$1,delete:deleteEntry,clear:clear,forEach:createForEach(false,true)};var readonlyInstrumentations={get:function get(key){return get$1(this,key,true);},get size(){return size(this,true);},has:function has(key){return has$1.call(this,key,true);},add:createReadonlyMethod("add"/* ADD */),set:createReadonlyMethod("set"/* SET */),delete:createReadonlyMethod("delete"/* DELETE */),clear:createReadonlyMethod("clear"/* CLEAR */),forEach:createForEach(true,false)};var shallowReadonlyInstrumentations={get:function get(key){return get$1(this,key,true,true);},get size(){return size(this,true);},has:function has(key){return has$1.call(this,key,true);},add:createReadonlyMethod("add"/* ADD */),set:createReadonlyMethod("set"/* SET */),delete:createReadonlyMethod("delete"/* DELETE */),clear:createReadonlyMethod("clear"/* CLEAR */),forEach:createForEach(true,true)};var iteratorMethods=['keys','values','entries',Symbol.iterator];iteratorMethods.forEach(function(method){mutableInstrumentations[method]=createIterableMethod(method,false,false);readonlyInstrumentations[method]=createIterableMethod(method,true,false);shallowInstrumentations[method]=createIterableMethod(method,false,true);shallowReadonlyInstrumentations[method]=createIterableMethod(method,true,true);});return[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations];}var _createInstrumentatio=/* #__PURE__*/createInstrumentations(),_createInstrumentatio2=_slicedToArray(_createInstrumentatio,4),mutableInstrumentations=_createInstrumentatio2[0],readonlyInstrumentations=_createInstrumentatio2[1],shallowInstrumentations=_createInstrumentatio2[2],shallowReadonlyInstrumentations=_createInstrumentatio2[3];function createInstrumentationGetter(isReadonly,shallow){var instrumentations=shallow?isReadonly?shallowReadonlyInstrumentations:shallowInstrumentations:isReadonly?readonlyInstrumentations:mutableInstrumentations;return function(target,key,receiver){if(key==="__v_isReactive"/* IS_REACTIVE */){return!isReadonly;}else if(key==="__v_isReadonly"/* IS_READONLY */){return isReadonly;}else if(key==="__v_raw"/* RAW */){return target;}return Reflect.get(hasOwn(instrumentations,key)&&key in target?instrumentations:target,key,receiver);};}var mutableCollectionHandlers={get:/*#__PURE__*/createInstrumentationGetter(false,false)};var shallowCollectionHandlers={get:/*#__PURE__*/createInstrumentationGetter(false,true)};var readonlyCollectionHandlers={get:/*#__PURE__*/createInstrumentationGetter(true,false)};var reactiveMap=new WeakMap();var shallowReactiveMap=new WeakMap();var readonlyMap=new WeakMap();var shallowReadonlyMap=new WeakMap();function targetTypeMap(rawType){switch(rawType){case'Object':case'Array':return 1/* COMMON */;case'Map':case'Set':case'WeakMap':case'WeakSet':return 2/* COLLECTION */;default:return 0/* INVALID */;}}function getTargetType(value){return value["__v_skip"/* SKIP */]||!Object.isExtensible(value)?0/* INVALID */:targetTypeMap(toRawType(value));}function reactive(target){// if trying to observe a readonly proxy, return the readonly version.
  71. if(target&&target["__v_isReadonly"/* IS_READONLY */]){return target;}return createReactiveObject(target,false,mutableHandlers,mutableCollectionHandlers,reactiveMap);}/**
  72. * Return a shallowly-reactive copy of the original object, where only the root
  73. * level properties are reactive. It also does not auto-unwrap refs (even at the
  74. * root level).
  75. */function shallowReactive(target){return createReactiveObject(target,false,shallowReactiveHandlers,shallowCollectionHandlers,shallowReactiveMap);}/**
  76. * Creates a readonly copy of the original object. Note the returned copy is not
  77. * made reactive, but `readonly` can be called on an already reactive object.
  78. */function readonly(target){return createReactiveObject(target,true,readonlyHandlers,readonlyCollectionHandlers,readonlyMap);}function createReactiveObject(target,isReadonly,baseHandlers,collectionHandlers,proxyMap){if(!isObject(target)){return target;}// target is already a Proxy, return it.
  79. // exception: calling readonly() on a reactive object
  80. if(target["__v_raw"/* RAW */]&&!(isReadonly&&target["__v_isReactive"/* IS_REACTIVE */])){return target;}// target already has corresponding Proxy
  81. var existingProxy=proxyMap.get(target);if(existingProxy){return existingProxy;}// only a whitelist of value types can be observed.
  82. var targetType=getTargetType(target);if(targetType===0/* INVALID */){return target;}var proxy=new Proxy(target,targetType===2/* COLLECTION */?collectionHandlers:baseHandlers);proxyMap.set(target,proxy);return proxy;}function isReactive(value){if(isReadonly(value)){return isReactive(value["__v_raw"/* RAW */]);}return!!(value&&value["__v_isReactive"/* IS_REACTIVE */]);}function isReadonly(value){return!!(value&&value["__v_isReadonly"/* IS_READONLY */]);}function isProxy(value){return isReactive(value)||isReadonly(value);}function toRaw(observed){var raw=observed&&observed["__v_raw"/* RAW */];return raw?toRaw(raw):observed;}function markRaw(value){def(value,"__v_skip"/* SKIP */,true);return value;}var toReactive=function toReactive(value){return isObject(value)?reactive(value):value;};var toReadonly=function toReadonly(value){return isObject(value)?readonly(value):value;};function trackRefValue(ref){if(isTracking()){ref=toRaw(ref);if(!ref.dep){ref.dep=createDep();}{trackEffects(ref.dep);}}}function triggerRefValue(ref,newVal){ref=toRaw(ref);if(ref.dep){{triggerEffects(ref.dep);}}}function isRef(r){return Boolean(r&&r.__v_isRef===true);}function ref(value){return createRef(value,false);}function shallowRef(value){return createRef(value,true);}function createRef(rawValue,shallow){if(isRef(rawValue)){return rawValue;}return new RefImpl(rawValue,shallow);}var RefImpl=/*#__PURE__*/function(){function RefImpl(value,_shallow){_classCallCheck(this,RefImpl);this._shallow=_shallow;this.dep=undefined;this.__v_isRef=true;this._rawValue=_shallow?value:toRaw(value);this._value=_shallow?value:toReactive(value);}_createClass(RefImpl,[{key:"value",get:function get(){trackRefValue(this);return this._value;},set:function set(newVal){newVal=this._shallow?newVal:toRaw(newVal);if(hasChanged(newVal,this._rawValue)){this._rawValue=newVal;this._value=this._shallow?newVal:toReactive(newVal);triggerRefValue(this);}}}]);return RefImpl;}();function unref(ref){return isRef(ref)?ref.value:ref;}var shallowUnwrapHandlers={get:function get(target,key,receiver){return unref(Reflect.get(target,key,receiver));},set:function set(target,key,value,receiver){var oldValue=target[key];if(isRef(oldValue)&&!isRef(value)){oldValue.value=value;return true;}else{return Reflect.set(target,key,value,receiver);}}};function proxyRefs(objectWithRefs){return isReactive(objectWithRefs)?objectWithRefs:new Proxy(objectWithRefs,shallowUnwrapHandlers);}var ComputedRefImpl=/*#__PURE__*/function(){function ComputedRefImpl(getter,_setter,isReadonly){var _this=this;_classCallCheck(this,ComputedRefImpl);this._setter=_setter;this.dep=undefined;this._dirty=true;this.__v_isRef=true;this.effect=new ReactiveEffect(getter,function(){if(!_this._dirty){_this._dirty=true;triggerRefValue(_this);}});this["__v_isReadonly"/* IS_READONLY */]=isReadonly;}_createClass(ComputedRefImpl,[{key:"value",get:function get(){// the computed ref may get wrapped by other proxies e.g. readonly() #3376
  83. var self=toRaw(this);trackRefValue(self);if(self._dirty){self._dirty=false;self._value=self.effect.run();}return self._value;},set:function set(newValue){this._setter(newValue);}}]);return ComputedRefImpl;}();function computed(getterOrOptions,debugOptions){var getter;var setter;var onlyGetter=isFunction(getterOrOptions);if(onlyGetter){getter=getterOrOptions;setter=NOOP;}else{getter=getterOrOptions.get;setter=getterOrOptions.set;}var cRef=new ComputedRefImpl(getter,setter,onlyGetter||!setter);return cRef;}Promise.resolve();function emit$1(instance,event){var props=instance.vnode.props||EMPTY_OBJ;for(var _len3=arguments.length,rawArgs=new Array(_len3>2?_len3-2:0),_key3=2;_key3<_len3;_key3++){rawArgs[_key3-2]=arguments[_key3];}var args=rawArgs;var isModelListener=event.startsWith('update:');// for v-model update:xxx events, apply modifiers on args
  84. var modelArg=isModelListener&&event.slice(7);if(modelArg&&modelArg in props){var modifiersKey="".concat(modelArg==='modelValue'?'model':modelArg,"Modifiers");var _ref3=props[modifiersKey]||EMPTY_OBJ,number=_ref3.number,trim=_ref3.trim;if(trim){args=rawArgs.map(function(a){return a.trim();});}else if(number){args=rawArgs.map(toNumber);}}var handlerName;var handler=props[handlerName=toHandlerKey(event)]||// also try camelCase event handler (#2249)
  85. props[handlerName=toHandlerKey(camelize(event))];// for v-model update:xxx events, also trigger kebab-case equivalent
  86. // for props passed via kebab-case
  87. if(!handler&&isModelListener){handler=props[handlerName=toHandlerKey(hyphenate(event))];}if(handler){callWithAsyncErrorHandling(handler,instance,6/* COMPONENT_EVENT_HANDLER */,args);}var onceHandler=props[handlerName+"Once"];if(onceHandler){if(!instance.emitted){instance.emitted={};}else if(instance.emitted[handlerName]){return;}instance.emitted[handlerName]=true;callWithAsyncErrorHandling(onceHandler,instance,6/* COMPONENT_EVENT_HANDLER */,args);}}function normalizeEmitsOptions(comp,appContext){var asMixin=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var cache=appContext.emitsCache;var cached=cache.get(comp);if(cached!==undefined){return cached;}var raw=comp.emits;var normalized={};// apply mixin/extends props
  88. var hasExtends=false;if(!isFunction(comp)){var extendEmits=function extendEmits(raw){var normalizedFromExtend=normalizeEmitsOptions(raw,appContext,true);if(normalizedFromExtend){hasExtends=true;extend(normalized,normalizedFromExtend);}};if(!asMixin&&appContext.mixins.length){appContext.mixins.forEach(extendEmits);}if(comp.extends){extendEmits(comp.extends);}if(comp.mixins){comp.mixins.forEach(extendEmits);}}if(!raw&&!hasExtends){cache.set(comp,null);return null;}if(isArray(raw)){raw.forEach(function(key){return normalized[key]=null;});}else{extend(normalized,raw);}cache.set(comp,normalized);return normalized;}// Check if an incoming prop key is a declared emit event listener.
  89. // e.g. With `emits: { click: null }`, props named `onClick` and `onclick` are
  90. // both considered matched listeners.
  91. function isEmitListener(options,key){if(!options||!isOn(key)){return false;}key=key.slice(2).replace(/Once$/,'');return hasOwn(options,key[0].toLowerCase()+key.slice(1))||hasOwn(options,hyphenate(key))||hasOwn(options,key);}/**
  92. * mark the current rendering instance for asset resolution (e.g.
  93. * resolveComponent, resolveDirective) during render
  94. */var currentRenderingInstance=null;var currentScopeId=null;/**
  95. * Note: rendering calls maybe nested. The function returns the parent rendering
  96. * instance if present, which should be restored after the render is done:
  97. *
  98. * ```js
  99. * const prev = setCurrentRenderingInstance(i)
  100. * // ...render
  101. * setCurrentRenderingInstance(prev)
  102. * ```
  103. */function setCurrentRenderingInstance(instance){var prev=currentRenderingInstance;currentRenderingInstance=instance;currentScopeId=instance&&instance.type.__scopeId||null;return prev;}/**
  104. * Wrap a slot function to memoize current rendering instance
  105. * @private compiler helper
  106. */function withCtx(fn){var ctx=arguments.length>1&&arguments[1]!==undefined?arguments[1]:currentRenderingInstance;var isNonScopedSlot// false only
  107. =arguments.length>2?arguments[2]:undefined;if(!ctx)return fn;// already normalized
  108. if(fn._n){return fn;}var renderFnWithContext=function renderFnWithContext(){// If a user calls a compiled slot inside a template expression (#1745), it
  109. // can mess up block tracking, so by default we disable block tracking and
  110. // force bail out when invoking a compiled slot (indicated by the ._d flag).
  111. // This isn't necessary if rendering a compiled `<slot>`, so we flip the
  112. // ._d flag off when invoking the wrapped fn inside `renderSlot`.
  113. if(renderFnWithContext._d){setBlockTracking(-1);}var prevInstance=setCurrentRenderingInstance(ctx);var res=fn.apply(void 0,arguments);setCurrentRenderingInstance(prevInstance);if(renderFnWithContext._d){setBlockTracking(1);}return res;};// mark normalized to avoid duplicated wrapping
  114. renderFnWithContext._n=true;// mark this as compiled by default
  115. // this is used in vnode.ts -> normalizeChildren() to set the slot
  116. // rendering flag.
  117. renderFnWithContext._c=true;// disable block tracking by default
  118. renderFnWithContext._d=true;return renderFnWithContext;}function markAttrsAccessed(){}function renderComponentRoot(instance){var Component=instance.type,vnode=instance.vnode,proxy=instance.proxy,withProxy=instance.withProxy,props=instance.props,_instance$propsOption=_slicedToArray(instance.propsOptions,1),propsOptions=_instance$propsOption[0],slots=instance.slots,attrs=instance.attrs,emit=instance.emit,render=instance.render,renderCache=instance.renderCache,data=instance.data,setupState=instance.setupState,ctx=instance.ctx,inheritAttrs=instance.inheritAttrs;var result;var fallthroughAttrs;var prev=setCurrentRenderingInstance(instance);try{if(vnode.shapeFlag&4/* STATEFUL_COMPONENT */){// withProxy is a proxy with a different `has` trap only for
  119. // runtime-compiled render functions using `with` block.
  120. var proxyToUse=withProxy||proxy;result=normalizeVNode(render.call(proxyToUse,proxyToUse,renderCache,props,setupState,data,ctx));fallthroughAttrs=attrs;}else{// functional
  121. var _render=Component;// in dev, mark attrs accessed if optional props (attrs === props)
  122. if("production"!=='production'&&attrs===props);result=normalizeVNode(_render.length>1?_render(props,"production"!=='production'?{get attrs(){markAttrsAccessed();return attrs;},slots:slots,emit:emit}:{attrs:attrs,slots:slots,emit:emit}):_render(props,null/* we know it doesn't need it */));fallthroughAttrs=Component.props?attrs:getFunctionalFallthrough(attrs);}}catch(err){handleError(err,instance,1/* RENDER_FUNCTION */);result=createVNode(Comment);}// attr merging
  123. // in dev mode, comments are preserved, and it's possible for a template
  124. // to have comments along side the root element which makes it a fragment
  125. var root=result;if(fallthroughAttrs&&inheritAttrs!==false){var keys=Object.keys(fallthroughAttrs);var _root=root,shapeFlag=_root.shapeFlag;if(keys.length){if(shapeFlag&(1/* ELEMENT */|6/* COMPONENT */)){if(propsOptions&&keys.some(isModelListener)){// If a v-model listener (onUpdate:xxx) has a corresponding declared
  126. // prop, it indicates this component expects to handle v-model and
  127. // it should not fallthrough.
  128. // related: #1543, #1643, #1989
  129. fallthroughAttrs=filterModelListeners(fallthroughAttrs,propsOptions);}root=cloneVNode(root,fallthroughAttrs);}}}// inherit directives
  130. if(vnode.dirs){root.dirs=root.dirs?root.dirs.concat(vnode.dirs):vnode.dirs;}// inherit transition data
  131. if(vnode.transition){root.transition=vnode.transition;}{result=root;}setCurrentRenderingInstance(prev);return result;}var getFunctionalFallthrough=function getFunctionalFallthrough(attrs){var res;for(var key in attrs){if(key==='class'||key==='style'||isOn(key)){(res||(res={}))[key]=attrs[key];}}return res;};var filterModelListeners=function filterModelListeners(attrs,props){var res={};for(var key in attrs){if(!isModelListener(key)||!(key.slice(9)in props)){res[key]=attrs[key];}}return res;};function shouldUpdateComponent(prevVNode,nextVNode,optimized){var prevProps=prevVNode.props,prevChildren=prevVNode.children,component=prevVNode.component;var nextProps=nextVNode.props,nextChildren=nextVNode.children,patchFlag=nextVNode.patchFlag;var emits=component.emitsOptions;// force child update for runtime directive or transition on component vnode.
  132. if(nextVNode.dirs||nextVNode.transition){return true;}if(optimized&&patchFlag>=0){if(patchFlag&1024/* DYNAMIC_SLOTS */){// slot content that references values that might have changed,
  133. // e.g. in a v-for
  134. return true;}if(patchFlag&16/* FULL_PROPS */){if(!prevProps){return!!nextProps;}// presence of this flag indicates props are always non-null
  135. return hasPropsChanged(prevProps,nextProps,emits);}else if(patchFlag&8/* PROPS */){var dynamicProps=nextVNode.dynamicProps;for(var i=0;i<dynamicProps.length;i++){var key=dynamicProps[i];if(nextProps[key]!==prevProps[key]&&!isEmitListener(emits,key)){return true;}}}}else{// this path is only taken by manually written render functions
  136. // so presence of any children leads to a forced update
  137. if(prevChildren||nextChildren){if(!nextChildren||!nextChildren.$stable){return true;}}if(prevProps===nextProps){return false;}if(!prevProps){return!!nextProps;}if(!nextProps){return true;}return hasPropsChanged(prevProps,nextProps,emits);}return false;}function hasPropsChanged(prevProps,nextProps,emitsOptions){var nextKeys=Object.keys(nextProps);if(nextKeys.length!==Object.keys(prevProps).length){return true;}for(var i=0;i<nextKeys.length;i++){var key=nextKeys[i];if(nextProps[key]!==prevProps[key]&&!isEmitListener(emitsOptions,key)){return true;}}return false;}function updateHOCHostEl(_ref4,el// HostNode
  138. ){var vnode=_ref4.vnode,parent=_ref4.parent;while(parent&&parent.subTree===vnode){(vnode=parent.vnode).el=el;parent=parent.parent;}}var isSuspense=function isSuspense(type){return type.__isSuspense;};function queueEffectWithSuspense(fn,suspense){if(suspense&&suspense.pendingBranch){if(isArray(fn)){var _suspense$effects;(_suspense$effects=suspense.effects).push.apply(_suspense$effects,_toConsumableArray(fn));}else{suspense.effects.push(fn);}}else{queuePostFlushCb(fn);}}function provide(key,value){if(!currentInstance);else{var provides=currentInstance.provides;// by default an instance inherits its parent's provides object
  139. // but when it needs to provide values of its own, it creates its
  140. // own provides object using parent provides object as prototype.
  141. // this way in `inject` we can simply look up injections from direct
  142. // parent and let the prototype chain do the work.
  143. var parentProvides=currentInstance.parent&&currentInstance.parent.provides;if(parentProvides===provides){provides=currentInstance.provides=Object.create(parentProvides);}// TS doesn't allow symbol as index type
  144. provides[key]=value;}}function inject(key,defaultValue){var treatDefaultAsFactory=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;// fallback to `currentRenderingInstance` so that this can be called in
  145. // a functional component
  146. var instance=currentInstance||currentRenderingInstance;if(instance){// #2400
  147. // to support `app.use` plugins,
  148. // fallback to appContext's `provides` if the intance is at root
  149. var provides=instance.parent==null?instance.vnode.appContext&&instance.vnode.appContext.provides:instance.parent.provides;if(provides&&key in provides){// TS doesn't allow symbol as index type
  150. return provides[key];}else if(arguments.length>1){return treatDefaultAsFactory&&isFunction(defaultValue)?defaultValue.call(instance.proxy):defaultValue;}else;}}// implementation, close to no-op
  151. function defineComponent(options){return isFunction(options)?{setup:options,name:options.name}:options;}var isAsyncWrapper=function isAsyncWrapper(i){return!!i.type.__asyncLoader;};var isKeepAlive=function isKeepAlive(vnode){return vnode.type.__isKeepAlive;};function onActivated(hook,target){registerKeepAliveHook(hook,"a"/* ACTIVATED */,target);}function onDeactivated(hook,target){registerKeepAliveHook(hook,"da"/* DEACTIVATED */,target);}function registerKeepAliveHook(hook,type){var target=arguments.length>2&&arguments[2]!==undefined?arguments[2]:currentInstance;// cache the deactivate branch check wrapper for injected hooks so the same
  152. // hook can be properly deduped by the scheduler. "__wdc" stands for "with
  153. // deactivation check".
  154. var wrappedHook=hook.__wdc||(hook.__wdc=function(){// only fire the hook if the target instance is NOT in a deactivated branch.
  155. var current=target;while(current){if(current.isDeactivated){return;}current=current.parent;}return hook();});injectHook(type,wrappedHook,target);// In addition to registering it on the target instance, we walk up the parent
  156. // chain and register it on all ancestor instances that are keep-alive roots.
  157. // This avoids the need to walk the entire component tree when invoking these
  158. // hooks, and more importantly, avoids the need to track child components in
  159. // arrays.
  160. if(target){var current=target.parent;while(current&&current.parent){if(isKeepAlive(current.parent.vnode)){injectToKeepAliveRoot(wrappedHook,type,target,current);}current=current.parent;}}}function injectToKeepAliveRoot(hook,type,target,keepAliveRoot){// injectHook wraps the original for error handling, so make sure to remove
  161. // the wrapped version.
  162. var injected=injectHook(type,hook,keepAliveRoot,true/* prepend */);onUnmounted(function(){remove(keepAliveRoot[type],injected);},target);}function injectHook(type,hook){var target=arguments.length>2&&arguments[2]!==undefined?arguments[2]:currentInstance;var prepend=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(target){var hooks=target[type]||(target[type]=[]);// cache the error handling wrapper for injected hooks so the same hook
  163. // can be properly deduped by the scheduler. "__weh" stands for "with error
  164. // handling".
  165. var wrappedHook=hook.__weh||(hook.__weh=function(){if(target.isUnmounted){return;}// disable tracking inside all lifecycle hooks
  166. // since they can potentially be called inside effects.
  167. pauseTracking();// Set currentInstance during hook invocation.
  168. // This assumes the hook does not synchronously trigger other hooks, which
  169. // can only be false when the user does something really funky.
  170. setCurrentInstance(target);for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4];}var res=callWithAsyncErrorHandling(hook,target,type,args);unsetCurrentInstance();resetTracking();return res;});if(prepend){hooks.unshift(wrappedHook);}else{hooks.push(wrappedHook);}return wrappedHook;}}var createHook=function createHook(lifecycle){return function(hook){var target=arguments.length>1&&arguments[1]!==undefined?arguments[1]:currentInstance;return(// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  171. (!isInSSRComponentSetup||lifecycle==="sp"/* SERVER_PREFETCH */)&&injectHook(lifecycle,hook,target));};};var onBeforeMount=createHook("bm"/* BEFORE_MOUNT */);var onMounted=createHook("m"/* MOUNTED */);var onBeforeUpdate=createHook("bu"/* BEFORE_UPDATE */);var onUpdated=createHook("u"/* UPDATED */);var onBeforeUnmount=createHook("bum"/* BEFORE_UNMOUNT */);var onUnmounted=createHook("um"/* UNMOUNTED */);var onServerPrefetch=createHook("sp"/* SERVER_PREFETCH */);var onRenderTriggered=createHook("rtg"/* RENDER_TRIGGERED */);var onRenderTracked=createHook("rtc"/* RENDER_TRACKED */);function onErrorCaptured(hook){var target=arguments.length>1&&arguments[1]!==undefined?arguments[1]:currentInstance;injectHook("ec"/* ERROR_CAPTURED */,hook,target);}var shouldCacheAccess=true;function applyOptions(instance){var options=resolveMergedOptions(instance);var publicThis=instance.proxy;var ctx=instance.ctx;// do not cache property access on public proxy during state initialization
  172. shouldCacheAccess=false;// call beforeCreate first before accessing other options since
  173. // the hook may mutate resolved options (#2791)
  174. if(options.beforeCreate){callHook(options.beforeCreate,instance,"bc"/* BEFORE_CREATE */);}var dataOptions=options.data,computedOptions=options.computed,methods=options.methods,watchOptions=options.watch,provideOptions=options.provide,injectOptions=options.inject,created=options.created,beforeMount=options.beforeMount,mounted=options.mounted,beforeUpdate=options.beforeUpdate,updated=options.updated,activated=options.activated,deactivated=options.deactivated,beforeDestroy=options.beforeDestroy,beforeUnmount=options.beforeUnmount,destroyed=options.destroyed,unmounted=options.unmounted,render=options.render,renderTracked=options.renderTracked,renderTriggered=options.renderTriggered,errorCaptured=options.errorCaptured,serverPrefetch=options.serverPrefetch,expose=options.expose,inheritAttrs=options.inheritAttrs,components=options.components,directives=options.directives,filters=options.filters;var checkDuplicateProperties=null;// options initialization order (to be consistent with Vue 2):
  175. // - props (already done outside of this function)
  176. // - inject
  177. // - methods
  178. // - data (deferred since it relies on `this` access)
  179. // - computed
  180. // - watch (deferred since it relies on `this` access)
  181. if(injectOptions){resolveInjections(injectOptions,ctx,checkDuplicateProperties,instance.appContext.config.unwrapInjectedRef);}if(methods){for(var key in methods){var methodHandler=methods[key];if(isFunction(methodHandler)){// In dev mode, we use the `createRenderContext` function to define
  182. // methods to the proxy target, and those are read-only but
  183. // reconfigurable, so it needs to be redefined here
  184. {ctx[key]=methodHandler.bind(publicThis);}}}}if(dataOptions){var data=dataOptions.call(publicThis,publicThis);if(!isObject(data));else{instance.data=reactive(data);}}// state initialization complete at this point - start caching access
  185. shouldCacheAccess=true;if(computedOptions){var _loop=function _loop(_key5){var opt=computedOptions[_key5];var get=isFunction(opt)?opt.bind(publicThis,publicThis):isFunction(opt.get)?opt.get.bind(publicThis,publicThis):NOOP;var set=!isFunction(opt)&&isFunction(opt.set)?opt.set.bind(publicThis):NOOP;var c=computed({get:get,set:set});Object.defineProperty(ctx,_key5,{enumerable:true,configurable:true,get:function get(){return c.value;},set:function set(v){return c.value=v;}});};for(var _key5 in computedOptions){_loop(_key5);}}if(watchOptions){for(var _key6 in watchOptions){createWatcher(watchOptions[_key6],ctx,publicThis,_key6);}}if(provideOptions){var provides=isFunction(provideOptions)?provideOptions.call(publicThis):provideOptions;Reflect.ownKeys(provides).forEach(function(key){provide(key,provides[key]);});}if(created){callHook(created,instance,"c"/* CREATED */);}function registerLifecycleHook(register,hook){if(isArray(hook)){hook.forEach(function(_hook){return register(_hook.bind(publicThis));});}else if(hook){register(hook.bind(publicThis));}}registerLifecycleHook(onBeforeMount,beforeMount);registerLifecycleHook(onMounted,mounted);registerLifecycleHook(onBeforeUpdate,beforeUpdate);registerLifecycleHook(onUpdated,updated);registerLifecycleHook(onActivated,activated);registerLifecycleHook(onDeactivated,deactivated);registerLifecycleHook(onErrorCaptured,errorCaptured);registerLifecycleHook(onRenderTracked,renderTracked);registerLifecycleHook(onRenderTriggered,renderTriggered);registerLifecycleHook(onBeforeUnmount,beforeUnmount);registerLifecycleHook(onUnmounted,unmounted);registerLifecycleHook(onServerPrefetch,serverPrefetch);if(isArray(expose)){if(expose.length){var exposed=instance.exposed||(instance.exposed={});expose.forEach(function(key){Object.defineProperty(exposed,key,{get:function get(){return publicThis[key];},set:function set(val){return publicThis[key]=val;}});});}else if(!instance.exposed){instance.exposed={};}}// options that are handled when creating the instance but also need to be
  186. // applied from mixins
  187. if(render&&instance.render===NOOP){instance.render=render;}if(inheritAttrs!=null){instance.inheritAttrs=inheritAttrs;}// asset options.
  188. if(components)instance.components=components;if(directives)instance.directives=directives;}function resolveInjections(injectOptions,ctx){var checkDuplicateProperties=arguments.length>2&&arguments[2]!==undefined?arguments[2]:NOOP;var unwrapRef=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(isArray(injectOptions)){injectOptions=normalizeInject(injectOptions);}var _loop2=function _loop2(key){var opt=injectOptions[key];var injected=void 0;if(isObject(opt)){if('default'in opt){injected=inject(opt.from||key,opt.default,true/* treat default function as factory */);}else{injected=inject(opt.from||key);}}else{injected=inject(opt);}if(isRef(injected)){// TODO remove the check in 3.3
  189. if(unwrapRef){Object.defineProperty(ctx,key,{enumerable:true,configurable:true,get:function get(){return injected.value;},set:function set(v){return injected.value=v;}});}else{ctx[key]=injected;}}else{ctx[key]=injected;}};for(var key in injectOptions){_loop2(key);}}function callHook(hook,instance,type){callWithAsyncErrorHandling(isArray(hook)?hook.map(function(h){return h.bind(instance.proxy);}):hook.bind(instance.proxy),instance,type);}function createWatcher(raw,ctx,publicThis,key){var getter=key.includes('.')?createPathGetter(publicThis,key):function(){return publicThis[key];};if(isString(raw)){var handler=ctx[raw];if(isFunction(handler)){watch(getter,handler);}}else if(isFunction(raw)){watch(getter,raw.bind(publicThis));}else if(isObject(raw)){if(isArray(raw)){raw.forEach(function(r){return createWatcher(r,ctx,publicThis,key);});}else{var _handler=isFunction(raw.handler)?raw.handler.bind(publicThis):ctx[raw.handler];if(isFunction(_handler)){watch(getter,_handler,raw);}}}else;}/**
  190. * Resolve merged options and cache it on the component.
  191. * This is done only once per-component since the merging does not involve
  192. * instances.
  193. */function resolveMergedOptions(instance){var base=instance.type;var mixins=base.mixins,extendsOptions=base.extends;var _instance$appContext=instance.appContext,globalMixins=_instance$appContext.mixins,cache=_instance$appContext.optionsCache,optionMergeStrategies=_instance$appContext.config.optionMergeStrategies;var cached=cache.get(base);var resolved;if(cached){resolved=cached;}else if(!globalMixins.length&&!mixins&&!extendsOptions){{resolved=base;}}else{resolved={};if(globalMixins.length){globalMixins.forEach(function(m){return mergeOptions$1(resolved,m,optionMergeStrategies,true);});}mergeOptions$1(resolved,base,optionMergeStrategies);}cache.set(base,resolved);return resolved;}function mergeOptions$1(to,from,strats){var asMixin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var mixins=from.mixins,extendsOptions=from.extends;if(extendsOptions){mergeOptions$1(to,extendsOptions,strats,true);}if(mixins){mixins.forEach(function(m){return mergeOptions$1(to,m,strats,true);});}for(var key in from){if(asMixin&&key==='expose');else{var strat=internalOptionMergeStrats[key]||strats&&strats[key];to[key]=strat?strat(to[key],from[key]):from[key];}}return to;}var internalOptionMergeStrats={data:mergeDataFn,props:mergeObjectOptions,emits:mergeObjectOptions,// objects
  194. methods:mergeObjectOptions,computed:mergeObjectOptions,// lifecycle
  195. beforeCreate:mergeAsArray,created:mergeAsArray,beforeMount:mergeAsArray,mounted:mergeAsArray,beforeUpdate:mergeAsArray,updated:mergeAsArray,beforeDestroy:mergeAsArray,beforeUnmount:mergeAsArray,destroyed:mergeAsArray,unmounted:mergeAsArray,activated:mergeAsArray,deactivated:mergeAsArray,errorCaptured:mergeAsArray,serverPrefetch:mergeAsArray,// assets
  196. components:mergeObjectOptions,directives:mergeObjectOptions,// watch
  197. watch:mergeWatchOptions,// provide / inject
  198. provide:mergeDataFn,inject:mergeInject};function mergeDataFn(to,from){if(!from){return to;}if(!to){return from;}return function mergedDataFn(){return extend(isFunction(to)?to.call(this,this):to,isFunction(from)?from.call(this,this):from);};}function mergeInject(to,from){return mergeObjectOptions(normalizeInject(to),normalizeInject(from));}function normalizeInject(raw){if(isArray(raw)){var res={};for(var i=0;i<raw.length;i++){res[raw[i]]=raw[i];}return res;}return raw;}function mergeAsArray(to,from){return to?_toConsumableArray(new Set([].concat(to,from))):from;}function mergeObjectOptions(to,from){return to?extend(extend(Object.create(null),to),from):from;}function mergeWatchOptions(to,from){if(!to)return from;if(!from)return to;var merged=extend(Object.create(null),to);for(var key in from){merged[key]=mergeAsArray(to[key],from[key]);}return merged;}function initProps(instance,rawProps,isStateful){var isSSR=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var props={};var attrs={};def(attrs,InternalObjectKey,1);instance.propsDefaults=Object.create(null);setFullProps(instance,rawProps,props,attrs);// ensure all declared prop keys are present
  199. for(var key in instance.propsOptions[0]){if(!(key in props)){props[key]=undefined;}}if(isStateful){// stateful
  200. instance.props=isSSR?props:shallowReactive(props);}else{if(!instance.type.props){// functional w/ optional props, props === attrs
  201. instance.props=attrs;}else{// functional w/ declared props
  202. instance.props=props;}}instance.attrs=attrs;}function updateProps(instance,rawProps,rawPrevProps,optimized){var props=instance.props,attrs=instance.attrs,patchFlag=instance.vnode.patchFlag;var rawCurrentProps=toRaw(props);var _instance$propsOption2=_slicedToArray(instance.propsOptions,1),options=_instance$propsOption2[0];var hasAttrsChanged=false;if(// always force full diff in dev
  203. // - #1942 if hmr is enabled with sfc component
  204. // - vite#872 non-sfc component used by sfc component
  205. (optimized||patchFlag>0)&&!(patchFlag&16/* FULL_PROPS */)){if(patchFlag&8/* PROPS */){// Compiler-generated props & no keys change, just set the updated
  206. // the props.
  207. var propsToUpdate=instance.vnode.dynamicProps;for(var i=0;i<propsToUpdate.length;i++){var key=propsToUpdate[i];// PROPS flag guarantees rawProps to be non-null
  208. var value=rawProps[key];if(options){// attr / props separation was done on init and will be consistent
  209. // in this code path, so just check if attrs have it.
  210. if(hasOwn(attrs,key)){if(value!==attrs[key]){attrs[key]=value;hasAttrsChanged=true;}}else{var camelizedKey=camelize(key);props[camelizedKey]=resolvePropValue(options,rawCurrentProps,camelizedKey,value,instance,false/* isAbsent */);}}else{if(value!==attrs[key]){attrs[key]=value;hasAttrsChanged=true;}}}}}else{// full props update.
  211. if(setFullProps(instance,rawProps,props,attrs)){hasAttrsChanged=true;}// in case of dynamic props, check if we need to delete keys from
  212. // the props object
  213. var kebabKey;for(var _key7 in rawCurrentProps){if(!rawProps||// for camelCase
  214. !hasOwn(rawProps,_key7)&&(// it's possible the original props was passed in as kebab-case
  215. // and converted to camelCase (#955)
  216. (kebabKey=hyphenate(_key7))===_key7||!hasOwn(rawProps,kebabKey))){if(options){if(rawPrevProps&&(// for camelCase
  217. rawPrevProps[_key7]!==undefined||// for kebab-case
  218. rawPrevProps[kebabKey]!==undefined)){props[_key7]=resolvePropValue(options,rawCurrentProps,_key7,undefined,instance,true/* isAbsent */);}}else{delete props[_key7];}}}// in the case of functional component w/o props declaration, props and
  219. // attrs point to the same object so it should already have been updated.
  220. if(attrs!==rawCurrentProps){for(var _key8 in attrs){if(!rawProps||!hasOwn(rawProps,_key8)){delete attrs[_key8];hasAttrsChanged=true;}}}}// trigger updates for $attrs in case it's used in component slots
  221. if(hasAttrsChanged){trigger(instance,"set"/* SET */,'$attrs');}}function setFullProps(instance,rawProps,props,attrs){var _instance$propsOption3=_slicedToArray(instance.propsOptions,2),options=_instance$propsOption3[0],needCastKeys=_instance$propsOption3[1];var hasAttrsChanged=false;var rawCastValues;if(rawProps){for(var key in rawProps){// key, ref are reserved and never passed down
  222. if(isReservedProp(key)){continue;}var value=rawProps[key];// prop option names are camelized during normalization, so to support
  223. // kebab -> camel conversion here we need to camelize the key.
  224. var camelKey=void 0;if(options&&hasOwn(options,camelKey=camelize(key))){if(!needCastKeys||!needCastKeys.includes(camelKey)){props[camelKey]=value;}else{(rawCastValues||(rawCastValues={}))[camelKey]=value;}}else if(!isEmitListener(instance.emitsOptions,key)){if(!(key in attrs)||value!==attrs[key]){attrs[key]=value;hasAttrsChanged=true;}}}}if(needCastKeys){var rawCurrentProps=toRaw(props);var castValues=rawCastValues||EMPTY_OBJ;for(var i=0;i<needCastKeys.length;i++){var _key9=needCastKeys[i];props[_key9]=resolvePropValue(options,rawCurrentProps,_key9,castValues[_key9],instance,!hasOwn(castValues,_key9));}}return hasAttrsChanged;}function resolvePropValue(options,props,key,value,instance,isAbsent){var opt=options[key];if(opt!=null){var hasDefault=hasOwn(opt,'default');// default values
  225. if(hasDefault&&value===undefined){var defaultValue=opt.default;if(opt.type!==Function&&isFunction(defaultValue)){var propsDefaults=instance.propsDefaults;if(key in propsDefaults){value=propsDefaults[key];}else{setCurrentInstance(instance);value=propsDefaults[key]=defaultValue.call(null,props);unsetCurrentInstance();}}else{value=defaultValue;}}// boolean casting
  226. if(opt[0/* shouldCast */]){if(isAbsent&&!hasDefault){value=false;}else if(opt[1/* shouldCastTrue */]&&(value===''||value===hyphenate(key))){value=true;}}}return value;}function normalizePropsOptions(comp,appContext){var asMixin=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var cache=appContext.propsCache;var cached=cache.get(comp);if(cached){return cached;}var raw=comp.props;var normalized={};var needCastKeys=[];// apply mixin/extends props
  227. var hasExtends=false;if(!isFunction(comp)){var extendProps=function extendProps(raw){hasExtends=true;var _normalizePropsOption=normalizePropsOptions(raw,appContext,true),_normalizePropsOption2=_slicedToArray(_normalizePropsOption,2),props=_normalizePropsOption2[0],keys=_normalizePropsOption2[1];extend(normalized,props);if(keys)needCastKeys.push.apply(needCastKeys,_toConsumableArray(keys));};if(!asMixin&&appContext.mixins.length){appContext.mixins.forEach(extendProps);}if(comp.extends){extendProps(comp.extends);}if(comp.mixins){comp.mixins.forEach(extendProps);}}if(!raw&&!hasExtends){cache.set(comp,EMPTY_ARR);return EMPTY_ARR;}if(isArray(raw)){for(var i=0;i<raw.length;i++){var normalizedKey=camelize(raw[i]);if(validatePropName(normalizedKey)){normalized[normalizedKey]=EMPTY_OBJ;}}}else if(raw){for(var key in raw){var _normalizedKey=camelize(key);if(validatePropName(_normalizedKey)){var opt=raw[key];var prop=normalized[_normalizedKey]=isArray(opt)||isFunction(opt)?{type:opt}:opt;if(prop){var booleanIndex=getTypeIndex(Boolean,prop.type);var stringIndex=getTypeIndex(String,prop.type);prop[0/* shouldCast */]=booleanIndex>-1;prop[1/* shouldCastTrue */]=stringIndex<0||booleanIndex<stringIndex;// if the prop needs boolean casting or default value
  228. if(booleanIndex>-1||hasOwn(prop,'default')){needCastKeys.push(_normalizedKey);}}}}}var res=[normalized,needCastKeys];cache.set(comp,res);return res;}function validatePropName(key){if(key[0]!=='$'){return true;}return false;}// use function string name to check type constructors
  229. // so that it works across vms / iframes.
  230. function getType(ctor){var match=ctor&&ctor.toString().match(/^\s*function (\w+)/);return match?match[1]:ctor===null?'null':'';}function isSameType(a,b){return getType(a)===getType(b);}function getTypeIndex(type,expectedTypes){if(isArray(expectedTypes)){return expectedTypes.findIndex(function(t){return isSameType(t,type);});}else if(isFunction(expectedTypes)){return isSameType(expectedTypes,type)?0:-1;}return-1;}var isInternalKey=function isInternalKey(key){return key[0]==='_'||key==='$stable';};var normalizeSlotValue=function normalizeSlotValue(value){return isArray(value)?value.map(normalizeVNode):[normalizeVNode(value)];};var normalizeSlot$1=function normalizeSlot$1(key,rawSlot,ctx){var normalized=withCtx(function(){return normalizeSlotValue(rawSlot.apply(void 0,arguments));},ctx);normalized._c=false;return normalized;};var normalizeObjectSlots=function normalizeObjectSlots(rawSlots,slots,instance){var ctx=rawSlots._ctx;for(var key in rawSlots){if(isInternalKey(key))continue;var value=rawSlots[key];if(isFunction(value)){slots[key]=normalizeSlot$1(key,value,ctx);}else if(value!=null){(function(){var normalized=normalizeSlotValue(value);slots[key]=function(){return normalized;};})();}}};var normalizeVNodeSlots=function normalizeVNodeSlots(instance,children){var normalized=normalizeSlotValue(children);instance.slots.default=function(){return normalized;};};var initSlots=function initSlots(instance,children){if(instance.vnode.shapeFlag&32/* SLOTS_CHILDREN */){var type=children._;if(type){// users can get the shallow readonly version of the slots object through `this.$slots`,
  231. // we should avoid the proxy object polluting the slots of the internal instance
  232. instance.slots=toRaw(children);// make compiler marker non-enumerable
  233. def(children,'_',type);}else{normalizeObjectSlots(children,instance.slots={});}}else{instance.slots={};if(children){normalizeVNodeSlots(instance,children);}}def(instance.slots,InternalObjectKey,1);};var updateSlots=function updateSlots(instance,children,optimized){var vnode=instance.vnode,slots=instance.slots;var needDeletionCheck=true;var deletionComparisonTarget=EMPTY_OBJ;if(vnode.shapeFlag&32/* SLOTS_CHILDREN */){var type=children._;if(type){// compiled slots.
  234. if(optimized&&type===1/* STABLE */){// compiled AND stable.
  235. // no need to update, and skip stale slots removal.
  236. needDeletionCheck=false;}else{// compiled but dynamic (v-if/v-for on slots) - update slots, but skip
  237. // normalization.
  238. extend(slots,children);// #2893
  239. // when rendering the optimized slots by manually written render function,
  240. // we need to delete the `slots._` flag if necessary to make subsequent updates reliable,
  241. // i.e. let the `renderSlot` create the bailed Fragment
  242. if(!optimized&&type===1/* STABLE */){delete slots._;}}}else{needDeletionCheck=!children.$stable;normalizeObjectSlots(children,slots);}deletionComparisonTarget=children;}else if(children){// non slot object children (direct value) passed to a component
  243. normalizeVNodeSlots(instance,children);deletionComparisonTarget={default:1};}// delete stale slots
  244. if(needDeletionCheck){for(var key in slots){if(!isInternalKey(key)&&!(key in deletionComparisonTarget)){delete slots[key];}}}};function invokeDirectiveHook(vnode,prevVNode,instance,name){var bindings=vnode.dirs;var oldBindings=prevVNode&&prevVNode.dirs;for(var i=0;i<bindings.length;i++){var binding=bindings[i];if(oldBindings){binding.oldValue=oldBindings[i].value;}var hook=binding.dir[name];if(hook){// disable tracking inside all lifecycle hooks
  245. // since they can potentially be called inside effects.
  246. pauseTracking();callWithAsyncErrorHandling(hook,instance,8/* DIRECTIVE_HOOK */,[vnode.el,binding,vnode,prevVNode]);resetTracking();}}}function createAppContext(){return{app:null,config:{isNativeTag:NO,performance:false,globalProperties:{},optionMergeStrategies:{},errorHandler:undefined,warnHandler:undefined,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap(),propsCache:new WeakMap(),emitsCache:new WeakMap()};}var uid=0;function createAppAPI(render,hydrate){return function createApp(rootComponent){var rootProps=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(rootProps!=null&&!isObject(rootProps)){rootProps=null;}var context=createAppContext();var installedPlugins=new Set();var isMounted=false;var app=context.app={_uid:uid++,_component:rootComponent,_props:rootProps,_container:null,_context:context,_instance:null,version:version,get config(){return context.config;},set config(v){},use:function use(plugin){for(var _len5=arguments.length,options=new Array(_len5>1?_len5-1:0),_key10=1;_key10<_len5;_key10++){options[_key10-1]=arguments[_key10];}if(installedPlugins.has(plugin));else if(plugin&&isFunction(plugin.install)){installedPlugins.add(plugin);plugin.install.apply(plugin,[app].concat(options));}else if(isFunction(plugin)){installedPlugins.add(plugin);plugin.apply(void 0,[app].concat(options));}else;return app;},mixin:function mixin(_mixin){{if(!context.mixins.includes(_mixin)){context.mixins.push(_mixin);}}return app;},component:function component(name,_component){if(!_component){return context.components[name];}context.components[name]=_component;return app;},directive:function directive(name,_directive){if(!_directive){return context.directives[name];}context.directives[name]=_directive;return app;},mount:function mount(rootContainer,isHydrate,isSVG){if(!isMounted){var vnode=createVNode(rootComponent,rootProps);// store app context on the root VNode.
  247. // this will be set on the root instance on initial mount.
  248. vnode.appContext=context;if(isHydrate&&hydrate){hydrate(vnode,rootContainer);}else{render(vnode,rootContainer,isSVG);}isMounted=true;app._container=rootContainer;rootContainer.__vue_app__=app;return getExposeProxy(vnode.component)||vnode.component.proxy;}},unmount:function unmount(){if(isMounted){render(null,app._container);delete app._container.__vue_app__;}},provide:function provide(key,value){// TypeScript doesn't allow symbols as index type
  249. // https://github.com/Microsoft/TypeScript/issues/24587
  250. context.provides[key]=value;return app;}};return app;};}/**
  251. * Function for handling a template ref
  252. */function setRef(rawRef,oldRawRef,parentSuspense,vnode){var isUnmount=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;if(isArray(rawRef)){rawRef.forEach(function(r,i){return setRef(r,oldRawRef&&(isArray(oldRawRef)?oldRawRef[i]:oldRawRef),parentSuspense,vnode,isUnmount);});return;}if(isAsyncWrapper(vnode)&&!isUnmount){// when mounting async components, nothing needs to be done,
  253. // because the template ref is forwarded to inner component
  254. return;}var refValue=vnode.shapeFlag&4/* STATEFUL_COMPONENT */?getExposeProxy(vnode.component)||vnode.component.proxy:vnode.el;var value=isUnmount?null:refValue;var owner=rawRef.i,ref=rawRef.r;var oldRef=oldRawRef&&oldRawRef.r;var refs=owner.refs===EMPTY_OBJ?owner.refs={}:owner.refs;var setupState=owner.setupState;// dynamic ref changed. unset old ref
  255. if(oldRef!=null&&oldRef!==ref){if(isString(oldRef)){refs[oldRef]=null;if(hasOwn(setupState,oldRef)){setupState[oldRef]=null;}}else if(isRef(oldRef)){oldRef.value=null;}}if(isFunction(ref)){callWithErrorHandling(ref,owner,12/* FUNCTION_REF */,[value,refs]);}else{var _isString=isString(ref);var _isRef=isRef(ref);if(_isString||_isRef){var doSet=function doSet(){if(rawRef.f){var existing=_isString?refs[ref]:ref.value;if(isUnmount){isArray(existing)&&remove(existing,refValue);}else{if(!isArray(existing)){if(_isString){refs[ref]=[refValue];}else{ref.value=[refValue];if(rawRef.k)refs[rawRef.k]=ref.value;}}else if(!existing.includes(refValue)){existing.push(refValue);}}}else if(_isString){refs[ref]=value;if(hasOwn(setupState,ref)){setupState[ref]=value;}}else if(isRef(ref)){ref.value=value;if(rawRef.k)refs[rawRef.k]=value;}else;};if(value){doSet.id=-1;queuePostRenderEffect(doSet,parentSuspense);}else{doSet();}}}}var queuePostRenderEffect=queueEffectWithSuspense;/**
  256. * The createRenderer function accepts two generic arguments:
  257. * HostNode and HostElement, corresponding to Node and Element types in the
  258. * host environment. For example, for runtime-dom, HostNode would be the DOM
  259. * `Node` interface and HostElement would be the DOM `Element` interface.
  260. *
  261. * Custom renderers can pass in the platform specific types like this:
  262. *
  263. * ``` js
  264. * const { render, createApp } = createRenderer<Node, Element>({
  265. * patchProp,
  266. * ...nodeOps
  267. * })
  268. * ```
  269. */function createRenderer(options){return baseCreateRenderer(options);}// implementation
  270. function baseCreateRenderer(options,createHydrationFns){var target=getGlobalThis();target.__VUE__=true;var hostInsert=options.insert,hostRemove=options.remove,hostPatchProp=options.patchProp,hostCreateElement=options.createElement,hostCreateText=options.createText,hostCreateComment=options.createComment,hostSetText=options.setText,hostSetElementText=options.setElementText,hostParentNode=options.parentNode,hostNextSibling=options.nextSibling,_options$setScopeId=options.setScopeId,hostSetScopeId=_options$setScopeId===void 0?NOOP:_options$setScopeId,hostCloneNode=options.cloneNode,hostInsertStaticContent=options.insertStaticContent;// Note: functions inside this closure should use `const xxx = () => {}`
  271. // style in order to prevent being inlined by minifiers.
  272. var patch=function patch(n1,n2,container){var anchor=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var parentComponent=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var parentSuspense=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var isSVG=arguments.length>6&&arguments[6]!==undefined?arguments[6]:false;var slotScopeIds=arguments.length>7&&arguments[7]!==undefined?arguments[7]:null;var optimized=arguments.length>8&&arguments[8]!==undefined?arguments[8]:!!n2.dynamicChildren;if(n1===n2){return;}// patching & not same type, unmount old tree
  273. if(n1&&!isSameVNodeType(n1,n2)){anchor=getNextHostNode(n1);unmount(n1,parentComponent,parentSuspense,true);n1=null;}if(n2.patchFlag===-2/* BAIL */){optimized=false;n2.dynamicChildren=null;}var type=n2.type,ref=n2.ref,shapeFlag=n2.shapeFlag;switch(type){case Text:processText(n1,n2,container,anchor);break;case Comment:processCommentNode(n1,n2,container,anchor);break;case Static:if(n1==null){mountStaticNode(n2,container,anchor,isSVG);}break;case Fragment:processFragment(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);break;default:if(shapeFlag&1/* ELEMENT */){processElement(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}else if(shapeFlag&6/* COMPONENT */){processComponent(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}else if(shapeFlag&64/* TELEPORT */){type.process(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized,internals);}else if(shapeFlag&128/* SUSPENSE */){type.process(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized,internals);}else;}// set ref
  274. if(ref!=null&&parentComponent){setRef(ref,n1&&n1.ref,parentSuspense,n2||n1,!n2);}};var processText=function processText(n1,n2,container,anchor){if(n1==null){hostInsert(n2.el=hostCreateText(n2.children),container,anchor);}else{var el=n2.el=n1.el;if(n2.children!==n1.children){hostSetText(el,n2.children);}}};var processCommentNode=function processCommentNode(n1,n2,container,anchor){if(n1==null){hostInsert(n2.el=hostCreateComment(n2.children||''),container,anchor);}else{// there's no support for dynamic comments
  275. n2.el=n1.el;}};var mountStaticNode=function mountStaticNode(n2,container,anchor,isSVG){var _hostInsertStaticCont=hostInsertStaticContent(n2.children,container,anchor,isSVG);var _hostInsertStaticCont2=_slicedToArray(_hostInsertStaticCont,2);n2.el=_hostInsertStaticCont2[0];n2.anchor=_hostInsertStaticCont2[1];};var moveStaticNode=function moveStaticNode(_ref5,container,nextSibling){var el=_ref5.el,anchor=_ref5.anchor;var next;while(el&&el!==anchor){next=hostNextSibling(el);hostInsert(el,container,nextSibling);el=next;}hostInsert(anchor,container,nextSibling);};var removeStaticNode=function removeStaticNode(_ref6){var el=_ref6.el,anchor=_ref6.anchor;var next;while(el&&el!==anchor){next=hostNextSibling(el);hostRemove(el);el=next;}hostRemove(anchor);};var processElement=function processElement(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized){isSVG=isSVG||n2.type==='svg';if(n1==null){mountElement(n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}else{patchElement(n1,n2,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}};var mountElement=function mountElement(vnode,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized){var el;var vnodeHook;var type=vnode.type,props=vnode.props,shapeFlag=vnode.shapeFlag,transition=vnode.transition,patchFlag=vnode.patchFlag,dirs=vnode.dirs;if(vnode.el&&hostCloneNode!==undefined&&patchFlag===-1/* HOISTED */){// If a vnode has non-null el, it means it's being reused.
  276. // Only static vnodes can be reused, so its mounted DOM nodes should be
  277. // exactly the same, and we can simply do a clone here.
  278. // only do this in production since cloned trees cannot be HMR updated.
  279. el=vnode.el=hostCloneNode(vnode.el);}else{el=vnode.el=hostCreateElement(vnode.type,isSVG,props&&props.is,props);// mount children first, since some props may rely on child content
  280. // being already rendered, e.g. `<select value>`
  281. if(shapeFlag&8/* TEXT_CHILDREN */){hostSetElementText(el,vnode.children);}else if(shapeFlag&16/* ARRAY_CHILDREN */){mountChildren(vnode.children,el,null,parentComponent,parentSuspense,isSVG&&type!=='foreignObject',slotScopeIds,optimized);}if(dirs){invokeDirectiveHook(vnode,null,parentComponent,'created');}// props
  282. if(props){for(var key in props){if(key!=='value'&&!isReservedProp(key)){hostPatchProp(el,key,null,props[key],isSVG,vnode.children,parentComponent,parentSuspense,unmountChildren);}}/**
  283. * Special case for setting value on DOM elements:
  284. * - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
  285. * - it needs to be forced (#1471)
  286. * #2353 proposes adding another renderer option to configure this, but
  287. * the properties affects are so finite it is worth special casing it
  288. * here to reduce the complexity. (Special casing it also should not
  289. * affect non-DOM renderers)
  290. */if('value'in props){hostPatchProp(el,'value',null,props.value);}if(vnodeHook=props.onVnodeBeforeMount){invokeVNodeHook(vnodeHook,parentComponent,vnode);}}// scopeId
  291. setScopeId(el,vnode,vnode.scopeId,slotScopeIds,parentComponent);}if(dirs){invokeDirectiveHook(vnode,null,parentComponent,'beforeMount');}// #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved
  292. // #1689 For inside suspense + suspense resolved case, just call it
  293. var needCallTransitionHooks=(!parentSuspense||parentSuspense&&!parentSuspense.pendingBranch)&&transition&&!transition.persisted;if(needCallTransitionHooks){transition.beforeEnter(el);}hostInsert(el,container,anchor);if((vnodeHook=props&&props.onVnodeMounted)||needCallTransitionHooks||dirs){queuePostRenderEffect(function(){vnodeHook&&invokeVNodeHook(vnodeHook,parentComponent,vnode);needCallTransitionHooks&&transition.enter(el);dirs&&invokeDirectiveHook(vnode,null,parentComponent,'mounted');},parentSuspense);}};var setScopeId=function setScopeId(el,vnode,scopeId,slotScopeIds,parentComponent){if(scopeId){hostSetScopeId(el,scopeId);}if(slotScopeIds){for(var i=0;i<slotScopeIds.length;i++){hostSetScopeId(el,slotScopeIds[i]);}}if(parentComponent){var subTree=parentComponent.subTree;if(vnode===subTree){var parentVNode=parentComponent.vnode;setScopeId(el,parentVNode,parentVNode.scopeId,parentVNode.slotScopeIds,parentComponent.parent);}}};var mountChildren=function mountChildren(children,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized){var start=arguments.length>8&&arguments[8]!==undefined?arguments[8]:0;for(var i=start;i<children.length;i++){var child=children[i]=optimized?cloneIfMounted(children[i]):normalizeVNode(children[i]);patch(null,child,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}};var patchElement=function patchElement(n1,n2,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized){var el=n2.el=n1.el;var patchFlag=n2.patchFlag,dynamicChildren=n2.dynamicChildren,dirs=n2.dirs;// #1426 take the old vnode's patch flag into account since user may clone a
  294. // compiler-generated vnode, which de-opts to FULL_PROPS
  295. patchFlag|=n1.patchFlag&16/* FULL_PROPS */;var oldProps=n1.props||EMPTY_OBJ;var newProps=n2.props||EMPTY_OBJ;var vnodeHook;// disable recurse in beforeUpdate hooks
  296. parentComponent&&toggleRecurse(parentComponent,false);if(vnodeHook=newProps.onVnodeBeforeUpdate){invokeVNodeHook(vnodeHook,parentComponent,n2,n1);}if(dirs){invokeDirectiveHook(n2,n1,parentComponent,'beforeUpdate');}parentComponent&&toggleRecurse(parentComponent,true);var areChildrenSVG=isSVG&&n2.type!=='foreignObject';if(dynamicChildren){patchBlockChildren(n1.dynamicChildren,dynamicChildren,el,parentComponent,parentSuspense,areChildrenSVG,slotScopeIds);}else if(!optimized){// full diff
  297. patchChildren(n1,n2,el,null,parentComponent,parentSuspense,areChildrenSVG,slotScopeIds,false);}if(patchFlag>0){// the presence of a patchFlag means this element's render code was
  298. // generated by the compiler and can take the fast path.
  299. // in this path old node and new node are guaranteed to have the same shape
  300. // (i.e. at the exact same position in the source template)
  301. if(patchFlag&16/* FULL_PROPS */){// element props contain dynamic keys, full diff needed
  302. patchProps(el,n2,oldProps,newProps,parentComponent,parentSuspense,isSVG);}else{// class
  303. // this flag is matched when the element has dynamic class bindings.
  304. if(patchFlag&2/* CLASS */){if(oldProps.class!==newProps.class){hostPatchProp(el,'class',null,newProps.class,isSVG);}}// style
  305. // this flag is matched when the element has dynamic style bindings
  306. if(patchFlag&4/* STYLE */){hostPatchProp(el,'style',oldProps.style,newProps.style,isSVG);}// props
  307. // This flag is matched when the element has dynamic prop/attr bindings
  308. // other than class and style. The keys of dynamic prop/attrs are saved for
  309. // faster iteration.
  310. // Note dynamic keys like :[foo]="bar" will cause this optimization to
  311. // bail out and go through a full diff because we need to unset the old key
  312. if(patchFlag&8/* PROPS */){// if the flag is present then dynamicProps must be non-null
  313. var propsToUpdate=n2.dynamicProps;for(var i=0;i<propsToUpdate.length;i++){var key=propsToUpdate[i];var prev=oldProps[key];var next=newProps[key];// #1471 force patch value
  314. if(next!==prev||key==='value'){hostPatchProp(el,key,prev,next,isSVG,n1.children,parentComponent,parentSuspense,unmountChildren);}}}}// text
  315. // This flag is matched when the element has only dynamic text children.
  316. if(patchFlag&1/* TEXT */){if(n1.children!==n2.children){hostSetElementText(el,n2.children);}}}else if(!optimized&&dynamicChildren==null){// unoptimized, full diff
  317. patchProps(el,n2,oldProps,newProps,parentComponent,parentSuspense,isSVG);}if((vnodeHook=newProps.onVnodeUpdated)||dirs){queuePostRenderEffect(function(){vnodeHook&&invokeVNodeHook(vnodeHook,parentComponent,n2,n1);dirs&&invokeDirectiveHook(n2,n1,parentComponent,'updated');},parentSuspense);}};// The fast path for blocks.
  318. var patchBlockChildren=function patchBlockChildren(oldChildren,newChildren,fallbackContainer,parentComponent,parentSuspense,isSVG,slotScopeIds){for(var i=0;i<newChildren.length;i++){var oldVNode=oldChildren[i];var newVNode=newChildren[i];// Determine the container (parent element) for the patch.
  319. var container=// oldVNode may be an errored async setup() component inside Suspense
  320. // which will not have a mounted element
  321. oldVNode.el&&(// - In the case of a Fragment, we need to provide the actual parent
  322. // of the Fragment itself so it can move its children.
  323. oldVNode.type===Fragment||// - In the case of different nodes, there is going to be a replacement
  324. // which also requires the correct parent container
  325. !isSameVNodeType(oldVNode,newVNode)||// - In the case of a component, it could contain anything.
  326. oldVNode.shapeFlag&(6/* COMPONENT */|64/* TELEPORT */))?hostParentNode(oldVNode.el):// In other cases, the parent container is not actually used so we
  327. // just pass the block element here to avoid a DOM parentNode call.
  328. fallbackContainer;patch(oldVNode,newVNode,container,null,parentComponent,parentSuspense,isSVG,slotScopeIds,true);}};var patchProps=function patchProps(el,vnode,oldProps,newProps,parentComponent,parentSuspense,isSVG){if(oldProps!==newProps){for(var key in newProps){// empty string is not valid prop
  329. if(isReservedProp(key))continue;var next=newProps[key];var prev=oldProps[key];// defer patching value
  330. if(next!==prev&&key!=='value'){hostPatchProp(el,key,prev,next,isSVG,vnode.children,parentComponent,parentSuspense,unmountChildren);}}if(oldProps!==EMPTY_OBJ){for(var _key11 in oldProps){if(!isReservedProp(_key11)&&!(_key11 in newProps)){hostPatchProp(el,_key11,oldProps[_key11],null,isSVG,vnode.children,parentComponent,parentSuspense,unmountChildren);}}}if('value'in newProps){hostPatchProp(el,'value',oldProps.value,newProps.value);}}};var processFragment=function processFragment(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized){var fragmentStartAnchor=n2.el=n1?n1.el:hostCreateText('');var fragmentEndAnchor=n2.anchor=n1?n1.anchor:hostCreateText('');var patchFlag=n2.patchFlag,dynamicChildren=n2.dynamicChildren,fragmentSlotScopeIds=n2.slotScopeIds;// check if this is a slot fragment with :slotted scope ids
  331. if(fragmentSlotScopeIds){slotScopeIds=slotScopeIds?slotScopeIds.concat(fragmentSlotScopeIds):fragmentSlotScopeIds;}if(n1==null){hostInsert(fragmentStartAnchor,container,anchor);hostInsert(fragmentEndAnchor,container,anchor);// a fragment can only have array children
  332. // since they are either generated by the compiler, or implicitly created
  333. // from arrays.
  334. mountChildren(n2.children,container,fragmentEndAnchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}else{if(patchFlag>0&&patchFlag&64/* STABLE_FRAGMENT */&&dynamicChildren&&// #2715 the previous fragment could've been a BAILed one as a result
  335. // of renderSlot() with no valid children
  336. n1.dynamicChildren){// a stable fragment (template root or <template v-for>) doesn't need to
  337. // patch children order, but it may contain dynamicChildren.
  338. patchBlockChildren(n1.dynamicChildren,dynamicChildren,container,parentComponent,parentSuspense,isSVG,slotScopeIds);if(// #2080 if the stable fragment has a key, it's a <template v-for> that may
  339. // get moved around. Make sure all root level vnodes inherit el.
  340. // #2134 or if it's a component root, it may also get moved around
  341. // as the component is being moved.
  342. n2.key!=null||parentComponent&&n2===parentComponent.subTree){traverseStaticChildren(n1,n2,true/* shallow */);}}else{// keyed / unkeyed, or manual fragments.
  343. // for keyed & unkeyed, since they are compiler generated from v-for,
  344. // each child is guaranteed to be a block so the fragment will never
  345. // have dynamicChildren.
  346. patchChildren(n1,n2,container,fragmentEndAnchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}}};var processComponent=function processComponent(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized){n2.slotScopeIds=slotScopeIds;if(n1==null){if(n2.shapeFlag&512/* COMPONENT_KEPT_ALIVE */){parentComponent.ctx.activate(n2,container,anchor,isSVG,optimized);}else{mountComponent(n2,container,anchor,parentComponent,parentSuspense,isSVG,optimized);}}else{updateComponent(n1,n2,optimized);}};var mountComponent=function mountComponent(initialVNode,container,anchor,parentComponent,parentSuspense,isSVG,optimized){var instance=initialVNode.component=createComponentInstance(initialVNode,parentComponent,parentSuspense);// inject renderer internals for keepAlive
  347. if(isKeepAlive(initialVNode)){instance.ctx.renderer=internals;}// resolve props and slots for setup context
  348. {setupComponent(instance);}// setup() is async. This component relies on async logic to be resolved
  349. // before proceeding
  350. if(instance.asyncDep){parentSuspense&&parentSuspense.registerDep(instance,setupRenderEffect);// Give it a placeholder if this is not hydration
  351. // TODO handle self-defined fallback
  352. if(!initialVNode.el){var placeholder=instance.subTree=createVNode(Comment);processCommentNode(null,placeholder,container,anchor);}return;}setupRenderEffect(instance,initialVNode,container,anchor,parentSuspense,isSVG,optimized);};var updateComponent=function updateComponent(n1,n2,optimized){var instance=n2.component=n1.component;if(shouldUpdateComponent(n1,n2,optimized)){if(instance.asyncDep&&!instance.asyncResolved){updateComponentPreRender(instance,n2,optimized);return;}else{// normal update
  353. instance.next=n2;// in case the child component is also queued, remove it to avoid
  354. // double updating the same child component in the same flush.
  355. invalidateJob(instance.update);// instance.update is the reactive effect.
  356. instance.update();}}else{// no update needed. just copy over properties
  357. n2.component=n1.component;n2.el=n1.el;instance.vnode=n2;}};var setupRenderEffect=function setupRenderEffect(instance,initialVNode,container,anchor,parentSuspense,isSVG,optimized){var componentUpdateFn=function componentUpdateFn(){if(!instance.isMounted){var vnodeHook;var _initialVNode=initialVNode,el=_initialVNode.el,props=_initialVNode.props;var bm=instance.bm,m=instance.m,parent=instance.parent;var isAsyncWrapperVNode=isAsyncWrapper(initialVNode);toggleRecurse(instance,false);// beforeMount hook
  358. if(bm){invokeArrayFns(bm);}// onVnodeBeforeMount
  359. if(!isAsyncWrapperVNode&&(vnodeHook=props&&props.onVnodeBeforeMount)){invokeVNodeHook(vnodeHook,parent,initialVNode);}toggleRecurse(instance,true);if(el&&hydrateNode){// vnode has adopted host node - perform hydration instead of mount.
  360. var hydrateSubTree=function hydrateSubTree(){instance.subTree=renderComponentRoot(instance);hydrateNode(el,instance.subTree,instance,parentSuspense,null);};if(isAsyncWrapperVNode){initialVNode.type.__asyncLoader().then(// note: we are moving the render call into an async callback,
  361. // which means it won't track dependencies - but it's ok because
  362. // a server-rendered async wrapper is already in resolved state
  363. // and it will never need to change.
  364. function(){return!instance.isUnmounted&&hydrateSubTree();});}else{hydrateSubTree();}}else{var subTree=instance.subTree=renderComponentRoot(instance);patch(null,subTree,container,anchor,instance,parentSuspense,isSVG);initialVNode.el=subTree.el;}// mounted hook
  365. if(m){queuePostRenderEffect(m,parentSuspense);}// onVnodeMounted
  366. if(!isAsyncWrapperVNode&&(vnodeHook=props&&props.onVnodeMounted)){var scopedInitialVNode=initialVNode;queuePostRenderEffect(function(){return invokeVNodeHook(vnodeHook,parent,scopedInitialVNode);},parentSuspense);}// activated hook for keep-alive roots.
  367. // #1742 activated hook must be accessed after first render
  368. // since the hook may be injected by a child keep-alive
  369. if(initialVNode.shapeFlag&256/* COMPONENT_SHOULD_KEEP_ALIVE */){instance.a&&queuePostRenderEffect(instance.a,parentSuspense);}instance.isMounted=true;// #2458: deference mount-only object parameters to prevent memleaks
  370. initialVNode=container=anchor=null;}else{// updateComponent
  371. // This is triggered by mutation of component's own state (next: null)
  372. // OR parent calling processComponent (next: VNode)
  373. var next=instance.next,bu=instance.bu,u=instance.u,_parent=instance.parent,vnode=instance.vnode;var originNext=next;var _vnodeHook;// Disallow component effect recursion during pre-lifecycle hooks.
  374. toggleRecurse(instance,false);if(next){next.el=vnode.el;updateComponentPreRender(instance,next,optimized);}else{next=vnode;}// beforeUpdate hook
  375. if(bu){invokeArrayFns(bu);}// onVnodeBeforeUpdate
  376. if(_vnodeHook=next.props&&next.props.onVnodeBeforeUpdate){invokeVNodeHook(_vnodeHook,_parent,next,vnode);}toggleRecurse(instance,true);var nextTree=renderComponentRoot(instance);var prevTree=instance.subTree;instance.subTree=nextTree;patch(prevTree,nextTree,// parent may have changed if it's in a teleport
  377. hostParentNode(prevTree.el),// anchor may have changed if it's in a fragment
  378. getNextHostNode(prevTree),instance,parentSuspense,isSVG);next.el=nextTree.el;if(originNext===null){// self-triggered update. In case of HOC, update parent component
  379. // vnode el. HOC is indicated by parent instance's subTree pointing
  380. // to child component's vnode
  381. updateHOCHostEl(instance,nextTree.el);}// updated hook
  382. if(u){queuePostRenderEffect(u,parentSuspense);}// onVnodeUpdated
  383. if(_vnodeHook=next.props&&next.props.onVnodeUpdated){queuePostRenderEffect(function(){return invokeVNodeHook(_vnodeHook,_parent,next,vnode);},parentSuspense);}}};// create reactive effect for rendering
  384. var effect=instance.effect=new ReactiveEffect(componentUpdateFn,function(){return queueJob(instance.update);},instance.scope// track it in component's effect scope
  385. );var update=instance.update=effect.run.bind(effect);update.id=instance.uid;// allowRecurse
  386. // #1801, #2043 component render effects should allow recursive updates
  387. toggleRecurse(instance,true);update();};var updateComponentPreRender=function updateComponentPreRender(instance,nextVNode,optimized){nextVNode.component=instance;var prevProps=instance.vnode.props;instance.vnode=nextVNode;instance.next=null;updateProps(instance,nextVNode.props,prevProps,optimized);updateSlots(instance,nextVNode.children,optimized);pauseTracking();// props update may have triggered pre-flush watchers.
  388. // flush them before the render update.
  389. flushPreFlushCbs(undefined,instance.update);resetTracking();};var patchChildren=function patchChildren(n1,n2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds){var optimized=arguments.length>8&&arguments[8]!==undefined?arguments[8]:false;var c1=n1&&n1.children;var prevShapeFlag=n1?n1.shapeFlag:0;var c2=n2.children;var patchFlag=n2.patchFlag,shapeFlag=n2.shapeFlag;// fast path
  390. if(patchFlag>0){if(patchFlag&128/* KEYED_FRAGMENT */){// this could be either fully-keyed or mixed (some keyed some not)
  391. // presence of patchFlag means children are guaranteed to be arrays
  392. patchKeyedChildren(c1,c2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);return;}else if(patchFlag&256/* UNKEYED_FRAGMENT */){// unkeyed
  393. patchUnkeyedChildren(c1,c2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);return;}}// children has 3 possibilities: text, array or no children.
  394. if(shapeFlag&8/* TEXT_CHILDREN */){// text children fast path
  395. if(prevShapeFlag&16/* ARRAY_CHILDREN */){unmountChildren(c1,parentComponent,parentSuspense);}if(c2!==c1){hostSetElementText(container,c2);}}else{if(prevShapeFlag&16/* ARRAY_CHILDREN */){// prev children was array
  396. if(shapeFlag&16/* ARRAY_CHILDREN */){// two arrays, cannot assume anything, do full diff
  397. patchKeyedChildren(c1,c2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}else{// no new children, just unmount old
  398. unmountChildren(c1,parentComponent,parentSuspense,true);}}else{// prev children was text OR null
  399. // new children is array OR null
  400. if(prevShapeFlag&8/* TEXT_CHILDREN */){hostSetElementText(container,'');}// mount new if array
  401. if(shapeFlag&16/* ARRAY_CHILDREN */){mountChildren(c2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}}}};var patchUnkeyedChildren=function patchUnkeyedChildren(c1,c2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized){c1=c1||EMPTY_ARR;c2=c2||EMPTY_ARR;var oldLength=c1.length;var newLength=c2.length;var commonLength=Math.min(oldLength,newLength);var i;for(i=0;i<commonLength;i++){var nextChild=c2[i]=optimized?cloneIfMounted(c2[i]):normalizeVNode(c2[i]);patch(c1[i],nextChild,container,null,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}if(oldLength>newLength){// remove old
  402. unmountChildren(c1,parentComponent,parentSuspense,true,false,commonLength);}else{// mount new
  403. mountChildren(c2,container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized,commonLength);}};// can be all-keyed or mixed
  404. var patchKeyedChildren=function patchKeyedChildren(c1,c2,container,parentAnchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized){var i=0;var l2=c2.length;var e1=c1.length-1;// prev ending index
  405. var e2=l2-1;// next ending index
  406. // 1. sync from start
  407. // (a b) c
  408. // (a b) d e
  409. while(i<=e1&&i<=e2){var n1=c1[i];var n2=c2[i]=optimized?cloneIfMounted(c2[i]):normalizeVNode(c2[i]);if(isSameVNodeType(n1,n2)){patch(n1,n2,container,null,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}else{break;}i++;}// 2. sync from end
  410. // a (b c)
  411. // d e (b c)
  412. while(i<=e1&&i<=e2){var _n2=c1[e1];var _n3=c2[e2]=optimized?cloneIfMounted(c2[e2]):normalizeVNode(c2[e2]);if(isSameVNodeType(_n2,_n3)){patch(_n2,_n3,container,null,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}else{break;}e1--;e2--;}// 3. common sequence + mount
  413. // (a b)
  414. // (a b) c
  415. // i = 2, e1 = 1, e2 = 2
  416. // (a b)
  417. // c (a b)
  418. // i = 0, e1 = -1, e2 = 0
  419. if(i>e1){if(i<=e2){var nextPos=e2+1;var anchor=nextPos<l2?c2[nextPos].el:parentAnchor;while(i<=e2){patch(null,c2[i]=optimized?cloneIfMounted(c2[i]):normalizeVNode(c2[i]),container,anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);i++;}}}// 4. common sequence + unmount
  420. // (a b) c
  421. // (a b)
  422. // i = 2, e1 = 2, e2 = 1
  423. // a (b c)
  424. // (b c)
  425. // i = 0, e1 = 0, e2 = -1
  426. else if(i>e2){while(i<=e1){unmount(c1[i],parentComponent,parentSuspense,true);i++;}}// 5. unknown sequence
  427. // [i ... e1 + 1]: a b [c d e] f g
  428. // [i ... e2 + 1]: a b [e d c h] f g
  429. // i = 2, e1 = 4, e2 = 5
  430. else{var s1=i;// prev starting index
  431. var s2=i;// next starting index
  432. // 5.1 build key:index map for newChildren
  433. var keyToNewIndexMap=new Map();for(i=s2;i<=e2;i++){var nextChild=c2[i]=optimized?cloneIfMounted(c2[i]):normalizeVNode(c2[i]);if(nextChild.key!=null){keyToNewIndexMap.set(nextChild.key,i);}}// 5.2 loop through old children left to be patched and try to patch
  434. // matching nodes & remove nodes that are no longer present
  435. var j;var patched=0;var toBePatched=e2-s2+1;var moved=false;// used to track whether any node has moved
  436. var maxNewIndexSoFar=0;// works as Map<newIndex, oldIndex>
  437. // Note that oldIndex is offset by +1
  438. // and oldIndex = 0 is a special value indicating the new node has
  439. // no corresponding old node.
  440. // used for determining longest stable subsequence
  441. var newIndexToOldIndexMap=new Array(toBePatched);for(i=0;i<toBePatched;i++){newIndexToOldIndexMap[i]=0;}for(i=s1;i<=e1;i++){var prevChild=c1[i];if(patched>=toBePatched){// all new children have been patched so this can only be a removal
  442. unmount(prevChild,parentComponent,parentSuspense,true);continue;}var newIndex=void 0;if(prevChild.key!=null){newIndex=keyToNewIndexMap.get(prevChild.key);}else{// key-less node, try to locate a key-less node of the same type
  443. for(j=s2;j<=e2;j++){if(newIndexToOldIndexMap[j-s2]===0&&isSameVNodeType(prevChild,c2[j])){newIndex=j;break;}}}if(newIndex===undefined){unmount(prevChild,parentComponent,parentSuspense,true);}else{newIndexToOldIndexMap[newIndex-s2]=i+1;if(newIndex>=maxNewIndexSoFar){maxNewIndexSoFar=newIndex;}else{moved=true;}patch(prevChild,c2[newIndex],container,null,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);patched++;}}// 5.3 move and mount
  444. // generate longest stable subsequence only when nodes have moved
  445. var increasingNewIndexSequence=moved?getSequence(newIndexToOldIndexMap):EMPTY_ARR;j=increasingNewIndexSequence.length-1;// looping backwards so that we can use last patched node as anchor
  446. for(i=toBePatched-1;i>=0;i--){var nextIndex=s2+i;var _nextChild=c2[nextIndex];var _anchor=nextIndex+1<l2?c2[nextIndex+1].el:parentAnchor;if(newIndexToOldIndexMap[i]===0){// mount new
  447. patch(null,_nextChild,container,_anchor,parentComponent,parentSuspense,isSVG,slotScopeIds,optimized);}else if(moved){// move if:
  448. // There is no stable subsequence (e.g. a reverse)
  449. // OR current node is not among the stable sequence
  450. if(j<0||i!==increasingNewIndexSequence[j]){move(_nextChild,container,_anchor,2/* REORDER */);}else{j--;}}}}};var move=function move(vnode,container,anchor,moveType){var parentSuspense=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var el=vnode.el,type=vnode.type,transition=vnode.transition,children=vnode.children,shapeFlag=vnode.shapeFlag;if(shapeFlag&6/* COMPONENT */){move(vnode.component.subTree,container,anchor,moveType);return;}if(shapeFlag&128/* SUSPENSE */){vnode.suspense.move(container,anchor,moveType);return;}if(shapeFlag&64/* TELEPORT */){type.move(vnode,container,anchor,internals);return;}if(type===Fragment){hostInsert(el,container,anchor);for(var i=0;i<children.length;i++){move(children[i],container,anchor,moveType);}hostInsert(vnode.anchor,container,anchor);return;}if(type===Static){moveStaticNode(vnode,container,anchor);return;}// single nodes
  451. var needTransition=moveType!==2/* REORDER */&&shapeFlag&1/* ELEMENT */&&transition;if(needTransition){if(moveType===0/* ENTER */){transition.beforeEnter(el);hostInsert(el,container,anchor);queuePostRenderEffect(function(){return transition.enter(el);},parentSuspense);}else{var leave=transition.leave,delayLeave=transition.delayLeave,afterLeave=transition.afterLeave;var _remove=function _remove(){return hostInsert(el,container,anchor);};var performLeave=function performLeave(){leave(el,function(){_remove();afterLeave&&afterLeave();});};if(delayLeave){delayLeave(el,_remove,performLeave);}else{performLeave();}}}else{hostInsert(el,container,anchor);}};var unmount=function unmount(vnode,parentComponent,parentSuspense){var doRemove=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var optimized=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var type=vnode.type,props=vnode.props,ref=vnode.ref,children=vnode.children,dynamicChildren=vnode.dynamicChildren,shapeFlag=vnode.shapeFlag,patchFlag=vnode.patchFlag,dirs=vnode.dirs;// unset ref
  452. if(ref!=null){setRef(ref,null,parentSuspense,vnode,true);}if(shapeFlag&256/* COMPONENT_SHOULD_KEEP_ALIVE */){parentComponent.ctx.deactivate(vnode);return;}var shouldInvokeDirs=shapeFlag&1/* ELEMENT */&&dirs;var shouldInvokeVnodeHook=!isAsyncWrapper(vnode);var vnodeHook;if(shouldInvokeVnodeHook&&(vnodeHook=props&&props.onVnodeBeforeUnmount)){invokeVNodeHook(vnodeHook,parentComponent,vnode);}if(shapeFlag&6/* COMPONENT */){unmountComponent(vnode.component,parentSuspense,doRemove);}else{if(shapeFlag&128/* SUSPENSE */){vnode.suspense.unmount(parentSuspense,doRemove);return;}if(shouldInvokeDirs){invokeDirectiveHook(vnode,null,parentComponent,'beforeUnmount');}if(shapeFlag&64/* TELEPORT */){vnode.type.remove(vnode,parentComponent,parentSuspense,optimized,internals,doRemove);}else if(dynamicChildren&&(// #1153: fast path should not be taken for non-stable (v-for) fragments
  453. type!==Fragment||patchFlag>0&&patchFlag&64/* STABLE_FRAGMENT */)){// fast path for block nodes: only need to unmount dynamic children.
  454. unmountChildren(dynamicChildren,parentComponent,parentSuspense,false,true);}else if(type===Fragment&&patchFlag&(128/* KEYED_FRAGMENT */|256/* UNKEYED_FRAGMENT */)||!optimized&&shapeFlag&16/* ARRAY_CHILDREN */){unmountChildren(children,parentComponent,parentSuspense);}if(doRemove){remove(vnode);}}if(shouldInvokeVnodeHook&&(vnodeHook=props&&props.onVnodeUnmounted)||shouldInvokeDirs){queuePostRenderEffect(function(){vnodeHook&&invokeVNodeHook(vnodeHook,parentComponent,vnode);shouldInvokeDirs&&invokeDirectiveHook(vnode,null,parentComponent,'unmounted');},parentSuspense);}};var remove=function remove(vnode){var type=vnode.type,el=vnode.el,anchor=vnode.anchor,transition=vnode.transition;if(type===Fragment){removeFragment(el,anchor);return;}if(type===Static){removeStaticNode(vnode);return;}var performRemove=function performRemove(){hostRemove(el);if(transition&&!transition.persisted&&transition.afterLeave){transition.afterLeave();}};if(vnode.shapeFlag&1/* ELEMENT */&&transition&&!transition.persisted){var leave=transition.leave,delayLeave=transition.delayLeave;var performLeave=function performLeave(){return leave(el,performRemove);};if(delayLeave){delayLeave(vnode.el,performRemove,performLeave);}else{performLeave();}}else{performRemove();}};var removeFragment=function removeFragment(cur,end){// For fragments, directly remove all contained DOM nodes.
  455. // (fragment child nodes cannot have transition)
  456. var next;while(cur!==end){next=hostNextSibling(cur);hostRemove(cur);cur=next;}hostRemove(end);};var unmountComponent=function unmountComponent(instance,parentSuspense,doRemove){var bum=instance.bum,scope=instance.scope,update=instance.update,subTree=instance.subTree,um=instance.um;// beforeUnmount hook
  457. if(bum){invokeArrayFns(bum);}// stop effects in component scope
  458. scope.stop();// update may be null if a component is unmounted before its async
  459. // setup has resolved.
  460. if(update){// so that scheduler will no longer invoke it
  461. update.active=false;unmount(subTree,instance,parentSuspense,doRemove);}// unmounted hook
  462. if(um){queuePostRenderEffect(um,parentSuspense);}queuePostRenderEffect(function(){instance.isUnmounted=true;},parentSuspense);// A component with async dep inside a pending suspense is unmounted before
  463. // its async dep resolves. This should remove the dep from the suspense, and
  464. // cause the suspense to resolve immediately if that was the last dep.
  465. if(parentSuspense&&parentSuspense.pendingBranch&&!parentSuspense.isUnmounted&&instance.asyncDep&&!instance.asyncResolved&&instance.suspenseId===parentSuspense.pendingId){parentSuspense.deps--;if(parentSuspense.deps===0){parentSuspense.resolve();}}};var unmountChildren=function unmountChildren(children,parentComponent,parentSuspense){var doRemove=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var optimized=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var start=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;for(var i=start;i<children.length;i++){unmount(children[i],parentComponent,parentSuspense,doRemove,optimized);}};var getNextHostNode=function getNextHostNode(vnode){if(vnode.shapeFlag&6/* COMPONENT */){return getNextHostNode(vnode.component.subTree);}if(vnode.shapeFlag&128/* SUSPENSE */){return vnode.suspense.next();}return hostNextSibling(vnode.anchor||vnode.el);};var render=function render(vnode,container,isSVG){if(vnode==null){if(container._vnode){unmount(container._vnode,null,null,true);}}else{patch(container._vnode||null,vnode,container,null,null,null,isSVG);}flushPostFlushCbs();container._vnode=vnode;};var internals={p:patch,um:unmount,m:move,r:remove,mt:mountComponent,mc:mountChildren,pc:patchChildren,pbc:patchBlockChildren,n:getNextHostNode,o:options};var hydrate;var hydrateNode;if(createHydrationFns){var _createHydrationFns=createHydrationFns(internals);var _createHydrationFns2=_slicedToArray(_createHydrationFns,2);hydrate=_createHydrationFns2[0];hydrateNode=_createHydrationFns2[1];}return{render:render,hydrate:hydrate,createApp:createAppAPI(render,hydrate)};}function toggleRecurse(_ref7,allowed){var effect=_ref7.effect,update=_ref7.update;effect.allowRecurse=update.allowRecurse=allowed;}/**
  466. * #1156
  467. * When a component is HMR-enabled, we need to make sure that all static nodes
  468. * inside a block also inherit the DOM element from the previous tree so that
  469. * HMR updates (which are full updates) can retrieve the element for patching.
  470. *
  471. * #2080
  472. * Inside keyed `template` fragment static children, if a fragment is moved,
  473. * the children will always be moved. Therefore, in order to ensure correct move
  474. * position, el should be inherited from previous nodes.
  475. */function traverseStaticChildren(n1,n2){var shallow=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var ch1=n1.children;var ch2=n2.children;if(isArray(ch1)&&isArray(ch2)){for(var i=0;i<ch1.length;i++){// this is only called in the optimized path so array children are
  476. // guaranteed to be vnodes
  477. var c1=ch1[i];var c2=ch2[i];if(c2.shapeFlag&1/* ELEMENT */&&!c2.dynamicChildren){if(c2.patchFlag<=0||c2.patchFlag===32/* HYDRATE_EVENTS */){c2=ch2[i]=cloneIfMounted(ch2[i]);c2.el=c1.el;}if(!shallow)traverseStaticChildren(c1,c2);}}}}// https://en.wikipedia.org/wiki/Longest_increasing_subsequence
  478. function getSequence(arr){var p=arr.slice();var result=[0];var i,j,u,v,c;var len=arr.length;for(i=0;i<len;i++){var arrI=arr[i];if(arrI!==0){j=result[result.length-1];if(arr[j]<arrI){p[i]=j;result.push(i);continue;}u=0;v=result.length-1;while(u<v){c=u+v>>1;if(arr[result[c]]<arrI){u=c+1;}else{v=c;}}if(arrI<arr[result[u]]){if(u>0){p[i]=result[u-1];}result[u]=i;}}}u=result.length;v=result[u-1];while(u-->0){result[u]=v;v=p[v];}return result;}var isTeleport=function isTeleport(type){return type.__isTeleport;};var NULL_DYNAMIC_COMPONENT=Symbol();var Fragment=exports('F',Symbol(undefined));var Text=Symbol(undefined);var Comment=Symbol(undefined);var Static=Symbol(undefined);var currentBlock=null;// Whether we should be tracking dynamic child nodes inside a block.
  479. // Only tracks when this value is > 0
  480. // We are not using a simple boolean because this value may need to be
  481. // incremented/decremented by nested usage of v-once (see below)
  482. var isBlockTreeEnabled=1;/**
  483. * Block tracking sometimes needs to be disabled, for example during the
  484. * creation of a tree that needs to be cached by v-once. The compiler generates
  485. * code like this:
  486. *
  487. * ``` js
  488. * _cache[1] || (
  489. * setBlockTracking(-1),
  490. * _cache[1] = createVNode(...),
  491. * setBlockTracking(1),
  492. * _cache[1]
  493. * )
  494. * ```
  495. *
  496. * @private
  497. */function setBlockTracking(value){isBlockTreeEnabled+=value;}function isVNode(value){return value?value.__v_isVNode===true:false;}function isSameVNodeType(n1,n2){return n1.type===n2.type&&n1.key===n2.key;}var InternalObjectKey="__vInternal";var normalizeKey=function normalizeKey(_ref8){var key=_ref8.key;return key!=null?key:null;};var normalizeRef=function normalizeRef(_ref9){var ref=_ref9.ref,ref_key=_ref9.ref_key,ref_for=_ref9.ref_for;return ref!=null?isString(ref)||isRef(ref)||isFunction(ref)?{i:currentRenderingInstance,r:ref,k:ref_key,f:!!ref_for}:ref:null;};function createBaseVNode(type){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var children=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var patchFlag=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var dynamicProps=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var shapeFlag=arguments.length>5&&arguments[5]!==undefined?arguments[5]:type===Fragment?0:1;var isBlockNode=arguments.length>6&&arguments[6]!==undefined?arguments[6]:false;var needFullChildrenNormalization=arguments.length>7&&arguments[7]!==undefined?arguments[7]:false;var vnode={__v_isVNode:true,__v_skip:true,type:type,props:props,key:props&&normalizeKey(props),ref:props&&normalizeRef(props),scopeId:currentScopeId,slotScopeIds:null,children:children,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:shapeFlag,patchFlag:patchFlag,dynamicProps:dynamicProps,dynamicChildren:null,appContext:null};if(needFullChildrenNormalization){normalizeChildren(vnode,children);// normalize suspense children
  498. if(shapeFlag&128/* SUSPENSE */){type.normalize(vnode);}}else if(children){// compiled element vnode - if children is passed, only possible types are
  499. // string or Array.
  500. vnode.shapeFlag|=isString(children)?8/* TEXT_CHILDREN */:16/* ARRAY_CHILDREN */;}// track vnode for block tree
  501. if(isBlockTreeEnabled>0&&// avoid a block node from tracking itself
  502. !isBlockNode&&// has current parent block
  503. currentBlock&&(// presence of a patch flag indicates this node needs patching on updates.
  504. // component nodes also should always be patched, because even if the
  505. // component doesn't need to update, it needs to persist the instance on to
  506. // the next vnode so that it can be properly unmounted later.
  507. vnode.patchFlag>0||shapeFlag&6/* COMPONENT */)&&// the EVENTS flag is only for hydration and if it is the only flag, the
  508. // vnode should not be considered dynamic due to handler caching.
  509. vnode.patchFlag!==32/* HYDRATE_EVENTS */){currentBlock.push(vnode);}return vnode;}var createVNode=exports('c',_createVNode);function _createVNode(type){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var children=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var patchFlag=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var dynamicProps=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var isBlockNode=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;if(!type||type===NULL_DYNAMIC_COMPONENT){type=Comment;}if(isVNode(type)){// createVNode receiving an existing vnode. This happens in cases like
  510. // <component :is="vnode"/>
  511. // #2078 make sure to merge refs during the clone instead of overwriting it
  512. var cloned=cloneVNode(type,props,true/* mergeRef: true */);if(children){normalizeChildren(cloned,children);}return cloned;}// class component normalization.
  513. if(isClassComponent(type)){type=type.__vccOpts;}// class & style normalization.
  514. if(props){// for reactive or proxy objects, we need to clone it to enable mutation.
  515. props=guardReactiveProps(props);var _props=props,klass=_props.class,style=_props.style;if(klass&&!isString(klass)){props.class=normalizeClass(klass);}if(isObject(style)){// reactive state objects need to be cloned since they are likely to be
  516. // mutated
  517. if(isProxy(style)&&!isArray(style)){style=extend({},style);}props.style=normalizeStyle(style);}}// encode the vnode type information into a bitmap
  518. var shapeFlag=isString(type)?1/* ELEMENT */:isSuspense(type)?128/* SUSPENSE */:isTeleport(type)?64/* TELEPORT */:isObject(type)?4/* STATEFUL_COMPONENT */:isFunction(type)?2/* FUNCTIONAL_COMPONENT */:0;return createBaseVNode(type,props,children,patchFlag,dynamicProps,shapeFlag,isBlockNode,true);}function guardReactiveProps(props){if(!props)return null;return isProxy(props)||InternalObjectKey in props?extend({},props):props;}function cloneVNode(vnode,extraProps){var mergeRef=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;// This is intentionally NOT using spread or extend to avoid the runtime
  519. // key enumeration cost.
  520. var props=vnode.props,ref=vnode.ref,patchFlag=vnode.patchFlag,children=vnode.children;var mergedProps=extraProps?mergeProps(props||{},extraProps):props;var cloned={__v_isVNode:true,__v_skip:true,type:vnode.type,props:mergedProps,key:mergedProps&&normalizeKey(mergedProps),ref:extraProps&&extraProps.ref?// #2078 in the case of <component :is="vnode" ref="extra"/>
  521. // if the vnode itself already has a ref, cloneVNode will need to merge
  522. // the refs so the single vnode can be set on multiple refs
  523. mergeRef&&ref?isArray(ref)?ref.concat(normalizeRef(extraProps)):[ref,normalizeRef(extraProps)]:normalizeRef(extraProps):ref,scopeId:vnode.scopeId,slotScopeIds:vnode.slotScopeIds,children:children,target:vnode.target,targetAnchor:vnode.targetAnchor,staticCount:vnode.staticCount,shapeFlag:vnode.shapeFlag,// if the vnode is cloned with extra props, we can no longer assume its
  524. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  525. // note: perserve flag for fragments since they use the flag for children
  526. // fast paths only.
  527. patchFlag:extraProps&&vnode.type!==Fragment?patchFlag===-1// hoisted node
  528. ?16/* FULL_PROPS */:patchFlag|16/* FULL_PROPS */:patchFlag,dynamicProps:vnode.dynamicProps,dynamicChildren:vnode.dynamicChildren,appContext:vnode.appContext,dirs:vnode.dirs,transition:vnode.transition,// These should technically only be non-null on mounted VNodes. However,
  529. // they *should* be copied for kept-alive vnodes. So we just always copy
  530. // them since them being non-null during a mount doesn't affect the logic as
  531. // they will simply be overwritten.
  532. component:vnode.component,suspense:vnode.suspense,ssContent:vnode.ssContent&&cloneVNode(vnode.ssContent),ssFallback:vnode.ssFallback&&cloneVNode(vnode.ssFallback),el:vnode.el,anchor:vnode.anchor};return cloned;}/**
  533. * @private
  534. */function createTextVNode(){var text=arguments.length>0&&arguments[0]!==undefined?arguments[0]:' ';var flag=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return createVNode(Text,null,text,flag);}function normalizeVNode(child){if(child==null||typeof child==='boolean'){// empty placeholder
  535. return createVNode(Comment);}else if(isArray(child)){// fragment
  536. return createVNode(Fragment,null,// #3666, avoid reference pollution when reusing vnode
  537. child.slice());}else if(_typeof(child)==='object'){// already vnode, this should be the most common since compiled templates
  538. // always produce all-vnode children arrays
  539. return cloneIfMounted(child);}else{// strings and numbers
  540. return createVNode(Text,null,String(child));}}// optimized normalization for template-compiled render fns
  541. function cloneIfMounted(child){return child.el===null||child.memo?child:cloneVNode(child);}function normalizeChildren(vnode,children){var type=0;var shapeFlag=vnode.shapeFlag;if(children==null){children=null;}else if(isArray(children)){type=16/* ARRAY_CHILDREN */;}else if(_typeof(children)==='object'){if(shapeFlag&(1/* ELEMENT */|64/* TELEPORT */)){// Normalize slot to plain children for plain element and Teleport
  542. var slot=children.default;if(slot){// _c marker is added by withCtx() indicating this is a compiled slot
  543. slot._c&&(slot._d=false);normalizeChildren(vnode,slot());slot._c&&(slot._d=true);}return;}else{type=32/* SLOTS_CHILDREN */;var slotFlag=children._;if(!slotFlag&&!(InternalObjectKey in children)){children._ctx=currentRenderingInstance;}else if(slotFlag===3/* FORWARDED */&&currentRenderingInstance){// a child component receives forwarded slots from the parent.
  544. // its slot type is determined by its parent's slot type.
  545. if(currentRenderingInstance.slots._===1/* STABLE */){children._=1/* STABLE */;}else{children._=2/* DYNAMIC */;vnode.patchFlag|=1024/* DYNAMIC_SLOTS */;}}}}else if(isFunction(children)){children={default:children,_ctx:currentRenderingInstance};type=32/* SLOTS_CHILDREN */;}else{children=String(children);// force teleport children to array so it can be moved around
  546. if(shapeFlag&64/* TELEPORT */){type=16/* ARRAY_CHILDREN */;children=[createTextVNode(children)];}else{type=8/* TEXT_CHILDREN */;}}vnode.children=children;vnode.shapeFlag|=type;}function mergeProps(){var ret={};for(var i=0;i<arguments.length;i++){var toMerge=i<0||arguments.length<=i?undefined:arguments[i];for(var key in toMerge){if(key==='class'){if(ret.class!==toMerge.class){ret.class=normalizeClass([ret.class,toMerge.class]);}}else if(key==='style'){ret.style=normalizeStyle([ret.style,toMerge.style]);}else if(isOn(key)){var existing=ret[key];var incoming=toMerge[key];if(existing!==incoming&&!(isArray(existing)&&existing.includes(incoming))){ret[key]=existing?[].concat(existing,incoming):incoming;}}else if(key!==''){ret[key]=toMerge[key];}}}return ret;}function invokeVNodeHook(hook,instance,vnode){var prevVNode=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;callWithAsyncErrorHandling(hook,instance,7/* VNODE_HOOK */,[vnode,prevVNode]);}/**
  547. * #2437 In Vue 3, functional components do not have a public instance proxy but
  548. * they exist in the internal parent chain. For code that relies on traversing
  549. * public $parent chains, skip functional ones and go to the parent instead.
  550. */var getPublicInstance=function getPublicInstance(i){if(!i)return null;if(isStatefulComponent(i))return getExposeProxy(i)||i.proxy;return getPublicInstance(i.parent);};var publicPropertiesMap=extend(Object.create(null),{$:function $(i){return i;},$el:function $el(i){return i.vnode.el;},$data:function $data(i){return i.data;},$props:function $props(i){return i.props;},$attrs:function $attrs(i){return i.attrs;},$slots:function $slots(i){return i.slots;},$refs:function $refs(i){return i.refs;},$parent:function $parent(i){return getPublicInstance(i.parent);},$root:function $root(i){return getPublicInstance(i.root);},$emit:function $emit(i){return i.emit;},$options:function $options(i){return resolveMergedOptions(i);},$forceUpdate:function $forceUpdate(i){return function(){return queueJob(i.update);};},$nextTick:function $nextTick(i){return nextTick.bind(i.proxy);},$watch:function $watch(i){return instanceWatch.bind(i);}});var PublicInstanceProxyHandlers={get:function get(_ref10,key){var instance=_ref10._;var ctx=instance.ctx,setupState=instance.setupState,data=instance.data,props=instance.props,accessCache=instance.accessCache,type=instance.type,appContext=instance.appContext;// data / props / ctx
  551. // This getter gets called for every property access on the render context
  552. // during render and is a major hotspot. The most expensive part of this
  553. // is the multiple hasOwn() calls. It's much faster to do a simple property
  554. // access on a plain object, so we use an accessCache object (with null
  555. // prototype) to memoize what access type a key corresponds to.
  556. var normalizedProps;if(key[0]!=='$'){var n=accessCache[key];if(n!==undefined){switch(n){case 1/* SETUP */:return setupState[key];case 2/* DATA */:return data[key];case 4/* CONTEXT */:return ctx[key];case 3/* PROPS */:return props[key];// default: just fallthrough
  557. }}else if(setupState!==EMPTY_OBJ&&hasOwn(setupState,key)){accessCache[key]=1/* SETUP */;return setupState[key];}else if(data!==EMPTY_OBJ&&hasOwn(data,key)){accessCache[key]=2/* DATA */;return data[key];}else if(// only cache other properties when instance has declared (thus stable)
  558. // props
  559. (normalizedProps=instance.propsOptions[0])&&hasOwn(normalizedProps,key)){accessCache[key]=3/* PROPS */;return props[key];}else if(ctx!==EMPTY_OBJ&&hasOwn(ctx,key)){accessCache[key]=4/* CONTEXT */;return ctx[key];}else if(shouldCacheAccess){accessCache[key]=0/* OTHER */;}}var publicGetter=publicPropertiesMap[key];var cssModule,globalProperties;// public $xxx properties
  560. if(publicGetter){if(key==='$attrs'){track(instance,"get"/* GET */,key);}return publicGetter(instance);}else if(// css module (injected by vue-loader)
  561. (cssModule=type.__cssModules)&&(cssModule=cssModule[key])){return cssModule;}else if(ctx!==EMPTY_OBJ&&hasOwn(ctx,key)){// user may set custom properties to `this` that start with `$`
  562. accessCache[key]=4/* CONTEXT */;return ctx[key];}else if(// global properties
  563. globalProperties=appContext.config.globalProperties,hasOwn(globalProperties,key)){{return globalProperties[key];}}else;},set:function set(_ref11,key,value){var instance=_ref11._;var data=instance.data,setupState=instance.setupState,ctx=instance.ctx;if(setupState!==EMPTY_OBJ&&hasOwn(setupState,key)){setupState[key]=value;}else if(data!==EMPTY_OBJ&&hasOwn(data,key)){data[key]=value;}else if(hasOwn(instance.props,key)){return false;}if(key[0]==='$'&&key.slice(1)in instance){return false;}else{{ctx[key]=value;}}return true;},has:function has(_ref12,key){var _ref12$_=_ref12._,data=_ref12$_.data,setupState=_ref12$_.setupState,accessCache=_ref12$_.accessCache,ctx=_ref12$_.ctx,appContext=_ref12$_.appContext,propsOptions=_ref12$_.propsOptions;var normalizedProps;return!!accessCache[key]||data!==EMPTY_OBJ&&hasOwn(data,key)||setupState!==EMPTY_OBJ&&hasOwn(setupState,key)||(normalizedProps=propsOptions[0])&&hasOwn(normalizedProps,key)||hasOwn(ctx,key)||hasOwn(publicPropertiesMap,key)||hasOwn(appContext.config.globalProperties,key);}};var emptyAppContext=createAppContext();var uid$1=0;function createComponentInstance(vnode,parent,suspense){var type=vnode.type;// inherit parent app context - or - if root, adopt from root vnode
  564. var appContext=(parent?parent.appContext:vnode.appContext)||emptyAppContext;var instance={uid:uid$1++,vnode:vnode,type:type,parent:parent,appContext:appContext,root:null,next:null,subTree:null,effect:null,update:null,scope:new EffectScope(true/* detached */),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:parent?parent.provides:Object.create(appContext.provides),accessCache:null,renderCache:[],// local resovled assets
  565. components:null,directives:null,// resolved props and emits options
  566. propsOptions:normalizePropsOptions(type,appContext),emitsOptions:normalizeEmitsOptions(type,appContext),// emit
  567. emit:null,emitted:null,// props default value
  568. propsDefaults:EMPTY_OBJ,// inheritAttrs
  569. inheritAttrs:type.inheritAttrs,// state
  570. ctx:EMPTY_OBJ,data:EMPTY_OBJ,props:EMPTY_OBJ,attrs:EMPTY_OBJ,slots:EMPTY_OBJ,refs:EMPTY_OBJ,setupState:EMPTY_OBJ,setupContext:null,// suspense related
  571. suspense:suspense,suspenseId:suspense?suspense.pendingId:0,asyncDep:null,asyncResolved:false,// lifecycle hooks
  572. // not using enums here because it results in computed properties
  573. isMounted:false,isUnmounted:false,isDeactivated:false,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};{instance.ctx={_:instance};}instance.root=parent?parent.root:instance;instance.emit=emit$1.bind(null,instance);// apply custom element special handling
  574. if(vnode.ce){vnode.ce(instance);}return instance;}var currentInstance=null;var setCurrentInstance=function setCurrentInstance(instance){currentInstance=instance;instance.scope.on();};var unsetCurrentInstance=function unsetCurrentInstance(){currentInstance&&currentInstance.scope.off();currentInstance=null;};function isStatefulComponent(instance){return instance.vnode.shapeFlag&4/* STATEFUL_COMPONENT */;}var isInSSRComponentSetup=false;function setupComponent(instance){var isSSR=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;isInSSRComponentSetup=isSSR;var _instance$vnode=instance.vnode,props=_instance$vnode.props,children=_instance$vnode.children;var isStateful=isStatefulComponent(instance);initProps(instance,props,isStateful,isSSR);initSlots(instance,children);var setupResult=isStateful?setupStatefulComponent(instance,isSSR):undefined;isInSSRComponentSetup=false;return setupResult;}function setupStatefulComponent(instance,isSSR){var Component=instance.type;// 0. create render proxy property access cache
  575. instance.accessCache=Object.create(null);// 1. create public instance / render proxy
  576. // also mark it raw so it's never observed
  577. instance.proxy=markRaw(new Proxy(instance.ctx,PublicInstanceProxyHandlers));// 2. call setup()
  578. var setup=Component.setup;if(setup){var setupContext=instance.setupContext=setup.length>1?createSetupContext(instance):null;setCurrentInstance(instance);pauseTracking();var setupResult=callWithErrorHandling(setup,instance,0/* SETUP_FUNCTION */,[instance.props,setupContext]);resetTracking();unsetCurrentInstance();if(isPromise(setupResult)){setupResult.then(unsetCurrentInstance,unsetCurrentInstance);if(isSSR){// return the promise so server-renderer can wait on it
  579. return setupResult.then(function(resolvedResult){handleSetupResult(instance,resolvedResult,isSSR);}).catch(function(e){handleError(e,instance,0/* SETUP_FUNCTION */);});}else{// async setup returned Promise.
  580. // bail here and wait for re-entry.
  581. instance.asyncDep=setupResult;}}else{handleSetupResult(instance,setupResult,isSSR);}}else{finishComponentSetup(instance,isSSR);}}function handleSetupResult(instance,setupResult,isSSR){if(isFunction(setupResult)){// setup returned an inline render function
  582. if(instance.type.__ssrInlineRender){// when the function's name is `ssrRender` (compiled by SFC inline mode),
  583. // set it as ssrRender instead.
  584. instance.ssrRender=setupResult;}else{instance.render=setupResult;}}else if(isObject(setupResult)){instance.setupState=proxyRefs(setupResult);}else;finishComponentSetup(instance,isSSR);}var compile;function finishComponentSetup(instance,isSSR,skipOptions){var Component=instance.type;// template / render function normalization
  585. // could be already set when returned from setup()
  586. if(!instance.render){// only do on-the-fly compile if not in SSR - SSR on-the-fly compliation
  587. // is done by server-renderer
  588. if(!isSSR&&compile&&!Component.render){var template=Component.template;if(template){var _instance$appContext$=instance.appContext.config,isCustomElement=_instance$appContext$.isCustomElement,compilerOptions=_instance$appContext$.compilerOptions;var delimiters=Component.delimiters,componentCompilerOptions=Component.compilerOptions;var finalCompilerOptions=extend(extend({isCustomElement:isCustomElement,delimiters:delimiters},compilerOptions),componentCompilerOptions);Component.render=compile(template,finalCompilerOptions);}}instance.render=Component.render||NOOP;}// support for 2.x options
  589. {setCurrentInstance(instance);pauseTracking();applyOptions(instance);resetTracking();unsetCurrentInstance();}}function createAttrsProxy(instance){return new Proxy(instance.attrs,{get:function get(target,key){track(instance,"get"/* GET */,'$attrs');return target[key];}});}function createSetupContext(instance){var expose=function expose(exposed){instance.exposed=exposed||{};};var attrs;{return{get attrs(){return attrs||(attrs=createAttrsProxy(instance));},slots:instance.slots,emit:instance.emit,expose:expose};}}function getExposeProxy(instance){if(instance.exposed){return instance.exposeProxy||(instance.exposeProxy=new Proxy(proxyRefs(markRaw(instance.exposed)),{get:function get(target,key){if(key in target){return target[key];}else if(key in publicPropertiesMap){return publicPropertiesMap[key](instance);}}}));}}function isClassComponent(value){return isFunction(value)&&'__vccOpts'in value;}function callWithErrorHandling(fn,instance,type,args){var res;try{res=args?fn.apply(void 0,_toConsumableArray(args)):fn();}catch(err){handleError(err,instance,type);}return res;}function callWithAsyncErrorHandling(fn,instance,type,args){if(isFunction(fn)){var res=callWithErrorHandling(fn,instance,type,args);if(res&&isPromise(res)){res.catch(function(err){handleError(err,instance,type);});}return res;}var values=[];for(var i=0;i<fn.length;i++){values.push(callWithAsyncErrorHandling(fn[i],instance,type,args));}return values;}function handleError(err,instance,type){var throwInDev=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var contextVNode=instance?instance.vnode:null;if(instance){var cur=instance.parent;// the exposed instance is the render proxy to keep it consistent with 2.x
  590. var exposedInstance=instance.proxy;// in production the hook receives only the error code
  591. var errorInfo=type;while(cur){var errorCapturedHooks=cur.ec;if(errorCapturedHooks){for(var i=0;i<errorCapturedHooks.length;i++){if(errorCapturedHooks[i](err,exposedInstance,errorInfo)===false){return;}}}cur=cur.parent;}// app-level handling
  592. var appErrorHandler=instance.appContext.config.errorHandler;if(appErrorHandler){callWithErrorHandling(appErrorHandler,null,10/* APP_ERROR_HANDLER */,[err,exposedInstance,errorInfo]);return;}}logError(err,type,contextVNode,throwInDev);}function logError(err,type,contextVNode){var throwInDev=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;{// recover in prod to reduce the impact on end-user
  593. console.error(err);}}var isFlushing=false;var isFlushPending=false;var queue=[];var flushIndex=0;var pendingPreFlushCbs=[];var activePreFlushCbs=null;var preFlushIndex=0;var pendingPostFlushCbs=[];var activePostFlushCbs=null;var postFlushIndex=0;var resolvedPromise=Promise.resolve();var currentFlushPromise=null;var currentPreFlushParentJob=null;function nextTick(fn){var p=currentFlushPromise||resolvedPromise;return fn?p.then(this?fn.bind(this):fn):p;}// #2768
  594. // Use binary-search to find a suitable position in the queue,
  595. // so that the queue maintains the increasing order of job's id,
  596. // which can prevent the job from being skipped and also can avoid repeated patching.
  597. function findInsertionIndex(id){// the start index should be `flushIndex + 1`
  598. var start=flushIndex+1;var end=queue.length;while(start<end){var middle=start+end>>>1;var middleJobId=getId(queue[middle]);middleJobId<id?start=middle+1:end=middle;}return start;}function queueJob(job){// the dedupe search uses the startIndex argument of Array.includes()
  599. // by default the search index includes the current job that is being run
  600. // so it cannot recursively trigger itself again.
  601. // if the job is a watch() callback, the search will start with a +1 index to
  602. // allow it recursively trigger itself - it is the user's responsibility to
  603. // ensure it doesn't end up in an infinite loop.
  604. if((!queue.length||!queue.includes(job,isFlushing&&job.allowRecurse?flushIndex+1:flushIndex))&&job!==currentPreFlushParentJob){if(job.id==null){queue.push(job);}else{queue.splice(findInsertionIndex(job.id),0,job);}queueFlush();}}function queueFlush(){if(!isFlushing&&!isFlushPending){isFlushPending=true;currentFlushPromise=resolvedPromise.then(flushJobs);}}function invalidateJob(job){var i=queue.indexOf(job);if(i>flushIndex){queue.splice(i,1);}}function queueCb(cb,activeQueue,pendingQueue,index){if(!isArray(cb)){if(!activeQueue||!activeQueue.includes(cb,cb.allowRecurse?index+1:index)){pendingQueue.push(cb);}}else{// if cb is an array, it is a component lifecycle hook which can only be
  605. // triggered by a job, which is already deduped in the main queue, so
  606. // we can skip duplicate check here to improve perf
  607. pendingQueue.push.apply(pendingQueue,_toConsumableArray(cb));}queueFlush();}function queuePreFlushCb(cb){queueCb(cb,activePreFlushCbs,pendingPreFlushCbs,preFlushIndex);}function queuePostFlushCb(cb){queueCb(cb,activePostFlushCbs,pendingPostFlushCbs,postFlushIndex);}function flushPreFlushCbs(seen){var parentJob=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(pendingPreFlushCbs.length){currentPreFlushParentJob=parentJob;activePreFlushCbs=_toConsumableArray(new Set(pendingPreFlushCbs));pendingPreFlushCbs.length=0;for(preFlushIndex=0;preFlushIndex<activePreFlushCbs.length;preFlushIndex++){activePreFlushCbs[preFlushIndex]();}activePreFlushCbs=null;preFlushIndex=0;currentPreFlushParentJob=null;// recursively flush until it drains
  608. flushPreFlushCbs(seen,parentJob);}}function flushPostFlushCbs(seen){if(pendingPostFlushCbs.length){var deduped=_toConsumableArray(new Set(pendingPostFlushCbs));pendingPostFlushCbs.length=0;// #1947 already has active queue, nested flushPostFlushCbs call
  609. if(activePostFlushCbs){var _activePostFlushCbs;(_activePostFlushCbs=activePostFlushCbs).push.apply(_activePostFlushCbs,_toConsumableArray(deduped));return;}activePostFlushCbs=deduped;activePostFlushCbs.sort(function(a,b){return getId(a)-getId(b);});for(postFlushIndex=0;postFlushIndex<activePostFlushCbs.length;postFlushIndex++){activePostFlushCbs[postFlushIndex]();}activePostFlushCbs=null;postFlushIndex=0;}}var getId=function getId(job){return job.id==null?Infinity:job.id;};function flushJobs(seen){isFlushPending=false;isFlushing=true;flushPreFlushCbs(seen);// Sort queue before flush.
  610. // This ensures that:
  611. // 1. Components are updated from parent to child. (because parent is always
  612. // created before the child so its render effect will have smaller
  613. // priority number)
  614. // 2. If a component is unmounted during a parent component's update,
  615. // its update can be skipped.
  616. queue.sort(function(a,b){return getId(a)-getId(b);});// conditional usage of checkRecursiveUpdate must be determined out of
  617. // try ... catch block since Rollup by default de-optimizes treeshaking
  618. // inside try-catch. This can leave all warning code unshaked. Although
  619. // they would get eventually shaken by a minifier like terser, some minifiers
  620. // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
  621. var check=NOOP;try{for(flushIndex=0;flushIndex<queue.length;flushIndex++){var job=queue[flushIndex];if(job&&job.active!==false){if("production"!=='production'&&check(job));// console.log(`running:`, job.id)
  622. callWithErrorHandling(job,null,14/* SCHEDULER */);}}}finally{flushIndex=0;queue.length=0;flushPostFlushCbs();isFlushing=false;currentFlushPromise=null;// some postFlushCb queued jobs!
  623. // keep flushing until it drains.
  624. if(queue.length||pendingPreFlushCbs.length||pendingPostFlushCbs.length){flushJobs(seen);}}}// initial value for watchers to trigger on undefined initial values
  625. var INITIAL_WATCHER_VALUE={};// implementation
  626. function watch(source,cb,options){return doWatch(source,cb,options);}function doWatch(source,cb){var _ref13=arguments.length>2&&arguments[2]!==undefined?arguments[2]:EMPTY_OBJ,immediate=_ref13.immediate,deep=_ref13.deep,flush=_ref13.flush,onTrack=_ref13.onTrack,onTrigger=_ref13.onTrigger;var instance=currentInstance;var getter;var forceTrigger=false;var isMultiSource=false;if(isRef(source)){getter=function getter(){return source.value;};forceTrigger=!!source._shallow;}else if(isReactive(source)){getter=function getter(){return source;};deep=true;}else if(isArray(source)){isMultiSource=true;forceTrigger=source.some(isReactive);getter=function getter(){return source.map(function(s){if(isRef(s)){return s.value;}else if(isReactive(s)){return traverse(s);}else if(isFunction(s)){return callWithErrorHandling(s,instance,2/* WATCH_GETTER */);}else;});};}else if(isFunction(source)){if(cb){// getter with cb
  627. getter=function getter(){return callWithErrorHandling(source,instance,2/* WATCH_GETTER */);};}else{// no cb -> simple effect
  628. getter=function getter(){if(instance&&instance.isUnmounted){return;}if(cleanup){cleanup();}return callWithAsyncErrorHandling(source,instance,3/* WATCH_CALLBACK */,[onInvalidate]);};}}else{getter=NOOP;}if(cb&&deep){var baseGetter=getter;getter=function getter(){return traverse(baseGetter());};}var cleanup;var onInvalidate=function onInvalidate(fn){cleanup=effect.onStop=function(){callWithErrorHandling(fn,instance,4/* WATCH_CLEANUP */);};};// in SSR there is no need to setup an actual effect, and it should be noop
  629. // unless it's eager
  630. if(isInSSRComponentSetup){// we will also not call the invalidate callback (+ runner is not set up)
  631. onInvalidate=NOOP;if(!cb){getter();}else if(immediate){callWithAsyncErrorHandling(cb,instance,3/* WATCH_CALLBACK */,[getter(),isMultiSource?[]:undefined,onInvalidate]);}return NOOP;}var oldValue=isMultiSource?[]:INITIAL_WATCHER_VALUE;var job=function job(){if(!effect.active){return;}if(cb){// watch(source, cb)
  632. var newValue=effect.run();if(deep||forceTrigger||(isMultiSource?newValue.some(function(v,i){return hasChanged(v,oldValue[i]);}):hasChanged(newValue,oldValue))||false){// cleanup before running cb again
  633. if(cleanup){cleanup();}callWithAsyncErrorHandling(cb,instance,3/* WATCH_CALLBACK */,[newValue,// pass undefined as the old value when it's changed for the first time
  634. oldValue===INITIAL_WATCHER_VALUE?undefined:oldValue,onInvalidate]);oldValue=newValue;}}else{// watchEffect
  635. effect.run();}};// important: mark the job as a watcher callback so that scheduler knows
  636. // it is allowed to self-trigger (#1727)
  637. job.allowRecurse=!!cb;var scheduler;if(flush==='sync'){scheduler=job;// the scheduler function gets called directly
  638. }else if(flush==='post'){scheduler=function scheduler(){return queuePostRenderEffect(job,instance&&instance.suspense);};}else{// default: 'pre'
  639. scheduler=function scheduler(){if(!instance||instance.isMounted){queuePreFlushCb(job);}else{// with 'pre' option, the first call must happen before
  640. // the component is mounted so it is called synchronously.
  641. job();}};}var effect=new ReactiveEffect(getter,scheduler);// initial run
  642. if(cb){if(immediate){job();}else{oldValue=effect.run();}}else if(flush==='post'){queuePostRenderEffect(effect.run.bind(effect),instance&&instance.suspense);}else{effect.run();}return function(){effect.stop();if(instance&&instance.scope){remove(instance.scope.effects,effect);}};}// this.$watch
  643. function instanceWatch(source,value,options){var publicThis=this.proxy;var getter=isString(source)?source.includes('.')?createPathGetter(publicThis,source):function(){return publicThis[source];}:source.bind(publicThis,publicThis);var cb;if(isFunction(value)){cb=value;}else{cb=value.handler;options=value;}var cur=currentInstance;setCurrentInstance(this);var res=doWatch(getter,cb.bind(publicThis),options);if(cur){setCurrentInstance(cur);}else{unsetCurrentInstance();}return res;}function createPathGetter(ctx,path){var segments=path.split('.');return function(){var cur=ctx;for(var i=0;i<segments.length&&cur;i++){cur=cur[segments[i]];}return cur;};}function traverse(value,seen){if(!isObject(value)||value["__v_skip"/* SKIP */]){return value;}seen=seen||new Set();if(seen.has(value)){return value;}seen.add(value);if(isRef(value)){traverse(value.value,seen);}else if(isArray(value)){for(var i=0;i<value.length;i++){traverse(value[i],seen);}}else if(isSet(value)||isMap(value)){value.forEach(function(v){traverse(v,seen);});}else if(isPlainObject(value)){for(var key in value){traverse(value[key],seen);}}return value;}// Actual implementation
  644. function h(type,propsOrChildren,children){var l=arguments.length;if(l===2){if(isObject(propsOrChildren)&&!isArray(propsOrChildren)){// single vnode without props
  645. if(isVNode(propsOrChildren)){return createVNode(type,null,[propsOrChildren]);}// props without children
  646. return createVNode(type,propsOrChildren);}else{// omit props
  647. return createVNode(type,null,propsOrChildren);}}else{if(l>3){children=Array.prototype.slice.call(arguments,2);}else if(l===3&&isVNode(children)){children=[children];}return createVNode(type,propsOrChildren,children);}}// Core API ------------------------------------------------------------------
  648. var version="3.2.26";var svgNS='http://www.w3.org/2000/svg';var doc=typeof document!=='undefined'?document:null;var staticTemplateCache=new Map();var nodeOps={insert:function insert(child,parent,anchor){parent.insertBefore(child,anchor||null);},remove:function remove(child){var parent=child.parentNode;if(parent){parent.removeChild(child);}},createElement:function createElement(tag,isSVG,is,props){var el=isSVG?doc.createElementNS(svgNS,tag):doc.createElement(tag,is?{is:is}:undefined);if(tag==='select'&&props&&props.multiple!=null){el.setAttribute('multiple',props.multiple);}return el;},createText:function createText(text){return doc.createTextNode(text);},createComment:function createComment(text){return doc.createComment(text);},setText:function setText(node,text){node.nodeValue=text;},setElementText:function setElementText(el,text){el.textContent=text;},parentNode:function parentNode(node){return node.parentNode;},nextSibling:function nextSibling(node){return node.nextSibling;},querySelector:function querySelector(selector){return doc.querySelector(selector);},setScopeId:function setScopeId(el,id){el.setAttribute(id,'');},cloneNode:function cloneNode(el){var cloned=el.cloneNode(true);// #3072
  649. // - in `patchDOMProp`, we store the actual value in the `el._value` property.
  650. // - normally, elements using `:value` bindings will not be hoisted, but if
  651. // the bound value is a constant, e.g. `:value="true"` - they do get
  652. // hoisted.
  653. // - in production, hoisted nodes are cloned when subsequent inserts, but
  654. // cloneNode() does not copy the custom property we attached.
  655. // - This may need to account for other custom DOM properties we attach to
  656. // elements in addition to `_value` in the future.
  657. if("_value"in el){cloned._value=el._value;}return cloned;},// __UNSAFE__
  658. // Reason: innerHTML.
  659. // Static content here can only come from compiled templates.
  660. // As long as the user only uses trusted templates, this is safe.
  661. insertStaticContent:function insertStaticContent(content,parent,anchor,isSVG){// <parent> before | first ... last | anchor </parent>
  662. var before=anchor?anchor.previousSibling:parent.lastChild;var template=staticTemplateCache.get(content);if(!template){var t=doc.createElement('template');t.innerHTML=isSVG?"<svg>".concat(content,"</svg>"):content;template=t.content;if(isSVG){// remove outer svg wrapper
  663. var wrapper=template.firstChild;while(wrapper.firstChild){template.appendChild(wrapper.firstChild);}template.removeChild(wrapper);}staticTemplateCache.set(content,template);}parent.insertBefore(template.cloneNode(true),anchor);return[// first
  664. before?before.nextSibling:parent.firstChild,// last
  665. anchor?anchor.previousSibling:parent.lastChild];}};// compiler should normalize class + :class bindings on the same element
  666. // into a single binding ['staticClass', dynamic]
  667. function patchClass(el,value,isSVG){// directly setting className should be faster than setAttribute in theory
  668. // if this is an element during a transition, take the temporary transition
  669. // classes into account.
  670. var transitionClasses=el._vtc;if(transitionClasses){value=(value?[value].concat(_toConsumableArray(transitionClasses)):_toConsumableArray(transitionClasses)).join(' ');}if(value==null){el.removeAttribute('class');}else if(isSVG){el.setAttribute('class',value);}else{el.className=value;}}function patchStyle(el,prev,next){var style=el.style;var isCssString=isString(next);if(next&&!isCssString){for(var key in next){setStyle(style,key,next[key]);}if(prev&&!isString(prev)){for(var _key12 in prev){if(next[_key12]==null){setStyle(style,_key12,'');}}}}else{var currentDisplay=style.display;if(isCssString){if(prev!==next){style.cssText=next;}}else if(prev){el.removeAttribute('style');}// indicates that the `display` of the element is controlled by `v-show`,
  671. // so we always keep the current `display` value regardless of the `style`
  672. // value, thus handing over control to `v-show`.
  673. if('_vod'in el){style.display=currentDisplay;}}}var importantRE=/\s*!important$/;function setStyle(style,name,val){if(isArray(val)){val.forEach(function(v){return setStyle(style,name,v);});}else{if(name.startsWith('--')){// custom property definition
  674. style.setProperty(name,val);}else{var prefixed=autoPrefix(style,name);if(importantRE.test(val)){// !important
  675. style.setProperty(hyphenate(prefixed),val.replace(importantRE,''),'important');}else{style[prefixed]=val;}}}}var prefixes=['Webkit','Moz','ms'];var prefixCache={};function autoPrefix(style,rawName){var cached=prefixCache[rawName];if(cached){return cached;}var name=camelize(rawName);if(name!=='filter'&&name in style){return prefixCache[rawName]=name;}name=capitalize(name);for(var i=0;i<prefixes.length;i++){var prefixed=prefixes[i]+name;if(prefixed in style){return prefixCache[rawName]=prefixed;}}return rawName;}var xlinkNS='http://www.w3.org/1999/xlink';function patchAttr(el,key,value,isSVG,instance){if(isSVG&&key.startsWith('xlink:')){if(value==null){el.removeAttributeNS(xlinkNS,key.slice(6,key.length));}else{el.setAttributeNS(xlinkNS,key,value);}}else{// note we are only checking boolean attributes that don't have a
  676. // corresponding dom prop of the same name here.
  677. var isBoolean=isSpecialBooleanAttr(key);if(value==null||isBoolean&&!includeBooleanAttr(value)){el.removeAttribute(key);}else{el.setAttribute(key,isBoolean?'':value);}}}// __UNSAFE__
  678. // functions. The user is responsible for using them with only trusted content.
  679. function patchDOMProp(el,key,value,// the following args are passed only due to potential innerHTML/textContent
  680. // overriding existing VNodes, in which case the old tree must be properly
  681. // unmounted.
  682. prevChildren,parentComponent,parentSuspense,unmountChildren){if(key==='innerHTML'||key==='textContent'){if(prevChildren){unmountChildren(prevChildren,parentComponent,parentSuspense);}el[key]=value==null?'':value;return;}if(key==='value'&&el.tagName!=='PROGRESS'&&// custom elements may use _value internally
  683. !el.tagName.includes('-')){// store value as _value as well since
  684. // non-string values will be stringified.
  685. el._value=value;var newValue=value==null?'':value;if(el.value!==newValue||// #4956: always set for OPTION elements because its value falls back to
  686. // textContent if no value attribute is present. And setting .value for
  687. // OPTION has no side effect
  688. el.tagName==='OPTION'){el.value=newValue;}if(value==null){el.removeAttribute(key);}return;}if(value===''||value==null){var type=_typeof(el[key]);if(type==='boolean'){// e.g. <select multiple> compiles to { multiple: '' }
  689. el[key]=includeBooleanAttr(value);return;}else if(value==null&&type==='string'){// e.g. <div :id="null">
  690. el[key]='';el.removeAttribute(key);return;}else if(type==='number'){// e.g. <img :width="null">
  691. // the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
  692. try{el[key]=0;}catch(_a){}el.removeAttribute(key);return;}}// some properties perform value validation and throw
  693. try{el[key]=value;}catch(e){}}// Async edge case fix requires storing an event listener's attach timestamp.
  694. var _getNow=Date.now;var skipTimestampCheck=false;if(typeof window!=='undefined'){// Determine what event timestamp the browser is using. Annoyingly, the
  695. // timestamp can either be hi-res (relative to page load) or low-res
  696. // (relative to UNIX epoch), so in order to compare time we have to use the
  697. // same timestamp type when saving the flush timestamp.
  698. if(_getNow()>document.createEvent('Event').timeStamp){// if the low-res timestamp which is bigger than the event timestamp
  699. // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
  700. // and we need to use the hi-res version for event listeners as well.
  701. _getNow=function _getNow(){return performance.now();};}// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
  702. // and does not fire microtasks in between event propagation, so safe to exclude.
  703. var ffMatch=navigator.userAgent.match(/firefox\/(\d+)/i);skipTimestampCheck=!!(ffMatch&&Number(ffMatch[1])<=53);}// To avoid the overhead of repeatedly calling performance.now(), we cache
  704. // and use the same timestamp for all event listeners attached in the same tick.
  705. var cachedNow=0;var p=Promise.resolve();var reset=function reset(){cachedNow=0;};var getNow=function getNow(){return cachedNow||(p.then(reset),cachedNow=_getNow());};function addEventListener(el,event,handler,options){el.addEventListener(event,handler,options);}function removeEventListener(el,event,handler,options){el.removeEventListener(event,handler,options);}function patchEvent(el,rawName,prevValue,nextValue){var instance=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;// vei = vue event invokers
  706. var invokers=el._vei||(el._vei={});var existingInvoker=invokers[rawName];if(nextValue&&existingInvoker){// patch
  707. existingInvoker.value=nextValue;}else{var _parseName=parseName(rawName),_parseName2=_slicedToArray(_parseName,2),name=_parseName2[0],options=_parseName2[1];if(nextValue){// add
  708. var invoker=invokers[rawName]=createInvoker(nextValue,instance);addEventListener(el,name,invoker,options);}else if(existingInvoker){// remove
  709. removeEventListener(el,name,existingInvoker,options);invokers[rawName]=undefined;}}}var optionsModifierRE=/(?:Once|Passive|Capture)$/;function parseName(name){var options;if(optionsModifierRE.test(name)){options={};var m;while(m=name.match(optionsModifierRE)){name=name.slice(0,name.length-m[0].length);options[m[0].toLowerCase()]=true;}}return[hyphenate(name.slice(2)),options];}function createInvoker(initialValue,instance){var invoker=function invoker(e){// async edge case #6566: inner click event triggers patch, event handler
  710. // attached to outer element during patch, and triggered again. This
  711. // happens because browsers fire microtask ticks between event propagation.
  712. // the solution is simple: we save the timestamp when a handler is attached,
  713. // and the handler would only fire if the event passed to it was fired
  714. // AFTER it was attached.
  715. var timeStamp=e.timeStamp||_getNow();if(skipTimestampCheck||timeStamp>=invoker.attached-1){callWithAsyncErrorHandling(patchStopImmediatePropagation(e,invoker.value),instance,5/* NATIVE_EVENT_HANDLER */,[e]);}};invoker.value=initialValue;invoker.attached=getNow();return invoker;}function patchStopImmediatePropagation(e,value){if(isArray(value)){var originalStop=e.stopImmediatePropagation;e.stopImmediatePropagation=function(){originalStop.call(e);e._stopped=true;};return value.map(function(fn){return function(e){return!e._stopped&&fn(e);};});}else{return value;}}var nativeOnRE=/^on[a-z]/;var patchProp=function patchProp(el,key,prevValue,nextValue){var isSVG=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var prevChildren=arguments.length>5?arguments[5]:undefined;var parentComponent=arguments.length>6?arguments[6]:undefined;var parentSuspense=arguments.length>7?arguments[7]:undefined;var unmountChildren=arguments.length>8?arguments[8]:undefined;if(key==='class'){patchClass(el,nextValue,isSVG);}else if(key==='style'){patchStyle(el,prevValue,nextValue);}else if(isOn(key)){// ignore v-model listeners
  716. if(!isModelListener(key)){patchEvent(el,key,prevValue,nextValue,parentComponent);}}else if(key[0]==='.'?(key=key.slice(1),true):key[0]==='^'?(key=key.slice(1),false):shouldSetAsProp(el,key,nextValue,isSVG)){patchDOMProp(el,key,nextValue,prevChildren,parentComponent,parentSuspense,unmountChildren);}else{// special case for <input v-model type="checkbox"> with
  717. // :true-value & :false-value
  718. // store value as dom properties since non-string values will be
  719. // stringified.
  720. if(key==='true-value'){el._trueValue=nextValue;}else if(key==='false-value'){el._falseValue=nextValue;}patchAttr(el,key,nextValue,isSVG);}};function shouldSetAsProp(el,key,value,isSVG){if(isSVG){// most keys must be set as attribute on svg elements to work
  721. // ...except innerHTML & textContent
  722. if(key==='innerHTML'||key==='textContent'){return true;}// or native onclick with function values
  723. if(key in el&&nativeOnRE.test(key)&&isFunction(value)){return true;}return false;}// spellcheck and draggable are numerated attrs, however their
  724. // corresponding DOM properties are actually booleans - this leads to
  725. // setting it with a string "false" value leading it to be coerced to
  726. // `true`, so we need to always treat them as attributes.
  727. // Note that `contentEditable` doesn't have this problem: its DOM
  728. // property is also enumerated string values.
  729. if(key==='spellcheck'||key==='draggable'){return false;}// #1787, #2840 form property on form elements is readonly and must be set as
  730. // attribute.
  731. if(key==='form'){return false;}// #1526 <input list> must be set as attribute
  732. if(key==='list'&&el.tagName==='INPUT'){return false;}// #2766 <textarea type> must be set as attribute
  733. if(key==='type'&&el.tagName==='TEXTAREA'){return false;}// native onclick with string value, must be set as attribute
  734. if(nativeOnRE.test(key)&&isString(value)){return false;}return key in el;}var rendererOptions=extend({patchProp:patchProp},nodeOps);// lazy create the renderer - this makes core renderer logic tree-shakable
  735. // in case the user only imports reactivity utilities from Vue.
  736. var renderer;function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions));}var createApp=exports('f',function(){var _ensureRenderer;var app=(_ensureRenderer=ensureRenderer()).createApp.apply(_ensureRenderer,arguments);var mount=app.mount;app.mount=function(containerOrSelector){var container=normalizeContainer(containerOrSelector);if(!container)return;var component=app._component;if(!isFunction(component)&&!component.render&&!component.template){// __UNSAFE__
  737. // Reason: potential execution of JS expressions in in-DOM template.
  738. // The user must make sure the in-DOM template is trusted. If it's
  739. // rendered by the server, the template should not contain any user data.
  740. component.template=container.innerHTML;}// clear content before mounting
  741. container.innerHTML='';var proxy=mount(container,false,container instanceof SVGElement);if(container instanceof Element){container.removeAttribute('v-cloak');container.setAttribute('data-v-app','');}return proxy;};return app;});function normalizeContainer(container){if(isString(container)){var res=document.querySelector(container);return res;}return container;}/*!
  742. * vue-router v4.0.12
  743. * (c) 2021 Eduardo San Martin Morote
  744. * @license MIT
  745. */var hasSymbol=typeof Symbol==='function'&&_typeof(Symbol.toStringTag)==='symbol';var PolySymbol=function PolySymbol(name){return(// vr = vue router
  746. hasSymbol?Symbol(name):'_vr_'+name);};// rvlm = Router View Location Matched
  747. /**
  748. * RouteRecord being rendered by the closest ancestor Router View. Used for
  749. * `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
  750. * Location Matched
  751. *
  752. * @internal
  753. */var matchedRouteKey=/*#__PURE__*/PolySymbol('rvlm');/**
  754. * Allows overriding the router view depth to control which component in
  755. * `matched` is rendered. rvd stands for Router View Depth
  756. *
  757. * @internal
  758. */var viewDepthKey=/*#__PURE__*/PolySymbol('rvd');/**
  759. * Allows overriding the router instance returned by `useRouter` in tests. r
  760. * stands for router
  761. *
  762. * @internal
  763. */var routerKey=/*#__PURE__*/PolySymbol('r');/**
  764. * Allows overriding the current route returned by `useRoute` in tests. rl
  765. * stands for route location
  766. *
  767. * @internal
  768. */var routeLocationKey=/*#__PURE__*/PolySymbol('rl');/**
  769. * Allows overriding the current route used by router-view. Internally this is
  770. * used when the `route` prop is passed.
  771. *
  772. * @internal
  773. */var routerViewLocationKey=/*#__PURE__*/PolySymbol('rvl');var isBrowser=typeof window!=='undefined';function isESModule(obj){return obj.__esModule||hasSymbol&&obj[Symbol.toStringTag]==='Module';}var assign=Object.assign;function applyToParams(fn,params){var newParams={};for(var key in params){var value=params[key];newParams[key]=Array.isArray(value)?value.map(fn):fn(value);}return newParams;}var noop=function noop(){};var TRAILING_SLASH_RE=/\/$/;var removeTrailingSlash=function removeTrailingSlash(path){return path.replace(TRAILING_SLASH_RE,'');};/**
  774. * Transforms an URI into a normalized history location
  775. *
  776. * @param parseQuery
  777. * @param location - URI to normalize
  778. * @param currentLocation - current absolute location. Allows resolving relative
  779. * paths. Must start with `/`. Defaults to `/`
  780. * @returns a normalized history location
  781. */function parseURL(parseQuery,location){var currentLocation=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'/';var path,query={},searchString='',hash='';// Could use URL and URLSearchParams but IE 11 doesn't support it
  782. var searchPos=location.indexOf('?');var hashPos=location.indexOf('#',searchPos>-1?searchPos:0);if(searchPos>-1){path=location.slice(0,searchPos);searchString=location.slice(searchPos+1,hashPos>-1?hashPos:location.length);query=parseQuery(searchString);}if(hashPos>-1){path=path||location.slice(0,hashPos);// keep the # character
  783. hash=location.slice(hashPos,location.length);}// no search and no query
  784. path=resolveRelativePath(path!=null?path:location,currentLocation);// empty path means a relative query or hash `?foo=f`, `#thing`
  785. return{fullPath:path+(searchString&&'?')+searchString+hash,path:path,query:query,hash:hash};}/**
  786. * Stringifies a URL object
  787. *
  788. * @param stringifyQuery
  789. * @param location
  790. */function stringifyURL(stringifyQuery,location){var query=location.query?stringifyQuery(location.query):'';return location.path+(query&&'?')+query+(location.hash||'');}/**
  791. * Strips off the base from the beginning of a location.pathname in a non
  792. * case-sensitive way.
  793. *
  794. * @param pathname - location.pathname
  795. * @param base - base to strip off
  796. */function stripBase(pathname,base){// no base or base is not found at the beginning
  797. if(!base||!pathname.toLowerCase().startsWith(base.toLowerCase()))return pathname;return pathname.slice(base.length)||'/';}/**
  798. * Checks if two RouteLocation are equal. This means that both locations are
  799. * pointing towards the same {@link RouteRecord} and that all `params`, `query`
  800. * parameters and `hash` are the same
  801. *
  802. * @param a - first {@link RouteLocation}
  803. * @param b - second {@link RouteLocation}
  804. */function isSameRouteLocation(stringifyQuery,a,b){var aLastIndex=a.matched.length-1;var bLastIndex=b.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a.matched[aLastIndex],b.matched[bLastIndex])&&isSameRouteLocationParams(a.params,b.params)&&stringifyQuery(a.query)===stringifyQuery(b.query)&&a.hash===b.hash;}/**
  805. * Check if two `RouteRecords` are equal. Takes into account aliases: they are
  806. * considered equal to the `RouteRecord` they are aliasing.
  807. *
  808. * @param a - first {@link RouteRecord}
  809. * @param b - second {@link RouteRecord}
  810. */function isSameRouteRecord(a,b){// since the original record has an undefined value for aliasOf
  811. // but all aliases point to the original record, this will always compare
  812. // the original record
  813. return(a.aliasOf||a)===(b.aliasOf||b);}function isSameRouteLocationParams(a,b){if(Object.keys(a).length!==Object.keys(b).length)return false;for(var key in a){if(!isSameRouteLocationParamsValue(a[key],b[key]))return false;}return true;}function isSameRouteLocationParamsValue(a,b){return Array.isArray(a)?isEquivalentArray(a,b):Array.isArray(b)?isEquivalentArray(b,a):a===b;}/**
  814. * Check if two arrays are the same or if an array with one single entry is the
  815. * same as another primitive value. Used to check query and parameters
  816. *
  817. * @param a - array of values
  818. * @param b - array of values or a single value
  819. */function isEquivalentArray(a,b){return Array.isArray(b)?a.length===b.length&&a.every(function(value,i){return value===b[i];}):a.length===1&&a[0]===b;}/**
  820. * Resolves a relative path that starts with `.`.
  821. *
  822. * @param to - path location we are resolving
  823. * @param from - currentLocation.path, should start with `/`
  824. */function resolveRelativePath(to,from){if(to.startsWith('/'))return to;if(!to)return from;var fromSegments=from.split('/');var toSegments=to.split('/');var position=fromSegments.length-1;var toPosition;var segment;for(toPosition=0;toPosition<toSegments.length;toPosition++){segment=toSegments[toPosition];// can't go below zero
  825. if(position===1||segment==='.')continue;if(segment==='..')position--;// found something that is not relative path
  826. else break;}return fromSegments.slice(0,position).join('/')+'/'+toSegments.slice(toPosition-(toPosition===toSegments.length?1:0)).join('/');}var NavigationType;(function(NavigationType){NavigationType["pop"]="pop";NavigationType["push"]="push";})(NavigationType||(NavigationType={}));var NavigationDirection;(function(NavigationDirection){NavigationDirection["back"]="back";NavigationDirection["forward"]="forward";NavigationDirection["unknown"]="";})(NavigationDirection||(NavigationDirection={}));// Generic utils
  827. /**
  828. * Normalizes a base by removing any trailing slash and reading the base tag if
  829. * present.
  830. *
  831. * @param base - base to normalize
  832. */function normalizeBase(base){if(!base){if(isBrowser){// respect <base> tag
  833. var baseEl=document.querySelector('base');base=baseEl&&baseEl.getAttribute('href')||'/';// strip full URL origin
  834. base=base.replace(/^\w+:\/\/[^\/]+/,'');}else{base='/';}}// ensure leading slash when it was removed by the regex above avoid leading
  835. // slash with hash because the file could be read from the disk like file://
  836. // and the leading slash would cause problems
  837. if(base[0]!=='/'&&base[0]!=='#')base='/'+base;// remove the trailing slash so all other method can just do `base + fullPath`
  838. // to build an href
  839. return removeTrailingSlash(base);}// remove any character before the hash
  840. var BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location){return base.replace(BEFORE_HASH_RE,'#')+location;}function getElementPosition(el,offset){var docRect=document.documentElement.getBoundingClientRect();var elRect=el.getBoundingClientRect();return{behavior:offset.behavior,left:elRect.left-docRect.left-(offset.left||0),top:elRect.top-docRect.top-(offset.top||0)};}var computeScrollPosition=function computeScrollPosition(){return{left:window.pageXOffset,top:window.pageYOffset};};function scrollToPosition(position){var scrollToOptions;if('el'in position){var positionEl=position.el;var isIdSelector=typeof positionEl==='string'&&positionEl.startsWith('#');var el=typeof positionEl==='string'?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el){return;}scrollToOptions=getElementPosition(el,position);}else{scrollToOptions=position;}if('scrollBehavior'in document.documentElement.style)window.scrollTo(scrollToOptions);else{window.scrollTo(scrollToOptions.left!=null?scrollToOptions.left:window.pageXOffset,scrollToOptions.top!=null?scrollToOptions.top:window.pageYOffset);}}function getScrollKey(path,delta){var position=history.state?history.state.position-delta:-1;return position+path;}var scrollPositions=new Map();function saveScrollPosition(key,scrollPosition){scrollPositions.set(key,scrollPosition);}function getSavedScrollPosition(key){var scroll=scrollPositions.get(key);// consume it so it's not used again
  841. scrollPositions.delete(key);return scroll;}// TODO: RFC about how to save scroll position
  842. /**
  843. * ScrollBehavior instance used by the router to compute and restore the scroll
  844. * position when navigating.
  845. */ // export interface ScrollHandler<ScrollPositionEntry extends HistoryStateValue, ScrollPosition extends ScrollPositionEntry> {
  846. // // returns a scroll position that can be saved in history
  847. // compute(): ScrollPositionEntry
  848. // // can take an extended ScrollPositionEntry
  849. // scroll(position: ScrollPosition): void
  850. // }
  851. // export const scrollHandler: ScrollHandler<ScrollPosition> = {
  852. // compute: computeScroll,
  853. // scroll: scrollToPosition,
  854. // }
  855. var createBaseLocation=function createBaseLocation(){return location.protocol+'//'+location.host;};/**
  856. * Creates a normalized history location from a window.location object
  857. * @param location -
  858. */function createCurrentLocation(base,location){var pathname=location.pathname,search=location.search,hash=location.hash;// allows hash bases like #, /#, #/, #!, #!/, /#!/, or even /folder#end
  859. var hashPos=base.indexOf('#');if(hashPos>-1){var slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1;var pathFromHash=hash.slice(slicePos);// prepend the starting slash to hash so the url starts with /#
  860. if(pathFromHash[0]!=='/')pathFromHash='/'+pathFromHash;return stripBase(pathFromHash,'');}var path=stripBase(pathname,base);return path+search+hash;}function useHistoryListeners(base,historyState,currentLocation,replace){var listeners=[];var teardowns=[];// TODO: should it be a stack? a Dict. Check if the popstate listener
  861. // can trigger twice
  862. var pauseState=null;var popStateHandler=function popStateHandler(_ref14){var state=_ref14.state;var to=createCurrentLocation(base,location);var from=currentLocation.value;var fromState=historyState.value;var delta=0;if(state){currentLocation.value=to;historyState.value=state;// ignore the popstate and reset the pauseState
  863. if(pauseState&&pauseState===from){pauseState=null;return;}delta=fromState?state.position-fromState.position:0;}else{replace(to);}// console.log({ deltaFromCurrent })
  864. // Here we could also revert the navigation by calling history.go(-delta)
  865. // this listener will have to be adapted to not trigger again and to wait for the url
  866. // to be updated before triggering the listeners. Some kind of validation function would also
  867. // need to be passed to the listeners so the navigation can be accepted
  868. // call all listeners
  869. listeners.forEach(function(listener){listener(currentLocation.value,from,{delta:delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown});});};function pauseListeners(){pauseState=currentLocation.value;}function listen(callback){// setup the listener and prepare teardown callbacks
  870. listeners.push(callback);var teardown=function teardown(){var index=listeners.indexOf(callback);if(index>-1)listeners.splice(index,1);};teardowns.push(teardown);return teardown;}function beforeUnloadListener(){var _window=window,history=_window.history;if(!history.state)return;history.replaceState(assign({},history.state,{scroll:computeScrollPosition()}),'');}function destroy(){var _iterator3=_createForOfIteratorHelper(teardowns),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var teardown=_step3.value;teardown();}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}teardowns=[];window.removeEventListener('popstate',popStateHandler);window.removeEventListener('beforeunload',beforeUnloadListener);}// setup the listeners and prepare teardown callbacks
  871. window.addEventListener('popstate',popStateHandler);window.addEventListener('beforeunload',beforeUnloadListener);return{pauseListeners:pauseListeners,listen:listen,destroy:destroy};}/**
  872. * Creates a state object
  873. */function buildState(back,current,forward){var replaced=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var computeScroll=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;return{back:back,current:current,forward:forward,replaced:replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null};}function useHistoryStateNavigation(base){var _window2=window,history=_window2.history,location=_window2.location;// private variables
  874. var currentLocation={value:createCurrentLocation(base,location)};var historyState={value:history.state};// build current history entry as this is a fresh navigation
  875. if(!historyState.value){changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,// the length is off by one, we need to decrease it
  876. position:history.length-1,replaced:true,// don't add a scroll as the user may have an anchor and we want
  877. // scrollBehavior to be triggered without a saved position
  878. scroll:null},true);}function changeLocation(to,state,replace){/**
  879. * if a base tag is provided and we are on a normal domain, we have to
  880. * respect the provided `base` attribute because pushState() will use it and
  881. * potentially erase anything before the `#` like at
  882. * https://github.com/vuejs/vue-router-next/issues/685 where a base of
  883. * `/folder/#` but a base of `/` would erase the `/folder/` section. If
  884. * there is no host, the `<base>` tag makes no sense and if there isn't a
  885. * base tag we can just use everything after the `#`.
  886. */var hashIndex=base.indexOf('#');var url=hashIndex>-1?(location.host&&document.querySelector('base')?base:base.slice(hashIndex))+to:createBaseLocation()+base+to;try{// BROWSER QUIRK
  887. // NOTE: Safari throws a SecurityError when calling this function 100 times in 30 seconds
  888. history[replace?'replaceState':'pushState'](state,'',url);historyState.value=state;}catch(err){{console.error(err);}// Force the navigation, this also resets the call count
  889. location[replace?'replace':'assign'](url);}}function replace(to,data){var state=assign({},history.state,buildState(historyState.value.back,// keep back and forward entries but override current position
  890. to,historyState.value.forward,true),data,{position:historyState.value.position});changeLocation(to,state,true);currentLocation.value=to;}function push(to,data){// Add to current entry the information of where we are going
  891. // as well as saving the current position
  892. var currentState=assign({},// use current history state to gracefully handle a wrong call to
  893. // history.replaceState
  894. // https://github.com/vuejs/vue-router-next/issues/366
  895. historyState.value,history.state,{forward:to,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,true);var state=assign({},buildState(currentLocation.value,to,null),{position:currentState.position+1},data);changeLocation(to,state,false);currentLocation.value=to;}return{location:currentLocation,state:historyState,push:push,replace:replace};}/**
  896. * Creates an HTML5 history. Most common history for single page applications.
  897. *
  898. * @param base -
  899. */function createWebHistory(base){base=normalizeBase(base);var historyNavigation=useHistoryStateNavigation(base);var historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta){var triggerListeners=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(!triggerListeners)historyListeners.pauseListeners();history.go(delta);}var routerHistory=assign({// it's overridden right after
  900. location:'',base:base,go:go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);Object.defineProperty(routerHistory,'location',{enumerable:true,get:function get(){return historyNavigation.location.value;}});Object.defineProperty(routerHistory,'state',{enumerable:true,get:function get(){return historyNavigation.state.value;}});return routerHistory;}/**
  901. * Creates a hash history. Useful for web applications with no host (e.g.
  902. * `file://`) or when configuring a server to handle any URL is not possible.
  903. *
  904. * @param base - optional base to provide. Defaults to `location.pathname +
  905. * location.search` If there is a `<base>` tag in the `head`, its value will be
  906. * ignored in favor of this parameter **but note it affects all the
  907. * history.pushState() calls**, meaning that if you use a `<base>` tag, it's
  908. * `href` value **has to match this parameter** (ignoring anything after the
  909. * `#`).
  910. *
  911. * @example
  912. * ```js
  913. * // at https://example.com/folder
  914. * createWebHashHistory() // gives a url of `https://example.com/folder#`
  915. * createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
  916. * // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
  917. * createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
  918. * // you should avoid doing this because it changes the original url and breaks copying urls
  919. * createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
  920. *
  921. * // at file:///usr/etc/folder/index.html
  922. * // for locations with no `host`, the base is ignored
  923. * createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
  924. * ```
  925. */function createWebHashHistory(base){// Make sure this implementation is fine in terms of encoding, specially for IE11
  926. // for `file://`, directly use the pathname and ignore the base
  927. // location.pathname contains an initial `/` even at the root: `https://example.com`
  928. base=location.host?base||location.pathname+location.search:'';// allow the user to provide a `#` in the middle: `/base/#/app`
  929. if(!base.includes('#'))base+='#';return createWebHistory(base);}function isRouteLocation(route){return typeof route==='string'||route&&_typeof(route)==='object';}function isRouteName(name){return typeof name==='string'||_typeof(name)==='symbol';}/**
  930. * Initial route location where the router is. Can be used in navigation guards
  931. * to differentiate the initial navigation.
  932. *
  933. * @example
  934. * ```js
  935. * import { START_LOCATION } from 'vue-router'
  936. *
  937. * router.beforeEach((to, from) => {
  938. * if (from === START_LOCATION) {
  939. * // initial navigation
  940. * }
  941. * })
  942. * ```
  943. */var START_LOCATION_NORMALIZED={path:'/',name:undefined,params:{},query:{},hash:'',fullPath:'/',matched:[],meta:{},redirectedFrom:undefined};var NavigationFailureSymbol=/*#__PURE__*/PolySymbol('nf');/**
  944. * Enumeration with all possible types for navigation failures. Can be passed to
  945. * {@link isNavigationFailure} to check for specific failures.
  946. */var NavigationFailureType;(function(NavigationFailureType){/**
  947. * An aborted navigation is a navigation that failed because a navigation
  948. * guard returned `false` or called `next(false)`
  949. */NavigationFailureType[NavigationFailureType["aborted"]=4]="aborted";/**
  950. * A cancelled navigation is a navigation that failed because a more recent
  951. * navigation finished started (not necessarily finished).
  952. */NavigationFailureType[NavigationFailureType["cancelled"]=8]="cancelled";/**
  953. * A duplicated navigation is a navigation that failed because it was
  954. * initiated while already being at the exact same location.
  955. */NavigationFailureType[NavigationFailureType["duplicated"]=16]="duplicated";})(NavigationFailureType||(NavigationFailureType={}));function createRouterError(type,params){// keep full error messages in cjs versions
  956. {return assign(new Error(),_defineProperty({type:type},NavigationFailureSymbol,true),params);}}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type));}// default pattern for a param: non greedy everything but /
  957. var BASE_PARAM_PATTERN='[^/]+?';var BASE_PATH_PARSER_OPTIONS={sensitive:false,strict:false,start:true,end:true};// Special Regex characters that must be escaped in static tokens
  958. var REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;/**
  959. * Creates a path parser from an array of Segments (a segment is an array of Tokens)
  960. *
  961. * @param segments - array of segments returned by tokenizePath
  962. * @param extraOptions - optional options for the regexp
  963. * @returns a PathParser
  964. */function tokensToParser(segments,extraOptions){var options=assign({},BASE_PATH_PARSER_OPTIONS,extraOptions);// the amount of scores is the same as the length of segments except for the root segment "/"
  965. var score=[];// the regexp as a string
  966. var pattern=options.start?'^':'';// extracted keys
  967. var keys=[];var _iterator4=_createForOfIteratorHelper(segments),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var segment=_step4.value;// the root segment needs special treatment
  968. var segmentScores=segment.length?[]:[90/* Root */];// allow trailing slash
  969. if(options.strict&&!segment.length)pattern+='/';for(var tokenIndex=0;tokenIndex<segment.length;tokenIndex++){var token=segment[tokenIndex];// resets the score if we are inside a sub segment /:a-other-:b
  970. var subSegmentScore=40/* Segment */+(options.sensitive?0.25/* BonusCaseSensitive */:0);if(token.type===0/* Static */){// prepend the slash if we are starting a new segment
  971. if(!tokenIndex)pattern+='/';pattern+=token.value.replace(REGEX_CHARS_RE,'\\$&');subSegmentScore+=40/* Static */;}else if(token.type===1/* Param */){var value=token.value,repeatable=token.repeatable,optional=token.optional,regexp=token.regexp;keys.push({name:value,repeatable:repeatable,optional:optional});var _re=regexp?regexp:BASE_PARAM_PATTERN;// the user provided a custom regexp /:id(\\d+)
  972. if(_re!==BASE_PARAM_PATTERN){subSegmentScore+=10/* BonusCustomRegExp */;// make sure the regexp is valid before using it
  973. try{new RegExp("(".concat(_re,")"));}catch(err){throw new Error("Invalid custom RegExp for param \"".concat(value,"\" (").concat(_re,"): ")+err.message);}}// when we repeat we must take care of the repeating leading slash
  974. var subPattern=repeatable?"((?:".concat(_re,")(?:/(?:").concat(_re,"))*)"):"(".concat(_re,")");// prepend the slash if we are starting a new segment
  975. if(!tokenIndex)subPattern=// avoid an optional / if there are more segments e.g. /:p?-static
  976. // or /:p?-:p2
  977. optional&&segment.length<2?"(?:/".concat(subPattern,")"):'/'+subPattern;if(optional)subPattern+='?';pattern+=subPattern;subSegmentScore+=20/* Dynamic */;if(optional)subSegmentScore+=-8/* BonusOptional */;if(repeatable)subSegmentScore+=-20/* BonusRepeatable */;if(_re==='.*')subSegmentScore+=-50/* BonusWildcard */;}segmentScores.push(subSegmentScore);}// an empty array like /home/ -> [[{home}], []]
  978. // if (!segment.length) pattern += '/'
  979. score.push(segmentScores);}// only apply the strict bonus to the last score
  980. }catch(err){_iterator4.e(err);}finally{_iterator4.f();}if(options.strict&&options.end){var i=score.length-1;score[i][score[i].length-1]+=0.7000000000000001/* BonusStrict */;}// TODO: dev only warn double trailing slash
  981. if(!options.strict)pattern+='/?';if(options.end)pattern+='$';// allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else
  982. else if(options.strict)pattern+='(?:/|$)';var re=new RegExp(pattern,options.sensitive?'':'i');function parse(path){var match=path.match(re);var params={};if(!match)return null;for(var _i2=1;_i2<match.length;_i2++){var value=match[_i2]||'';var key=keys[_i2-1];params[key.name]=value&&key.repeatable?value.split('/'):value;}return params;}function stringify(params){var path='';// for optional parameters to allow to be empty
  983. var avoidDuplicatedSlash=false;var _iterator5=_createForOfIteratorHelper(segments),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var segment=_step5.value;if(!avoidDuplicatedSlash||!path.endsWith('/'))path+='/';avoidDuplicatedSlash=false;var _iterator6=_createForOfIteratorHelper(segment),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var token=_step6.value;if(token.type===0/* Static */){path+=token.value;}else if(token.type===1/* Param */){var value=token.value,repeatable=token.repeatable,optional=token.optional;var param=value in params?params[value]:'';if(Array.isArray(param)&&!repeatable)throw new Error("Provided param \"".concat(value,"\" is an array but it is not repeatable (* or + modifiers)"));var text=Array.isArray(param)?param.join('/'):param;if(!text){if(optional){// if we have more than one optional param like /:a?-static we
  984. // don't need to care about the optional param
  985. if(segment.length<2){// remove the last slash as we could be at the end
  986. if(path.endsWith('/'))path=path.slice(0,-1);// do not append a slash on the next iteration
  987. else avoidDuplicatedSlash=true;}}else throw new Error("Missing required param \"".concat(value,"\""));}path+=text;}}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}return path;}return{re:re,score:score,keys:keys,parse:parse,stringify:stringify};}/**
  988. * Compares an array of numbers as used in PathParser.score and returns a
  989. * number. This function can be used to `sort` an array
  990. *
  991. * @param a - first array of numbers
  992. * @param b - second array of numbers
  993. * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
  994. * should be sorted first
  995. */function compareScoreArray(a,b){var i=0;while(i<a.length&&i<b.length){var diff=b[i]-a[i];// only keep going if diff === 0
  996. if(diff)return diff;i++;}// if the last subsegment was Static, the shorter segments should be sorted first
  997. // otherwise sort the longest segment first
  998. if(a.length<b.length){return a.length===1&&a[0]===40/* Static */+40/* Segment */?-1:1;}else if(a.length>b.length){return b.length===1&&b[0]===40/* Static */+40/* Segment */?1:-1;}return 0;}/**
  999. * Compare function that can be used with `sort` to sort an array of PathParser
  1000. *
  1001. * @param a - first PathParser
  1002. * @param b - second PathParser
  1003. * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
  1004. */function comparePathParserScore(a,b){var i=0;var aScore=a.score;var bScore=b.score;while(i<aScore.length&&i<bScore.length){var comp=compareScoreArray(aScore[i],bScore[i]);// do not return if both are equal
  1005. if(comp)return comp;i++;}// if a and b share the same score entries but b has more, sort b first
  1006. return bScore.length-aScore.length;// this is the ternary version
  1007. // return aScore.length < bScore.length
  1008. // ? 1
  1009. // : aScore.length > bScore.length
  1010. // ? -1
  1011. // : 0
  1012. }var ROOT_TOKEN={type:0/* Static */,value:''};var VALID_PARAM_RE=/[a-zA-Z0-9_]/;// After some profiling, the cache seems to be unnecessary because tokenizePath
  1013. // (the slowest part of adding a route) is very fast
  1014. // const tokenCache = new Map<string, Token[][]>()
  1015. function tokenizePath(path){if(!path)return[[]];if(path==='/')return[[ROOT_TOKEN]];if(!path.startsWith('/')){throw new Error("Invalid path \"".concat(path,"\""));}// if (tokenCache.has(path)) return tokenCache.get(path)!
  1016. function crash(message){throw new Error("ERR (".concat(state,")/\"").concat(buffer,"\": ").concat(message));}var state=0/* Static */;var previousState=state;var tokens=[];// the segment will always be valid because we get into the initial state
  1017. // with the leading /
  1018. var segment;function finalizeSegment(){if(segment)tokens.push(segment);segment=[];}// index on the path
  1019. var i=0;// char at index
  1020. var char;// buffer of the value read
  1021. var buffer='';// custom regexp for a param
  1022. var customRe='';function consumeBuffer(){if(!buffer)return;if(state===0/* Static */){segment.push({type:0/* Static */,value:buffer});}else if(state===1/* Param */||state===2/* ParamRegExp */||state===3/* ParamRegExpEnd */){if(segment.length>1&&(char==='*'||char==='+'))crash("A repeatable param (".concat(buffer,") must be alone in its segment. eg: '/:ids+."));segment.push({type:1/* Param */,value:buffer,regexp:customRe,repeatable:char==='*'||char==='+',optional:char==='*'||char==='?'});}else{crash('Invalid state to consume buffer');}buffer='';}function addCharToBuffer(){buffer+=char;}while(i<path.length){char=path[i++];if(char==='\\'&&state!==2/* ParamRegExp */){previousState=state;state=4/* EscapeNext */;continue;}switch(state){case 0/* Static */:if(char==='/'){if(buffer){consumeBuffer();}finalizeSegment();}else if(char===':'){consumeBuffer();state=1/* Param */;}else{addCharToBuffer();}break;case 4/* EscapeNext */:addCharToBuffer();state=previousState;break;case 1/* Param */:if(char==='('){state=2/* ParamRegExp */;}else if(VALID_PARAM_RE.test(char)){addCharToBuffer();}else{consumeBuffer();state=0/* Static */;// go back one character if we were not modifying
  1023. if(char!=='*'&&char!=='?'&&char!=='+')i--;}break;case 2/* ParamRegExp */:// TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)
  1024. // it already works by escaping the closing )
  1025. // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#
  1026. // is this really something people need since you can also write
  1027. // /prefix_:p()_suffix
  1028. if(char===')'){// handle the escaped )
  1029. if(customRe[customRe.length-1]=='\\')customRe=customRe.slice(0,-1)+char;else state=3/* ParamRegExpEnd */;}else{customRe+=char;}break;case 3/* ParamRegExpEnd */:// same as finalizing a param
  1030. consumeBuffer();state=0/* Static */;// go back one character if we were not modifying
  1031. if(char!=='*'&&char!=='?'&&char!=='+')i--;customRe='';break;default:crash('Unknown state');break;}}if(state===2/* ParamRegExp */)crash("Unfinished custom RegExp for param \"".concat(buffer,"\""));consumeBuffer();finalizeSegment();// tokenCache.set(path, tokens)
  1032. return tokens;}function createRouteRecordMatcher(record,parent,options){var parser=tokensToParser(tokenizePath(record.path),options);var matcher=assign(parser,{record:record,parent:parent,// these needs to be populated by the parent
  1033. children:[],alias:[]});if(parent){// both are aliases or both are not aliases
  1034. // we don't want to mix them because the order is used when
  1035. // passing originalRecord in Matcher.addRoute
  1036. if(!matcher.record.aliasOf===!parent.record.aliasOf)parent.children.push(matcher);}return matcher;}/**
  1037. * Creates a Router Matcher.
  1038. *
  1039. * @internal
  1040. * @param routes - array of initial routes
  1041. * @param globalOptions - global route options
  1042. */function createRouterMatcher(routes,globalOptions){// normalized ordered array of matchers
  1043. var matchers=[];var matcherMap=new Map();globalOptions=mergeOptions({strict:false,end:true,sensitive:false},globalOptions);function getRecordMatcher(name){return matcherMap.get(name);}function addRoute(record,parent,originalRecord){// used later on to remove by name
  1044. var isRootAdd=!originalRecord;var mainNormalizedRecord=normalizeRouteRecord(record);// we might be the child of an alias
  1045. mainNormalizedRecord.aliasOf=originalRecord&&originalRecord.record;var options=mergeOptions(globalOptions,record);// generate an array of records to correctly handle aliases
  1046. var normalizedRecords=[mainNormalizedRecord];if('alias'in record){var aliases=typeof record.alias==='string'?[record.alias]:record.alias;var _iterator7=_createForOfIteratorHelper(aliases),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var alias=_step7.value;normalizedRecords.push(assign({},mainNormalizedRecord,{// this allows us to hold a copy of the `components` option
  1047. // so that async components cache is hold on the original record
  1048. components:originalRecord?originalRecord.record.components:mainNormalizedRecord.components,path:alias,// we might be the child of an alias
  1049. aliasOf:originalRecord?originalRecord.record:mainNormalizedRecord// the aliases are always of the same kind as the original since they
  1050. // are defined on the same record
  1051. }));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}var matcher;var originalMatcher;for(var _i3=0,_normalizedRecords=normalizedRecords;_i3<_normalizedRecords.length;_i3++){var normalizedRecord=_normalizedRecords[_i3];var path=normalizedRecord.path;// Build up the path for nested routes if the child isn't an absolute
  1052. // route. Only add the / delimiter if the child path isn't empty and if the
  1053. // parent path doesn't have a trailing slash
  1054. if(parent&&path[0]!=='/'){var parentPath=parent.record.path;var connectingSlash=parentPath[parentPath.length-1]==='/'?'':'/';normalizedRecord.path=parent.record.path+(path&&connectingSlash+path);}// create the object before hand so it can be passed to children
  1055. matcher=createRouteRecordMatcher(normalizedRecord,parent,options);// if we are an alias we must tell the original record that we exist
  1056. // so we can be removed
  1057. if(originalRecord){originalRecord.alias.push(matcher);}else{// otherwise, the first record is the original and others are aliases
  1058. originalMatcher=originalMatcher||matcher;if(originalMatcher!==matcher)originalMatcher.alias.push(matcher);// remove the route if named and only for the top record (avoid in nested calls)
  1059. // this works because the original record is the first one
  1060. if(isRootAdd&&record.name&&!isAliasRecord(matcher))removeRoute(record.name);}if('children'in mainNormalizedRecord){var children=mainNormalizedRecord.children;for(var i=0;i<children.length;i++){addRoute(children[i],matcher,originalRecord&&originalRecord.children[i]);}}// if there was no original record, then the first one was not an alias and all
  1061. // other alias (if any) need to reference this record when adding children
  1062. originalRecord=originalRecord||matcher;// TODO: add normalized records for more flexibility
  1063. // if (parent && isAliasRecord(originalRecord)) {
  1064. // parent.children.push(originalRecord)
  1065. // }
  1066. insertMatcher(matcher);}return originalMatcher?function(){// since other matchers are aliases, they should be removed by the original matcher
  1067. removeRoute(originalMatcher);}:noop;}function removeRoute(matcherRef){if(isRouteName(matcherRef)){var matcher=matcherMap.get(matcherRef);if(matcher){matcherMap.delete(matcherRef);matchers.splice(matchers.indexOf(matcher),1);matcher.children.forEach(removeRoute);matcher.alias.forEach(removeRoute);}}else{var index=matchers.indexOf(matcherRef);if(index>-1){matchers.splice(index,1);if(matcherRef.record.name)matcherMap.delete(matcherRef.record.name);matcherRef.children.forEach(removeRoute);matcherRef.alias.forEach(removeRoute);}}}function getRoutes(){return matchers;}function insertMatcher(matcher){var i=0;// console.log('i is', { i })
  1068. while(i<matchers.length&&comparePathParserScore(matcher,matchers[i])>=0){i++;}// console.log('END i is', { i })
  1069. // while (i < matchers.length && matcher.score <= matchers[i].score) i++
  1070. matchers.splice(i,0,matcher);// only add the original record to the name map
  1071. if(matcher.record.name&&!isAliasRecord(matcher))matcherMap.set(matcher.record.name,matcher);}function resolve(location,currentLocation){var matcher;var params={};var path;var name;if('name'in location&&location.name){matcher=matcherMap.get(location.name);if(!matcher)throw createRouterError(1/* MATCHER_NOT_FOUND */,{location:location});name=matcher.record.name;params=assign(// paramsFromLocation is a new object
  1072. paramsFromLocation(currentLocation.params,// only keep params that exist in the resolved location
  1073. // TODO: only keep optional params coming from a parent record
  1074. matcher.keys.filter(function(k){return!k.optional;}).map(function(k){return k.name;})),location.params);// throws if cannot be stringified
  1075. path=matcher.stringify(params);}else if('path'in location){// no need to resolve the path with the matcher as it was provided
  1076. // this also allows the user to control the encoding
  1077. path=location.path;matcher=matchers.find(function(m){return m.re.test(path);});// matcher should have a value after the loop
  1078. if(matcher){// TODO: dev warning of unused params if provided
  1079. // we know the matcher works because we tested the regexp
  1080. params=matcher.parse(path);name=matcher.record.name;}// location is a relative path
  1081. }else{// match by name or path of current route
  1082. matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(function(m){return m.re.test(currentLocation.path);});if(!matcher)throw createRouterError(1/* MATCHER_NOT_FOUND */,{location:location,currentLocation:currentLocation});name=matcher.record.name;// since we are navigating to the same location, we don't need to pick the
  1083. // params like when `name` is provided
  1084. params=assign({},currentLocation.params,location.params);path=matcher.stringify(params);}var matched=[];var parentMatcher=matcher;while(parentMatcher){// reversed order so parents are at the beginning
  1085. matched.unshift(parentMatcher.record);parentMatcher=parentMatcher.parent;}return{name:name,path:path,params:params,matched:matched,meta:mergeMetaFields(matched)};}// add initial routes
  1086. routes.forEach(function(route){return addRoute(route);});return{addRoute:addRoute,resolve:resolve,removeRoute:removeRoute,getRoutes:getRoutes,getRecordMatcher:getRecordMatcher};}function paramsFromLocation(params,keys){var newParams={};var _iterator8=_createForOfIteratorHelper(keys),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var key=_step8.value;if(key in params)newParams[key]=params[key];}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}return newParams;}/**
  1087. * Normalizes a RouteRecordRaw. Creates a copy
  1088. *
  1089. * @param record
  1090. * @returns the normalized version
  1091. */function normalizeRouteRecord(record){return{path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:undefined,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set(),updateGuards:new Set(),enterCallbacks:{},components:'components'in record?record.components||{}:{default:record.component}};}/**
  1092. * Normalize the optional `props` in a record to always be an object similar to
  1093. * components. Also accept a boolean for components.
  1094. * @param record
  1095. */function normalizeRecordProps(record){var propsObject={};// props does not exist on redirect records but we can set false directly
  1096. var props=record.props||false;if('component'in record){propsObject.default=props;}else{// NOTE: we could also allow a function to be applied to every component.
  1097. // Would need user feedback for use cases
  1098. for(var name in record.components){propsObject[name]=typeof props==='boolean'?props:props[name];}}return propsObject;}/**
  1099. * Checks if a record or any of its parent is an alias
  1100. * @param record
  1101. */function isAliasRecord(record){while(record){if(record.record.aliasOf)return true;record=record.parent;}return false;}/**
  1102. * Merge meta fields of an array of records
  1103. *
  1104. * @param matched - array of matched records
  1105. */function mergeMetaFields(matched){return matched.reduce(function(meta,record){return assign(meta,record.meta);},{});}function mergeOptions(defaults,partialOptions){var options={};for(var key in defaults){options[key]=key in partialOptions?partialOptions[key]:defaults[key];}return options;}/**
  1106. * Encoding Rules ␣ = Space Path: ␣ " < > # ? { } Query: ␣ " < > # & = Hash: ␣ "
  1107. * < > `
  1108. *
  1109. * On top of that, the RFC3986 (https://tools.ietf.org/html/rfc3986#section-2.2)
  1110. * defines some extra characters to be encoded. Most browsers do not encode them
  1111. * in encodeURI https://github.com/whatwg/url/issues/369, so it may be safer to
  1112. * also encode `!'()*`. Leaving unencoded only ASCII alphanumeric(`a-zA-Z0-9`)
  1113. * plus `-._~`. This extra safety should be applied to query by patching the
  1114. * string returned by encodeURIComponent encodeURI also encodes `[\]^`. `\`
  1115. * should be encoded to avoid ambiguity. Browsers (IE, FF, C) transform a `\`
  1116. * into a `/` if directly typed in. The _backtick_ (`````) should also be
  1117. * encoded everywhere because some browsers like FF encode it when directly
  1118. * written while others don't. Safari and IE don't encode ``"<>{}``` in hash.
  1119. */ // const EXTRA_RESERVED_RE = /[!'()*]/g
  1120. // const encodeReservedReplacer = (c: string) => '%' + c.charCodeAt(0).toString(16)
  1121. var HASH_RE=/#/g;// %23
  1122. var AMPERSAND_RE=/&/g;// %26
  1123. var SLASH_RE=/\//g;// %2F
  1124. var EQUAL_RE=/=/g;// %3D
  1125. var IM_RE=/\?/g;// %3F
  1126. var PLUS_RE=/\+/g;// %2B
  1127. /**
  1128. * NOTE: It's not clear to me if we should encode the + symbol in queries, it
  1129. * seems to be less flexible than not doing so and I can't find out the legacy
  1130. * systems requiring this for regular requests like text/html. In the standard,
  1131. * the encoding of the plus character is only mentioned for
  1132. * application/x-www-form-urlencoded
  1133. * (https://url.spec.whatwg.org/#urlencoded-parsing) and most browsers seems lo
  1134. * leave the plus character as is in queries. To be more flexible, we allow the
  1135. * plus character on the query but it can also be manually encoded by the user.
  1136. *
  1137. * Resources:
  1138. * - https://url.spec.whatwg.org/#urlencoded-parsing
  1139. * - https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
  1140. */var ENC_BRACKET_OPEN_RE=/%5B/g;// [
  1141. var ENC_BRACKET_CLOSE_RE=/%5D/g;// ]
  1142. var ENC_CARET_RE=/%5E/g;// ^
  1143. var ENC_BACKTICK_RE=/%60/g;// `
  1144. var ENC_CURLY_OPEN_RE=/%7B/g;// {
  1145. var ENC_PIPE_RE=/%7C/g;// |
  1146. var ENC_CURLY_CLOSE_RE=/%7D/g;// }
  1147. var ENC_SPACE_RE=/%20/g;// }
  1148. /**
  1149. * Encode characters that need to be encoded on the path, search and hash
  1150. * sections of the URL.
  1151. *
  1152. * @internal
  1153. * @param text - string to encode
  1154. * @returns encoded string
  1155. */function commonEncode(text){return encodeURI(''+text).replace(ENC_PIPE_RE,'|').replace(ENC_BRACKET_OPEN_RE,'[').replace(ENC_BRACKET_CLOSE_RE,']');}/**
  1156. * Encode characters that need to be encoded on the hash section of the URL.
  1157. *
  1158. * @param text - string to encode
  1159. * @returns encoded string
  1160. */function encodeHash(text){return commonEncode(text).replace(ENC_CURLY_OPEN_RE,'{').replace(ENC_CURLY_CLOSE_RE,'}').replace(ENC_CARET_RE,'^');}/**
  1161. * Encode characters that need to be encoded query values on the query
  1162. * section of the URL.
  1163. *
  1164. * @param text - string to encode
  1165. * @returns encoded string
  1166. */function encodeQueryValue(text){return commonEncode(text)// Encode the space as +, encode the + to differentiate it from the space
  1167. .replace(PLUS_RE,'%2B').replace(ENC_SPACE_RE,'+').replace(HASH_RE,'%23').replace(AMPERSAND_RE,'%26').replace(ENC_BACKTICK_RE,'`').replace(ENC_CURLY_OPEN_RE,'{').replace(ENC_CURLY_CLOSE_RE,'}').replace(ENC_CARET_RE,'^');}/**
  1168. * Like `encodeQueryValue` but also encodes the `=` character.
  1169. *
  1170. * @param text - string to encode
  1171. */function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,'%3D');}/**
  1172. * Encode characters that need to be encoded on the path section of the URL.
  1173. *
  1174. * @param text - string to encode
  1175. * @returns encoded string
  1176. */function encodePath(text){return commonEncode(text).replace(HASH_RE,'%23').replace(IM_RE,'%3F');}/**
  1177. * Encode characters that need to be encoded on the path section of the URL as a
  1178. * param. This function encodes everything {@link encodePath} does plus the
  1179. * slash (`/`) character. If `text` is `null` or `undefined`, returns an empty
  1180. * string instead.
  1181. *
  1182. * @param text - string to encode
  1183. * @returns encoded string
  1184. */function encodeParam(text){return text==null?'':encodePath(text).replace(SLASH_RE,'%2F');}/**
  1185. * Decode text using `decodeURIComponent`. Returns the original text if it
  1186. * fails.
  1187. *
  1188. * @param text - string to decode
  1189. * @returns decoded string
  1190. */function decode(text){try{return decodeURIComponent(''+text);}catch(err){}return''+text;}/**
  1191. * Transforms a queryString into a {@link LocationQuery} object. Accept both, a
  1192. * version with the leading `?` and without Should work as URLSearchParams
  1193. * @internal
  1194. *
  1195. * @param search - search string to parse
  1196. * @returns a query object
  1197. */function parseQuery(search){var query={};// avoid creating an object with an empty key and empty value
  1198. // because of split('&')
  1199. if(search===''||search==='?')return query;var hasLeadingIM=search[0]==='?';var searchParams=(hasLeadingIM?search.slice(1):search).split('&');for(var i=0;i<searchParams.length;++i){// pre decode the + into space
  1200. var searchParam=searchParams[i].replace(PLUS_RE,' ');// allow the = character
  1201. var eqPos=searchParam.indexOf('=');var key=decode(eqPos<0?searchParam:searchParam.slice(0,eqPos));var value=eqPos<0?null:decode(searchParam.slice(eqPos+1));if(key in query){// an extra variable for ts types
  1202. var currentValue=query[key];if(!Array.isArray(currentValue)){currentValue=query[key]=[currentValue];}currentValue.push(value);}else{query[key]=value;}}return query;}/**
  1203. * Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
  1204. * doesn't prepend a `?`
  1205. *
  1206. * @internal
  1207. *
  1208. * @param query - query object to stringify
  1209. * @returns string version of the query without the leading `?`
  1210. */function stringifyQuery(query){var search='';var _loop3=function _loop3(_key13){var value=query[_key13];_key13=encodeQueryKey(_key13);if(value==null){// only null adds the value
  1211. if(value!==undefined){search+=(search.length?'&':'')+_key13;}key=_key13;return"continue";}// keep null values
  1212. var values=Array.isArray(value)?value.map(function(v){return v&&encodeQueryValue(v);}):[value&&encodeQueryValue(value)];values.forEach(function(value){// skip undefined values in arrays as if they were not present
  1213. // smaller code than using filter
  1214. if(value!==undefined){// only append & with non-empty search
  1215. search+=(search.length?'&':'')+_key13;if(value!=null)search+='='+value;}});key=_key13;};for(var key in query){var _ret=_loop3(key);if(_ret==="continue")continue;}return search;}/**
  1216. * Transforms a {@link LocationQueryRaw} into a {@link LocationQuery} by casting
  1217. * numbers into strings, removing keys with an undefined value and replacing
  1218. * undefined with null in arrays
  1219. *
  1220. * @param query - query object to normalize
  1221. * @returns a normalized query object
  1222. */function normalizeQuery(query){var normalizedQuery={};for(var _key14 in query){var value=query[_key14];if(value!==undefined){normalizedQuery[_key14]=Array.isArray(value)?value.map(function(v){return v==null?null:''+v;}):value==null?value:''+value;}}return normalizedQuery;}/**
  1223. * Create a list of callbacks that can be reset. Used to create before and after navigation guards list
  1224. */function useCallbacks(){var handlers=[];function add(handler){handlers.push(handler);return function(){var i=handlers.indexOf(handler);if(i>-1)handlers.splice(i,1);};}function reset(){handlers=[];}return{add:add,list:function list(){return handlers;},reset:reset};}function guardToPromiseFn(guard,to,from,record,name){// keep a reference to the enterCallbackArray to prevent pushing callbacks if a new navigation took place
  1225. var enterCallbackArray=record&&(// name is defined if record is because of the function overload
  1226. record.enterCallbacks[name]=record.enterCallbacks[name]||[]);return function(){return new Promise(function(resolve,reject){var next=function next(valid){if(valid===false)reject(createRouterError(4/* NAVIGATION_ABORTED */,{from:from,to:to}));else if(valid instanceof Error){reject(valid);}else if(isRouteLocation(valid)){reject(createRouterError(2/* NAVIGATION_GUARD_REDIRECT */,{from:to,to:valid}));}else{if(enterCallbackArray&&// since enterCallbackArray is truthy, both record and name also are
  1227. record.enterCallbacks[name]===enterCallbackArray&&typeof valid==='function')enterCallbackArray.push(valid);resolve();}};// wrapping with Promise.resolve allows it to work with both async and sync guards
  1228. var guardReturn=guard.call(record&&record.instances[name],to,from,next);var guardCall=Promise.resolve(guardReturn);if(guard.length<3)guardCall=guardCall.then(next);guardCall.catch(function(err){return reject(err);});});};}function extractComponentsGuards(matched,guardType,to,from){var guards=[];var _iterator9=_createForOfIteratorHelper(matched),_step9;try{var _loop4=function _loop4(){var record=_step9.value;var _loop5=function _loop5(name){var rawComponent=record.components[name];// skip update and leave guards if the route component is not mounted
  1229. if(guardType!=='beforeRouteEnter'&&!record.instances[name])return"continue";if(isRouteComponent(rawComponent)){// __vccOpts is added by vue-class-component and contain the regular options
  1230. var options=rawComponent.__vccOpts||rawComponent;var guard=options[guardType];guard&&guards.push(guardToPromiseFn(guard,to,from,record,name));}else{// start requesting the chunk already
  1231. var componentPromise=rawComponent();guards.push(function(){return componentPromise.then(function(resolved){if(!resolved)return Promise.reject(new Error("Couldn't resolve component \"".concat(name,"\" at \"").concat(record.path,"\"")));var resolvedComponent=isESModule(resolved)?resolved.default:resolved;// replace the function with the resolved component
  1232. record.components[name]=resolvedComponent;// __vccOpts is added by vue-class-component and contain the regular options
  1233. var options=resolvedComponent.__vccOpts||resolvedComponent;var guard=options[guardType];return guard&&guardToPromiseFn(guard,to,from,record,name)();});});}};for(var name in record.components){var _ret2=_loop5(name);if(_ret2==="continue")continue;}};for(_iterator9.s();!(_step9=_iterator9.n()).done;){_loop4();}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}return guards;}/**
  1234. * Allows differentiating lazy components from functional components and vue-class-component
  1235. *
  1236. * @param component
  1237. */function isRouteComponent(component){return _typeof(component)==='object'||'displayName'in component||'props'in component||'__vccOpts'in component;}// TODO: we could allow currentRoute as a prop to expose `isActive` and
  1238. // `isExactActive` behavior should go through an RFC
  1239. function useLink(props){var router=inject(routerKey);var currentRoute=inject(routeLocationKey);var route=computed(function(){return router.resolve(unref(props.to));});var activeRecordIndex=computed(function(){var matched=route.value.matched;var length=matched.length;var routeMatched=matched[length-1];var currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;var index=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index>-1)return index;// possible parent record
  1240. var parentRecordPath=getOriginalPath(matched[length-2]);return(// we are dealing with nested routes
  1241. length>1&&// if the parent and matched route have the same path, this link is
  1242. // referring to the empty child. Or we currently are on a different
  1243. // child of the same parent
  1244. getOriginalPath(routeMatched)===parentRecordPath&&// avoid comparing the child with its parent
  1245. currentMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index);});var isActive=computed(function(){return activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params);});var isExactActive=computed(function(){return activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params);});function navigate(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(guardEvent(e)){return router[unref(props.replace)?'replace':'push'](unref(props.to)// avoid uncaught errors are they are logged anyway
  1246. ).catch(noop);}return Promise.resolve();}return{route:route,href:computed(function(){return route.value.href;}),isActive:isActive,isExactActive:isExactActive,navigate:navigate};}var RouterLinkImpl=/*#__PURE__*/defineComponent({name:'RouterLink',props:{to:{type:[String,Object],required:true},replace:Boolean,activeClass:String,// inactiveClass: String,
  1247. exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:'page'}},useLink:useLink,setup:function setup(props,_ref15){var slots=_ref15.slots;var link=reactive(useLink(props));var _inject=inject(routerKey),options=_inject.options;var elClass=computed(function(){var _ref16;return _ref16={},_defineProperty(_ref16,getLinkClass(props.activeClass,options.linkActiveClass,'router-link-active'),link.isActive),_defineProperty(_ref16,getLinkClass(props.exactActiveClass,options.linkExactActiveClass,'router-link-exact-active'),link.isExactActive),_ref16;});return function(){var children=slots.default&&slots.default(link);return props.custom?children:h('a',{'aria-current':link.isExactActive?props.ariaCurrentValue:null,href:link.href,// this would override user added attrs but Vue will still add
  1248. // the listener so we end up triggering both
  1249. onClick:link.navigate,class:elClass.value},children);};}});// export the public type for h/tsx inference
  1250. // also to avoid inline import() in generated d.ts files
  1251. /**
  1252. * Component to render a link that triggers a navigation on click.
  1253. */var RouterLink=RouterLinkImpl;function guardEvent(e){// don't redirect with control keys
  1254. if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;// don't redirect when preventDefault called
  1255. if(e.defaultPrevented)return;// don't redirect on right click
  1256. if(e.button!==undefined&&e.button!==0)return;// don't redirect if `target="_blank"`
  1257. // @ts-expect-error getAttribute does exist
  1258. if(e.currentTarget&&e.currentTarget.getAttribute){// @ts-expect-error getAttribute exists
  1259. var target=e.currentTarget.getAttribute('target');if(/\b_blank\b/i.test(target))return;}// this may be a Weex event which doesn't have this method
  1260. if(e.preventDefault)e.preventDefault();return true;}function includesParams(outer,inner){var _loop6=function _loop6(_key15){var innerValue=inner[_key15];var outerValue=outer[_key15];if(typeof innerValue==='string'){if(innerValue!==outerValue)return{v:false};}else{if(!Array.isArray(outerValue)||outerValue.length!==innerValue.length||innerValue.some(function(value,i){return value!==outerValue[i];}))return{v:false};}};for(var _key15 in inner){var _ret3=_loop6(_key15);if(_typeof(_ret3)==="object")return _ret3.v;}return true;}/**
  1261. * Get the original path value of a record by following its aliasOf
  1262. * @param record
  1263. */function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:'';}/**
  1264. * Utility class to get the active class based on defaults.
  1265. * @param propClass
  1266. * @param globalClass
  1267. * @param defaultClass
  1268. */var getLinkClass=function getLinkClass(propClass,globalClass,defaultClass){return propClass!=null?propClass:globalClass!=null?globalClass:defaultClass;};var RouterViewImpl=/*#__PURE__*/defineComponent({name:'RouterView',// #674 we manually inherit them
  1269. inheritAttrs:false,props:{name:{type:String,default:'default'},route:Object},setup:function setup(props,_ref17){var attrs=_ref17.attrs,slots=_ref17.slots;var injectedRoute=inject(routerViewLocationKey);var routeToDisplay=computed(function(){return props.route||injectedRoute.value;});var depth=inject(viewDepthKey,0);var matchedRouteRef=computed(function(){return routeToDisplay.value.matched[depth];});provide(viewDepthKey,depth+1);provide(matchedRouteKey,matchedRouteRef);provide(routerViewLocationKey,routeToDisplay);var viewRef=ref();// watch at the same time the component instance, the route record we are
  1270. // rendering, and the name
  1271. watch(function(){return[viewRef.value,matchedRouteRef.value,props.name];},function(_ref18,_ref19){var _ref20=_slicedToArray(_ref18,3),instance=_ref20[0],to=_ref20[1],name=_ref20[2];var _ref21=_slicedToArray(_ref19,3),oldInstance=_ref21[0],from=_ref21[1],oldName=_ref21[2];// copy reused instances
  1272. if(to){// this will update the instance for new instances as well as reused
  1273. // instances when navigating to a new route
  1274. to.instances[name]=instance;// the component instance is reused for a different route or name so
  1275. // we copy any saved update or leave guards. With async setup, the
  1276. // mounting component will mount before the matchedRoute changes,
  1277. // making instance === oldInstance, so we check if guards have been
  1278. // added before. This works because we remove guards when
  1279. // unmounting/deactivating components
  1280. if(from&&from!==to&&instance&&instance===oldInstance){if(!to.leaveGuards.size){to.leaveGuards=from.leaveGuards;}if(!to.updateGuards.size){to.updateGuards=from.updateGuards;}}}// trigger beforeRouteEnter next callbacks
  1281. if(instance&&to&&(// if there is no instance but to and from are the same this might be
  1282. // the first visit
  1283. !from||!isSameRouteRecord(to,from)||!oldInstance)){(to.enterCallbacks[name]||[]).forEach(function(callback){return callback(instance);});}},{flush:'post'});return function(){var route=routeToDisplay.value;var matchedRoute=matchedRouteRef.value;var ViewComponent=matchedRoute&&matchedRoute.components[props.name];// we need the value at the time we render because when we unmount, we
  1284. // navigated to a different location so the value is different
  1285. var currentName=props.name;if(!ViewComponent){return normalizeSlot(slots.default,{Component:ViewComponent,route:route});}// props from route configuration
  1286. var routePropsOption=matchedRoute.props[props.name];var routeProps=routePropsOption?routePropsOption===true?route.params:typeof routePropsOption==='function'?routePropsOption(route):routePropsOption:null;var onVnodeUnmounted=function onVnodeUnmounted(vnode){// remove the instance reference to prevent leak
  1287. if(vnode.component.isUnmounted){matchedRoute.instances[currentName]=null;}};var component=h(ViewComponent,assign({},routeProps,attrs,{onVnodeUnmounted:onVnodeUnmounted,ref:viewRef}));return(// pass the vnode to the slot as a prop.
  1288. // h and <component :is="..."> both accept vnodes
  1289. normalizeSlot(slots.default,{Component:component,route:route})||component);};}});function normalizeSlot(slot,data){if(!slot)return null;var slotContent=slot(data);return slotContent.length===1?slotContent[0]:slotContent;}// export the public type for h/tsx inference
  1290. // also to avoid inline import() in generated d.ts files
  1291. /**
  1292. * Component to display the current route the user is at.
  1293. */var RouterView=exports('R',RouterViewImpl);/**
  1294. * Creates a Router instance that can be used by a Vue app.
  1295. *
  1296. * @param options - {@link RouterOptions}
  1297. */function createRouter(options){var matcher=createRouterMatcher(options.routes,options);var parseQuery$1=options.parseQuery||parseQuery;var stringifyQuery$1=options.stringifyQuery||stringifyQuery;var routerHistory=options.history;var beforeGuards=useCallbacks();var beforeResolveGuards=useCallbacks();var afterGuards=useCallbacks();var currentRoute=shallowRef(START_LOCATION_NORMALIZED);var pendingLocation=START_LOCATION_NORMALIZED;// leave the scrollRestoration if no scrollBehavior is provided
  1298. if(isBrowser&&options.scrollBehavior&&'scrollRestoration'in history){history.scrollRestoration='manual';}var normalizeParams=applyToParams.bind(null,function(paramValue){return''+paramValue;});var encodeParams=applyToParams.bind(null,encodeParam);var decodeParams=// @ts-expect-error: intentionally avoid the type check
  1299. applyToParams.bind(null,decode);function addRoute(parentOrRoute,route){var parent;var record;if(isRouteName(parentOrRoute)){parent=matcher.getRecordMatcher(parentOrRoute);record=route;}else{record=parentOrRoute;}return matcher.addRoute(record,parent);}function removeRoute(name){var recordMatcher=matcher.getRecordMatcher(name);if(recordMatcher){matcher.removeRoute(recordMatcher);}}function getRoutes(){return matcher.getRoutes().map(function(routeMatcher){return routeMatcher.record;});}function hasRoute(name){return!!matcher.getRecordMatcher(name);}function resolve(rawLocation,currentLocation){// const objectLocation = routerLocationAsObject(rawLocation)
  1300. // we create a copy to modify it later
  1301. currentLocation=assign({},currentLocation||currentRoute.value);if(typeof rawLocation==='string'){var locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path);var _matchedRoute=matcher.resolve({path:locationNormalized.path},currentLocation);var _href=routerHistory.createHref(locationNormalized.fullPath);// locationNormalized is always a new object
  1302. return assign(locationNormalized,_matchedRoute,{params:decodeParams(_matchedRoute.params),hash:decode(locationNormalized.hash),redirectedFrom:undefined,href:_href});}var matcherLocation;// path could be relative in object as well
  1303. if('path'in rawLocation){matcherLocation=assign({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});}else{// remove any nullish param
  1304. var targetParams=assign({},rawLocation.params);for(var _key16 in targetParams){if(targetParams[_key16]==null){delete targetParams[_key16];}}// pass encoded values to the matcher so it can produce encoded path and fullPath
  1305. matcherLocation=assign({},rawLocation,{params:encodeParams(rawLocation.params)});// current location params are decoded, we need to encode them in case the
  1306. // matcher merges the params
  1307. currentLocation.params=encodeParams(currentLocation.params);}var matchedRoute=matcher.resolve(matcherLocation,currentLocation);var hash=rawLocation.hash||'';// decoding them) the matcher might have merged current location params so
  1308. // we need to run the decoding again
  1309. matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));var fullPath=stringifyURL(stringifyQuery$1,assign({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path}));var href=routerHistory.createHref(fullPath);return assign({fullPath:fullPath,// keep the hash encoded so fullPath is effectively path + encodedQuery +
  1310. // hash
  1311. hash:hash,query:// if the user is using a custom query lib like qs, we might have
  1312. // nested objects, so we keep the query as is, meaning it can contain
  1313. // numbers at `$route.query`, but at the point, the user will have to
  1314. // use their own type anyway.
  1315. // https://github.com/vuejs/vue-router-next/issues/328#issuecomment-649481567
  1316. stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:undefined,href:href});}function locationAsObject(to){return typeof to==='string'?parseURL(parseQuery$1,to,currentRoute.value.path):assign({},to);}function checkCanceledNavigation(to,from){if(pendingLocation!==to){return createRouterError(8/* NAVIGATION_CANCELLED */,{from:from,to:to});}}function push(to){return pushWithRedirect(to);}function replace(to){return push(assign(locationAsObject(to),{replace:true}));}function handleRedirectRecord(to){var lastMatched=to.matched[to.matched.length-1];if(lastMatched&&lastMatched.redirect){var redirect=lastMatched.redirect;var newTargetLocation=typeof redirect==='function'?redirect(to):redirect;if(typeof newTargetLocation==='string'){newTargetLocation=newTargetLocation.includes('?')||newTargetLocation.includes('#')?newTargetLocation=locationAsObject(newTargetLocation):// force empty params
  1317. {path:newTargetLocation};// @ts-expect-error: force empty params when a string is passed to let
  1318. // the router parse them again
  1319. newTargetLocation.params={};}return assign({query:to.query,hash:to.hash,params:to.params},newTargetLocation);}}function pushWithRedirect(to,redirectedFrom){var targetLocation=pendingLocation=resolve(to);var from=currentRoute.value;var data=to.state;var force=to.force;// to could be a string where `replace` is a function
  1320. var replace=to.replace===true;var shouldRedirect=handleRedirectRecord(targetLocation);if(shouldRedirect)return pushWithRedirect(assign(locationAsObject(shouldRedirect),{state:data,force:force,replace:replace}),// keep original redirectedFrom if it exists
  1321. redirectedFrom||targetLocation);// if it was a redirect we already called `pushWithRedirect` above
  1322. var toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;var failure;if(!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)){failure=createRouterError(16/* NAVIGATION_DUPLICATED */,{to:toLocation,from:from});// trigger scroll to allow scrolling to the same anchor
  1323. handleScroll(from,from,// this is a push, the only way for it to be triggered from a
  1324. // history.listen is with a redirect, which makes it become a push
  1325. true,// This cannot be the first navigation because the initial location
  1326. // cannot be manually navigated to
  1327. false);}return(failure?Promise.resolve(failure):navigate(toLocation,from)).catch(function(error){return isNavigationFailure(error)?error:// reject any unknown error
  1328. triggerError(error,toLocation,from);}).then(function(failure){if(failure){if(isNavigationFailure(failure,2/* NAVIGATION_GUARD_REDIRECT */)){return pushWithRedirect(// keep options
  1329. assign(locationAsObject(failure.to),{state:data,force:force,replace:replace}),// preserve the original redirectedFrom if any
  1330. redirectedFrom||toLocation);}}else{// if we fail we don't finalize the navigation
  1331. failure=finalizeNavigation(toLocation,from,true,replace,data);}triggerAfterEach(toLocation,from,failure);return failure;});}/**
  1332. * Helper to reject and skip all navigation guards if a new navigation happened
  1333. * @param to
  1334. * @param from
  1335. */function checkCanceledNavigationAndReject(to,from){var error=checkCanceledNavigation(to,from);return error?Promise.reject(error):Promise.resolve();}// TODO: refactor the whole before guards by internally using router.beforeEach
  1336. function navigate(to,from){var guards;var _extractChangingRecor=extractChangingRecords(to,from),_extractChangingRecor2=_slicedToArray(_extractChangingRecor,3),leavingRecords=_extractChangingRecor2[0],updatingRecords=_extractChangingRecor2[1],enteringRecords=_extractChangingRecor2[2];// all components here have been resolved once because we are leaving
  1337. guards=extractComponentsGuards(leavingRecords.reverse(),'beforeRouteLeave',to,from);// leavingRecords is already reversed
  1338. var _iterator10=_createForOfIteratorHelper(leavingRecords),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var record=_step10.value;record.leaveGuards.forEach(function(guard){guards.push(guardToPromiseFn(guard,to,from));});}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}var canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to,from);guards.push(canceledNavigationCheck);// run the queue of per route beforeRouteLeave guards
  1339. return runGuardQueue(guards).then(function(){// check global guards beforeEach
  1340. guards=[];var _iterator11=_createForOfIteratorHelper(beforeGuards.list()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var guard=_step11.value;guards.push(guardToPromiseFn(guard,to,from));}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}guards.push(canceledNavigationCheck);return runGuardQueue(guards);}).then(function(){// check in components beforeRouteUpdate
  1341. guards=extractComponentsGuards(updatingRecords,'beforeRouteUpdate',to,from);var _iterator12=_createForOfIteratorHelper(updatingRecords),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var record=_step12.value;record.updateGuards.forEach(function(guard){guards.push(guardToPromiseFn(guard,to,from));});}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}guards.push(canceledNavigationCheck);// run the queue of per route beforeEnter guards
  1342. return runGuardQueue(guards);}).then(function(){// check the route beforeEnter
  1343. guards=[];var _iterator13=_createForOfIteratorHelper(to.matched),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var record=_step13.value;// do not trigger beforeEnter on reused views
  1344. if(record.beforeEnter&&!from.matched.includes(record)){if(Array.isArray(record.beforeEnter)){var _iterator14=_createForOfIteratorHelper(record.beforeEnter),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var beforeEnter=_step14.value;guards.push(guardToPromiseFn(beforeEnter,to,from));}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}else{guards.push(guardToPromiseFn(record.beforeEnter,to,from));}}}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}guards.push(canceledNavigationCheck);// run the queue of per route beforeEnter guards
  1345. return runGuardQueue(guards);}).then(function(){// NOTE: at this point to.matched is normalized and does not contain any () => Promise<Component>
  1346. // clear existing enterCallbacks, these are added by extractComponentsGuards
  1347. to.matched.forEach(function(record){return record.enterCallbacks={};});// check in-component beforeRouteEnter
  1348. guards=extractComponentsGuards(enteringRecords,'beforeRouteEnter',to,from);guards.push(canceledNavigationCheck);// run the queue of per route beforeEnter guards
  1349. return runGuardQueue(guards);}).then(function(){// check global guards beforeResolve
  1350. guards=[];var _iterator15=_createForOfIteratorHelper(beforeResolveGuards.list()),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var guard=_step15.value;guards.push(guardToPromiseFn(guard,to,from));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}guards.push(canceledNavigationCheck);return runGuardQueue(guards);})// catch any navigation canceled
  1351. .catch(function(err){return isNavigationFailure(err,8/* NAVIGATION_CANCELLED */)?err:Promise.reject(err);});}function triggerAfterEach(to,from,failure){// navigation is confirmed, call afterGuards
  1352. // TODO: wrap with error handlers
  1353. var _iterator16=_createForOfIteratorHelper(afterGuards.list()),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var guard=_step16.value;guard(to,from,failure);}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}}/**
  1354. * - Cleans up any navigation guards
  1355. * - Changes the url if necessary
  1356. * - Calls the scrollBehavior
  1357. */function finalizeNavigation(toLocation,from,isPush,replace,data){// a more recent navigation took place
  1358. var error=checkCanceledNavigation(toLocation,from);if(error)return error;// only consider as push if it's not the first navigation
  1359. var isFirstNavigation=from===START_LOCATION_NORMALIZED;var state=!isBrowser?{}:history.state;// change URL only if the user did a push/replace and if it's not the initial navigation because
  1360. // it's just reflecting the url
  1361. if(isPush){// on the initial navigation, we want to reuse the scroll position from
  1362. // history state if it exists
  1363. if(replace||isFirstNavigation)routerHistory.replace(toLocation.fullPath,assign({scroll:isFirstNavigation&&state&&state.scroll},data));else routerHistory.push(toLocation.fullPath,data);}// accept current navigation
  1364. currentRoute.value=toLocation;handleScroll(toLocation,from,isPush,isFirstNavigation);markAsReady();}var removeHistoryListener;// attach listener to history to trigger navigations
  1365. function setupListeners(){removeHistoryListener=routerHistory.listen(function(to,_from,info){// cannot be a redirect route because it was in history
  1366. var toLocation=resolve(to);// due to dynamic routing, and to hash history with manual navigation
  1367. // (manually changing the url or calling history.hash = '#/somewhere'),
  1368. // there could be a redirect record in history
  1369. var shouldRedirect=handleRedirectRecord(toLocation);if(shouldRedirect){pushWithRedirect(assign(shouldRedirect,{replace:true}),toLocation).catch(noop);return;}pendingLocation=toLocation;var from=currentRoute.value;// TODO: should be moved to web history?
  1370. if(isBrowser){saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition());}navigate(toLocation,from).catch(function(error){if(isNavigationFailure(error,4/* NAVIGATION_ABORTED */|8/* NAVIGATION_CANCELLED */)){return error;}if(isNavigationFailure(error,2/* NAVIGATION_GUARD_REDIRECT */)){// Here we could call if (info.delta) routerHistory.go(-info.delta,
  1371. // false) but this is bug prone as we have no way to wait the
  1372. // navigation to be finished before calling pushWithRedirect. Using
  1373. // a setTimeout of 16ms seems to work but there is not guarantee for
  1374. // it to work on every browser. So Instead we do not restore the
  1375. // history entry and trigger a new navigation as requested by the
  1376. // navigation guard.
  1377. // the error is already handled by router.push we just want to avoid
  1378. // logging the error
  1379. pushWithRedirect(error.to,toLocation// avoid an uncaught rejection, let push call triggerError
  1380. ).then(function(failure){// manual change in hash history #916 ending up in the URL not
  1381. // changing but it was changed by the manual url change, so we
  1382. // need to manually change it ourselves
  1383. if(isNavigationFailure(failure,4/* NAVIGATION_ABORTED */|16/* NAVIGATION_DUPLICATED */)&&!info.delta&&info.type===NavigationType.pop){routerHistory.go(-1,false);}}).catch(noop);// avoid the then branch
  1384. return Promise.reject();}// do not restore history on unknown direction
  1385. if(info.delta)routerHistory.go(-info.delta,false);// unrecognized error, transfer to the global handler
  1386. return triggerError(error,toLocation,from);}).then(function(failure){failure=failure||finalizeNavigation(// after navigation, all matched components are resolved
  1387. toLocation,from,false);// revert the navigation
  1388. if(failure){if(info.delta){routerHistory.go(-info.delta,false);}else if(info.type===NavigationType.pop&&isNavigationFailure(failure,4/* NAVIGATION_ABORTED */|16/* NAVIGATION_DUPLICATED */)){// manual change in hash history #916
  1389. // it's like a push but lacks the information of the direction
  1390. routerHistory.go(-1,false);}}triggerAfterEach(toLocation,from,failure);}).catch(noop);});}// Initialization and Errors
  1391. var readyHandlers=useCallbacks();var errorHandlers=useCallbacks();var ready;/**
  1392. * Trigger errorHandlers added via onError and throws the error as well
  1393. *
  1394. * @param error - error to throw
  1395. * @param to - location we were navigating to when the error happened
  1396. * @param from - location we were navigating from when the error happened
  1397. * @returns the error as a rejected promise
  1398. */function triggerError(error,to,from){markAsReady(error);var list=errorHandlers.list();if(list.length){list.forEach(function(handler){return handler(error,to,from);});}else{console.error(error);}return Promise.reject(error);}function isReady(){if(ready&&currentRoute.value!==START_LOCATION_NORMALIZED)return Promise.resolve();return new Promise(function(resolve,reject){readyHandlers.add([resolve,reject]);});}/**
  1399. * Mark the router as ready, resolving the promised returned by isReady(). Can
  1400. * only be called once, otherwise does nothing.
  1401. * @param err - optional error
  1402. */function markAsReady(err){if(ready)return;ready=true;setupListeners();readyHandlers.list().forEach(function(_ref22){var _ref23=_slicedToArray(_ref22,2),resolve=_ref23[0],reject=_ref23[1];return err?reject(err):resolve();});readyHandlers.reset();}// Scroll behavior
  1403. function handleScroll(to,from,isPush,isFirstNavigation){var scrollBehavior=options.scrollBehavior;if(!isBrowser||!scrollBehavior)return Promise.resolve();var scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(function(){return scrollBehavior(to,from,scrollPosition);}).then(function(position){return position&&scrollToPosition(position);}).catch(function(err){return triggerError(err,to,from);});}var go=function go(delta){return routerHistory.go(delta);};var started;var installedApps=new Set();var router={currentRoute:currentRoute,addRoute:addRoute,removeRoute:removeRoute,hasRoute:hasRoute,getRoutes:getRoutes,resolve:resolve,options:options,push:push,replace:replace,go:go,back:function back(){return go(-1);},forward:function forward(){return go(1);},beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorHandlers.add,isReady:isReady,install:function install(app){var router=this;app.component('RouterLink',RouterLink);app.component('RouterView',RouterView);app.config.globalProperties.$router=router;Object.defineProperty(app.config.globalProperties,'$route',{enumerable:true,get:function get(){return unref(currentRoute);}});// this initial navigation is only necessary on client, on server it doesn't
  1404. // make sense because it will create an extra unnecessary navigation and could
  1405. // lead to problems
  1406. if(isBrowser&&// used for the initial navigation client side to avoid pushing
  1407. // multiple times when the router is used in multiple apps
  1408. !started&&currentRoute.value===START_LOCATION_NORMALIZED){// see above
  1409. started=true;push(routerHistory.location).catch(function(err){});}var reactiveRoute={};var _loop7=function _loop7(_key17){// @ts-expect-error: the key matches
  1410. reactiveRoute[_key17]=computed(function(){return currentRoute.value[_key17];});};for(var _key17 in START_LOCATION_NORMALIZED){_loop7(_key17);}app.provide(routerKey,router);app.provide(routeLocationKey,reactive(reactiveRoute));app.provide(routerViewLocationKey,currentRoute);var unmountApp=app.unmount;installedApps.add(app);app.unmount=function(){installedApps.delete(app);// the router is not attached to an app anymore
  1411. if(installedApps.size<1){// invalidate the current navigation
  1412. pendingLocation=START_LOCATION_NORMALIZED;removeHistoryListener&&removeHistoryListener();currentRoute.value=START_LOCATION_NORMALIZED;started=false;ready=false;}unmountApp();};}};return router;}function runGuardQueue(guards){return guards.reduce(function(promise,guard){return promise.then(function(){return guard();});},Promise.resolve());}function extractChangingRecords(to,from){var leavingRecords=[];var updatingRecords=[];var enteringRecords=[];var len=Math.max(from.matched.length,to.matched.length);var _loop8=function _loop8(i){var recordFrom=from.matched[i];if(recordFrom){if(to.matched.find(function(record){return isSameRouteRecord(record,recordFrom);}))updatingRecords.push(recordFrom);else leavingRecords.push(recordFrom);}var recordTo=to.matched[i];if(recordTo){// the type doesn't matter because we are comparing per reference
  1413. if(!from.matched.find(function(record){return isSameRouteRecord(record,recordTo);})){enteringRecords.push(recordTo);}}};for(var i=0;i<len;i++){_loop8(i);}return[leavingRecords,updatingRecords,enteringRecords];}}};});})();