ui5-lib-guard-router 1.6.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/{dist/.ui5 → .ui5}/build-manifest.json +56 -8
  2. package/CHANGELOG.md +190 -0
  3. package/README.md +695 -327
  4. package/dist/index.d.ts +9 -5
  5. package/dist/resources/ui5/guard/router/.library +1 -1
  6. package/dist/resources/ui5/guard/router/GuardConfig-dbg.js +222 -0
  7. package/dist/resources/ui5/guard/router/GuardConfig-dbg.js.map +1 -0
  8. package/dist/resources/ui5/guard/router/GuardConfig.d.ts +89 -0
  9. package/dist/resources/ui5/guard/router/GuardConfig.d.ts.map +1 -0
  10. package/dist/resources/ui5/guard/router/GuardConfig.js +2 -0
  11. package/dist/resources/ui5/guard/router/GuardConfig.js.map +1 -0
  12. package/dist/resources/ui5/guard/router/GuardModules-dbg.js +253 -0
  13. package/dist/resources/ui5/guard/router/GuardModules-dbg.js.map +1 -0
  14. package/dist/resources/ui5/guard/router/GuardModules.d.ts +72 -0
  15. package/dist/resources/ui5/guard/router/GuardModules.d.ts.map +1 -0
  16. package/dist/resources/ui5/guard/router/GuardModules.js +2 -0
  17. package/dist/resources/ui5/guard/router/GuardModules.js.map +1 -0
  18. package/dist/resources/ui5/guard/router/GuardPipeline-dbg.js +122 -121
  19. package/dist/resources/ui5/guard/router/GuardPipeline-dbg.js.map +1 -1
  20. package/dist/resources/ui5/guard/router/GuardPipeline.d.ts +45 -26
  21. package/dist/resources/ui5/guard/router/GuardPipeline.d.ts.map +1 -1
  22. package/dist/resources/ui5/guard/router/GuardPipeline.js +1 -1
  23. package/dist/resources/ui5/guard/router/GuardPipeline.js.map +1 -1
  24. package/dist/resources/ui5/guard/router/NavigationOutcome-dbg.js +3 -3
  25. package/dist/resources/ui5/guard/router/NavigationOutcome-dbg.js.map +1 -1
  26. package/dist/resources/ui5/guard/router/NavigationOutcome.d.ts +3 -3
  27. package/dist/resources/ui5/guard/router/NavigationOutcome.d.ts.map +1 -1
  28. package/dist/resources/ui5/guard/router/NavigationOutcome.js.map +1 -1
  29. package/dist/resources/ui5/guard/router/PatternTree-dbg.js +156 -0
  30. package/dist/resources/ui5/guard/router/PatternTree-dbg.js.map +1 -0
  31. package/dist/resources/ui5/guard/router/PatternTree.d.ts +71 -0
  32. package/dist/resources/ui5/guard/router/PatternTree.d.ts.map +1 -0
  33. package/dist/resources/ui5/guard/router/PatternTree.js +2 -0
  34. package/dist/resources/ui5/guard/router/PatternTree.js.map +1 -0
  35. package/dist/resources/ui5/guard/router/RouteMeta-dbg.js +84 -0
  36. package/dist/resources/ui5/guard/router/RouteMeta-dbg.js.map +1 -0
  37. package/dist/resources/ui5/guard/router/RouteMeta.d.ts +33 -0
  38. package/dist/resources/ui5/guard/router/RouteMeta.d.ts.map +1 -0
  39. package/dist/resources/ui5/guard/router/RouteMeta.js +2 -0
  40. package/dist/resources/ui5/guard/router/RouteMeta.js.map +1 -0
  41. package/dist/resources/ui5/guard/router/Router-dbg.js +882 -1020
  42. package/dist/resources/ui5/guard/router/Router-dbg.js.map +1 -1
  43. package/dist/resources/ui5/guard/router/Router.d.ts +360 -211
  44. package/dist/resources/ui5/guard/router/Router.d.ts.map +1 -1
  45. package/dist/resources/ui5/guard/router/Router.js +1 -1
  46. package/dist/resources/ui5/guard/router/Router.js.map +1 -1
  47. package/dist/resources/ui5/guard/router/library-dbg.js +1 -1
  48. package/dist/resources/ui5/guard/router/library-dbg.js.map +1 -1
  49. package/dist/resources/ui5/guard/router/library-preload.js +8 -4
  50. package/dist/resources/ui5/guard/router/library-preload.js.map +1 -1
  51. package/dist/resources/ui5/guard/router/library.js +1 -1
  52. package/dist/resources/ui5/guard/router/library.js.map +1 -1
  53. package/dist/resources/ui5/guard/router/manifest.json +5 -2
  54. package/dist/resources/ui5/guard/router/types-dbg.js.map +1 -1
  55. package/dist/resources/ui5/guard/router/types.d.ts +94 -39
  56. package/dist/resources/ui5/guard/router/types.d.ts.map +1 -1
  57. package/package.json +10 -6
  58. package/src/GuardConfig.ts +272 -0
  59. package/src/GuardModules.ts +249 -0
  60. package/src/GuardPipeline.ts +155 -128
  61. package/src/NavigationOutcome.ts +3 -3
  62. package/src/PatternTree.ts +145 -0
  63. package/src/RouteMeta.ts +82 -0
  64. package/src/Router.ts +1089 -1130
  65. package/src/manifest.json +5 -2
  66. package/src/types.ts +79 -22
  67. package/tsconfig.json +0 -11
