!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.plugins,i=window.wp.hooks,o=window.nisje.settings,a=window.nisje.router;function s(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){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],_n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(_n=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,i=e}finally{try{_n||null==a.return||a.return()}finally{if(r)throw i}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(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)?s(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 c=window.nisje.components,l=window.nisje.views,d=window.nisje.data,f=window.nisje.icons,p=function(e){var n=e.type,r=e.id,i=u((0,d.useApiFetch)("/wp/v2/".concat(n,"/").concat(r,"?_fields=content")),2),o=i[0],a=i[1];if(!o)return(0,t.createElement)("div",{style:{textAlign:"center",padding:30}},(0,t.createElement)(c.Loader,{size:30}));if(a)return(0,t.createElement)(l.Message,{icon:f.warning},a.data.status,": ",a.message);var s=o.content;return(0,t.createElement)(c.EntryContainer,{autoHeight:!0,transparent:!0},(0,t.createElement)(c.EntryContent,null,s.rendered))},g=window.wp.i18n,m=window.nisje.interface,w=function(e){var n=e.match.params.id,r=u((0,d.useApiFetch)("/wp/v2/nisje-feed-frontpage/".concat(n,"/revisions?_fields=content")),2),i=r[0],o=r[1];if(!i)return(0,t.createElement)("div",{style:{textAlign:"center",padding:30}},(0,t.createElement)(c.Loader,{size:30}));if(o)return(0,t.createElement)(l.Message,{icon:f.warning},o.data.status,": ",o.message);var a=i[0].content;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(m.Header,{title:(0,g.__)("Wall")}),(0,t.createElement)(c.EntryContainer,{autoHeight:!0,transparent:!0},(0,t.createElement)(c.EntryContent,null,a.rendered)))};(0,i.addFilter)("nisje.frontpage","nisje/feedLayouts/frontpage",(function(e){return function(r){var i=(0,o.getOption)("feedLayouts.frontpage",0);return 0!==i&&(0,n.isEmpty)(r.search)?(0,t.createElement)(p,{id:i,type:"nisje-feed-frontpage",search:r.search}):(0,t.createElement)(e,r)}})),(0,i.addFilter)("nisje.groups.frontpage","nisje/feedLayouts/frontpage",(function(e){return function(n){var r=(0,o.getOption)("feedLayouts.groups.".concat(n.id),0);return 0===r?(0,t.createElement)(e,n):(0,t.createElement)(p,{id:r,type:"nisje-feed-group"})}})),(0,r.registerPlugin)("feed-layouts",{render:function(){return(0,t.createElement)(a.PluginRoutes,null,(0,t.createElement)(a.Route,{path:"/feed-layout/:id",component:w}))}}),(window.nisje=window.nisje||{}).pluginFeedLayouts=e}();