UNPKG

@rero/rero-ils-ui

Version:

User interface for RERO integrated library system (RERO ILS).

2 lines (1 loc) 1.33 kB
import{a}from"./chunk-PKCRAMTV.js";import{za as c}from"./chunk-MTJX6JRK.js";import{u as i}from"./chunk-4MYHQLZQ.js";import{m as s}from"./chunk-WKOKZ3JO.js";import{ia as n,r as o}from"./chunk-3WD6XLXL.js";var m=class{constructor(){this.routeToolService=n(a),this.location=n(s),this.DISABLED=()=>o({can:!1,message:""})}routeMatcher(e,r){return e[0].path==="records"&&e[1].path===r?this.matchedUrl(e):null}fieldsToRemoved(e,r){return r.forEach(t=>{t in e&&delete e[t]}),e}matchedUrl(e){return{consumed:[new i(e[0].path,{}),new i(e[1].path,{})],posParams:{type:new i(e[1].path,{})}}}removeKey(e,r){if(e instanceof Array&&(e=e.map(t=>this.removeKey(t,r))),e instanceof Object)for(let t of Object.keys(e))t===r?delete e[r]:e[t]=this.removeKey(e[t],r);return e}redirectUrl(e,r){let t="$ref"in e?c(e.$ref):e.pid;return o(`${r}/${t}`)}expertSearchFilter(){return{label:"Expert search",filter:"simple",value:"0",disabledValue:"1",persistent:!0}}canRead(e){let r=this.routeToolService.appStore.currentOrganisationPid(),t="organisation"in e.metadata?e.metadata.organisation.pid:!1;return o({can:r===t,message:""})}_expertSearchLink(){let e="help/recherche",r={fr:"help/recherche"},t=Object.keys(r);return this.routeToolService.translateService.getCurrentLang()in t?r[this.routeToolService.translateService.getCurrentLang()]:e}};export{m as a};