Liferay.Loader.define("frontend-js-web@5.0.32/liferay/util/fetch.es",["module","exports","require"],(function(e,t,r){window;{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){e||(e="/o/");let r=e.url?e.url:e.toString();if(r.startsWith("/")){const t=Liferay.ThemeDisplay.getPathContext();t&&!r.startsWith(t)&&(r=t+r,e="string"==typeof e?r:o(o({},e),{},{url:r})),r=window.location.origin+r}const n=new URL(r),i=new Headers({}),c={};n.origin===window.location.origin&&(i.set("x-csrf-token",Liferay.authToken),c.credentials="include");return new Headers(t.headers||{}).forEach(((e,t)=>{i.set(t,e)})),fetch(e,o(o(o({},c),t),{},{headers:i}))}}}));
//# sourceMappingURL=fetch.es.js.map