1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965 |
- 'use strict';
- var vue = require('vue');
- const isBrowser = typeof document !== 'undefined';
- function isRouteComponent(component) {
- return (typeof component === 'object' ||
- 'displayName' in component ||
- 'props' in component ||
- '__vccOpts' in component);
- }
- function isESModule(obj) {
- return (obj.__esModule ||
- obj[Symbol.toStringTag] === 'Module' ||
-
-
- (obj.default && isRouteComponent(obj.default)));
- }
- const assign = Object.assign;
- function applyToParams(fn, params) {
- const newParams = {};
- for (const key in params) {
- const value = params[key];
- newParams[key] = isArray(value)
- ? value.map(fn)
- : fn(value);
- }
- return newParams;
- }
- const noop = () => { };
- const isArray = Array.isArray;
- const HASH_RE = /#/g;
- const AMPERSAND_RE = /&/g;
- const SLASH_RE = /\//g;
- const EQUAL_RE = /=/g;
- const IM_RE = /\?/g;
- const PLUS_RE = /\+/g;
- const ENC_BRACKET_OPEN_RE = /%5B/g;
- const ENC_BRACKET_CLOSE_RE = /%5D/g;
- const ENC_CARET_RE = /%5E/g;
- const ENC_BACKTICK_RE = /%60/g;
- const ENC_CURLY_OPEN_RE = /%7B/g;
- const ENC_PIPE_RE = /%7C/g;
- const ENC_CURLY_CLOSE_RE = /%7D/g;
- const ENC_SPACE_RE = /%20/g;
- function commonEncode(text) {
- return encodeURI('' + text)
- .replace(ENC_PIPE_RE, '|')
- .replace(ENC_BRACKET_OPEN_RE, '[')
- .replace(ENC_BRACKET_CLOSE_RE, ']');
- }
- function encodeHash(text) {
- return commonEncode(text)
- .replace(ENC_CURLY_OPEN_RE, '{')
- .replace(ENC_CURLY_CLOSE_RE, '}')
- .replace(ENC_CARET_RE, '^');
- }
- function encodeQueryValue(text) {
- return (commonEncode(text)
-
- .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, '^'));
- }
- function encodeQueryKey(text) {
- return encodeQueryValue(text).replace(EQUAL_RE, '%3D');
- }
- function encodePath(text) {
- return commonEncode(text).replace(HASH_RE, '%23').replace(IM_RE, '%3F');
- }
- function encodeParam(text) {
- return text == null ? '' : encodePath(text).replace(SLASH_RE, '%2F');
- }
- function decode(text) {
- try {
- return decodeURIComponent('' + text);
- }
- catch (err) {
- }
- return '' + text;
- }
- const TRAILING_SLASH_RE = /\/$/;
- const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, '');
- function parseURL(parseQuery, location, currentLocation = '/') {
- let path, query = {}, searchString = '', hash = '';
-
-
- const hashPos = location.indexOf('#');
- let searchPos = location.indexOf('?');
-
- if (hashPos < searchPos && hashPos >= 0) {
- searchPos = -1;
- }
- 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);
-
- hash = location.slice(hashPos, location.length);
- }
-
- path = resolveRelativePath(path != null ? path : location, currentLocation);
-
- return {
- fullPath: path + (searchString && '?') + searchString + hash,
- path,
- query,
- hash: decode(hash),
- };
- }
- function stringifyURL(stringifyQuery, location) {
- const query = location.query ? stringifyQuery(location.query) : '';
- return location.path + (query && '?') + query + (location.hash || '');
- }
- function stripBase(pathname, base) {
-
- if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase()))
- return pathname;
- return pathname.slice(base.length) || '/';
- }
- function isSameRouteLocation(stringifyQuery, a, b) {
- const aLastIndex = a.matched.length - 1;
- const 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);
- }
- function isSameRouteRecord(a, b) {
-
-
-
- return (a.aliasOf || a) === (b.aliasOf || b);
- }
- function isSameRouteLocationParams(a, b) {
- if (Object.keys(a).length !== Object.keys(b).length)
- return false;
- for (const key in a) {
- if (!isSameRouteLocationParamsValue(a[key], b[key]))
- return false;
- }
- return true;
- }
- function isSameRouteLocationParamsValue(a, b) {
- return isArray(a)
- ? isEquivalentArray(a, b)
- : isArray(b)
- ? isEquivalentArray(b, a)
- : a === b;
- }
- function isEquivalentArray(a, b) {
- return isArray(b)
- ? a.length === b.length && a.every((value, i) => value === b[i])
- : a.length === 1 && a[0] === b;
- }
- function resolveRelativePath(to, from) {
- if (to.startsWith('/'))
- return to;
- if (!to)
- return from;
- const fromSegments = from.split('/');
- const toSegments = to.split('/');
- const lastToSegment = toSegments[toSegments.length - 1];
-
-
- if (lastToSegment === '..' || lastToSegment === '.') {
- toSegments.push('');
- }
- let position = fromSegments.length - 1;
- let toPosition;
- let segment;
- for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
- segment = toSegments[toPosition];
-
- if (segment === '.')
- continue;
-
- if (segment === '..') {
-
- if (position > 1)
- position--;
-
- }
-
- else
- break;
- }
- return (fromSegments.slice(0, position).join('/') +
- '/' +
- toSegments.slice(toPosition).join('/'));
- }
- const START_LOCATION_NORMALIZED = {
- path: '/',
-
- name: undefined,
- params: {},
- query: {},
- hash: '',
- fullPath: '/',
- matched: [],
- meta: {},
- redirectedFrom: undefined,
- };
- 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 = {}));
- const START = '';
- function normalizeBase(base) {
- if (!base) {
- if (isBrowser) {
-
- const baseEl = document.querySelector('base');
- base = (baseEl && baseEl.getAttribute('href')) || '/';
-
- base = base.replace(/^\w+:\/\/[^\/]+/, '');
- }
- else {
- base = '/';
- }
- }
-
-
-
- if (base[0] !== '/' && base[0] !== '#')
- base = '/' + base;
-
-
- return removeTrailingSlash(base);
- }
- const BEFORE_HASH_RE = /^[^#]+#/;
- function createHref(base, location) {
- return base.replace(BEFORE_HASH_RE, '#') + location;
- }
- function getElementPosition(el, offset) {
- const docRect = document.documentElement.getBoundingClientRect();
- const elRect = el.getBoundingClientRect();
- return {
- behavior: offset.behavior,
- left: elRect.left - docRect.left - (offset.left || 0),
- top: elRect.top - docRect.top - (offset.top || 0),
- };
- }
- const computeScrollPosition = () => ({
- left: window.scrollX,
- top: window.scrollY,
- });
- function scrollToPosition(position) {
- let scrollToOptions;
- if ('el' in position) {
- const positionEl = position.el;
- const isIdSelector = typeof positionEl === 'string' && positionEl.startsWith('#');
- const 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.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
- }
- }
- function getScrollKey(path, delta) {
- const position = history.state ? history.state.position - delta : -1;
- return position + path;
- }
- const scrollPositions = new Map();
- function saveScrollPosition(key, scrollPosition) {
- scrollPositions.set(key, scrollPosition);
- }
- function getSavedScrollPosition(key) {
- const scroll = scrollPositions.get(key);
-
- scrollPositions.delete(key);
- return scroll;
- }
- let createBaseLocation = () => location.protocol + '//' + location.host;
- function createCurrentLocation(base, location) {
- const { pathname, search, hash } = location;
-
- const hashPos = base.indexOf('#');
- if (hashPos > -1) {
- let slicePos = hash.includes(base.slice(hashPos))
- ? base.slice(hashPos).length
- : 1;
- let pathFromHash = hash.slice(slicePos);
-
- if (pathFromHash[0] !== '/')
- pathFromHash = '/' + pathFromHash;
- return stripBase(pathFromHash, '');
- }
- const path = stripBase(pathname, base);
- return path + search + hash;
- }
- function useHistoryListeners(base, historyState, currentLocation, replace) {
- let listeners = [];
- let teardowns = [];
-
-
- let pauseState = null;
- const popStateHandler = ({ state, }) => {
- const to = createCurrentLocation(base, location);
- const from = currentLocation.value;
- const fromState = historyState.value;
- let delta = 0;
- if (state) {
- currentLocation.value = to;
- historyState.value = state;
-
- if (pauseState && pauseState === from) {
- pauseState = null;
- return;
- }
- delta = fromState ? state.position - fromState.position : 0;
- }
- else {
- replace(to);
- }
-
-
-
-
-
- listeners.forEach(listener => {
- listener(currentLocation.value, from, {
- delta,
- type: NavigationType.pop,
- direction: delta
- ? delta > 0
- ? NavigationDirection.forward
- : NavigationDirection.back
- : NavigationDirection.unknown,
- });
- });
- };
- function pauseListeners() {
- pauseState = currentLocation.value;
- }
- function listen(callback) {
-
- listeners.push(callback);
- const teardown = () => {
- const index = listeners.indexOf(callback);
- if (index > -1)
- listeners.splice(index, 1);
- };
- teardowns.push(teardown);
- return teardown;
- }
- function beforeUnloadListener() {
- const { history } = window;
- if (!history.state)
- return;
- history.replaceState(assign({}, history.state, { scroll: computeScrollPosition() }), '');
- }
- function destroy() {
- for (const teardown of teardowns)
- teardown();
- teardowns = [];
- window.removeEventListener('popstate', popStateHandler);
- window.removeEventListener('beforeunload', beforeUnloadListener);
- }
-
- window.addEventListener('popstate', popStateHandler);
-
-
- window.addEventListener('beforeunload', beforeUnloadListener, {
- passive: true,
- });
- return {
- pauseListeners,
- listen,
- destroy,
- };
- }
- function buildState(back, current, forward, replaced = false, computeScroll = false) {
- return {
- back,
- current,
- forward,
- replaced,
- position: window.history.length,
- scroll: computeScroll ? computeScrollPosition() : null,
- };
- }
- function useHistoryStateNavigation(base) {
- const { history, location } = window;
-
- const currentLocation = {
- value: createCurrentLocation(base, location),
- };
- const historyState = { value: history.state };
-
- if (!historyState.value) {
- changeLocation(currentLocation.value, {
- back: null,
- current: currentLocation.value,
- forward: null,
-
- position: history.length - 1,
- replaced: true,
-
-
- scroll: null,
- }, true);
- }
- function changeLocation(to, state, replace) {
-
- const hashIndex = base.indexOf('#');
- const url = hashIndex > -1
- ? (location.host && document.querySelector('base')
- ? base
- : base.slice(hashIndex)) + to
- : createBaseLocation() + base + to;
- try {
-
-
- history[replace ? 'replaceState' : 'pushState'](state, '', url);
- historyState.value = state;
- }
- catch (err) {
- {
- console.error(err);
- }
-
- location[replace ? 'replace' : 'assign'](url);
- }
- }
- function replace(to, data) {
- const state = assign({}, history.state, buildState(historyState.value.back,
-
- to, historyState.value.forward, true), data, { position: historyState.value.position });
- changeLocation(to, state, true);
- currentLocation.value = to;
- }
- function push(to, data) {
-
-
- const currentState = assign({},
-
-
-
- historyState.value, history.state, {
- forward: to,
- scroll: computeScrollPosition(),
- });
- changeLocation(currentState.current, currentState, true);
- const 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,
- replace,
- };
- }
- function createWebHistory(base) {
- base = normalizeBase(base);
- const historyNavigation = useHistoryStateNavigation(base);
- const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
- function go(delta, triggerListeners = true) {
- if (!triggerListeners)
- historyListeners.pauseListeners();
- history.go(delta);
- }
- const routerHistory = assign({
-
- location: '',
- base,
- go,
- createHref: createHref.bind(null, base),
- }, historyNavigation, historyListeners);
- Object.defineProperty(routerHistory, 'location', {
- enumerable: true,
- get: () => historyNavigation.location.value,
- });
- Object.defineProperty(routerHistory, 'state', {
- enumerable: true,
- get: () => historyNavigation.state.value,
- });
- return routerHistory;
- }
- function createMemoryHistory(base = '') {
- let listeners = [];
- let queue = [START];
- let position = 0;
- base = normalizeBase(base);
- function setLocation(location) {
- position++;
- if (position !== queue.length) {
-
- queue.splice(position);
- }
- queue.push(location);
- }
- function triggerListeners(to, from, { direction, delta }) {
- const info = {
- direction,
- delta,
- type: NavigationType.pop,
- };
- for (const callback of listeners) {
- callback(to, from, info);
- }
- }
- const routerHistory = {
-
- location: START,
-
- state: {},
- base,
- createHref: createHref.bind(null, base),
- replace(to) {
-
- queue.splice(position--, 1);
- setLocation(to);
- },
- push(to, data) {
- setLocation(to);
- },
- listen(callback) {
- listeners.push(callback);
- return () => {
- const index = listeners.indexOf(callback);
- if (index > -1)
- listeners.splice(index, 1);
- };
- },
- destroy() {
- listeners = [];
- queue = [START];
- position = 0;
- },
- go(delta, shouldTrigger = true) {
- const from = this.location;
- const direction =
-
-
-
- delta < 0 ? NavigationDirection.back : NavigationDirection.forward;
- position = Math.max(0, Math.min(position + delta, queue.length - 1));
- if (shouldTrigger) {
- triggerListeners(this.location, from, {
- direction,
- delta,
- });
- }
- },
- };
- Object.defineProperty(routerHistory, 'location', {
- enumerable: true,
- get: () => queue[position],
- });
- return routerHistory;
- }
- function createWebHashHistory(base) {
-
-
-
- base = location.host ? base || location.pathname + location.search : '';
-
- 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';
- }
- const NavigationFailureSymbol = Symbol('');
- exports.NavigationFailureType = void 0;
- (function (NavigationFailureType) {
-
- NavigationFailureType[NavigationFailureType["aborted"] = 4] = "aborted";
-
- NavigationFailureType[NavigationFailureType["cancelled"] = 8] = "cancelled";
-
- NavigationFailureType[NavigationFailureType["duplicated"] = 16] = "duplicated";
- })(exports.NavigationFailureType || (exports.NavigationFailureType = {}));
- const ErrorTypeMessages = {
- [1 ]({ location, currentLocation }) {
- return `No match for\n ${JSON.stringify(location)}${currentLocation
- ? '\nwhile being at\n' + JSON.stringify(currentLocation)
- : ''}`;
- },
- [2 ]({ from, to, }) {
- return `Redirected from "${from.fullPath}" to "${stringifyRoute(to)}" via a navigation guard.`;
- },
- [4 ]({ from, to }) {
- return `Navigation aborted from "${from.fullPath}" to "${to.fullPath}" via a navigation guard.`;
- },
- [8 ]({ from, to }) {
- return `Navigation cancelled from "${from.fullPath}" to "${to.fullPath}" with a new navigation.`;
- },
- [16 ]({ from, to }) {
- return `Avoided redundant navigation to current location: "${from.fullPath}".`;
- },
- };
- function createRouterError(type, params) {
-
- {
- return assign(new Error(ErrorTypeMessages[type](params)), {
- type,
- [NavigationFailureSymbol]: true,
- }, params);
- }
- }
- function isNavigationFailure(error, type) {
- return (error instanceof Error &&
- NavigationFailureSymbol in error &&
- (type == null || !!(error.type & type)));
- }
- const propertiesToLog = ['params', 'query', 'hash'];
- function stringifyRoute(to) {
- if (typeof to === 'string')
- return to;
- if (to.path != null)
- return to.path;
- const location = {};
- for (const key of propertiesToLog) {
- if (key in to)
- location[key] = to[key];
- }
- return JSON.stringify(location, null, 2);
- }
- const BASE_PARAM_PATTERN = '[^/]+?';
- const BASE_PATH_PARSER_OPTIONS = {
- sensitive: false,
- strict: false,
- start: true,
- end: true,
- };
- const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
- function tokensToParser(segments, extraOptions) {
- const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
-
- const score = [];
-
- let pattern = options.start ? '^' : '';
-
- const keys = [];
- for (const segment of segments) {
-
- const segmentScores = segment.length ? [] : [90 ];
-
- if (options.strict && !segment.length)
- pattern += '/';
- for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
- const token = segment[tokenIndex];
-
- let subSegmentScore = 40 +
- (options.sensitive ? 0.25 : 0);
- if (token.type === 0 ) {
-
- if (!tokenIndex)
- pattern += '/';
- pattern += token.value.replace(REGEX_CHARS_RE, '\\$&');
- subSegmentScore += 40 ;
- }
- else if (token.type === 1 ) {
- const { value, repeatable, optional, regexp } = token;
- keys.push({
- name: value,
- repeatable,
- optional,
- });
- const re = regexp ? regexp : BASE_PARAM_PATTERN;
-
- if (re !== BASE_PARAM_PATTERN) {
- subSegmentScore += 10 ;
-
- try {
- new RegExp(`(${re})`);
- }
- catch (err) {
- throw new Error(`Invalid custom RegExp for param "${value}" (${re}): ` +
- err.message);
- }
- }
-
- let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;
-
- if (!tokenIndex)
- subPattern =
-
-
- optional && segment.length < 2
- ? `(?:/${subPattern})`
- : '/' + subPattern;
- if (optional)
- subPattern += '?';
- pattern += subPattern;
- subSegmentScore += 20 ;
- if (optional)
- subSegmentScore += -8 ;
- if (repeatable)
- subSegmentScore += -20 ;
- if (re === '.*')
- subSegmentScore += -50 ;
- }
- segmentScores.push(subSegmentScore);
- }
-
-
- score.push(segmentScores);
- }
-
- if (options.strict && options.end) {
- const i = score.length - 1;
- score[i][score[i].length - 1] += 0.7000000000000001 ;
- }
-
- if (!options.strict)
- pattern += '/?';
- if (options.end)
- pattern += '$';
-
- else if (options.strict && !pattern.endsWith('/'))
- pattern += '(?:/|$)';
- const re = new RegExp(pattern, options.sensitive ? '' : 'i');
- function parse(path) {
- const match = path.match(re);
- const params = {};
- if (!match)
- return null;
- for (let i = 1; i < match.length; i++) {
- const value = match[i] || '';
- const key = keys[i - 1];
- params[key.name] = value && key.repeatable ? value.split('/') : value;
- }
- return params;
- }
- function stringify(params) {
- let path = '';
-
- let avoidDuplicatedSlash = false;
- for (const segment of segments) {
- if (!avoidDuplicatedSlash || !path.endsWith('/'))
- path += '/';
- avoidDuplicatedSlash = false;
- for (const token of segment) {
- if (token.type === 0 ) {
- path += token.value;
- }
- else if (token.type === 1 ) {
- const { value, repeatable, optional } = token;
- const param = value in params ? params[value] : '';
- if (isArray(param) && !repeatable) {
- throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
- }
- const text = isArray(param)
- ? param.join('/')
- : param;
- if (!text) {
- if (optional) {
-
- if (segment.length < 2) {
-
- if (path.endsWith('/'))
- path = path.slice(0, -1);
-
- else
- avoidDuplicatedSlash = true;
- }
- }
- else
- throw new Error(`Missing required param "${value}"`);
- }
- path += text;
- }
- }
- }
-
- return path || '/';
- }
- return {
- re,
- score,
- keys,
- parse,
- stringify,
- };
- }
- function compareScoreArray(a, b) {
- let i = 0;
- while (i < a.length && i < b.length) {
- const diff = b[i] - a[i];
-
- if (diff)
- return diff;
- i++;
- }
-
-
- if (a.length < b.length) {
- return a.length === 1 && a[0] === 40 + 40
- ? -1
- : 1;
- }
- else if (a.length > b.length) {
- return b.length === 1 && b[0] === 40 + 40
- ? 1
- : -1;
- }
- return 0;
- }
- function comparePathParserScore(a, b) {
- let i = 0;
- const aScore = a.score;
- const bScore = b.score;
- while (i < aScore.length && i < bScore.length) {
- const comp = compareScoreArray(aScore[i], bScore[i]);
-
- if (comp)
- return comp;
- i++;
- }
- if (Math.abs(bScore.length - aScore.length) === 1) {
- if (isLastScoreNegative(aScore))
- return 1;
- if (isLastScoreNegative(bScore))
- return -1;
- }
-
- return bScore.length - aScore.length;
-
-
-
-
-
-
- }
- function isLastScoreNegative(score) {
- const last = score[score.length - 1];
- return score.length > 0 && last[last.length - 1] < 0;
- }
- const ROOT_TOKEN = {
- type: 0 ,
- value: '',
- };
- const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
- function tokenizePath(path) {
- if (!path)
- return [[]];
- if (path === '/')
- return [[ROOT_TOKEN]];
- if (!path.startsWith('/')) {
- throw new Error(`Invalid path "${path}"`);
- }
-
- function crash(message) {
- throw new Error(`ERR (${state})/"${buffer}": ${message}`);
- }
- let state = 0 ;
- let previousState = state;
- const tokens = [];
-
-
- let segment;
- function finalizeSegment() {
- if (segment)
- tokens.push(segment);
- segment = [];
- }
-
- let i = 0;
-
- let char;
-
- let buffer = '';
-
- let customRe = '';
- function consumeBuffer() {
- if (!buffer)
- return;
- if (state === 0 ) {
- segment.push({
- type: 0 ,
- value: buffer,
- });
- }
- else if (state === 1 ||
- state === 2 ||
- state === 3 ) {
- if (segment.length > 1 && (char === '*' || char === '+'))
- crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
- segment.push({
- type: 1 ,
- 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 ) {
- previousState = state;
- state = 4 ;
- continue;
- }
- switch (state) {
- case 0 :
- if (char === '/') {
- if (buffer) {
- consumeBuffer();
- }
- finalizeSegment();
- }
- else if (char === ':') {
- consumeBuffer();
- state = 1 ;
- }
- else {
- addCharToBuffer();
- }
- break;
- case 4 :
- addCharToBuffer();
- state = previousState;
- break;
- case 1 :
- if (char === '(') {
- state = 2 ;
- }
- else if (VALID_PARAM_RE.test(char)) {
- addCharToBuffer();
- }
- else {
- consumeBuffer();
- state = 0 ;
-
- if (char !== '*' && char !== '?' && char !== '+')
- i--;
- }
- break;
- case 2 :
-
-
-
-
-
- if (char === ')') {
-
- if (customRe[customRe.length - 1] == '\\')
- customRe = customRe.slice(0, -1) + char;
- else
- state = 3 ;
- }
- else {
- customRe += char;
- }
- break;
- case 3 :
-
- consumeBuffer();
- state = 0 ;
-
- if (char !== '*' && char !== '?' && char !== '+')
- i--;
- customRe = '';
- break;
- default:
- crash('Unknown state');
- break;
- }
- }
- if (state === 2 )
- crash(`Unfinished custom RegExp for param "${buffer}"`);
- consumeBuffer();
- finalizeSegment();
-
- return tokens;
- }
- function createRouteRecordMatcher(record, parent, options) {
- const parser = tokensToParser(tokenizePath(record.path), options);
- const matcher = assign(parser, {
- record,
- parent,
-
- children: [],
- alias: [],
- });
- if (parent) {
-
-
-
- if (!matcher.record.aliasOf === !parent.record.aliasOf)
- parent.children.push(matcher);
- }
- return matcher;
- }
- function createRouterMatcher(routes, globalOptions) {
-
- const matchers = [];
- const matcherMap = new Map();
- globalOptions = mergeOptions({ strict: false, end: true, sensitive: false }, globalOptions);
- function getRecordMatcher(name) {
- return matcherMap.get(name);
- }
- function addRoute(record, parent, originalRecord) {
-
- const isRootAdd = !originalRecord;
- const mainNormalizedRecord = normalizeRouteRecord(record);
-
- mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
- const options = mergeOptions(globalOptions, record);
-
- const normalizedRecords = [mainNormalizedRecord];
- if ('alias' in record) {
- const aliases = typeof record.alias === 'string' ? [record.alias] : record.alias;
- for (const alias of aliases) {
- normalizedRecords.push(
-
-
- normalizeRouteRecord(assign({}, mainNormalizedRecord, {
-
-
- components: originalRecord
- ? originalRecord.record.components
- : mainNormalizedRecord.components,
- path: alias,
-
- aliasOf: originalRecord
- ? originalRecord.record
- : mainNormalizedRecord,
-
-
- })));
- }
- }
- let matcher;
- let originalMatcher;
- for (const normalizedRecord of normalizedRecords) {
- const { path } = normalizedRecord;
-
-
-
- if (parent && path[0] !== '/') {
- const parentPath = parent.record.path;
- const connectingSlash = parentPath[parentPath.length - 1] === '/' ? '' : '/';
- normalizedRecord.path =
- parent.record.path + (path && connectingSlash + path);
- }
-
- matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
-
-
- if (originalRecord) {
- originalRecord.alias.push(matcher);
- }
- else {
-
- originalMatcher = originalMatcher || matcher;
- if (originalMatcher !== matcher)
- originalMatcher.alias.push(matcher);
-
-
- if (isRootAdd && record.name && !isAliasRecord(matcher)) {
- removeRoute(record.name);
- }
- }
-
-
- if (isMatchable(matcher)) {
- insertMatcher(matcher);
- }
- if (mainNormalizedRecord.children) {
- const children = mainNormalizedRecord.children;
- for (let i = 0; i < children.length; i++) {
- addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
- }
- }
-
-
- originalRecord = originalRecord || matcher;
-
-
-
-
- }
- return originalMatcher
- ? () => {
-
- removeRoute(originalMatcher);
- }
- : noop;
- }
- function removeRoute(matcherRef) {
- if (isRouteName(matcherRef)) {
- const matcher = matcherMap.get(matcherRef);
- if (matcher) {
- matcherMap.delete(matcherRef);
- matchers.splice(matchers.indexOf(matcher), 1);
- matcher.children.forEach(removeRoute);
- matcher.alias.forEach(removeRoute);
- }
- }
- else {
- const 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) {
- const index = findInsertionIndex(matcher, matchers);
- matchers.splice(index, 0, matcher);
-
- if (matcher.record.name && !isAliasRecord(matcher))
- matcherMap.set(matcher.record.name, matcher);
- }
- function resolve(location, currentLocation) {
- let matcher;
- let params = {};
- let path;
- let name;
- if ('name' in location && location.name) {
- matcher = matcherMap.get(location.name);
- if (!matcher)
- throw createRouterError(1 , {
- location,
- });
- name = matcher.record.name;
- params = assign(
-
- paramsFromLocation(currentLocation.params,
-
-
- matcher.keys
- .filter(k => !k.optional)
- .concat(matcher.parent ? matcher.parent.keys.filter(k => k.optional) : [])
- .map(k => k.name)),
-
-
- location.params &&
- paramsFromLocation(location.params, matcher.keys.map(k => k.name)));
-
- path = matcher.stringify(params);
- }
- else if (location.path != null) {
-
-
- path = location.path;
- matcher = matchers.find(m => m.re.test(path));
-
- if (matcher) {
-
- params = matcher.parse(path);
- name = matcher.record.name;
- }
-
- }
- else {
-
- matcher = currentLocation.name
- ? matcherMap.get(currentLocation.name)
- : matchers.find(m => m.re.test(currentLocation.path));
- if (!matcher)
- throw createRouterError(1 , {
- location,
- currentLocation,
- });
- name = matcher.record.name;
-
-
- params = assign({}, currentLocation.params, location.params);
- path = matcher.stringify(params);
- }
- const matched = [];
- let parentMatcher = matcher;
- while (parentMatcher) {
-
- matched.unshift(parentMatcher.record);
- parentMatcher = parentMatcher.parent;
- }
- return {
- name,
- path,
- params,
- matched,
- meta: mergeMetaFields(matched),
- };
- }
-
- routes.forEach(route => addRoute(route));
- function clearRoutes() {
- matchers.length = 0;
- matcherMap.clear();
- }
- return {
- addRoute,
- resolve,
- removeRoute,
- clearRoutes,
- getRoutes,
- getRecordMatcher,
- };
- }
- function paramsFromLocation(params, keys) {
- const newParams = {};
- for (const key of keys) {
- if (key in params)
- newParams[key] = params[key];
- }
- return newParams;
- }
- function normalizeRouteRecord(record) {
- const normalized = {
- path: record.path,
- redirect: record.redirect,
- name: record.name,
- meta: record.meta || {},
- aliasOf: record.aliasOf,
- beforeEnter: record.beforeEnter,
- props: normalizeRecordProps(record),
- children: record.children || [],
- instances: {},
- leaveGuards: new Set(),
- updateGuards: new Set(),
- enterCallbacks: {},
-
-
- components: 'components' in record
- ? record.components || null
- : record.component && { default: record.component },
- };
-
-
-
- Object.defineProperty(normalized, 'mods', {
- value: {},
- });
- return normalized;
- }
- function normalizeRecordProps(record) {
- const propsObject = {};
-
- const props = record.props || false;
- if ('component' in record) {
- propsObject.default = props;
- }
- else {
-
-
- for (const name in record.components)
- propsObject[name] = typeof props === 'object' ? props[name] : props;
- }
- return propsObject;
- }
- function isAliasRecord(record) {
- while (record) {
- if (record.record.aliasOf)
- return true;
- record = record.parent;
- }
- return false;
- }
- function mergeMetaFields(matched) {
- return matched.reduce((meta, record) => assign(meta, record.meta), {});
- }
- function mergeOptions(defaults, partialOptions) {
- const options = {};
- for (const key in defaults) {
- options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
- }
- return options;
- }
- function findInsertionIndex(matcher, matchers) {
-
- let lower = 0;
- let upper = matchers.length;
- while (lower !== upper) {
- const mid = (lower + upper) >> 1;
- const sortOrder = comparePathParserScore(matcher, matchers[mid]);
- if (sortOrder < 0) {
- upper = mid;
- }
- else {
- lower = mid + 1;
- }
- }
-
- const insertionAncestor = getInsertionAncestor(matcher);
- if (insertionAncestor) {
- upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
- }
- return upper;
- }
- function getInsertionAncestor(matcher) {
- let ancestor = matcher;
- while ((ancestor = ancestor.parent)) {
- if (isMatchable(ancestor) &&
- comparePathParserScore(matcher, ancestor) === 0) {
- return ancestor;
- }
- }
- return;
- }
- function isMatchable({ record }) {
- return !!(record.name ||
- (record.components && Object.keys(record.components).length) ||
- record.redirect);
- }
- function parseQuery(search) {
- const query = {};
-
-
- if (search === '' || search === '?')
- return query;
- const hasLeadingIM = search[0] === '?';
- const searchParams = (hasLeadingIM ? search.slice(1) : search).split('&');
- for (let i = 0; i < searchParams.length; ++i) {
-
- const searchParam = searchParams[i].replace(PLUS_RE, ' ');
-
- const eqPos = searchParam.indexOf('=');
- const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
- const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
- if (key in query) {
-
- let currentValue = query[key];
- if (!isArray(currentValue)) {
- currentValue = query[key] = [currentValue];
- }
- currentValue.push(value);
- }
- else {
- query[key] = value;
- }
- }
- return query;
- }
- function stringifyQuery(query) {
- let search = '';
- for (let key in query) {
- const value = query[key];
- key = encodeQueryKey(key);
- if (value == null) {
-
- if (value !== undefined) {
- search += (search.length ? '&' : '') + key;
- }
- continue;
- }
-
- const values = isArray(value)
- ? value.map(v => v && encodeQueryValue(v))
- : [value && encodeQueryValue(value)];
- values.forEach(value => {
-
-
- if (value !== undefined) {
-
- search += (search.length ? '&' : '') + key;
- if (value != null)
- search += '=' + value;
- }
- });
- }
- return search;
- }
- function normalizeQuery(query) {
- const normalizedQuery = {};
- for (const key in query) {
- const value = query[key];
- if (value !== undefined) {
- normalizedQuery[key] = isArray(value)
- ? value.map(v => (v == null ? null : '' + v))
- : value == null
- ? value
- : '' + value;
- }
- }
- return normalizedQuery;
- }
- const matchedRouteKey = Symbol('');
- const viewDepthKey = Symbol('');
- const routerKey = Symbol('');
- const routeLocationKey = Symbol('');
- const routerViewLocationKey = Symbol('');
- function useCallbacks() {
- let handlers = [];
- function add(handler) {
- handlers.push(handler);
- return () => {
- const i = handlers.indexOf(handler);
- if (i > -1)
- handlers.splice(i, 1);
- };
- }
- function reset() {
- handlers = [];
- }
- return {
- add,
- list: () => handlers.slice(),
- reset,
- };
- }
- function registerGuard(record, name, guard) {
- const removeFromList = () => {
- record[name].delete(guard);
- };
- vue.onUnmounted(removeFromList);
- vue.onDeactivated(removeFromList);
- vue.onActivated(() => {
- record[name].add(guard);
- });
- record[name].add(guard);
- }
- function onBeforeRouteLeave(leaveGuard) {
- const activeRecord = vue.inject(matchedRouteKey,
-
- {}).value;
- if (!activeRecord) {
- return;
- }
- registerGuard(activeRecord, 'leaveGuards', leaveGuard);
- }
- function onBeforeRouteUpdate(updateGuard) {
- const activeRecord = vue.inject(matchedRouteKey,
-
- {}).value;
- if (!activeRecord) {
- return;
- }
- registerGuard(activeRecord, 'updateGuards', updateGuard);
- }
- function guardToPromiseFn(guard, to, from, record, name, runWithContext = fn => fn()) {
-
- const enterCallbackArray = record &&
-
- (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
- return () => new Promise((resolve, reject) => {
- const next = (valid) => {
- if (valid === false) {
- reject(createRouterError(4 , {
- from,
- to,
- }));
- }
- else if (valid instanceof Error) {
- reject(valid);
- }
- else if (isRouteLocation(valid)) {
- reject(createRouterError(2 , {
- from: to,
- to: valid,
- }));
- }
- else {
- if (enterCallbackArray &&
-
- record.enterCallbacks[name] === enterCallbackArray &&
- typeof valid === 'function') {
- enterCallbackArray.push(valid);
- }
- resolve();
- }
- };
-
- const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
- let guardCall = Promise.resolve(guardReturn);
- if (guard.length < 3)
- guardCall = guardCall.then(next);
- guardCall.catch(err => reject(err));
- });
- }
- function extractComponentsGuards(matched, guardType, to, from, runWithContext = fn => fn()) {
- const guards = [];
- for (const record of matched) {
- for (const name in record.components) {
- let rawComponent = record.components[name];
-
- if (guardType !== 'beforeRouteEnter' && !record.instances[name])
- continue;
- if (isRouteComponent(rawComponent)) {
-
- const options = rawComponent.__vccOpts || rawComponent;
- const guard = options[guardType];
- guard &&
- guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
- }
- else {
-
- let componentPromise = rawComponent();
- guards.push(() => componentPromise.then(resolved => {
- if (!resolved)
- throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
- const resolvedComponent = isESModule(resolved)
- ? resolved.default
- : resolved;
-
- record.mods[name] = resolved;
-
-
- record.components[name] = resolvedComponent;
-
- const options = resolvedComponent.__vccOpts || resolvedComponent;
- const guard = options[guardType];
- return (guard &&
- guardToPromiseFn(guard, to, from, record, name, runWithContext)());
- }));
- }
- }
- }
- return guards;
- }
- function loadRouteLocation(route) {
- return route.matched.every(record => record.redirect)
- ? Promise.reject(new Error('Cannot load a route that redirects.'))
- : Promise.all(route.matched.map(record => record.components &&
- Promise.all(Object.keys(record.components).reduce((promises, name) => {
- const rawComponent = record.components[name];
- if (typeof rawComponent === 'function' &&
- !('displayName' in rawComponent)) {
- promises.push(rawComponent().then(resolved => {
- if (!resolved)
- return Promise.reject(new Error(`Couldn't resolve component "${name}" at "${record.path}". Ensure you passed a function that returns a promise.`));
- const resolvedComponent = isESModule(resolved)
- ? resolved.default
- : resolved;
-
- record.mods[name] = resolved;
-
-
- record.components[name] = resolvedComponent;
- return;
- }));
- }
- return promises;
- }, [])))).then(() => route);
- }
- function useLink(props) {
- const router = vue.inject(routerKey);
- const currentRoute = vue.inject(routeLocationKey);
- const route = vue.computed(() => {
- const to = vue.unref(props.to);
- return router.resolve(to);
- });
- const activeRecordIndex = vue.computed(() => {
- const { matched } = route.value;
- const { length } = matched;
- const routeMatched = matched[length - 1];
- const currentMatched = currentRoute.matched;
- if (!routeMatched || !currentMatched.length)
- return -1;
- const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
- if (index > -1)
- return index;
-
- const parentRecordPath = getOriginalPath(matched[length - 2]);
- return (
-
- length > 1 &&
-
-
-
- getOriginalPath(routeMatched) === parentRecordPath &&
-
- currentMatched[currentMatched.length - 1].path !== parentRecordPath
- ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2]))
- : index);
- });
- const isActive = vue.computed(() => activeRecordIndex.value > -1 &&
- includesParams(currentRoute.params, route.value.params));
- const isExactActive = vue.computed(() => activeRecordIndex.value > -1 &&
- activeRecordIndex.value === currentRoute.matched.length - 1 &&
- isSameRouteLocationParams(currentRoute.params, route.value.params));
- function navigate(e = {}) {
- if (guardEvent(e)) {
- const p = router[vue.unref(props.replace) ? 'replace' : 'push'](vue.unref(props.to)
-
- ).catch(noop);
- if (props.viewTransition &&
- typeof document !== 'undefined' &&
- 'startViewTransition' in document) {
- document.startViewTransition(() => p);
- }
- return p;
- }
- return Promise.resolve();
- }
-
- return {
- route,
- href: vue.computed(() => route.value.href),
- isActive,
- isExactActive,
- navigate,
- };
- }
- function preferSingleVNode(vnodes) {
- return vnodes.length === 1 ? vnodes[0] : vnodes;
- }
- const RouterLinkImpl = vue.defineComponent({
- name: 'RouterLink',
- compatConfig: { MODE: 3 },
- props: {
- to: {
- type: [String, Object],
- required: true,
- },
- replace: Boolean,
- activeClass: String,
-
- exactActiveClass: String,
- custom: Boolean,
- ariaCurrentValue: {
- type: String,
- default: 'page',
- },
- },
- useLink,
- setup(props, { slots }) {
- const link = vue.reactive(useLink(props));
- const { options } = vue.inject(routerKey);
- const elClass = vue.computed(() => ({
- [getLinkClass(props.activeClass, options.linkActiveClass, 'router-link-active')]: link.isActive,
-
-
-
-
-
- [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, 'router-link-exact-active')]: link.isExactActive,
- }));
- return () => {
- const children = slots.default && preferSingleVNode(slots.default(link));
- return props.custom
- ? children
- : vue.h('a', {
- 'aria-current': link.isExactActive
- ? props.ariaCurrentValue
- : null,
- href: link.href,
-
-
- onClick: link.navigate,
- class: elClass.value,
- }, children);
- };
- },
- });
- const RouterLink = RouterLinkImpl;
- function guardEvent(e) {
-
- if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
- return;
-
- if (e.defaultPrevented)
- return;
-
- if (e.button !== undefined && e.button !== 0)
- return;
-
-
- if (e.currentTarget && e.currentTarget.getAttribute) {
-
- const target = e.currentTarget.getAttribute('target');
- if (/\b_blank\b/i.test(target))
- return;
- }
-
- if (e.preventDefault)
- e.preventDefault();
- return true;
- }
- function includesParams(outer, inner) {
- for (const key in inner) {
- const innerValue = inner[key];
- const outerValue = outer[key];
- if (typeof innerValue === 'string') {
- if (innerValue !== outerValue)
- return false;
- }
- else {
- if (!isArray(outerValue) ||
- outerValue.length !== innerValue.length ||
- innerValue.some((value, i) => value !== outerValue[i]))
- return false;
- }
- }
- return true;
- }
- function getOriginalPath(record) {
- return record ? (record.aliasOf ? record.aliasOf.path : record.path) : '';
- }
- const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null
- ? propClass
- : globalClass != null
- ? globalClass
- : defaultClass;
- const RouterViewImpl = vue.defineComponent({
- name: 'RouterView',
-
- inheritAttrs: false,
- props: {
- name: {
- type: String,
- default: 'default',
- },
- route: Object,
- },
-
-
- compatConfig: { MODE: 3 },
- setup(props, { attrs, slots }) {
- const injectedRoute = vue.inject(routerViewLocationKey);
- const routeToDisplay = vue.computed(() => props.route || injectedRoute.value);
- const injectedDepth = vue.inject(viewDepthKey, 0);
-
-
- const depth = vue.computed(() => {
- let initialDepth = vue.unref(injectedDepth);
- const { matched } = routeToDisplay.value;
- let matchedRoute;
- while ((matchedRoute = matched[initialDepth]) &&
- !matchedRoute.components) {
- initialDepth++;
- }
- return initialDepth;
- });
- const matchedRouteRef = vue.computed(() => routeToDisplay.value.matched[depth.value]);
- vue.provide(viewDepthKey, vue.computed(() => depth.value + 1));
- vue.provide(matchedRouteKey, matchedRouteRef);
- vue.provide(routerViewLocationKey, routeToDisplay);
- const viewRef = vue.ref();
-
-
- vue.watch(() => [viewRef.value, matchedRouteRef.value, props.name], ([instance, to, name], [oldInstance, from, oldName]) => {
-
- if (to) {
-
-
- to.instances[name] = instance;
-
-
-
-
-
-
- if (from && from !== to && instance && instance === oldInstance) {
- if (!to.leaveGuards.size) {
- to.leaveGuards = from.leaveGuards;
- }
- if (!to.updateGuards.size) {
- to.updateGuards = from.updateGuards;
- }
- }
- }
-
- if (instance &&
- to &&
-
-
- (!from || !isSameRouteRecord(to, from) || !oldInstance)) {
- (to.enterCallbacks[name] || []).forEach(callback => callback(instance));
- }
- }, { flush: 'post' });
- return () => {
- const route = routeToDisplay.value;
-
-
- const currentName = props.name;
- const matchedRoute = matchedRouteRef.value;
- const ViewComponent = matchedRoute && matchedRoute.components[currentName];
- if (!ViewComponent) {
- return normalizeSlot(slots.default, { Component: ViewComponent, route });
- }
-
- const routePropsOption = matchedRoute.props[currentName];
- const routeProps = routePropsOption
- ? routePropsOption === true
- ? route.params
- : typeof routePropsOption === 'function'
- ? routePropsOption(route)
- : routePropsOption
- : null;
- const onVnodeUnmounted = vnode => {
-
- if (vnode.component.isUnmounted) {
- matchedRoute.instances[currentName] = null;
- }
- };
- const component = vue.h(ViewComponent, assign({}, routeProps, attrs, {
- onVnodeUnmounted,
- ref: viewRef,
- }));
- return (
-
-
- normalizeSlot(slots.default, { Component: component, route }) ||
- component);
- };
- },
- });
- function normalizeSlot(slot, data) {
- if (!slot)
- return null;
- const slotContent = slot(data);
- return slotContent.length === 1 ? slotContent[0] : slotContent;
- }
- const RouterView = RouterViewImpl;
- function createRouter(options) {
- const matcher = createRouterMatcher(options.routes, options);
- const parseQuery$1 = options.parseQuery || parseQuery;
- const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
- const routerHistory = options.history;
- const beforeGuards = useCallbacks();
- const beforeResolveGuards = useCallbacks();
- const afterGuards = useCallbacks();
- const currentRoute = vue.shallowRef(START_LOCATION_NORMALIZED);
- let pendingLocation = START_LOCATION_NORMALIZED;
-
- if (isBrowser && options.scrollBehavior && 'scrollRestoration' in history) {
- history.scrollRestoration = 'manual';
- }
- const normalizeParams = applyToParams.bind(null, paramValue => '' + paramValue);
- const encodeParams = applyToParams.bind(null, encodeParam);
- const decodeParams =
-
- applyToParams.bind(null, decode);
- function addRoute(parentOrRoute, route) {
- let parent;
- let record;
- if (isRouteName(parentOrRoute)) {
- parent = matcher.getRecordMatcher(parentOrRoute);
- record = route;
- }
- else {
- record = parentOrRoute;
- }
- return matcher.addRoute(record, parent);
- }
- function removeRoute(name) {
- const recordMatcher = matcher.getRecordMatcher(name);
- if (recordMatcher) {
- matcher.removeRoute(recordMatcher);
- }
- }
- function getRoutes() {
- return matcher.getRoutes().map(routeMatcher => routeMatcher.record);
- }
- function hasRoute(name) {
- return !!matcher.getRecordMatcher(name);
- }
- function resolve(rawLocation, currentLocation) {
-
-
-
- currentLocation = assign({}, currentLocation || currentRoute.value);
- if (typeof rawLocation === 'string') {
- const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
- const matchedRoute = matcher.resolve({ path: locationNormalized.path }, currentLocation);
- const href = routerHistory.createHref(locationNormalized.fullPath);
-
- return assign(locationNormalized, matchedRoute, {
- params: decodeParams(matchedRoute.params),
- hash: decode(locationNormalized.hash),
- redirectedFrom: undefined,
- href,
- });
- }
- let matcherLocation;
-
- if (rawLocation.path != null) {
- matcherLocation = assign({}, rawLocation, {
- path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path,
- });
- }
- else {
-
- const targetParams = assign({}, rawLocation.params);
- for (const key in targetParams) {
- if (targetParams[key] == null) {
- delete targetParams[key];
- }
- }
-
- matcherLocation = assign({}, rawLocation, {
- params: encodeParams(targetParams),
- });
-
-
- currentLocation.params = encodeParams(currentLocation.params);
- }
- const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
- const hash = rawLocation.hash || '';
-
-
- matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
- const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
- hash: encodeHash(hash),
- path: matchedRoute.path,
- }));
- const href = routerHistory.createHref(fullPath);
- return assign({
- fullPath,
-
-
- hash,
- query:
-
-
-
-
-
- stringifyQuery$1 === stringifyQuery
- ? normalizeQuery(rawLocation.query)
- : (rawLocation.query || {}),
- }, matchedRoute, {
- redirectedFrom: undefined,
- 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 , {
- from,
- to,
- });
- }
- }
- function push(to) {
- return pushWithRedirect(to);
- }
- function replace(to) {
- return push(assign(locationAsObject(to), { replace: true }));
- }
- function handleRedirectRecord(to) {
- const lastMatched = to.matched[to.matched.length - 1];
- if (lastMatched && lastMatched.redirect) {
- const { redirect } = lastMatched;
- let newTargetLocation = typeof redirect === 'function' ? redirect(to) : redirect;
- if (typeof newTargetLocation === 'string') {
- newTargetLocation =
- newTargetLocation.includes('?') || newTargetLocation.includes('#')
- ? (newTargetLocation = locationAsObject(newTargetLocation))
- :
- { path: newTargetLocation };
-
-
- newTargetLocation.params = {};
- }
- return assign({
- query: to.query,
- hash: to.hash,
-
- params: newTargetLocation.path != null ? {} : to.params,
- }, newTargetLocation);
- }
- }
- function pushWithRedirect(to, redirectedFrom) {
- const targetLocation = (pendingLocation = resolve(to));
- const from = currentRoute.value;
- const data = to.state;
- const force = to.force;
-
- const replace = to.replace === true;
- const shouldRedirect = handleRedirectRecord(targetLocation);
- if (shouldRedirect)
- return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
- state: typeof shouldRedirect === 'object'
- ? assign({}, data, shouldRedirect.state)
- : data,
- force,
- replace,
- }),
-
- redirectedFrom || targetLocation);
-
- const toLocation = targetLocation;
- toLocation.redirectedFrom = redirectedFrom;
- let failure;
- if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
- failure = createRouterError(16 , { to: toLocation, from });
-
- handleScroll(from, from,
-
-
- true,
-
-
- false);
- }
- return (failure ? Promise.resolve(failure) : navigate(toLocation, from))
- .catch((error) => isNavigationFailure(error)
- ?
- isNavigationFailure(error, 2 )
- ? error
- : markAsReady(error)
- :
- triggerError(error, toLocation, from))
- .then((failure) => {
- if (failure) {
- if (isNavigationFailure(failure, 2 )) {
- return pushWithRedirect(
-
- assign({
-
- replace,
- }, locationAsObject(failure.to), {
- state: typeof failure.to === 'object'
- ? assign({}, data, failure.to.state)
- : data,
- force,
- }),
-
- redirectedFrom || toLocation);
- }
- }
- else {
-
- failure = finalizeNavigation(toLocation, from, true, replace, data);
- }
- triggerAfterEach(toLocation, from, failure);
- return failure;
- });
- }
-
- function checkCanceledNavigationAndReject(to, from) {
- const error = checkCanceledNavigation(to, from);
- return error ? Promise.reject(error) : Promise.resolve();
- }
- function runWithContext(fn) {
- const app = installedApps.values().next().value;
-
- return app && typeof app.runWithContext === 'function'
- ? app.runWithContext(fn)
- : fn();
- }
-
- function navigate(to, from) {
- let guards;
- const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
-
- guards = extractComponentsGuards(leavingRecords.reverse(), 'beforeRouteLeave', to, from);
-
- for (const record of leavingRecords) {
- record.leaveGuards.forEach(guard => {
- guards.push(guardToPromiseFn(guard, to, from));
- });
- }
- const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
- guards.push(canceledNavigationCheck);
-
- return (runGuardQueue(guards)
- .then(() => {
-
- guards = [];
- for (const guard of beforeGuards.list()) {
- guards.push(guardToPromiseFn(guard, to, from));
- }
- guards.push(canceledNavigationCheck);
- return runGuardQueue(guards);
- })
- .then(() => {
-
- guards = extractComponentsGuards(updatingRecords, 'beforeRouteUpdate', to, from);
- for (const record of updatingRecords) {
- record.updateGuards.forEach(guard => {
- guards.push(guardToPromiseFn(guard, to, from));
- });
- }
- guards.push(canceledNavigationCheck);
-
- return runGuardQueue(guards);
- })
- .then(() => {
-
- guards = [];
- for (const record of enteringRecords) {
-
- if (record.beforeEnter) {
- if (isArray(record.beforeEnter)) {
- for (const beforeEnter of record.beforeEnter)
- guards.push(guardToPromiseFn(beforeEnter, to, from));
- }
- else {
- guards.push(guardToPromiseFn(record.beforeEnter, to, from));
- }
- }
- }
- guards.push(canceledNavigationCheck);
-
- return runGuardQueue(guards);
- })
- .then(() => {
-
-
- to.matched.forEach(record => (record.enterCallbacks = {}));
-
- guards = extractComponentsGuards(enteringRecords, 'beforeRouteEnter', to, from, runWithContext);
- guards.push(canceledNavigationCheck);
-
- return runGuardQueue(guards);
- })
- .then(() => {
-
- guards = [];
- for (const guard of beforeResolveGuards.list()) {
- guards.push(guardToPromiseFn(guard, to, from));
- }
- guards.push(canceledNavigationCheck);
- return runGuardQueue(guards);
- })
-
- .catch(err => isNavigationFailure(err, 8 )
- ? err
- : Promise.reject(err)));
- }
- function triggerAfterEach(to, from, failure) {
-
-
- afterGuards
- .list()
- .forEach(guard => runWithContext(() => guard(to, from, failure)));
- }
-
- function finalizeNavigation(toLocation, from, isPush, replace, data) {
-
- const error = checkCanceledNavigation(toLocation, from);
- if (error)
- return error;
-
- const isFirstNavigation = from === START_LOCATION_NORMALIZED;
- const state = !isBrowser ? {} : history.state;
-
-
- if (isPush) {
-
-
- if (replace || isFirstNavigation)
- routerHistory.replace(toLocation.fullPath, assign({
- scroll: isFirstNavigation && state && state.scroll,
- }, data));
- else
- routerHistory.push(toLocation.fullPath, data);
- }
-
- currentRoute.value = toLocation;
- handleScroll(toLocation, from, isPush, isFirstNavigation);
- markAsReady();
- }
- let removeHistoryListener;
-
- function setupListeners() {
-
- if (removeHistoryListener)
- return;
- removeHistoryListener = routerHistory.listen((to, _from, info) => {
- if (!router.listening)
- return;
-
- const toLocation = resolve(to);
-
-
-
- const shouldRedirect = handleRedirectRecord(toLocation);
- if (shouldRedirect) {
- pushWithRedirect(assign(shouldRedirect, { replace: true, force: true }), toLocation).catch(noop);
- return;
- }
- pendingLocation = toLocation;
- const from = currentRoute.value;
-
- if (isBrowser) {
- saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
- }
- navigate(toLocation, from)
- .catch((error) => {
- if (isNavigationFailure(error, 4 | 8 )) {
- return error;
- }
- if (isNavigationFailure(error, 2 )) {
-
-
-
-
-
-
-
-
-
- pushWithRedirect(assign(locationAsObject(error.to), {
- force: true,
- }), toLocation
-
- )
- .then(failure => {
-
-
-
- if (isNavigationFailure(failure, 4 |
- 16 ) &&
- !info.delta &&
- info.type === NavigationType.pop) {
- routerHistory.go(-1, false);
- }
- })
- .catch(noop);
-
- return Promise.reject();
- }
-
- if (info.delta) {
- routerHistory.go(-info.delta, false);
- }
-
- return triggerError(error, toLocation, from);
- })
- .then((failure) => {
- failure =
- failure ||
- finalizeNavigation(
-
- toLocation, from, false);
-
- if (failure) {
- if (info.delta &&
-
-
- !isNavigationFailure(failure, 8 )) {
- routerHistory.go(-info.delta, false);
- }
- else if (info.type === NavigationType.pop &&
- isNavigationFailure(failure, 4 | 16 )) {
-
-
- routerHistory.go(-1, false);
- }
- }
- triggerAfterEach(toLocation, from, failure);
- })
-
- .catch(noop);
- });
- }
-
- let readyHandlers = useCallbacks();
- let errorListeners = useCallbacks();
- let ready;
-
- function triggerError(error, to, from) {
- markAsReady(error);
- const list = errorListeners.list();
- if (list.length) {
- list.forEach(handler => 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((resolve, reject) => {
- readyHandlers.add([resolve, reject]);
- });
- }
- function markAsReady(err) {
- if (!ready) {
-
- ready = !err;
- setupListeners();
- readyHandlers
- .list()
- .forEach(([resolve, reject]) => (err ? reject(err) : resolve()));
- readyHandlers.reset();
- }
- return err;
- }
-
- function handleScroll(to, from, isPush, isFirstNavigation) {
- const { scrollBehavior } = options;
- if (!isBrowser || !scrollBehavior)
- return Promise.resolve();
- const scrollPosition = (!isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0))) ||
- ((isFirstNavigation || !isPush) &&
- history.state &&
- history.state.scroll) ||
- null;
- return vue.nextTick()
- .then(() => scrollBehavior(to, from, scrollPosition))
- .then(position => position && scrollToPosition(position))
- .catch(err => triggerError(err, to, from));
- }
- const go = (delta) => routerHistory.go(delta);
- let started;
- const installedApps = new Set();
- const router = {
- currentRoute,
- listening: true,
- addRoute,
- removeRoute,
- clearRoutes: matcher.clearRoutes,
- hasRoute,
- getRoutes,
- resolve,
- options,
- push,
- replace,
- go,
- back: () => go(-1),
- forward: () => go(1),
- beforeEach: beforeGuards.add,
- beforeResolve: beforeResolveGuards.add,
- afterEach: afterGuards.add,
- onError: errorListeners.add,
- isReady,
- install(app) {
- const router = this;
- app.component('RouterLink', RouterLink);
- app.component('RouterView', RouterView);
- app.config.globalProperties.$router = router;
- Object.defineProperty(app.config.globalProperties, '$route', {
- enumerable: true,
- get: () => vue.unref(currentRoute),
- });
-
-
-
- if (isBrowser &&
-
-
- !started &&
- currentRoute.value === START_LOCATION_NORMALIZED) {
-
- started = true;
- push(routerHistory.location).catch(err => {
- });
- }
- const reactiveRoute = {};
- for (const key in START_LOCATION_NORMALIZED) {
- Object.defineProperty(reactiveRoute, key, {
- get: () => currentRoute.value[key],
- enumerable: true,
- });
- }
- app.provide(routerKey, router);
- app.provide(routeLocationKey, vue.shallowReactive(reactiveRoute));
- app.provide(routerViewLocationKey, currentRoute);
- const unmountApp = app.unmount;
- installedApps.add(app);
- app.unmount = function () {
- installedApps.delete(app);
-
- if (installedApps.size < 1) {
-
- pendingLocation = START_LOCATION_NORMALIZED;
- removeHistoryListener && removeHistoryListener();
- removeHistoryListener = null;
- currentRoute.value = START_LOCATION_NORMALIZED;
- started = false;
- ready = false;
- }
- unmountApp();
- };
- },
- };
-
- function runGuardQueue(guards) {
- return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
- }
- return router;
- }
- function extractChangingRecords(to, from) {
- const leavingRecords = [];
- const updatingRecords = [];
- const enteringRecords = [];
- const len = Math.max(from.matched.length, to.matched.length);
- for (let i = 0; i < len; i++) {
- const recordFrom = from.matched[i];
- if (recordFrom) {
- if (to.matched.find(record => isSameRouteRecord(record, recordFrom)))
- updatingRecords.push(recordFrom);
- else
- leavingRecords.push(recordFrom);
- }
- const recordTo = to.matched[i];
- if (recordTo) {
-
- if (!from.matched.find(record => isSameRouteRecord(record, recordTo))) {
- enteringRecords.push(recordTo);
- }
- }
- }
- return [leavingRecords, updatingRecords, enteringRecords];
- }
- function useRouter() {
- return vue.inject(routerKey);
- }
- function useRoute(_name) {
- return vue.inject(routeLocationKey);
- }
- exports.RouterLink = RouterLink;
- exports.RouterView = RouterView;
- exports.START_LOCATION = START_LOCATION_NORMALIZED;
- exports.createMemoryHistory = createMemoryHistory;
- exports.createRouter = createRouter;
- exports.createRouterMatcher = createRouterMatcher;
- exports.createWebHashHistory = createWebHashHistory;
- exports.createWebHistory = createWebHistory;
- exports.isNavigationFailure = isNavigationFailure;
- exports.loadRouteLocation = loadRouteLocation;
- exports.matchedRouteKey = matchedRouteKey;
- exports.onBeforeRouteLeave = onBeforeRouteLeave;
- exports.onBeforeRouteUpdate = onBeforeRouteUpdate;
- exports.parseQuery = parseQuery;
- exports.routeLocationKey = routeLocationKey;
- exports.routerKey = routerKey;
- exports.routerViewLocationKey = routerViewLocationKey;
- exports.stringifyQuery = stringifyQuery;
- exports.useLink = useLink;
- exports.useRoute = useRoute;
- exports.useRouter = useRouter;
- exports.viewDepthKey = viewDepthKey;
|