UNPKG

@larva.io/webcomponents

Version:

Fentrica SmartUnits WebComponents package

5 lines 1.04 kB
/*! * (C) Fentrica http://fentrica.com - Seee LICENSE.md */ class t{constructor(){this.m=new Map}reset(t){this.m=new Map(Object.entries(t))}get(t,e){const n=this.m.get(t);return n!==undefined?n:e}getBoolean(t,e=false){const n=this.m.get(t);if(n===undefined){return e}if(typeof n==="string"){return n==="true"}return!!n}getNumber(t,e){const n=parseFloat(this.m.get(t));return isNaN(n)?e!==undefined?e:NaN:n}set(t,e){this.m.set(t,e)}}const e=new t;const n=t=>{try{const e=t.sessionStorage.getItem(a);return e!==null?JSON.parse(e):{}}catch(t){return{}}};const s=(t,e)=>{try{t.sessionStorage.setItem(a,JSON.stringify(e))}catch(t){return}};const r=t=>{const e={};t.location.search.slice(1).split("&").map((t=>t.split("="))).map((([t,e])=>[decodeURIComponent(t),decodeURIComponent(e)])).filter((([t])=>o(t,c))).map((([t,e])=>[t.slice(c.length),e])).forEach((([t,n])=>{e[t]=n}));return e};const o=(t,e)=>t.substr(0,e.length)===e;const c="larva:";const a="larva-persist-config";export{r as a,e as b,n as c,s}; //# sourceMappingURL=p-Bt4QT_oL.js.map