芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/ithemes-security-pro/dist/user-groups/settings.min.js
/*! For license information please see settings.min.js.LICENSE.txt */ (globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[8913],{63668:(e,t,r)=>{"use strict";r.r(t);var n=r(6293),s=r(95122),o=r(3571),i=(r(25703),r(31600)),a=r(87375),l=r(7980),u=r(64893);function c({groupId:e,disabled:t}){return(0,n.createElement)(React.Fragment,null,(0,n.createElement)(g,{groupId:e,disabled:t}),(0,n.createElement)(le,{groupId:e,disabled:t}),(0,n.createElement)(he,{groupId:e,disabled:t}))}var d=r(48015),p=r(62470);function g({groupId:e,disabled:t=!1}){const{label:r}=(0,d.useSelect)((t=>({label:t(p.store).getEditedGroupAttribute(e,"label")||""})),[e]),{editGroup:o}=(0,d.useDispatch)(p.store);return(0,n.createElement)(u.TextControl,{label:(0,s.__)("Group Name","it-l10n-ithemes-security-pro"),value:r,maxLength:50,disabled:t,onChange:t=>o(e,{label:t}),__nextHasNoMarginBottom:!0})}var m=r(52117),h=r(73727),f=r(16550),v=r(95117),b=r(13173),E=r(65813);const _=(0,m.Z)(b.Rx,{target:"ex8nmdm0"})({name:"syl0ps",styles:"padding:.5rem 1.5rem 1rem;align-items:center;flex-wrap:wrap"});function y(){const{navIds:e}=(0,d.useSelect)((e=>({navIds:e(p.store).getMatchableNavIds()})),[]),{createLocalGroup:t}=(0,d.useDispatch)(p.store),r=(0,l.useNavigateTo)(),{root:o}=(0,f.UO)();return e?(0,n.createElement)(_,{orientation:"horizontal"},e.map((e=>(0,n.createElement)(w,{key:e,groupId:e,root:o}))),(0,n.createElement)(b.zx,{variant:"tertiary",icon:v.Z,label:(0,s.__)("Create User Group","it-l10n-ithemes-security-pro"),onClick:async()=>{const{id:e}=await t();r(`/${o}/user-groups/${e}`)}})):null}function w({groupId:e,root:t}){const{label:r}=(0,d.useSelect)((t=>({label:t(p.store).getEditedMatchableLabel(e)})),[e]);return(0,n.createElement)(h.OL,{to:`/${t}/user-groups/${e}`,component:(0,E.Sj)(b.Ig)},r||(0,s.__)("Untitled","it-l10n-ithemes-security-pro"))}var I=r(20567);const x=(0,m.Z)("div",{target:"entfely0"})({name:"s9thde",styles:"max-width:830px;width:100%;flex-grow:1"});function L({module:e,children:t}){return(0,n.createElement)(x,null,(0,n.createElement)(Se,null,(0,n.createElement)(b.mr,{title:(0,s.__)("Imported User Groups","it-l10n-ithemes-security-pro"),description:(0,s.__)("Click any user group to edit its features or its members before importing.","it-l10n-ithemes-security-pro")})),(0,n.createElement)(l.OnboardHeader,{title:e.title,description:(0,n.createElement)(I.Lu,{content:e.help,noWrap:!0}),showNext:!0,showIndicator:!0}),t)}var S=r(42236);const O=(0,m.Z)(b.Tg,{target:"e1vwm4mq0"})("border:1px solid ",(({theme:e})=>e.colors.border.normal),";");function C(){const{url:e,path:t,params:{root:r}}=(0,f.$B)(),{hash:s,search:o}=(0,f.TH)(),{navIds:a,module:l}=(0,d.useSelect)((e=>({navIds:e(p.store).getMatchableNavIds(),module:e(i.MODULES_STORE_NAME).getModule("user-groups")})),[]);return null!==a&&l?(0,n.createElement)(f.rs,null,(0,n.createElement)(f.AW,{path:`${t}/multi`},(0,n.createElement)(k,{module:l})),(0,n.createElement)(f.AW,{path:`${t}/:groupId`},(0,n.createElement)(N,{module:l,root:r})),(0,n.createElement)(f.AW,{path:t},"onboard"===r&&(0,n.createElement)(ee,null),"onboard"!==r&&a.length>0&&(0,n.createElement)(f.l_,{to:`${e}/${a[0]}/${o}${s}`}))):null}function N({module:e,root:t}){const{groupId:r}=(0,f.UO)();return(0,n.createElement)(D,{root:t,module:e,groupId:r},(0,n.createElement)(O,null,(0,n.createElement)(Le,null),(0,n.createElement)(y,null),(0,n.createElement)(Z,{groupId:r})),(0,n.createElement)(ve,{groupId:r}))}function k({module:e}){const[t]=(0,S.Wd)("back",S.Zp),[r,o]=(0,S.Wd)("id",(0,S.Wc)(S.V3,[]));return(0,n.createElement)(React.Fragment,null,(0,n.createElement)(O,null,(0,n.createElement)(b.mr,{title:(0,s.__)("User Groups","it-l10n-ithemes-security-pro"),description:(0,n.createElement)(I.Lu,{content:e.help,noWrap:!0})},(0,n.createElement)(h.rU,{to:t?`/settings/user-groups/${t}`:"/settings/user-groups",component:(0,E.Sj)(b.xv),as:"a",decoration:"none",variant:b.rK.MUTED,text:(0,s.__)("Cancel Group Edit","it-l10n-ithemes-security-pro")})),(0,n.createElement)(F,{selected:r,setSelected:o}),(0,n.createElement)(A,{groupIds:r})),(0,n.createElement)(Ee,{groupIds:r}))}function D({root:e,module:t,groupId:r,children:o}){const i=(0,n.useMemo)((()=>({groupId:r})),[r]);return"onboard"===e?(0,n.createElement)(re,{module:t},o):"import"===e?(0,n.createElement)(L,{module:t},o):(0,n.createElement)(React.Fragment,null,(0,n.createElement)(Se,null,(0,n.createElement)(b.mr,{title:(0,s.__)("User Groups","it-l10n-ithemes-security-pro"),description:(0,n.createElement)(I.Lu,{content:t.help,noWrap:!0})},(0,n.createElement)(Ie,{fillProps:i}))),o)}var M=r(92819);const G=(0,m.Z)(b.x4,{target:"e1qle9621"})({name:"1nzdh6",styles:".components-tab-panel__tabs{padding:0 1.5rem;}.components-tab-panel__tab-content{padding:1rem 1.5rem;}"}),R=(0,m.Z)(I.KM,{target:"e1qle9620"})({name:"8dk3vg",styles:"margin-bottom:1rem"});function Z({groupId:e}){const{root:t}=(0,f.UO)(),{hash:r}=(0,f.TH)(),{type:o,isSaving:i,notFound:l,error:c}=(0,d.useSelect)((t=>({type:t(p.store).getMatchableType(e),error:t(p.store).getError(e),isSaving:t(p.store).isSavingGroupOrSettings(e),notFound:t(a.store).isGroupNotFound(e)})),[e]),g=(0,n.useMemo)((()=>[{name:"settings",title:(0,s.__)("Features","it-l10n-ithemes-security-pro"),Component:ye},"user-group"===o&&{name:"edit",title:(0,s.__)("Edit Group","it-l10n-ithemes-security-pro"),Component:_e}].filter(M.isPlainObject)),[o]);return l?(0,n.createElement)(f.l_,{to:`/${t}/user-groups`}):(0,n.createElement)(u.Disabled,{isDisabled:i},(0,n.createElement)(G,{tabs:g},(({Component:t})=>(0,n.createElement)(t,{groupId:e,highlight:r.substring(1)},(0,n.createElement)(R,{apiError:c})))))}function A({groupIds:e}){const{errors:t}=(0,d.useSelect)((e=>({errors:e(p.store).getBulkErrorsList()})),[]),r=(0,n.useMemo)((()=>[{name:"settings",title:(0,s.__)("Features","it-l10n-ithemes-security-pro"),Component:we}]),[]);return(0,n.createElement)(G,{tabs:r,isStyled:!0},(({Component:r})=>(0,n.createElement)(r,{groupIds:e},(0,n.createElement)(R,{errors:t}))))}var $=r(27231);const U=(0,m.Z)("fieldset",{target:"e1xcjnx23"})({name:"1i6y9la",styles:"display:flex;flex-wrap:wrap;align-items:center;padding:.5rem 1.5rem 1rem;gap:0.75rem"}),H=(0,m.Z)(b.Tg,{target:"e1xcjnx22"})({name:"adif5y",styles:"position:relative;display:inline;border-radius:1.5rem"}),W=(0,m.Z)("input",{target:"e1xcjnx21"})({name:"1ouiv6l",styles:"opacity:0;position:absolute;width:100%;height:100%"}),P=(0,m.Z)(b.xv,{target:"e1xcjnx20"})({name:"1nx3mrv",styles:"padding:0.75rem 1.25rem 0.75rem 0.75rem"});function F({selected:e,setSelected:t}){const{matchables:r}=(0,d.useSelect)((e=>({matchables:e(a.store).getMatchables()||[]})),[]);return(0,n.createElement)("div",{className:"itsec-user-groups-multi-group-selector"},(0,n.createElement)(U,null,(0,n.createElement)(u.VisuallyHidden,{as:"legend"},(0,s.__)("User Groups","it-l10n-ithemes-security-pro")),r.map((r=>(0,n.createElement)(V,{key:r.id,id:r.id,selected:e,setSelected:t})))))}function V({id:e,selected:t,setSelected:r}){const{label:s}=(0,d.useSelect)((t=>({label:t(p.store).getEditedMatchableLabel(e)})),[e]),o=t.includes(e);return(0,n.createElement)(H,{variant:o?b.h1.SECONDARY:b.h1.PRIMARY},(0,n.createElement)(W,{type:"checkbox",checked:o,onChange:n=>(n=>{r(n?[...t,e]:(0,M.without)(t,e),"replaceIn")})(n.target.checked),id:`itsec-multi-group-selector-group-${e}`}),(0,n.createElement)(P,{text:s,variant:b.rK.DARK,weight:b.fs.HEAVY,as:"label",htmlFor:`itsec-multi-group-selector-group-${e}`,icon:o?$.Z:v.Z,iconColor:!o&&"#6817C5"}))}const T=(0,m.Z)("div",{target:"em21pmf0"})({name:"olj6q7",styles:"max-width:530px;display:flex;flex-direction:column;gap:1.75rem"}),B=(0,n.createElement)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)("path",{d:"M9 4C7.35156 4 6 5.35156 6 7V26H6.42188C6.85938 27.1094 7.74219 28 9 28H26V26H9C8.4375 26 8 25.5625 8 25C8 24.4375 8.4375 24 9 24H26V4H9ZM9 6H24V22H9C8.64844 22 8.3125 22.0781 8 22.1875V7C8 6.4375 8.4375 6 9 6ZM10 10V12H22V10H10Z",fill:"#9675F7"})),j=(0,n.createElement)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)("path",{d:"M22 2C17.5938 2 14 5.59375 14 10C14 10.7109 14.1875 11.3516 14.3594 11.9844L13.875 12.4688L10 8.58594V5.44531L9.53125 5.15625L4.85938 2.23438L2.23438 4.8125L5.4375 10H8.58594L12.4687 13.875L5.17188 21.1719C3.61719 22.7266 3.61719 25.2734 5.17188 26.8281C6.72656 28.3828 9.27344 28.3828 10.8281 26.8281L16 21.6562L21.1719 26.8281C22.7266 28.3828 25.2734 28.3828 26.8281 26.8281C28.3828 25.2734 28.3828 22.7266 26.8281 21.1719L23.5 17.8438C27.1953 17.1406 30 13.8906 30 10C30 8.66406 29.6406 7.42188 29.0781 6.33594L28.4453 5.125L27.4844 6.09375L23.1875 10.3828L21.6172 8.8125L26.875 3.54688L25.6641 2.92188C24.5781 2.35938 23.3359 2 22 2ZM22 4C22.4531 4 22.8438 4.21875 23.2734 4.32813L18.7891 8.8125L23.1875 13.2109L27.6797 8.72656C27.7812 9.15625 28 9.54688 28 10C28 13.3281 25.3281 16 22 16C21.3125 16 20.6562 15.8594 20 15.625L19.4062 15.4219L9.41406 25.4141C8.625 26.2031 7.375 26.2031 6.58594 25.4141C5.79688 24.625 5.79688 23.375 6.58594 22.5859L16.5781 12.5938L16.375 12C16.1406 11.3438 16 10.6875 16 10C16 6.67188 18.6719 4 22 4ZM5.14062 4.76563L8 6.55469V7.83594L7.83594 8H6.5625L4.77344 5.11719L5.14062 4.76563ZM20.0156 17.6406C20.2187 17.6953 20.4219 17.7422 20.625 17.7969L25.4141 22.5859C26.2031 23.375 26.2031 24.625 25.4141 25.4141C24.625 26.2031 23.375 26.2031 22.5859 25.4141L17.4141 20.2422L20.0156 17.6406Z",fill:"#9675F7"}));var z=r(65096),q=r.n(z),K=r(91247),Y=r(50460);function X(){return X.instance||(X.instance=new(q())({schemaId:"id"}),X.instance.addMetaSchema(r(27171))),X.instance}function J(){const{registerCompletionStep:e}=(0,d.useDispatch)(l.ONBOARD_STORE_NAME),{saveGroups:t,saveGroupSettingsAsBatch:r}=(0,d.useDispatch)(p.store);(0,E.eH)(J,(()=>{e({id:"savingUserGroups",label:(0,s.__)("Create User Groups","it-l10n-ithemes-security-pro"),priority:15,callback:()=>t()}),e({id:"savingUserGroupsSetting",label:(0,s.__)("Setup User Group Settings","it-l10n-ithemes-security-pro"),priority:20,callback:()=>r()})}))}function Q(){const{registerProvider:e}=(0,d.useDispatch)(Y.G);(0,E.eH)(Q,(()=>{e("user-group-settings",(0,s.__)("User Group Settings","it-l10n-ithemes-security-pro"),25,(({registry:e,evaluate:t,results:r})=>e.select(a.store).getSettingDefinitions(X()).reduce(((e,n)=>(0,M.reduce)(n.settings,((e,s,o)=>{var i,a,l;return t.stringMatch(s.title)||t.stringMatch(s.description)||t.keywordMatch(s.keywords)?(null!==(l=(i=r.groups)[a=n.id])&&void 0!==l||(i[a]={title:n.title,items:[]}),r.groups[n.id].items.push({title:s.title,description:s.description,route:`/settings/user-groups?module=${n.id}#${n.id}/${o}`}),e++):e}),e)),0))),e("user-groups",(0,s.__)("User Groups","it-l10n-ithemes-security-pro"),50,(({registry:e,evaluate:t,results:r})=>(e.select(p.store).getAvailableGroups()||[]).reduce(((e,n)=>t.stringMatch(n.label)?(r.items.push({title:n.label,description:n.description,route:`/settings/user-groups/${n.id}`}),e++):e),0)))}))}function ee(){const e=(0,l.useNavigateTo)(),t=function(){const{select:e,resolveSelect:t}=(0,d.useRegistry)(),{createLocalGroup:r,editGroup:n,editGroupSetting:o,createdDefaultGroups:u}=(0,d.useDispatch)(p.store);return async()=>{if(e(p.store).hasCreatedDefaultGroups())return e(p.store).getMatchableNavIds();const c={administrator:(0,s.__)("Administrators","it-l10n-ithemes-security-pro"),editor:(0,s.__)("Editors","it-l10n-ithemes-security-pro"),author:(0,s.__)("Authors","it-l10n-ithemes-security-pro"),contributor:(0,s.__)("Contributors","it-l10n-ithemes-security-pro"),subscriber:(0,s.__)("Subscribers","it-l10n-ithemes-security-pro")},d=await t(i.MODULES_STORE_NAME).getEditedModules(),g=await t(a.store).getMatchables(),m=e(p.store).getLocalGroupIds(),h=e(l.ONBOARD_STORE_NAME).getAnswers(),f={administrator:[],editor:[],author:[],contributor:[],subscriber:[]};for(const t of(0,M.map)((0,M.filter)(g,{type:"user-group"}),"id").concat(m)){const r=e(p.store).getEditedGroupAttribute(t,"canonical");for(const e of r)f[e].push(t)}const v={};for(const e of h)(0,M.isPlainObject)(e.canonical_group_substitutions)&&Object.assign(v,e.canonical_group_substitutions);for(const e in c){if(!c.hasOwnProperty(e))continue;const t=f[e];if(v.hasOwnProperty(e)){if(null===v[e]&&!t.length)continue;t.push(v[e])}if(0===t.length){const s=(0,K.Z)();r(s),n(s,{label:c[e],canonical:[e]}),t.push(s)}"subscriber"===e&&t.push("everybody-else");for(const r of d)if("active"===r.status.selected)for(const n in r.user_groups){if(!r.user_groups.hasOwnProperty(n))continue;if(!r.user_groups[n].default)continue;let s=r.user_groups[n].default;if(Array.isArray(s)||(s=[s]),(0,M.intersection)(["all",e],s).length>0)for(const e of t)o(e,r.id,n,!0)}for(const r of h)if(r.user_groups_settings[e])for(const n in r.user_groups_settings[e])if(r.user_groups_settings[e].hasOwnProperty(n))for(const s of r.user_groups_settings[e][n])for(const e of t)o(e,n,s,!0)}return u(),e(p.store).getMatchableNavIds()}}(),r=function(){const{resolveSelect:e}=(0,d.useRegistry)(),{editGroupSetting:t}=(0,d.useDispatch)(p.store);return async()=>{const r=await e(i.MODULES_STORE_NAME).getEditedModules(),n=await e(p.store).getMatchableNavIds();for(const e of n)for(const n of r)if("active"===n.status.selected)for(const r in n.user_groups)n.user_groups.hasOwnProperty(r)&&"all"===n.user_groups[r].default&&t(e,n.id,r,!0)}}();return(0,n.createElement)(T,null,(0,n.createElement)(u.Flex,{as:"header",gap:2,direction:"column",expanded:!1},(0,n.createElement)(b.X6,{level:2,size:b.yH.EXTRA_LARGE,variant:b.rK.DARK,text:(0,s.__)("User Groups","it-l10n-ithemes-security-pro")}),(0,n.createElement)(b.xv,{size:b.yH.SUBTITLE_SMALL,variant:b.rK.DARK,weight:b.fs.HEAVY,text:(0,s.__)("Enable or disable security features for specific groups of users.","it-l10n-ithemes-security-pro")}),(0,n.createElement)(b.xv,{variant:b.rK.MUTED,text:(0,s.__)("Default user groups are the roles that already exist in WordPress, like Authors, Editors, and Administrators. Custom user groups can include any existing user or role. User groups allow you to define unique security options and requirements for each group. Create and enforce group security policies with default and custom user groups.","it-l10n-ithemes-security-pro")})),(0,n.createElement)(u.Flex,{gap:12},(0,n.createElement)(l.SelectableCard,{title:(0,s.__)("Default User Groups","it-l10n-ithemes-security-pro"),icon:B,direction:"vertical",onClick:async()=>{const n=await t();await r(),e(`/onboard/user-groups/${n[0]}`)}}),(0,n.createElement)(l.SelectableCard,{title:(0,s.__)("Custom User Groups","it-l10n-ithemes-security-pro"),icon:j,direction:"vertical",onClick:()=>{e("/onboard/user-groups/everybody-else")}})))}const te=(0,m.Z)("div",{target:"e16tg84q0"})({name:"s9thde",styles:"max-width:830px;width:100%;flex-grow:1"});function re({module:e,children:t}){const{createdDefaultGroups:r}=(0,d.useSelect)((e=>({createdDefaultGroups:e(p.store).hasCreatedDefaultGroups()})),[]);return(0,n.createElement)(te,null,(0,n.createElement)(Se,null,(0,n.createElement)(b.mr,{title:r?(0,s.__)("Default User Groups","it-l10n-ithemes-security-pro"):(0,s.__)("Custom User Groups","it-l10n-ithemes-security-pro"),description:r?(0,s.__)("Click any default user group to edit its features or its members.","it-l10n-ithemes-security-pro"):(0,s.__)("Create custom user groups for each set of users you want to have a different security policy.","it-l10n-ithemes-security-pro")})),(0,n.createElement)(l.OnboardHeader,{title:e.title,description:(0,n.createElement)(I.Lu,{content:e.help,noWrap:!0}),showNext:!0,showIndicator:!0}),t)}var ne=r(59588),se=r.n(ne),oe=r(36179),ie=r(31511);const ae=se()(((e,t)=>{const r=[{value:"$administrator$",label:(0,s.__)("Administrator Capabilities","it-l10n-ithemes-security-pro")},{value:"$editor$",label:(0,s.__)("Editor Capabilities","it-l10n-ithemes-security-pro")},{value:"$author$",label:(0,s.__)("Author Capabilities","it-l10n-ithemes-security-pro")},{value:"$contributor$",label:(0,s.__)("Contributor Capabilities","it-l10n-ithemes-security-pro")},{value:"$subscriber$",label:(0,s.__)("Subscriber Capabilities","it-l10n-ithemes-security-pro")}];t&&r.unshift({value:"$super-admin$",label:(0,s.__)("Super Admin","it-l10n-ithemes-security-pro")}),(0,M.some)(e,(e=>""===e.canonical))&&r.push({value:"$other$",label:(0,s.__)("Other","it-l10n-ithemes-security-pro"),selectable:!1});for(const t in e){if(!e.hasOwnProperty(t))continue;const{canonical:n,label:s}=e[t];r.push({value:t,parent:n.length>0?`$${n}$`:"$other$",label:s})}return Object.values(r)}));function le({groupId:e,disabled:t=!1}){const{roles:r,canonical:o,available:i,schema:a}=(0,d.useSelect)((t=>({roles:t(p.store).getEditedGroupAttribute(e,"roles")||[],canonical:t(p.store).getEditedGroupAttribute(e,"canonical")||[],available:t("ithemes-security/core").getRoles(),schema:t("ithemes-security/core").getSchema("ithemes-security-user-group")})),[e]),{editGroup:l}=(0,d.useDispatch)(p.store),u=(0,M.get)(a,["properties","canonical","items","enum"],[]).includes("super-admin"),c=[...r,...o.map((e=>`$${e}$`))];return(0,n.createElement)(oe.gN,{label:(0,s.__)("Select Roles","it-l10n-ithemes-security-pro"),help:(0,s.__)("Add users with the selected roles to this group.","it-l10n-ithemes-security-pro"),value:c,disabled:t,options:ae(i,u),onChange:t=>{const[r,n]=(0,ie.pL)(t,(e=>e.startsWith("$")&&e.endsWith("$")));l(e,{roles:n,canonical:(0,M.without)(r.map((e=>e.slice(1,-1))),"other")})}})}var ue=r(87514),ce=r.n(ue),de=r(73470),pe=r(9576);function ge(e){return{value:e.id,label:e.name,user:e}}const me=e=>t=>new Promise(((r,n)=>{ce()({path:(0,de.addQueryArgs)("/wp/v2/users",{search:t,per_page:100,context:"embed",itsec_global:!0})}).then((t=>(t.forEach(e),t))).then((e=>r(e.map(ge)))).catch(n)}));function he({groupId:e,disabled:t=!1}){const r=(0,pe.useInstanceId)(he),{editGroup:o}=(0,d.useDispatch)(p.store),{receiveUser:i}=(0,d.useDispatch)("ithemes-security/core"),{users:a,loading:l}=(0,d.useSelect)((t=>{const r=t(p.store).getEditedGroupAttribute(e,"users")||[],n=[];let s=!1;return r.forEach((e=>{const r=t("ithemes-security/core").getUser(e);r?n.push(r):t("core/data").isResolving("ithemes-security/core","getUser",[e])&&(s=!0)})),{users:n,loading:s}}),[e]),[c,g]=(0,n.useState)(""),m=`itsec-user-group-panel-users__select-${r}`,h=l?[]:a.map(ge),f=(0,n.useMemo)((()=>me(i)),[i]);return(0,n.createElement)(u.BaseControl,{className:"itsec-user-group-panel-users__select-control",label:(0,s.__)("Select Users","it-l10n-ithemes-security-pro"),help:(0,s.__)("Select specific users to add to this group.","it-l10n-ithemes-security-pro"),id:m},(0,n.createElement)(I.qb,{classNamePrefix:"components-itsec-async-select-control",inputId:m,isDisabled:t||l,isLoading:l,isMulti:!0,cacheOptions:!0,defaultOptions:!0,loadOptions:f,value:h,onChange:t=>o(e,{users:(0,M.map)(t,"value")}),inputValue:c,onInputChange:e=>g(e)}))}const fe=(0,m.Z)(u.Flex,{target:"efw12bs0"})({name:"hltamm",styles:"margin-top:2rem"});function ve({groupId:e}){const{isDirty:t,isSaving:r}=(0,d.useSelect)((t=>({isDirty:t(p.store).isDirty(e),isSaving:t(p.store).isSavingGroupOrSettings(e)})),[e]),{saveGroupAndSettings:o,resetEdits:i}=(0,d.useDispatch)(p.store),{root:a}=(0,f.UO)(),{goNext:c}=(0,l.useNavigation)();return(0,n.createElement)(fe,{justify:"end"},(0,n.createElement)(u.FlexItem,null,(0,n.createElement)(b.zx,{variant:"secondary",onClick:()=>i(e),disabled:!t},(0,s.__)("Undo Changes","it-l10n-ithemes-security-pro"))),"settings"===a&&(0,n.createElement)(u.FlexItem,null,(0,n.createElement)(b.zx,{variant:"primary",onClick:()=>o(e),isBusy:r,disabled:r||!t},(0,s.__)("Save","it-l10n-ithemes-security-pro"))),"settings"!==a&&(0,n.createElement)(b.zx,{text:(0,s.__)("Next","it-l10n-ithemes-security-pro"),variant:"primary",onClick:c}))}const be=(0,m.Z)(u.Flex,{target:"eluqwtc0"})({name:"hltamm",styles:"margin-top:2rem"});function Ee({groupIds:e}){const{isDirty:t,isSaving:r}=(0,d.useSelect)((t=>({isDirty:t(p.store).hasBulkSettingEdits(),isSaving:t(p.store).isSavingBulkEdits(e)})),[e]),{saveBulkEdits:o,resetBulkGroupSettingEdits:i}=(0,d.useDispatch)(p.store);return(0,n.createElement)(be,{justify:"end"},(0,n.createElement)(u.FlexItem,null,(0,n.createElement)(b.zx,{variant:"secondary",onClick:()=>i(e),disabled:!t},(0,s.__)("Undo Changes","it-l10n-ithemes-security-pro"))),(0,n.createElement)(u.FlexItem,null,(0,n.createElement)(b.zx,{variant:"primary",onClick:()=>o(e),isBusy:r,disabled:r||!t},(0,s.__)("Save","it-l10n-ithemes-security-pro"))))}function _e({groupId:e,children:t}){const{label:r,isLoading:o}=(0,d.useSelect)((t=>({label:t(p.store).getEditedGroupAttribute(e,"label"),isLoading:t("core/data").isResolving(a.store,"getGroup",[e])||t("core/data").isResolving(i.coreStore,"getIndex")})),[e]),{deleteGroup:l}=(0,d.useDispatch)(p.store),[g,m]=(0,b.HW)({onContinue:()=>l(e),title:(0,s.__)("Confirm your action","it-l10n-ithemes-security-pro"),body:(0,s.sprintf)((0,s.__)("Are you sure you want to delete the “%s” user group?","it-l10n-ithemes-security-pro"),null!=r?r:(0,s.__)("Untitled","it-l10n-ithemes-security-pro")),continueText:(0,s.__)("Delete User Group","it-l10n-ithemes-security-pro")});return(0,n.createElement)(React.Fragment,null,m,(0,n.createElement)(xe,null,(0,n.createElement)(b.zx,{text:(0,s.__)("Delete User Group","it-l10n-ithemes-security-pro"),variant:"tertiary",isDestructive:!0,onClick:g})),(0,n.createElement)(u.Disabled,{isDisabled:o},t,(0,n.createElement)(c,{groupId:e,disabled:o})))}function ye({groupId:e,highlight:t,moduleFilter:r,children:o}){const{root:i}=(0,f.UO)(),l=(0,p.useSettingsDefinitions)({module:r}),{isLoading:c}=(0,d.useSelect)((t=>{let r=!1;if(!t(p.store).isLocalGroup(e)){const n=t(a.store).getGroupSettings(e),s=t(a.store).isResolving("getGroupSettings",[e]);r=!n&&s}return{isLoading:r}}),[e]);return(0,n.createElement)(React.Fragment,null,"settings"===i&&(0,n.createElement)(xe,null,(0,n.createElement)(h.rU,{to:`/settings/user-groups/multi?id=${e}&back=${e}`,component:(0,E.Sj)(b.xv),as:"a",variant:b.rK.ACCENT,text:(0,s.__)("Edit Multiple Groups","it-l10n-ithemes-security-pro")})),(0,n.createElement)(u.Disabled,{isDisabled:c},o,(0,n.createElement)(p.SettingsForm,{definitions:l,settingComponent:p.SingleSettingField,groupId:e,disabled:c,highlight:t})))}function we({groupIds:e,children:t}){const r=(0,p.useSettingsDefinitions)();return(0,n.createElement)(u.Disabled,{isDisabled:!e.length},t,(0,n.createElement)(p.SettingsForm,{definitions:r,settingComponent:p.BulkSettingField,groupIds:e}))}const{Slot:Ie,Fill:xe}=(0,u.createSlotFill)("UserGroupsPageHeaderAction"),{Slot:Le,Fill:Se}=(0,u.createSlotFill)("UserGroupsPageHeader");var Oe=r(27738),Ce=r(54761);function Ne(){return J(),Q(),(0,n.createElement)(l.Page,{id:"user-groups",title:(0,s.__)("User Groups","it-l10n-ithemes-security-pro"),icon:"groups",priority:10,roots:["onboard","settings","import"]},(()=>(0,n.createElement)(C,null)))}(0,Ce.addAction)("ithemes-security.onboard.applyAnswerResponse","ithemes-security/user-groups/onboard.applyAnswerResponse",(function(e,t){for(const r of t.user_groups)e.dispatch(p.store).createLocalGroup(r.id)&&e.dispatch(p.store).editGroup(r.id,(0,M.pick)(r,["label","users","roles","canonical"]));for(const r in t.user_groups_settings){if(!t.user_groups_settings.hasOwnProperty(r)||!(0,Oe.Z)(r))continue;const n=t.user_groups_settings[r];if(n)for(const t in n)if(n.hasOwnProperty(t))for(const s of n[t])e.dispatch(p.store).editGroupSetting(r,t,s,!0)}})),(0,Ce.addAction)("ithemes-security.onboard.reset","ithemes-security/user-groups/onboard.reset",(function(e){e.dispatch(p.store).deleteLocalGroups(),e.dispatch(p.store).resetAllEdits()})),r.p=window.itsecWebpackPublicPath,(0,s.setLocaleData)({"":{}},"ithemes-security-pro"),(0,o.registerPlugin)("itsec-user-groups",{render:()=>(0,n.createElement)(Ne,null)})},50460:(e,t,r)=>{"use strict";r.d(t,{G:()=>U,o:()=>N});var n={};r.r(n),r.d(n,{REGISTER_PROVIDER:()=>Z,registerProvider:()=>R});var s={};r.r(s),r.d(s,{getProviders:()=>A});var o=r(87462),i=r(6293),a=r(73727),l=r(16550),u=r(90071),c=r(92819),d=r(64893),p=r(95122),g=r(48015),m=r(9576),h=r(81019),f=r(82839),v=r(13173),b=r(65813),E=r(36179),_=r(86033),y=r(13092);function w(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}var I=new WeakMap,x=new WeakMap,L=new WeakMap,S=new WeakMap,O=new WeakMap;class C{constructor(e,t){w(this,I,{writable:!0,value:void 0}),w(this,x,{writable:!0,value:void 0}),w(this,L,{writable:!0,value:void 0}),w(this,S,{writable:!0,value:void 0}),w(this,O,{writable:!0,value:void 0}),(0,y.Z)(this,I,e),(0,y.Z)(this,x,t),(0,y.Z)(this,L,t.select(U).getProviders()),this._prepare()}_prepare(){(0,y.Z)(this,O,(0,_.Z)(this,I).split(/\s+/g).map((e=>e.trim().toLowerCase())).filter((e=>!!e)));const e=(0,_.Z)(this,I).endsWith(" ");(0,y.Z)(this,S,new RegExp((0,_.Z)(this,O).map(((t,r)=>r+1!==(0,_.Z)(this,O).length||e?`(?=.*\\b${(0,c.escapeRegExp)(t)}\\b)`:`(?=.*\\b${(0,c.escapeRegExp)(t)})`)).join("")+".+","gi"))}_stringMatch(e){return e&&(0,_.Z)(this,S).test(e)}_keywordMatch(e){return!(!e||!e.length)&&e.some((e=>(0,_.Z)(this,O).some(((t,r)=>e.includes(" ")?this._stringMatch(e):r===(0,_.Z)(this,O).length-1?e.startsWith(t):t===e))))}getResults(){if((0,_.Z)(this,I).length<3)return[{},0];let e=0;const t=[],r={stringMatch:e=>this._stringMatch(e),keywordMatch:e=>this._keywordMatch(e)};for(const n of(0,_.Z)(this,L)){const s={title:n.title,items:[],groups:{}};e+=n.callback({evaluate:r,results:s,registry:(0,_.Z)(this,x)}),!s.items.length&&(0,c.isEmpty)(s.groups)||t.push(s)}return[t,e]}}const N=(0,i.forwardRef)((function({onPick:e=c.noop,showResults:t},r){const[n,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(!1),u=(0,i.useRef)(),d=(0,i.useRef)(),[E,_]=(0,i.useState)([]),y=(0,g.useRegistry)(),w=(0,i.useCallback)((e=>{const t=new C(e,y).getResults();_(t[0]),(0,f.speak)((0,p.sprintf)((0,p._n)("%d result found.","%d results found.",t[1],"it-l10n-ithemes-security-pro"),t[1]))}),[y]),I=(0,m.useDebounce)(w,50),x=(0,i.useCallback)((e=>{u.current&&(e.preventDefault(),u.current.focus())}),[u]);return(0,m.useKeyboardShortcut)("/",x),(0,i.createElement)("div",(0,o.Z)({className:"itsec-search"},(0,b.Zk)((()=>l(!1)))),(0,i.createElement)("div",null,(0,i.createElement)(v.lD,{value:n,onChange:e=>{s(e),I(e)},onFocus:()=>l(!0),onKeyDown:e=>{e.keyCode===h.DOWN&&(e.preventDefault(),d.current.focus())},ref:(0,b.qq)([r,u]),placeholder:(0,p.__)("Search for features, settings, and more","it-l10n-ithemes-security-pro"),omitSeparators:!0,size:"large"}),(a||t)&&n.length>=3&&(0,i.createElement)(k,{results:E,exitSearch:t=>{e(t),l(!1)},ref:d,onPick:e})))})),k=(0,i.forwardRef)((function({results:e,exitSearch:t,onPick:r},n){const s=(0,i.useRef)();(0,i.useImperativeHandle)(n,(()=>({focus(){s.current.focus()}})));const a=(0,m.useInstanceId)(k,"itsec-search"),g=a+"__result__",f=function(){const e=(0,l.k6)();return(t,r="push")=>e[r]((0,u.ob)(t))}(),[v,b]=(0,i.useState)("");return(0,c.isEmpty)(e)?null:(0,i.createElement)(React.Fragment,null,(0,i.createElement)(d.VisuallyHidden,{id:a+"__label"},(0,p.__)("Search Results","it-l10n-ithemes-security-pro")),(0,i.createElement)(E.T2,{className:"itsec-search__results",id:a,active:v&&g+v,onNavigate:e=>b(e.substring(g.length)),onKeyDown:({keyCode:e})=>{!v||e!==h.ENTER&&e!==h.SPACE||(r(v),f(v),t())},onFocus:()=>{if(!v&&!(0,c.isEmpty)(e)){const[,t]=Object.entries(e)[0];if(t.items?.length)b(t.items[0].route);else if(!(0,c.isEmpty)(t.groups)){const[,e]=Object.entries(t.groups)[0];b(e.items[0].route)}}},role:"listbox",descendantRoles:"option",ref:s,"aria-labelledby":a+"__label"},(0,c.map)(e,((e,r)=>(0,i.createElement)(D,(0,o.Z)({key:r},e,{active:v,idPrefix:g,exitSearch:t}))))))}));function D({title:e,items:t,groups:r,...n}){const s=(0,m.useInstanceId)(k,"itsec-search__kind");return(0,i.createElement)("ul",{className:"itsec-search__kind",role:"group","aria-labelledby":s},(0,i.createElement)("li",{role:"presentation",id:s},e),(t||[]).map((e=>(0,i.createElement)(G,(0,o.Z)({key:e.route},e,n)))),(0,c.map)(r,((e,t)=>(0,i.createElement)(M,(0,o.Z)({key:t},e,n)))))}function M({title:e,items:t,...r}){const n=(0,m.useInstanceId)(k,"itsec-search__group");return(0,i.createElement)("ul",{className:"itsec-search__group",role:"group","aria-labelledby":n},(0,i.createElement)("li",{role:"presentation",id:n},(0,i.createElement)("span",null,e)),(t||[]).map((e=>(0,i.createElement)(G,(0,o.Z)({key:e.route},e,r)))))}function G({title:e,description:t,route:r,active:n,idPrefix:s,exitSearch:o}){return(0,i.createElement)("li",{className:"itsec-search__result",role:"option","aria-selected":n===r||void 0,id:s+r,"aria-label":e},(0,i.createElement)(a.rU,{to:r,tabIndex:-1,onClick:()=>o(r)},(0,i.createElement)("span",null,e),(0,i.createElement)(E.Lu,{content:t,noHtml:!0,tagName:"p"})))}function R(e,t,r,n){return{type:Z,slug:e,title:t,priority:r,callback:n}}const Z="REGISTER_PROVIDER",A=(0,r(28306).Z)((e=>(0,c.sortBy)(e.providers,"priority")),(e=>e.providers)),$={providers:{}},U="ithemes-security/search";(0,g.registerStore)(U,{actions:n,selectors:s,reducer:function(e=$,t){return t.type===Z?{...e,providers:{...e.providers,[t.slug]:(0,c.omit)(t,["type"])}}:e}})},11984:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(6293);const s=function({icon:e,size:t=24,...r}){return(0,n.cloneElement)(e,{width:t,height:t,...r})}},27231:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(6293),s=r(14776);const o=(0,n.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(s.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}))},95117:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(6293),s=r(14776);const o=(0,n.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(s.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}))},79526:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(6293),s=r(14776);const o=(0,n.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(s.Path,{d:"M7 11.5h10V13H7z"}))},94184:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e=[],t=0;t
{"use strict";var n,s;function o(e){return[e]}function i(){var e={clear:function(){e.head=null}};return e}function a(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n
l}),n={},s="undefined"!=typeof WeakMap},64239:(e,t,r)=>{"use strict";function n(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function s(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function o(e,t){if(e.clientHeight
t||o>e&&i
=t&&a>=r?o-e-n:i>t&&a
r?i-t+s:0}function a(e,t){var r=window,s=t.scrollMode,a=t.block,l=t.inline,u=t.boundary,c=t.skipOverflowHiddenElements,d="function"==typeof u?u:function(e){return e!==u};if(!n(e))throw new TypeError("Invalid target");for(var p=document.scrollingElement||document.documentElement,g=[],m=e;n(m)&&d(m);){if((m=m.parentElement)===p){g.push(m);break}null!=m&&m===document.body&&o(m)&&!o(document.documentElement)||null!=m&&o(m,c)&&g.push(m)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,f=r.visualViewport?r.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,E=e.getBoundingClientRect(),_=E.height,y=E.width,w=E.top,I=E.right,x=E.bottom,L=E.left,S="start"===a||"nearest"===a?w:"end"===a?x:w+_/2,O="center"===l?L+y/2:"end"===l?I:L,C=[],N=0;N
=0&&L>=0&&x<=f&&I<=h&&w>=R&&x<=A&&L>=$&&I<=Z)return C;var U=getComputedStyle(k),H=parseInt(U.borderLeftWidth,10),W=parseInt(U.borderTopWidth,10),P=parseInt(U.borderRightWidth,10),F=parseInt(U.borderBottomWidth,10),V=0,T=0,B="offsetWidth"in k?k.offsetWidth-k.clientWidth-H-P:0,j="offsetHeight"in k?k.offsetHeight-k.clientHeight-W-F:0;if(p===k)V="start"===a?S:"end"===a?S-f:"nearest"===a?i(b,b+f,f,W,F,b+S,b+S+_,_):S-f/2,T="start"===l?O:"center"===l?O-h/2:"end"===l?O-h:i(v,v+h,h,H,P,v+O,v+O+y,y),V=Math.max(0,V+b),T=Math.max(0,T+v);else{V="start"===a?S-R-W:"end"===a?S-A+F+j:"nearest"===a?i(R,A,M,W,F+j,S,S+_,_):S-(R+M/2)+j/2,T="start"===l?O-$-H:"center"===l?O-($+G/2)+B/2:"end"===l?O-Z+P+B:i($,Z,G,H,P+B,O,O+y,y);var z=k.scrollLeft,q=k.scrollTop;S+=q-(V=Math.max(0,Math.min(q+V,k.scrollHeight-M+j))),O+=z-(T=Math.max(0,Math.min(z+T,k.scrollWidth-G+B)))}C.push({el:k,top:V,left:T})}return C}function l(e){return e===Object(e)&&0!==Object.keys(e).length}r.d(t,{Z:()=>u});const u=function(e,t){var r=e.isConnected||e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(r?a(e,t):[]);if(r){var n=function(e){return!1===e?{block:"end",inline:"nearest"}:l(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var r="scrollBehavior"in document.body.style;e.forEach((function(e){var n=e.el,s=e.top,o=e.left;n.scroll&&r?n.scroll({top:s,left:o,behavior:t}):(n.scrollTop=s,n.scrollLeft=o)}))}(a(e,n),n.behavior)}}},91247:(e,t,r)=>{"use strict";var n;r.d(t,{Z:()=>u});var s=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(s)}for(var i=r(27738),a=[],l=0;l<256;++l)a.push((l+256).toString(16).substr(1));const u=function(e,t,r){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var s=0;s<16;++s)t[r+s]=n[s];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase();if(!(0,i.Z)(r))throw TypeError("Stringified UUID is invalid");return r}(n)}},27738:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});const n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=function(e){return"string"==typeof e&&n.test(e)}},31600:e=>{e.exports=function(){return this.itsec.packages.data}()},7980:e=>{e.exports=function(){return this.itsec.pages.settings}()},87375:e=>{e.exports=function(){return this.itsec["user-groups"].api}()},62470:e=>{e.exports=function(){return this.itsec["user-groups"].ui}()},82839:e=>{e.exports=function(){return this.wp.a11y}()},87514:e=>{e.exports=function(){return this.wp.apiFetch}()},64893:e=>{e.exports=function(){return this.wp.components}()},9576:e=>{e.exports=function(){return this.wp.compose}()},48015:e=>{e.exports=function(){return this.wp.data}()},82521:e=>{e.exports=function(){return this.wp.date}()},6293:e=>{e.exports=function(){return this.wp.element}()},54761:e=>{e.exports=function(){return this.wp.hooks}()},95122:e=>{e.exports=function(){return this.wp.i18n}()},81834:e=>{e.exports=function(){return this.wp.isShallowEqual}()},81019:e=>{e.exports=function(){return this.wp.keycodes}()},25703:e=>{e.exports=function(){return this.wp.notices}()},3571:e=>{e.exports=function(){return this.wp.plugins}()},14776:e=>{e.exports=function(){return this.wp.primitives}()},73470:e=>{e.exports=function(){return this.wp.url}()},99196:e=>{"use strict";e.exports=window.React},91850:e=>{"use strict";e.exports=window.ReactDOM},92819:e=>{"use strict";e.exports=window.lodash},76292:e=>{"use strict";e.exports=window.moment}},e=>{e.O(0,[7271,3173,5307,5257,3627,3828,976,1511,567,6179],(()=>(63668,e(e.s=63668))));var t=e.O();((window.itsec=window.itsec||{})["user-groups"]=window.itsec["user-groups"]||{}).settings=t}]);