1import{C as e,S as t,_ as n,r,u as i,y as a}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{r as o}from"./BYSskNbK.chunk.js";var s=`breadcrumb:history`,c=2;function l(e){return Array.isArray(e)||(e=[e]),e.map(a.getAppLinkString).join(`:`)}var u=new class extends r{constructor(...e){super(...e),this.fullHistory=[],this.builders={},this.builderOptions={},this.leafBuilders={},this.siblings={},this.allowedParents={}}get name(){return`StaticBreadcrumbService`}initialize(){this.listenTo(e.SHELL,t.ROUTE,this.updateHistory)}loadHistory(e){if(this.history)return;let t=o.get(s);if(!Array.isArray(t)){this.history=[];return}if(!a.isEqual(e,t[t.length-1])){this.history=[];return}this.history=t.slice(-1-c,-1),this.fullHistory=t}getCurrent(){return this.fullHistory[this.fullHistory.length-1]}resetHistory(){this.history=[],this.fullHistory=[]}updateHistory(e){if(this.loadHistory(e),a.isEqual(e,this.getCurrent())||!a.getHref(e))return;let t=this.siblings[l([this.getCurrent(),e])];t?.(this.getCurrent(),e)&&this.fullHistory.pop();let n=this.fullHistory[this.fullHistory.length-2];a.isEqual(e,n)?this.fullHistory.pop():this.fullHistory.push(e);let r=this.fullHistory.slice(-1-c,-1);this.history=r,o.set(s,[...this.history,this.getCurrent()])}wrapBuilder(e,t){return n=>this.handleParents(e(n),t)}handleParents(e,t){if(!e?.length)return e;let n=[...e],r=[];for(;n.length;){let e=n[0].appLink,i=t?.parentComparisonOptions||{args:!0,params:!1},o=a.isEqual(e,this.getCurrent(),i),s=this.siblings[l([this.getCurrent(),e])];if(o||s?.(this.getCurrent(),e))return r;r.push(n.shift())}return r}isCurrentParentAllowed(){let e=[...this.history],t=l(this.getCurrent()),n=this.allowedParents[t],r=e[e.length-1];return n&&r?!!n[l(r)]:!0}registerBuilder(e,t,r){if(e.length>c)return n.throw(new i(`BreadcrumbService currently only handes history of length ${c}`)),this;let a=l(e);return this.builders[a]=t,this.builderOptions[a]=r,this}registerLeafBuilder(e,t){if(e.length>c)return n.throw(new i(`BreadcrumbService currently only handes history of length ${c}`)),this;let r=l(e);return this.leafBuilders[r]=t,this}registerSiblings(e,t,n){return this.siblings[l([e,t])]=n,this.siblings[l([t,e])]=n,this}getBuilder(){let e=[...this.history],t=l(this.getCurrent());if(this.isCurrentParentAllowed())for(;e.length;){let t=l(e);if(this.builders[t])return[e,this.wrapBuilder(this.builders[t],this.builderOptions[t])];e.shift()}return this.builders[t]?[[this.getCurrent()],this.wrapBuilder(this.builders[t],this.builderOptions[t])]:this.leafBuilders[t]?[[this.getCurrent()],this.wrapBuilder(this.leafBuilders[t],this.builderOptions[t])]:[null,()=>null]}getHistory(){return this.fullHistory}registerAllowedParents(e,t){return this.allowedParents[l(e)]=t.reduce((e,t)=>(e[l(t)]=!0,e),{}),this}};export{u as t}; 2//# sourceMappingURL=D6Cj2lob2.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.