@@ -1 +1 @@
1
- {"version":3,"file":"Router.d.ts","sourceRoot":"../../../../..","sources":["src/Router.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,yBAAyB,CAAC;IACzC,OAAO,YAAY,MAAM,sBAAsB,CAAC;IAGhD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;IAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;IAChE,OAAO,KAAK,EACX,OAAO,EAEP,iBAAiB,EAGjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EAEZ,kBAAkB,EAClB,gBAAgB,EAChB,6BAA6B,EAC7B,gBAAgB,EAChB,8BAA8B,EAC9B,MAAM,SAAS,CAAC;IAIjB,MAAM,gBAAgB,KAAuC,CAAC;IAE9D,MAAM,aAAa,4BAA4B,CAAC;IAEhD,SAAS,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,GAAG,KAAK,IAAI,gBAAgB,CAExF;IAED,iFAAiF;IACjF,UAAU,iBAAiB;QAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;QACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC5B;IAED,UAAU,SAAS;QAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACtB;IAED,UAAU,eAAe;QACxB,QAAQ,CAAC,IAAI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AAO,CAAC,aAAa;QAarB;;;;;;WAMG;QACH,OAAO,CAAC,iBAAiB;QAwBzB;;WAEG;QACH,OAAO,CAAC,cAAc;QA2BtB;;;;;;;;;WASG;QACH,OAAO,CAAC,kBAAkB;QAa1B;;;;;;;;WAQG;QACH,OAAO,CAAC,iBAAiB;QAwBzB;;;;;;;;;;WAUG;QACH,OAAO,CAAC,iBAAiB;QAYzB;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,SAAS;QAgEjB;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,sBAAsB;QA2E9B,yHAAyH;QACzH,OAAO,CAAC,WAAW;QAKnB;;;WAGG;QACH,OAAO,CAAC,cAAc;QAItB;;;WAGG;QACH,OAAO,CAAC,eAAe;QAQvB;;;WAGG;QACH,OAAO,CAAC,mBAAmB;QAqB3B;;;;;WAKG;QACH,OAAO,CAAC,mBAAmB;QAuB3B;;;;WAIG;QACH,OAAO,CAAC,gBAAgB;QASxB;;;;WAIG;QACH,OAAO,CAAC,gBAAgB;QASxB;;;;;;WAMG;QACH,OAAO,CAAC,kBAAkB;QAe1B;;;;WAIG;QACH,OAAO,CAAC,aAAa;QAerB;;;;;;;;;;;;;;;;WAgBG;QACH,OAAO,CAAC,eAAe;QAyBvB;;;WAGG;QACH,OAAO,CAAC,gBAAgB;QAKxB;;;WAGG;QACH,OAAO,CAAC,cAAc;QAQtB;;;;;;;;;;WAUG;QACH,OAAO,CAAC,YAAY;QAQpB;;;WAGG;QACH,OAAO,CAAC,qBAAqB;QAS7B;;;;;WAKG;QACH,OAAO,CAAC,sBAAsB;QAmB9B,2GAA2G;QAC3G,OAAO,CAAC,mBAAmB;QAM3B;;;;;WAKG;QACM,OAAO,IAAI,IAAI;KAcxB;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["sap/m/routing/Router","sap/base/Log","sap/ui/core/library","./NavigationOutcome","./GuardPipeline"],function(t,e,i,n,r){"use strict";function s(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const o=s(n);const a=s(r);const u=r["isPromiseLike"];const h=i.routing.HistoryDirection;const c="ui5.guard.router.Router";function d(t){return typeof t==="object"&&t!==null}const f={kind:"idle"};function l(t){if(typeof t!=="object"||t===null||Array.isArray(t))return false;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function p(...t){const e=new Set(t);return t=>typeof t==="string"&&e.has(t)}const g=p("ignore","warn","throw");const _=p("guard","bypass","off");const m=p("block","lazy");const v=p("none","pattern-tree");const y=/^:[^:]*\*?:$/;function R(t){const e=t.indexOf("{?");if(e!==-1)return t.slice(0,e);const i=t.indexOf(":?");if(i!==-1)return t.slice(0,i);return t}function b(t){return t.split("/").map(R).filter(t=>t!==""&&!y.test(t))}function k(t,e){if(t==="")return true;const i=b(t);if(i.length===0)return false;const n=b(e);if(n.length<=i.length)return false;return i.every((t,e)=>{const i=n[e];if(t===i)return true;return t.startsWith("{")&&i.startsWith("{")})}function G(t,e){if(t.startsWith("module:")){return t.slice("module:".length).replace(/\./g,"/")}const i=e?e+"."+t:t;return i.replace(/\./g,"/")}function w(t,e){const i=t.indexOf("#");const n=i===-1?t:t.slice(0,i);const r=i===-1?undefined:t.slice(i+1);const s=G(n,e);const o=n.split(".").pop()??n;const a=r??o;return{modulePath:s,name:a,exportKey:r}}function H(t,i){e.warning(`guardRouter.guards: "${t}" ${i}`,undefined,c)}function M(t,i,n,r){const s=i.split("/").pop()??i;if(typeof t==="function"){if(r!==undefined){e.debug(`guardRouter.guards: "${i}#${r}" is a single function, ignoring export key`,undefined,c)}return[{name:n,fn:t}]}if(Array.isArray(t)){if(t.length===0){H(i,"exported an empty array, skipping");return[]}if(r!==undefined){const e=parseInt(r,10);if(Number.isNaN(e)||e<0||e>=t.length){H(i,`#${r} - index out of range, skipping`);return[]}const n=t[e];if(typeof n!=="function"){H(i,`#${r} is not a function, skipping`);return[]}return[{name:`${s}#${r}`,fn:n}]}const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(typeof r!=="function"){H(i,`[${n}] is not a function, skipping`);continue}e.push({name:`${s}#${n}`,fn:r})}return e}if(l(t)){const e=Object.entries(t);if(e.length===0){H(i,"exported an empty object, skipping");return[]}if(r!==undefined){let n=t[r];let s=r;if(n===undefined){const t=parseInt(r,10);if(!Number.isNaN(t)&&t>=0&&t<e.length){const[i,r]=e[t];n=r;s=i}}if(n===undefined){H(i,`#${r} - key not found, skipping`);return[]}if(typeof n!=="function"){H(i,`#${r} is not a function, skipping`);return[]}return[{name:s,fn:n}]}const n=[];for(const[t,r]of e){if(typeof r!=="function"){H(i,`.${t} is not a function, skipping`);continue}n.push({name:t,fn:r})}return n}H(i,"did not export a function, array, or plain object, skipping");return[]}function N(t,i){if(!l(t)){e.warning("guardRouter.guards is not a plain object, skipping",JSON.stringify(t),c);return[]}const n=[];function r(t,r,s,o){for(const a of t){if(typeof a!=="string"||a.length===0){e.warning(`guardRouter.guards${o}: invalid entry, skipping`,JSON.stringify(a),c);continue}const t=w(a,i);n.push({route:r,type:s,...t})}}for(const[i,n]of Object.entries(t)){if(Array.isArray(n)){r(n,i,"enter",`["${i}"]`)}else if(l(n)){const t=n;if(i==="*"&&t.leave!==undefined){e.warning('guardRouter.guards["*"].leave: global leave guards are not supported, skipping',undefined,c)}if(i==="*"&&t.enter===undefined&&t.leave!==undefined){continue}if(i==="*"&&t.enter!==undefined){e.info('guardRouter.guards["*"]: object form; treating enter as global',undefined,c)}if(Array.isArray(t.enter)){r(t.enter,i,"enter",`["${i}"].enter`)}if(i!=="*"&&Array.isArray(t.leave)){r(t.leave,i,"leave",`["${i}"].leave`)}}else{e.warning(`guardRouter.guards["${i}"]: expected string[] or { enter?, leave? }, skipping`,JSON.stringify(n),c)}}return n}const P={unknownRouteRegistration:"warn",navToPreflight:"guard",guardLoading:"lazy",inheritance:"none"};function S(t,i,n,r){if(t[i]!==undefined){if(n(t[i])){r[i]=t[i]}else{e.warning(`guardRouter.${i} has invalid value, using default`,JSON.stringify(t[i]),c)}}}function $(t){if(!l(t)){if(t!==undefined){e.warning("guardRouter config is not a plain object, using defaults",JSON.stringify(t),c)}return P}const i={...P};S(t,"unknownRouteRegistration",g,i);S(t,"navToPreflight",_,i);S(t,"guardLoading",m,i);S(t,"inheritance",v,i);return i}const D=10;const O=t.extend("ui5.guard.router.Router",{constructor:function i(...n){const[r,s,o,...u]=n;const h=s;const d=l(h);const{guardRouter:p,...g}=d?h:{};t.prototype.constructor.apply(this,[r,d?g:s,o,...u]);this._options=P;this._pipeline=new a;this._currentRoute="";this._currentHash=null;this._phase=f;this._parseGeneration=0;this._suppressedHash=null;this._settlementResolvers=[];this._lastSettlement=null;this._pendingGuardDescriptors=[];this._sourceDescriptors=[];this._destroyed=false;this._manifestMeta=new Map;this._runtimeMeta=new Map;this._resolvedMetaCache=new Map;this._routeNames=[];this._options=$(p);if(Array.isArray(r)){this._routeNames=r.filter(t=>l(t)&&typeof t.name==="string").map(t=>t.name)}else if(l(r)){this._routeNames=Object.keys(r)}if(l(p)&&p.routeMeta!==undefined){if(l(p.routeMeta)){for(const[t,i]of Object.entries(p.routeMeta)){if(l(i)){this._manifestMeta.set(t,Object.freeze({...i}))}else{e.warning(`guardRouter.routeMeta["${t}"]: expected object, skipping`,JSON.stringify(i),c)}}}else{e.warning("guardRouter.routeMeta: expected object, skipping",JSON.stringify(p.routeMeta),c)}}if(l(p)&&p.guards!==undefined){let t="";if(o){const e=o.getManifestEntry("sap.app");if(l(e)&&typeof e.id==="string"){t=e.id}}this._pendingGuardDescriptors=N(p.guards,t);if(this._pendingGuardDescriptors.length>0&&this._options.guardLoading==="lazy"){const t=[...new Set(this._pendingGuardDescriptors.map(t=>t.modulePath))];sap.ui.require(t)}}},initialize:function i(){if(this._pendingGuardDescriptors.length===0){return t.prototype.initialize.call(this)}const n=this._pendingGuardDescriptors;this._pendingGuardDescriptors=[];this._sourceDescriptors=n;const r=this._options.inheritance==="pattern-tree"?this._expandGuardDescriptors(n):n;if(this._options.guardLoading==="lazy"){this._registerLazyGuards(r);return t.prototype.initialize.call(this)}this._loadAndRegisterGuards(r).then(()=>{if(!this._destroyed)t.prototype.initialize.call(this)}).catch(i=>{if(this._destroyed)return;e.error("guardRouter.guards: module loading failed, initializing without manifest guards",String(i),c);t.prototype.initialize.call(this)});return this},addRoute:function e(i,...n){t.prototype.addRoute.apply(this,[i,...n]);if(!this._routeNames)return;const r=i.name;if(typeof r!=="string")return;if(this._routeNames.includes(r))return;this._routeNames.push(r);this._resolvedMetaCache.clear();if(this._options.inheritance!=="pattern-tree")return;if(this._sourceDescriptors.length===0)return;const s=this.getRoute(r);if(!s)return;const o=s.getPattern();if(o===undefined)return;const a=this._expandGuardDescriptorsForNewRoute(r,o);if(a.length===0)return;this._registerLazyGuards(a)},_expandGuardDescriptorsForNewRoute:function t(e,i){const n=[];for(const t of this._sourceDescriptors){if(t.route==="*")continue;if(t.route!==e){const r=this.getRoute(t.route);const s=r?.getPattern();if(s!==undefined&&k(s,i)){n.push({...t,route:e})}}else{for(const{name:r,pattern:s}of this._collectRoutePatterns()){if(r===e)continue;if(k(i,s)){n.push({...t,route:r})}}}}return n.toSorted((t,e)=>{const i=this.getRoute(t.route)?.getPattern()??"";const n=this.getRoute(e.route)?.getPattern()??"";return b(i).length-b(n).length})},addGuard:function t(e){if(!this._isFn(e,"addGuard"))return this;this._pipeline.addGlobalGuard(e);return this},removeGuard:function t(e){if(!this._isFn(e,"removeGuard"))return this;this._pipeline.removeGlobalGuard(e);return this},addRouteGuard:function t(i,n){if(d(n)){if(!this._handleUnknownRouteRegistration(i,"addRouteGuard")){return this}let t=false;if(n.beforeEnter!==undefined){t=true;if(this._isFn(n.beforeEnter,"addRouteGuard",i)){this._pipeline.addEnterGuard(i,n.beforeEnter)}}if(n.beforeLeave!==undefined){t=true;if(this._isFn(n.beforeLeave,"addRouteGuard",i)){this._pipeline.addLeaveGuard(i,n.beforeLeave)}}if(!t){e.info("addRouteGuard: config has no beforeEnter or beforeLeave",i,c);return this}return this}if(!this._isFn(n,"addRouteGuard",i))return this;if(!this._handleUnknownRouteRegistration(i,"addRouteGuard")){return this}this._pipeline.addEnterGuard(i,n);return this},removeRouteGuard:function t(e,i){if(d(i)){if(typeof i.beforeEnter==="function"){this.removeRouteGuard(e,i.beforeEnter)}if(typeof i.beforeLeave==="function"){this.removeLeaveGuard(e,i.beforeLeave)}return this}if(!this._isFn(i,"removeRouteGuard",e))return this;this._pipeline.removeEnterGuard(e,i);return this},addLeaveGuard:function t(e,i){if(!this._isFn(i,"addLeaveGuard",e))return this;if(!this._handleUnknownRouteRegistration(e,"addLeaveGuard")){return this}this._pipeline.addLeaveGuard(e,i);return this},_resolveNavToArgs:function t(e,i,n){if(typeof e==="boolean"){return{replace:e,guardOptions:typeof i==="object"&&i!==null?i:undefined}}return{componentTargetInfo:e,replace:typeof i==="boolean"?i:undefined,guardOptions:n}},_isFn:function t(i,n,r){if(typeof i==="function")return true;e.warning(`${n}: not a function, ignoring`,r,c);return false},_handleUnknownRouteRegistration:function t(i,n){if(this.getRoute(i))return true;switch(this._options.unknownRouteRegistration){case"ignore":return true;case"throw":throw new Error(`${n} called for unknown route "${i}". `+`Set guardRouter.unknownRouteRegistration to "warn" or "ignore" to allow this.`);case"warn":default:e.warning(`${n}: unknown route, guard registered anyway`,i,c);return true}},removeLeaveGuard:function t(e,i){if(!this._isFn(i,"removeLeaveGuard",e))return this;this._pipeline.removeLeaveGuard(e,i);return this},getRouteMeta:function t(i){if(i!==""&&!this.getRoute(i)){e.warning("getRouteMeta: unknown route, returning empty metadata",i,c);return O._EMPTY_META}const n=this._resolvedMetaCache.get(i);if(n)return n;let r;if(this._options.inheritance==="pattern-tree"){r=this._resolveInheritedMeta(i)}else{r=this._resolveFlatMeta(i)}if(Object.keys(r).length===0){this._resolvedMetaCache.set(i,O._EMPTY_META);return O._EMPTY_META}this._resolvedMetaCache.set(i,r);return r},setRouteMeta:function t(i,n){if(!l(n)){e.warning("setRouteMeta: expected object, ignoring",i,c);return this}if(i!==""&&!this._handleUnknownRouteRegistration(i,"setRouteMeta")){return this}this._runtimeMeta.set(i,Object.freeze({...n}));this._resolvedMetaCache.clear();return this},navigationSettled:function t(){if(this._phase.kind!=="evaluating"){return Promise.resolve(this._lastSettlement??{status:o.Committed,route:this._currentRoute,hash:this._currentHash??""})}return new Promise(t=>{this._settlementResolvers.push(t)})},attachNavigationSettled:function t(e,i,n){this.attachEvent("navigationSettled",e,i,n);return this},detachNavigationSettled:function t(e,i){this.detachEvent("navigationSettled",e,i);return this},_flushSettlement:function t(e){this._lastSettlement=e;const i=this._settlementResolvers;this._settlementResolvers=[];for(const t of i){t(e)}this.fireEvent("navigationSettled",e)},navTo:function i(n,r,s,o,a){const{componentTargetInfo:h,replace:d,guardOptions:f}=this._resolveNavToArgs(s,o,a);if(this._phase.kind==="committing"&&this._phase.origin==="redirect"){t.prototype.navTo.call(this,n,r,h,d);return this}const l=this.getRoute(n);if(!l){this._cancelPendingNavigation();t.prototype.navTo.call(this,n,r,h,d);return this}const p=l.getURL(r??{});const g=this.getRouteInfoByHash(p);const _=g?.name??"";if(this._currentHash!==null&&p===this._currentHash){this._cancelPendingNavigation();return this}if(this._phase.kind==="evaluating"&&p===this._phase.attempt.hash){return this}this._cancelPendingNavigation();const m=f?.skipGuards===true;if(m||this._options.navToPreflight==="bypass"){this._phase={kind:"committing",hash:p,route:_,origin:"preflight"};t.prototype.navTo.call(this,n,r,h,d);if(this._phase.kind==="committing"&&this._phase.hash===p){this._commitNavigation(p,_)}return this}if(this._options.navToPreflight==="off"){t.prototype.navTo.call(this,n,r,h,d);return this}const v=new AbortController;const y=this._parseGeneration;this._phase={kind:"evaluating",attempt:{hash:p,route:_,controller:v,generation:y}};const R=this._createGuardContext(_,p,g,v.signal);const b=this._pipeline.evaluate(R);if(u(b)){b.then(t=>{if(y!==this._parseGeneration||this._phase.kind!=="evaluating"){e.debug("Async preflight result discarded (superseded by newer navigation)",p,c);return}this._applyPreflightDecision(t,n,r,h,d,p,_,R.bag)}).catch(t=>{if(y!==this._parseGeneration)return;e.error(`Async preflight guard failed for route "${n}", navigation failed`,String(t),c);this._errorNavigation(t,p,false)});return this}this._applyPreflightDecision(b,n,r,h,d,p,_,R.bag);return this},_applyPreflightDecision:function e(i,n,r,s,o,a,u,h){switch(i.action){case"allow":this._phase={kind:"committing",hash:a,route:u,origin:"preflight"};t.prototype.navTo.call(this,n,r,s,o);if(this._phase.kind==="committing"&&this._phase.hash===a){this._commitNavigation(a,u)}break;case"block":this._blockNavigation(a,false);break;case"redirect":this._startRedirectChain(i.target,a,false,h);break;case"error":this._errorNavigation(i.error,a,false);break}},parse:function t(i){if(this._suppressedHash!==null){if(i===this._suppressedHash){this._suppressedHash=null;return}this._suppressedHash=null}if(this._phase.kind==="committing"){this._commitNavigation(i,this._phase.route!==""?this._phase.route:this.getRouteInfoByHash(i)?.name??"");return}if(this._currentHash!==null&&i===this._currentHash){this._cancelPendingNavigation();return}const n=this.getRouteInfoByHash(i);const r=n?.name??"";this._cancelPendingNavigation();const s=new AbortController;const o=this._parseGeneration;this._phase={kind:"evaluating",attempt:{hash:i,route:r,controller:s,generation:o}};const a=this._createGuardContext(r,i,n,s.signal);const h=this._pipeline.evaluate(a);if(u(h)){h.then(t=>{if(o!==this._parseGeneration||this._phase.kind!=="evaluating"){e.debug("Async guard result discarded (superseded by newer navigation)",i,c);return}this._applyDecision(t,i,r,a.bag)}).catch(t=>{if(o!==this._parseGeneration)return;e.error(`Guard pipeline failed for "${i}", navigation failed`,String(t),c);this._errorNavigation(t,i)});return}this._applyDecision(h,i,r,a.bag)},stop:function e(){this._cancelPendingNavigation();this._suppressedHash=null;this._currentRoute="";this._currentHash=null;this._lastSettlement=null;t.prototype.stop.call(this);return this},_cancelPendingNavigation:function t(){++this._parseGeneration;if(this._phase.kind==="evaluating"){this._phase.attempt.controller.abort();this._flushSettlement({status:o.Cancelled,route:this._currentRoute,hash:this._currentHash??""})}this._phase=f},_applyDecision:function t(e,i,n,r){switch(e.action){case"allow":this._phase={kind:"committing",hash:i,route:n,origin:"parse"};this._commitNavigation(i,n);break;case"block":this._blockNavigation(i);break;case"redirect":this._startRedirectChain(e.target,i,true,r);break;case"error":this._errorNavigation(e.error,i);break}},_commitNavigation:function e(i,n){const r=this._phase.kind==="committing"&&this._phase.origin==="redirect";this._currentHash=i;this._currentRoute=n??this.getRouteInfoByHash(i)?.name??"";this._phase=f;this._flushSettlement({status:r?o.Redirected:this._currentRoute===""?o.Bypassed:o.Committed,route:this._currentRoute,hash:i});t.prototype.parse.call(this,i)},_redirect:function t(i,n){const r=typeof i==="string"?i:i.route;let s=null;const o=typeof i==="string"?{}:i.parameters??{};const a=this.getRoute(r);if(a){try{s=a.getURL(o)}catch{s=null}}if(s!==null&&n.visited.has(s)){e.error(`Guard redirect loop detected: ${[...n.visited,s].join(" -> ")}`,undefined,c);this._blockNavigation(n.attemptedHash,n.restoreHash);return}if(n.visited.size>D){e.error(`Guard redirect chain exceeded maximum depth (${D}): ${[...n.visited].join(" -> ")}`,undefined,c);this._blockNavigation(n.attemptedHash,n.restoreHash);return}if(s!==null){n.visited.add(s)}if(s===null){const t=this._lastSettlement;this._phase={kind:"committing",hash:"",route:r,origin:"redirect"};try{if(typeof i==="string"){this.navTo(i,{},{},true)}else{this.navTo(i.route,i.parameters??{},i.componentTargetInfo,true)}}finally{if(this._phase.kind==="committing"){this._phase=f}}if(this._lastSettlement===t){e.warning(`Guard redirect target "${r}" did not produce a navigation, treating as blocked`,undefined,c);this._blockNavigation(n.attemptedHash,n.restoreHash)}return}const h=s;const d=this.getRouteInfoByHash(h);const l={toRoute:d?.name??"",toHash:h,toArguments:d?.arguments??{},fromRoute:n.fromRoute,fromHash:n.fromHash,signal:n.signal,bag:n.bag,toMeta:this.getRouteMeta(d?.name??""),fromMeta:this.getRouteMeta(n.fromRoute)};const p=this._pipeline.evaluate(l,{skipLeaveGuards:true});if(u(p)){p.then(t=>{if(n.generation!==this._parseGeneration)return;this._applyRedirectDecision(t,i,h,n)}).catch(t=>{if(n.generation!==this._parseGeneration)return;e.error(`Guard pipeline failed during redirect chain for "${r}", navigation failed`,String(t),c);this._errorNavigation(t,n.attemptedHash,n.restoreHash)});return}this._applyRedirectDecision(p,i,h,n)},_applyRedirectDecision:function t(i,n,r,s){switch(i.action){case"allow":{const t=typeof n==="string"?n:n.route;const i=this._lastSettlement;this._phase={kind:"committing",hash:r,route:t,origin:"redirect"};try{if(typeof n==="string"){this.navTo(n,{},{},true)}else{this.navTo(n.route,n.parameters??{},n.componentTargetInfo,true)}}finally{if(this._phase.kind==="committing"){this._phase=f}}if(this._lastSettlement===i){const i=r===(this._currentHash??"");if(i){this._phase={kind:"committing",hash:this._currentHash??"",route:this._currentRoute,origin:"redirect"};this._commitNavigation(this._currentHash??"",this._currentRoute);return}e.warning(`Guard redirect target "${t}" did not produce a navigation, treating as blocked`,undefined,c);this._blockNavigation(s.attemptedHash,s.restoreHash)}break}case"block":this._blockNavigation(s.attemptedHash,s.restoreHash);break;case"redirect":this._redirect(i.target,s);break;case"error":this._errorNavigation(i.error,s.attemptedHash,s.restoreHash);break}},_createGuardContext:function t(e,i,n,r){return{toRoute:e,toHash:i,toArguments:n?.arguments??{},fromRoute:this._currentRoute,fromHash:this._currentHash??"",signal:r,bag:new Map,toMeta:this.getRouteMeta(e),fromMeta:this.getRouteMeta(this._currentRoute)}},_startRedirectChain:function t(e,i,n,r){const{attempt:s}=this._phase;const o=new Set;o.add(i);this._redirect(e,{visited:o,attemptedHash:i,restoreHash:n,fromRoute:this._currentRoute,fromHash:this._currentHash??"",signal:s.controller.signal,generation:s.generation,bag:r})},_blockNavigation:function t(e,i=true){this._phase=f;this._flushSettlement({status:o.Blocked,route:this._currentRoute,hash:this._currentHash??""});this._restoreHashIfNeeded(e,i)},_errorNavigation:function t(e,i,n=true){this._phase=f;this._flushSettlement({status:o.Error,route:this._currentRoute,hash:this._currentHash??"",error:e});this._restoreHashIfNeeded(i,n)},_restoreHashIfNeeded:function t(e,i){if(!i)return;if(this._currentHash===null&&e&&e!==""){this._restoreHash("",false);return}this._restoreHash(this._currentHash??"")},_restoreHash:function t(e,i=true){const n=this.getHashChanger();if(n){this._suppressedHash=i?e:null;n.replaceHash(e,h.Unknown);if(this._suppressedHash===e){this._suppressedHash=null}}},_collectRoutePatterns:function t(){const e=[];for(const t of this._routeNames){const i=this.getRoute(t);if(i){const n=i.getPattern();if(n!==undefined){e.push({name:t,pattern:n})}}}return e},_expandGuardDescriptors:function t(e){const i=this._collectRoutePatterns();if(i.length===0)return e;const n=new Map(i.map(t=>[t.name,t.pattern]));const r=[];for(const t of e){r.push(t);if(t.route==="*")continue;const e=n.get(t.route);if(e===undefined)continue;for(const{name:n,pattern:s}of i){if(n===t.route)continue;if(k(e,s)){r.push({...t,route:n})}}}return r.toSorted((t,e)=>{if(t.route==="*"||e.route==="*")return 0;const i=n.get(t.route)??"";const r=n.get(e.route)??"";return b(i).length-b(r).length})},_resolveFlatMeta:function t(e){const i=this._manifestMeta.get(e);const n=this._runtimeMeta.get(e);if(!i&&!n)return O._EMPTY_META;if(!n)return i;if(!i)return n;return Object.freeze({...i,...n})},_resolveInheritedMeta:function t(e){const i=this._collectRoutePatterns();const n=i.find(t=>t.name===e);if(!n)return this._resolveFlatMeta(e);const r=i.filter(t=>t.name!==e&&(this._manifestMeta.has(t.name)||this._runtimeMeta.has(t.name))&&k(t.pattern,n.pattern));r.sort((t,e)=>b(t.pattern).length-b(e.pattern).length);const s={};for(const t of r){const e=this._manifestMeta.get(t.name);if(e)Object.assign(s,e);const i=this._runtimeMeta.get(t.name);if(i)Object.assign(s,i)}const o=this._manifestMeta.get(e);if(o)Object.assign(s,o);const a=this._runtimeMeta.get(e);if(a)Object.assign(s,a);if(Object.keys(s).length===0)return O._EMPTY_META;return Object.freeze(s)},_loadAndRegisterGuards:function t(i){const n=i.map(t=>new Promise(i=>{sap.ui.require([t.modulePath],e=>{i({descriptor:t,moduleExport:e})},n=>{e.warning(`guardRouter.guards: failed to load module "${t.modulePath}", skipping`,String(n),c);i({descriptor:t,moduleExport:null})})}));return Promise.all(n).then(t=>{for(const{descriptor:i,moduleExport:n}of t){if(n===null)continue;const t=M(n,i.modulePath,i.name,i.exportKey);for(const{fn:n}of t){try{this._registerGuardFromDescriptor(i,n)}catch(t){e.error(`guardRouter.guards: failed to register "${i.modulePath}"`,String(t),c)}}}})},_registerGuardFromDescriptor:function t(e,i){if(e.route==="*"){this.addGuard(i)}else if(e.type==="leave"){if(!this._handleUnknownRouteRegistration(e.route,"addLeaveGuard"))return;this._pipeline.addLeaveGuard(e.route,i)}else{this.addRouteGuard(e.route,i)}},_registerLazyGuards:function t(i){for(const t of i){const{modulePath:i,exportKey:n,name:r}=t;if(n!==undefined){const s=t=>{const s=sap.ui.require(i);if(s!==undefined){const e=M(s,i,r,n);if(e.length===0)return true;return e[0].fn(t)}return new Promise((s,o)=>{sap.ui.require([i],e=>{const o=M(e,i,r,n);if(o.length===0){s(true);return}s(o[0].fn(t))},t=>{e.warning(`guardRouter.guards: lazy load of "${i}" failed`,String(t),c);o(t)})})};this._registerGuardFromDescriptor(t,s);continue}const s=sap.ui.require(i);if(s!==undefined){const e=M(s,i,r);for(const i of e){this._registerGuardFromDescriptor(t,i.fn)}continue}let o=false;const a=n=>new Promise((s,a)=>{sap.ui.require([i],e=>{const a=M(e,i,r);if(a.length===0){s(true);return}if(!o){o=true;for(let e=1;e<a.length;e++){this._registerGuardFromDescriptor(t,a[e].fn)}}s(a[0].fn(n))},t=>{e.warning(`guardRouter.guards: lazy load of "${i}" failed`,String(t),c);a(t)})});this._registerGuardFromDescriptor(t,a)}},destroy:function e(){this._destroyed=true;this._pipeline.clear();this._pendingGuardDescriptors=[];this._sourceDescriptors=[];this._cancelPendingNavigation();this._suppressedHash=null;this._lastSettlement=null;this._manifestMeta.clear();this._runtimeMeta.clear();this._resolvedMetaCache.clear();t.prototype.destroy.call(this);return this}});O._EMPTY_META=Object.freeze({});return O});
1
+ sap.ui.define(["sap/m/routing/Router","sap/base/Log","sap/ui/core/library","sap/ui/core/routing/HashChanger","sap/ui/core/routing/History","./NavigationOutcome","./GuardPipeline","./GuardConfig","./GuardModules","./PatternTree","./RouteMeta"],function(t,e,s,i,n,r,a,o,h,u,c){"use strict";function d(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const l=d(r);const _=d(a);const f=a["isPromiseLike"];const p=a["isPromiseResolver"];const g=a["LOG_COMPONENT"];const m=o["isRecord"];const H=o["parseGuardRouterConfig"];const v=h["createLazyGuards"];const R=h["loadGuardModules"];const y=u["byRouteDepth"];const k=u["expandForNewRoute"];const w=u["expandToDescendants"];const b=d(c);const G=c["EMPTY_META"];const N=s.routing.HistoryDirection;function C(t){const e=t=>t==="guardRouter";return new Proxy(t,{get:(t,s,i)=>e(s)?undefined:Reflect.get(t,s,i),has:(t,s)=>!e(s)&&Reflect.has(t,s),ownKeys:t=>Reflect.ownKeys(t).filter(t=>!e(t)),getOwnPropertyDescriptor:(t,s)=>e(s)?undefined:Reflect.getOwnPropertyDescriptor(t,s)})}function L(t){return typeof t==="object"&&t!==null}let M=null;let P=null;window.navigation?.addEventListener("currententrychange",t=>{const e=window.location.href;if(P!==e)P=null;const s=window.navigation.currentEntry;if(s&&t.navigationType==="traverse"){M={offset:s.index-t.from.index,href:e}}else if(M?.href!==e){M=null}});const D={kind:"idle"};const E=10;const T=t.extend("ui5.guard.router.Router",{constructor:function e(s,i,n,...r){const a=m(i);const o=a?i.guardRouter:undefined;t.prototype.constructor.apply(this,[s,a?C(i):i,n,...r]);this._pipeline=new _;this._currentRoute="";this._currentHash=null;this._phase=D;this._parseGeneration=0;this._suppressedHash=null;this._undo=null;this._reportedHash=null;this._lastReport=null;this._reportOutdated=false;this._rootHashChanger=null;this._stoppedRoute="";this._settlementResolvers=[];this._lastSettlement=null;this._sourceDescriptors=[];this._manifestGuards=[];this._destroyed=false;this._nativeMatching=false;this._matchWaiters=[];this._blockLoad=null;this._ownerComponent=n;this._routeNames??=[];this._greedyRouteNames??=[];this._mirrorMatchingProcess();let h="";const u=n?.getManifestEntry("sap.app");if(m(u)&&typeof u.id==="string"){h=u.id}const c=H(o,h);this._options=c.options;this._meta=new b(c.routeMeta,this._options.inheritance==="pattern-tree"?()=>this._collectRoutePatterns():null);this._pendingGuardDescriptors=c.guards;if(this._options.guardLoading==="lazy"){const t=[...new Set(this._pendingGuardDescriptors.map(t=>t.modulePath))];sap.ui.require(t,undefined,()=>{})}},_mirrorMatchingProcess:function t(){Object.defineProperty(this,"_bMatchingProcessStarted",{get:()=>this._isMatching(),set:t=>{this._nativeMatching=t}})},_isMatching:function t(){return this._nativeMatching||this._phase.kind==="evaluating"&&this._phase.postponed===true},attachRouteMatched:function e(s,i,n){if(p(s)&&(!this.isInitialized()||this._isMatching())){this._matchWaiters.push(s)}return t.prototype.attachRouteMatched.call(this,s,i,n)},_settleMatchWaiters:function t(){if(this._phase.kind==="evaluating"&&this._phase.postponed)return;const e=this._matchWaiters;this._matchWaiters=[];if(this._nativeMatching)return;for(const t of e)t()},initialize:function t(e){if(this._blockLoad){if(!this._blockLoad.start){this._blockLoad.start=true;this._blockLoad.ignoreInitialHash=e}return this}if(this._pendingGuardDescriptors.length===0){return this._start(e)}const s=this._pendingGuardDescriptors.map(t=>({...t,source:t}));this._pendingGuardDescriptors=[];this._sourceDescriptors=s;const i=this._options.inheritance==="pattern-tree"?w(s,this._collectRoutePatterns()):s;if(this._options.guardLoading==="lazy"){this._registerLazyGuards(i);return this._start(e)}const n={start:true,ignoreInitialHash:e};this._blockLoad=n;void R(i).then(t=>{this._blockLoad=null;if(this._destroyed)return;for(const{descriptor:e,guards:s}of t){for(const t of s)this._registerManifestGuard(e,t)}if(n.start)this._start(n.ignoreInitialHash)});return this},_start:function e(s){const n=!this.isInitialized();if(n){this.getHashChanger().attachEvent("hashChanged",this._onHashReported,this);this._rootHashChanger=i.getInstance();this._rootHashChanger.attachEvent("hashChanged",this._onRootHashChanged,this)}t.prototype.initialize.call(this,s);if(n&&s){const t=this.getHashChanger().getHash();this._currentRoute=this._stoppedRoute;this._currentHash=t??null}return this},_onHashReported:function t(e){const s=e.getParameter("newHash");const i=this.getHashChanger().getHash();this._reportedHash=s;this._reportOutdated=i!==s&&i===this._lastReport;if(!this._reportOutdated)this._lastReport=s},_onRootHashChanged:function t(e){const s=e.getParameter("newHash");const n=e.getParameter("oldHash")??"";const r=i.getInstance();if(r===this._rootHashChanger){this._completeUndo(s,n);return}r.detachEvent("hashChanged",this._onRootHashChanged,this);r.attachEvent("hashChanged",this._onRootHashChanged,this);this._rootHashChanger=r;queueMicrotask(()=>this._completeUndo(s,n))},_completeUndo:function t(e,s){const i=this._undo;if(!i||i.first!==e)return;i.fullHash??=s;if(this._phase.kind==="restoring"&&this._phase.awaitsReport)this._replaceFullHash(i.fullHash)},addRoute:function e(s,i){t.prototype.addRoute.call(this,s,i);const n=s.name;this._routeNames??=[];this._greedyRouteNames??=[];if(this._routeNames.includes(n))return;this._routeNames.push(n);if(s.greedy)this._greedyRouteNames.push(n);if(!this._meta)return;this._meta.invalidate();if(this._options.inheritance!=="pattern-tree")return;const r=this._collectRoutePatterns();const a=y(this._sourceDescriptors,new Map(r.map(t=>[t.name,t.pattern])));const o=t=>a.findIndex(e=>e.source===t.source);for(const t of k(this._sourceDescriptors,n,r)){const e=o(t);const s=this._manifestGuards.filter(s=>s.descriptor.route===t.route&&s.descriptor.type===t.type&&o(s.descriptor)>e).toSorted((t,e)=>o(t.descriptor)-o(e.descriptor))[0];for(const e of v(t))this._registerManifestGuard(t,e,s?.fn)}},addGuard:function t(e){if(!this._isFn(e,"addGuard"))return this;this._pipeline.addGlobalGuard(e);return this},removeGuard:function t(e){if(!this._isFn(e,"removeGuard"))return this;this._pipeline.removeGlobalGuard(e);return this},addRouteGuard:function t(s,i){if(L(i)){this._handleUnknownRouteRegistration(s,"addRouteGuard");let t=false;if(i.beforeEnter!==undefined){t=true;if(this._isFn(i.beforeEnter,"addRouteGuard",s)){this._pipeline.addEnterGuard(s,i.beforeEnter)}}if(i.beforeLeave!==undefined){t=true;if(this._isFn(i.beforeLeave,"addRouteGuard",s)){this._pipeline.addLeaveGuard(s,i.beforeLeave)}}if(!t){e.info("addRouteGuard: config has no beforeEnter or beforeLeave",s,g)}return this}if(!this._isFn(i,"addRouteGuard",s))return this;this._handleUnknownRouteRegistration(s,"addRouteGuard");this._pipeline.addEnterGuard(s,i);return this},removeRouteGuard:function t(e,s){if(L(s)){if(typeof s.beforeEnter==="function"){this.removeRouteGuard(e,s.beforeEnter)}if(typeof s.beforeLeave==="function"){this.removeLeaveGuard(e,s.beforeLeave)}return this}if(!this._isFn(s,"removeRouteGuard",e))return this;this._pipeline.removeEnterGuard(e,s);return this},addLeaveGuard:function t(e,s){if(!this._isFn(s,"addLeaveGuard",e))return this;this._handleUnknownRouteRegistration(e,"addLeaveGuard");this._pipeline.addLeaveGuard(e,s);return this},_resolveNavToArgs:function t(e,s,i){if(typeof e==="boolean"){return{replace:e,guardOptions:typeof s==="object"?s:undefined}}return{componentTargetInfo:e,replace:typeof s==="boolean"?s:undefined,guardOptions:typeof s==="object"?s:i}},_isFn:function t(s,i,n){if(typeof s==="function")return true;e.warning(`${i}: not a function, ignoring`,n,g);return false},_handleUnknownRouteRegistration:function t(s,i,n="guard registered"){if(this.getRoute(s))return;switch(this._options.unknownRouteRegistration){case"ignore":return;case"throw":throw new Error(`${i} called for unknown route "${s}". `+`Set guardRouter.unknownRouteRegistration to "warn" or "ignore" to allow this.`);case"warn":e.warning(`${i}: unknown route, ${n} anyway`,s,g)}},removeLeaveGuard:function t(e,s){if(!this._isFn(s,"removeLeaveGuard",e))return this;this._pipeline.removeLeaveGuard(e,s);return this},getRouteMeta:function t(s){if(s!==""&&!this.getRoute(s)){e.warning("getRouteMeta: unknown route, returning empty metadata",s,g);return G}return this._meta.get(s)},setRouteMeta:function t(s,i){if(!m(i)){e.warning("setRouteMeta: expected object, ignoring",s,g);return this}if(s!=="")this._handleUnknownRouteRegistration(s,"setRouteMeta","metadata stored");this._meta.set(s,i);return this},navigationSettled:function t(){if(this._phase.kind==="idle"||this._phase.kind==="committing"){return Promise.resolve(this._lastSettlement??{status:l.Committed,route:this._currentRoute,hash:this._currentHash??""})}return new Promise(t=>{this._settlementResolvers.push(t)})},attachNavigationSettled:function t(e,s,i){return this.attachEvent("navigationSettled",e,s,i)},detachNavigationSettled:function t(e,s){this.detachEvent("navigationSettled",e,s);return this},_flushSettlement:function t(s){this._lastSettlement=s;e.debug(`Navigation settled: ${s.status}`,s.hash,g);queueMicrotask(()=>this._settleMatchWaiters());const i=this._settlementResolvers;this._settlementResolvers=[];for(const t of i){t(s)}try{this.fireEvent("navigationSettled",s)}catch(t){e.error("A navigationSettled handler threw",String(t),g)}},navTo:function s(i,n,r,a,o){const{componentTargetInfo:h,replace:u,guardOptions:c}=this._resolveNavToArgs(r,a,o);if(this._phase.kind==="committing"&&this._phase.origin==="redirect"){t.prototype.navTo.call(this,i,n,h,u);return this}if(!this.isInitialized()){t.prototype.navTo.call(this,i,n,h,u);return this}const d=this.getRoute(i);if(!d){this._cancelPendingNavigation(true);t.prototype.navTo.call(this,i,n,h,u);return this}const l=d.getURL(n??{});const _=this._matchRoute(l);const p=_.name;if(l===this._currentHash){this._cancelPendingNavigation(true);const e=this.getHashChanger().getHash();if(e===undefined||e===l){t.prototype.navTo.call(this,i,n,h,u)}return this}const m=c?.skipGuards===true||this._options.navToPreflight==="bypass";if(!m&&this._phase.kind==="evaluating"&&l===this._phase.attempt.hash){return this}if(!m&&this._options.navToPreflight==="off"){t.prototype.navTo.call(this,i,n,h,u);return this}const H=this._pendingRestoresHash();this._cancelPendingNavigation();if(m){this._navigateAllowed(i,n,h,u,l,p,H);return this}const v=this._startAttempt(l,H);const{generation:R}=v;const y=this._createGuardContext(_,l,v.controller.signal);const k=this._evaluateGuards(y);if(f(k)){this._applyWhenDecided(k,t=>{if(R!==this._parseGeneration){e.debug("Async preflight result discarded (superseded by newer navigation)",l,g);return}this._applyPreflightDecision(t,i,n,h,u,l,p,y.bag,v)},l,H);return this}this._applyPreflightDecision(k,i,n,h,u,l,p,y.bag,v);return this},_navigateAllowed:function e(s,n,r,a,o,h,u){this._phase={kind:"committing",route:h,hash:o,origin:"preflight",restoreHash:u,writtenOver:i.getInstance().getHash()};try{t.prototype.navTo.call(this,s,n,r,a);if(!this._commitAfterNavTo(r)){this._blockNavigation(o,u)}}finally{if(this._phase.kind==="committing"){this._phase=D}}},_applyPreflightDecision:function t(e,s,i,n,r,a,o,h,u){if(u.generation!==this._parseGeneration)return;switch(e.action){case"allow":this._navigateAllowed(s,i,n,r,a,o,u.restoreHash);break;case"block":this._blockNavigation(a,u.restoreHash);break;case"redirect":this._startRedirectChain(e.target,a,h,u,r);break;case"error":this._errorNavigation(e.error,a,u.restoreHash);break}},parse:function s(r){if(this._destroyed){t.prototype.parse.call(this,r);return}const a=this._reportedHash===r;this._reportedHash=null;if(a&&this._reportOutdated)return;if(r===this._suppressedHash)return;const o=this._undo;if(o?.started&&o.fullHash===i.getInstance().getHash()){this._undo=null;this._currentHash=r;this._finishRestore(r);return}const h=this._phase;const u=h.kind==="awaitingHash"?h.commit:h.kind==="committing"?h:null;if(u?.hash===r){this._phase=u;this._commitNavigation(r,u.route);return}const c=this._currentHash;if(r===c){if(this._pendingRestoresHash()){if(this._phase.kind==="evaluating")this._cancelPendingNavigation();else this._undo=null}else{t.prototype.parse.call(this,r)}return}const d=this._matchRoute(r);const l=d.name;const _=this._pendingRestoresHash()?o:null;const p=this._phase.kind==="restoring";this._cancelPendingNavigation();if(this._currentHash!==c)return;this._undo=p?null:this._describeUndo(_,a);if(this._undo&&u===h&&!u.restoreHash)this._undo.fullHash=u.writtenOver;const m=a?n.getInstance().getDirection():undefined;const H=this._startAttempt(r,true,m);const{generation:v}=H;const R=this._createGuardContext(d,r,H.controller.signal);const y=this._evaluateGuards(R);if(f(y)){this._applyWhenDecided(y,t=>{if(v!==this._parseGeneration){e.debug("Async guard result discarded (superseded by newer navigation)",r,g);return}this._applyDecision(t,r,l,R.bag,H)},r,true);return}this._applyDecision(y,r,l,R.bag,H)},stop:function e(){if(this._blockLoad)this._blockLoad.start=false;this._cancelPendingNavigation();this._undo=null;if(this._currentHash!==null)this._stoppedRoute=this._currentRoute;this._currentRoute="";this._currentHash=null;this._lastSettlement=null;this._detachHashListeners();t.prototype.stop.call(this);return this},_detachHashListeners:function t(){this.getHashChanger().detachEvent("hashChanged",this._onHashReported,this);i.getInstance().detachEvent("hashChanged",this._onRootHashChanged,this);this._rootHashChanger=null},_cancelPendingNavigation:function t(e=false){++this._parseGeneration;const s=this._phase;const i=this._pendingRestoresHash();this._phase=D;if(s.kind==="idle"||s.kind==="committing")return;if(s.kind==="restoring"){this._flushSettlement(s.result);return}if(s.kind==="evaluating")s.attempt.controller.abort();this._settleUncommitted({status:l.Cancelled,route:this._currentRoute,hash:this._currentHash??""},s.kind==="evaluating"?s.attempt.hash:s.commit.hash,e&&i)},_pendingRestoresHash:function t(){const e=this._phase;if(e.kind==="evaluating")return e.attempt.restoreHash;if(e.kind==="committing")return e.restoreHash;return e.kind==="awaitingHash"&&e.commit.restoreHash},_startAttempt:function t(e,s,i){if(this._phase.kind==="evaluating")this._phase.attempt.controller.abort();const n={hash:e,controller:new AbortController,generation:++this._parseGeneration,restoreHash:s,direction:i};this._phase={kind:"evaluating",attempt:n};return n},_applyWhenDecided:function t(s,i,n,r){if(this._phase.kind==="evaluating")this._phase={...this._phase,postponed:true};s.then(t=>{const s=this._lastSettlement;try{i(t)}catch(t){e.error("Navigation failed after its guards had settled",t instanceof Error?t:String(t),g);if(this._lastSettlement===s){this._errorNavigation(t,n,r)}}})},_applyDecision:function t(e,s,i,n,r){if(r.generation!==this._parseGeneration)return;switch(e.action){case"allow":this._phase={kind:"committing",route:i,hash:s,origin:"parse",restoreHash:false};this._commitNavigation(s,i);break;case"block":this._blockNavigation(s);break;case"redirect":this._startRedirectChain(e.target,s,n,r,true);break;case"error":this._errorNavigation(e.error,s);break}},_alignTitleHistory:function t(e){if(e===N.NewEntry||e===N.Forwards){Reflect.set(this,"_bLastHashReplaced",false)}else if(e===N.Backwards){const t=this.getTitleHistory();const e=t.at(-1);const s=t.at(-2);if(m(e)&&m(s)&&!e.isHome&&e.title!==s.title){t.splice(-2,1)}}},_commitNavigation:function e(s,i){const n=this._phase.kind==="committing"&&this._phase.origin==="redirect";if(this._phase.kind==="committing")this._alignTitleHistory(this._phase.direction);this._undo=null;this._currentHash=s;this._currentRoute=i;this._phase=D;this._flushSettlement({status:n?l.Redirected:this._currentRoute===""?l.Bypassed:l.Committed,route:this._currentRoute,hash:s});if(this._currentHash!==s)return;t.prototype.parse.call(this,s)},_commitAfterNavTo:function t(e){const s=this._phase;if(s.kind!=="committing")return true;if(this.getHashChanger().getHash()===s.hash){this._commitNavigation(s.hash,s.route);return true}if(!e||Object.keys(e).length===0)return false;this._phase={kind:"awaitingHash",commit:s};return true},_redirect:function t(s,i){const n=typeof s==="string"?s:s.route;const r=this.getRoute(n);if(!r){e.warning(`Guard redirect target "${n}" is not a known route, treating as blocked`,undefined,g);this._blockNavigation(i.attemptedHash,i.restoreHash);return}let a;try{a=r.getURL(typeof s==="string"?{}:s.parameters??{})}catch(t){e.error(`Guard redirect target "${n}" has no valid hash, navigation failed`,String(t),g);this._errorNavigation(t,i.attemptedHash,i.restoreHash);return}if(i.visited.has(a)){e.error(`Guard redirect loop detected: ${[...i.visited,a].join(" -> ")}`,undefined,g);this._blockNavigation(i.attemptedHash,i.restoreHash);return}if(i.visited.size>E){e.error(`Guard redirect chain exceeded maximum depth (${E}): ${[...i.visited].join(" -> ")}`,undefined,g);this._blockNavigation(i.attemptedHash,i.restoreHash);return}i.visited.add(a);const o=this._matchRoute(a);const h=o.name;const u=this._createGuardContext(o,a,i.signal,i);const c=this._evaluateGuards(u,true);if(f(c)){this._applyWhenDecided(c,t=>this._applyRedirectDecision(t,s,a,h,i),i.attemptedHash,i.restoreHash);return}this._applyRedirectDecision(c,s,a,h,i)},_applyRedirectDecision:function e(s,n,r,a,o){if(o.generation!==this._parseGeneration)return;switch(s.action){case"allow":{const e=typeof n==="string"?undefined:n.componentTargetInfo;if(r===this._currentHash){this._phase=D;this._settleUncommitted({status:l.Redirected,route:this._currentRoute,hash:r},o.attemptedHash,o.restoreHash,typeof n!=="string"&&e?()=>{if(this.getHashChanger().getHash()!==r)return;t.prototype.navTo.call(this,n.route,n.parameters??{},e,o.replace)}:undefined);break}this._phase={kind:"committing",route:a,hash:r,origin:"redirect",direction:o.direction,restoreHash:o.restoreHash,writtenOver:i.getInstance().getHash()};try{const t=this.getHashChanger().getHash()===r;if(typeof n==="string"){if(!t)this.navTo(n,{},{},o.replace)}else if(!t||e){this.navTo(n.route,n.parameters??{},e,o.replace)}if(!this._commitAfterNavTo(e)){this._blockNavigation(o.attemptedHash,o.restoreHash)}}finally{if(this._phase.kind==="committing"){this._phase=D}}break}case"block":this._blockNavigation(o.attemptedHash,o.restoreHash);break;case"redirect":this._redirect(s.target,o);break;case"error":this._errorNavigation(s.error,o.attemptedHash,o.restoreHash);break}},_matchRoute:function t(e){const s=this.getRouteInfoByHash(e);return{name:s?.name??"",arguments:s?.arguments??{}}},_greedyMatches:function t(e,s){return this._greedyRouteNames.filter(t=>t!==s&&this.getRoute(t)?.match(e))},_evaluateGuards:function t(e,s=false){return this._pipeline.evaluate(e,{skipLeaveGuards:s,alsoLeaving:this._greedyMatches(e.fromHash,e.fromRoute),alsoEntering:this._greedyMatches(e.toHash,e.toRoute)})},_createGuardContext:function t(e,s,i,n){const r=n?n.fromRoute:this._currentRoute;return{toRoute:e.name,toHash:s,toArguments:e.arguments,fromRoute:r,fromHash:n?n.fromHash:this._currentHash??"",signal:i,bag:n?n.bag:new Map,toMeta:this.getRouteMeta(e.name),fromMeta:this.getRouteMeta(r),ownerComponent:this._ownerComponent}},_startRedirectChain:function t(e,s,i,n,r){const a=new Set;a.add(s);this._redirect(e,{visited:a,attemptedHash:s,restoreHash:n.restoreHash,replace:r,direction:n.direction,fromRoute:this._currentRoute,fromHash:this._currentHash??"",signal:n.controller.signal,generation:n.generation,bag:i})},_blockNavigation:function t(e,s=true){this._phase=D;this._settleUncommitted({status:l.Blocked,route:this._currentRoute,hash:this._currentHash??""},e,s)},_errorNavigation:function t(e,s,i=true){this._phase=D;this._settleUncommitted({status:l.Error,route:this._currentRoute,hash:this._currentHash??"",error:e},s,i)},_settleUncommitted:function t(e,s,i,n){const r=i&&this._currentHash===null&&!!s;if(i&&!r&&!this._undoHashChange(e,n))return;this._flushSettlement(e);n?.();if(r&&this._currentHash===null)this._restoreHash("",false)},_describeUndo:function t(e,s){if(!s)return e;const n=i.getInstance().getHash();const r=M;if(!e)return{first:n,fullHash:undefined,shown:n,step:r,started:false};const a=e.step&&r?e.step.offset+r.offset:0;return{first:e.first,fullHash:e.fullHash,shown:n,step:r&&a?{offset:a,href:r.href}:null,started:false}},_undoHashChange:function t(e,s){const n=this._undo;const r=this._currentHash;const a=i.getInstance().getHash();if(n===null||r===null||n.shown!==a||n.fullHash===a){this._restoreHash(r??"");return true}const o=window.location.href;n.started=true;this._phase={kind:"restoring",result:e,whenBack:s};if(P===o){}else if(n.step){P=o;window.history.go(-n.step.offset)}else if(n.fullHash===undefined){this._phase={...this._phase,awaitsReport:true}}else{this._replaceFullHash(n.fullHash)}return false},_replaceFullHash:function t(e){i.getInstance().replaceHash(e,N.Unknown);this._finishRestore()},_finishRestore:function t(e){const s=this._phase;if(s.kind!=="restoring")return;this._phase=D;this._flushSettlement(e===undefined?s.result:{...s.result,hash:e});s.whenBack?.()},_restoreHash:function t(e,s=true){const i=this.getHashChanger();if(i.getHash()===e)return;this._suppressedHash=s?e:null;void i.replaceHash(e,N.Unknown);this._suppressedHash=null},_collectRoutePatterns:function t(){const e=[];for(const t of this._routeNames){const s=this.getRoute(t)?.getPattern();if(s!==undefined)e.push({name:t,pattern:s})}return e},_registerManifestGuard:function t(s,i,n){try{if(s.route==="*"){this.addGuard(i);return}if(s.type==="leave"){this._handleUnknownRouteRegistration(s.route,"addLeaveGuard");this._pipeline.addLeaveGuard(s.route,i,n)}else{this._handleUnknownRouteRegistration(s.route,"addRouteGuard");this._pipeline.addEnterGuard(s.route,i,n)}this._manifestGuards.push({descriptor:s,fn:i})}catch(t){e.error(`guardRouter.guards: failed to register "${s.modulePath}"`,String(t),g)}},_registerLazyGuards:function t(e){for(const t of e){for(const e of v(t))this._registerManifestGuard(t,e)}},destroy:function e(){if(this._destroyed)return this;this._destroyed=true;this._pipeline.clear();this._pendingGuardDescriptors=[];this._sourceDescriptors=[];this._manifestGuards=[];this._cancelPendingNavigation();this._lastSettlement=null;this._detachHashListeners();this._meta.clear();t.prototype.destroy.call(this);return this}});return T});
2
2
  //# sourceMappingURL=Router.js.map