AUI.add("liferay-store",(t=>{const e=t.Lang,a=e.isObject,s="serialize://",l=function Store(t,s){let l;e.isFunction(s)?(l="get",Array.isArray(t)&&(l="getAll")):(l="set",a(t)?l="setAll":1===arguments.length&&(l=null)),l&&Store[l].apply(Store,arguments)};t.mix(l,{_getValues(t,e,a){const s={callback:a,data:{cmd:t,key:e}};"getAll"===t&&(s.dataType="json"),this._ioRequest(s)},_ioRequest(t){t.data.p_auth=Liferay.authToken;const a=themeDisplay.getDoAsUserIdEncoded();a&&(t.data.doAsUserId=a);const l=new URLSearchParams;Object.keys(t.data).forEach((e=>{Array.isArray(t.data[e])?t.data[e].forEach((t=>{l.append(e,t)})):l.set(e,t.data[e])})),Liferay.Util.fetch(themeDisplay.getPathMain()+"/portal/session_click",{body:l,method:"POST"}).then((e=>"json"===t.dataType?e.json():e.text())).then((a=>{if("json"===t.dataType&&e.isString(a)&&0===a.indexOf(s))try{a=JSON.parse(a.substring(s.length))}catch(t){}"function"==typeof t.callback&&t.callback(a)}))},_setValues(t){this._ioRequest({data:t})},get(t,e){this._getValues("get",t,e)},getAll(t,e){this._getValues("getAll",t,e)},set(t,e){const l={};a(e)&&(e=s+JSON.stringify(e)),l[t]=e,this._setValues(l)},setAll(t){this._setValues(t)}}),Liferay.Store=l}),"");
//# sourceMappingURL=store.js.map