!function(){"use strict";var e={d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},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);var n={};e.r(n),e.d(n,{createErrorNotice:function(){return d},createInfoNotice:function(){return a},createNotice:function(){return u},removeNotice:function(){return f}});var o={};e.r(o),e.d(o,{getNotices:function(){return y}});var r=window.wp.data,i=window.lodash,c=(0,window.nisje.data.onSubKey)("context")(((e=[],t)=>{switch(t.type){case"CREATE_NOTICE":return[...(0,i.reject)(e,{id:t.notice.id}),t.notice];case"REMOVE_NOTICE":return(0,i.reject)(e,{id:t.id});default:return e}}));const s="global";function*u(e="info",t,n={}){const{autoDismiss:o=5e3,context:r=s,id:c=(0,i.uniqueId)(r),isDismissible:u=!0,speak:a=!0,...d}=n;t=String(t),a&&(yield{type:"SPEAK",message:t});const f={autoDismiss:o,content:t,id:c,isDismissible:u,status:e,...d};yield{type:"CREATE_NOTICE",context:r,notice:f}}function a(e,t){return u("info-dark",e,t)}function d(e,t){return u("error",e,t)}function f(e,t=s){return{type:"REMOVE_NOTICE",id:e,context:t}}const l=[];function y(e,t=s){return e[t]||l}var w=window.wp.a11y,p={SPEAK(e){(0,w.speak)(e.message,"assertive")}};(0,r.registerStore)("nisje/notices",{reducer:c,actions:n,selectors:o,controls:p}),(window.nisje=window.nisje||{}).notices=t}();