PageSourceSearch

https://www.aireserv.com/brand/_assets/js/o2/opus2.storage-manager-loader.1611316d8ec9bfa135f6.js

js aireserv.com collected 2026-09-24 10:35:27 UTC 2,995 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkcrownpeak_opus2=self.webpackChunkcrownpeak_opus2||[]).push([["storage-manager-loader"],{"./src/js/global/storage-manager.ts"(e,t,r){r.r(t),r.d(t,{StorageManager:()=>a});var i=r(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),s=r(/*! ../opus2/util/locationBasedBrandJson */"./src/js/opus2/util/locationBasedBrandJson.ts"),o=r(/*! ../opus2/api/apiRequest */"./src/js/opus2/api/apiRequest.ts");class a{constructor(e,t,r,i,s,o){var a,l;void 0===e&&(e=Number.isNaN(Number.parseInt("1"))?7:Number.parseInt("1")),void 0===t&&(t=null!==(l=null===(a="days")?void 0:a.toLowerCase())&&void 0!==l?l:"days"),void 0===r&&(r="expiryTime"),void 0===i&&(i=["brandDetails","fullAttrOnLoad"]),void 0===s&&(s="boolean"==typeof JSON.parse("false".toLowerCase())&&JSON.parse("false".toLowerCase())),void 0===o&&(o="boolean"==typeof JSON.parse("false".toLowerCase())&&JSON.parse("false".toLowerCase())),this.expiryThreshold=e,this.expiryTimeKey=r,this.expiryType=t,this.localStorageItems=i,this.clearAllLocalStorge=s,this.clearAllSessionStorge=o,this.expiryTimeMap={days:864e5,hours:36e5,minutes:6e4,seconds:1e3},setTimeout(()=>{this.init()},2e3)}static getInstance(){return a.instance||(a.instance=new a),a.instance}getExpiryTimeInMilliseconds(){return this.expiryThreshold*(this.expiryTimeMap[this.expiryType]||864e5)}isExpired(){const e=localStorage.getItem(this.expiryTimeKey);if(!e)return!0;return Date.now()>JSON.parse(e)}setExpiryTime(){const e=Date.now()+this.getExpiryTimeInMilliseconds();localStorage.setItem(this.expiryTimeKey,JSON.stringify(e))}callAllAPIs(){return(0,i.__awaiter)(this,void 0,void 0,function*(){const e=document.getElementById("conceptCode");if(e){const t=e.value;try{const e=(0,s.getBrandJSON)();if("Error validating Location"===e)return void console.error("Error Determining BrandJSON path for given location");{const r={method:"GET",url:`${window.location.origin}/${e}`},i=(yield(0,o.default)(r)).find(e=>e.code===t);return localStorage.setItem("brandDetails",JSON.stringify(i)),i}}catch(e){return console.error("Error in fetching getBrandDetailsFromBrandJson API data:",e),[]}}})}clearLocalStorage(){this.clearAllLocalStorge?localStorage.clear():this.localStorageItems.forEach(e=>{localStorage.removeItem(e)})}clearSessionStorage(){this.clearAllSessionStorge&&sessionStorage.clear()}triggerClearing(){const e=localStorage.getItem(this.expiryTimeKey);if(e)try{const t=JSON.parse(e),r=t-Date.now();r<=0?(this.clearLocalStorage(),this.clearSessionStorage(),this.setExpiryTime()):setTimeout(()=>{this.clearLocalStorage(),this.clearSessionStorage(),this.setExpiryTime()},r)}catch(e){console.error("Error while clearing storage in triggerClearing:",e)}}init(){this.isExpired()?(this.clearLocalStorage(),this.clearSessionStorage(),this.setExpiryTime()):this.triggerClearing()}}globalThis.__StorageManagerInitialized||(globalThis.__StorageManagerInitialized=!0,a.getInstance())}}]);
2//# sourceMappingURL=opus2.storage-manager-loader.1611316d8ec9bfa135f6.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.