!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t=window.wp.element,n=window.lodash,r=window.wp.hooks,a=window.nisje.settings,i=window.nisje.router;function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,a,i=[],_n=!0,o=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==n.return||n.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var l=window.nisje.components,s=window.nisje.views,c=window.nisje.data,d=window.nisje.icons,f=function(e){var n=e.type,r=e.id,a=u((0,c.useApiFetch)("/wp/v2/".concat(n,"/").concat(r,"?_fields=content")),2),i=a[0],o=a[1];if(!i)return(0,t.createElement)("div",{style:{textAlign:"center",padding:30}},(0,t.createElement)(l.Loader,{size:30}));if(o)return(0,t.createElement)(s.Message,{icon:d.warning},o.data.status,": ",o.message);var f=i.content;return(0,t.createElement)(l.EntryContainer,{autoHeight:!0,transparent:!0},(0,t.createElement)(l.EntryContent,null,f.rendered))},p=window.wp.i18n,g=window.nisje.interface,m=function(e){var n=e.match.params.id,r=u((0,c.useApiFetch)("/wp/v2/nisje-feed-frontpage/".concat(n,"/revisions?_fields=content")),2),a=r[0],i=r[1];if(!a)return(0,t.createElement)("div",{style:{textAlign:"center",padding:30}},(0,t.createElement)(l.Loader,{size:30}));if(i)return(0,t.createElement)(s.Message,{icon:d.warning},i.data.status,": ",i.message);var o=a[0].content;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(g.Header,{title:(0,p.__)("Wall")}),(0,t.createElement)(l.EntryContainer,{autoHeight:!0,transparent:!0},(0,t.createElement)(l.EntryContent,null,o.rendered)))};(0,r.addFilter)("nisje.frontpage","nisje/feedLayouts/frontpage",(function(e){return function(r){var i=(0,a.getOption)("feedLayouts.frontpage",0);return 0!==i&&(0,n.isEmpty)(r.search)?(0,t.createElement)(f,{id:i,type:"nisje-feed-frontpage",search:r.search}):(0,t.createElement)(e,r)}})),(0,r.addFilter)("nisje.groups.frontpage","nisje/feedLayouts/frontpage",(function(e){return function(n){var r=(0,a.getOption)("feedLayouts.groups.".concat(n.id),0);return 0===r?(0,t.createElement)(e,n):(0,t.createElement)(f,{id:r,type:"nisje-feed-group"})}})),(0,a.registerPlugin)("feed-layouts",{render:function(){return(0,t.createElement)(i.PluginRoutes,null,(0,t.createElement)(i.Route,{path:"/feed-layout/:id",component:m}))}}),(window.nisje=window.nisje||{}).pluginFeedLayouts=e}();