!function(){"use strict";var e={d:function(t,n){for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{useApiFetch:function(){return r}});var n=window.React,a=window.nisje.app.fetch;const o=e=>e.json?e.json():Promise.reject(e);var r=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[s,i]=(0,n.useState)(),[c,d]=(0,n.useState)({}),[u,p]=(0,n.useState)();return(0,n.useEffect)((()=>{(s||u)&&(p(void 0),i(void 0));const n=t=(async()=>{if(r.fetchHeaders){const t=await(0,a.apiFetch)({path:e,parse:!1}),n={};return n.totalPages=parseInt(t.headers.get("X-WP-TotalPages"),10),n.total=parseInt(t.headers.get("X-WP-Total"),10),{response:await o(t),responseHeaders:n}}return{response:await(0,a.apiFetch)({path:e})}})().then((e=>{let{response:a,responseHeaders:o}=e;n===t&&(r.callback&&r.callback(a),d(o),i(a))})).catch((e=>{p(e)}));return()=>{t=void 0}}),[e]),r.fetchHeaders?[s,c,u]:[s,u]};(window.nisje=window.nisje||{}).data=t}();