(()=>{var e,t={811:(e,t,n)=>{"use strict";const r=window.wp.element;var a=n(184),s=n.n(a);const o=window.wp.components,l=(e,t)=>e[t],c=({type:e,updateSetting:t,settings:n,valueCallback:a=l})=>{const{fields:c}=neveAccessRestriction.fields[e];return(0,r.createElement)(r.Fragment,null,Object.keys(c).map(((e,l)=>{const{type:i,label:d,description:p}=c[e];if(c[e].parent){const t=c[e].parent;if(n[t.fieldKey]!==t.fieldValue)return null}const u=a(n,e);return(0,r.createElement)("div",{key:l,className:s()(["field-wrap",e])},"toggle"===i&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.ToggleControl,{checked:"yes"===u||!1,label:d,onChange:n=>{t(e,n?"yes":"no")}}),u&&p&&(0,r.createElement)("p",{className:"description"},p)),"select"===i&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.SelectControl,{value:u,label:d,options:c[e].options,onChange:n=>{t(e,n)}}),u&&p&&(0,r.createElement)("p",{className:"description"},p)))})))},i=window.wp.apiFetch;var d=n.n(i);const p=window.wp.i18n,u=()=>{const[e,t]=(0,r.useState)(neveAccessRestriction.options),[n,a]=(0,r.useState)(!1),[l,i]=(0,r.useState)(""),u="restrict-content-addon-more-settings",m="seen"===window.localStorage.getItem(u),[v,g]=(0,r.useState)(m||!0),f=s()(["accordion",{open:v,closed:!v}]),h=(t=null)=>{const n=t||e;var r;a(!0),i(""),(r=JSON.stringify(n),new Promise((e=>{d()({path:neveAccessRestriction.settingsRoute,method:"POST",data:{settings:r}}).then((t=>{const n="success"===JSON.parse(t).status;e({success:n})})).catch((()=>{e({success:!1})}))}))).then((e=>{if(!e.success)return i((0,p.__)("An error occurred. Please try again.","neve")),a(!1),!1;i(""),a(!1)}))};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(c,{type:"content_types",updateSetting:(n,r)=>{const a={...e};a.content_types[n].enabled=r,t(a),h(a)},valueCallback:(e,t)=>e[t].enabled,settings:e.content_types}),(0,r.createElement)("div",{className:f},(0,r.createElement)("button",{"aria-expanded":v,className:"accordion-header",onClick:()=>{v&&!m&&window.localStorage.setItem(u,"seen"),g(!v)}},(0,r.createElement)("div",{className:"accordion-title"},(0,p.__)("More settings","neve")),(0,r.createElement)(o.Dashicon,{icon:v?"arrow-up-alt2":"arrow-down-alt2"})),(0,r.createElement)("div",{className:"accordion-body",style:{height:v?"auto":"0px"}},(0,r.createElement)(c,{type:"restriction_behavior",updateSetting:(n,r)=>{const a={...e,[n]:r};t(a),h(a)},settings:e}))),n&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.Dashicon,{size:18,icon:"update",className:"is-loading"}),(0,r.createElement)("span",null,(0,p.__)("Updating","neve")+"...")),""!==l&&(0,r.createElement)("span",{className:"notice notice-error",style:{width:"100%",margin:0,padding:"8px"}},l))};window.addEventListener("neve-dashboard-react-placeholder",(e=>{if(e.detail.slug){const t=document.getElementById(e.detail.slug);t&&(0,r.render)((0,r.createElement)(u,null),t)}}))},184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var s=typeof n;if("string"===s||"number"===s)e.push(n);else if(Array.isArray(n)){if(n.length){var o=a.apply(null,n);o&&e.push(o)}}else if("object"===s)if(n.toString===Object.prototype.toString)for(var l in n)r.call(n,l)&&n[l]&&e.push(l);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,r),s.exports}r.m=t,e=[],r.O=(t,n,a,s)=>{if(!n){var o=1/0;for(d=0;d<e.length;d++){n=e[d][0],a=e[d][1],s=e[d][2];for(var l=!0,c=0;c<n.length;c++)(!1&s||o>=s)&&Object.keys(r.O).every((e=>r.O[e](n[c])))?n.splice(c--,1):(l=!1,s<o&&(o=s));if(l){e.splice(d--,1);var i=a();void 0!==i&&(t=i)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[n,a,s]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={826:0,46:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var a,s,o=n[0],l=n[1],c=n[2],i=0;if(o.some((t=>0!==e[t]))){for(a in l)r.o(l,a)&&(r.m[a]=l[a]);if(c)var d=c(r)}for(t&&t(n);i<o.length;i++)s=o[i],r.o(e,s)&&e[s]&&e[s][0](),e[o[i]]=0;return r.O(d)},n=self.webpackChunkneve_pro_addon=self.webpackChunkneve_pro_addon||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var a=r.O(void 0,[46],(()=>r(811)));a=r.O(a)})();