From 728821e295e95cd158efc816b153ff282fcafbcd Mon Sep 17 00:00:00 2001 From: Nick Diego Date: Thu, 18 Jan 2024 15:35:44 -0600 Subject: [PATCH] Fresh build. --- build/block-visibility-editor.asset.php | 2 +- build/block-visibility-editor.js | 8 ++++---- build/block-visibility-settings.asset.php | 2 +- build/block-visibility-settings.js | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build/block-visibility-editor.asset.php b/build/block-visibility-editor.asset.php index 0f832da..7dc9ef7 100644 --- a/build/block-visibility-editor.asset.php +++ b/build/block-visibility-editor.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '2e4d7fa43416b0887877'); + array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'a0044009cac613277464'); diff --git a/build/block-visibility-editor.js b/build/block-visibility-editor.js index e3c542a..b42291c 100644 --- a/build/block-visibility-editor.js +++ b/build/block-visibility-editor.js @@ -8,19 +8,19 @@ // translators: %s: Date/time preset was created. (0,o.__)("Modified: %s","block-visibility"),(0,X.format)(`${D.formats.date} ${D.formats.time}`,x))),P&&(0,t.createElement)("span",null,(0,o.sprintf)( // translators: %s: Id of preset. -(0,o.__)("Id: %s","block-visibility"),P)))),(0,t.createElement)("div",{className:"preset-controls"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Enable preset","block-visibility"),checked:A,onChange:()=>L("enable",!A)}),(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide block","block-visibility"),checked:V,onChange:()=>L("hideBlock",!V),help:(0,o.__)("Hide the block from everyone.","block-visibility")}))))}var ne=window.wp.a11y,ae=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),re=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"})),se=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"})),ce=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),ue=l(855),de=window.wp.notices;function pe(e){var l;const{canResetAll:i,controlSetAtts:a}=e,r=null!==(l=a?.controls)&&void 0!==l?l:"";let s="";r&&(s=JSON.stringify(r));const{createSuccessNotice:c}=(0,n.useDispatch)(de.store),d=(0,o.__)("Copied visibility controls to clipboard.","block-visibility"),p=(0,o.__)("Nothing to copy. Current block has no configured visibility controls.","block-visibility"),b=r?d:p;return i?(0,t.createElement)(ue.CopyToClipboard,{text:s},(0,t.createElement)(u.MenuItem,{"aria-disabled":!i,onClick:()=>c(b,{type:"snackbar"})},(0,o.__)("Copy","block-visibility"))):(0,t.createElement)(u.MenuItem,{"aria-disabled":!0},(0,o.__)("Copy","block-visibility"))}function be(e){const{onClose:l,setModalOpen:i}=e;return(0,t.createElement)(u.MenuItem,{className:"import",onClick:()=>{i("import"),l()}},(0,o.__)("Import","block-visibility"))}function ve(e){const[l,a]=(0,t.useState)(""),{controlSetAtts:r,setControlSetAtts:s,modalOpen:c,setModalOpen:d}=e,p=!l||function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(l),{createSuccessNotice:b}=(0,n.useDispatch)(de.store),v=(0,o.__)("Visibility settings successfully imported.","block-visibility"),m="https:"===document.location.protocol;return(0,t.createElement)(t.Fragment,null,"import"===c&&(0,t.createElement)(u.Modal,{className:"block-visibility__import-modal",title:(0,o.__)("Import Visibility Control Settings","block-visibility"),onRequestClose:()=>d(!1)},!p&&(0,t.createElement)(u.Notice,{status:"error",isDismissible:!1},(0,o.__)("The provided settings are not properly formatted.","block-visibility")),(0,t.createElement)("div",{className:"block-visibility__import-modal--input"},(0,t.createElement)(u.Button,{label:(0,o.__)("Paste from clipboard","block-visibility"),onClick:()=>{navigator.clipboard.readText().then((e=>{a(e)}))},disabled:l||!m,isTertiary:!0,isSmall:!0,icon:R}),(0,t.createElement)(u.TextareaControl,{value:l,onChange:e=>a(e),placeholder:(0,o.__)("Paste copied settings or input manually.","block-visibility"),help:(0,o.__)("Imported settings will override any visibility controls currently applied to the selected block.","block-visibility"),rows:6})),(0,t.createElement)("div",{className:"block-visibility__import-modal--buttons"},(0,t.createElement)(u.Button,{isSecondary:!0,onClick:()=>d(!1)},(0,o.__)("Cancel","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>function(e){const t=JSON.parse(e),l=(0,i.assign)({...r},{controls:t});s(l),d(!1),b(v,{type:"snackbar"})}(l),disabled:!p||!l},(0,o.__)("Import","block-visibility")))))}function me(l){var n,a;const[r,s]=(0,t.useState)(!1),{activeSetControls:c,enabledSetControls:d,controlSets:p,controlSetAtts:b,setControlSetAtts:v}=l,m=d.filter((e=>"integration"!==e.type)),y=d.filter((e=>"integration"===e.type));function h(e){let t;t=e.isActive?(0,i.omit)({...b.controls},[e.attributeSlug]):(0,i.assign)({...b.controls},{[e.attributeSlug]:{}});const l=(0,i.assign)({...b},{controls:{...t}});v(l)}function f(e,t){v({...b,[e]:t})}const g=null!==(n=b?.title)&&void 0!==n?n:"",_=null===(a=b?.enable)||void 0===a||a,k=g||(0,o.__)("Control Set","block-visibility"),E=[...m,...y].some((e=>e.isActive)),S=(0,t.createElement)(u.DropdownMenu,{label:(0,o.__)("Edit","block-visibility"),icon:ae,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:g,label:(0,o.__)("Control set title","block-visibility"),placeholder:k,onChange:e=>f("title",e)}))),w=(0,t.createElement)(u.DropdownMenu,{className:"controls-dropdown",label:(0,o.__)("Visibility Controls","block-visibility"),icon:0===c.length?G:Z,popoverProps:{className:"block-visibility__control-popover visibility-controls",focusOnMount:"container"},toggleProps:{isSmall:!0,disabled:0===d.length}},(n=>{let{onClose:a}=n;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Controls","block-visibility")},m.map(((e,l)=>(0,t.createElement)(ye,{key:l,control:e,toggleControls:h})))),0!==y.length&&(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Integrations","block-visibility")},y.map(((e,l)=>(0,t.createElement)(ye,{key:l,control:e,toggleControls:h})))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(pe,e({canResetAll:E},l)),(0,t.createElement)(be,{modalOpen:r,onClose:a,setModalOpen:s}),(0,t.createElement)(u.MenuItem,{onClick:()=>f("enable",!_)},_?(0,o.__)("Disable all","block-visibility"):(0,o.__)("Enable all","block-visibility")),(0,t.createElement)(u.MenuItem,{"aria-disabled":!E,variant:"tertiary",onClick:()=>{E&&(function(){const e=(0,i.assign)({...b},{controls:{}});v(e)}(),(0,ne.speak)((0,o.__)("All controls reset","block-visibility"),"assertive"))}},(0,o.__)("Reset all","block-visibility"))))}));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"control-set__header section-header main"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("h2",null,k),S),(0,t.createElement)("div",{className:"section-header__toolbar"},(0,t.createElement)(u.Button,{disabled:0===c.length&&p.length<=1,icon:re,isSmall:!0,label:(0,o.__)("Remove","block-visibility"),onClick:()=>{v(b,!0)}}),(0,t.createElement)(u.Button,{disabled:0===c.length,icon:se,isSmall:!0,label:(0,o.__)("Duplicate","block-visibility"),onClick:()=>function(){const e=Math.max(...p.map((e=>e.id)),0)+1,t={...b,id:e};v(t)}(),style:{padding:0}}),w)),r&&(0,t.createElement)(ve,e({modalOpen:r,setModalOpen:s,toggleControls:h,coreControls:m,integrationControls:y},l)))}function ye(e){const{control:l,toggleControls:i}=e;return(0,t.createElement)(u.MenuItem,{key:l.attributeSlug,icon:l.isActive&&ce,label:(0,o.sprintf)( +(0,o.__)("Id: %s","block-visibility"),P)))),(0,t.createElement)("div",{className:"preset-controls"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Enable preset","block-visibility"),checked:A,onChange:()=>L("enable",!A)}),(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide block","block-visibility"),checked:V,onChange:()=>L("hideBlock",!V),help:(0,o.__)("Hide the block from everyone.","block-visibility")}))))}var ne=window.wp.a11y,ae=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),re=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"})),se=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"})),ce=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),ue=l(855),de=window.wp.notices;function pe(e){var l;const{canResetAll:i,controlSetAtts:a}=e,r=null!==(l=a?.controls)&&void 0!==l?l:"";let s="";r&&(s=JSON.stringify(r));const{createSuccessNotice:c}=(0,n.useDispatch)(de.store),d=(0,o.__)("Copied visibility controls to clipboard.","block-visibility"),p=(0,o.__)("Nothing to copy. Current block has no configured visibility controls.","block-visibility"),b=r?d:p;return i?(0,t.createElement)(ue.CopyToClipboard,{text:s},(0,t.createElement)(u.MenuItem,{"aria-disabled":!i,onClick:()=>c(b,{type:"snackbar"})},(0,o.__)("Copy","block-visibility"))):(0,t.createElement)(u.MenuItem,{"aria-disabled":!0},(0,o.__)("Copy","block-visibility"))}function be(e){const{onClose:l,setModalOpen:i}=e;return(0,t.createElement)(u.MenuItem,{className:"import",onClick:()=>{i("import"),l()}},(0,o.__)("Import","block-visibility"))}function ve(e){const[l,a]=(0,t.useState)(""),{controlSetAtts:r,setControlSetAtts:s,modalOpen:c,setModalOpen:d}=e,p=!l||function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(l),{createSuccessNotice:b}=(0,n.useDispatch)(de.store),v=(0,o.__)("Visibility settings successfully imported.","block-visibility"),m="https:"===document.location.protocol;return(0,t.createElement)(t.Fragment,null,"import"===c&&(0,t.createElement)(u.Modal,{className:"block-visibility__import-modal",title:(0,o.__)("Import Visibility Control Settings","block-visibility"),onRequestClose:()=>d(!1)},!p&&(0,t.createElement)(u.Notice,{status:"error",isDismissible:!1},(0,o.__)("The provided settings are not properly formatted.","block-visibility")),(0,t.createElement)("div",{className:"block-visibility__import-modal--input"},(0,t.createElement)(u.Button,{label:(0,o.__)("Paste from clipboard","block-visibility"),onClick:()=>{navigator.clipboard.readText().then((e=>{a(e)}))},disabled:l||!m,isTertiary:!0,isSmall:!0,icon:R}),(0,t.createElement)(u.TextareaControl,{value:l,onChange:e=>a(e),placeholder:(0,o.__)("Paste copied settings or input manually.","block-visibility"),help:(0,o.__)("Imported settings will override any visibility controls currently applied to the selected block.","block-visibility"),rows:6})),(0,t.createElement)("div",{className:"block-visibility__import-modal--buttons"},(0,t.createElement)(u.Button,{isSecondary:!0,onClick:()=>d(!1)},(0,o.__)("Cancel","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>function(e){const t=JSON.parse(e),l=(0,i.assign)({...r},{controls:t});s(l),d(!1),b(v,{type:"snackbar"})}(l),disabled:!p||!l},(0,o.__)("Import","block-visibility")))))}function me(l){var n,a;const[r,s]=(0,t.useState)(!1),{activeSetControls:c,enabledSetControls:d,controlSets:p,controlSetAtts:b,setControlSetAtts:v}=l,m=d.filter((e=>"integration"!==e.type)),y=d.filter((e=>"integration"===e.type));function h(e){let t;t=e.isActive?(0,i.omit)({...b.controls},[e.attributeSlug]):(0,i.assign)({...b.controls},{[e.attributeSlug]:{}});const l=(0,i.assign)({...b},{controls:{...t}});v(l)}function f(e,t){v({...b,[e]:t})}const g=null!==(n=b?.title)&&void 0!==n?n:"",_=null===(a=b?.enable)||void 0===a||a,k=g||(0,o.__)("Control Set","block-visibility"),E=[...m,...y].some((e=>e.isActive)),S=(0,t.createElement)(u.DropdownMenu,{label:(0,o.__)("Edit","block-visibility"),icon:ae,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:g,label:(0,o.__)("Control set title","block-visibility"),placeholder:k,onChange:e=>f("title",e)}))),w=(0,t.createElement)(u.DropdownMenu,{className:"controls-dropdown",label:(0,o.__)("Visibility Controls","block-visibility"),icon:0===c.length?G:Z,popoverProps:{className:"block-visibility__control-popover visibility-controls",focusOnMount:"container",placement:"left-start",offset:259},toggleProps:{isSmall:!0,disabled:0===d.length}},(n=>{let{onClose:a}=n;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Controls","block-visibility")},m.map(((e,l)=>(0,t.createElement)(ye,{key:l,control:e,toggleControls:h})))),0!==y.length&&(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Integrations","block-visibility")},y.map(((e,l)=>(0,t.createElement)(ye,{key:l,control:e,toggleControls:h})))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(pe,e({canResetAll:E},l)),(0,t.createElement)(be,{modalOpen:r,onClose:a,setModalOpen:s}),(0,t.createElement)(u.MenuItem,{onClick:()=>f("enable",!_)},_?(0,o.__)("Disable all","block-visibility"):(0,o.__)("Enable all","block-visibility")),(0,t.createElement)(u.MenuItem,{"aria-disabled":!E,variant:"tertiary",onClick:()=>{E&&(function(){const e=(0,i.assign)({...b},{controls:{}});v(e)}(),(0,ne.speak)((0,o.__)("All controls reset","block-visibility"),"assertive"))}},(0,o.__)("Reset all","block-visibility"))))}));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"control-set__header section-header main"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("h2",null,k),S),(0,t.createElement)("div",{className:"section-header__toolbar"},(0,t.createElement)(u.Button,{disabled:0===c.length&&p.length<=1,icon:re,isSmall:!0,label:(0,o.__)("Remove","block-visibility"),onClick:()=>{v(b,!0)}}),(0,t.createElement)(u.Button,{disabled:0===c.length,icon:se,isSmall:!0,label:(0,o.__)("Duplicate","block-visibility"),onClick:()=>function(){const e=Math.max(...p.map((e=>e.id)),0)+1,t={...b,id:e};v(t)}(),style:{padding:0}}),w)),r&&(0,t.createElement)(ve,e({modalOpen:r,setModalOpen:s,toggleControls:h,coreControls:m,integrationControls:y},l)))}function ye(e){const{control:l,toggleControls:i}=e;return(0,t.createElement)(u.MenuItem,{key:l.attributeSlug,icon:l.isActive&&ce,label:(0,o.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". (0,o.__)("Toggle %s"),l.label),onClick:()=>{i(l),(0,ne.speak)((0,o.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". (0,o.__)("%s toggled"),l.label),"assertive")}},l.icon&&(0,t.createElement)(W,{className:"control-branding-icon",icon:l.icon}),l.label)}const he=[{type:"text",label:(0,o.__)("Text","block-visibility")},{type:"textarea",label:(0,o.__)("Text Area","block-visibility")},{type:"number",label:(0,o.__)("Number","block-visibility"),options:"numeric"},{type:"range",label:(0,o.__)("Range","block-visibility"),options:"numeric"},{type:"email",label:(0,o.__)("Email","block-visibility")},{type:"url",label:(0,o.__)("Url","block-visibility")},{type:"password",label:(0,o.__)("Password","block-visibility")},{type:"image",label:(0,o.__)("Image","block-visibility")},{type:"file",label:(0,o.__)("File","block-visibility")},{type:"wysiwyg",label:(0,o.__)("Wysiwyg Editor","block-visibility")},{type:"oembed",label:(0,o.__)("oEmbed","block-visibility")},{type:"select",label:(0,o.__)("Select","block-visibility")},{type:"checkbox",label:(0,o.__)("Checkbox","block-visibility")},{type:"radio",label:(0,o.__)("Radio Button","block-visibility")},{type:"button_group",label:(0,o.__)("Button Group","block-visibility")},{type:"true_false",label:(0,o.__)("True / False","block-visibility"),options:"boolean"},{type:"link",label:(0,o.__)("Link","block-visibility")},{type:"post_object",label:(0,o.__)("Post Object","block-visibility")},{type:"page_link",label:(0,o.__)("Page Link","block-visibility")},{type:"relationship",label:(0,o.__)("Relationship","block-visibility")},{type:"taxonomy",label:(0,o.__)("Taxonomy","block-visibility")},{type:"user",label:(0,o.__)("User","block-visibility")},{type:"google_map",label:(0,o.__)("Google Map","block-visibility")},{type:"date_picker",label:(0,o.__)("Date Picker","block-visibility"),options:"dateTime"},{type:"date_time_picker",label:(0,o.__)("Date Time Picker","block-visibility"),options:"dateTime"},{type:"time_picker",label:(0,o.__)("Time Picker","block-visibility"),options:"dateTime"},{type:"color_picker",label:(0,o.__)("Color Picker","block-visibility")},{type:"message",label:(0,o.__)("Message","block-visibility")},{type:"accordion",label:(0,o.__)("Accordion","block-visibility")},{type:"tab",label:(0,o.__)("Tab","block-visibility")},{type:"group",label:(0,o.__)("Group","block-visibility")},{type:"repeater",label:(0,o.__)("Repeater","block-visibility")},{type:"flexible_content",label:(0,o.__)("Flexible Content","block-visibility")},{type:"clone",label:(0,o.__)("Clone","block-visibility")}];function fe(e){var t;const l=null!==(t=e?.integrations?.acf?.fields)&&void 0!==t?t:[],i=[];return 0!==l.length&&l.forEach((e=>{var t,l;const n=null!==(t=e?.key)&&void 0!==t?t:"",a=null!==(l=e?.fields)&&void 0!==l?l:[];0!==a.length&&a.forEach((e=>{var t,l;const a=null!==(t=e?.key)&&void 0!==t?t:"",r=null!==(l=e?.label)&&void 0!==l?l:"";i.push({value:a,label:r,group:n,help:"Field type: "+he.filter((t=>t?.type===e?.type))[0]?.label,helpPosition:"top",fields:[{type:"operatorField",valueType:"select",options:ge(e),placeholder:(0,o.__)("Select Condition…","block-visibility")},{type:"valueField",valueType:"text",placeholder:(0,o.__)("Enter Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","greaterThan","greaterThanEqual","lessThan","lessThanEqual","contains","notContain"]}]},{type:"subField",name:"fieldLocation",valueType:"select",options:[{value:"post",label:(0,o.__)("The current post","block-visibility"),disableValue:!0},{value:"user",label:(0,o.__)("The current user","block-visibility"),disableValue:!0},{value:"option",label:(0,o.__)("An options page","block-visibility")}],label:(0,o.__)("This field is associated with","block-visibility"),placeholder:(0,o.__)("Select…","block-visibility")}]})}))})),i}function ge(e){const t=he.filter((t=>t?.type===e?.type))[0]?.options,l=[{value:"notEmpty",label:(0,o.__)("True","block-visibility"),disableValue:!0},{value:"empty",label:(0,o.__)("False","block-visibility"),disableValue:!0}],i=[{value:"notEmpty",label:(0,o.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,o.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,o.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,o.__)("Value is not equal to","block-visibility")},{value:"greaterThan",label:(0,o.__)("Value is greater than","block-visibility")},{value:"greaterThanEqual",label:(0,o.__)("Value is greater or equal to","block-visibility")},{value:"lessThan",label:(0,o.__)("Value is less than","block-visibility")},{value:"lessThanEqual",label:(0,o.__)("Value is less than or equal to","block-visibility")}],n=[{value:"notEmpty",label:(0,o.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,o.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,o.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,o.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,o.__)("Value contains","block-visibility")},{value:"notContain",label:(0,o.__)("Value does not contain","block-visibility")}];return"boolean"===t?l:"dateTime"===t||"numeric"===t?i:n}function _e(e){const{value:l,onDateChange:i,setPopoverOpen:o,includeTime:n}=e,a=(0,X.__experimentalGetSettings)(),r=/a(?!\\)/i.test(a.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",onClose:o.bind(null,!1)},[n&&(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{i(e),o(!1)},is12Hour:r}),!n&&(0,t.createElement)(u.DatePicker,{currentDate:l,onChange:e=>{i(e),o(!1)},is12Hour:r})])}var ke=(0,t.createElement)($.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)($.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})),Ee=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.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"}));function Se(e){const{value:l,setPopoverOpen:i,onClearDateTime:n,includeTime:a}=e;let r=a?(0,o.__)("Select Date and Time…","block-visibility"):(0,o.__)("Select Date…","block-visibility");const s=(0,X.__experimentalGetSettings)();if(l){const e=a?`${s.formats.date} ${s.formats.time}`:`${s.formats.date}`;r=(0,X.format)(e,l)}return(0,t.createElement)("div",{className:b()("date-time__date-time-field",{"has-value":l})},(0,t.createElement)(u.Button,{icon:ke,title:(0,o.__)("Select date/time","block-visibility"),onClick:()=>i((e=>!e)),isLink:!0},(0,t.createElement)("span",null,r)),l&&(0,t.createElement)(u.Button,{icon:Ee,className:"clear-date-time",title:(0,o.__)("Clear date/time","block-visibility"),onClick:()=>n("")}))}function we(e){const{value:l,onChange:i,includeTime:o,help:n}=e,[a,r]=(0,t.useState)(!1);return(0,t.createElement)("div",{className:"block-visibility__date-time"},(0,t.createElement)(Se,{value:l,setPopoverOpen:r,onClearDateTime:()=>i(""),includeTime:o}),a&&(0,t.createElement)(_e,{value:l,onDateChange:e=>i(e),setPopoverOpen:r,includeTime:o}),n&&(0,t.createElement)("div",{className:"control-fields-item__help for-date-time-component"},n))}var Ce=(0,t.createElement)($.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)($.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function Te(e){const{message:l,subMessage:i,link:n,position:a}=e,r=null!=a?a:"middle left";return(0,t.createElement)("div",{className:"information-popover"},(0,t.createElement)(u.DropdownMenu,{label:(0,o.__)("More Information","block-visibility"),icon:Ce,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:r,noArrow:!1}},(()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,l),i&&(0,t.createElement)("p",null,i),n&&(0,t.createElement)(u.ExternalLink,{href:n},(0,o.__)("Learn More","block-visibility"))))))}function Oe(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function Fe(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,i)}return l}function Pe(e){for(var t=1;te.length)&&(t=e.length);for(var l=0,i=new Array(t);l=0||(o[l]=e[l]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(o[l]=e[l])}return o}var Re=l(196),Me=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Ie(e,t){for(var l=0;l0?Ze(nt,--it):0,tt--,10===ot&&(tt=1,et--),ot}function ct(){return ot=it2||bt(ot)>3?"":" "}function ft(e,t){for(;--t&&ct()&&!(ot<48||ot>102||ot>57&&ot<65||ot>70&&ot<97););return pt(e,dt()+(t<6&&32==ut()&&32==ct()))}function gt(e){for(;ct();)switch(ot){case e:return it;case 34:case 39:34!==e&&39!==e&>(ot);break;case 40:41===e&>(e);break;case 92:ct()}return it}function _t(e,t){for(;ct()&&e+ot!==57&&(e+ot!==84||47!==ut()););return"/*"+pt(t,it-1)+"*"+ze(47===e?e:ct())}function kt(e){for(;!bt(ut());)ct();return pt(e,it)}var Et="-ms-",St="-moz-",wt="-webkit-",Ct="comm",Tt="rule",Ot="decl",Ft="@keyframes";function Pt(e,t){for(var l="",i=Ke(e),o=0;o0&&Xe(S)-d&&Je(b>32?Mt(S+";",i,l,d-1):Mt(We(S," ","")+";",i,l,d-2),s);break;case 59:S+=";";default:if(Je(E=Vt(S,t,l,c,u,o,r,g,_=[],k=[],d),n),123===f)if(0===u)At(S,t,E,E,_,n,d,r,k);else switch(99===p&&110===Ze(S,3)?100:p){case 100:case 109:case 115:At(e,E,E,i&&Je(Vt(e,E,E,0,0,o,r,g,o,_=[],d),k),o,k,d,r,i?_:k);break;default:At(S,E,E,E,[""],k,0,r,k)}}c=u=b=0,m=h=1,g=S="",d=a;break;case 58:d=1+Xe(S),b=v;default:if(m<1)if(123==f)--m;else if(125==f&&0==m++&&125==st())continue;switch(S+=ze(f),f*m){case 38:h=u>0?1:(S+="\f",-1);break;case 44:r[c++]=(Xe(S)-1)*h,h=1;break;case 64:45===ut()&&(S+=yt(ct())),p=ut(),u=d=Xe(g=S+=kt(dt())),f++;break;case 45:45===v&&2==Xe(S)&&(m=0)}}return n}function Vt(e,t,l,i,o,n,a,r,s,c,u){for(var d=o-1,p=0===o?n:[""],b=Ke(p),v=0,m=0,y=0;v0?p[h]+" "+f:We(f,/&\f/g,p[h])))&&(s[y++]=g);return at(e,t,l,0===o?Tt:r,s,c,u)}function Rt(e,t,l){return at(e,t,l,Ct,ze(ot),Ye(e,2,-2),0)}function Mt(e,t,l,i){return at(e,t,l,Ot,Ye(e,0,i),Ye(e,i+1,-1),i)}var It=function(e,t,l){for(var i=0,o=0;i=o,o=ut(),38===i&&12===o&&(t[l]=1),!bt(o);)ct();return pt(e,it)},Dt=new WeakMap,Lt=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,l=e.parent,i=e.column===l.column&&e.line===l.line;"rule"!==l.type;)if(!(l=l.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Dt.get(l))&&!i){Dt.set(e,!0);for(var o=[],n=function(e,t){return mt(function(e,t){var l=-1,i=44;do{switch(bt(i)){case 0:38===i&&12===ut()&&(t[l]=1),e[l]+=It(it-1,t,l);break;case 2:e[l]+=yt(i);break;case 4:if(44===i){e[++l]=58===ut()?"&\f":"",t[l]=e[l].length;break}default:e[l]+=ze(i)}}while(i=ct());return e}(vt(e),t))}(t,o),a=l.props,r=0,s=0;r6)switch(Ze(e,t+1)){case 109:if(45!==Ze(e,t+4))break;case 102:return We(e,/(.+:)(.+)-([^]+)/,"$1"+wt+"$2-$3$1"+St+(108==Ze(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Qe(e,"stretch")?Bt(We(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Ze(e,t+1))break;case 6444:switch(Ze(e,Xe(e)-3-(~Qe(e,"!important")&&10))){case 107:return We(e,":",":"+wt)+e;case 101:return We(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+wt+(45===Ze(e,14)?"inline-":"")+"box$3$1"+wt+"$2$3$1"+Et+"$2box$3")+e}break;case 5936:switch(Ze(e,t+11)){case 114:return wt+e+Et+We(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return wt+e+Et+We(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return wt+e+Et+We(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return wt+e+Et+e+e}return e}var Ut=[function(e,t,l,i){if(e.length>-1&&!e.return)switch(e.type){case Ot:e.return=Bt(e.value,e.length);break;case Ft:return Pt([rt(e,{value:We(e.value,"@","@"+wt)})],i);case Tt:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Pt([rt(e,{props:[We(t,/:(read-\w+)/,":"+St+"$1")]})],i);case"::placeholder":return Pt([rt(e,{props:[We(t,/:(plac\w+)/,":"+wt+"input-$1")]}),rt(e,{props:[We(t,/:(plac\w+)/,":"+St+"$1")]}),rt(e,{props:[We(t,/:(plac\w+)/,Et+"input-$1")]})],i)}return""}))}}],jt=function(e){var t=e.key;if("css"===t){var l=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(l,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,o,n=e.stylisPlugins||Ut,a={},r=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),l=1;l=4;++i,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),l=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&l)+(59797*(l>>>16)<<16);switch(o){case 3:l^=(255&e.charCodeAt(i+2))<<16;case 2:l^=(255&e.charCodeAt(i+1))<<8;case 1:l=1540483477*(65535&(l^=255&e.charCodeAt(i)))+(59797*(l>>>16)<<16)}return(((l=1540483477*(65535&(l^=l>>>13))+(59797*(l>>>16)<<16))^l>>>15)>>>0).toString(36)},$t={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Gt=/[A-Z]|^ms/g,Wt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Qt=function(e){return 45===e.charCodeAt(1)},Zt=function(e){return null!=e&&"boolean"!=typeof e},Yt=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Qt(l=e)?l:l.replace(Gt,"-$&").toLowerCase()),t[e];var l}}(),Xt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Wt,(function(e,t,l){return Jt={name:t,styles:l,next:Jt},t}))}return 1===$t[e]||Qt(e)||"number"!=typeof t||0===t?t:t+"px"};function Kt(e,t,l){if(null==l)return"";if(void 0!==l.__emotion_styles)return l;switch(typeof l){case"boolean":return"";case"object":if(1===l.anim)return Jt={name:l.name,styles:l.styles,next:Jt},l.name;if(void 0!==l.styles){var i=l.next;if(void 0!==i)for(;void 0!==i;)Jt={name:i.name,styles:i.styles,next:Jt},i=i.next;return l.styles+";"}return function(e,t,l){var i="";if(Array.isArray(l))for(var o=0;oe.brand+"/"+e.version)).join(" "),fl):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const wl=Math.round;function Cl(e){return _l(e)?e:e.contextElement}const Tl={x:1,y:1};function Ol(e){const t=Cl(e);if(!gl(t))return Tl;const l=t.getBoundingClientRect(),{width:i,height:o,fallback:n}=function(e){const t=ml(e);let l=parseFloat(t.width),i=parseFloat(t.height);const o=gl(e),n=o?e.offsetWidth:l,a=o?e.offsetHeight:i,r=wl(l)!==n||wl(i)!==a;return r&&(l=n,i=a),{width:l,height:i,fallback:r}}(t);let a=(n?wl(l.width):l.width)/i,r=(n?wl(l.height):l.height)/o;return a&&Number.isFinite(a)||(a=1),r&&Number.isFinite(r)||(r=1),{x:a,y:r}}function Fl(e,t,l,i){var o,n;void 0===t&&(t=!1),void 0===l&&(l=!1);const a=e.getBoundingClientRect(),r=Cl(e);let s=Tl;t&&(i?_l(i)&&(s=Ol(i)):s=Ol(e));const c=r?vl(r):window,u=Sl()&&l;let d=(a.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/s.x,p=(a.top+(u&&(null==(n=c.visualViewport)?void 0:n.offsetTop)||0))/s.y,b=a.width/s.x,v=a.height/s.y;if(r){const e=vl(r),t=i&&_l(i)?vl(i):i;let l=e.frameElement;for(;l&&i&&t!==e;){const e=Ol(l),t=l.getBoundingClientRect(),i=getComputedStyle(l);t.x+=(l.clientLeft+parseFloat(i.paddingLeft))*e.x,t.y+=(l.clientTop+parseFloat(i.paddingTop))*e.y,d*=e.x,p*=e.y,b*=e.x,v*=e.y,d+=t.x,p+=t.y,l=vl(l).frameElement}}return m={width:b,height:v,x:d,y:p},{...m,top:m.y,left:m.x,right:m.x+m.width,bottom:m.y+m.height};var m}function Pl(e){if("html"===hl(e))return e;const t=e.assignedSlot||e.parentNode||kl(e)&&e.host||function(e){return((yl(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return kl(t)?t.host:t}function Nl(e){const t=Pl(e);return function(e){return["html","body","#document"].includes(hl(e))}(t)?t.ownerDocument.body:gl(t)&&El(t)?t:Nl(t)}function xl(e,t){var l;void 0===t&&(t=[]);const i=Nl(e),o=i===(null==(l=e.ownerDocument)?void 0:l.body),n=vl(i);return o?t.concat(n,n.visualViewport||[],El(i)?i:[]):t.concat(i,xl(i))}var Al=Re.useLayoutEffect,Vl=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Rl=function(){};function Ml(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Il(e,t){for(var l=arguments.length,i=new Array(l>2?l-2:0),o=2;o-1}function Ul(e){return Bl(e)?window.pageYOffset:e.scrollTop}function jl(e,t){Bl(e)?window.scrollTo(0,t):e.scrollTop=t}function ql(e,t){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Rl,o=Ul(e),n=t-o,a=0;!function t(){var r,s=(r=a+=10,n*((r=r/l-1)*r*r+1)+o);jl(e,s),al.bottom?jl(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):i.top-o=v)return{placement:"bottom",maxHeight:t};if(w>=v&&!a)return n&&ql(s,C,O),{placement:"bottom",maxHeight:t};if(!a&&w>=i||a&&E>=i)return n&&ql(s,C,O),{placement:"bottom",maxHeight:a?E-g:w-g};if("auto"===o||a){var F=t,P=a?k:S;return P>=i&&(F=Math.min(P-g-r,t)),{placement:"top",maxHeight:F}}if("bottom"===o)return n&&jl(s,C),{placement:"bottom",maxHeight:t};break;case"top":if(k>=v)return{placement:"top",maxHeight:t};if(S>=v&&!a)return n&&ql(s,T,O),{placement:"top",maxHeight:t};if(!a&&S>=i||a&&k>=i){var N=t;return(!a&&S>=i||a&&k>=i)&&(N=a?k-_:S-_),n&&ql(s,T,O),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}({maxHeight:i,menuEl:e,minHeight:l,placement:o,shouldScroll:a&&!t,isFixedPosition:t,controlHeight:y});p(r.maxHeight),m(r.placement),null==s||s(r.placement)}}),[i,o,n,a,l,s,y]),t({ref:c,placerProps:Pe(Pe({},e),{},{placement:v||Kl(o),maxHeight:d})})},ti=function(e,t){var l=e.theme,i=l.spacing.baseUnit,o=l.colors;return Pe({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},li=ti,ii=ti,oi=function(t){var l=t.children,i=t.innerProps;return dl("div",e({},Hl(t,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),l)};oi.defaultProps={children:"No options"};var ni=function(t){var l=t.children,i=t.innerProps;return dl("div",e({},Hl(t,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),l)};ni.defaultProps={children:"Loading..."};var ai,ri,si,ci=["size"],ui={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},di=function(t){var l=t.size,i=Ve(t,ci);return dl("svg",e({height:l,width:l,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ui},i))},pi=function(t){return dl(di,e({size:20},t),dl("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},bi=function(t){return dl(di,e({size:20},t),dl("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},vi=function(e,t){var l=e.isFocused,i=e.theme,o=i.spacing.baseUnit,n=i.colors;return Pe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:l?n.neutral60:n.neutral20,padding:2*o,":hover":{color:l?n.neutral80:n.neutral40}})},mi=vi,yi=vi,hi=function(){var e=pl.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(ai||(ri=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],si||(si=ri.slice(0)),ai=Object.freeze(Object.defineProperties(ri,{raw:{value:Object.freeze(si)}})))),fi=function(e){var t=e.delay,l=e.offset;return dl("span",{css:pl({animation:"".concat(hi," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:l?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},gi=function(t){var l=t.innerProps,i=t.isRtl;return dl("div",e({},Hl(t,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),l),dl(fi,{delay:0,offset:i}),dl(fi,{delay:160,offset:!0}),dl(fi,{delay:320,offset:!i}))};gi.defaultProps={size:4};var _i=["data"],ki=["innerRef","isDisabled","isHidden","inputClassName"],Ei={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Si={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Pe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Ei)},wi=function(e){return Pe({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Ei)},Ci=function(e){var t=e.children,l=e.innerProps;return dl("div",l,t)},Ti={ClearIndicator:function(t){var l=t.children,i=t.innerProps;return dl("div",e({},Hl(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),l||dl(pi,null))},Control:function(t){var l=t.children,i=t.isDisabled,o=t.isFocused,n=t.innerRef,a=t.innerProps,r=t.menuIsOpen;return dl("div",e({ref:n},Hl(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":o,"control--menu-is-open":r}),a),l)},DropdownIndicator:function(t){var l=t.children,i=t.innerProps;return dl("div",e({},Hl(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),l||dl(bi,null))},DownChevron:bi,CrossIcon:pi,Group:function(t){var l=t.children,i=t.cx,o=t.getStyles,n=t.getClassNames,a=t.Heading,r=t.headingProps,s=t.innerProps,c=t.label,u=t.theme,d=t.selectProps;return dl("div",e({},Hl(t,"group",{group:!0}),s),dl(a,e({},r,{selectProps:d,theme:u,getStyles:o,getClassNames:n,cx:i}),c),dl("div",null,l))},GroupHeading:function(t){var l=Ll(t);l.data;var i=Ve(l,_i);return dl("div",e({},Hl(t,"groupHeading",{"group-heading":!0}),i))},IndicatorsContainer:function(t){var l=t.children,i=t.innerProps;return dl("div",e({},Hl(t,"indicatorsContainer",{indicators:!0}),i),l)},IndicatorSeparator:function(t){var l=t.innerProps;return dl("span",e({},l,Hl(t,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(t){var l=t.cx,i=t.value,o=Ll(t),n=o.innerRef,a=o.isDisabled,r=o.isHidden,s=o.inputClassName,c=Ve(o,ki);return dl("div",e({},Hl(t,"input",{"input-container":!0}),{"data-value":i||""}),dl("input",e({className:l({input:!0},s),ref:n,style:wi(r),disabled:a},c)))},LoadingIndicator:gi,Menu:function(t){var l=t.children,i=t.innerRef,o=t.innerProps;return dl("div",e({},Hl(t,"menu",{menu:!0}),{ref:i},o),l)},MenuList:function(t){var l=t.children,i=t.innerProps,o=t.innerRef,n=t.isMulti;return dl("div",e({},Hl(t,"menuList",{"menu-list":!0,"menu-list--is-multi":n}),{ref:o},i),l)},MenuPortal:function(t){var l=t.appendTo,i=t.children,o=t.controlElement,n=t.innerProps,a=t.menuPlacement,r=t.menuPosition,s=(0,Re.useRef)(null),c=(0,Re.useRef)(null),u=Ae((0,Re.useState)(Kl(a)),2),d=u[0],p=u[1],b=(0,Re.useMemo)((function(){return{setPortalPlacement:p}}),[]),v=Ae((0,Re.useState)(null),2),m=v[0],y=v[1],h=(0,Re.useCallback)((function(){if(o){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(o),t="fixed"===r?0:window.pageYOffset,l=e[d]+t;l===(null==m?void 0:m.offset)&&e.left===(null==m?void 0:m.rect.left)&&e.width===(null==m?void 0:m.rect.width)||y({offset:l,rect:e})}}),[o,r,d,null==m?void 0:m.offset,null==m?void 0:m.rect.left,null==m?void 0:m.rect.width]);Al((function(){h()}),[h]);var f=(0,Re.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),o&&s.current&&(c.current=function(e,t,l,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:n=!0,elementResize:a=!0,animationFrame:r=!1}=i,s=o&&!r,c=s||n?[..._l(e)?xl(e):e.contextElement?xl(e.contextElement):[],...xl(t)]:[];c.forEach((e=>{s&&e.addEventListener("scroll",l,{passive:!0}),n&&e.addEventListener("resize",l)}));let u,d=null;a&&(d=new ResizeObserver((()=>{l()})),_l(e)&&!r&&d.observe(e),_l(e)||!e.contextElement||r||d.observe(e.contextElement),d.observe(t));let p=r?Fl(e):null;return r&&function t(){const i=Fl(e);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||l(),p=i,u=requestAnimationFrame(t)}(),l(),()=>{var e;c.forEach((e=>{s&&e.removeEventListener("scroll",l),n&&e.removeEventListener("resize",l)})),null==(e=d)||e.disconnect(),d=null,r&&cancelAnimationFrame(u)}}(o,s.current,h,{elementResize:"ResizeObserver"in window}))}),[o,h]);Al((function(){f()}),[f]);var g=(0,Re.useCallback)((function(e){s.current=e,f()}),[f]);if(!l&&"fixed"!==r||!m)return null;var _=dl("div",e({ref:g},Hl(Pe(Pe({},t),{},{offset:m.offset,position:r,rect:m.rect}),"menuPortal",{"menu-portal":!0}),n),i);return dl(Jl.Provider,{value:b},l?(0,bl.createPortal)(_,l):_)},LoadingMessage:ni,NoOptionsMessage:oi,MultiValue:function(e){var t=e.children,l=e.components,i=e.data,o=e.innerProps,n=e.isDisabled,a=e.removeProps,r=e.selectProps,s=l.Container,c=l.Label,u=l.Remove;return dl(s,{data:i,innerProps:Pe(Pe({},Hl(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":n})),o),selectProps:r},dl(c,{data:i,innerProps:Pe({},Hl(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:r},t),dl(u,{data:i,innerProps:Pe(Pe({},Hl(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:r}))},MultiValueContainer:Ci,MultiValueLabel:Ci,MultiValueRemove:function(t){var l=t.children,i=t.innerProps;return dl("div",e({role:"button"},i),l||dl(pi,{size:14}))},Option:function(t){var l=t.children,i=t.isDisabled,o=t.isFocused,n=t.isSelected,a=t.innerRef,r=t.innerProps;return dl("div",e({},Hl(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":o,"option--is-selected":n}),{ref:a,"aria-disabled":i},r),l)},Placeholder:function(t){var l=t.children,i=t.innerProps;return dl("div",e({},Hl(t,"placeholder",{placeholder:!0}),i),l)},SelectContainer:function(t){var l=t.children,i=t.innerProps,o=t.isDisabled,n=t.isRtl;return dl("div",e({},Hl(t,"container",{"--is-disabled":o,"--is-rtl":n}),i),l)},SingleValue:function(t){var l=t.children,i=t.isDisabled,o=t.innerProps;return dl("div",e({},Hl(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),o),l)},ValueContainer:function(t){var l=t.children,i=t.innerProps,o=t.isMulti,n=t.hasValue;return dl("div",e({},Hl(t,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":n}),i),l)}},Oi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Fi(e,t){if(e.length!==t.length)return!1;for(var l=0;l1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(i,n?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,l=e.focused,i=e.options,o=e.label,n=void 0===o?"":o,a=e.selectValue,r=e.isDisabled,s=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(n," focused, ").concat(c(a,l),".");if("menu"===t){var u=r?" disabled":"",d="".concat(s?"selected":"focused").concat(u);return"option ".concat(n," ").concat(d,", ").concat(c(i,l),".")}return""},onFilter:function(e){var t=e.inputValue,l=e.resultsMessage;return"".concat(l).concat(t?" for search term "+t:"",".")}},Ai=function(e){var t=e.ariaSelection,l=e.focusedOption,i=e.focusedValue,o=e.focusableOptions,n=e.isFocused,a=e.selectValue,r=e.selectProps,s=e.id,c=r.ariaLiveMessages,u=r.getOptionLabel,d=r.inputValue,p=r.isMulti,b=r.isOptionDisabled,v=r.isSearchable,m=r.menuIsOpen,y=r.options,h=r.screenReaderStatus,f=r.tabSelectsValue,g=r["aria-label"],_=r["aria-live"],k=(0,Re.useMemo)((function(){return Pe(Pe({},xi),c||{})}),[c]),E=(0,Re.useMemo)((function(){var e,l="";if(t&&k.onChange){var i=t.option,o=t.options,n=t.removedValue,r=t.removedValues,s=t.value,c=n||i||(e=s,Array.isArray(e)?null:e),d=c?u(c):"",p=o||r||void 0,v=p?p.map(u):[],m=Pe({isDisabled:c&&b(c,a),label:d,labels:v},t);l=k.onChange(m)}return l}),[t,k,b,a,u]),S=(0,Re.useMemo)((function(){var e="",t=l||i,n=!!(l&&a&&a.includes(l));if(t&&k.onFocus){var r={focused:t,label:u(t),isDisabled:b(t,a),isSelected:n,options:o,context:t===l?"menu":"value",selectValue:a};e=k.onFocus(r)}return e}),[l,i,u,b,k,o,a]),w=(0,Re.useMemo)((function(){var e="";if(m&&y.length&&k.onFilter){var t=h({count:o.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[o,d,m,k,y,h]),C=(0,Re.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":m?"menu":"input";e=k.guidance({"aria-label":g,context:t,isDisabled:l&&b(l,a),isMulti:p,isSearchable:v,tabSelectsValue:f})}return e}),[g,l,i,p,b,v,m,k,a,f]),T="".concat(S," ").concat(w," ").concat(C),O=dl(Re.Fragment,null,dl("span",{id:"aria-selection"},E),dl("span",{id:"aria-context"},T)),F="initial-input-focus"===(null==t?void 0:t.action);return dl(Re.Fragment,null,dl(Ni,{id:s},F&&O),dl(Ni,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},n&&!F&&O))},Vi=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Ri=new RegExp("["+Vi.map((function(e){return e.letters})).join("")+"]","g"),Mi={},Ii=0;Ii1?t-1:0),i=1;i0,m=d-p-u,y=!1;m>t&&a.current&&(i&&i(e),a.current=!1),v&&r.current&&(n&&n(e),r.current=!1),v&&t>m?(l&&!a.current&&l(e),b.scrollTop=d,y=!0,a.current=!0):!v&&-t>u&&(o&&!r.current&&o(e),b.scrollTop=0,y=!0,r.current=!0),y&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[l,i,o,n]),d=(0,Re.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,Re.useCallback)((function(e){s.current=e.changedTouches[0].clientY}),[]),b=(0,Re.useCallback)((function(e){var t=s.current-e.changedTouches[0].clientY;u(e,t)}),[u]),v=(0,Re.useCallback)((function(e){if(e){var t=!!Zl&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",b,t)}}),[b,p,d]),m=(0,Re.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",b,!1))}),[b,p,d]);return(0,Re.useEffect)((function(){if(t){var e=c.current;return v(e),function(){m(e)}}}),[t,v,m]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),n=function(e){var t=e.isEnabled,l=e.accountForScrollbars,i=void 0===l||l,o=(0,Re.useRef)({}),n=(0,Re.useRef)(null),a=(0,Re.useCallback)((function(e){if(Xi){var t=document.body,l=t&&t.style;if(i&&$i.forEach((function(e){var t=l&&l[e];o.current[e]=t})),i&&Ki<1){var n=parseInt(o.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,r=window.innerWidth-a+n||0;Object.keys(Gi).forEach((function(e){var t=Gi[e];l&&(l[e]=t)})),l&&(l.paddingRight="".concat(r,"px"))}t&&Yi()&&(t.addEventListener("touchmove",Wi,Ji),e&&(e.addEventListener("touchstart",Zi,Ji),e.addEventListener("touchmove",Qi,Ji))),Ki+=1}}),[i]),r=(0,Re.useCallback)((function(e){if(Xi){var t=document.body,l=t&&t.style;Ki=Math.max(Ki-1,0),i&&Ki<1&&$i.forEach((function(e){var t=o.current[e];l&&(l[e]=t)})),t&&Yi()&&(t.removeEventListener("touchmove",Wi,Ji),e&&(e.removeEventListener("touchstart",Zi,Ji),e.removeEventListener("touchmove",Qi,Ji)))}}),[i]);return(0,Re.useEffect)((function(){if(t){var e=n.current;return a(e),function(){r(e)}}}),[t,a,r]),function(e){n.current=e}}({isEnabled:l});return dl(Re.Fragment,null,l&&dl("div",{onClick:eo,css:to}),t((function(e){o(e),n(e)})))}var io={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},oo=function(e){var t=e.name,l=e.onFocus;return dl("input",{required:!0,name:t,tabIndex:-1,onFocus:l,css:io,value:"",onChange:function(){}})},no={clearIndicator:yi,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var l=e.isDisabled,i=e.isFocused,o=e.theme,n=o.colors,a=o.borderRadius;return Pe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:l?n.neutral5:n.neutral0,borderColor:l?n.neutral10:i?n.primary:n.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(n.primary):void 0,"&:hover":{borderColor:i?n.primary:n.neutral30}})},dropdownIndicator:mi,group:function(e,t){var l=e.theme.spacing;return t?{}:{paddingBottom:2*l.baseUnit,paddingTop:2*l.baseUnit}},groupHeading:function(e,t){var l=e.theme,i=l.colors,o=l.spacing;return Pe({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var l=e.isDisabled,i=e.theme,o=i.spacing.baseUnit,n=i.colors;return Pe({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:l?n.neutral10:n.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var l=e.isDisabled,i=e.value,o=e.theme,n=o.spacing,a=o.colors;return Pe(Pe({visibility:l?"hidden":"visible",transform:i?"translateZ(0)":""},Si),t?{}:{margin:n.baseUnit/2,paddingBottom:n.baseUnit/2,paddingTop:n.baseUnit/2,color:a.neutral80})},loadingIndicator:function(e,t){var l=e.isFocused,i=e.size,o=e.theme,n=o.colors,a=o.spacing.baseUnit;return Pe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:l?n.neutral60:n.neutral20,padding:2*a})},loadingMessage:ii,menu:function(e,t){var l,i=e.placement,o=e.theme,n=o.borderRadius,a=o.spacing,r=o.colors;return Pe((Oe(l={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),Oe(l,"position","absolute"),Oe(l,"width","100%"),Oe(l,"zIndex",1),l),t?{}:{backgroundColor:r.neutral0,borderRadius:n,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},menuList:function(e,t){var l=e.maxHeight,i=e.theme.spacing.baseUnit;return Pe({maxHeight:l,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:i,paddingTop:i})},menuPortal:function(e){var t=e.rect,l=e.offset,i=e.position;return{left:t.left,position:i,top:l,width:t.width,zIndex:1}},multiValue:function(e,t){var l=e.theme,i=l.spacing,o=l.borderRadius,n=l.colors;return Pe({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:n.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var l=e.theme,i=l.borderRadius,o=l.colors,n=e.cropWithEllipsis;return Pe({overflow:"hidden",textOverflow:n||void 0===n?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var l=e.theme,i=l.spacing,o=l.borderRadius,n=l.colors,a=e.isFocused;return Pe({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?n.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:n.dangerLight,color:n.danger}})},noOptionsMessage:li,option:function(e,t){var l=e.isDisabled,i=e.isFocused,o=e.isSelected,n=e.theme,a=n.spacing,r=n.colors;return Pe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?r.primary:i?r.primary25:"transparent",color:l?r.neutral20:o?r.neutral0:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),":active":{backgroundColor:l?void 0:o?r.primary:r.primary50}})},placeholder:function(e,t){var l=e.theme,i=l.spacing,o=l.colors;return Pe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var l=e.isDisabled,i=e.theme,o=i.spacing,n=i.colors;return Pe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:l?n.neutral40:n.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var l=e.theme.spacing,i=e.isMulti,o=e.hasValue,n=e.selectProps.controlShouldRenderValue;return Pe({alignItems:"center",display:i&&o&&n?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(l.baseUnit/2,"px ").concat(2*l.baseUnit,"px")})}},ao={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},ro={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:$l(),captureMenuScroll:!$l(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var l=Pe({ignoreCase:!0,ignoreAccents:!0,stringify:ji,trim:!0,matchFrom:"any"},undefined),i=l.ignoreCase,o=l.ignoreAccents,n=l.stringify,a=l.trim,r=l.matchFrom,s=a?Ui(t):t,c=a?Ui(n(e)):n(e);return i&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=Bi(s),c=Hi(c)),"start"===r?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function so(e,t,l,i){return{type:"option",data:t,isDisabled:mo(e,t,l),isSelected:yo(e,t,l),label:bo(e,t),value:vo(e,t),index:i}}function co(e,t){return e.options.map((function(l,i){if("options"in l){var o=l.options.map((function(l,i){return so(e,l,t,i)})).filter((function(t){return po(e,t)}));return o.length>0?{type:"group",data:l,options:o,index:i}:void 0}var n=so(e,l,t,i);return po(e,n)?n:void 0})).filter(Yl)}function uo(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Ue(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function po(e,t){var l=e.inputValue,i=void 0===l?"":l,o=t.data,n=t.isSelected,a=t.label,r=t.value;return(!fo(e)||!n)&&ho(e,{label:a,value:r,data:o},i)}var bo=function(e,t){return e.getOptionLabel(t)},vo=function(e,t){return e.getOptionValue(t)};function mo(e,t,l){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,l)}function yo(e,t,l){if(l.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,l);var i=vo(e,t);return l.some((function(t){return vo(e,t)===i}))}function ho(e,t,l){return!e.filterOption||e.filterOption(t,l)}var fo=function(e){var t=e.hideSelectedOptions,l=e.isMulti;return void 0===t?l:t},go=1,_o=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&De(e,t)}(a,t);var l,i,o,n=Be(a);function a(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=n.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,l){var i=t.props,o=i.onChange,n=i.name;l.name=n,t.ariaOnChange(e,l),o(e,l)},t.setValue=function(e,l,i){var o=t.props,n=o.closeMenuOnSelect,a=o.isMulti,r=o.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:r}),n&&(t.setState({inputIsHiddenAfterUpdate:!a}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:l,option:i})},t.selectOption=function(e){var l=t.props,i=l.blurInputOnSelect,o=l.isMulti,n=l.name,a=t.state.selectValue,r=o&&t.isOptionSelected(e,a),s=t.isOptionDisabled(e,a);if(r){var c=t.getOptionValue(e);t.setValue(a.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(s)return void t.ariaOnChange(e,{action:"select-option",option:e,name:n});o?t.setValue([].concat(Ue(a),[e]),"select-option",e):t.setValue(e,"select-option")}i&&t.blurInput()},t.removeValue=function(e){var l=t.props.isMulti,i=t.state.selectValue,o=t.getOptionValue(e),n=i.filter((function(e){return t.getOptionValue(e)!==o})),a=Xl(l,n,n[0]||null);t.onChange(a,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(Xl(t.props.isMulti,[],null),{action:"clear",removedValues:e})},t.popValue=function(){var e=t.props.isMulti,l=t.state.selectValue,i=l[l.length-1],o=l.slice(0,l.length-1),n=Xl(e,o,o[0]||null);t.onChange(n,{action:"pop-value",removedValue:i})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,l=new Array(e),i=0;i5||n>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var l=t.props.inputValue,i=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(i,{action:"input-change",prevInputValue:l}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var l=t.props.inputValue;t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:l}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){t.blockOptionHover||t.state.focusedOption===e||t.setState({focusedOption:e})},t.shouldHideSelectedOptions=function(){return fo(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var l=t.props,i=l.isMulti,o=l.backspaceRemovesValue,n=l.escapeClearsValue,a=l.inputValue,r=l.isClearable,s=l.isDisabled,c=l.menuIsOpen,u=l.onKeyDown,d=l.tabSelectsValue,p=l.openMenuOnFocus,b=t.state,v=b.focusedOption,m=b.focusedValue,y=b.selectValue;if(!(s||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!i||a)return;t.focusValue("previous");break;case"ArrowRight":if(!i||a)return;t.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(m)t.removeValue(m);else{if(!o)return;i?t.popValue():r&&t.clearValue()}break;case"Tab":if(t.isComposing)return;if(e.shiftKey||!c||!d||!v||p&&t.isOptionSelected(v,y))return;t.selectOption(v);break;case"Enter":if(229===e.keyCode)break;if(c){if(!v)return;if(t.isComposing)return;t.selectOption(v);break}return;case"Escape":c?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:a}),t.onMenuClose()):r&&n&&t.clearValue();break;case" ":if(a)return;if(!c){t.openMenu("first");break}if(!v)return;t.selectOption(v);break;case"ArrowUp":c?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":c?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!c)return;t.focusOption("pageup");break;case"PageDown":if(!c)return;t.focusOption("pagedown");break;case"Home":if(!c)return;t.focusOption("first");break;case"End":if(!c)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++go),t.state.selectValue=Dl(e.value),e.menuIsOpen&&t.state.selectValue.length){var l=t.buildFocusableOptions(),i=l.indexOf(t.state.selectValue[0]);t.state.focusedOption=l[i]}return t}return l=a,i=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&zl(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,l=t.isDisabled,i=t.menuIsOpen,o=this.state.isFocused;(o&&!l&&e.isDisabled||o&&i&&!e.menuIsOpen)&&this.focusInput(),o&&l&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||l||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(zl(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,l=this.state,i=l.selectValue,o=l.isFocused,n=this.buildFocusableOptions(),a="first"===e?0:n.length-1;if(!this.props.isMulti){var r=n.indexOf(i[0]);r>-1&&(a=r)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:n[a]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,l=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=l.indexOf(i);i||(o=-1);var n=l.length-1,a=-1;if(l.length){switch(e){case"previous":a=0===o?0:-1===o?n:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,l=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var o=0,n=i.indexOf(l);l||(n=-1),"up"===e?o=n>0?n-1:i.length-1:"down"===e?o=(n+1)%i.length:"pageup"===e?(o=n-t)<0&&(o=0):"pagedown"===e?(o=n+t)>i.length-1&&(o=i.length-1):"last"===e&&(o=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(ao):Pe(Pe({},ao),this.props.theme):ao}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,l=this.getStyles,i=this.getClassNames,o=this.getValue,n=this.selectOption,a=this.setValue,r=this.props,s=r.isMulti,c=r.isRtl,u=r.options;return{clearValue:e,cx:t,getStyles:l,getClassNames:i,getValue:o,hasValue:this.hasValue(),isMulti:s,isRtl:c,options:u,selectOption:n,selectProps:r,setValue:a,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,l=e.isMulti;return void 0===t?l:t}},{key:"isOptionDisabled",value:function(e,t){return mo(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return yo(this.props,e,t)}},{key:"filterOption",value:function(e,t){return ho(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var l=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:l,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,l=t.isDisabled,i=t.isSearchable,o=t.inputId,n=t.inputValue,a=t.tabIndex,r=t.form,s=t.menuIsOpen,c=t.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,b=d.ariaSelection,v=this.commonProps,m=o||this.getElementId("input"),y=Pe(Pe(Pe({"aria-autocomplete":"list","aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox"},s&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==b?void 0:b.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?Re.createElement(u,e({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:l,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:r,type:"text",value:n},y)):Re.createElement(zi,e({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Rl,onFocus:this.onInputFocus,disabled:l,tabIndex:a,inputMode:"none",form:r,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,l=this.getComponents(),i=l.MultiValue,o=l.MultiValueContainer,n=l.MultiValueLabel,a=l.MultiValueRemove,r=l.SingleValue,s=l.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,b=u.isMulti,v=u.inputValue,m=u.placeholder,y=this.state,h=y.selectValue,f=y.focusedValue,g=y.isFocused;if(!this.hasValue()||!d)return v?null:Re.createElement(s,e({},c,{key:"placeholder",isDisabled:p,isFocused:g,innerProps:{id:this.getElementId("placeholder")}}),m);if(b)return h.map((function(l,r){var s=l===f,u="".concat(t.getOptionLabel(l),"-").concat(t.getOptionValue(l));return Re.createElement(i,e({},c,{components:{Container:o,Label:n,Remove:a},isFocused:s,isDisabled:p,key:u,index:r,removeProps:{onClick:function(){return t.removeValue(l)},onTouchEnd:function(){return t.removeValue(l)},onMouseDown:function(e){e.preventDefault()}},data:l}),t.formatOptionLabel(l,"value"))}));if(v)return null;var _=h[0];return Re.createElement(r,e({},c,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,l=this.commonProps,i=this.props,o=i.isDisabled,n=i.isLoading,a=this.state.isFocused;if(!this.isClearable()||!t||o||!this.hasValue()||n)return null;var r={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Re.createElement(t,e({},l,{innerProps:r,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,l=this.commonProps,i=this.props,o=i.isDisabled,n=i.isLoading,a=this.state.isFocused;return t&&n?Re.createElement(t,e({},l,{innerProps:{"aria-hidden":"true"},isDisabled:o,isFocused:a})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),l=t.DropdownIndicator,i=t.IndicatorSeparator;if(!l||!i)return null;var o=this.commonProps,n=this.props.isDisabled,a=this.state.isFocused;return Re.createElement(i,e({},o,{isDisabled:n,isFocused:a}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var l=this.commonProps,i=this.props.isDisabled,o=this.state.isFocused,n={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Re.createElement(t,e({},l,{innerProps:n,isDisabled:i,isFocused:o}))}},{key:"renderMenu",value:function(){var t=this,l=this.getComponents(),i=l.Group,o=l.GroupHeading,n=l.Menu,a=l.MenuList,r=l.MenuPortal,s=l.LoadingMessage,c=l.NoOptionsMessage,u=l.Option,d=this.commonProps,p=this.state.focusedOption,b=this.props,v=b.captureMenuScroll,m=b.inputValue,y=b.isLoading,h=b.loadingMessage,f=b.minMenuHeight,g=b.maxMenuHeight,_=b.menuIsOpen,k=b.menuPlacement,E=b.menuPosition,S=b.menuPortalTarget,w=b.menuShouldBlockScroll,C=b.menuShouldScrollIntoView,T=b.noOptionsMessage,O=b.onMenuScrollToTop,F=b.onMenuScrollToBottom;if(!_)return null;var P,N=function(l,i){var o=l.type,n=l.data,a=l.isDisabled,r=l.isSelected,s=l.label,c=l.value,b=p===n,v=a?void 0:function(){return t.onOptionHover(n)},m=a?void 0:function(){return t.selectOption(n)},y="".concat(t.getElementId("option"),"-").concat(i),h={id:y,onClick:m,onMouseMove:v,onMouseOver:v,tabIndex:-1};return Re.createElement(u,e({},d,{innerProps:h,data:n,isDisabled:a,isSelected:r,key:y,label:s,type:o,value:c,isFocused:b,innerRef:b?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(l.data,"menu"))};if(this.hasOptions())P=this.getCategorizedOptions().map((function(l){if("group"===l.type){var n=l.data,a=l.options,r=l.index,s="".concat(t.getElementId("group"),"-").concat(r),c="".concat(s,"-heading");return Re.createElement(i,e({},d,{key:s,data:n,options:a,Heading:o,headingProps:{id:c,data:l.data},label:t.formatGroupLabel(l.data)}),l.options.map((function(e){return N(e,"".concat(r,"-").concat(e.index))})))}if("option"===l.type)return N(l,"".concat(l.index))}));else if(y){var x=h({inputValue:m});if(null===x)return null;P=Re.createElement(s,d,x)}else{var A=T({inputValue:m});if(null===A)return null;P=Re.createElement(c,d,A)}var V={minMenuHeight:f,maxMenuHeight:g,menuPlacement:k,menuPosition:E,menuShouldScrollIntoView:C},R=Re.createElement(ei,e({},d,V),(function(l){var i=l.ref,o=l.placerProps,r=o.placement,s=o.maxHeight;return Re.createElement(n,e({},d,V,{innerRef:i,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:y,placement:r}),Re.createElement(lo,{captureEnabled:v,onTopArrive:O,onBottomArrive:F,lockEnabled:w},(function(l){return Re.createElement(a,e({},d,{innerRef:function(e){t.getMenuListRef(e),l(e)},isLoading:y,maxHeight:s,focusedOption:p}),P)})))}));return S||"fixed"===E?Re.createElement(r,e({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:k,menuPosition:E}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,l=t.delimiter,i=t.isDisabled,o=t.isMulti,n=t.name,a=t.required,r=this.state.selectValue;if(n&&!i){if(a&&!this.hasValue())return Re.createElement(oo,{name:n,onFocus:this.onValueInputFocus});if(o){if(l){var s=r.map((function(t){return e.getOptionValue(t)})).join(l);return Re.createElement("input",{name:n,type:"hidden",value:s})}var c=r.length>0?r.map((function(t,l){return Re.createElement("input",{key:"i-".concat(l),name:n,type:"hidden",value:e.getOptionValue(t)})})):Re.createElement("input",{name:n,type:"hidden",value:""});return Re.createElement("div",null,c)}var u=r[0]?this.getOptionValue(r[0]):"";return Re.createElement("input",{name:n,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,l=this.state,i=l.ariaSelection,o=l.focusedOption,n=l.focusedValue,a=l.isFocused,r=l.selectValue,s=this.getFocusableOptions();return Re.createElement(Ai,e({},t,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:o,focusedValue:n,isFocused:a,selectValue:r,focusableOptions:s}))}},{key:"render",value:function(){var t=this.getComponents(),l=t.Control,i=t.IndicatorsContainer,o=t.SelectContainer,n=t.ValueContainer,a=this.props,r=a.className,s=a.id,c=a.isDisabled,u=a.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return Re.createElement(o,e({},p,{className:r,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),Re.createElement(l,e({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),Re.createElement(n,e({},p,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),Re.createElement(i,e({},p,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],o=[{key:"getDerivedStateFromProps",value:function(e,t){var l=t.prevProps,i=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,n=t.ariaSelection,a=t.isFocused,r=t.prevWasFocused,s=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,b=Dl(c),v={};if(l&&(c!==l.value||s!==l.options||u!==l.menuIsOpen||d!==l.inputValue)){var m=u?function(e,t){return uo(co(e,t))}(e,b):[],y=i?function(e,t){var l=e.focusedValue,i=e.selectValue.indexOf(l);if(i>-1){if(t.indexOf(l)>-1)return l;if(i-1?l:t[0]}(t,m);v={selectValue:b,focusedOption:h,focusedValue:y,clearFocusValueOnUpdate:!1}}var f=null!=o&&e!==l?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},g=n,_=a&&r;return a&&!_&&(g={value:Xl(p,b,b[0]||null),options:b,action:"initial-input-focus"},_=!r),"initial-input-focus"===(null==n?void 0:n.action)&&(g=null),Pe(Pe(Pe({},v),f),{},{prevProps:e,ariaSelection:g,prevWasFocused:_})}}],i&&Ie(l.prototype,i),o&&Ie(l,o),Object.defineProperty(l,"prototype",{writable:!1}),a}(Re.Component);_o.defaultProps=ro;var ko=(0,Re.forwardRef)((function(t,l){var i=function(e){var t=e.defaultInputValue,l=void 0===t?"":t,i=e.defaultMenuIsOpen,o=void 0!==i&&i,n=e.defaultValue,a=void 0===n?null:n,r=e.inputValue,s=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,b=e.value,v=Ve(e,Me),m=Ae((0,Re.useState)(void 0!==r?r:l),2),y=m[0],h=m[1],f=Ae((0,Re.useState)(void 0!==s?s:o),2),g=f[0],_=f[1],k=Ae((0,Re.useState)(void 0!==b?b:a),2),E=k[0],S=k[1],w=(0,Re.useCallback)((function(e,t){"function"==typeof c&&c(e,t),S(e)}),[c]),C=(0,Re.useCallback)((function(e,t){var l;"function"==typeof u&&(l=u(e,t)),h(void 0!==l?l:e)}),[u]),T=(0,Re.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),O=(0,Re.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),F=void 0!==r?r:y,P=void 0!==s?s:g,N=void 0!==b?b:E;return Pe(Pe({},v),{},{inputValue:F,menuIsOpen:P,onChange:w,onInputChange:C,onMenuClose:O,onMenuOpen:T,value:N})}(t);return Re.createElement(_o,e({ref:l},i))})),Eo=ko,So=window.wp.htmlEntities;const wo={context:"view",orderby:"name",order:"asc",per_page:-1,who:"authors",_fields:"id,name"};function Co(e){const{className:l,fieldId:i,fieldType:a,fieldName:r,handleRuleChange:s,triggerReset:c,value:u,label:d,help:p}=e,{authors:v,loading:m}=(0,n.useSelect)((e=>{const{getUsers:t,isResolving:l}=e("core");return{authors:t(wo),loading:l("getUsers",[wo])}}),[]),y=(0,t.useMemo)((()=>(null!=v?v:[]).map((e=>({value:e.id,label:(0,So.decodeEntities)(e.name)})))),[v]),h=y.filter((e=>u.includes(e.value)));return(0,t.createElement)(t.Fragment,null,d&&(0,t.createElement)("label",{id:`${i}_label`,htmlFor:`${i}_select`,className:"field__label"},d),(0,t.createElement)(Eo,{"aria-labelledby":`${i}`,inputId:`${i}_select`,className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:h,options:y,placeholder:(0,o.__)("Select Author…","block-visibility"),onChange:e=>s(e,"multiSelect",a,r,c),isLoading:m,isMulti:!0}),p&&(0,t.createElement)("div",{className:"control-fields-item__help for-select-component"},p))}const To={context:"view",orderby:"name",order:"asc",per_page:-1,_fields:"id,name"};function Oo(e){const{className:l,fieldId:i,fieldType:o,fieldName:n,handleRuleChange:r,label:s,placeholder:c,help:u,taxonomySlug:d,triggerReset:p,value:v}=e,m=(0,a.useEntityRecords)("taxonomy",d,To),y=(0,t.useMemo)((()=>{var e;return(null!==(e=m.records)&&void 0!==e?e:[]).map((e=>({value:e.id,label:(0,So.decodeEntities)(e.name)})))}),[m.records]),h=y.filter((e=>v.includes(e.value)));return(0,t.createElement)(t.Fragment,null,s&&(0,t.createElement)("label",{id:`${i}_label`,htmlFor:`${i}_select`,className:"field__label"},s),(0,t.createElement)(Eo,{"aria-labelledby":`${i}`,inputId:`${i}_select`,className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:h,options:y,placeholder:c,onChange:e=>r(e,"multiSelect",o,n,p),isLoading:m.isResolving,isMulti:!0}),u&&(0,t.createElement)("div",{className:"control-fields-item__help for-select-component"},u))}function Fo(e){const t=e?.title?.raw?(0,So.decodeEntities)(e.title.rendered):`${(0,o.__)("Untitled","block-visibility")} #${e.id}`;let l="";return"draft"!==e?.status&&"pending"!==e?.status||(l=`${e.status.charAt(0).toUpperCase()+e.status.slice(1)}: `),l+t}function Po(e){const{className:l,fieldId:a,fieldType:r,fieldName:s,handleRuleChange:c,label:u,placeholder:d,help:p,postType:v,triggerReset:m,value:y,valueType:h,isMulti:f}=e,[g,_]=(0,t.useState)(!1),[k,E]=(0,t.useState)(!1),{availablePosts:S,loadingAvailablePosts:w}=(0,n.useSelect)((e=>{const{getPostType:t,getEntityRecords:l,isResolving:o}=e("core"),n=t(v),a=(0,i.get)(n,["hierarchical"],!1),r={orderby:a?"title":"date",order:a?"asc":"desc",per_page:25,status:"publish,draft,private,pending",_fields:"id,title,status"};return k&&(r.search=k),{availablePosts:l("postType",v,r),loadingAvailablePosts:o("getEntityRecords",["postType",v,r])}}),[k]),{savedPosts:C,loadingSavedPosts:T}=(0,n.useSelect)((e=>{if(0!==y.length&&!g){const t={include:Array.isArray(y)?y.join(","):y,per_page:-1,status:"publish,draft,private,pending",_fields:"id,title,status"},{getEntityRecords:l,isResolving:i}=e("core");return{savedPosts:l("postType",v,t),selectedLoading:i("getEntityRecords",["postType",v,t])}}return{savedPosts:[],loadingSavedPosts:!1}})),O=(0,t.useMemo)((()=>(null!=S?S:[]).map((e=>({value:e.id,label:Fo(e)})))),[S]);let F=[];return F=g||(null!=C?C:[]).map((e=>({value:e.id,label:Fo(e)}))),(0,t.createElement)(t.Fragment,null,u&&(0,t.createElement)("label",{id:`${a}_label`,htmlFor:`${a}_select`,className:"field__label"},u),(0,t.createElement)(Eo,{"aria-labelledby":`${a}`,inputId:`${a}_select`,className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:F,options:O,onChange:e=>{const t="postSelect"===h?"select":"multiSelect";_(e),c(e,t,r,s,m)},onInputChange:(0,i.debounce)((e=>{(0===e.length||e.length>=3)&&E(e)}),300),filterOption:(e,t)=>0===t.length||t.length>=3,noOptionsMessage:e=>{var t;const l=null!==(t=e?.inputValue.length)&&void 0!==t?t:0;return 0===l||l>=3?(0,o.__)("No options found","block-visibility"):(0,o.__)("Enter 3 characters to begin search","block-visibility")},placeholder:d,isLoading:w||T,isMulti:f}),p&&(0,t.createElement)("div",{className:"control-fields-item__help for-select-component"},p))}var No=window.wp.url,xo=window.wp.apiFetch,Ao=l.n(xo);function Vo(e){const{controlName:l,className:n,fieldId:a,fieldType:r,fieldName:s,handleRuleChange:c,label:u,placeholder:d,help:p,triggerReset:v,value:m,valueType:y,isMulti:h}=e,[f,g]=(0,t.useState)([]),[_,k]=(0,t.useState)([]),[E,S]=(0,t.useState)(!1),[w,C]=(0,t.useState)(!1),[T,O]=(0,t.useState)(void 0);(0,t.useEffect)((()=>{if(0!==m.length&&!w){const e=(0,No.addQueryArgs)("/block-visibility/v1/variables",{integration:l,saved_values:Array.isArray(m)?m.join(","):m});S(!0),Ao()({path:e}).then((e=>{var t;const i=(null!==(t=e?.integrations?.[l]?.products)&&void 0!==t?t:[]).filter((e=>Array.isArray(m)?m.includes(e.value):m===e.value));k(i),S(!1)})).catch((()=>{k([]),S(!1)}))}}),[]),(0,t.useEffect)((()=>{const e=(0,No.addQueryArgs)("/block-visibility/v1/variables",{integration:l,search_term:null!=T?T:void 0});S(!0),Ao()({path:e}).then((e=>{var t;g(null!==(t=e?.integrations?.[l]?.products)&&void 0!==t?t:[]),S(!1)})).catch((()=>{g([]),S(!1)}))}),[T]);const F=(0,t.useMemo)((()=>f),[f]);let P=[];return P=w||_,(0,t.createElement)(t.Fragment,null,u&&(0,t.createElement)("label",{id:`${a}_label`,htmlFor:`${a}_select`,className:"field__label"},u),(0,t.createElement)(Eo,{"aria-labelledby":`${a}`,inputId:`${a}_select`,className:b()("block-visibility__react-select",n),classNamePrefix:"react-select",value:P,options:F,onChange:e=>{const t="productSelect"===y?"select":"multiSelect";C(e),c(e,t,r,s,v)},onInputChange:(0,i.debounce)((e=>{(0===e.length||e.length>=3)&&O(e)}),300),filterOption:(e,t)=>0===t.length||t.length>=3,noOptionsMessage:e=>{var t;const l=null!==(t=e?.inputValue.length)&&void 0!==t?t:0;return 0===l||l>=3?(0,o.__)("No products found","block-visibility"):(0,o.__)("Enter 3 characters to begin search","block-visibility")},placeholder:d,isLoading:E,isMulti:h}),p&&(0,t.createElement)("div",{className:"control-fields-item__help for-select-component"},p))}function Ro(l){const{rule:i,fieldId:n,fieldType:a,fieldName:r,valueType:s,valueTypeVariant:c,options:d,label:p,placeholder:v,help:m,handleRuleChange:y,triggerReset:h,isLoading:f,hasGroupedFields:g,hasGroupedOptions:_,dependantFieldValue:k}=l;if(g&&!i.field&&"ruleField"!==a)return null;let E="";var S;if("ruleField"===a)E=null!==(S=i?.field)&&void 0!==S?S:"";else if("subField"===a){var w,C;E=i?.subFields?null!==(w=i.subFields[r])&&void 0!==w?w:"":null!==(C=i?.subField)&&void 0!==C?C:""}else{var T;E=null!==(T=i["operatorField"===a?"operator":"value"])&&void 0!==T?T:""}if("select"===s||"multiSelect"===s){let e="",t=d;if(_){const e=[];d.forEach((t=>{e.push(...t.options)})),t=e}"multiSelect"===s?e=t.filter((e=>E.includes(e.value))):(e=t.filter((e=>e.value===E)),0!==e.length&&(e=e[0])),E=e}const O="field__"+a;if("select"===s||"multiSelect"===s){const e=v||(0,o.__)("Select…","block-visibility");return(0,t.createElement)(t.Fragment,null,p&&(0,t.createElement)("label",{id:`${n}_label`,htmlFor:`${n}_select`,className:"field__label"},p),(0,t.createElement)(Eo,{"aria-labelledby":`${n}_label`,inputId:`${n}_select`,className:b()("block-visibility__react-select",O),classNamePrefix:"react-select",value:E,options:d,placeholder:e,onChange:e=>y(e,s,a,r,h),isMulti:"multiSelect"===s,isLoading:f}),m&&(0,t.createElement)("div",{className:"control-fields-item__help for-select-component"},m))}if("date"===s||"dateTime"===s)return(0,t.createElement)(we,{className:O,value:E,onChange:e=>y(e,s,a,r,h),includeTime:"dateTime"===s,help:m});if("toggle"===s)return(0,t.createElement)(u.ToggleControl,{className:O,label:v,checked:E,onChange:()=>y(!E,s,a,r,h),help:m});if("authorsSelect"===s)return(0,t.createElement)(Co,e({className:O,value:E},l));if("termsSelect"===s){let i;return k&&!c?i=k:c&&(i=c),(0,t.createElement)(Oo,e({key:i,taxonomySlug:i,className:O,value:E},l))}if("postsSelect"===s||"postSelect"===s){let i;return k&&!c?i=k:c&&(i=c),(0,t.createElement)(Po,e({key:i,postType:i,className:O,value:E,valueType:s,isMulti:"postsSelect"===s},l))}if("productsSelect"===s||"productSelect"===s){if("productSelect"===s){const i="dynamicProduct"===E;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.ToggleControl,{className:O,label:(0,o.__)("Detect current product","block-visibility"),checked:i,onChange:()=>y(i?"":"dynamicProduct",s,a,r,h),help:m}),!i&&(0,t.createElement)(Vo,e({controlName:l.controlName,className:O,value:E,valueType:s,isMulti:!1},l)))}return(0,t.createElement)(Vo,e({controlName:l.controlName,className:O,value:E,valueType:s,isMulti:!0},l))}return(0,t.createElement)(u.TextControl,{className:O,type:s,min:"number"===s?0:"",value:E,label:p,placeholder:v,help:m,onChange:e=>y(e,"text",a,r,h),autocomplete:"off"})}function Mo(e){var l,n,a,r,s;const{rule:c,ruleIndex:d,ruleSet:p,ruleSetIndex:v,ruleSets:m,hideOnRuleSets:y,rulePlaceholder:h,ruleLabel:f,controlName:g,controlAtts:_,setControlAtts:k,groupedFields:E,allFields:S}=e;let w=S.filter((e=>e.value===c.field));E||(w=S.filter((e=>"ruleField"===e.type))),0!==w.length&&(w=w[0]);const C=E?null!==(l=w?.fields)&&void 0!==l?l:[]:S,T=null!==(n=w?.help)&&void 0!==n&&n,O=null!==(a=w?.helpPosition)&&void 0!==a?a:"bottom",F=null!==(r=w?.hasMultipleSubFields)&&void 0!==r&&r,P=null!==(s=w?.hasSimplifiedLayout)&&void 0!==s&&s;let N=f;N||(N=()=>0===d?(0,o.sprintf)( // Translators: Whether the block is hidden or visible. -(0,o.__)("%s the block if","block-visibility"),y?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility")):(0,o.__)("And if","block-visibility"));const x=function(e,t,l){let o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];"select"===t?o=e.value:"multiSelect"===t?(o=[],0!==e.length&&e.forEach((e=>{o.push(e.value)}))):o=e;const r=[...m],s=[...p.rules];if("ruleField"===l)s[d]=E?{field:o}:(0,i.assign)({...s[d]},{field:o});else if("subField"===l)s[d]=F?(0,i.assign)({...s[d]},{subFields:{...s[d].subFields,[n]:o}}):(0,i.assign)({...s[d]},{subField:o}),a&&delete s[d].value;else{const e="operatorField"===l?"operator":"value";s[d]=(0,i.assign)({...s[d]},{[e]:o})}r[v]=(0,i.assign)({...p},{rules:s}),k(g,(0,i.assign)({..._},{ruleSets:[...r]}))};return(0,t.createElement)("div",{key:d,className:"rule"},(0,t.createElement)("div",{className:"rule__header"},(0,t.createElement)("span",null,N(d)),p.rules.length>1&&(0,t.createElement)(u.Button,{label:(0,o.__)("Delete Rule","block-visibility"),icon:Ee,onClick:()=>(()=>{const e=[...m],t=p.rules.filter(((e,t)=>t!==d));e[v]=(0,i.assign)({...p},{rules:[...t]}),k(g,(0,i.assign)({..._},{ruleSets:[...e]}))})()})),(0,t.createElement)("div",{className:"rule__fields"},(0,t.createElement)("div",{className:b()("fields-container",{"is-simplified":P})},E&&(0,t.createElement)(Ro,{controlName:g,rule:c,fieldId:d+"_ruleField_select",fieldType:"ruleField",valueType:"select",options:E,placeholder:null!=h?h:(0,o.__)("Select Rule…","block-visibility"),handleRuleChange:x,hasGroupedOptions:!0}),T&&"top"===O&&(0,t.createElement)("div",{className:"control-fields-item__help for-select-component"},w.help),C.map(((e,l)=>{var i,o,n,a,r,s,u,p,b,v,m,y;let h=e?.valueType,f=e?.valueTypeVariant,_=e?.options,k=e?.placeholder,S="";const w=`${d}${l}_${null!==(i=e?.type)&&void 0!==i?i:"valueField"}_${h}`,C=e?.conditionalValueTypes;C&&C.forEach((e=>{var t;if(S=null!==(t=c[e.dependencyType])&&void 0!==t?t:"",e.dependencyValues.includes(S)){var l,i,o,n,a;const t=null!==(l=e?.valueTypes)&&void 0!==l?l:[],r=t.filter((e=>e.value===S)),s=t.filter((e=>"default"===e.value));h=null!==(i=r[0]?.valueType)&&void 0!==i?i:s[0]?.valueType,f=null!==(o=r[0]?.valueTypeVariant)&&void 0!==o?o:f,_=null!==(n=r[0]?.options)&&void 0!==n?n:_,k=null!==(a=r[0]?.placeholder)&&void 0!==a?a:k}}));const T=e?.displayConditions;if(T){const e=[];if(T.forEach((t=>{let l;if(F&&"subField"===t.dependencyType){var i,o;const e=null!==(i=c?.subFields)&&void 0!==i?i:[];l=null!==(o=e[t.dependencyName])&&void 0!==o?o:""}else{var n;const e="operatorField"===t.dependencyType?"operator":"subField";l=null!==(n=c[e])&&void 0!==n?n:""}var a;"dynamic"===t.dependencyValues?0!==(null!==(a=t?.options)&&void 0!==a?a:[]).filter((e=>e.value===l)).length&&e.push(!0):t.dependencyValues.includes(l)&&e.push(!0)})),e.length!==T.length)return null}const O=e?.conditionalOptions;return O&&O.forEach((e=>{let t;if(F&&"subField"===e.dependencyType){var l,i;const o=null!==(l=c?.subFields)&&void 0!==l?l:[];t=null!==(i=o[e.dependencyName])&&void 0!==i?i:""}else{var o;t=null!==(o=c[e.dependencyType])&&void 0!==o?o:""}if("dynamic"===e.dependencyValues){var n,a,r;const l=(null!==(n=e?.options)&&void 0!==n?n:[]).filter((e=>e.value===t));_=null!==(a=l[0]?.valueOptions)&&void 0!==a?a:[],k=null!==(r=e?.placeholder)&&void 0!==r?r:""}else e.dependencyValues.includes(t)&&(_=e?.options,k=e?.placeholder)})),(0,t.createElement)(Ro,{key:w,controlName:g,rule:c,fieldId:w,fieldType:null!==(o=e?.type)&&void 0!==o?o:"valueField",fieldName:null!==(n=e?.name)&&void 0!==n?n:"",valueType:null!==(a=h)&&void 0!==a?a:"text",valueTypeVariant:null!==(r=f)&&void 0!==r?r:"",dependantFieldValue:null!==(s=S)&&void 0!==s?s:"",options:null!==(u=_)&&void 0!==u?u:[],handleRuleChange:x,hasGroupedFields:!!E,hasGroupedOptions:null!==(p=e?.hasGroupedOptions)&&void 0!==p&&p,label:null!==(b=e?.label)&&void 0!==b?b:"",placeholder:null!==(v=k)&&void 0!==v?v:"",help:null!==(m=e?.help)&&void 0!==m?m:"",isLoading:e?.isLoading,triggerReset:null!==(y=e?.triggerReset)&&void 0!==y&&y})}))),T&&"bottom"===O&&(0,t.createElement)("div",{className:"control-fields-item__help"},w.help)))}function Io(l){var n,a,r;const{ruleSet:s,ruleSetIndex:c,ruleSets:d,controlName:p,controlAtts:v,setControlAtts:m}=l,y=null!==(n=s?.title)&&void 0!==n?n:"",h=y||(0,o.__)("Rule Set","block-visibility"),f=null===(a=s?.enable)||void 0===a||a,g=null!==(r=s?.rules)&&void 0!==r?r:[];0===g.length&&g.push({field:""});const _=(e,t)=>{const l={...s},o=[...d];l[e]=t,o[c]=l,m(p,(0,i.assign)({...v},{ruleSets:[...o]}))},k=(0,t.createElement)(u.DropdownMenu,{label:(0,o.__)("Edit","block-visibility"),icon:ae,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:y,label:(0,o.__)("Rule set title","block-visibility"),placeholder:(0,o.__)("Rule Set","block-visibility"),onChange:e=>_("title",e)}))),E=d.length<=1?(0,o.__)("Clear rule set","block-visibility"):(0,o.__)("Remove rule set","block-visibility"),S=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,o.__)("Options","block-visibility"),icon:Z,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>_("enable",!f)},f?(0,o.__)("Disable","block-visibility"):(0,o.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{className:"more-settings__tools-duplicate",onClick:()=>{!function(){const e=[...d,s];m(p,(0,i.assign)({...v},{ruleSets:[...e]}))}(),l()}},(0,o.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=d.filter(((e,t)=>t!==c));m(p,(0,i.assign)({...v},{ruleSets:[...e]}))}(),l()}},E)))}));let w=(0,t.createElement)("div",{className:"rule-set__fields"},(0,t.createElement)("div",{className:"rule-set__rules"},g.map(((i,o)=>(0,t.createElement)(Mo,e({key:o,rule:i,ruleIndex:o,ruleSet:s,ruleSetIndex:c,ruleSets:d},l))))),(0,t.createElement)("div",{className:"rule-set__add-rule"},(0,t.createElement)(u.Button,{onClick:()=>function(){const e=[...d],t=[...s.rules,{field:""}];e[c]=(0,i.assign)({...s},{rules:t}),m(p,(0,i.assign)({...v},{ruleSets:[...e]}))}(),isLink:!0},(0,o.__)("Add rule","block-visibility"))));return f||(w=(0,t.createElement)(u.Disabled,null,w)),(0,t.createElement)("div",{key:c,className:b()("rule-sets__rule-set",{disabled:!f})},(0,t.createElement)("div",{className:"rule-set__header section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,h),k),(0,t.createElement)("div",{className:"section-header__toolbar"},S)),w)}function Do(l){var n,a,r,s,c,d;const{controlSetAtts:p,enabledControls:b,setControlAtts:v,settings:m,variables:y}=l,h=null!==(n=y?.integrations?.acf?.active)&&void 0!==n&&n;if(!b.some((e=>"acf"===e.settingSlug&&e?.isActive))||!h)return null;const f=null===(a=m?.plugin_settings?.enable_editor_notices)||void 0===a||a,g=null!==(r=y?.integrations?.acf?.fields)&&void 0!==r?r:[],_=null!==(s=p?.controls?.acf)&&void 0!==s?s:{},k=null!==(c=_?.hideOnRuleSets)&&void 0!==c&&c,E=null!==(d=_?.ruleSets)&&void 0!==d?d:[];E.forEach((function(e){e.rules.forEach((function(e){"true"===e.subField?e.subField="user":e.hasOwnProperty("subField")&&"false"!==e.subField||(e.subField="post")}))}));const S=function(e){const t=function(e){var t;const l=null!==(t=e?.integrations?.acf?.fields)&&void 0!==t?t:[],i=[];return 0!==l.length&&l.forEach((e=>{var t,l;const o=null!==(t=e?.key)&&void 0!==t?t:"",n=null!==(l=e?.title)&&void 0!==l?l:"";i.push({value:o,label:n})})),i}(e),l=fe(e),i=[];return t.forEach((e=>{var t,o;const n=null!==(t=e?.value)&&void 0!==t?t:"",a=null!==(o=e?.label)&&void 0!==o?o:"",r=l.filter((e=>e.group===n));i.push({value:n,label:a,options:r})})),i}(y),w=fe(y);return(0,t.createElement)("div",{className:"controls-panel-item acf-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)(W,{icon:B}),(0,t.createElement)("span",null,(0,o.__)("Advanced Custom Fields","block-visibility")),f&&(0,t.createElement)(Te,{message:(0,o.__)("The Advanced Custom Fields (ACF) control allows you to configure block visibility based on various field-related rules, which form rule sets.","block-visibility"),link:ie.editorACF,position:"bottom right"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:G,onClick:()=>(()=>{const e=[...E,{enable:!0,rules:[{field:""}]}];v("acf",(0,i.assign)({..._},{ruleSets:[...e]}))})(),label:(0,o.__)("Add rule set","block-visibility"),isSmall:!0}))),f&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,o.sprintf)( +(0,o.__)("%s the block if","block-visibility"),y?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility")):(0,o.__)("And if","block-visibility"));const x=function(e,t,l){let o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];"select"===t?o=e.value:"multiSelect"===t?(o=[],0!==e.length&&e.forEach((e=>{o.push(e.value)}))):o=e;const r=[...m],s=[...p.rules];if("ruleField"===l)s[d]=E?{field:o}:(0,i.assign)({...s[d]},{field:o});else if("subField"===l)s[d]=F?(0,i.assign)({...s[d]},{subFields:{...s[d].subFields,[n]:o}}):(0,i.assign)({...s[d]},{subField:o}),a&&delete s[d].value;else{const e="operatorField"===l?"operator":"value";s[d]=(0,i.assign)({...s[d]},{[e]:o})}r[v]=(0,i.assign)({...p},{rules:s}),k(g,(0,i.assign)({..._},{ruleSets:[...r]}))};return(0,t.createElement)("div",{key:d,className:"rule"},(0,t.createElement)("div",{className:"rule__header"},(0,t.createElement)("span",null,N(d)),p.rules.length>1&&(0,t.createElement)(u.Button,{label:(0,o.__)("Delete Rule","block-visibility"),icon:Ee,onClick:()=>(()=>{const e=[...m],t=p.rules.filter(((e,t)=>t!==d));e[v]=(0,i.assign)({...p},{rules:[...t]}),k(g,(0,i.assign)({..._},{ruleSets:[...e]}))})()})),(0,t.createElement)("div",{className:"rule__fields"},(0,t.createElement)("div",{className:b()("fields-container",{"is-simplified":P})},E&&(0,t.createElement)(Ro,{controlName:g,rule:c,fieldId:d+"_ruleField_select",fieldType:"ruleField",valueType:"select",options:E,placeholder:null!=h?h:(0,o.__)("Select Rule…","block-visibility"),handleRuleChange:x,hasGroupedOptions:!0}),T&&"top"===O&&(0,t.createElement)("div",{className:"control-fields-item__help for-select-component"},w.help),C.map(((e,l)=>{var i,o,n,a,r,s,u,p,b,v,m,y;let h=e?.valueType,f=e?.valueTypeVariant,_=e?.options,k=e?.placeholder,S="";const w=`${d}${l}_${null!==(i=e?.type)&&void 0!==i?i:"valueField"}_${h}`,C=e?.conditionalValueTypes;C&&C.forEach((e=>{var t;if(S=null!==(t=c[e.dependencyType])&&void 0!==t?t:"",e.dependencyValues.includes(S)){var l,i,o,n,a;const t=null!==(l=e?.valueTypes)&&void 0!==l?l:[],r=t.filter((e=>e.value===S)),s=t.filter((e=>"default"===e.value));h=null!==(i=r[0]?.valueType)&&void 0!==i?i:s[0]?.valueType,f=null!==(o=r[0]?.valueTypeVariant)&&void 0!==o?o:f,_=null!==(n=r[0]?.options)&&void 0!==n?n:_,k=null!==(a=r[0]?.placeholder)&&void 0!==a?a:k}}));const T=e?.displayConditions;if(T){const e=[];if(T.forEach((t=>{let l;if(F&&"subField"===t.dependencyType){var i,o;const e=null!==(i=c?.subFields)&&void 0!==i?i:[];l=null!==(o=e[t.dependencyName])&&void 0!==o?o:""}else{var n;const e="operatorField"===t.dependencyType?"operator":"subField";l=null!==(n=c[e])&&void 0!==n?n:""}var a;"dynamic"===t.dependencyValues?0!==(null!==(a=t?.options)&&void 0!==a?a:[]).filter((e=>e.value===l)).length&&e.push(!0):t.dependencyValues.includes(l)&&e.push(!0)})),e.length!==T.length)return null}const O=e?.conditionalOptions;return O&&O.forEach((e=>{let t;if(F&&"subField"===e.dependencyType){var l,i;const o=null!==(l=c?.subFields)&&void 0!==l?l:[];t=null!==(i=o[e.dependencyName])&&void 0!==i?i:""}else{var o;t=null!==(o=c[e.dependencyType])&&void 0!==o?o:""}if("dynamic"===e.dependencyValues){var n,a,r;const l=(null!==(n=e?.options)&&void 0!==n?n:[]).filter((e=>e.value===t));_=null!==(a=l[0]?.valueOptions)&&void 0!==a?a:[],k=null!==(r=e?.placeholder)&&void 0!==r?r:""}else e.dependencyValues.includes(t)&&(_=e?.options,k=e?.placeholder)})),(0,t.createElement)(Ro,{key:w,controlName:g,rule:c,fieldId:w,fieldType:null!==(o=e?.type)&&void 0!==o?o:"valueField",fieldName:null!==(n=e?.name)&&void 0!==n?n:"",valueType:null!==(a=h)&&void 0!==a?a:"text",valueTypeVariant:null!==(r=f)&&void 0!==r?r:"",dependantFieldValue:null!==(s=S)&&void 0!==s?s:"",options:null!==(u=_)&&void 0!==u?u:[],handleRuleChange:x,hasGroupedFields:!!E,hasGroupedOptions:null!==(p=e?.hasGroupedOptions)&&void 0!==p&&p,label:null!==(b=e?.label)&&void 0!==b?b:"",placeholder:null!==(v=k)&&void 0!==v?v:"",help:null!==(m=e?.help)&&void 0!==m?m:"",isLoading:e?.isLoading,triggerReset:null!==(y=e?.triggerReset)&&void 0!==y&&y})}))),T&&"bottom"===O&&(0,t.createElement)("div",{className:"control-fields-item__help"},w.help)))}function Io(l){var n,a,r;const{ruleSet:s,ruleSetIndex:c,ruleSets:d,controlName:p,controlAtts:v,setControlAtts:m}=l,y=null!==(n=s?.title)&&void 0!==n?n:"",h=y||(0,o.__)("Rule Set","block-visibility"),f=null===(a=s?.enable)||void 0===a||a,g=null!==(r=s?.rules)&&void 0!==r?r:[];0===g.length&&g.push({field:""});const _=(e,t)=>{const l={...s},o=[...d];l[e]=t,o[c]=l,m(p,(0,i.assign)({...v},{ruleSets:[...o]}))},k=(0,t.createElement)(u.DropdownMenu,{label:(0,o.__)("Edit","block-visibility"),icon:ae,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:y,label:(0,o.__)("Rule set title","block-visibility"),placeholder:(0,o.__)("Rule Set","block-visibility"),onChange:e=>_("title",e)}))),E=d.length<=1?(0,o.__)("Clear rule set","block-visibility"):(0,o.__)("Remove rule set","block-visibility"),S=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,o.__)("Options","block-visibility"),icon:Z,popoverProps:{focusOnMount:"container",placement:"left-start",offset:259}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>_("enable",!f)},f?(0,o.__)("Disable","block-visibility"):(0,o.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{className:"more-settings__tools-duplicate",onClick:()=>{!function(){const e=[...d,s];m(p,(0,i.assign)({...v},{ruleSets:[...e]}))}(),l()}},(0,o.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=d.filter(((e,t)=>t!==c));m(p,(0,i.assign)({...v},{ruleSets:[...e]}))}(),l()}},E)))}));let w=(0,t.createElement)("div",{className:"rule-set__fields"},(0,t.createElement)("div",{className:"rule-set__rules"},g.map(((i,o)=>(0,t.createElement)(Mo,e({key:o,rule:i,ruleIndex:o,ruleSet:s,ruleSetIndex:c,ruleSets:d},l))))),(0,t.createElement)("div",{className:"rule-set__add-rule"},(0,t.createElement)(u.Button,{onClick:()=>function(){const e=[...d],t=[...s.rules,{field:""}];e[c]=(0,i.assign)({...s},{rules:t}),m(p,(0,i.assign)({...v},{ruleSets:[...e]}))}(),isLink:!0},(0,o.__)("Add rule","block-visibility"))));return f||(w=(0,t.createElement)(u.Disabled,null,w)),(0,t.createElement)("div",{key:c,className:b()("rule-sets__rule-set",{disabled:!f})},(0,t.createElement)("div",{className:"rule-set__header section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,h),k),(0,t.createElement)("div",{className:"section-header__toolbar"},S)),w)}function Do(l){var n,a,r,s,c,d;const{controlSetAtts:p,enabledControls:b,setControlAtts:v,settings:m,variables:y}=l,h=null!==(n=y?.integrations?.acf?.active)&&void 0!==n&&n;if(!b.some((e=>"acf"===e.settingSlug&&e?.isActive))||!h)return null;const f=null===(a=m?.plugin_settings?.enable_editor_notices)||void 0===a||a,g=null!==(r=y?.integrations?.acf?.fields)&&void 0!==r?r:[],_=null!==(s=p?.controls?.acf)&&void 0!==s?s:{},k=null!==(c=_?.hideOnRuleSets)&&void 0!==c&&c,E=null!==(d=_?.ruleSets)&&void 0!==d?d:[];0===E.length?E.push({enable:!0,rules:[{field:""}]}):E.forEach((function(e){e.rules.forEach((function(e){"true"===e.subField?e.subField="user":e.hasOwnProperty("subField")&&"false"!==e.subField||(e.subField="post")}))}));const S=function(e){const t=function(e){var t;const l=null!==(t=e?.integrations?.acf?.fields)&&void 0!==t?t:[],i=[];return 0!==l.length&&l.forEach((e=>{var t,l;const o=null!==(t=e?.key)&&void 0!==t?t:"",n=null!==(l=e?.title)&&void 0!==l?l:"";i.push({value:o,label:n})})),i}(e),l=fe(e),i=[];return t.forEach((e=>{var t,o;const n=null!==(t=e?.value)&&void 0!==t?t:"",a=null!==(o=e?.label)&&void 0!==o?o:"",r=l.filter((e=>e.group===n));i.push({value:n,label:a,options:r})})),i}(y),w=fe(y);return(0,t.createElement)("div",{className:"controls-panel-item acf-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)(W,{icon:B}),(0,t.createElement)("span",null,(0,o.__)("Advanced Custom Fields","block-visibility")),f&&(0,t.createElement)(Te,{message:(0,o.__)("The Advanced Custom Fields (ACF) control allows you to configure block visibility based on various field-related rules, which form rule sets.","block-visibility"),link:ie.editorACF,position:"bottom right"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:G,onClick:()=>(()=>{const e=[...E,{enable:!0,rules:[{field:""}]}];v("acf",(0,i.assign)({..._},{ruleSets:[...e]}))})(),label:(0,o.__)("Add rule set","block-visibility"),isSmall:!0}))),f&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,o.sprintf)( // Translators: Whether the block is hidden or visible. (0,o.__)("%s the block if at least one rule set applies. Rules associated with users will fail if the current user is not logged in.","block-visibility"),k?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},0===g.length&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,o.__)("It does not appear that your website contains any published fields yet.","block-visibility")),(0,t.createElement)("div",{className:"rule-sets"},E.map(((i,n)=>(0,t.createElement)(Io,e({key:n,ruleSet:i,ruleSetIndex:n,ruleSets:E,groupedFields:S,allFields:w,controlName:"acf",controlAtts:_,hideOnRuleSets:k,rulePlaceholder:(0,o.__)("Select Field…","block-visibility")},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide when rules apply","block-visibility"),checked:k,onChange:()=>v("acf",(0,i.assign)({..._},{hideOnRuleSets:!k}))}))))}function Lo(){const e=[{value:"any",label:(0,o.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,o.__)("Is none of the selected","block-visibility")}],t=(0,o.__)("Select Condition…","block-visibility");return[{value:"browserType",label:(0,o.__)("Browser","block-visibility"),group:"browser",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"chrome",label:(0,o.__)("Chrome","block-visibility")},{value:"firefox",label:(0,o.__)("Firefox","block-visibility")},{value:"edge",label:(0,o.__)("Microsoft Edge","block-visibility")},{value:"ie",label:(0,o.__)("Internet Explorer","block-visibility")},{value:"opera",label:(0,o.__)("Opera","block-visibility")},{value:"safari",label:(0,o.__)("Safari","block-visibility")},{value:"samsung",label:(0,o.__)("Samsung Internet","block-visibility")}],placeholder:(0,o.__)("Select Browser…","block-visibility")}]},{value:"devicePlatform",label:(0,o.__)("Platform","block-visibility"),group:"device",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"android",label:(0,o.__)("Android","block-visibility")},{value:"ios",label:(0,o.__)("iOS (iPhone and iPad)","block-visibility")},{value:"linux",label:(0,o.__)("Linux","block-visibility")},{value:"macintosh",label:(0,o.__)("Macintosh","block-visibility")},{value:"windows",label:(0,o.__)("Windows","block-visibility")}],placeholder:(0,o.__)("Select Platform…","block-visibility")}]},{value:"deviceType",label:(0,o.__)("Device Type","block-visibility"),group:"device",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"mobile",label:(0,o.__)("Is Mobile","block-visibility")},{value:"robot",label:(0,o.__)("Is Robot","block-visibility")},{value:"other",label:(0,o.__)("Is Desktop (Other)","block-visibility")}],placeholder:(0,o.__)("Select Type…","block-visibility")}]}]}function Ho(l){var n,a,r,s;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"browser_device"===e.settingSlug&&e?.isActive)))return null;const v=null===(n=b?.plugin_settings?.enable_editor_notices)||void 0===n||n,m=null!==(a=d?.controls?.browserDevice)&&void 0!==a?a:{},y=null!==(r=m?.hideOnRuleSets)&&void 0!==r&&r,h=null!==(s=m?.ruleSets)&&void 0!==s?s:[];0===h.length&&h.push({enable:!0,rules:[{field:""}]});const f=function(){const e=[{value:"browser",label:(0,o.__)("Browser","block-visibility")},{value:"device",label:(0,o.__)("Device","block-visibility")}],t=Lo(),l=[];return e.forEach((e=>{var i,o;const n=null!==(i=e?.value)&&void 0!==i?i:"",a=null!==(o=e?.label)&&void 0!==o?o:"",r=t.filter((e=>e.group===n));l.push({value:n,label:a,options:r})})),l}(),g=Lo();return(0,t.createElement)("div",{className:"controls-panel-item browser-device-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,o.__)("Browser & Device","block-visibility")),v&&(0,t.createElement)(Te,{message:(0,o.__)("The Browser & Device control allows you to configure block visibility based on the current user's browser or device.","block-visibility"),link:ie.editorBrowserDevice,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:G,onClick:()=>(()=>{const e=[...h,{enable:!0,rules:[{field:""}]}];p("browserDevice",(0,i.assign)({...m},{ruleSets:[...e]}))})(),label:(0,o.__)("Add rule set","block-visibility"),isSmall:!0}))),v&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,o.sprintf)( // Translators: Whether the block is hidden or visible. (0,o.__)("%s the block if at least one rule set applies.","block-visibility"),y?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},h.map(((i,o)=>(0,t.createElement)(Io,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:h,groupedFields:f,allFields:g,controlName:"browserDevice",controlAtts:m,hideOnRuleSets:y},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide when rules apply","block-visibility"),checked:y,onChange:()=>p("browserDevice",(0,i.assign)({...m},{hideOnRuleSets:!y}))}))))}function Bo(l){var n,a,r,s;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"cookie"===e.settingSlug&&e?.isActive)))return null;const v=null===(n=b?.plugin_settings?.enable_editor_notices)||void 0===n||n,m=null!==(a=d?.controls?.cookie)&&void 0!==a?a:{},y=null!==(r=m?.hideOnRuleSets)&&void 0!==r&&r,h=null!==(s=m?.ruleSets)&&void 0!==s?s:[];0===h.length&&h.push({enable:!0,rules:[{field:""}]});const f=function(){const e=[{value:"notEmpty",label:(0,o.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,o.__)("Has no value (Does not exist)","block-visibility"),disableValue:!0},{value:"equal",label:(0,o.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,o.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,o.__)("Value contains","block-visibility")},{value:"notContain",label:(0,o.__)("Value does not contain","block-visibility")}],t=(0,o.__)("Select Condition…","block-visibility");return[{type:"ruleField",valueType:"text",placeholder:(0,o.__)("Enter Cookie Name…","block-visibility")},{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"text",placeholder:(0,o.__)("Enter Cookie Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","contains","notContain"]}]}]}();return(0,t.createElement)("div",{className:"controls-panel-item cookie-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,o.__)("Cookie","block-visibility")),v&&(0,t.createElement)(Te,{message:(0,o.__)("The Cookie control allows you to configure block visibility based on HTML cookies.","block-visibility"),link:ie.editorCookie,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:G,onClick:()=>(()=>{const e=[...h,{enable:!0,rules:[{field:""}]}];p("cookie",(0,i.assign)({...m},{ruleSets:[...e]}))})(),label:(0,o.__)("Add rule set","block-visibility"),isSmall:!0}))),v&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,o.sprintf)( // Translators: Whether the block is hidden or visible. -(0,o.__)("%s the block if at least one rule set applies.","block-visibility"),y?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},h.map(((i,o)=>(0,t.createElement)(Io,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:h,allFields:f,controlName:"cookie",controlAtts:m,hideOnRuleSets:y},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide when rules apply","block-visibility"),checked:y,onChange:()=>p("cookie",(0,i.assign)({...m},{hideOnRuleSets:!y}))}))))}const Uo=[{index:1,slug:"Sun",title:(0,o.__)("Sunday","block-visibility")},{index:2,slug:"Mon",title:(0,o.__)("Monday","block-visibility")},{index:3,slug:"Tue",title:(0,o.__)("Tuesday","block-visibility")},{index:4,slug:"Wed",title:(0,o.__)("Wednesday","block-visibility")},{index:5,slug:"Thu",title:(0,o.__)("Thursday","block-visibility")},{index:6,slug:"Fri",title:(0,o.__)("Friday","block-visibility")},{index:7,slug:"Sat",title:(0,o.__)("Saturday","block-visibility")}];function jo(e){var l;const{scheduleAtts:n,setAttribute:a}=e,r=null!==(l=n?.dayOfWeek?.days)&&void 0!==l?l:[];return(0,t.createElement)("div",{className:"schedules-item__fields__day-of-week"},(0,t.createElement)("div",{className:"control-fields-item__label"},(0,o.__)("On these days","block-visibility")),(0,t.createElement)("div",{className:"day-of-week__checkbox-controls"},Uo.map((e=>(0,t.createElement)(u.CheckboxControl,{key:e.index,label:(0,t.createElement)(u.Tooltip,{text:e.title},(0,t.createElement)("span",{"aria-label":e.title},e.title.charAt(0))),checked:r.includes(e.slug),onChange:t=>{let l=[...r];t?l.push(e.slug):l=(0,i.without)(l,e.slug),a("dayOfWeek","days",l)}})))))}var qo=window.moment,zo=l.n(qo);const $o="HH:mm:ss";function Go(e){let{value:l,onUpdate:o,...n}=e;return(0,t.createElement)("input",{key:l,defaultValue:l,onBlur:function(e){const{target:t}=e;if(l===t.value)return;const a=parseInt(t.value,10);!(0,i.isInteger)(a)||void 0!==n.max&&a>n.max||void 0!==n.min&&a({minutes:r.format("mm"),hours:r.format(n?"hh":"HH"),am:r.format("H")<=11?"AM":"PM"})),[r,n]);function v(e){c(e);let t=e.format($o);t="23:59:00"===t?"23:59:59":t,a(t)}function m(e,t){let l=t;n&&"hours"===e&&"PM"===b&&(l=12!==l?t+12:l),v(s.clone()[e](l))}function y(e){return()=>{if(b===e)return;const t=parseInt(p,10);v(s.clone().hours("PM"===e?(t%12+12)%24:t%12))}}return(0,t.createElement)("fieldset",{className:"time-picker"},l&&(0,t.createElement)("span",{className:"control-fields-item__sub-label"},l),(0,t.createElement)("div",{className:"time-picker__fields-wrapper"},(0,t.createElement)("div",{className:"time-picker__fields-inputs"},(0,t.createElement)(Go,{"aria-label":(0,o.__)("Hours","block-visibility"),type:"number",name:"hours",step:1,min:n?1:0,max:n?12:23,value:p,onUpdate:m}),(0,t.createElement)("span",{"aria-hidden":"true"},":"),(0,t.createElement)(Go,{"aria-label":(0,o.__)("Minutes","block-visibility"),type:"number",name:"minutes",step:1,min:0,max:59,value:d,onUpdate:m})),n&&(0,t.createElement)(u.ButtonGroup,{className:"time-picker__fields-am-pm"},(0,t.createElement)(u.Button,{isPrimary:"AM"===b,isSecondary:"AM"!==b,onClick:y("AM"),className:"time-picker__am-button"},(0,o.__)("AM","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:"PM"===b,isSecondary:"PM"!==b,onClick:y("PM"),className:"time-picker__pm-button"},(0,o.__)("PM","block-visibility")))))}function Qo(e){var l,i;const{scheduleAtts:n,setAttribute:a}=e,r=(0,X.__experimentalGetSettings)(),s=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join("")),c=null!==(l=n?.timeOfDay)&&void 0!==l?l:{},d={start:"00:00:00",end:"00:00:00"};let p=null!==(i=c?.intervals)&&void 0!==i?i:[];0===p.length&&(c.intervals=[d],p=c.intervals);const b=(e,t,l)=>{const i=[...p],o={...p[l]};o[e]=t,i[l]=o,a("timeOfDay","intervals",i)};return(0,t.createElement)("div",{className:"schedules-item__fields__time-of-day"},(0,t.createElement)("div",{className:"control-fields-item__label"},(0,o._n)("During this time interval","During these time intervals",p.length,"block-visibility")),(0,t.createElement)("div",{className:"time-of-day__intervals"},p.map(((e,l)=>(0,t.createElement)("div",{key:`timepicker-${l}`,className:"time-of-day__interval-control"},(0,t.createElement)("div",{className:"time-of-day__interval-control__wrapper"},(0,t.createElement)(Wo,{label:(0,o.__)("From","block-visibility"),currentTime:e.start,is12Hour:s,onChange:e=>b("start",e,l),intervalIndex:l}),(0,t.createElement)(Wo,{label:(0,o.__)("To","block-visibility"),currentTime:e.end,is12Hour:s,onChange:e=>b("end",e,l)})),p.length>1&&(0,t.createElement)("div",{className:"time-of-day__interval-control__remove"},(0,t.createElement)(u.Button,{label:(0,o.__)("Clear time interval","block-visibility"),onClick:()=>(e=>{const t=p.filter(((t,l)=>l!==e));a("timeOfDay","intervals",t)})(l),icon:Ee})),e.end(()=>{const e=[...p];e.push(d),a("timeOfDay","intervals",e)})(),isLink:!0},(0,o.__)("Add interval","block-visibility"))))}function Zo(e){const{dateType:l,label:i,title:n,hasDateTime:a,setAttribute:r,setPickerOpen:s,setPickerType:c}=e;return(0,t.createElement)("div",{className:"date-time-item__field"},(0,t.createElement)(u.Button,{title:n,onClick:()=>{c(l),s(!0)}},(0,t.createElement)("span",null,i)),a&&(0,t.createElement)(u.Button,{icon:Ee,className:"clear-date-time",title:(0,o.__)("Clear date/time","block-visibility"),onClick:()=>r(l,!1,""),isSmall:!0}))}function Yo(e,t){const l=(0,X.__experimentalGetSettings)();let i=t;return e&&(i=(0,X.format)(`M j, Y ${l.formats.time}`,e)),i}function Xo(e){const{currentDate:l,label:i,setAttribute:n,setPickerOpen:a,pickerType:r}=e,s=(0,X.__experimentalGetSettings)(),c=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",focusOnMount:!0,onClose:()=>a(!1),placement:"left-start",offset:8},(0,t.createElement)("div",{className:"date-time-popover__header"},(0,t.createElement)("h2",null,i),(0,t.createElement)(u.Button,{label:(0,o.__)("Close","block-visibility"),onClick:()=>a(!1),icon:Ee,isSmall:!0})),(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{n(r,!1,e)},is12Hour:c,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0}))}function Ko(e,t,l){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e||0===e.length)return!1;const n=e.visibility_controls;return(0,i.has)(n,t)&&(0,i.has)(n[t],l)?n[t][l]:o}function Jo(l){var n,a,r,s,c,d;const{dateTime:p,schedules:v,scheduleIndex:m,scheduleAtts:y,setControlAtts:h,hideOnSchedules:f,settings:g}=l,[_,k]=(0,t.useState)(!1),[E,S]=(0,t.useState)(null),w=Ko(g,"date_time","enable_day_of_week"),C=Ko(g,"date_time","enable_time_of_day"),T=null!==(n=y?.title)&&void 0!==n?n:"",O=null===(a=y?.enable)||void 0===a||a,F=null!==(r=y?.start)&&void 0!==r?r:null,P=null!==(s=y?.end)&&void 0!==s?s:null,N=null!==(c=y?.dayOfWeek?.enable)&&void 0!==c&&c,x=null!==(d=y?.timeOfDay?.enable)&&void 0!==d&&d,A=new Date((new Date).setHours(0,0,0,0)),R=T||(0,o.__)("Schedule","block-visibility"),M=Yo(F,(0,o.__)("Now","block-visibility")),I=Yo(P,(0,o.__)("Forever","block-visibility"));let D=!1;F&&P&&(D=F>=P);const L=(e,t,l)=>{const o={...y},n=[...v];o[e]=t?(0,i.assign)({...o[e]},{[t]:l}):l,n[m]=o,h("dateTime",(0,i.assign)({...p},{schedules:[...n]}))},H=(0,t.createElement)(u.DropdownMenu,{label:(0,o.__)("Edit","block-visibility"),icon:ae,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"},toggleProps:{isSmall:!0}},(()=>(0,t.createElement)(u.TextControl,{value:T,label:(0,o.__)("Schedule title","block-visibility"),placeholder:(0,o.__)("Schedule","block-visibility"),onChange:e=>L("title",!1,e)}))),B=v.length<=1?(0,o.__)("Clear schedule","block-visibility"):(0,o.__)("Remove schedule","block-visibility"),U=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,o.__)("Options","block-visibility"),icon:Z,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>L("enable",!1,!O)},O?(0,o.__)("Disable","block-visibility"):(0,o.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=[...v,y];h("dateTime",(0,i.assign)({...p},{schedules:[...e]}))}(),l()}},(0,o.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=v.filter(((e,t)=>t!==m));h("dateTime",(0,i.assign)({...p},{schedules:[...e]}))}(),l()}},B)))}));let j=(0,t.createElement)("div",{className:"schedules-item__fields"},(0,t.createElement)("div",{className:"schedules-item__fields__date-time"},(0,t.createElement)("div",{className:"control-fields-item__label"},(0,o.sprintf)( +(0,o.__)("%s the block if at least one rule set applies.","block-visibility"),y?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},h.map(((i,o)=>(0,t.createElement)(Io,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:h,allFields:f,controlName:"cookie",controlAtts:m,hideOnRuleSets:y},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide when rules apply","block-visibility"),checked:y,onChange:()=>p("cookie",(0,i.assign)({...m},{hideOnRuleSets:!y}))}))))}const Uo=[{index:1,slug:"Sun",title:(0,o.__)("Sunday","block-visibility")},{index:2,slug:"Mon",title:(0,o.__)("Monday","block-visibility")},{index:3,slug:"Tue",title:(0,o.__)("Tuesday","block-visibility")},{index:4,slug:"Wed",title:(0,o.__)("Wednesday","block-visibility")},{index:5,slug:"Thu",title:(0,o.__)("Thursday","block-visibility")},{index:6,slug:"Fri",title:(0,o.__)("Friday","block-visibility")},{index:7,slug:"Sat",title:(0,o.__)("Saturday","block-visibility")}];function jo(e){var l;const{scheduleAtts:n,setAttribute:a}=e,r=null!==(l=n?.dayOfWeek?.days)&&void 0!==l?l:[];return(0,t.createElement)("div",{className:"schedules-item__fields__day-of-week"},(0,t.createElement)("div",{className:"control-fields-item__label"},(0,o.__)("On these days","block-visibility")),(0,t.createElement)("div",{className:"day-of-week__checkbox-controls"},Uo.map((e=>(0,t.createElement)(u.CheckboxControl,{key:e.index,label:(0,t.createElement)(u.Tooltip,{text:e.title},(0,t.createElement)("span",{"aria-label":e.title},e.title.charAt(0))),checked:r.includes(e.slug),onChange:t=>{let l=[...r];t?l.push(e.slug):l=(0,i.without)(l,e.slug),a("dayOfWeek","days",l)}})))))}var qo=window.moment,zo=l.n(qo);const $o="HH:mm:ss";function Go(e){let{value:l,onUpdate:o,...n}=e;return(0,t.createElement)("input",{key:l,defaultValue:l,onBlur:function(e){const{target:t}=e;if(l===t.value)return;const a=parseInt(t.value,10);!(0,i.isInteger)(a)||void 0!==n.max&&a>n.max||void 0!==n.min&&a({minutes:r.format("mm"),hours:r.format(n?"hh":"HH"),am:r.format("H")<=11?"AM":"PM"})),[r,n]);function v(e){c(e);let t=e.format($o);t="23:59:00"===t?"23:59:59":t,a(t)}function m(e,t){let l=t;n&&"hours"===e&&"PM"===b&&(l=12!==l?t+12:l),v(s.clone()[e](l))}function y(e){return()=>{if(b===e)return;const t=parseInt(p,10);v(s.clone().hours("PM"===e?(t%12+12)%24:t%12))}}return(0,t.createElement)("fieldset",{className:"time-picker"},l&&(0,t.createElement)("span",{className:"control-fields-item__sub-label"},l),(0,t.createElement)("div",{className:"time-picker__fields-wrapper"},(0,t.createElement)("div",{className:"time-picker__fields-inputs"},(0,t.createElement)(Go,{"aria-label":(0,o.__)("Hours","block-visibility"),type:"number",name:"hours",step:1,min:n?1:0,max:n?12:23,value:p,onUpdate:m}),(0,t.createElement)("span",{"aria-hidden":"true"},":"),(0,t.createElement)(Go,{"aria-label":(0,o.__)("Minutes","block-visibility"),type:"number",name:"minutes",step:1,min:0,max:59,value:d,onUpdate:m})),n&&(0,t.createElement)(u.ButtonGroup,{className:"time-picker__fields-am-pm"},(0,t.createElement)(u.Button,{isPrimary:"AM"===b,isSecondary:"AM"!==b,onClick:y("AM"),className:"time-picker__am-button"},(0,o.__)("AM","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:"PM"===b,isSecondary:"PM"!==b,onClick:y("PM"),className:"time-picker__pm-button"},(0,o.__)("PM","block-visibility")))))}function Qo(e){var l,i;const{scheduleAtts:n,setAttribute:a}=e,r=(0,X.__experimentalGetSettings)(),s=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join("")),c=null!==(l=n?.timeOfDay)&&void 0!==l?l:{},d={start:"00:00:00",end:"00:00:00"};let p=null!==(i=c?.intervals)&&void 0!==i?i:[];0===p.length&&(c.intervals=[d],p=c.intervals);const b=(e,t,l)=>{const i=[...p],o={...p[l]};o[e]=t,i[l]=o,a("timeOfDay","intervals",i)};return(0,t.createElement)("div",{className:"schedules-item__fields__time-of-day"},(0,t.createElement)("div",{className:"control-fields-item__label"},(0,o._n)("During this time interval","During these time intervals",p.length,"block-visibility")),(0,t.createElement)("div",{className:"time-of-day__intervals"},p.map(((e,l)=>(0,t.createElement)("div",{key:`timepicker-${l}`,className:"time-of-day__interval-control"},(0,t.createElement)("div",{className:"time-of-day__interval-control__wrapper"},(0,t.createElement)(Wo,{label:(0,o.__)("From","block-visibility"),currentTime:e.start,is12Hour:s,onChange:e=>b("start",e,l),intervalIndex:l}),(0,t.createElement)(Wo,{label:(0,o.__)("To","block-visibility"),currentTime:e.end,is12Hour:s,onChange:e=>b("end",e,l)})),p.length>1&&(0,t.createElement)("div",{className:"time-of-day__interval-control__remove"},(0,t.createElement)(u.Button,{label:(0,o.__)("Clear time interval","block-visibility"),onClick:()=>(e=>{const t=p.filter(((t,l)=>l!==e));a("timeOfDay","intervals",t)})(l),icon:Ee})),e.end(()=>{const e=[...p];e.push(d),a("timeOfDay","intervals",e)})(),isLink:!0},(0,o.__)("Add interval","block-visibility"))))}function Zo(e){const{dateType:l,label:i,title:n,hasDateTime:a,setAttribute:r,setPickerOpen:s,setPickerType:c}=e;return(0,t.createElement)("div",{className:"date-time-item__field"},(0,t.createElement)(u.Button,{title:n,onClick:()=>{c(l),s(!0)}},(0,t.createElement)("span",null,i)),a&&(0,t.createElement)(u.Button,{icon:Ee,className:"clear-date-time",title:(0,o.__)("Clear date/time","block-visibility"),onClick:()=>r(l,!1,""),isSmall:!0}))}function Yo(e,t){const l=(0,X.__experimentalGetSettings)();let i=t;return e&&(i=(0,X.format)(`M j, Y ${l.formats.time}`,e)),i}function Xo(e){const{currentDate:l,label:i,setAttribute:n,setPickerOpen:a,pickerType:r}=e,s=(0,X.__experimentalGetSettings)(),c=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",focusOnMount:!0,onClose:()=>a(!1),placement:"left-start",offset:8},(0,t.createElement)("div",{className:"date-time-popover__header"},(0,t.createElement)("h2",null,i),(0,t.createElement)(u.Button,{label:(0,o.__)("Close","block-visibility"),onClick:()=>a(!1),icon:Ee,isSmall:!0})),(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{n(r,!1,e)},is12Hour:c,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0}))}function Ko(e,t,l){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e||0===e.length)return!1;const n=e.visibility_controls;return(0,i.has)(n,t)&&(0,i.has)(n[t],l)?n[t][l]:o}function Jo(l){var n,a,r,s,c,d;const{dateTime:p,schedules:v,scheduleIndex:m,scheduleAtts:y,setControlAtts:h,hideOnSchedules:f,settings:g}=l,[_,k]=(0,t.useState)(!1),[E,S]=(0,t.useState)(null),w=Ko(g,"date_time","enable_day_of_week"),C=Ko(g,"date_time","enable_time_of_day"),T=null!==(n=y?.title)&&void 0!==n?n:"",O=null===(a=y?.enable)||void 0===a||a,F=null!==(r=y?.start)&&void 0!==r?r:null,P=null!==(s=y?.end)&&void 0!==s?s:null,N=null!==(c=y?.dayOfWeek?.enable)&&void 0!==c&&c,x=null!==(d=y?.timeOfDay?.enable)&&void 0!==d&&d,A=new Date((new Date).setHours(0,0,0,0)),R=T||(0,o.__)("Schedule","block-visibility"),M=Yo(F,(0,o.__)("Now","block-visibility")),I=Yo(P,(0,o.__)("Forever","block-visibility"));let D=!1;F&&P&&(D=F>=P);const L=(e,t,l)=>{const o={...y},n=[...v];o[e]=t?(0,i.assign)({...o[e]},{[t]:l}):l,n[m]=o,h("dateTime",(0,i.assign)({...p},{schedules:[...n]}))},H=(0,t.createElement)(u.DropdownMenu,{label:(0,o.__)("Edit","block-visibility"),icon:ae,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"},toggleProps:{isSmall:!0}},(()=>(0,t.createElement)(u.TextControl,{value:T,label:(0,o.__)("Schedule title","block-visibility"),placeholder:(0,o.__)("Schedule","block-visibility"),onChange:e=>L("title",!1,e)}))),B=v.length<=1?(0,o.__)("Clear schedule","block-visibility"):(0,o.__)("Remove schedule","block-visibility"),U=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,o.__)("Options","block-visibility"),icon:Z,popoverProps:{focusOnMount:"container",placement:"left-start",offset:259}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>L("enable",!1,!O)},O?(0,o.__)("Disable","block-visibility"):(0,o.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=[...v,y];h("dateTime",(0,i.assign)({...p},{schedules:[...e]}))}(),l()}},(0,o.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=v.filter(((e,t)=>t!==m));h("dateTime",(0,i.assign)({...p},{schedules:[...e]}))}(),l()}},B)))}));let j=(0,t.createElement)("div",{className:"schedules-item__fields"},(0,t.createElement)("div",{className:"schedules-item__fields__date-time"},(0,t.createElement)("div",{className:"control-fields-item__label"},(0,o.sprintf)( // Translators: Whether the block is hidden or visible. (0,o.__)("%s the block","block-visibility"),f?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"date-time-items"},(0,t.createElement)("div",{className:"date-time-item"},(0,t.createElement)("span",{className:"control-fields-item__sub-label"},(0,o.__)("From","block-visibility")),(0,t.createElement)(Zo,{label:M,title:(0,o.__)("Choose a start date/time","block-visibility"),dateType:"start",hasDateTime:F,setAttribute:L,setPickerType:S,setPickerOpen:k})),(0,t.createElement)("div",{className:"date-time-item"},(0,t.createElement)("span",{className:"control-fields-item__sub-label"},(0,o.__)("To","block-visibility")),(0,t.createElement)(Zo,{label:I,title:(0,o.__)("Choose a end date/time","block-visibility"),dateType:"end",hasDateTime:P,setAttribute:L,setPickerType:S,setPickerOpen:k})),_&&E&&(0,t.createElement)(Xo,{currentDate:"start"===E?((e,t,l)=>{if(e)return e;const i=t?new Date(t):new Date(l);return t&&(i.setHours(0,0,0,0),i.setDate(i.getDate()-1)),i})(F,P,A):((e,t,l)=>{if(t)return t;const i=e?new Date(e):new Date(l);return i.setHours(0,0,0,0),i.setDate(i.getDate()+1),i})(F,P,A),label:"start"===E?(0,o.__)("Start Date/Time","block-visibility"):(0,o.__)("End Date/Time","block-visibility"),isOpen:k,setAttribute:L,setPickerOpen:k,pickerType:E})),D&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,o.__)("The start time is after the stop time. Please fix for date/time settings to function properly.","block-visibility"))),w&&N&&(0,t.createElement)(jo,e({setAttribute:L},l)),C&&x&&(0,t.createElement)(Qo,e({setAttribute:L},l)));return O||(j=(0,t.createElement)(u.Disabled,null,j)),(0,t.createElement)("div",{className:b()("schedules-item",{disabled:!O})},(0,t.createElement)("div",{className:"section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,R),H),(0,t.createElement)("div",{className:"section-header__toolbar"},C&&(0,t.createElement)(u.Button,{icon:V,isPressed:x,onClick:()=>L("timeOfDay","enable",!x),isSmall:!0,label:(0,o.__)("Set time of day controls","block-visibility")}),w&&(0,t.createElement)(u.Button,{icon:ke,isPressed:N,onClick:()=>L("dayOfWeek","enable",!N),isSmall:!0,label:(0,o.__)("Set day of week controls","block-visibility")}),U)),j)}function en(l){var n,a,r,s;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"date_time"===e.settingSlug&&e?.isActive)))return null;const v=null===(n=b?.plugin_settings?.enable_editor_notices)||void 0===n||n,m=null!==(a=d?.controls?.dateTime)&&void 0!==a?a:{},y=null!==(r=m?.hideOnSchedules)&&void 0!==r&&r;let h=null!==(s=m?.schedules)&&void 0!==s?s:[];if(0===h.length){const e={enable:!0,start:"",end:""};m.schedules=[e],h=m.schedules}return(0,t.createElement)("div",{className:"controls-panel-item date-time-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,o.__)("Date & Time","block-visibility")),v&&(0,t.createElement)(Te,{message:(0,o.__)("The Date & Time control allows you to schedule when the block should be visible. Dates and times are relative to the timezone set in your website's General settings.","block-visibility"),link:ie.editorDateTime,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:G,onClick:()=>(()=>{const e=[...h];e.push({enable:!0,start:"",end:""}),p("dateTime",(0,i.assign)({...m},{schedules:[...e]}))})(),label:(0,o.__)("Add schedule","block-visibility"),isSmall:!0}))),v&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,o.sprintf)( // Translators: Whether the block is hidden or visible. @@ -40,7 +40,7 @@ // Translators: Whether the block is hidden or visible. (0,o.__)("%s the block if","block-visibility"),T?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"fields-container"},(0,t.createElement)(Eo,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:A,value:A.filter((e=>e.value===C)),placeholder:(0,o.__)("Select Condition…","block-visibility"),onChange:e=>function(e){var t;const l=null!==(t=e?.value)&&void 0!==t?t:"all";m({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{operator:l})})})}(e)}),(0,t.createElement)(Eo,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:(0,i.isEmpty)(_)?null:_,value:P,placeholder:N,onChange:e=>function(e){const t=[];0!==e.length&&e.forEach((e=>{t.push(e.value)})),m({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{presets:t})})})}(e),isMulti:!0,isLoading:g.isResolving,isDisabled:null===_||(0,i.isEmpty)(_)})),null!==_&&0===_.length&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,o.__)("Add visibility presets using the plus icon in the toolbar above.","block-visibility")),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide when presets apply","block-visibility"),checked:T,onChange:()=>m({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{hideOnPresets:!T})})})})))),p&&(0,t.createElement)(u.Modal,{className:"block-visibility__preset-manager-modal",title:(0,o.__)("Block Visibility Presets","block-visibility"),onRequestClose:()=>b(!1),shouldCloseOnClickOutside:!1,isFullScreen:!0},(0,t.createElement)(Fn,null)))}function En(){const e=[{value:"equal",label:(0,o.__)("Is equal to","block-visibility")},{value:"notEqual",label:(0,o.__)("Is not equal to","block-visibility")},{value:"greaterThan",label:(0,o.__)("Is greater than","block-visibility")},{value:"lessThan",label:(0,o.__)("Is less than","block-visibility")},{value:"greaterThanEqual",label:(0,o.__)("Is greater or equal to","block-visibility")},{value:"lessThanEqual",label:(0,o.__)("Is less than or equal to","block-visibility")}],t=[{value:"equal",label:(0,o.__)("Was placed on","block-visibility")},{value:"notEqual",label:(0,o.__)("Was not placed on","block-visibility")},{value:"greaterThan",label:(0,o.__)("Was placed after","block-visibility")},{value:"lessThan",label:(0,o.__)("Was placed before","block-visibility")}],l=[{value:"equal",label:(0,o.__)("On","block-visibility")},{value:"notEqual",label:(0,o.__)("Not on","block-visibility")},{value:"greaterThan",label:(0,o.__)("After","block-visibility")},{value:"lessThan",label:(0,o.__)("Before","block-visibility")}],i=[{value:"atLeastOne",label:(0,o.__)("At least one of the selected","block-visibility")},{value:"all",label:(0,o.__)("All of the selected","block-visibility")},{value:"none",label:(0,o.__)("None of the selected","block-visibility")}],n=(0,o.__)("Select Condition…","block-visibility"),a=(0,o.__)("Select Order Type…","block-visibility"),r=(0,o.__)("Select Product Category…","block-visibility"),s=(0,o.__)("Select Product…","block-visibility");return[{value:"cartContents",label:(0,o.__)("Cart Contents","block-visibility"),group:"cart",fields:[{type:"subField",name:"cartContents",valueType:"select",options:[{value:"empty",label:(0,o.__)("Is empty","block-visibility")},{value:"notEmpty",label:(0,o.__)("Is not empty","block-visibility")},{value:"containsProducts",label:(0,o.__)("Contains (Products)","block-visibility")},{value:"containsCategories",label:(0,o.__)("Contains (Categories)","block-visibility")}],placeholder:n,triggerReset:!0},{type:"operatorField",valueType:"select",options:i,placeholder:n,displayConditions:[{dependencyType:"subField",dependencyName:"cartContents",dependencyValues:["containsProducts","containsCategories"]}]},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:["containsProducts","containsCategories"],valueTypes:[{value:"containsProducts",valueType:"productsSelect",placeholder:s},{value:"containsCategories",valueType:"termsSelect",valueTypeVariant:"product_cat",placeholder:r}]}],displayConditions:[{dependencyType:"subField",dependencyValues:["containsProducts","containsCategories"]}]}]},{value:"cartTotalQuantity",label:(0,o.__)("Total Products in Cart","block-visibility"),group:"cart",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"cartTotalValue",label:(0,o.__)("Total Cart Value","block-visibility"),group:"cart",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"cartProductQuantity",label:(0,o.__)("Quantity of Product in Cart","block-visibility"),help:(0,o.__)("Quantity applies to each selected product.","block-visibility"),group:"cart",fields:[{type:"subField",name:"products",valueType:"productsSelect",placeholder:s},{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"cartCategoryQuantity",label:(0,o.__)("Quantity of Category in Cart","block-visibility"),help:(0,o.__)("Quantity of products in cart which belong to the selected category. Quantity applies to each category.","block-visibility"),group:"cart",fields:[{type:"subField",name:"categories",valueType:"termsSelect",valueTypeVariant:"product_cat",placeholder:r},{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"customerTotalSpent",label:(0,o.__)("Total Spent","block-visibility"),group:"customer-value",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"customerAverageOrderValue",label:(0,o.__)("Average Order Value","block-visibility"),group:"customer-value",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"customerTotalOrders",label:(0,o.__)("Total Orders","block-visibility"),group:"customer-quantity",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"customerQuantityProductOrdered",label:(0,o.__)("Quantity of Product Ordered","block-visibility"),help:(0,o.__)("Quantity applies to each selected product.","block-visibility"),group:"customer-quantity",fields:[{type:"subField",name:"products",valueType:"productsSelect",placeholder:s},{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"customerQuantityCategoryOrdered",label:(0,o.__)("Quantity of Category Ordered","block-visibility"),help:(0,o.__)("Quantity of products ordered which belong to the category. Applies to each selected category.","block-visibility"),group:"customer-quantity",fields:[{type:"subField",name:"categories",valueType:"termsSelect",valueTypeVariant:"product_cat",placeholder:r},{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"customerTimeSinceOrder",label:(0,o.__)("Time Since Order","block-visibility"),help:(0,o.__)("The number of days since the customer's order was placed.","block-visibility"),group:"customer-time",fields:[{type:"subField",name:"orderType",valueType:"select",options:[{value:"first",label:(0,o.__)("First order","block-visibility")},{value:"last",label:(0,o.__)("Last order","block-visibility")}],placeholder:a},{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0},{value:"customerTimeSinceProductOrdered",label:(0,o.__)("Time Since Product Ordered","block-visibility"),help:(0,o.__)("The number of days since the product was ordered. Applies to each selected product.","block-visibility"),group:"customer-time",fields:[{type:"subField",name:"orderType",valueType:"select",options:[{value:"first",label:(0,o.__)("First order","block-visibility")},{value:"last",label:(0,o.__)("Last order","block-visibility")}],placeholder:a},{type:"subField",name:"products",valueType:"productsSelect",placeholder:s},{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasMultipleSubFields:!0,hasSimplifiedLayout:!0},{value:"customerTimeSinceCategoryOrdered",label:(0,o.__)("Time Since Category Ordered","block-visibility"),help:(0,o.__)("The number of days since the category was ordered. Applies to each selected category.","block-visibility"),group:"customer-time",fields:[{type:"subField",name:"orderType",valueType:"select",options:[{value:"first",label:(0,o.__)("First order","block-visibility")},{value:"last",label:(0,o.__)("Last order","block-visibility")}],placeholder:a},{type:"subField",name:"categories",valueType:"termsSelect",valueTypeVariant:"product_cat",placeholder:r},{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasMultipleSubFields:!0,hasSimplifiedLayout:!0},{value:"customerDateOfOrder",label:(0,o.__)("Date of Order","block-visibility"),group:"customer-time",fields:[{type:"subField",valueType:"select",options:[{value:"first",label:(0,o.__)("First order","block-visibility")},{value:"last",label:(0,o.__)("Last order","block-visibility")}],placeholder:a},{type:"operatorField",valueType:"select",options:t,placeholder:n},{type:"valueField",valueType:"date"}]},{value:"customerDateOfProductOrdered",label:(0,o.__)("Date of Product Ordered","block-visibility"),group:"customer-time",fields:[{type:"subField",name:"orderType",valueType:"select",options:[{value:"first",label:(0,o.__)("First ordered","block-visibility")},{value:"last",label:(0,o.__)("Last ordered","block-visibility")}],placeholder:a},{type:"subField",name:"products",valueType:"productsSelect",placeholder:s},{type:"operatorField",valueType:"select",options:l,placeholder:n},{type:"valueField",valueType:"date"}],hasMultipleSubFields:!0},{value:"customerDateOfCategoryOrdered",label:(0,o.__)("Date of Category Ordered","block-visibility"),group:"customer-time",fields:[{type:"subField",name:"orderType",valueType:"select",options:[{value:"first",label:(0,o.__)("First ordered","block-visibility")},{value:"last",label:(0,o.__)("Last ordered","block-visibility")}],placeholder:a},{type:"subField",name:"categories",valueType:"termsSelect",valueTypeVariant:"product_cat",placeholder:r},{type:"operatorField",valueType:"select",options:l,placeholder:n},{type:"valueField",valueType:"date"}],hasMultipleSubFields:!0},{value:"productInventory",label:(0,o.__)("Product Inventory","block-visibility"),group:"product",fields:[{type:"subField",name:"products",valueType:"productSelect",placeholder:s},{type:"valueField",valueType:"select",options:[{value:"inStock",label:(0,o.__)("Is in stock","block-visibility")},{value:"outOfStock",label:(0,o.__)("Is out of stock","block-visibility")},{value:"onBackorder",label:(0,o.__)("Is on backorder","block-visibility")}],placeholder:(0,o.__)("Select Inventory Status…","block-visibility")}]},{value:"productQuantityInStock",label:(0,o.__)("Quantity of Product in Stock","block-visibility"),group:"product",fields:[{type:"subField",valueType:"productSelect",placeholder:s},{type:"operatorField",valueType:"select",options:e,placeholder:n},{type:"valueField",valueType:"number"}],hasSimplifiedLayout:!0}]}function Sn(l){var n,a,r,s,c;const{variables:d,enabledControls:p,controlSetAtts:b,setControlAtts:v,settings:m}=l,y=null!==(n=d?.integrations?.woocommerce?.active)&&void 0!==n&&n;if(!p.some((e=>"woocommerce"===e.settingSlug&&e?.isActive))||!y)return null;const h=null===(a=m?.plugin_settings?.enable_editor_notices)||void 0===a||a,f=null!==(r=b?.controls?.woocommerce)&&void 0!==r?r:{},g=null!==(s=f?.hideOnRuleSets)&&void 0!==s&&s,_=null!==(c=f?.ruleSets)&&void 0!==c?c:[];0===_.length&&_.push({enable:!0,rules:[{field:""}]});const k=function(){const e=[{value:"cart",label:(0,o.__)("Cart","block-visibility")},{value:"customer-value",label:(0,o.__)("Customer History - Value","block-visibility")},{value:"customer-quantity",label:(0,o.__)("Customer History - Quantity","block-visibility")},{value:"customer-time",label:(0,o.__)("Customer History - Time","block-visibility")},{value:"product",label:(0,o.__)("Product","block-visibility")}],t=En(),l=[];return e.forEach((e=>{var i,o;const n=null!==(i=e?.value)&&void 0!==i?i:"",a=null!==(o=e?.label)&&void 0!==o?o:"",r=t.filter((e=>e.group===n));l.push({value:n,label:a,options:r})})),l}(),E=En();return(0,t.createElement)("div",{className:"controls-panel-item woocommerce-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)(W,{icon:L}),(0,t.createElement)("span",null,(0,o.__)("WooCommerce","block-visibility")),h&&(0,t.createElement)(Te,{message:(0,o.__)("The WooCommerce control allows you to configure block visibility based on various store-related rules.","block-visibility"),link:ie.editorWoocommerce,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:G,onClick:()=>(()=>{const e=[..._,{enable:!0,rules:[{field:""}]}];v("woocommerce",(0,i.assign)({...f},{ruleSets:[...e]}))})(),label:(0,o.__)("Add rule set","block-visibility"),isSmall:!0}))),h&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,o.sprintf)( // Translators: Whether the block is hidden or visible. -(0,o.__)("%s the block if at least one rule set applies.","block-visibility"),g?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},!d?.integrations?.woocommerce?.products&&(0,t.createElement)(u.Notice,{className:"no-products-notice",status:"warning",isDismissible:!1},(0,o.__)("It appears that your store has no published products.","block-visibility")),(0,t.createElement)("div",{className:"rule-sets"},_.map(((i,o)=>(0,t.createElement)(Io,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:_,groupedFields:k,allFields:E,controlName:"woocommerce",controlAtts:f,hideOnRuleSets:g},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide when rules apply","block-visibility"),checked:g,onChange:()=>v("woocommerce",(0,i.assign)({...f},{hideOnRuleSets:!g}))}))))}function wn(e){var l,n,a,r,s,c,d,p,b;const{controlSetAtts:v,enabledControls:m,setControlAtts:y,settings:h,variables:f}=e,g=null!==(l=f?.integrations?.wp_fusion?.active)&&void 0!==l&&l;if(!m.some((e=>"wp_fusion"===e.settingSlug&&e?.isActive))||!g)return null;const _=null===(n=h?.plugin_settings?.enable_editor_notices)||void 0===n||n,k=null!==(a=v?.controls.hasOwnProperty("userRole"))&&void 0!==a&&a,E=null!==(r=v?.controls?.userRole?.visibilityByRole)&&void 0!==r?r:"public",S=null!==(s=f?.integrations?.wp_fusion?.tags)&&void 0!==s?s:[],w=e=>S.filter((t=>e.includes(t.value))),C=null!==(c=v?.controls?.wpFusion)&&void 0!==c?c:{},T=w(null!==(d=C?.tagsAny)&&void 0!==d?d:[]),O=w(null!==(p=C?.tagsAll)&&void 0!==p?p:[]),F=w(null!==(b=C?.tagsNot)&&void 0!==b?b:[]),P=(e,t)=>{const l=[];0!==t.length&&t.forEach((e=>{l.push(e.value)})),y("wpFusion",(0,i.assign)({...C},{[e]:l}))};let N=(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)("div",{className:"components-base-control__label"},(0,t.createInterpolateElement)((0,o.__)("Required Tags (Any)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(Eo,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:T,placeholder:(0,o.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsAny",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,o.__)("Only visible to logged-in users with at least one of the selected tags.","block-visibility"))),(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)("div",{className:"components-base-control__label"},(0,t.createInterpolateElement)((0,o.__)("Required Tags (All)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(Eo,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:O,placeholder:(0,o.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsAll",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,t.createInterpolateElement)((0,o.__)("Only visible to logged-in users with all of the selected tags.","block-visibility"),{strong:(0,t.createElement)("strong",null)}))));"public"!==E&&"logged-out"!==E||(N=(0,t.createElement)(u.Disabled,null,N));let x=(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)("div",{className:"components-base-control__label"},(0,t.createInterpolateElement)((0,o.__)("Required Tags (Not)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(Eo,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:F,placeholder:(0,o.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsNot",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,o.__)("Hide from logged-in users with at least one of the selected tags.","block-visibility")));return"logged-out"===E&&(x=(0,t.createElement)(u.Disabled,null,x)),(0,t.createElement)("div",{className:"controls-panel-item wp-fusion-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)(W,{icon:H}),(0,t.createElement)("span",null,(0,o.__)("WP Fusion","block-visibility")),_&&(0,t.createElement)(Te,{message:(0,o.__)("The WP Fusion control allows you to configure block visibility based on WP Fusion tags.","block-visibility"),subMessage:(0,o.__)("Note that the available fields depend on the User Role control settings. If the User Role control is disabled, only the Required Tags (Not) field will be available.","block-visibility"),link:ie.editorWpFusion,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},N,x,!k&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,o.__)("The WP Fusion control works best in coordination with the User Role control, which has been disabled.","block-visibility"))))}const Cn=(0,u.withFilters)("blockVisibility.addControlSetControls")((e=>(0,t.createElement)(t.Fragment,null)));function Tn(l){var n;const{index:a,controlSetAtts:r,setControlSetAtts:s,enabledControls:c}=l,d=null===(n=r?.enable)||void 0===n||n,p="multiple-"+r?.id;if(0===c.length)return null;const b=[];c.forEach((e=>{var t;b.push({label:e.label,type:e.type,attributeSlug:e.attributeSlug,settingSlug:e.settingSlug,icon:null!==(t=e?.icon)&&void 0!==t&&t,isActive:r?.controls?.hasOwnProperty(e.attributeSlug)})}));const v=b.filter((e=>e.isActive));function m(e,t){var l;const o=null!==(l=r?.controls)&&void 0!==l?l:{},n=(0,i.assign)({...r},{controls:(0,i.assign)({...o},{[e]:t})});s(n)}let y=(0,t.createElement)("div",{className:"control-set__controls"},(0,t.createElement)(Ho,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(Bo,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(en,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(an,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(sn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(cn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(un,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(pn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(dn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(fn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(u.Slot,{name:"ControlSetControls-"+p}),(0,t.createElement)(Do,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(ln,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(Sn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(wn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(u.Slot,{name:"ControlSetControlsIntegrations-"+p}),(0,t.createElement)(u.Slot,{name:"ControlSetControlsBottom-"+p}));return d||(y=(0,t.createElement)(u.Disabled,null,y)),(0,t.createElement)("div",{className:"control-set"},(0,t.createElement)(me,e({},l,{key:a,activeSetControls:v,enabledSetControls:b,setControlSetAtts:s})),v.length>0&&y,0===v.length&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,o.__)("Add visibility controls using the plus icon in the toolbar above.","block-visibility")),(0,t.createElement)(Cn,e({},l,{uniqueIndex:p,setControlAtts:m,enabledControls:b})))}function On(l){var n,a,r;const{enabledControls:s,presetAttributes:c,setPresetAttributes:d,controlSets:p,setHasUpdates:v,variables:m}=l,y=null!==(n=m?.plugin_variables?.settings_url)&&void 0!==n?n:"",h=null!==(a=c?.layout)&&void 0!==a?a:"columns",f=null!==(r=c?.hideBlock)&&void 0!==r&&r;function g(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const l=[...p];let o;l.forEach(((t,l)=>{t.id===e.id&&(o=l)})),t?l.splice(o,1):(0,i.isUndefined)(o)?l.push(e):l[o]=e,d({...c,controlSets:[...l]}),v(!0)}return(0,t.createElement)("div",{className:"control-sets"},(0,t.createElement)("div",{className:"control-sets__header"},(0,t.createElement)("div",{className:"control-sets__header-title"},(0,t.createElement)("h2",null,(0,o.__)("Control Sets","block-visibility")),(0,t.createElement)(Te,{message:(0,o.__)("Each control set represents a group of visibility controls that form “AND” conditions. All controls within a control set must be satisfied for the block to be visible.","block-visibility"),subMessage:(0,o.__)('Multiple control sets allow you to create "OR" conditions between each set.',"block-visibility"),link:ie.editorVisibilityPresets,position:"bottom center"})),(0,t.createElement)("div",{className:"control-sets__description"},(0,o.__)("Show the block if at least one control set applies.","block-visibility"))),s.length>0&&(0,t.createElement)("div",{className:"control-sets__container-outer"},(0,t.createElement)("div",{className:b()("control-sets__container",{"is-rows":"rows"===h})},p.map(((i,o)=>(0,t.createElement)("div",{key:o,className:"control-set__container"},[!f&&(0,t.createElement)(Tn,e({key:o,index:o,controlSetAtts:i,setControlSetAtts:g},l)),f&&(0,t.createElement)("div",{className:"control-set__disabled"},(0,t.createElement)(u.Disabled,null,(0,t.createElement)(Tn,e({key:o,index:o,controlSetAtts:i,setControlSetAtts:g},l))))]))),(0,t.createElement)("div",{className:"control-set__inserter-button"},(0,t.createElement)(u.Button,{label:(0,o.__)("Add control set","block-visibility"),icon:G,onClick:function(){const e={id:Math.max(...p.map((e=>e.id)),0)+1,enable:!0,controls:{}};d({...c,controlSets:[...p,e]}),v(!0)},isPrimary:!0,isSmall:!0})))),0===s.length&&(0,t.createElement)("div",{className:"control-sets__notices"},(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,o.__)("All visibility controls have been manually disabled. Visit the plugin settings to re-enable.","block-visibility"),{a:(0,t.createElement)("a",{href:y+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))))}function Fn(){var e;const[l,n]=(0,t.useState)({}),[r,s]=(0,t.useState)(!1),c=(0,a.useEntityRecords)("postType","visibility_preset",{per_page:-1,orderby:"modified"}),d=(0,a.useEntityRecord)("block-visibility/v1","settings"),p=(0,a.useEntityRecord)("block-visibility/v1","variables");if(c.isResolving||d.isResolving||p.isResolving)return null;const b=c.records,v=d.record,m=p.record,y=U(v,m).filter((e=>"hideBlock"!==e.attributeSlug&&"visibilityPresets"!==e.attributeSlug));let h=null!==(e=l?.controlSets)&&void 0!==e?e:[];function f(){n({title:"",enable:!0}),s(!0)}return 0===h.length&&(h=[{id:1,enable:!0}]),(0,t.createElement)("div",{className:"preset-manager"},(0,t.createElement)(Q,{presetAttributes:l,setPresetAttributes:n,presets:b,addNewPreset:f,hasUpdates:r,setHasUpdates:s}),(0,t.createElement)("div",{className:"preset-manager__content"},(0,i.isEmpty)(l)&&(0,t.createElement)("div",{className:"preset-manager__content-placeholder"},(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>f()},(0,o.__)("New preset","block-visibility")),(0,t.createElement)("p",null,[(0,i.isEmpty)(b)&&(0,o.__)("To get started, create a new visibility preset.","block-visibility"),!(0,i.isEmpty)(b)&&(0,o.__)("Create a new visibility preset or edit an existing one.","block-visibility")])),!(0,i.isEmpty)(l)&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(oe,{presetAttributes:l,setPresetAttributes:n,presets:b,controlSets:h,enabledControls:y,hasUpdates:r,setHasUpdates:s,settings:v,variables:m}),(0,t.createElement)(On,{presetAttributes:l,setPresetAttributes:n,controlSets:h,enabledControls:y,setHasUpdates:s,settings:v,variables:m}))))}function Pn(l){var n;const[a,r]=(0,t.useState)(!1),{activeControls:s,attributes:c,setAttributes:d,enabledControls:p,controlSetAtts:b,setControlSetAtts:v,settings:m}=l,y=null!==(n=c?.blockVisibility)&&void 0!==n?n:{},h=p.filter((e=>e.isDefault)),f=N(m,"enable_control_set_utilities");h.forEach((e=>{"hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug?e.hasEdits=y.hasOwnProperty(e.attributeSlug):e.hasEdits=b?.controls?.hasOwnProperty(e.attributeSlug)}));const g=p.filter((e=>"integration"!==e.type&&!e.isDefault)),_=p.filter((e=>"integration"===e.type&&!e.isDefault));function k(e,t){if("hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug)e.hasEdits||e.isActive&&!e.isDefault?d({blockVisibility:(0,i.omit)({...y},[e.attributeSlug])}):d({blockVisibility:(0,i.assign)({...y},{[e.attributeSlug]:"hideBlock"!==e.attributeSlug&&{}})});else if("reset"===t)v((0,i.assign)({...b},{controls:{...(0,i.omit)({...b.controls},[e.attributeSlug])}}));else{let t;t=e.isActive?(0,i.omit)({...b.controls},[e.attributeSlug]):(0,i.assign)({...b.controls},{[e.attributeSlug]:{}}),v((0,i.assign)({...b},{controls:{...t}}))}}const E=[...h,...g,..._].some((e=>e.isActive&&!e.isDefault||e.isDefault&&e.hasEdits)),S=(0,t.createElement)(u.DropdownMenu,{className:"controls-dropdown",icon:0===s.length?G:Z,label:(0,o.__)("Visibility Controls","block-visibility"),popoverProps:{className:"block-visibility__control-popover visibility-controls",focusOnMount:"container"},toggleProps:{isSmall:!0,disabled:0===p.length}},(i=>{let{onClose:n}=i;return(0,t.createElement)(t.Fragment,null,0!==h.length&&(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Defaults","block-visibility")},h.map(((e,l)=>(0,t.createElement)(xn,{key:l,control:e,toggleControls:k})))),(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Controls","block-visibility")},g.map(((e,l)=>(0,t.createElement)(Nn,{key:l,control:e,toggleControls:k})))),0!==_.length&&(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Integrations","block-visibility")},_.map(((e,l)=>(0,t.createElement)(Nn,{key:l,control:e,toggleControls:k})))),(0,t.createElement)(u.MenuGroup,null,f&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(pe,e({canResetAll:E},l)),(0,t.createElement)(be,{modalOpen:a,onClose:n,setModalOpen:r})),(0,t.createElement)(u.MenuItem,{"aria-disabled":!E,onClick:()=>{E&&(d({blockVisibility:void 0}),(0,ne.speak)((0,o.__)("All controls reset","block-visibility"),"assertive"))},variant:"tertiary"},(0,o.__)("Reset all","block-visibility"))))}));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"controls-panel-header"},(0,t.createElement)("h2",null,(0,o.__)("Visibility","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-header__dropdown-menus"},S)),a&&f&&(0,t.createElement)(ve,e({coreControls:g,integrationControls:_,modalOpen:a,setModalOpen:r,toggleControls:k},l)))}function Nn(e){const{control:l,toggleControls:i}=e;return(0,t.createElement)(u.MenuItem,{key:l.attributeSlug,icon:l.isActive&&ce,label:(0,o.sprintf)( +(0,o.__)("%s the block if at least one rule set applies.","block-visibility"),g?(0,o.__)("Hide","block-visibility"):(0,o.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},!d?.integrations?.woocommerce?.products&&(0,t.createElement)(u.Notice,{className:"no-products-notice",status:"warning",isDismissible:!1},(0,o.__)("It appears that your store has no published products.","block-visibility")),(0,t.createElement)("div",{className:"rule-sets"},_.map(((i,o)=>(0,t.createElement)(Io,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:_,groupedFields:k,allFields:E,controlName:"woocommerce",controlAtts:f,hideOnRuleSets:g},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,o.__)("Hide when rules apply","block-visibility"),checked:g,onChange:()=>v("woocommerce",(0,i.assign)({...f},{hideOnRuleSets:!g}))}))))}function wn(e){var l,n,a,r,s,c,d,p,b;const{controlSetAtts:v,enabledControls:m,setControlAtts:y,settings:h,variables:f}=e,g=null!==(l=f?.integrations?.wp_fusion?.active)&&void 0!==l&&l;if(!m.some((e=>"wp_fusion"===e.settingSlug&&e?.isActive))||!g)return null;const _=null===(n=h?.plugin_settings?.enable_editor_notices)||void 0===n||n,k=null!==(a=v?.controls.hasOwnProperty("userRole"))&&void 0!==a&&a,E=null!==(r=v?.controls?.userRole?.visibilityByRole)&&void 0!==r?r:"public",S=null!==(s=f?.integrations?.wp_fusion?.tags)&&void 0!==s?s:[],w=e=>S.filter((t=>e.includes(t.value))),C=null!==(c=v?.controls?.wpFusion)&&void 0!==c?c:{},T=w(null!==(d=C?.tagsAny)&&void 0!==d?d:[]),O=w(null!==(p=C?.tagsAll)&&void 0!==p?p:[]),F=w(null!==(b=C?.tagsNot)&&void 0!==b?b:[]),P=(e,t)=>{const l=[];0!==t.length&&t.forEach((e=>{l.push(e.value)})),y("wpFusion",(0,i.assign)({...C},{[e]:l}))};let N=(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)("div",{className:"components-base-control__label"},(0,t.createInterpolateElement)((0,o.__)("Required Tags (Any)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(Eo,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:T,placeholder:(0,o.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsAny",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,o.__)("Only visible to logged-in users with at least one of the selected tags.","block-visibility"))),(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)("div",{className:"components-base-control__label"},(0,t.createInterpolateElement)((0,o.__)("Required Tags (All)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(Eo,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:O,placeholder:(0,o.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsAll",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,t.createInterpolateElement)((0,o.__)("Only visible to logged-in users with all of the selected tags.","block-visibility"),{strong:(0,t.createElement)("strong",null)}))));"public"!==E&&"logged-out"!==E||(N=(0,t.createElement)(u.Disabled,null,N));let x=(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)("div",{className:"components-base-control__label"},(0,t.createInterpolateElement)((0,o.__)("Required Tags (Not)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(Eo,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:F,placeholder:(0,o.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsNot",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,o.__)("Hide from logged-in users with at least one of the selected tags.","block-visibility")));return"logged-out"===E&&(x=(0,t.createElement)(u.Disabled,null,x)),(0,t.createElement)("div",{className:"controls-panel-item wp-fusion-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)(W,{icon:H}),(0,t.createElement)("span",null,(0,o.__)("WP Fusion","block-visibility")),_&&(0,t.createElement)(Te,{message:(0,o.__)("The WP Fusion control allows you to configure block visibility based on WP Fusion tags.","block-visibility"),subMessage:(0,o.__)("Note that the available fields depend on the User Role control settings. If the User Role control is disabled, only the Required Tags (Not) field will be available.","block-visibility"),link:ie.editorWpFusion,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},N,x,!k&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,o.__)("The WP Fusion control works best in coordination with the User Role control, which has been disabled.","block-visibility"))))}const Cn=(0,u.withFilters)("blockVisibility.addControlSetControls")((e=>(0,t.createElement)(t.Fragment,null)));function Tn(l){var n;const{index:a,controlSetAtts:r,setControlSetAtts:s,enabledControls:c}=l,d=null===(n=r?.enable)||void 0===n||n,p="multiple-"+r?.id;if(0===c.length)return null;const b=[];c.forEach((e=>{var t;b.push({label:e.label,type:e.type,attributeSlug:e.attributeSlug,settingSlug:e.settingSlug,icon:null!==(t=e?.icon)&&void 0!==t&&t,isActive:r?.controls?.hasOwnProperty(e.attributeSlug)})}));const v=b.filter((e=>e.isActive));function m(e,t){var l;const o=null!==(l=r?.controls)&&void 0!==l?l:{},n=(0,i.assign)({...r},{controls:(0,i.assign)({...o},{[e]:t})});s(n)}let y=(0,t.createElement)("div",{className:"control-set__controls"},(0,t.createElement)(Ho,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(Bo,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(en,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(an,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(sn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(cn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(un,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(pn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(dn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(fn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(u.Slot,{name:"ControlSetControls-"+p}),(0,t.createElement)(Do,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(ln,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(Sn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(wn,e({},l,{enabledControls:b,setControlAtts:m})),(0,t.createElement)(u.Slot,{name:"ControlSetControlsIntegrations-"+p}),(0,t.createElement)(u.Slot,{name:"ControlSetControlsBottom-"+p}));return d||(y=(0,t.createElement)(u.Disabled,null,y)),(0,t.createElement)("div",{className:"control-set"},(0,t.createElement)(me,e({},l,{key:a,activeSetControls:v,enabledSetControls:b,setControlSetAtts:s})),v.length>0&&y,0===v.length&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,o.__)("Add visibility controls using the plus icon in the toolbar above.","block-visibility")),(0,t.createElement)(Cn,e({},l,{uniqueIndex:p,setControlAtts:m,enabledControls:b})))}function On(l){var n,a,r;const{enabledControls:s,presetAttributes:c,setPresetAttributes:d,controlSets:p,setHasUpdates:v,variables:m}=l,y=null!==(n=m?.plugin_variables?.settings_url)&&void 0!==n?n:"",h=null!==(a=c?.layout)&&void 0!==a?a:"columns",f=null!==(r=c?.hideBlock)&&void 0!==r&&r;function g(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const l=[...p];let o;l.forEach(((t,l)=>{t.id===e.id&&(o=l)})),t?l.splice(o,1):(0,i.isUndefined)(o)?l.push(e):l[o]=e,d({...c,controlSets:[...l]}),v(!0)}return(0,t.createElement)("div",{className:"control-sets"},(0,t.createElement)("div",{className:"control-sets__header"},(0,t.createElement)("div",{className:"control-sets__header-title"},(0,t.createElement)("h2",null,(0,o.__)("Control Sets","block-visibility")),(0,t.createElement)(Te,{message:(0,o.__)("Each control set represents a group of visibility controls that form “AND” conditions. All controls within a control set must be satisfied for the block to be visible.","block-visibility"),subMessage:(0,o.__)('Multiple control sets allow you to create "OR" conditions between each set.',"block-visibility"),link:ie.editorVisibilityPresets,position:"bottom center"})),(0,t.createElement)("div",{className:"control-sets__description"},(0,o.__)("Show the block if at least one control set applies.","block-visibility"))),s.length>0&&(0,t.createElement)("div",{className:"control-sets__container-outer"},(0,t.createElement)("div",{className:b()("control-sets__container",{"is-rows":"rows"===h})},p.map(((i,o)=>(0,t.createElement)("div",{key:o,className:"control-set__container"},[!f&&(0,t.createElement)(Tn,e({key:o,index:o,controlSetAtts:i,setControlSetAtts:g},l)),f&&(0,t.createElement)("div",{className:"control-set__disabled"},(0,t.createElement)(u.Disabled,null,(0,t.createElement)(Tn,e({key:o,index:o,controlSetAtts:i,setControlSetAtts:g},l))))]))),(0,t.createElement)("div",{className:"control-set__inserter-button"},(0,t.createElement)(u.Button,{label:(0,o.__)("Add control set","block-visibility"),icon:G,onClick:function(){const e={id:Math.max(...p.map((e=>e.id)),0)+1,enable:!0,controls:{}};d({...c,controlSets:[...p,e]}),v(!0)},isPrimary:!0,isSmall:!0})))),0===s.length&&(0,t.createElement)("div",{className:"control-sets__notices"},(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,o.__)("All visibility controls have been manually disabled. Visit the plugin settings to re-enable.","block-visibility"),{a:(0,t.createElement)("a",{href:y+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))))}function Fn(){var e;const[l,n]=(0,t.useState)({}),[r,s]=(0,t.useState)(!1),c=(0,a.useEntityRecords)("postType","visibility_preset",{per_page:-1,orderby:"modified"}),d=(0,a.useEntityRecord)("block-visibility/v1","settings"),p=(0,a.useEntityRecord)("block-visibility/v1","variables");if(c.isResolving||d.isResolving||p.isResolving)return null;const b=c.records,v=d.record,m=p.record,y=U(v,m).filter((e=>"hideBlock"!==e.attributeSlug&&"visibilityPresets"!==e.attributeSlug));let h=null!==(e=l?.controlSets)&&void 0!==e?e:[];function f(){n({title:"",enable:!0}),s(!0)}return 0===h.length&&(h=[{id:1,enable:!0}]),(0,t.createElement)("div",{className:"preset-manager"},(0,t.createElement)(Q,{presetAttributes:l,setPresetAttributes:n,presets:b,addNewPreset:f,hasUpdates:r,setHasUpdates:s}),(0,t.createElement)("div",{className:"preset-manager__content"},(0,i.isEmpty)(l)&&(0,t.createElement)("div",{className:"preset-manager__content-placeholder"},(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>f()},(0,o.__)("New preset","block-visibility")),(0,t.createElement)("p",null,[(0,i.isEmpty)(b)&&(0,o.__)("To get started, create a new visibility preset.","block-visibility"),!(0,i.isEmpty)(b)&&(0,o.__)("Create a new visibility preset or edit an existing one.","block-visibility")])),!(0,i.isEmpty)(l)&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(oe,{presetAttributes:l,setPresetAttributes:n,presets:b,controlSets:h,enabledControls:y,hasUpdates:r,setHasUpdates:s,settings:v,variables:m}),(0,t.createElement)(On,{presetAttributes:l,setPresetAttributes:n,controlSets:h,enabledControls:y,setHasUpdates:s,settings:v,variables:m}))))}function Pn(l){var n;const[a,r]=(0,t.useState)(!1),{activeControls:s,attributes:c,setAttributes:d,enabledControls:p,controlSetAtts:b,setControlSetAtts:v,settings:m}=l,y=null!==(n=c?.blockVisibility)&&void 0!==n?n:{},h=p.filter((e=>e.isDefault)),f=N(m,"enable_control_set_utilities");h.forEach((e=>{"hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug?e.hasEdits=y.hasOwnProperty(e.attributeSlug):e.hasEdits=b?.controls?.hasOwnProperty(e.attributeSlug)}));const g=p.filter((e=>"integration"!==e.type&&!e.isDefault)),_=p.filter((e=>"integration"===e.type&&!e.isDefault));function k(e,t){if("hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug)e.hasEdits||e.isActive&&!e.isDefault?d({blockVisibility:(0,i.omit)({...y},[e.attributeSlug])}):d({blockVisibility:(0,i.assign)({...y},{[e.attributeSlug]:"hideBlock"!==e.attributeSlug&&{}})});else if("reset"===t)v((0,i.assign)({...b},{controls:{...(0,i.omit)({...b.controls},[e.attributeSlug])}}));else{let t;t=e.isActive?(0,i.omit)({...b.controls},[e.attributeSlug]):(0,i.assign)({...b.controls},{[e.attributeSlug]:{}}),v((0,i.assign)({...b},{controls:{...t}}))}}const E=[...h,...g,..._].some((e=>e.isActive&&!e.isDefault||e.isDefault&&e.hasEdits)),S=(0,t.createElement)(u.DropdownMenu,{className:"controls-dropdown",icon:0===s.length?G:Z,label:(0,o.__)("Visibility Controls","block-visibility"),popoverProps:{className:"block-visibility__control-popover visibility-controls",focusOnMount:"container",placement:"left-start",offset:259},toggleProps:{isSmall:!0,disabled:0===p.length}},(i=>{let{onClose:n}=i;return(0,t.createElement)(t.Fragment,null,0!==h.length&&(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Defaults","block-visibility")},h.map(((e,l)=>(0,t.createElement)(xn,{key:l,control:e,toggleControls:k})))),(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Controls","block-visibility")},g.map(((e,l)=>(0,t.createElement)(Nn,{key:l,control:e,toggleControls:k})))),0!==_.length&&(0,t.createElement)(u.MenuGroup,{label:(0,o.__)("Integrations","block-visibility")},_.map(((e,l)=>(0,t.createElement)(Nn,{key:l,control:e,toggleControls:k})))),(0,t.createElement)(u.MenuGroup,null,f&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(pe,e({canResetAll:E},l)),(0,t.createElement)(be,{modalOpen:a,onClose:n,setModalOpen:r})),(0,t.createElement)(u.MenuItem,{"aria-disabled":!E,onClick:()=>{E&&(d({blockVisibility:void 0}),(0,ne.speak)((0,o.__)("All controls reset","block-visibility"),"assertive"))},variant:"tertiary"},(0,o.__)("Reset all","block-visibility"))))}));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"controls-panel-header"},(0,t.createElement)("h2",null,(0,o.__)("Visibility","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-header__dropdown-menus"},S)),a&&f&&(0,t.createElement)(ve,e({coreControls:g,integrationControls:_,modalOpen:a,setModalOpen:r,toggleControls:k},l)))}function Nn(e){const{control:l,toggleControls:i}=e;return(0,t.createElement)(u.MenuItem,{key:l.attributeSlug,icon:l.isActive&&ce,label:(0,o.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". (0,o.__)("Toggle %s","block-visibility"),l.label),onClick:()=>{i(l),(0,ne.speak)((0,o.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". diff --git a/build/block-visibility-settings.asset.php b/build/block-visibility-settings.asset.php index 6332741..63fa6fe 100644 --- a/build/block-visibility-settings.asset.php +++ b/build/block-visibility-settings.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '3c9316ef1608f873b851'); + array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'ffa638418a1a62c1dd42'); diff --git a/build/block-visibility-settings.js b/build/block-visibility-settings.js index e0ccc70..bc03f10 100644 --- a/build/block-visibility-settings.js +++ b/build/block-visibility-settings.js @@ -1,16 +1,16 @@ -!function(){var e={184:function(e,t){var n;!function(){"use strict";var i={}.hasOwnProperty;function o(){for(var e=[],t=0;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,r),i=o.default.Children.only(t);return o.default.cloneElement(i,c(c({},n),{},{onClick:this.onClick}))}}])&&u(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.default.PureComponent);t.CopyToClipboard=g,m(g,"defaultProps",{onCopy:void 0,options:void 0})},855:function(e,t,n){"use strict";var i=n(300).CopyToClipboard;i.CopyToClipboard=i,e.exports=i},921:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,l=n?Symbol.for("react.fragment"):60107,r=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,b=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,f=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,h=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case u:case d:case l:case a:case r:case b:return e;default:switch(e=e&&e.$$typeof){case c:case p:case f:case g:case s:return e;default:return t}}case o:return t}}}function E(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=i,t.ForwardRef=p,t.Fragment=l,t.Lazy=f,t.Memo=g,t.Portal=o,t.Profiler=a,t.StrictMode=r,t.Suspense=b,t.isAsyncMode=function(e){return E(e)||k(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===l},t.isLazy=function(e){return k(e)===f},t.isMemo=function(e){return k(e)===g},t.isPortal=function(e){return k(e)===o},t.isProfiler=function(e){return k(e)===a},t.isStrictMode=function(e){return k(e)===r},t.isSuspense=function(e){return k(e)===b},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===d||e===a||e===r||e===b||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===g||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===h||e.$$typeof===y||e.$$typeof===_||e.$$typeof===v)},t.typeOf=k},864:function(e,t,n){"use strict";e.exports=n(921)},742:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],i=0;i{var n;const o=null!==(n=i[t].rel)&&void 0!==n?n:"noreferrer";return(0,e.createElement)("a",{key:t,href:i[t].url,className:"plugin-links__"+t,target:"_blank",rel:o},(0,e.createElement)(g,{icon:i[t].icon}),(0,e.createElement)("span",null,i[t].title))}));return(0,e.createElement)("div",{className:"masthead"},(0,e.createElement)("div",{className:"inner-container"},(0,e.createElement)("div",{className:"masthead__branding"},(0,e.createElement)("h1",null,E,(0,e.createElement)("span",null,(0,l.__)("Block Visibility","block-visibility")),n?.is_pro&&(0,e.createElement)("span",{className:"pro-badge"},"Pro"))),(0,e.createElement)("div",{className:"masthead__plugin-links"},o)))}function M(t){var n;const{variables:i}=t,o=null!==(n=i?.plugin_variables)&&void 0!==n?n:[],r={plugin:{title:(0,l.__)("Block Visibility","block-visibility")+" "+o.version,url:k.settingsHome,rel:"external"},docs:{title:(0,l.__)("Knowledge Base","block-visibility"),url:k.settingsKnowledgeBase,rel:"external"},support:{title:(0,l.__)("Support","block-visibility"),url:k.blockVisibilityOrgSupport},repo:{title:(0,l.__)("GitHub","block-visibility"),url:k.gitHub},twitter:{title:(0,l.__)("Twitter","block-visibility"),url:k.twitter}};(0,u.applyFilters)("blockVisibility.FooterLinks",r);const a=Object.keys(r).map((t=>{var n;const i=null!==(n=r[t].rel)&&void 0!==n?n:"noreferrer";return(0,e.createElement)("a",{key:t,href:r[t].url,className:"footer-links__"+t,target:"_blank",rel:i},r[t].title)}));return(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("div",{className:"inner-container"},a))}function N(){return N=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var B=n(196),z=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function H(e,t){for(var n=0;n0?ee(ue,--se):0,re--,10===ce&&(re=1,le--),ce}function me(){return ce=se2||he(ce)>3?"":" "}function we(e,t){for(;--t&&me()&&!(ce<48||ce>102||ce>57&&ce<65||ce>70&&ce<97););return ve(e,fe()+(t<6&&32==ge()&&32==me()))}function Ce(e){for(;me();)switch(ce){case e:return se;case 34:case 39:34!==e&&39!==e&&Ce(ce);break;case 40:41===e&&Ce(e);break;case 92:me()}return se}function Se(e,t){for(;me()&&e+ce!==57&&(e+ce!==84||47!==ge()););return"/*"+ve(t,se-1)+"*"+Y(47===e?e:me())}function xe(e){for(;!he(ge());)me();return ve(e,se)}var Oe="-ms-",Ve="-moz-",Pe="-webkit-",Me="comm",Ne="rule",Te="decl",De="@keyframes";function Re(e,t){for(var n="",i=ie(e),o=0;o0&&ne(w)-d&&oe(b>32?ze(w+";",i,n,d-1):ze(Q(w," ","")+";",i,n,d-2),s);break;case 59:w+=";";default:if(oe(E=Ae(w,t,n,c,u,o,a,y,_=[],k=[],d),l),123===h)if(0===u)Le(w,t,E,E,_,l,d,a,k);else switch(99===p&&110===ee(w,3)?100:p){case 100:case 109:case 115:Le(e,E,E,i&&oe(Ae(e,E,E,0,0,o,a,y,o,_=[],d),k),o,k,d,a,i?_:k);break;default:Le(w,E,E,E,[""],k,0,a,k)}}c=u=b=0,g=v=1,y=w="",d=r;break;case 58:d=1+ne(w),b=m;default:if(g<1)if(123==h)--g;else if(125==h&&0==g++&&125==be())continue;switch(w+=Y(h),h*g){case 38:v=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(ne(w)-1)*v,v=1;break;case 64:45===ge()&&(w+=ke(me())),p=ge(),u=d=ne(y=w+=xe(fe())),h++;break;case 45:45===m&&2==ne(w)&&(g=0)}}return l}function Ae(e,t,n,i,o,l,r,a,s,c,u){for(var d=o-1,p=0===o?l:[""],b=ie(p),m=0,g=0,f=0;m0?p[v]+" "+h:Q(h,/&\f/g,p[v])))&&(s[f++]=y);return de(e,t,n,0===o?Ne:a,s,c,u)}function Be(e,t,n){return de(e,t,n,Me,Y(ce),te(e,2,-2),0)}function ze(e,t,n,i){return de(e,t,n,Te,te(e,0,i),te(e,i+1,-1),i)}var He=function(e,t,n){for(var i=0,o=0;i=o,o=ge(),38===i&&12===o&&(t[n]=1),!he(o);)me();return ve(e,se)},Ue=new WeakMap,je=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ue.get(n))&&!i){Ue.set(e,!0);for(var o=[],l=function(e,t){return _e(function(e,t){var n=-1,i=44;do{switch(he(i)){case 0:38===i&&12===ge()&&(t[n]=1),e[n]+=He(se-1,t,n);break;case 2:e[n]+=ke(i);break;case 4:if(44===i){e[++n]=58===ge()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Y(i)}}while(i=me());return e}(ye(e),t))}(t,o),r=n.props,a=0,s=0;a6)switch(ee(e,t+1)){case 109:if(45!==ee(e,t+4))break;case 102:return Q(e,/(.+:)(.+)-([^]+)/,"$1"+Pe+"$2-$3$1"+Ve+(108==ee(e,t+3)?"$3":"$2-$3"))+e;case 115:return~J(e,"stretch")?Ge(Q(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ee(e,t+1))break;case 6444:switch(ee(e,ne(e)-3-(~J(e,"!important")&&10))){case 107:return Q(e,":",":"+Pe)+e;case 101:return Q(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Pe+(45===ee(e,14)?"inline-":"")+"box$3$1"+Pe+"$2$3$1"+Oe+"$2box$3")+e}break;case 5936:switch(ee(e,t+11)){case 114:return Pe+e+Oe+Q(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Pe+e+Oe+Q(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Pe+e+Oe+Q(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Pe+e+Oe+e+e}return e}var We=[function(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case Te:e.return=Ge(e.value,e.length);break;case De:return Re([pe(e,{value:Q(e.value,"@","@"+Pe)})],i);case Ne:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Re([pe(e,{props:[Q(t,/:(read-\w+)/,":"+Ve+"$1")]})],i);case"::placeholder":return Re([pe(e,{props:[Q(t,/:(plac\w+)/,":"+Pe+"input-$1")]}),pe(e,{props:[Q(t,/:(plac\w+)/,":"+Ve+"$1")]}),pe(e,{props:[Q(t,/:(plac\w+)/,Oe+"input-$1")]})],i)}return""}))}}],Ze=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,o,l=e.stylisPlugins||We,r={},a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++i,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Ke={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Xe=/[A-Z]|^ms/g,Qe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Je=function(e){return 45===e.charCodeAt(1)},et=function(e){return null!=e&&"boolean"!=typeof e},tt=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Je(n=e)?n:n.replace(Xe,"-$&").toLowerCase()),t[e];var n}}(),nt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Qe,(function(e,t,n){return ot={name:t,styles:n,next:ot},t}))}return 1===Ke[e]||Je(e)||"number"!=typeof t||0===t?t:t+"px"};function it(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return ot={name:n.name,styles:n.styles,next:ot},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)ot={name:i.name,styles:i.styles,next:ot},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var o=0;oe.brand+"/"+e.version)).join(" "),wt):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const Pt=Math.round;function Mt(e){return St(e)?e:e.contextElement}const Nt={x:1,y:1};function Tt(e){const t=Mt(e);if(!Ct(t))return Nt;const n=t.getBoundingClientRect(),{width:i,height:o,fallback:l}=function(e){const t=_t(e);let n=parseFloat(t.width),i=parseFloat(t.height);const o=Ct(e),l=o?e.offsetWidth:n,r=o?e.offsetHeight:i,a=Pt(n)!==l||Pt(i)!==r;return a&&(n=l,i=r),{width:n,height:i,fallback:a}}(t);let r=(l?Pt(n.width):n.width)/i,a=(l?Pt(n.height):n.height)/o;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function Dt(e,t,n,i){var o,l;void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Mt(e);let s=Nt;t&&(i?St(i)&&(s=Tt(i)):s=Tt(e));const c=a?yt(a):window,u=Vt()&&n;let d=(r.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/s.x,p=(r.top+(u&&(null==(l=c.visualViewport)?void 0:l.offsetTop)||0))/s.y,b=r.width/s.x,m=r.height/s.y;if(a){const e=yt(a),t=i&&St(i)?yt(i):i;let n=e.frameElement;for(;n&&i&&t!==e;){const e=Tt(n),t=n.getBoundingClientRect(),i=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(i.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(i.paddingTop))*e.y,d*=e.x,p*=e.y,b*=e.x,m*=e.y,d+=t.x,p+=t.y,n=yt(n).frameElement}}return g={width:b,height:m,x:d,y:p},{...g,top:g.y,left:g.x,right:g.x+g.width,bottom:g.y+g.height};var g}function Rt(e){if("html"===Et(e))return e;const t=e.assignedSlot||e.parentNode||xt(e)&&e.host||function(e){return((kt(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return xt(t)?t.host:t}function It(e){const t=Rt(e);return function(e){return["html","body","#document"].includes(Et(e))}(t)?t.ownerDocument.body:Ct(t)&&Ot(t)?t:It(t)}function Ft(e,t){var n;void 0===t&&(t=[]);const i=It(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),l=yt(i);return o?t.concat(l,l.visualViewport||[],Ot(i)?i:[]):t.concat(i,Ft(i))}var Lt=B.useLayoutEffect,At=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Bt=function(){};function zt(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Ht(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o-1}function Wt(e){return Gt(e)?window.pageYOffset:e.scrollTop}function Zt(e,t){Gt(e)?window.scrollTo(0,t):e.scrollTop=t}function qt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bt,o=Wt(e),l=t-o,r=0;!function t(){var a,s=(a=r+=10,l*((a=a/n-1)*a*a+1)+o);Zt(e,s),rn.bottom?Zt(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):i.top-o=m)return{placement:"bottom",maxHeight:t};if(C>=m&&!r)return l&&qt(s,S,O),{placement:"bottom",maxHeight:t};if(!r&&C>=i||r&&E>=i)return l&&qt(s,S,O),{placement:"bottom",maxHeight:r?E-y:C-y};if("auto"===o||r){var V=t,P=r?k:w;return P>=i&&(V=Math.min(P-y-a,t)),{placement:"top",maxHeight:V}}if("bottom"===o)return l&&Zt(s,S),{placement:"bottom",maxHeight:t};break;case"top":if(k>=m)return{placement:"top",maxHeight:t};if(w>=m&&!r)return l&&qt(s,x,O),{placement:"top",maxHeight:t};if(!r&&w>=i||r&&k>=i){var M=t;return(!r&&w>=i||r&&k>=i)&&(M=r?k-_:w-_),l&&qt(s,x,O),{placement:"top",maxHeight:M}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}({maxHeight:i,menuEl:e,minHeight:n,placement:o,shouldScroll:r&&!t,isFixedPosition:t,controlHeight:f});p(a.maxHeight),g(a.placement),null==s||s(a.placement)}}),[i,o,l,r,n,s,f]),t({ref:c,placerProps:R(R({},e),{},{placement:m||on(o),maxHeight:d})})},an=function(e,t){var n=e.theme,i=n.spacing.baseUnit,o=n.colors;return R({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},sn=an,cn=an,un=function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),t)};un.defaultProps={children:"No options"};var dn=function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),t)};dn.defaultProps={children:"Loading..."};var pn,bn,mn,gn=["size"],fn={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},vn=function(e){var t=e.size,n=A(e,gn);return ft("svg",N({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:fn},n))},hn=function(e){return ft(vn,N({size:20},e),ft("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},yn=function(e){return ft(vn,N({size:20},e),ft("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},kn=function(e,t){var n=e.isFocused,i=e.theme,o=i.spacing.baseUnit,l=i.colors;return R({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?l.neutral60:l.neutral20,padding:2*o,":hover":{color:n?l.neutral80:l.neutral40}})},En=kn,wn=kn,Cn=function(){var e=vt.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(pn||(bn=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],mn||(mn=bn.slice(0)),pn=Object.freeze(Object.defineProperties(bn,{raw:{value:Object.freeze(mn)}})))),Sn=function(e){var t=e.delay,n=e.offset;return ft("span",{css:vt({animation:"".concat(Cn," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},xn=function(e){var t=e.innerProps,n=e.isRtl;return ft("div",N({},$t(e,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ft(Sn,{delay:0,offset:n}),ft(Sn,{delay:160,offset:!0}),ft(Sn,{delay:320,offset:!n}))};xn.defaultProps={size:4};var On=["data"],Vn=["innerRef","isDisabled","isHidden","inputClassName"],Pn={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Mn={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":R({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Pn)},Nn=function(e){return R({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Pn)},Tn=function(e){var t=e.children,n=e.innerProps;return ft("div",n,t)},Dn={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ft(hn,null))},Control:function(e){var t=e.children,n=e.isDisabled,i=e.isFocused,o=e.innerRef,l=e.innerProps,r=e.menuIsOpen;return ft("div",N({ref:o},$t(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":i,"control--menu-is-open":r}),l),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ft(yn,null))},DownChevron:yn,CrossIcon:hn,Group:function(e){var t=e.children,n=e.cx,i=e.getStyles,o=e.getClassNames,l=e.Heading,r=e.headingProps,a=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return ft("div",N({},$t(e,"group",{group:!0}),a),ft(l,N({},r,{selectProps:u,theme:c,getStyles:i,getClassNames:o,cx:n}),s),ft("div",null,t))},GroupHeading:function(e){var t=jt(e);t.data;var n=A(t,On);return ft("div",N({},$t(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ft("span",N({},t,$t(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,i=jt(e),o=i.innerRef,l=i.isDisabled,r=i.isHidden,a=i.inputClassName,s=A(i,Vn);return ft("div",N({},$t(e,"input",{"input-container":!0}),{"data-value":n||""}),ft("input",N({className:t({input:!0},a),ref:o,style:Nn(r),disabled:l},s)))},LoadingIndicator:xn,Menu:function(e){var t=e.children,n=e.innerRef,i=e.innerProps;return ft("div",N({},$t(e,"menu",{menu:!0}),{ref:n},i),t)},MenuList:function(e){var t=e.children,n=e.innerProps,i=e.innerRef,o=e.isMulti;return ft("div",N({},$t(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,i=e.controlElement,o=e.innerProps,l=e.menuPlacement,r=e.menuPosition,a=(0,B.useRef)(null),s=(0,B.useRef)(null),c=L((0,B.useState)(on(l)),2),u=c[0],d=c[1],p=(0,B.useMemo)((function(){return{setPortalPlacement:d}}),[]),b=L((0,B.useState)(null),2),m=b[0],g=b[1],f=(0,B.useCallback)((function(){if(i){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(i),t="fixed"===r?0:window.pageYOffset,n=e[u]+t;n===(null==m?void 0:m.offset)&&e.left===(null==m?void 0:m.rect.left)&&e.width===(null==m?void 0:m.rect.width)||g({offset:n,rect:e})}}),[i,r,u,null==m?void 0:m.offset,null==m?void 0:m.rect.left,null==m?void 0:m.rect.width]);Lt((function(){f()}),[f]);var v=(0,B.useCallback)((function(){"function"==typeof s.current&&(s.current(),s.current=null),i&&a.current&&(s.current=function(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:r=!0,animationFrame:a=!1}=i,s=o&&!a,c=s||l?[...St(e)?Ft(e):e.contextElement?Ft(e.contextElement):[],...Ft(t)]:[];c.forEach((e=>{s&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)}));let u,d=null;r&&(d=new ResizeObserver((()=>{n()})),St(e)&&!a&&d.observe(e),St(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t));let p=a?Dt(e):null;return a&&function t(){const i=Dt(e);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n(),p=i,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{s&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(u)}}(i,a.current,f,{elementResize:"ResizeObserver"in window}))}),[i,f]);Lt((function(){v()}),[v]);var h=(0,B.useCallback)((function(e){a.current=e,v()}),[v]);if(!t&&"fixed"!==r||!m)return null;var y=ft("div",N({ref:h},$t(R(R({},e),{},{offset:m.offset,position:r,rect:m.rect}),"menuPortal",{"menu-portal":!0}),o),n);return ft(ln.Provider,{value:p},t?(0,ht.createPortal)(y,t):y)},LoadingMessage:dn,NoOptionsMessage:un,MultiValue:function(e){var t=e.children,n=e.components,i=e.data,o=e.innerProps,l=e.isDisabled,r=e.removeProps,a=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return ft(s,{data:i,innerProps:R(R({},$t(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:a},ft(c,{data:i,innerProps:R({},$t(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},t),ft(u,{data:i,innerProps:R(R({},$t(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},r),selectProps:a}))},MultiValueContainer:Tn,MultiValueLabel:Tn,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return ft("div",N({role:"button"},n),t||ft(hn,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,i=e.isFocused,o=e.isSelected,l=e.innerRef,r=e.innerProps;return ft("div",N({},$t(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":i,"option--is-selected":o}),{ref:l,"aria-disabled":n},r),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,i=e.isDisabled,o=e.isRtl;return ft("div",N({},$t(e,"container",{"--is-disabled":i,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,i=e.innerProps;return ft("div",N({},$t(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),i),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,i=e.isMulti,o=e.hasValue;return ft("div",N({},$t(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),n),t)}},Rn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function In(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(i,l?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,o=e.label,l=void 0===o?"":o,r=e.selectValue,a=e.isDisabled,s=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&r)return"value ".concat(l," focused, ").concat(c(r,n),".");if("menu"===t){var u=a?" disabled":"",d="".concat(s?"selected":"focused").concat(u);return"option ".concat(l," ").concat(d,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Bn=function(e){var t=e.ariaSelection,n=e.focusedOption,i=e.focusedValue,o=e.focusableOptions,l=e.isFocused,r=e.selectValue,a=e.selectProps,s=e.id,c=a.ariaLiveMessages,u=a.getOptionLabel,d=a.inputValue,p=a.isMulti,b=a.isOptionDisabled,m=a.isSearchable,g=a.menuIsOpen,f=a.options,v=a.screenReaderStatus,h=a.tabSelectsValue,y=a["aria-label"],_=a["aria-live"],k=(0,B.useMemo)((function(){return R(R({},An),c||{})}),[c]),E=(0,B.useMemo)((function(){var e,n="";if(t&&k.onChange){var i=t.option,o=t.options,l=t.removedValue,a=t.removedValues,s=t.value,c=l||i||(e=s,Array.isArray(e)?null:e),d=c?u(c):"",p=o||a||void 0,m=p?p.map(u):[],g=R({isDisabled:c&&b(c,r),label:d,labels:m},t);n=k.onChange(g)}return n}),[t,k,b,r,u]),w=(0,B.useMemo)((function(){var e="",t=n||i,l=!!(n&&r&&r.includes(n));if(t&&k.onFocus){var a={focused:t,label:u(t),isDisabled:b(t,r),isSelected:l,options:o,context:t===n?"menu":"value",selectValue:r};e=k.onFocus(a)}return e}),[n,i,u,b,k,o,r]),C=(0,B.useMemo)((function(){var e="";if(g&&f.length&&k.onFilter){var t=v({count:o.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[o,d,g,k,f,v]),S=(0,B.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":g?"menu":"input";e=k.guidance({"aria-label":y,context:t,isDisabled:n&&b(n,r),isMulti:p,isSearchable:m,tabSelectsValue:h})}return e}),[y,n,i,p,b,m,g,k,r,h]),x="".concat(w," ").concat(C," ").concat(S),O=ft(B.Fragment,null,ft("span",{id:"aria-selection"},E),ft("span",{id:"aria-context"},x)),V="initial-input-focus"===(null==t?void 0:t.action);return ft(B.Fragment,null,ft(Ln,{id:s},V&&O),ft(Ln,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},l&&!V&&O))},zn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Hn=new RegExp("["+zn.map((function(e){return e.letters})).join("")+"]","g"),Un={},jn=0;jn1?t-1:0),i=1;i0,g=d-p-u,f=!1;g>t&&r.current&&(i&&i(e),r.current=!1),m&&a.current&&(l&&l(e),a.current=!1),m&&t>g?(n&&!r.current&&n(e),b.scrollTop=d,f=!0,r.current=!0):!m&&-t>u&&(o&&!a.current&&o(e),b.scrollTop=0,f=!0,a.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,i,o,l]),d=(0,B.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,B.useCallback)((function(e){s.current=e.changedTouches[0].clientY}),[]),b=(0,B.useCallback)((function(e){var t=s.current-e.changedTouches[0].clientY;u(e,t)}),[u]),m=(0,B.useCallback)((function(e){if(e){var t=!!en&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",b,t)}}),[b,p,d]),g=(0,B.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",b,!1))}),[b,p,d]);return(0,B.useEffect)((function(){if(t){var e=c.current;return m(e),function(){g(e)}}}),[t,m,g]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),l=function(e){var t=e.isEnabled,n=e.accountForScrollbars,i=void 0===n||n,o=(0,B.useRef)({}),l=(0,B.useRef)(null),r=(0,B.useCallback)((function(e){if(oi){var t=document.body,n=t&&t.style;if(i&&Qn.forEach((function(e){var t=n&&n[e];o.current[e]=t})),i&&li<1){var l=parseInt(o.current.paddingRight,10)||0,r=document.body?document.body.clientWidth:0,a=window.innerWidth-r+l||0;Object.keys(Jn).forEach((function(e){var t=Jn[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(a,"px"))}t&&ii()&&(t.addEventListener("touchmove",ei,ri),e&&(e.addEventListener("touchstart",ni,ri),e.addEventListener("touchmove",ti,ri))),li+=1}}),[i]),a=(0,B.useCallback)((function(e){if(oi){var t=document.body,n=t&&t.style;li=Math.max(li-1,0),i&&li<1&&Qn.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&ii()&&(t.removeEventListener("touchmove",ei,ri),e&&(e.removeEventListener("touchstart",ni,ri),e.removeEventListener("touchmove",ti,ri)))}}),[i]);return(0,B.useEffect)((function(){if(t){var e=l.current;return r(e),function(){a(e)}}}),[t,r,a]),function(e){l.current=e}}({isEnabled:n});return ft(B.Fragment,null,n&&ft("div",{onClick:ai,css:si}),t((function(e){o(e),l(e)})))}var ui={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},di=function(e){var t=e.name,n=e.onFocus;return ft("input",{required:!0,name:t,tabIndex:-1,onFocus:n,css:ui,value:"",onChange:function(){}})},pi={clearIndicator:wn,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,i=e.isFocused,o=e.theme,l=o.colors,r=o.borderRadius;return R({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?l.neutral5:l.neutral0,borderColor:n?l.neutral10:i?l.primary:l.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:i?l.primary:l.neutral30}})},dropdownIndicator:En,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,i=n.colors,o=n.spacing;return R({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,i=e.theme,o=i.spacing.baseUnit,l=i.colors;return R({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?l.neutral10:l.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,i=e.value,o=e.theme,l=o.spacing,r=o.colors;return R(R({visibility:n?"hidden":"visible",transform:i?"translateZ(0)":""},Mn),t?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:r.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,i=e.size,o=e.theme,l=o.colors,r=o.spacing.baseUnit;return R({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?l.neutral60:l.neutral20,padding:2*r})},loadingMessage:cn,menu:function(e,t){var n,i=e.placement,o=e.theme,l=o.borderRadius,r=o.spacing,a=o.colors;return R((T(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),T(n,"position","absolute"),T(n,"width","100%"),T(n,"zIndex",1),n),t?{}:{backgroundColor:a.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:r.menuGutter,marginTop:r.menuGutter})},menuList:function(e,t){var n=e.maxHeight,i=e.theme.spacing.baseUnit;return R({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:i,paddingTop:i})},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,i=n.spacing,o=n.borderRadius,l=n.colors;return R({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,i=n.borderRadius,o=n.colors,l=e.cropWithEllipsis;return R({overflow:"hidden",textOverflow:l||void 0===l?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,i=n.spacing,o=n.borderRadius,l=n.colors,r=e.isFocused;return R({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:r?l.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},noOptionsMessage:sn,option:function(e,t){var n=e.isDisabled,i=e.isFocused,o=e.isSelected,l=e.theme,r=l.spacing,a=l.colors;return R({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?a.primary:i?a.primary25:"transparent",color:n?a.neutral20:o?a.neutral0:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?a.primary:a.primary50}})},placeholder:function(e,t){var n=e.theme,i=n.spacing,o=n.colors;return R({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,i=e.theme,o=i.spacing,l=i.colors;return R({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,i=e.isMulti,o=e.hasValue,l=e.selectProps.controlShouldRenderValue;return R({alignItems:"center",display:i&&o&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},bi={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},mi={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Kt(),captureMenuScroll:!Kt(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=R({ignoreCase:!0,ignoreAccents:!0,stringify:Yn,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,o=n.ignoreAccents,l=n.stringify,r=n.trim,a=n.matchFrom,s=r?qn(t):t,c=r?qn(l(e)):l(e);return i&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=Zn(s),c=Wn(c)),"start"===a?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function gi(e,t,n,i){return{type:"option",data:t,isDisabled:ki(e,t,n),isSelected:Ei(e,t,n),label:yi(e,t),value:_i(e,t),index:i}}function fi(e,t){return e.options.map((function(n,i){if("options"in n){var o=n.options.map((function(n,i){return gi(e,n,t,i)})).filter((function(t){return hi(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:i}:void 0}var l=gi(e,n,t,i);return hi(e,l)?l:void 0})).filter(tn)}function vi(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,W(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function hi(e,t){var n=e.inputValue,i=void 0===n?"":n,o=t.data,l=t.isSelected,r=t.label,a=t.value;return(!Ci(e)||!l)&&wi(e,{label:r,value:a,data:o},i)}var yi=function(e,t){return e.getOptionLabel(t)},_i=function(e,t){return e.getOptionValue(t)};function ki(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Ei(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=_i(e,t);return n.some((function(t){return _i(e,t)===i}))}function wi(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Ci=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Si=1,xi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}(l,e);var t,n,i,o=G(l);function l(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=o.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,n){var i=t.props,o=i.onChange,l=i.name;n.name=l,t.ariaOnChange(e,n),o(e,n)},t.setValue=function(e,n,i){var o=t.props,l=o.closeMenuOnSelect,r=o.isMulti,a=o.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:a}),l&&(t.setState({inputIsHiddenAfterUpdate:!r}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:n,option:i})},t.selectOption=function(e){var n=t.props,i=n.blurInputOnSelect,o=n.isMulti,l=n.name,r=t.state.selectValue,a=o&&t.isOptionSelected(e,r),s=t.isOptionDisabled(e,r);if(a){var c=t.getOptionValue(e);t.setValue(r.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(s)return void t.ariaOnChange(e,{action:"select-option",option:e,name:l});o?t.setValue([].concat(W(r),[e]),"select-option",e):t.setValue(e,"select-option")}i&&t.blurInput()},t.removeValue=function(e){var n=t.props.isMulti,i=t.state.selectValue,o=t.getOptionValue(e),l=i.filter((function(e){return t.getOptionValue(e)!==o})),r=nn(n,l,l[0]||null);t.onChange(r,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(nn(t.props.isMulti,[],null),{action:"clear",removedValues:e})},t.popValue=function(){var e=t.props.isMulti,n=t.state.selectValue,i=n[n.length-1],o=n.slice(0,n.length-1),l=nn(e,o,o[0]||null);t.onChange(l,{action:"pop-value",removedValue:i})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,n=new Array(e),i=0;i5||l>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var n=t.props.inputValue,i=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(i,{action:"input-change",prevInputValue:n}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var n=t.props.inputValue;t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:n}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){t.blockOptionHover||t.state.focusedOption===e||t.setState({focusedOption:e})},t.shouldHideSelectedOptions=function(){return Ci(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var n=t.props,i=n.isMulti,o=n.backspaceRemovesValue,l=n.escapeClearsValue,r=n.inputValue,a=n.isClearable,s=n.isDisabled,c=n.menuIsOpen,u=n.onKeyDown,d=n.tabSelectsValue,p=n.openMenuOnFocus,b=t.state,m=b.focusedOption,g=b.focusedValue,f=b.selectValue;if(!(s||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!i||r)return;t.focusValue("previous");break;case"ArrowRight":if(!i||r)return;t.focusValue("next");break;case"Delete":case"Backspace":if(r)return;if(g)t.removeValue(g);else{if(!o)return;i?t.popValue():a&&t.clearValue()}break;case"Tab":if(t.isComposing)return;if(e.shiftKey||!c||!d||!m||p&&t.isOptionSelected(m,f))return;t.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(t.isComposing)return;t.selectOption(m);break}return;case"Escape":c?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:r}),t.onMenuClose()):a&&l&&t.clearValue();break;case" ":if(r)return;if(!c){t.openMenu("first");break}if(!m)return;t.selectOption(m);break;case"ArrowUp":c?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":c?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!c)return;t.focusOption("pageup");break;case"PageDown":if(!c)return;t.focusOption("pagedown");break;case"Home":if(!c)return;t.focusOption("first");break;case"End":if(!c)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++Si),t.state.selectValue=Ut(e.value),e.menuIsOpen&&t.state.selectValue.length){var n=t.buildFocusableOptions(),i=n.indexOf(t.state.selectValue[0]);t.state.focusedOption=n[i]}return t}return t=l,n=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Yt(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,i=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&i&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Yt(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,i=n.selectValue,o=n.isFocused,l=this.buildFocusableOptions(),r="first"===e?0:l.length-1;if(!this.props.isMulti){var a=l.indexOf(i[0]);a>-1&&(r=a)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[r]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(i);i||(o=-1);var l=n.length-1,r=-1;if(n.length){switch(e){case"previous":r=0===o?0:-1===o?l:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var o=0,l=i.indexOf(n);n||(l=-1),"up"===e?o=l>0?l-1:i.length-1:"down"===e?o=(l+1)%i.length:"pageup"===e?(o=l-t)<0&&(o=0):"pagedown"===e?(o=l+t)>i.length-1&&(o=i.length-1):"last"===e&&(o=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(bi):R(R({},bi),this.props.theme):bi}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getClassNames,o=this.getValue,l=this.selectOption,r=this.setValue,a=this.props,s=a.isMulti,c=a.isRtl,u=a.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:i,getValue:o,hasValue:this.hasValue(),isMulti:s,isRtl:c,options:u,selectOption:l,selectProps:a,setValue:r,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return ki(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Ei(this.props,e,t)}},{key:"filterOption",value:function(e,t){return wi(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,o=e.inputValue,l=e.tabIndex,r=e.form,a=e.menuIsOpen,s=e.required,c=this.getComponents().Input,u=this.state,d=u.inputIsHidden,p=u.ariaSelection,b=this.commonProps,m=i||this.getElementId("input"),g=R(R(R({"aria-autocomplete":"list","aria-expanded":a,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":s,role:"combobox"},a&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==p?void 0:p.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?B.createElement(c,N({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:r,type:"text",value:o},g)):B.createElement(Xn,N({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Bt,onFocus:this.onInputFocus,disabled:t,tabIndex:l,inputMode:"none",form:r,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,o=t.MultiValueLabel,l=t.MultiValueRemove,r=t.SingleValue,a=t.Placeholder,s=this.commonProps,c=this.props,u=c.controlShouldRenderValue,d=c.isDisabled,p=c.isMulti,b=c.inputValue,m=c.placeholder,g=this.state,f=g.selectValue,v=g.focusedValue,h=g.isFocused;if(!this.hasValue()||!u)return b?null:B.createElement(a,N({},s,{key:"placeholder",isDisabled:d,isFocused:h,innerProps:{id:this.getElementId("placeholder")}}),m);if(p)return f.map((function(t,r){var a=t===v,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return B.createElement(n,N({},s,{components:{Container:i,Label:o,Remove:l},isFocused:a,isDisabled:d,key:c,index:r,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(b)return null;var y=f[0];return B.createElement(r,N({},s,{data:y,isDisabled:d}),this.formatOptionLabel(y,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,l=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||o)return null;var r={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return B.createElement(e,N({},t,{innerProps:r,isFocused:l}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,l=this.state.isFocused;return e&&o?B.createElement(e,N({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:l})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,o=this.props.isDisabled,l=this.state.isFocused;return B.createElement(n,N({},i,{isDisabled:o,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return B.createElement(e,N({},t,{innerProps:o,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,o=t.Menu,l=t.MenuList,r=t.MenuPortal,a=t.LoadingMessage,s=t.NoOptionsMessage,c=t.Option,u=this.commonProps,d=this.state.focusedOption,p=this.props,b=p.captureMenuScroll,m=p.inputValue,g=p.isLoading,f=p.loadingMessage,v=p.minMenuHeight,h=p.maxMenuHeight,y=p.menuIsOpen,_=p.menuPlacement,k=p.menuPosition,E=p.menuPortalTarget,w=p.menuShouldBlockScroll,C=p.menuShouldScrollIntoView,S=p.noOptionsMessage,x=p.onMenuScrollToTop,O=p.onMenuScrollToBottom;if(!y)return null;var V,P=function(t,n){var i=t.type,o=t.data,l=t.isDisabled,r=t.isSelected,a=t.label,s=t.value,p=d===o,b=l?void 0:function(){return e.onOptionHover(o)},m=l?void 0:function(){return e.selectOption(o)},g="".concat(e.getElementId("option"),"-").concat(n),f={id:g,onClick:m,onMouseMove:b,onMouseOver:b,tabIndex:-1};return B.createElement(c,N({},u,{innerProps:f,data:o,isDisabled:l,isSelected:r,key:g,label:a,type:i,value:s,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())V=this.getCategorizedOptions().map((function(t){if("group"===t.type){var o=t.data,l=t.options,r=t.index,a="".concat(e.getElementId("group"),"-").concat(r),s="".concat(a,"-heading");return B.createElement(n,N({},u,{key:a,data:o,options:l,Heading:i,headingProps:{id:s,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return P(e,"".concat(r,"-").concat(e.index))})))}if("option"===t.type)return P(t,"".concat(t.index))}));else if(g){var M=f({inputValue:m});if(null===M)return null;V=B.createElement(a,u,M)}else{var T=S({inputValue:m});if(null===T)return null;V=B.createElement(s,u,T)}var D={minMenuHeight:v,maxMenuHeight:h,menuPlacement:_,menuPosition:k,menuShouldScrollIntoView:C},R=B.createElement(rn,N({},u,D),(function(t){var n=t.ref,i=t.placerProps,r=i.placement,a=i.maxHeight;return B.createElement(o,N({},u,D,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:g,placement:r}),B.createElement(ci,{captureEnabled:b,onTopArrive:x,onBottomArrive:O,lockEnabled:w},(function(t){return B.createElement(l,N({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:g,maxHeight:a,focusedOption:d}),V)})))}));return E||"fixed"===k?B.createElement(r,N({},u,{appendTo:E,controlElement:this.controlRef,menuPlacement:_,menuPosition:k}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,o=t.isMulti,l=t.name,r=t.required,a=this.state.selectValue;if(l&&!i){if(r&&!this.hasValue())return B.createElement(di,{name:l,onFocus:this.onValueInputFocus});if(o){if(n){var s=a.map((function(t){return e.getOptionValue(t)})).join(n);return B.createElement("input",{name:l,type:"hidden",value:s})}var c=a.length>0?a.map((function(t,n){return B.createElement("input",{key:"i-".concat(n),name:l,type:"hidden",value:e.getOptionValue(t)})})):B.createElement("input",{name:l,type:"hidden",value:""});return B.createElement("div",null,c)}var u=a[0]?this.getOptionValue(a[0]):"";return B.createElement("input",{name:l,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,o=t.focusedValue,l=t.isFocused,r=t.selectValue,a=this.getFocusableOptions();return B.createElement(Bn,N({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:o,isFocused:l,selectValue:r,focusableOptions:a}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,o=e.ValueContainer,l=this.props,r=l.className,a=l.id,s=l.isDisabled,c=l.menuIsOpen,u=this.state.isFocused,d=this.commonProps=this.getCommonProps();return B.createElement(i,N({},d,{className:r,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:u}),this.renderLiveRegion(),B.createElement(t,N({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:u,menuIsOpen:c}),B.createElement(o,N({},d,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),B.createElement(n,N({},d,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],i=[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,l=t.ariaSelection,r=t.isFocused,a=t.prevWasFocused,s=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,b=Ut(c),m={};if(n&&(c!==n.value||s!==n.options||u!==n.menuIsOpen||d!==n.inputValue)){var g=u?function(e,t){return vi(fi(e,t))}(e,b):[],f=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i-1?n:t[0]}(t,g);m={selectValue:b,focusedOption:v,focusedValue:f,clearFocusValueOnUpdate:!1}}var h=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},y=l,_=r&&a;return r&&!_&&(y={value:nn(p,b,b[0]||null),options:b,action:"initial-input-focus"},_=!a),"initial-input-focus"===(null==l?void 0:l.action)&&(y=null),R(R(R({},m),h),{},{prevProps:e,ariaSelection:y,prevWasFocused:_})}}],n&&H(t.prototype,n),i&&H(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(B.Component);xi.defaultProps=mi;var Oi=(0,B.forwardRef)((function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,i=e.defaultMenuIsOpen,o=void 0!==i&&i,l=e.defaultValue,r=void 0===l?null:l,a=e.inputValue,s=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,b=e.value,m=A(e,z),g=L((0,B.useState)(void 0!==a?a:n),2),f=g[0],v=g[1],h=L((0,B.useState)(void 0!==s?s:o),2),y=h[0],_=h[1],k=L((0,B.useState)(void 0!==b?b:r),2),E=k[0],w=k[1],C=(0,B.useCallback)((function(e,t){"function"==typeof c&&c(e,t),w(e)}),[c]),S=(0,B.useCallback)((function(e,t){var n;"function"==typeof u&&(n=u(e,t)),v(void 0!==n?n:e)}),[u]),x=(0,B.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),O=(0,B.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),V=void 0!==a?a:f,P=void 0!==s?s:y,M=void 0!==b?b:E;return R(R({},m),{},{inputValue:V,menuIsOpen:P,onChange:C,onInputChange:S,onMenuClose:O,onMenuOpen:x,value:M})}(e);return B.createElement(xi,N({ref:t},n))})),Vi=Oi;n(855),window.wp.notices,window.wp.date;var Pi=(0,e.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(d.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function Mi(t){const{message:n,subMessage:i,link:o,position:r}=t,a=null!=r?r:"middle left";return(0,e.createElement)("div",{className:"information-popover"},(0,e.createElement)(c.DropdownMenu,{label:(0,l.__)("More Information","block-visibility"),icon:Pi,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:a,noArrow:!1}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,n),i&&(0,e.createElement)("p",null,i),o&&(0,e.createElement)(c.ExternalLink,{href:o},(0,l.__)("Learn More","block-visibility"))))))}function Ni(n){var i,o,r;const{settings:a,setSettings:s,setHasUpdates:d,visibilityControls:p,setVisibilityControls:b,variables:m}=n,g=null!==(i=a?.plugin_settings)&&void 0!==i?i:{},f=function(e,n){var i,o;let r=[];if(!e||!n||0===e.length||0===n.length)return r;let a=function(){let e=[{label:(0,l.__)("Hide Block","block-visibility"),attributeSlug:"hideBlock",settingSlug:"hide_block"},{label:(0,l.__)("Browser & Device","block-visibility"),attributeSlug:"browserDevice",settingSlug:"browser_device"},{label:(0,l.__)("Cookie","block-visibility"),attributeSlug:"cookie",settingSlug:"cookie"},{label:(0,l.__)("Date & Time","block-visibility"),attributeSlug:"dateTime",settingSlug:"date_time"},{label:(0,l.__)("Location","block-visibility"),attributeSlug:"location",settingSlug:"location"},{label:(0,l.__)("Metadata","block-visibility"),attributeSlug:"metadata",settingSlug:"metadata"},{label:(0,l.__)("Query String","block-visibility"),attributeSlug:"queryString",settingSlug:"query_string"},{label:(0,l.__)("Referral Source","block-visibility"),attributeSlug:"referralSource",settingSlug:"referral_source"},{label:(0,l.__)("Screen Size","block-visibility"),attributeSlug:"screenSize",settingSlug:"screen_size"},{label:(0,l.__)("URL Path","block-visibility"),attributeSlug:"urlPath",settingSlug:"url_path"},{label:(0,l.__)("User Role","block-visibility"),attributeSlug:"userRole",settingSlug:"visibility_by_role"},{label:(0,l.__)("Visibility Presets","block-visibility"),attributeSlug:"visibilityPresets",settingSlug:"visibility_presets"},{label:(0,l.__)("Advanced Custom Fields","block-visibility"),type:"integration",attributeSlug:"acf",settingSlug:"acf",icon:V},{label:(0,l.__)("Easy Digital Downloads","block-visibility"),type:"integration",attributeSlug:"edd",settingSlug:"edd",icon:S},{label:(0,l.__)("WooCommerce","block-visibility"),type:"integration",attributeSlug:"woocommerce",settingSlug:"woocommerce",icon:x},{label:(0,l.__)("WP Fusion","block-visibility"),type:"integration",attributeSlug:"wpFusion",settingSlug:"wp_fusion",icon:O}];return e=(0,u.applyFilters)("blockVisibility.controls",e),e=(0,u.applyFilters)("blockVisibility.coreControls",e),e=(0,u.applyFilters)("blockVisibility.integrationControls",e),e=e.filter(((e,t,n)=>t===n.findIndex((t=>t.attributeSlug===e.attributeSlug&&t.settingSlug===e.settingSlug)))),e.sort(((e,t)=>e.label.localeCompare(t.label))),e}();a.forEach((function(e){"integration"!==e.type||(e=>{let t=!1;var i;return n?.integrations&&(t=null!==(i=n?.integrations[e]?.active)&&void 0!==i&&i),t})(e.settingSlug)||(a=a.filter((t=>t.settingSlug!==e.settingSlug)))}));const s=null!==(i=e?.visibility_controls)&&void 0!==i?i:{};(0,t.isEmpty)(s)||a.forEach((function(e){var n;let i=!1;(0,t.has)(s,e.settingSlug)||(i=!0),(null===(n=s[e.settingSlug]?.enable)||void 0===n||n)&&(i=!0),i&&r.push(e)}));const c=null!==(o=e?.plugin_settings?.default_controls)&&void 0!==o?o:[];return r.forEach((function(e){c.includes(e.settingSlug)&&(e.isDefault=!0)})),r=(0,u.applyFilters)("blockVisibility.enabledControls",r,e,n),r}(a,m),v=[];f.forEach((e=>{v.push({label:e.label,value:e.settingSlug})}));const h=null===(o=p?.general?.enable_local_controls)||void 0===o||o,y=null!==(r=g?.default_controls)&&void 0!==r?r:[],_=v.filter((e=>y.includes(e.value)));return(0,e.createElement)("div",{className:"settings-panel two-columns"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("General","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__select has-info-popover"},(0,e.createElement)("div",{className:"select-control-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Default visibility controls","block-visibility"))),(0,e.createElement)(Vi,{className:"block-visibility__react-select",classNamePrefix:"react-select",styles:{multiValueLabel:(e,t)=>t.data.isFixed?{...e,backgroundColor:"#757575",color:"#ffffff",paddingRight:6}:e,multiValueRemove:(e,t)=>t.data.isFixed?{...e,display:"none"}:e},isClearable:_.some((e=>!e.isFixed)),placeholder:(0,l.__)("Select Controls…","block-visibility"),options:v,value:(k=_,k.filter((e=>e.isFixed)).concat(k.filter((e=>!e.isFixed)))),onChange:(e,t)=>((e,t)=>{const n=[];switch(t.action){case"remove-value":case"pop-value":if(t.removedValue.isFixed)return;0!==e.length&&e.forEach((e=>{n.push(e.value)}));break;case"select-option":0!==e.length&&e.forEach((e=>{n.push(e.value)}));break;case"clear":const i=v.filter((e=>e.isFixed));0!==i.length&&i.forEach((e=>{n.push(e.value)}))}s({...a,plugin_settings:{...g,default_controls:n}}),d(!0)})(e,t),isMulti:!0})),(0,e.createElement)(Mi,{message:(0,l.__)("Default controls are automatically displayed in the Visibility panel when editing a block in the Editor. Defaults can be helpful if you frequently use the same few controls.","block-visibility")})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable local visibility controls.","block-visibility"),checked:h,onChange:()=>{b({...p,general:{...p.general,enable_local_controls:!h}})}}),(0,e.createElement)(Mi,{message:(0,l.__)('"Local" refers to the visibility controls available on each block. When disabled, only Visibility Presets and the Hide Block control will be available. Presets are then used to manage all other enabled controls.',"block-visibility")})),(0,e.createElement)(c.Slot,{name:"VisibilityControlsGeneral"})));var k}function Ti(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.hide_block?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-hide-block"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Hide Block","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Hide Block control.","block-visibility"),checked:r,onChange:()=>{o({...i,hide_block:{...i.hide_block,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Hide Block control allows you to hide blocks easily on your website's front end. This control overrides all other controls when enabled on a block.","block-visibility"),link:k.settingsHideBlock}))))}function Di(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.browser_device?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-browser-device"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Browser & Device (User Agent)","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Browser & Device control.","block-visibility"),checked:r,onChange:()=>{o({...i,browser_device:{...i.browser_device,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Browser & Device control allows you to conditionally display a block based on the device or web browser the current user is using to visit your website.","block-visibility"),link:k.settingsBrowserDevice}))))}function Ri(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.cookie?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-cookie"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Cookie","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Cookie control.","block-visibility"),checked:r,onChange:()=>{o({...i,cookie:{...i.cookie,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Cookie control allows you to conditionally display a block based on HTML cookies.","block-visibility"),link:k.settingsCookie}))))}function Ii(t){var n,i,o;const{visibilityControls:r,setVisibilityControls:a}=t,s=null===(n=r?.date_time?.enable)||void 0===n||n,u=null===(i=r?.date_time?.enable_day_of_week)||void 0===i||i,d=null===(o=r?.date_time?.enable_time_of_day)||void 0===o||o;let p=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Day of Week control.","block-visibility"),checked:u,onChange:()=>{a({...r,date_time:{...r.date_time,enable_day_of_week:!u}})}}),b=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Time of Day control.","block-visibility"),checked:d,onChange:()=>{a({...r,date_time:{...r.date_time,enable_time_of_day:!d}})}});return s||(p=(0,e.createElement)(c.Disabled,null,p),b=(0,e.createElement)(c.Disabled,null,b)),(0,e.createElement)("div",{className:"settings-panel control-date-time"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Date & Time","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Date & Time controls.","block-visibility"),checked:s,onChange:()=>{a({...r,date_time:{...r.date_time,enable:!s}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Date & Time control allows you to conditionally display blocks based on time and date settings, which includes the ability to schedule blocks.","block-visibility"),link:k.settingsDateTime})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover first subsetting"},p,(0,e.createElement)(Mi,{message:(0,l.__)("The Day of Week control adds functionality to the main Date & Time control. It allows you to conditionally display blocks based on specific days of the week within a given schedule.","block-visibility"),link:k.settingsDateTime})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},b,(0,e.createElement)(Mi,{message:(0,l.__)("The Time of Day adds functionality to the main Date & Time control. It allows you to conditionally display blocks at specific time intervals on each day of a given schedule.","block-visibility"),link:k.settingsDateTime}))))}function Fi(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.location?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-location"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Location","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Location control.","block-visibility"),checked:r,onChange:()=>{o({...i,location:{...i.location,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Location control allows you to conditionally display blocks based on where the block is located on your website. This includes page and post types, taxonomies, and more.","block-visibility"),link:k.settingsLocation}))))}function Li(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.metadata?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-metadata"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Metadata (Custom Fields)","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Metadata control.","block-visibility"),checked:r,onChange:()=>{o({...i,metadata:{...i.metadata,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Metadata control allows you to conditionally display a block based on post or user metadata. Metadata is often referred to as Custom Fields. If you are already using the Advanced Custom Fields plugin, use the ACF control over the Metadata control.","block-visibility"),link:k.settingsMetadata}))))}function Ai(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.query_string?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-query-string"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Query String","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Query String control.","block-visibility"),checked:r,onChange:()=>{o({...i,query_string:{...i.query_string,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Query String control allows you to conditionally display blocks based on URL query strings.","block-visibility"),link:k.settingsQueryString}))))}function Bi(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.referral_source?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-referral-source"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Referral Source","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Referral Source control.","block-visibility"),checked:r,onChange:()=>{o({...i,referral_source:{...i.referral_source,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Referral Source control allows you to conditionally display blocks based on the domain or URL from which visitors arrive at your site.","block-visibility"),link:k.settingsReferralSource}))))}function zi(t){const[n,i]=(0,e.useState)(!1),{screenSize:o,enableAdvancedControls:r}=t,a=function(e){const t=e.breakpoints.large,n=e.breakpoints.medium,i=e.controls.large,o=e.controls.medium,l=e.controls.small;let r="";return i&&(r=`/* Large screens (desktops, ${t} and up) */\n@media ( min-width: ${t} ) {\n\t.block-visibility-hide-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),o&&(r=(r?r+"\n\n":r)+`/* Medium screens (tablets, between ${n} and ${t}) */\n@media ( min-width: ${n} ) and ( max-width: ${Hi(t)} ) {\n\t.block-visibility-hide-medium-screen {\n\t\tdisplay: none !important;\n\t}\n}`),l&&(r=(r?r+"\n\n":r)+`/* Small screens (mobile devices, less than ${n}) */\n@media ( max-width: ${Hi(n)} ) {\n\t.block-visibility-hide-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),r||(r="/* All screen size controls have been disabled. */"),r}(o),s=function(e){const t=e.breakpoints.extra_large,n=e.breakpoints.large,i=e.breakpoints.medium,o=e.breakpoints.small,l=e.controls.extra_large,r=e.controls.large,a=e.controls.medium,s=e.controls.small,c=e.controls.extra_small,u="\n\n";let d="";return l&&(d=`/* Extra large screens (large desktops, ${t} and up) */\n@media ( min-width: ${t} ) {\n\t.block-visibility-hide-extra-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),r&&(d=(d?d+u:d)+`/* Large screens (desktops, between ${n} and ${t}) */\n@media ( min-width: ${n} ) and (max-width: ${Hi(t)} ) {\n\t.block-visibility-hide-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),a&&(d=(d?d+u:d)+`/* Medium screens (tablets, between ${i} and ${n}) */\n@media ( min-width: ${i} ) and ( max-width: ${Hi(n)} ) {\n\t.block-visibility-hide-medium-screen {\n\t\tdisplay: none !important;\n\t}\n}`),s&&(d=(d?d+u:d)+`/* Small screens (landscape mobile devices, between ${o} and ${n}) */\n@media ( min-width: ${o} ) and ( max-width: ${Hi(i)} ) {\n\t.block-visibility-hide-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),c&&(d=(d?d+u:d)+`/* Extra small screens (portrait mobile devices, less than ${o}) */\n@media ( max-width: ${Hi(o)} ) {\n\t.block-visibility-hide-extra-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),d||(d="/* All screen size controls have been disabled. */"),d}(o);return(0,e.createElement)("div",{className:"breakpoint-css-preview subsetting"},(0,e.createElement)(c.Button,{onClick:()=>i(!n),isSecondary:!0},[!n&&(0,l.__)("Preview Frontend CSS","block-visibility"),n&&(0,l.__)("Hide Preview","block-visibility")]),n&&(0,e.createElement)("pre",null,[r&&s,!r&&a]))}function Hi(e){return(0,t.trim)(e,"px")-.02+"px"}function Ui(t){const{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:r}=t,a={extra_large:{title:(0,l.__)("Extra Large","block-visibility"),description:(0,l.__)("Large desktop screen sizes.")},large:{title:(0,l.__)("Large","block-visibility"),description:(0,l.__)("Desktop and tablet (landscape) screen sizes.","block-visibility")},medium:{title:(0,l.__)("Medium","block-visibility"),description:(0,l.__)("Tablet (portrait) screen sizes.","block-visibility")},small:{title:(0,l.__)("Small","block-visibility"),description:(0,l.__)("Mobile (landscape) screen sizes.","block-visibility")}};return(0,e.createElement)("div",{className:"breakpoints-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Breakpoints","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The plugin automatically sets a series of breakpoints that enable the Screen Size control. However, for best results, you can configure the breakpoints to correspond with the media breakpoints of your current theme.","block-visibility"),subMessage:(0,l.__)("The default breakpoints are Large (992px) and Medium (768px). Advanced screen size controls add Extra Large (1200px) and Small (576px).","block-visibility"),link:k.settingsScreenSize})),Object.entries(a).map((t=>{let[l,a]=t;const s=o.breakpoints[l];return"extra_large"!==l&&"small"!==l||r?(0,e.createElement)("div",{className:"breakpoint",key:l},(0,e.createElement)("div",{className:"breakpoint-inputs"},(0,e.createElement)(c.__experimentalUnitControl,{label:a.title,value:s,onChange:e=>function(e,t){i({...n,screen_size:{...o,breakpoints:{...o.breakpoints,[e]:t}}})}(l,e),units:[{value:"px",label:"px"}]}),(0,e.createElement)("div",{className:"settings-panel__help"},a.description))):null})))}function ji(t){const{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:r}=t;function a(e,t){i({...n,screen_size:{...o,controls:{...o.controls,[e]:t}}})}return(0,e.createElement)("div",{className:"controls-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Controls","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The settings below allow you to restrict which controls are available to users in the Block/Site Editor. Disabling controls will remove the corresponding CSS from the front end of your website.","block-visibility"),subMessage:(0,l.__)("The default controls are Desktop, Tablet, and Mobile. Advanced screen size controls add Large Desktop and Mobile (portrait).","block-visibility"),link:k.settingsScreenSize})),r&&(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable large desktop control","block-visibility"),help:(0,l.sprintf)( +!function(){var e={184:function(e,t){var n;!function(){"use strict";var i={}.hasOwnProperty;function o(){for(var e=[],t=0;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,r),i=o.default.Children.only(t);return o.default.cloneElement(i,c(c({},n),{},{onClick:this.onClick}))}}])&&u(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.default.PureComponent);t.CopyToClipboard=g,m(g,"defaultProps",{onCopy:void 0,options:void 0})},855:function(e,t,n){"use strict";var i=n(300).CopyToClipboard;i.CopyToClipboard=i,e.exports=i},921:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,l=n?Symbol.for("react.fragment"):60107,r=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,b=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,f=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,h=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case u:case d:case l:case a:case r:case b:return e;default:switch(e=e&&e.$$typeof){case c:case p:case f:case g:case s:return e;default:return t}}case o:return t}}}function E(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=i,t.ForwardRef=p,t.Fragment=l,t.Lazy=f,t.Memo=g,t.Portal=o,t.Profiler=a,t.StrictMode=r,t.Suspense=b,t.isAsyncMode=function(e){return E(e)||k(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===l},t.isLazy=function(e){return k(e)===f},t.isMemo=function(e){return k(e)===g},t.isPortal=function(e){return k(e)===o},t.isProfiler=function(e){return k(e)===a},t.isStrictMode=function(e){return k(e)===r},t.isSuspense=function(e){return k(e)===b},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===d||e===a||e===r||e===b||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===g||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===h||e.$$typeof===y||e.$$typeof===_||e.$$typeof===v)},t.typeOf=k},864:function(e,t,n){"use strict";e.exports=n(921)},742:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],i=0;i{var n;const o=null!==(n=i[t].rel)&&void 0!==n?n:"noreferrer";return(0,e.createElement)("a",{key:t,href:i[t].url,className:"plugin-links__"+t,target:"_blank",rel:o},(0,e.createElement)(g,{icon:i[t].icon}),(0,e.createElement)("span",null,i[t].title))}));return(0,e.createElement)("div",{className:"masthead"},(0,e.createElement)("div",{className:"inner-container"},(0,e.createElement)("div",{className:"masthead__branding"},(0,e.createElement)("h1",null,E,(0,e.createElement)("span",null,(0,l.__)("Block Visibility","block-visibility")),n?.is_pro&&(0,e.createElement)("span",{className:"pro-badge"},"Pro"))),(0,e.createElement)("div",{className:"masthead__plugin-links"},o)))}function M(t){var n;const{variables:i}=t,o=null!==(n=i?.plugin_variables)&&void 0!==n?n:[],r={plugin:{title:(0,l.__)("Block Visibility","block-visibility")+" "+o.version,url:k.settingsHome,rel:"external"},docs:{title:(0,l.__)("Knowledge Base","block-visibility"),url:k.settingsKnowledgeBase,rel:"external"},support:{title:(0,l.__)("Support","block-visibility"),url:k.blockVisibilityOrgSupport},repo:{title:(0,l.__)("GitHub","block-visibility"),url:k.gitHub},twitter:{title:(0,l.__)("Twitter","block-visibility"),url:k.twitter}};(0,u.applyFilters)("blockVisibility.FooterLinks",r);const a=Object.keys(r).map((t=>{var n;const i=null!==(n=r[t].rel)&&void 0!==n?n:"noreferrer";return(0,e.createElement)("a",{key:t,href:r[t].url,className:"footer-links__"+t,target:"_blank",rel:i},r[t].title)}));return(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("div",{className:"inner-container"},a))}function N(){return N=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var B=n(196),z=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function H(e,t){for(var n=0;n0?ee(ue,--se):0,re--,10===ce&&(re=1,le--),ce}function me(){return ce=se2||he(ce)>3?"":" "}function we(e,t){for(;--t&&me()&&!(ce<48||ce>102||ce>57&&ce<65||ce>70&&ce<97););return ve(e,fe()+(t<6&&32==ge()&&32==me()))}function Ce(e){for(;me();)switch(ce){case e:return se;case 34:case 39:34!==e&&39!==e&&Ce(ce);break;case 40:41===e&&Ce(e);break;case 92:me()}return se}function Se(e,t){for(;me()&&e+ce!==57&&(e+ce!==84||47!==ge()););return"/*"+ve(t,se-1)+"*"+Y(47===e?e:me())}function xe(e){for(;!he(ge());)me();return ve(e,se)}var Oe="-ms-",Ve="-moz-",Pe="-webkit-",Me="comm",Ne="rule",Te="decl",De="@keyframes";function Re(e,t){for(var n="",i=ie(e),o=0;o0&&ne(w)-d&&oe(b>32?ze(w+";",i,n,d-1):ze(Q(w," ","")+";",i,n,d-2),s);break;case 59:w+=";";default:if(oe(E=Ae(w,t,n,c,u,o,a,y,_=[],k=[],d),l),123===h)if(0===u)Le(w,t,E,E,_,l,d,a,k);else switch(99===p&&110===ee(w,3)?100:p){case 100:case 109:case 115:Le(e,E,E,i&&oe(Ae(e,E,E,0,0,o,a,y,o,_=[],d),k),o,k,d,a,i?_:k);break;default:Le(w,E,E,E,[""],k,0,a,k)}}c=u=b=0,g=v=1,y=w="",d=r;break;case 58:d=1+ne(w),b=m;default:if(g<1)if(123==h)--g;else if(125==h&&0==g++&&125==be())continue;switch(w+=Y(h),h*g){case 38:v=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(ne(w)-1)*v,v=1;break;case 64:45===ge()&&(w+=ke(me())),p=ge(),u=d=ne(y=w+=xe(fe())),h++;break;case 45:45===m&&2==ne(w)&&(g=0)}}return l}function Ae(e,t,n,i,o,l,r,a,s,c,u){for(var d=o-1,p=0===o?l:[""],b=ie(p),m=0,g=0,f=0;m0?p[v]+" "+h:Q(h,/&\f/g,p[v])))&&(s[f++]=y);return de(e,t,n,0===o?Ne:a,s,c,u)}function Be(e,t,n){return de(e,t,n,Me,Y(ce),te(e,2,-2),0)}function ze(e,t,n,i){return de(e,t,n,Te,te(e,0,i),te(e,i+1,-1),i)}var He=function(e,t,n){for(var i=0,o=0;i=o,o=ge(),38===i&&12===o&&(t[n]=1),!he(o);)me();return ve(e,se)},Ue=new WeakMap,je=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ue.get(n))&&!i){Ue.set(e,!0);for(var o=[],l=function(e,t){return _e(function(e,t){var n=-1,i=44;do{switch(he(i)){case 0:38===i&&12===ge()&&(t[n]=1),e[n]+=He(se-1,t,n);break;case 2:e[n]+=ke(i);break;case 4:if(44===i){e[++n]=58===ge()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Y(i)}}while(i=me());return e}(ye(e),t))}(t,o),r=n.props,a=0,s=0;a6)switch(ee(e,t+1)){case 109:if(45!==ee(e,t+4))break;case 102:return Q(e,/(.+:)(.+)-([^]+)/,"$1"+Pe+"$2-$3$1"+Ve+(108==ee(e,t+3)?"$3":"$2-$3"))+e;case 115:return~J(e,"stretch")?Ge(Q(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==ee(e,t+1))break;case 6444:switch(ee(e,ne(e)-3-(~J(e,"!important")&&10))){case 107:return Q(e,":",":"+Pe)+e;case 101:return Q(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Pe+(45===ee(e,14)?"inline-":"")+"box$3$1"+Pe+"$2$3$1"+Oe+"$2box$3")+e}break;case 5936:switch(ee(e,t+11)){case 114:return Pe+e+Oe+Q(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Pe+e+Oe+Q(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Pe+e+Oe+Q(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Pe+e+Oe+e+e}return e}var We=[function(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case Te:e.return=Ge(e.value,e.length);break;case De:return Re([pe(e,{value:Q(e.value,"@","@"+Pe)})],i);case Ne:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Re([pe(e,{props:[Q(t,/:(read-\w+)/,":"+Ve+"$1")]})],i);case"::placeholder":return Re([pe(e,{props:[Q(t,/:(plac\w+)/,":"+Pe+"input-$1")]}),pe(e,{props:[Q(t,/:(plac\w+)/,":"+Ve+"$1")]}),pe(e,{props:[Q(t,/:(plac\w+)/,Oe+"input-$1")]})],i)}return""}))}}],Ze=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,o,l=e.stylisPlugins||We,r={},a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++i,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Ke={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Xe=/[A-Z]|^ms/g,Qe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Je=function(e){return 45===e.charCodeAt(1)},et=function(e){return null!=e&&"boolean"!=typeof e},tt=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Je(n=e)?n:n.replace(Xe,"-$&").toLowerCase()),t[e];var n}}(),nt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Qe,(function(e,t,n){return ot={name:t,styles:n,next:ot},t}))}return 1===Ke[e]||Je(e)||"number"!=typeof t||0===t?t:t+"px"};function it(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return ot={name:n.name,styles:n.styles,next:ot},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)ot={name:i.name,styles:i.styles,next:ot},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var o=0;oe.brand+"/"+e.version)).join(" "),wt):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const Pt=Math.round;function Mt(e){return St(e)?e:e.contextElement}const Nt={x:1,y:1};function Tt(e){const t=Mt(e);if(!Ct(t))return Nt;const n=t.getBoundingClientRect(),{width:i,height:o,fallback:l}=function(e){const t=_t(e);let n=parseFloat(t.width),i=parseFloat(t.height);const o=Ct(e),l=o?e.offsetWidth:n,r=o?e.offsetHeight:i,a=Pt(n)!==l||Pt(i)!==r;return a&&(n=l,i=r),{width:n,height:i,fallback:a}}(t);let r=(l?Pt(n.width):n.width)/i,a=(l?Pt(n.height):n.height)/o;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function Dt(e,t,n,i){var o,l;void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Mt(e);let s=Nt;t&&(i?St(i)&&(s=Tt(i)):s=Tt(e));const c=a?yt(a):window,u=Vt()&&n;let d=(r.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/s.x,p=(r.top+(u&&(null==(l=c.visualViewport)?void 0:l.offsetTop)||0))/s.y,b=r.width/s.x,m=r.height/s.y;if(a){const e=yt(a),t=i&&St(i)?yt(i):i;let n=e.frameElement;for(;n&&i&&t!==e;){const e=Tt(n),t=n.getBoundingClientRect(),i=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(i.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(i.paddingTop))*e.y,d*=e.x,p*=e.y,b*=e.x,m*=e.y,d+=t.x,p+=t.y,n=yt(n).frameElement}}return g={width:b,height:m,x:d,y:p},{...g,top:g.y,left:g.x,right:g.x+g.width,bottom:g.y+g.height};var g}function Rt(e){if("html"===Et(e))return e;const t=e.assignedSlot||e.parentNode||xt(e)&&e.host||function(e){return((kt(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return xt(t)?t.host:t}function It(e){const t=Rt(e);return function(e){return["html","body","#document"].includes(Et(e))}(t)?t.ownerDocument.body:Ct(t)&&Ot(t)?t:It(t)}function Ft(e,t){var n;void 0===t&&(t=[]);const i=It(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),l=yt(i);return o?t.concat(l,l.visualViewport||[],Ot(i)?i:[]):t.concat(i,Ft(i))}var Lt=B.useLayoutEffect,At=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Bt=function(){};function zt(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Ht(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o-1}function Wt(e){return Gt(e)?window.pageYOffset:e.scrollTop}function Zt(e,t){Gt(e)?window.scrollTo(0,t):e.scrollTop=t}function qt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bt,o=Wt(e),l=t-o,r=0;!function t(){var a,s=(a=r+=10,l*((a=a/n-1)*a*a+1)+o);Zt(e,s),rn.bottom?Zt(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):i.top-o=m)return{placement:"bottom",maxHeight:t};if(C>=m&&!r)return l&&qt(s,S,O),{placement:"bottom",maxHeight:t};if(!r&&C>=i||r&&E>=i)return l&&qt(s,S,O),{placement:"bottom",maxHeight:r?E-y:C-y};if("auto"===o||r){var V=t,P=r?k:w;return P>=i&&(V=Math.min(P-y-a,t)),{placement:"top",maxHeight:V}}if("bottom"===o)return l&&Zt(s,S),{placement:"bottom",maxHeight:t};break;case"top":if(k>=m)return{placement:"top",maxHeight:t};if(w>=m&&!r)return l&&qt(s,x,O),{placement:"top",maxHeight:t};if(!r&&w>=i||r&&k>=i){var M=t;return(!r&&w>=i||r&&k>=i)&&(M=r?k-_:w-_),l&&qt(s,x,O),{placement:"top",maxHeight:M}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}({maxHeight:i,menuEl:e,minHeight:n,placement:o,shouldScroll:r&&!t,isFixedPosition:t,controlHeight:f});p(a.maxHeight),g(a.placement),null==s||s(a.placement)}}),[i,o,l,r,n,s,f]),t({ref:c,placerProps:R(R({},e),{},{placement:m||on(o),maxHeight:d})})},an=function(e,t){var n=e.theme,i=n.spacing.baseUnit,o=n.colors;return R({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},sn=an,cn=an,un=function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),t)};un.defaultProps={children:"No options"};var dn=function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),t)};dn.defaultProps={children:"Loading..."};var pn,bn,mn,gn=["size"],fn={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},vn=function(e){var t=e.size,n=A(e,gn);return ft("svg",N({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:fn},n))},hn=function(e){return ft(vn,N({size:20},e),ft("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},yn=function(e){return ft(vn,N({size:20},e),ft("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},kn=function(e,t){var n=e.isFocused,i=e.theme,o=i.spacing.baseUnit,l=i.colors;return R({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?l.neutral60:l.neutral20,padding:2*o,":hover":{color:n?l.neutral80:l.neutral40}})},En=kn,wn=kn,Cn=function(){var e=vt.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(pn||(bn=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],mn||(mn=bn.slice(0)),pn=Object.freeze(Object.defineProperties(bn,{raw:{value:Object.freeze(mn)}})))),Sn=function(e){var t=e.delay,n=e.offset;return ft("span",{css:vt({animation:"".concat(Cn," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},xn=function(e){var t=e.innerProps,n=e.isRtl;return ft("div",N({},$t(e,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ft(Sn,{delay:0,offset:n}),ft(Sn,{delay:160,offset:!0}),ft(Sn,{delay:320,offset:!n}))};xn.defaultProps={size:4};var On=["data"],Vn=["innerRef","isDisabled","isHidden","inputClassName"],Pn={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Mn={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":R({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Pn)},Nn=function(e){return R({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Pn)},Tn=function(e){var t=e.children,n=e.innerProps;return ft("div",n,t)},Dn={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ft(hn,null))},Control:function(e){var t=e.children,n=e.isDisabled,i=e.isFocused,o=e.innerRef,l=e.innerProps,r=e.menuIsOpen;return ft("div",N({ref:o},$t(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":i,"control--menu-is-open":r}),l),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ft(yn,null))},DownChevron:yn,CrossIcon:hn,Group:function(e){var t=e.children,n=e.cx,i=e.getStyles,o=e.getClassNames,l=e.Heading,r=e.headingProps,a=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return ft("div",N({},$t(e,"group",{group:!0}),a),ft(l,N({},r,{selectProps:u,theme:c,getStyles:i,getClassNames:o,cx:n}),s),ft("div",null,t))},GroupHeading:function(e){var t=jt(e);t.data;var n=A(t,On);return ft("div",N({},$t(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ft("span",N({},t,$t(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,i=jt(e),o=i.innerRef,l=i.isDisabled,r=i.isHidden,a=i.inputClassName,s=A(i,Vn);return ft("div",N({},$t(e,"input",{"input-container":!0}),{"data-value":n||""}),ft("input",N({className:t({input:!0},a),ref:o,style:Nn(r),disabled:l},s)))},LoadingIndicator:xn,Menu:function(e){var t=e.children,n=e.innerRef,i=e.innerProps;return ft("div",N({},$t(e,"menu",{menu:!0}),{ref:n},i),t)},MenuList:function(e){var t=e.children,n=e.innerProps,i=e.innerRef,o=e.isMulti;return ft("div",N({},$t(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,i=e.controlElement,o=e.innerProps,l=e.menuPlacement,r=e.menuPosition,a=(0,B.useRef)(null),s=(0,B.useRef)(null),c=L((0,B.useState)(on(l)),2),u=c[0],d=c[1],p=(0,B.useMemo)((function(){return{setPortalPlacement:d}}),[]),b=L((0,B.useState)(null),2),m=b[0],g=b[1],f=(0,B.useCallback)((function(){if(i){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(i),t="fixed"===r?0:window.pageYOffset,n=e[u]+t;n===(null==m?void 0:m.offset)&&e.left===(null==m?void 0:m.rect.left)&&e.width===(null==m?void 0:m.rect.width)||g({offset:n,rect:e})}}),[i,r,u,null==m?void 0:m.offset,null==m?void 0:m.rect.left,null==m?void 0:m.rect.width]);Lt((function(){f()}),[f]);var v=(0,B.useCallback)((function(){"function"==typeof s.current&&(s.current(),s.current=null),i&&a.current&&(s.current=function(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:r=!0,animationFrame:a=!1}=i,s=o&&!a,c=s||l?[...St(e)?Ft(e):e.contextElement?Ft(e.contextElement):[],...Ft(t)]:[];c.forEach((e=>{s&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)}));let u,d=null;r&&(d=new ResizeObserver((()=>{n()})),St(e)&&!a&&d.observe(e),St(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t));let p=a?Dt(e):null;return a&&function t(){const i=Dt(e);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n(),p=i,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{s&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(u)}}(i,a.current,f,{elementResize:"ResizeObserver"in window}))}),[i,f]);Lt((function(){v()}),[v]);var h=(0,B.useCallback)((function(e){a.current=e,v()}),[v]);if(!t&&"fixed"!==r||!m)return null;var y=ft("div",N({ref:h},$t(R(R({},e),{},{offset:m.offset,position:r,rect:m.rect}),"menuPortal",{"menu-portal":!0}),o),n);return ft(ln.Provider,{value:p},t?(0,ht.createPortal)(y,t):y)},LoadingMessage:dn,NoOptionsMessage:un,MultiValue:function(e){var t=e.children,n=e.components,i=e.data,o=e.innerProps,l=e.isDisabled,r=e.removeProps,a=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return ft(s,{data:i,innerProps:R(R({},$t(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:a},ft(c,{data:i,innerProps:R({},$t(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},t),ft(u,{data:i,innerProps:R(R({},$t(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},r),selectProps:a}))},MultiValueContainer:Tn,MultiValueLabel:Tn,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return ft("div",N({role:"button"},n),t||ft(hn,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,i=e.isFocused,o=e.isSelected,l=e.innerRef,r=e.innerProps;return ft("div",N({},$t(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":i,"option--is-selected":o}),{ref:l,"aria-disabled":n},r),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return ft("div",N({},$t(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,i=e.isDisabled,o=e.isRtl;return ft("div",N({},$t(e,"container",{"--is-disabled":i,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,i=e.innerProps;return ft("div",N({},$t(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),i),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,i=e.isMulti,o=e.hasValue;return ft("div",N({},$t(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),n),t)}},Rn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function In(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(i,l?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,o=e.label,l=void 0===o?"":o,r=e.selectValue,a=e.isDisabled,s=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&r)return"value ".concat(l," focused, ").concat(c(r,n),".");if("menu"===t){var u=a?" disabled":"",d="".concat(s?"selected":"focused").concat(u);return"option ".concat(l," ").concat(d,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Bn=function(e){var t=e.ariaSelection,n=e.focusedOption,i=e.focusedValue,o=e.focusableOptions,l=e.isFocused,r=e.selectValue,a=e.selectProps,s=e.id,c=a.ariaLiveMessages,u=a.getOptionLabel,d=a.inputValue,p=a.isMulti,b=a.isOptionDisabled,m=a.isSearchable,g=a.menuIsOpen,f=a.options,v=a.screenReaderStatus,h=a.tabSelectsValue,y=a["aria-label"],_=a["aria-live"],k=(0,B.useMemo)((function(){return R(R({},An),c||{})}),[c]),E=(0,B.useMemo)((function(){var e,n="";if(t&&k.onChange){var i=t.option,o=t.options,l=t.removedValue,a=t.removedValues,s=t.value,c=l||i||(e=s,Array.isArray(e)?null:e),d=c?u(c):"",p=o||a||void 0,m=p?p.map(u):[],g=R({isDisabled:c&&b(c,r),label:d,labels:m},t);n=k.onChange(g)}return n}),[t,k,b,r,u]),w=(0,B.useMemo)((function(){var e="",t=n||i,l=!!(n&&r&&r.includes(n));if(t&&k.onFocus){var a={focused:t,label:u(t),isDisabled:b(t,r),isSelected:l,options:o,context:t===n?"menu":"value",selectValue:r};e=k.onFocus(a)}return e}),[n,i,u,b,k,o,r]),C=(0,B.useMemo)((function(){var e="";if(g&&f.length&&k.onFilter){var t=v({count:o.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[o,d,g,k,f,v]),S=(0,B.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":g?"menu":"input";e=k.guidance({"aria-label":y,context:t,isDisabled:n&&b(n,r),isMulti:p,isSearchable:m,tabSelectsValue:h})}return e}),[y,n,i,p,b,m,g,k,r,h]),x="".concat(w," ").concat(C," ").concat(S),O=ft(B.Fragment,null,ft("span",{id:"aria-selection"},E),ft("span",{id:"aria-context"},x)),V="initial-input-focus"===(null==t?void 0:t.action);return ft(B.Fragment,null,ft(Ln,{id:s},V&&O),ft(Ln,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},l&&!V&&O))},zn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Hn=new RegExp("["+zn.map((function(e){return e.letters})).join("")+"]","g"),Un={},jn=0;jn1?t-1:0),i=1;i0,g=d-p-u,f=!1;g>t&&r.current&&(i&&i(e),r.current=!1),m&&a.current&&(l&&l(e),a.current=!1),m&&t>g?(n&&!r.current&&n(e),b.scrollTop=d,f=!0,r.current=!0):!m&&-t>u&&(o&&!a.current&&o(e),b.scrollTop=0,f=!0,a.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,i,o,l]),d=(0,B.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,B.useCallback)((function(e){s.current=e.changedTouches[0].clientY}),[]),b=(0,B.useCallback)((function(e){var t=s.current-e.changedTouches[0].clientY;u(e,t)}),[u]),m=(0,B.useCallback)((function(e){if(e){var t=!!en&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",b,t)}}),[b,p,d]),g=(0,B.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",b,!1))}),[b,p,d]);return(0,B.useEffect)((function(){if(t){var e=c.current;return m(e),function(){g(e)}}}),[t,m,g]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),l=function(e){var t=e.isEnabled,n=e.accountForScrollbars,i=void 0===n||n,o=(0,B.useRef)({}),l=(0,B.useRef)(null),r=(0,B.useCallback)((function(e){if(oi){var t=document.body,n=t&&t.style;if(i&&Qn.forEach((function(e){var t=n&&n[e];o.current[e]=t})),i&&li<1){var l=parseInt(o.current.paddingRight,10)||0,r=document.body?document.body.clientWidth:0,a=window.innerWidth-r+l||0;Object.keys(Jn).forEach((function(e){var t=Jn[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(a,"px"))}t&&ii()&&(t.addEventListener("touchmove",ei,ri),e&&(e.addEventListener("touchstart",ni,ri),e.addEventListener("touchmove",ti,ri))),li+=1}}),[i]),a=(0,B.useCallback)((function(e){if(oi){var t=document.body,n=t&&t.style;li=Math.max(li-1,0),i&&li<1&&Qn.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&ii()&&(t.removeEventListener("touchmove",ei,ri),e&&(e.removeEventListener("touchstart",ni,ri),e.removeEventListener("touchmove",ti,ri)))}}),[i]);return(0,B.useEffect)((function(){if(t){var e=l.current;return r(e),function(){a(e)}}}),[t,r,a]),function(e){l.current=e}}({isEnabled:n});return ft(B.Fragment,null,n&&ft("div",{onClick:ai,css:si}),t((function(e){o(e),l(e)})))}var ui={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},di=function(e){var t=e.name,n=e.onFocus;return ft("input",{required:!0,name:t,tabIndex:-1,onFocus:n,css:ui,value:"",onChange:function(){}})},pi={clearIndicator:wn,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,i=e.isFocused,o=e.theme,l=o.colors,r=o.borderRadius;return R({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?l.neutral5:l.neutral0,borderColor:n?l.neutral10:i?l.primary:l.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:i?l.primary:l.neutral30}})},dropdownIndicator:En,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,i=n.colors,o=n.spacing;return R({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,i=e.theme,o=i.spacing.baseUnit,l=i.colors;return R({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?l.neutral10:l.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,i=e.value,o=e.theme,l=o.spacing,r=o.colors;return R(R({visibility:n?"hidden":"visible",transform:i?"translateZ(0)":""},Mn),t?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:r.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,i=e.size,o=e.theme,l=o.colors,r=o.spacing.baseUnit;return R({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?l.neutral60:l.neutral20,padding:2*r})},loadingMessage:cn,menu:function(e,t){var n,i=e.placement,o=e.theme,l=o.borderRadius,r=o.spacing,a=o.colors;return R((T(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),T(n,"position","absolute"),T(n,"width","100%"),T(n,"zIndex",1),n),t?{}:{backgroundColor:a.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:r.menuGutter,marginTop:r.menuGutter})},menuList:function(e,t){var n=e.maxHeight,i=e.theme.spacing.baseUnit;return R({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:i,paddingTop:i})},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,i=n.spacing,o=n.borderRadius,l=n.colors;return R({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,i=n.borderRadius,o=n.colors,l=e.cropWithEllipsis;return R({overflow:"hidden",textOverflow:l||void 0===l?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,i=n.spacing,o=n.borderRadius,l=n.colors,r=e.isFocused;return R({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:r?l.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},noOptionsMessage:sn,option:function(e,t){var n=e.isDisabled,i=e.isFocused,o=e.isSelected,l=e.theme,r=l.spacing,a=l.colors;return R({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?a.primary:i?a.primary25:"transparent",color:n?a.neutral20:o?a.neutral0:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?a.primary:a.primary50}})},placeholder:function(e,t){var n=e.theme,i=n.spacing,o=n.colors;return R({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,i=e.theme,o=i.spacing,l=i.colors;return R({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,i=e.isMulti,o=e.hasValue,l=e.selectProps.controlShouldRenderValue;return R({alignItems:"center",display:i&&o&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},bi={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},mi={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Kt(),captureMenuScroll:!Kt(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=R({ignoreCase:!0,ignoreAccents:!0,stringify:Yn,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,o=n.ignoreAccents,l=n.stringify,r=n.trim,a=n.matchFrom,s=r?qn(t):t,c=r?qn(l(e)):l(e);return i&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=Zn(s),c=Wn(c)),"start"===a?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function gi(e,t,n,i){return{type:"option",data:t,isDisabled:ki(e,t,n),isSelected:Ei(e,t,n),label:yi(e,t),value:_i(e,t),index:i}}function fi(e,t){return e.options.map((function(n,i){if("options"in n){var o=n.options.map((function(n,i){return gi(e,n,t,i)})).filter((function(t){return hi(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:i}:void 0}var l=gi(e,n,t,i);return hi(e,l)?l:void 0})).filter(tn)}function vi(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,W(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function hi(e,t){var n=e.inputValue,i=void 0===n?"":n,o=t.data,l=t.isSelected,r=t.label,a=t.value;return(!Ci(e)||!l)&&wi(e,{label:r,value:a,data:o},i)}var yi=function(e,t){return e.getOptionLabel(t)},_i=function(e,t){return e.getOptionValue(t)};function ki(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Ei(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=_i(e,t);return n.some((function(t){return _i(e,t)===i}))}function wi(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Ci=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Si=1,xi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}(l,e);var t,n,i,o=G(l);function l(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=o.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.instancePrefix="",t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,n){var i=t.props,o=i.onChange,l=i.name;n.name=l,t.ariaOnChange(e,n),o(e,n)},t.setValue=function(e,n,i){var o=t.props,l=o.closeMenuOnSelect,r=o.isMulti,a=o.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:a}),l&&(t.setState({inputIsHiddenAfterUpdate:!r}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:n,option:i})},t.selectOption=function(e){var n=t.props,i=n.blurInputOnSelect,o=n.isMulti,l=n.name,r=t.state.selectValue,a=o&&t.isOptionSelected(e,r),s=t.isOptionDisabled(e,r);if(a){var c=t.getOptionValue(e);t.setValue(r.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(s)return void t.ariaOnChange(e,{action:"select-option",option:e,name:l});o?t.setValue([].concat(W(r),[e]),"select-option",e):t.setValue(e,"select-option")}i&&t.blurInput()},t.removeValue=function(e){var n=t.props.isMulti,i=t.state.selectValue,o=t.getOptionValue(e),l=i.filter((function(e){return t.getOptionValue(e)!==o})),r=nn(n,l,l[0]||null);t.onChange(r,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(nn(t.props.isMulti,[],null),{action:"clear",removedValues:e})},t.popValue=function(){var e=t.props.isMulti,n=t.state.selectValue,i=n[n.length-1],o=n.slice(0,n.length-1),l=nn(e,o,o[0]||null);t.onChange(l,{action:"pop-value",removedValue:i})},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,n=new Array(e),i=0;i5||l>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var n=t.props.inputValue,i=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(i,{action:"input-change",prevInputValue:n}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var n=t.props.inputValue;t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:n}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){t.blockOptionHover||t.state.focusedOption===e||t.setState({focusedOption:e})},t.shouldHideSelectedOptions=function(){return Ci(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var n=t.props,i=n.isMulti,o=n.backspaceRemovesValue,l=n.escapeClearsValue,r=n.inputValue,a=n.isClearable,s=n.isDisabled,c=n.menuIsOpen,u=n.onKeyDown,d=n.tabSelectsValue,p=n.openMenuOnFocus,b=t.state,m=b.focusedOption,g=b.focusedValue,f=b.selectValue;if(!(s||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!i||r)return;t.focusValue("previous");break;case"ArrowRight":if(!i||r)return;t.focusValue("next");break;case"Delete":case"Backspace":if(r)return;if(g)t.removeValue(g);else{if(!o)return;i?t.popValue():a&&t.clearValue()}break;case"Tab":if(t.isComposing)return;if(e.shiftKey||!c||!d||!m||p&&t.isOptionSelected(m,f))return;t.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(t.isComposing)return;t.selectOption(m);break}return;case"Escape":c?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:r}),t.onMenuClose()):a&&l&&t.clearValue();break;case" ":if(r)return;if(!c){t.openMenu("first");break}if(!m)return;t.selectOption(m);break;case"ArrowUp":c?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":c?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!c)return;t.focusOption("pageup");break;case"PageDown":if(!c)return;t.focusOption("pagedown");break;case"Home":if(!c)return;t.focusOption("first");break;case"End":if(!c)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.instancePrefix="react-select-"+(t.props.instanceId||++Si),t.state.selectValue=Ut(e.value),e.menuIsOpen&&t.state.selectValue.length){var n=t.buildFocusableOptions(),i=n.indexOf(t.state.selectValue[0]);t.state.focusedOption=n[i]}return t}return t=l,n=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Yt(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,i=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&i&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Yt(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,i=n.selectValue,o=n.isFocused,l=this.buildFocusableOptions(),r="first"===e?0:l.length-1;if(!this.props.isMulti){var a=l.indexOf(i[0]);a>-1&&(r=a)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[r]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(i);i||(o=-1);var l=n.length-1,r=-1;if(n.length){switch(e){case"previous":r=0===o?0:-1===o?l:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var o=0,l=i.indexOf(n);n||(l=-1),"up"===e?o=l>0?l-1:i.length-1:"down"===e?o=(l+1)%i.length:"pageup"===e?(o=l-t)<0&&(o=0):"pagedown"===e?(o=l+t)>i.length-1&&(o=i.length-1):"last"===e&&(o=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(bi):R(R({},bi),this.props.theme):bi}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getClassNames,o=this.getValue,l=this.selectOption,r=this.setValue,a=this.props,s=a.isMulti,c=a.isRtl,u=a.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:i,getValue:o,hasValue:this.hasValue(),isMulti:s,isRtl:c,options:u,selectOption:l,selectProps:a,setValue:r,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return ki(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Ei(this.props,e,t)}},{key:"filterOption",value:function(e,t){return wi(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,o=e.inputValue,l=e.tabIndex,r=e.form,a=e.menuIsOpen,s=e.required,c=this.getComponents().Input,u=this.state,d=u.inputIsHidden,p=u.ariaSelection,b=this.commonProps,m=i||this.getElementId("input"),g=R(R(R({"aria-autocomplete":"list","aria-expanded":a,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":s,role:"combobox"},a&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==p?void 0:p.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?B.createElement(c,N({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:r,type:"text",value:o},g)):B.createElement(Xn,N({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Bt,onFocus:this.onInputFocus,disabled:t,tabIndex:l,inputMode:"none",form:r,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,o=t.MultiValueLabel,l=t.MultiValueRemove,r=t.SingleValue,a=t.Placeholder,s=this.commonProps,c=this.props,u=c.controlShouldRenderValue,d=c.isDisabled,p=c.isMulti,b=c.inputValue,m=c.placeholder,g=this.state,f=g.selectValue,v=g.focusedValue,h=g.isFocused;if(!this.hasValue()||!u)return b?null:B.createElement(a,N({},s,{key:"placeholder",isDisabled:d,isFocused:h,innerProps:{id:this.getElementId("placeholder")}}),m);if(p)return f.map((function(t,r){var a=t===v,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return B.createElement(n,N({},s,{components:{Container:i,Label:o,Remove:l},isFocused:a,isDisabled:d,key:c,index:r,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(b)return null;var y=f[0];return B.createElement(r,N({},s,{data:y,isDisabled:d}),this.formatOptionLabel(y,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,l=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||o)return null;var r={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return B.createElement(e,N({},t,{innerProps:r,isFocused:l}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,l=this.state.isFocused;return e&&o?B.createElement(e,N({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:l})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,o=this.props.isDisabled,l=this.state.isFocused;return B.createElement(n,N({},i,{isDisabled:o,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return B.createElement(e,N({},t,{innerProps:o,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,o=t.Menu,l=t.MenuList,r=t.MenuPortal,a=t.LoadingMessage,s=t.NoOptionsMessage,c=t.Option,u=this.commonProps,d=this.state.focusedOption,p=this.props,b=p.captureMenuScroll,m=p.inputValue,g=p.isLoading,f=p.loadingMessage,v=p.minMenuHeight,h=p.maxMenuHeight,y=p.menuIsOpen,_=p.menuPlacement,k=p.menuPosition,E=p.menuPortalTarget,w=p.menuShouldBlockScroll,C=p.menuShouldScrollIntoView,S=p.noOptionsMessage,x=p.onMenuScrollToTop,O=p.onMenuScrollToBottom;if(!y)return null;var V,P=function(t,n){var i=t.type,o=t.data,l=t.isDisabled,r=t.isSelected,a=t.label,s=t.value,p=d===o,b=l?void 0:function(){return e.onOptionHover(o)},m=l?void 0:function(){return e.selectOption(o)},g="".concat(e.getElementId("option"),"-").concat(n),f={id:g,onClick:m,onMouseMove:b,onMouseOver:b,tabIndex:-1};return B.createElement(c,N({},u,{innerProps:f,data:o,isDisabled:l,isSelected:r,key:g,label:a,type:i,value:s,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())V=this.getCategorizedOptions().map((function(t){if("group"===t.type){var o=t.data,l=t.options,r=t.index,a="".concat(e.getElementId("group"),"-").concat(r),s="".concat(a,"-heading");return B.createElement(n,N({},u,{key:a,data:o,options:l,Heading:i,headingProps:{id:s,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return P(e,"".concat(r,"-").concat(e.index))})))}if("option"===t.type)return P(t,"".concat(t.index))}));else if(g){var M=f({inputValue:m});if(null===M)return null;V=B.createElement(a,u,M)}else{var T=S({inputValue:m});if(null===T)return null;V=B.createElement(s,u,T)}var D={minMenuHeight:v,maxMenuHeight:h,menuPlacement:_,menuPosition:k,menuShouldScrollIntoView:C},R=B.createElement(rn,N({},u,D),(function(t){var n=t.ref,i=t.placerProps,r=i.placement,a=i.maxHeight;return B.createElement(o,N({},u,D,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:g,placement:r}),B.createElement(ci,{captureEnabled:b,onTopArrive:x,onBottomArrive:O,lockEnabled:w},(function(t){return B.createElement(l,N({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:g,maxHeight:a,focusedOption:d}),V)})))}));return E||"fixed"===k?B.createElement(r,N({},u,{appendTo:E,controlElement:this.controlRef,menuPlacement:_,menuPosition:k}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,o=t.isMulti,l=t.name,r=t.required,a=this.state.selectValue;if(l&&!i){if(r&&!this.hasValue())return B.createElement(di,{name:l,onFocus:this.onValueInputFocus});if(o){if(n){var s=a.map((function(t){return e.getOptionValue(t)})).join(n);return B.createElement("input",{name:l,type:"hidden",value:s})}var c=a.length>0?a.map((function(t,n){return B.createElement("input",{key:"i-".concat(n),name:l,type:"hidden",value:e.getOptionValue(t)})})):B.createElement("input",{name:l,type:"hidden",value:""});return B.createElement("div",null,c)}var u=a[0]?this.getOptionValue(a[0]):"";return B.createElement("input",{name:l,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,o=t.focusedValue,l=t.isFocused,r=t.selectValue,a=this.getFocusableOptions();return B.createElement(Bn,N({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:o,isFocused:l,selectValue:r,focusableOptions:a}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,o=e.ValueContainer,l=this.props,r=l.className,a=l.id,s=l.isDisabled,c=l.menuIsOpen,u=this.state.isFocused,d=this.commonProps=this.getCommonProps();return B.createElement(i,N({},d,{className:r,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:u}),this.renderLiveRegion(),B.createElement(t,N({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:u,menuIsOpen:c}),B.createElement(o,N({},d,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),B.createElement(n,N({},d,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],i=[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,l=t.ariaSelection,r=t.isFocused,a=t.prevWasFocused,s=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,b=Ut(c),m={};if(n&&(c!==n.value||s!==n.options||u!==n.menuIsOpen||d!==n.inputValue)){var g=u?function(e,t){return vi(fi(e,t))}(e,b):[],f=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i-1?n:t[0]}(t,g);m={selectValue:b,focusedOption:v,focusedValue:f,clearFocusValueOnUpdate:!1}}var h=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},y=l,_=r&&a;return r&&!_&&(y={value:nn(p,b,b[0]||null),options:b,action:"initial-input-focus"},_=!a),"initial-input-focus"===(null==l?void 0:l.action)&&(y=null),R(R(R({},m),h),{},{prevProps:e,ariaSelection:y,prevWasFocused:_})}}],n&&H(t.prototype,n),i&&H(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(B.Component);xi.defaultProps=mi;var Oi=(0,B.forwardRef)((function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,i=e.defaultMenuIsOpen,o=void 0!==i&&i,l=e.defaultValue,r=void 0===l?null:l,a=e.inputValue,s=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,b=e.value,m=A(e,z),g=L((0,B.useState)(void 0!==a?a:n),2),f=g[0],v=g[1],h=L((0,B.useState)(void 0!==s?s:o),2),y=h[0],_=h[1],k=L((0,B.useState)(void 0!==b?b:r),2),E=k[0],w=k[1],C=(0,B.useCallback)((function(e,t){"function"==typeof c&&c(e,t),w(e)}),[c]),S=(0,B.useCallback)((function(e,t){var n;"function"==typeof u&&(n=u(e,t)),v(void 0!==n?n:e)}),[u]),x=(0,B.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),O=(0,B.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),V=void 0!==a?a:f,P=void 0!==s?s:y,M=void 0!==b?b:E;return R(R({},m),{},{inputValue:V,menuIsOpen:P,onChange:C,onInputChange:S,onMenuClose:O,onMenuOpen:x,value:M})}(e);return B.createElement(xi,N({ref:t},n))})),Vi=Oi;n(855),window.wp.notices,window.wp.date;var Pi=(0,e.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(d.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function Mi(t){const{message:n,subMessage:i,link:o,position:r}=t,a=null!=r?r:"middle left";return(0,e.createElement)("div",{className:"information-popover"},(0,e.createElement)(c.DropdownMenu,{label:(0,l.__)("More Information","block-visibility"),icon:Pi,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:a,noArrow:!1}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,n),i&&(0,e.createElement)("p",null,i),o&&(0,e.createElement)(c.ExternalLink,{href:o},(0,l.__)("Learn More","block-visibility"))))))}function Ni(n){var i,o,r;const{settings:a,setSettings:s,setHasUpdates:d,visibilityControls:p,setVisibilityControls:b,variables:m}=n,g=null!==(i=a?.plugin_settings)&&void 0!==i?i:{},f=function(e,n){var i,o;let r=[];if(!e||!n||0===e.length||0===n.length)return r;let a=function(){let e=[{label:(0,l.__)("Hide Block","block-visibility"),attributeSlug:"hideBlock",settingSlug:"hide_block"},{label:(0,l.__)("Browser & Device","block-visibility"),attributeSlug:"browserDevice",settingSlug:"browser_device"},{label:(0,l.__)("Cookie","block-visibility"),attributeSlug:"cookie",settingSlug:"cookie"},{label:(0,l.__)("Date & Time","block-visibility"),attributeSlug:"dateTime",settingSlug:"date_time"},{label:(0,l.__)("Location","block-visibility"),attributeSlug:"location",settingSlug:"location"},{label:(0,l.__)("Metadata","block-visibility"),attributeSlug:"metadata",settingSlug:"metadata"},{label:(0,l.__)("Query String","block-visibility"),attributeSlug:"queryString",settingSlug:"query_string"},{label:(0,l.__)("Referral Source","block-visibility"),attributeSlug:"referralSource",settingSlug:"referral_source"},{label:(0,l.__)("Screen Size","block-visibility"),attributeSlug:"screenSize",settingSlug:"screen_size"},{label:(0,l.__)("URL Path","block-visibility"),attributeSlug:"urlPath",settingSlug:"url_path"},{label:(0,l.__)("User Role","block-visibility"),attributeSlug:"userRole",settingSlug:"visibility_by_role"},{label:(0,l.__)("Visibility Presets","block-visibility"),attributeSlug:"visibilityPresets",settingSlug:"visibility_presets"},{label:(0,l.__)("Advanced Custom Fields","block-visibility"),type:"integration",attributeSlug:"acf",settingSlug:"acf",icon:V},{label:(0,l.__)("Easy Digital Downloads","block-visibility"),type:"integration",attributeSlug:"edd",settingSlug:"edd",icon:S},{label:(0,l.__)("WooCommerce","block-visibility"),type:"integration",attributeSlug:"woocommerce",settingSlug:"woocommerce",icon:x},{label:(0,l.__)("WP Fusion","block-visibility"),type:"integration",attributeSlug:"wpFusion",settingSlug:"wp_fusion",icon:O}];return e=(0,u.applyFilters)("blockVisibility.controls",e),e=(0,u.applyFilters)("blockVisibility.coreControls",e),e=(0,u.applyFilters)("blockVisibility.integrationControls",e),e=e.filter(((e,t,n)=>t===n.findIndex((t=>t.attributeSlug===e.attributeSlug&&t.settingSlug===e.settingSlug)))),e.sort(((e,t)=>e.label.localeCompare(t.label))),e}();a.forEach((function(e){"integration"!==e.type||(e=>{let t=!1;var i;return n?.integrations&&(t=null!==(i=n?.integrations[e]?.active)&&void 0!==i&&i),t})(e.settingSlug)||(a=a.filter((t=>t.settingSlug!==e.settingSlug)))}));const s=null!==(i=e?.visibility_controls)&&void 0!==i?i:{};(0,t.isEmpty)(s)||a.forEach((function(e){var n;let i=!1;(0,t.has)(s,e.settingSlug)||(i=!0),(null===(n=s[e.settingSlug]?.enable)||void 0===n||n)&&(i=!0),i&&r.push(e)}));const c=null!==(o=e?.plugin_settings?.default_controls)&&void 0!==o?o:[];return r.forEach((function(e){c.includes(e.settingSlug)&&(e.isDefault=!0)})),r=(0,u.applyFilters)("blockVisibility.enabledControls",r,e,n),r}(a,m),v=[];f.forEach((e=>{v.push({label:e.label,value:e.settingSlug})}));const h=null===(o=p?.general?.enable_local_controls)||void 0===o||o,y=null!==(r=g?.default_controls)&&void 0!==r?r:[],_=v.filter((e=>y.includes(e.value)));return(0,e.createElement)("div",{className:"settings-panel two-columns"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("General","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__select has-info-popover"},(0,e.createElement)("div",{className:"select-control-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Default visibility controls","block-visibility"))),(0,e.createElement)(Vi,{className:"block-visibility__react-select",classNamePrefix:"react-select",styles:{multiValueLabel:(e,t)=>t.data.isFixed?{...e,backgroundColor:"#757575",color:"#ffffff",paddingRight:6}:e,multiValueRemove:(e,t)=>t.data.isFixed?{...e,display:"none"}:e},isClearable:_.some((e=>!e.isFixed)),placeholder:(0,l.__)("Select Controls…","block-visibility"),options:v,value:(k=_,k.filter((e=>e.isFixed)).concat(k.filter((e=>!e.isFixed)))),onChange:(e,t)=>((e,t)=>{const n=[];switch(t.action){case"remove-value":case"pop-value":if(t.removedValue.isFixed)return;0!==e.length&&e.forEach((e=>{n.push(e.value)}));break;case"select-option":0!==e.length&&e.forEach((e=>{n.push(e.value)}));break;case"clear":const i=v.filter((e=>e.isFixed));0!==i.length&&i.forEach((e=>{n.push(e.value)}))}s({...a,plugin_settings:{...g,default_controls:n}}),d(!0)})(e,t),isMulti:!0})),(0,e.createElement)(Mi,{message:(0,l.__)("Default controls are automatically displayed in the Visibility panel when editing a block in the Editor. Defaults can be helpful if you frequently use the same few controls.","block-visibility")})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable local visibility controls.","block-visibility"),checked:h,onChange:()=>{b({...p,general:{...p.general,enable_local_controls:!h}})}}),(0,e.createElement)(Mi,{message:(0,l.__)('"Local" refers to the visibility controls available on each block. When disabled, only Visibility Presets and the Hide Block control will be available. Presets are then used to manage all other enabled controls.',"block-visibility")})),(0,e.createElement)(c.Slot,{name:"VisibilityControlsGeneral"})));var k}function Ti(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.hide_block?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-hide-block"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Hide Block","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Hide Block control.","block-visibility"),checked:r,onChange:()=>{o({...i,hide_block:{...i.hide_block,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Hide Block control allows you to hide blocks easily on your website's front end. This control overrides all other controls when enabled on a block.","block-visibility"),link:k.settingsHideBlock}))))}function Di(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.browser_device?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-browser-device"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Browser & Device (User Agent)","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Browser & Device control.","block-visibility"),checked:r,onChange:()=>{o({...i,browser_device:{...i.browser_device,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Browser & Device control allows you to conditionally display a block based on the device or web browser the current user is using to visit your website.","block-visibility"),link:k.settingsBrowserDevice}))))}function Ri(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.cookie?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-cookie"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Cookie","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Cookie control.","block-visibility"),checked:r,onChange:()=>{o({...i,cookie:{...i.cookie,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Cookie control allows you to conditionally display a block based on HTML cookies.","block-visibility"),link:k.settingsCookie}))))}function Ii(t){var n,i,o;const{visibilityControls:r,setVisibilityControls:a}=t,s=null===(n=r?.date_time?.enable)||void 0===n||n,u=null===(i=r?.date_time?.enable_day_of_week)||void 0===i||i,d=null===(o=r?.date_time?.enable_time_of_day)||void 0===o||o;let p=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Day of Week control.","block-visibility"),checked:u,onChange:()=>{a({...r,date_time:{...r.date_time,enable_day_of_week:!u}})}}),b=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Time of Day control.","block-visibility"),checked:d,onChange:()=>{a({...r,date_time:{...r.date_time,enable_time_of_day:!d}})}});return s||(p=(0,e.createElement)(c.Disabled,null,p),b=(0,e.createElement)(c.Disabled,null,b)),(0,e.createElement)("div",{className:"settings-panel control-date-time"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Date & Time","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Date & Time controls.","block-visibility"),checked:s,onChange:()=>{a({...r,date_time:{...r.date_time,enable:!s}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Date & Time control allows you to conditionally display blocks based on time and date settings, which includes the ability to schedule blocks.","block-visibility"),link:k.settingsDateTime})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover first subsetting"},p,(0,e.createElement)(Mi,{message:(0,l.__)("The Day of Week control adds functionality to the main Date & Time control. It allows you to conditionally display blocks based on specific days of the week within a given schedule.","block-visibility"),link:k.settingsDateTime})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},b,(0,e.createElement)(Mi,{message:(0,l.__)("The Time of Day adds functionality to the main Date & Time control. It allows you to conditionally display blocks at specific time intervals on each day of a given schedule.","block-visibility"),link:k.settingsDateTime}))))}function Fi(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.location?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-location"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Location","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Location control.","block-visibility"),checked:r,onChange:()=>{o({...i,location:{...i.location,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Location control allows you to conditionally display blocks based on where the block is located on your website. This includes page and post types, taxonomies, and more.","block-visibility"),link:k.settingsLocation}))))}function Li(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.metadata?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-metadata"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Metadata (Custom Fields)","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Metadata control.","block-visibility"),checked:r,onChange:()=>{o({...i,metadata:{...i.metadata,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Metadata control allows you to conditionally display a block based on post or user metadata. Metadata is often referred to as Custom Fields. If you are already using the Advanced Custom Fields plugin, use the ACF control over the Metadata control.","block-visibility"),link:k.settingsMetadata}))))}function Ai(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.query_string?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-query-string"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Query String","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Query String control.","block-visibility"),checked:r,onChange:()=>{o({...i,query_string:{...i.query_string,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Query String control allows you to conditionally display blocks based on URL query strings.","block-visibility"),link:k.settingsQueryString}))))}function Bi(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.referral_source?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-referral-source"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Referral Source","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Referral Source control.","block-visibility"),checked:r,onChange:()=>{o({...i,referral_source:{...i.referral_source,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Referral Source control allows you to conditionally display blocks based on the domain or URL from which visitors arrive at your site.","block-visibility"),link:k.settingsReferralSource}))))}function zi(t){const[n,i]=(0,e.useState)(!1),{screenSize:o,enableAdvancedControls:r}=t,a=function(e){const t=e.breakpoints.large,n=e.breakpoints.medium,i=e.controls.large,o=e.controls.medium,l=e.controls.small;let r="";return i&&(r=`/* Large screens (desktops, ${t} and up) */\n@media ( min-width: ${t} ) {\n\t.block-visibility-hide-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),o&&(r=(r?r+"\n\n":r)+`/* Medium screens (tablets, between ${n} and ${t}) */\n@media ( min-width: ${n} ) and ( max-width: ${Hi(t)} ) {\n\t.block-visibility-hide-medium-screen {\n\t\tdisplay: none !important;\n\t}\n}`),l&&(r=(r?r+"\n\n":r)+`/* Small screens (mobile devices, less than ${n}) */\n@media ( max-width: ${Hi(n)} ) {\n\t.block-visibility-hide-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),r||(r="/* All screen size controls have been disabled. */"),r}(o),s=function(e){const t=e.breakpoints.extra_large,n=e.breakpoints.large,i=e.breakpoints.medium,o=e.breakpoints.small,l=e.controls.extra_large,r=e.controls.large,a=e.controls.medium,s=e.controls.small,c=e.controls.extra_small,u="\n\n";let d="";return l&&(d=`/* Extra large screens (large desktops, ${t} and up) */\n@media ( min-width: ${t} ) {\n\t.block-visibility-hide-extra-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),r&&(d=(d?d+u:d)+`/* Large screens (desktops, between ${n} and ${t}) */\n@media ( min-width: ${n} ) and (max-width: ${Hi(t)} ) {\n\t.block-visibility-hide-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),a&&(d=(d?d+u:d)+`/* Medium screens (tablets, between ${i} and ${n}) */\n@media ( min-width: ${i} ) and ( max-width: ${Hi(n)} ) {\n\t.block-visibility-hide-medium-screen {\n\t\tdisplay: none !important;\n\t}\n}`),s&&(d=(d?d+u:d)+`/* Small screens (landscape mobile devices, between ${o} and ${n}) */\n@media ( min-width: ${o} ) and ( max-width: ${Hi(i)} ) {\n\t.block-visibility-hide-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),c&&(d=(d?d+u:d)+`/* Extra small screens (portrait mobile devices, less than ${o}) */\n@media ( max-width: ${Hi(o)} ) {\n\t.block-visibility-hide-extra-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),d||(d="/* All screen size controls have been disabled. */"),d}(o);return(0,e.createElement)("div",{className:"breakpoint-css-preview subsetting"},(0,e.createElement)(c.Button,{onClick:()=>i(!n),isSecondary:!0},[!n&&(0,l.__)("Preview Frontend CSS","block-visibility"),n&&(0,l.__)("Hide Preview","block-visibility")]),n&&(0,e.createElement)("pre",null,[r&&s,!r&&a]))}function Hi(e){return(0,t.trim)(e,"px")-.02+"px"}function Ui(t){const{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:r}=t,a={extra_large:{title:(0,l.__)("Extra Large","block-visibility"),description:(0,l.__)("Large desktop screen sizes."),placeholder:"1200"},large:{title:(0,l.__)("Large","block-visibility"),description:(0,l.__)("Desktop and tablet (landscape) screen sizes.","block-visibility"),placeholder:"992"},medium:{title:(0,l.__)("Medium","block-visibility"),description:(0,l.__)("Tablet (portrait) screen sizes.","block-visibility"),placeholder:"768"},small:{title:(0,l.__)("Small","block-visibility"),description:(0,l.__)("Mobile (landscape) screen sizes.","block-visibility"),placeholder:"576"}};return(0,e.createElement)("div",{className:"breakpoints-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Breakpoints","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The plugin automatically sets a series of breakpoints that enable the Screen Size control. However, for best results, you can configure the breakpoints to correspond with the media breakpoints of your current theme.","block-visibility"),subMessage:(0,l.__)("The default breakpoints are Large (992px) and Medium (768px). Advanced screen size controls add Extra Large (1200px) and Small (576px).","block-visibility"),link:k.settingsScreenSize})),Object.entries(a).map((t=>{let[l,a]=t;const s=o.breakpoints[l];return"extra_large"!==l&&"small"!==l||r?(0,e.createElement)("div",{className:"breakpoint",key:l},(0,e.createElement)("div",{className:"breakpoint-inputs"},(0,e.createElement)(c.__experimentalUnitControl,{label:a.title,value:s,onChange:e=>function(e,t){i({...n,screen_size:{...o,breakpoints:{...o.breakpoints,[e]:t}}})}(l,e),units:[{value:"px",label:"px"}],placeholder:a.placeholder}),(0,e.createElement)("div",{className:"settings-panel__help"},a.description))):null})))}function ji(t){const{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:r}=t,a=o.breakpoints?.extra_large||"1200px",s=o.breakpoints?.large||"992px",u=o.breakpoints?.medium||"768px",d=o.breakpoints?.small||"576px";function p(e,t){i({...n,screen_size:{...o,controls:{...o.controls,[e]:t}}})}return(0,e.createElement)("div",{className:"controls-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Controls","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The settings below allow you to restrict which controls are available to users in the Block/Site Editor. Disabling controls will remove the corresponding CSS from the front end of your website.","block-visibility"),subMessage:(0,l.__)("The default controls are Desktop, Tablet, and Mobile. Advanced screen size controls add Large Desktop and Mobile (portrait).","block-visibility"),link:k.settingsScreenSize})),r&&(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable large desktop control","block-visibility"),help:(0,l.sprintf)( // translators: %s: extra large breakpoint -(0,l.__)("Allows users to hide blocks on extra large screen sizes, %s and up.","block-visibility"),o.breakpoints.extra_large),checked:o.controls.extra_large,onChange:()=>a("extra_large",!o.controls.extra_large)}),(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable desktop control","block-visibility"),help:[!r&&(0,l.sprintf)( +(0,l.__)("Allows users to hide blocks on extra large screen sizes, %s and up.","block-visibility"),a),checked:o.controls.extra_large,onChange:()=>p("extra_large",!o.controls.extra_large)}),(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable desktop control","block-visibility"),help:[!r&&(0,l.sprintf)( // translators: %s large breakpoint -(0,l.__)("Allows users to hide blocks on large screen sizes, %s and up.","block-visibility"),o.breakpoints.large),r&&(0,l.sprintf)( +(0,l.__)("Allows users to hide blocks on large screen sizes, %s and up.","block-visibility"),s),r&&(0,l.sprintf)( // translators: %1$s: large breakpoint %2$s: extra large breakpoint -(0,l.__)("Allows users to hide blocks on large screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.large,o.breakpoints.extra_large)],checked:o.controls.large,onChange:()=>a("large",!o.controls.large)}),(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable tablet control","block-visibility"),help:(0,l.sprintf)( +(0,l.__)("Allows users to hide blocks on large screen sizes, between %1$s and %2$s.","block-visibility"),s,a)],checked:o.controls.large,onChange:()=>p("large",!o.controls.large)}),(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable tablet control","block-visibility"),help:(0,l.sprintf)( // translators: %1$s: medium breakpoint %2$s: large breakpoint -(0,l.__)("Allows users to hide blocks on medium screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.medium,o.breakpoints.large),checked:o.controls.medium,onChange:()=>a("medium",!o.controls.medium)}),(0,e.createElement)(c.ToggleControl,{label:[!r&&(0,l.__)("Enable mobile control","block-visibility"),r&&(0,l.__)("Enable mobile (landscape) control","block-visibility")],help:[!r&&(0,l.sprintf)( +(0,l.__)("Allows users to hide blocks on medium screen sizes, between %1$s and %2$s.","block-visibility"),u,s),checked:o.controls.medium,onChange:()=>p("medium",!o.controls.medium)}),(0,e.createElement)(c.ToggleControl,{label:[!r&&(0,l.__)("Enable mobile control","block-visibility"),r&&(0,l.__)("Enable mobile (landscape) control","block-visibility")],help:[!r&&(0,l.sprintf)( // translators: %s: medium breakpoint (0,l.__)("Allows users to hide blocks on small screen sizes, less than %s.","block-visibility"),o.breakpoints.medium),r&&(0,l.sprintf)( // translators: %1$s: small breakpoint %2$s: medium breakpoint -(0,l.__)("Allows users to hide blocks on small screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.small,o.breakpoints.medium)],checked:o.controls.small,onChange:()=>a("small",!o.controls.small)}),r&&(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable mobile (portrait) control","block-visibility"),help:(0,l.sprintf)( +(0,l.__)("Allows users to hide blocks on small screen sizes, between %1$s and %2$s.","block-visibility"),d,u)],checked:o.controls.small,onChange:()=>p("small",!o.controls.small)}),r&&(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable mobile (portrait) control","block-visibility"),help:(0,l.sprintf)( // translators: %s: small breakpoint -(0,l.__)("Allows users to hide blocks on extra small screen sizes, less than %s.","block-visibility"),o.breakpoints.small),checked:o.controls.extra_small,onChange:()=>a("extra_small",!o.controls.extra_small)}))}function $i(t){const{visibilityControls:n,setVisibilityControls:i}=t;let o;o=n?.screen_size?n.screen_size:{enable:!0,breakpoints:{extra_large:"1200px",large:"992px",medium:"768px",small:"576px"},controls:{extra_large:!0,large:!0,medium:!0,small:!0,extra_small:!0},enable_advanced_controls:!1,enable_frontend_css:!0};let r=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"breakpoint-control-container subsetting"},(0,e.createElement)(Ui,{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:o.enable_advanced_controls}),(0,e.createElement)(ji,{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:o.enable_advanced_controls})),(0,e.createElement)(zi,{screenSize:o,enableAdvancedControls:o.enable_advanced_controls})),a=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable advanced screen size controls.","block-visibility"),checked:o.enable_advanced_controls,onChange:()=>{i({...n,screen_size:{...o,enable_advanced_controls:!o.enable_advanced_controls}})}}),s=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Load screen size CSS on the frontend of this website.","block-visibility"),checked:o.enable_frontend_css,onChange:()=>{i({...n,screen_size:{...o,enable_frontend_css:!o.enable_frontend_css}})}});return o.enable||(r=(0,e.createElement)(c.Disabled,null,r),a=(0,e.createElement)(c.Disabled,null,a),s=(0,e.createElement)(c.Disabled,null,s)),(0,e.createElement)("div",{className:"settings-panel control-screen-size two-columns"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Screen Size","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Screen Size controls.","block-visibility"),checked:o.enable,onChange:()=>{i({...n,screen_size:{...o,enable:!o.enable}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Screen Size control allows you to conditionally display blocks on the current width of the browser window, or in other words, the screen size of a user's device.","block-visibility"),link:k.settingsScreenSize})),r,(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},a,(0,e.createElement)(Mi,{message:(0,l.__)("By default, the Screen Size control includes two breakpoints and three controls for users to hide blocks. There are certain situations where you may need more control over when a block should be visible, for example, in the case of very large or small screens. Enabling advanced controls provides these options.","block-visibility"),subMessage:(0,l.__)("Note that once enabled, any block that is only using the advanced controls to hide at extra large or extra small breakpoints will become visible again if you disable this setting in the future.","block-visibility"),link:k.settingsScreenSize})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},s,(0,e.createElement)(Mi,{message:(0,l.__)('By default, the CSS needed for the Screen Size controls is loaded on the front end of your website. If disabled, you will need to add the CSS manually to your theme for the Screen Size controls to work properly. This CSS code is available via the "Preview Frontend CSS" button.',"block-visibility"),link:k.settingsScreenSize}))))}function Gi(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.url_path?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-url-path"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("URL Path","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the URL Path control.","block-visibility"),checked:r,onChange:()=>{o({...i,url_path:{...i.url_path,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The URL Path control allows you to conditionally display a block based on the URL of the page that the block is on.","block-visibility"),link:k.settingsUrlPath}))))}function Wi(t){var n,i,o,r;const{visibilityControls:a,setVisibilityControls:s}=t,u=null===(n=a?.visibility_by_role?.enable)||void 0===n||n,d=null===(i=a?.visibility_by_role?.enable_user_roles)||void 0===i||i,p=null===(o=a?.visibility_by_role?.enable_users)||void 0===o||o,b=null===(r=a?.visibility_by_role?.enable_user_rule_sets)||void 0===r||r;let m=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable individual user role restrictions (Administrator, Editor, Subscriber, etc.)","block-visibility"),checked:d,onChange:()=>{s({...a,visibility_by_role:{...a.visibility_by_role,enable_user_roles:!d}})}}),g=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable individual user restrictions.","block-visibility"),checked:p,onChange:()=>{s({...a,visibility_by_role:{...a.visibility_by_role,enable_users:!p}})}}),f=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable advanced user role restrictions (User rule sets)","block-visibility"),checked:b,onChange:()=>{s({...a,visibility_by_role:{...a.visibility_by_role,enable_user_rule_sets:!b}})}});return u||(m=(0,e.createElement)(c.Disabled,null,m),g=(0,e.createElement)(c.Disabled,null,g),f=(0,e.createElement)(c.Disabled,null,f)),(0,e.createElement)("div",{className:"settings-panel control-user-role"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("User Role","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the User Role controls.","block-visibility"),checked:u,onChange:()=>{s({...a,visibility_by_role:{...a.visibility_by_role,enable:!u}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The User Role control allows you to conditionally display blocks based on whether a user is logged-in, logged-out, and more.","block-visibility"),link:k.settingsUserRole})),(0,e.createElement)("div",{className:"settings-type__toggle first has-info-popover subsetting"},m,(0,e.createElement)(Mi,{message:(0,l.__)("Restrict visibility by any user role (Administrator, Editor, Subscriber, etc.). Roles added by third-party plugins will also be available to choose from.","block-visibility"),link:k.settingsUserRole})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},g,(0,e.createElement)(Mi,{message:(0,l.__)("Restrict visibility to specific individual users on your website based on user ID. You can select multiple users at once.","block-visibility"),link:k.settingsUserRole})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},f,(0,e.createElement)(Mi,{message:(0,l.__)("This functionality allows you to create user-based rule sets, which provide extensive configuration options and greater flexibility.","block-visibility"),link:k.settingsUserRole}))))}function Zi(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.visibility_presets?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-visibility-presets"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Visibility Presets","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Visibility Presets control.","block-visibility"),checked:r,onChange:()=>{o({...i,visibility_presets:{...i.visibility_presets,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("Visibility Presets allow you to configure visibility controls globally and then apply them to individual blocks.","block-visibility"),link:k.settingsVisibilityPresets}))))}function qi(t){var n,i;const{variables:o,visibilityControls:r,setVisibilityControls:a}=t;if(null===(n=o?.integrations?.acf?.active)||void 0===n||!n)return null;const s=null===(i=r?.acf?.enable)||void 0===i||i;return(0,e.createElement)("div",{className:"settings-panel control-acf"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(g,{icon:V}),(0,l.__)("Advanced Custom Fields","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Advanced Custom Fields control.","block-visibility"),checked:s,onChange:()=>{a({...r,acf:{...r.acf,enable:!s}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Advanced Custom Fields (ACF) control allows you to conditionally display blocks, including ACF blocks, based on ACF fields.","block-visibility"),link:k.settingsACF}))))}function Yi(t){var n,i,o;const{variables:r,visibilityControls:a,setVisibilityControls:s}=t;if(null===(n=r?.integrations?.edd?.active)||void 0===n||!n)return null;const u=null===(i=a?.edd?.enable)||void 0===i||i,d=null===(o=a?.edd?.enable_variable_pricing)||void 0===o||o;let p=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable variable pricing.","block-visibility"),checked:d,onChange:()=>{s({...a,edd:{...a.edd,enable_variable_pricing:!d}})}});return u||(p=(0,e.createElement)(c.Disabled,null,p)),(0,e.createElement)("div",{className:"settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(g,{icon:S}),(0,l.__)("Easy Digital Downloads (EDD)","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Easy Digital Downloads control.","block-visibility"),checked:u,onChange:()=>{s({...a,edd:{...a.edd,enable:!u}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Easy Digital Downloads control allows you to conditionally display blocks based on a variety of store-related rules. This includes shopping cart contents, customer order history, and more.","block-visibility"),link:k.settingsEDD})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},p,(0,e.createElement)(Mi,{message:(0,l.__)("Display each variable price separately for downloads with variable pricing in the Easy Digital Downloads control. Downloads without variable pricing display as usual.","block-visibility"),link:k.settingsEDD}))))}function Ki(t){var n,i,o;const{variables:r,visibilityControls:a,setVisibilityControls:s}=t;if(null===(n=r?.integrations?.woocommerce?.active)||void 0===n||!n)return null;const u=null===(i=a?.woocommerce?.enable)||void 0===i||i,d=null===(o=a?.woocommerce?.enable_variable_pricing)||void 0===o||o;let p=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable variable pricing.","block-visibility"),checked:d,onChange:()=>{s({...a,woocommerce:{...a.woocommerce,enable_variable_pricing:!d}})}});return u||(p=(0,e.createElement)(c.Disabled,null,p)),(0,e.createElement)("div",{className:"settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(g,{icon:x}),(0,l.__)("WooCommerce","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the WooCommerce control.","block-visibility"),checked:u,onChange:()=>{s({...a,woocommerce:{...a.woocommerce,enable:!u}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The WooCommerce control allows you to conditionally display blocks based on a variety of store-related rules. This includes shopping cart contents, customer order history, and more.","block-visibility"),link:k.settingsWoocommerce})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},p,(0,e.createElement)(Mi,{message:(0,l.__)("For products with variable pricing, display each variable price separately in the WooCommerce control. Products without variable pricing display as usual.","block-visibility"),link:k.settingsWoocommerce}))))}function Xi(t){var n,i;const{variables:o,visibilityControls:r,setVisibilityControls:a}=t;if(null===(n=o?.integrations?.wp_fusion?.active)||void 0===n||!n)return null;const s=null===(i=r?.wp_fusion?.enable)||void 0===i||i;return(0,e.createElement)("div",{className:"settings-panel control-wp-fusion"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(g,{icon:O}),(0,l.__)("WP Fusion","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the WP Fusion control.","block-visibility"),checked:s,onChange:()=>{a({...r,wp_fusion:{...r.wp_fusion,enable:!s}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The WP Fusion control allows you to conditionally display blocks based on WP Fusion tags.","block-visibility"),link:k.settingsWpFusion}))))}window.wp.htmlEntities,window.wp.url,window.wp.apiFetch;var Qi=(0,e.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(d.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"}));function Ji(n){const[i,s]=(0,e.useState)("saved"),[u,d]=(0,e.useState)(!1),{settings:p,setSettings:b,hasUpdates:m,setHasUpdates:f,tabSlug:v,tabSettings:h}=n,{saveEntityRecord:y}=(0,r.useDispatch)(a.store),_="saving"===i?(0,l.__)("Updating…","block-visibility"):(0,l.__)("Update","block-visibility");async function k(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"save",n="";"reset"===e?(s("resetting"),n={reset:v}):"resetAll"===e?(s("resetting"),n={reset:"all"}):(s("saving"),n=(0,t.assign)({...p},{[v]:h}));let i="";i=await y("block-visibility/v1","settings",n),i?(b(i),"reset"===e||"resetAll"===e?(s("reset"),d(!1)):(s("saved"),f(!1))):s("error")}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-controls__save-settings"},["saving"===i&&(0,e.createElement)(c.Animate,{type:"loading"},(t=>{let{className:n}=t;return(0,e.createElement)("span",{className:o()("message",n)},(0,e.createElement)(g,{icon:Qi}),(0,l.__)("Saving","block-visibility"))})),"error"===i&&(0,e.createElement)("span",{className:"message update-failed"},(0,l.__)("Update failed. Try again or get in touch with support.","block-visibility"))],"saving"!==i&&(0,e.createElement)(c.Button,{className:"reset-settings__save-button",onClick:()=>d(!0),isTertiary:!0},(0,l.__)("Reset Settings","block-visibility")),(0,e.createElement)(c.Button,{className:o()("save-settings__save-button",{"is-busy":"saving"===i}),onClick:()=>k(),disabled:!m&&"error"!==i,isPrimary:!0},_)),u&&(0,e.createElement)(c.Modal,{className:"block-visibility__reset-modal",title:(0,l.__)("Reset Settings","block-visibility"),onRequestClose:()=>d(!1)},(0,e.createElement)("p",null,(0,l.__)("Resetting will restore all configured settings on the current tab to their default values. To restore all plugin settings, choose Reset All.","block-visibility")),(0,e.createElement)("div",{className:"block-visibility__reset-modal--buttons"},(0,e.createElement)("div",{className:"block-visibility__reset-modal--buttons-reset"},(0,e.createElement)(c.Button,{isPrimary:!0,onClick:()=>k("reset")},(0,l.__)("Reset","block-visibility")),(0,e.createElement)(c.Button,{isSecondary:!0,onClick:()=>k("resetAll")},(0,l.__)("Reset All","block-visibility")),"resetting"===i&&(0,e.createElement)(c.Spinner,null)),(0,e.createElement)(c.Button,{isTertiary:!0,onClick:()=>d(!1)},(0,l.__)("Cancel","block-visibility"))),"error"===i&&(0,e.createElement)("div",{className:"message update-failed"},(0,l.__)("Reset failed. Try again or get in touch with support.","block-visibility"))))}function eo(t){var n;const{variables:i,visibilityControls:o}=t;let r=null!==(n=i?.integrations)&&void 0!==n?n:{};return r=Object.keys(r).map((e=>r[e])),r=r.filter((e=>!0===e.active)),0===r.length?null:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-tabs__setting-controls integrations"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,l.__)("Third-Party Integration Controls","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The settings below allow you to configure all third-party integration controls for Block Visibility. If you are looking for an integration, and do not see it below, make sure the respective third-party plugin is installed and activated on your website.","block-visibility"),subMessage:(0,l.__)("Visit the plugin Knowledge Base for more information on configuring third-party integration controls and what integrations are currently available in Block Visibility.","block-visibility"),link:k.settingsVisibilityContolsIntegrations})),(0,e.createElement)(Ji,N({tabSlug:"visibility_controls",tabSettings:o},t))),(0,e.createElement)("div",{className:"setting-tabs__setting-panels integrations"},(0,e.createElement)(qi,t),(0,e.createElement)(Yi,t),(0,e.createElement)(Ki,t),(0,e.createElement)(Xi,t),(0,e.createElement)(c.Slot,{name:"VisibilityControlsIntegrations"}),(0,e.createElement)(c.Slot,{name:"VisibilityControlsIntegrationsBottom"})))}const to=(0,c.withFilters)("blockVisibility.VisibilityControls")((t=>(0,e.createElement)(e.Fragment,null)));function no(t){var n;const[i,o]=(0,e.useState)(!1),{settings:r,setSettings:a}=t,s=null!==(n=r?.visibility_controls)&&void 0!==n?n:{};function u(e){a({...r,visibility_controls:e}),o(!0)}return(0,e.createElement)("div",{className:"setting-tabs__visibility-controls inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,l.__)("Visibility Controls","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The settings below allow you to configure the visibility controls that power Block Visibility. Pick and choose which controls you want to enable and how you would like them to function.","block-visibility"),subMessage:(0,l.__)("When a visibility control is disabled, blocks that rely on the disabled control will become visible again unless other enabled controls hide them.","block-visibility"),link:k.settingsVisibilityControls})),(0,e.createElement)(Ji,N({tabSlug:"visibility_controls",tabSettings:s,hasUpdates:i,setHasUpdates:o},t))),(0,e.createElement)("div",{className:"setting-tabs__setting-panels"},(0,e.createElement)(Ni,N({visibilityControls:s,setVisibilityControls:u,setHasUpdates:o},t)),(0,e.createElement)(Ti,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Zi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Di,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Ri,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Ii,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Fi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Li,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Ai,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Bi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)($i,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Gi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Wi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(c.Slot,{name:"VisibilityControls"})),(0,e.createElement)(eo,N({visibilityControls:s,setVisibilityControls:u,hasUpdates:i,setHasUpdates:o},t)),(0,e.createElement)(to,N({visibilityControls:s,setVisibilityControls:u},t)))}var io=window.wp.blockEditor;function oo(t){const{blockType:n,disabledBlocks:i,handleBlockTypeChange:o}=t,l=!i.includes(n.name);return(0,e.createElement)("li",{key:n.name,className:"blocks-category__block"},(0,e.createElement)(c.CheckboxControl,{checked:l,onChange:e=>function(e){o(e,n.name)}(e),label:(0,e.createElement)("span",null,n.title,n.icon&&(0,e.createElement)(io.BlockIcon,{icon:n.icon}))}))}function lo(n){const{blockTypes:i,category:r,disabledBlocks:a,handleBlockCategoryChange:s,handleBlockTypeChange:u}=n;if(!i.length)return null;const d=(0,t.map)(i,"name"),p=(0,t.without)(d,...a),b=p.length===d.length;let m;m=b?"true":p.length>0?"mixed":"false";const g="block-manager__category-title-"+r.slug;return(0,e.createElement)("div",{role:"group","aria-labelledby":g,className:"block-manager__block-category"},(0,e.createElement)("div",{className:o()("block-category__title",{"has-info-popover":"uncategorized"===r.slug})},(0,e.createElement)(c.CheckboxControl,{checked:b,onChange:e=>function(e){const n=(0,t.map)(i,"name");s(e,n)}(e),"aria-checked":m,label:(0,e.createElement)("span",{id:g},r.title,r.icon&&(0,e.createElement)(io.BlockIcon,{icon:r.icon}))}),"uncategorized"===r.slug&&(0,e.createElement)(Mi,{message:(0,l.__)("Some blocks may appear in the Block Manager as uncategorized even though they have an assigned category in the Editor. This is due to how the block is registered in WordPress.","block-visibility")})),(0,e.createElement)("ul",{className:"block-category__blocks-list"},i.map((t=>(0,e.createElement)(oo,{key:t,blockType:t,handleBlockTypeChange:u,disabledBlocks:a})))))}var ro=(0,r.withSelect)((e=>{const{getCategories:t,getBlockTypes:n,hasBlockSupport:i,isMatchingSearchTerm:o}=e("core/blocks");return{blockTypes:n(),categories:t(),hasBlockSupport:i,isMatchingSearchTerm:o}}))((function(n){var i,o;const[r,a]=(0,e.useState)(!1),[s,u]=(0,e.useState)(""),{settings:d,setSettings:p,blockTypes:b,categories:m,hasBlockSupport:g,isMatchingSearchTerm:f}=n,v=null!==(i=d?.disabled_blocks)&&void 0!==i?i:{};function h(e){p({...d,disabled_blocks:e}),a(!0)}function y(e,n){let i=[...v];i=e?(0,t.difference)(i,n):(0,t.union)(i,n),h(i),a(!0)}function _(e,n){let i=[...v];e?i=(0,t.without)(i,n):i.push(n),h(i),a(!0)}let E;E=null!==(o=d?.plugin_settings?.enable_full_control_mode)&&void 0!==o&&o?b:b.filter((e=>g(e,"inserter",!0)&&!e.parent));const S=["core/freeform"];E=E.filter((e=>!S.includes(e.name)));const x=E.filter((e=>!s||f(e,s))),O=x.filter((e=>!e?.category)),V=(0,t.intersection)(v,(0,t.map)(x,"name")),P=(0,t.intersection)(v,(0,t.map)(E,"name"));let M=w,T=(0,l.__)("Visibility is enabled for all blocks","block-visibility");return P.length&&(M=C,T=(0,l.sprintf)(/* translators: %s: The total number of visible block types */ +(0,l.__)("Allows users to hide blocks on extra small screen sizes, less than %s.","block-visibility"),d),checked:o.controls.extra_small,onChange:()=>p("extra_small",!o.controls.extra_small)}))}function $i(t){const{visibilityControls:n,setVisibilityControls:i}=t;let o;o=n?.screen_size?n.screen_size:{enable:!0,breakpoints:{extra_large:"1200px",large:"992px",medium:"768px",small:"576px"},controls:{extra_large:!0,large:!0,medium:!0,small:!0,extra_small:!0},enable_advanced_controls:!1,enable_frontend_css:!0};let r=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"breakpoint-control-container subsetting"},(0,e.createElement)(Ui,{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:o.enable_advanced_controls}),(0,e.createElement)(ji,{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:o.enable_advanced_controls})),(0,e.createElement)(zi,{screenSize:o,enableAdvancedControls:o.enable_advanced_controls})),a=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable advanced screen size controls.","block-visibility"),checked:o.enable_advanced_controls,onChange:()=>{i({...n,screen_size:{...o,enable_advanced_controls:!o.enable_advanced_controls}})}}),s=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Load screen size CSS on the frontend of this website.","block-visibility"),checked:o.enable_frontend_css,onChange:()=>{i({...n,screen_size:{...o,enable_frontend_css:!o.enable_frontend_css}})}});return o.enable||(r=(0,e.createElement)(c.Disabled,null,r),a=(0,e.createElement)(c.Disabled,null,a),s=(0,e.createElement)(c.Disabled,null,s)),(0,e.createElement)("div",{className:"settings-panel control-screen-size two-columns"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Screen Size","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Screen Size controls.","block-visibility"),checked:o.enable,onChange:()=>{i({...n,screen_size:{...o,enable:!o.enable}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Screen Size control allows you to conditionally display blocks on the current width of the browser window, or in other words, the screen size of a user's device.","block-visibility"),link:k.settingsScreenSize})),r,(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},a,(0,e.createElement)(Mi,{message:(0,l.__)("By default, the Screen Size control includes two breakpoints and three controls for users to hide blocks. There are certain situations where you may need more control over when a block should be visible, for example, in the case of very large or small screens. Enabling advanced controls provides these options.","block-visibility"),subMessage:(0,l.__)("Note that once enabled, any block that is only using the advanced controls to hide at extra large or extra small breakpoints will become visible again if you disable this setting in the future.","block-visibility"),link:k.settingsScreenSize})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},s,(0,e.createElement)(Mi,{message:(0,l.__)('By default, the CSS needed for the Screen Size controls is loaded on the front end of your website. If disabled, you will need to add the CSS manually to your theme for the Screen Size controls to work properly. This CSS code is available via the "Preview Frontend CSS" button.',"block-visibility"),link:k.settingsScreenSize}))))}function Gi(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.url_path?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-url-path"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("URL Path","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the URL Path control.","block-visibility"),checked:r,onChange:()=>{o({...i,url_path:{...i.url_path,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The URL Path control allows you to conditionally display a block based on the URL of the page that the block is on.","block-visibility"),link:k.settingsUrlPath}))))}function Wi(t){var n,i,o,r;const{visibilityControls:a,setVisibilityControls:s}=t,u=null===(n=a?.visibility_by_role?.enable)||void 0===n||n,d=null===(i=a?.visibility_by_role?.enable_user_roles)||void 0===i||i,p=null===(o=a?.visibility_by_role?.enable_users)||void 0===o||o,b=null===(r=a?.visibility_by_role?.enable_user_rule_sets)||void 0===r||r;let m=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable individual user role restrictions (Administrator, Editor, Subscriber, etc.)","block-visibility"),checked:d,onChange:()=>{s({...a,visibility_by_role:{...a.visibility_by_role,enable_user_roles:!d}})}}),g=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable individual user restrictions.","block-visibility"),checked:p,onChange:()=>{s({...a,visibility_by_role:{...a.visibility_by_role,enable_users:!p}})}}),f=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable advanced user role restrictions (User rule sets)","block-visibility"),checked:b,onChange:()=>{s({...a,visibility_by_role:{...a.visibility_by_role,enable_user_rule_sets:!b}})}});return u||(m=(0,e.createElement)(c.Disabled,null,m),g=(0,e.createElement)(c.Disabled,null,g),f=(0,e.createElement)(c.Disabled,null,f)),(0,e.createElement)("div",{className:"settings-panel control-user-role"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("User Role","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the User Role controls.","block-visibility"),checked:u,onChange:()=>{s({...a,visibility_by_role:{...a.visibility_by_role,enable:!u}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The User Role control allows you to conditionally display blocks based on whether a user is logged-in, logged-out, and more.","block-visibility"),link:k.settingsUserRole})),(0,e.createElement)("div",{className:"settings-type__toggle first has-info-popover subsetting"},m,(0,e.createElement)(Mi,{message:(0,l.__)("Restrict visibility by any user role (Administrator, Editor, Subscriber, etc.). Roles added by third-party plugins will also be available to choose from.","block-visibility"),link:k.settingsUserRole})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},g,(0,e.createElement)(Mi,{message:(0,l.__)("Restrict visibility to specific individual users on your website based on user ID. You can select multiple users at once.","block-visibility"),link:k.settingsUserRole})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},f,(0,e.createElement)(Mi,{message:(0,l.__)("This functionality allows you to create user-based rule sets, which provide extensive configuration options and greater flexibility.","block-visibility"),link:k.settingsUserRole}))))}function Zi(t){var n;const{visibilityControls:i,setVisibilityControls:o}=t,r=null===(n=i?.visibility_presets?.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"settings-panel control-visibility-presets"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Visibility Presets","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Visibility Presets control.","block-visibility"),checked:r,onChange:()=>{o({...i,visibility_presets:{...i.visibility_presets,enable:!r}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("Visibility Presets allow you to configure visibility controls globally and then apply them to individual blocks.","block-visibility"),link:k.settingsVisibilityPresets}))))}function qi(t){var n,i;const{variables:o,visibilityControls:r,setVisibilityControls:a}=t;if(null===(n=o?.integrations?.acf?.active)||void 0===n||!n)return null;const s=null===(i=r?.acf?.enable)||void 0===i||i;return(0,e.createElement)("div",{className:"settings-panel control-acf"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(g,{icon:V}),(0,l.__)("Advanced Custom Fields","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Advanced Custom Fields control.","block-visibility"),checked:s,onChange:()=>{a({...r,acf:{...r.acf,enable:!s}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Advanced Custom Fields (ACF) control allows you to conditionally display blocks, including ACF blocks, based on ACF fields.","block-visibility"),link:k.settingsACF}))))}function Yi(t){var n,i,o;const{variables:r,visibilityControls:a,setVisibilityControls:s}=t;if(null===(n=r?.integrations?.edd?.active)||void 0===n||!n)return null;const u=null===(i=a?.edd?.enable)||void 0===i||i,d=null===(o=a?.edd?.enable_variable_pricing)||void 0===o||o;let p=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable variable pricing.","block-visibility"),checked:d,onChange:()=>{s({...a,edd:{...a.edd,enable_variable_pricing:!d}})}});return u||(p=(0,e.createElement)(c.Disabled,null,p)),(0,e.createElement)("div",{className:"settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(g,{icon:S}),(0,l.__)("Easy Digital Downloads (EDD)","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the Easy Digital Downloads control.","block-visibility"),checked:u,onChange:()=>{s({...a,edd:{...a.edd,enable:!u}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The Easy Digital Downloads control allows you to conditionally display blocks based on a variety of store-related rules. This includes shopping cart contents, customer order history, and more.","block-visibility"),link:k.settingsEDD})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},p,(0,e.createElement)(Mi,{message:(0,l.__)("Display each variable price separately for downloads with variable pricing in the Easy Digital Downloads control. Downloads without variable pricing display as usual.","block-visibility"),link:k.settingsEDD}))))}function Ki(t){var n,i,o;const{variables:r,visibilityControls:a,setVisibilityControls:s}=t;if(null===(n=r?.integrations?.woocommerce?.active)||void 0===n||!n)return null;const u=null===(i=a?.woocommerce?.enable)||void 0===i||i,d=null===(o=a?.woocommerce?.enable_variable_pricing)||void 0===o||o;let p=(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable variable pricing.","block-visibility"),checked:d,onChange:()=>{s({...a,woocommerce:{...a.woocommerce,enable_variable_pricing:!d}})}});return u||(p=(0,e.createElement)(c.Disabled,null,p)),(0,e.createElement)("div",{className:"settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(g,{icon:x}),(0,l.__)("WooCommerce","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the WooCommerce control.","block-visibility"),checked:u,onChange:()=>{s({...a,woocommerce:{...a.woocommerce,enable:!u}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The WooCommerce control allows you to conditionally display blocks based on a variety of store-related rules. This includes shopping cart contents, customer order history, and more.","block-visibility"),link:k.settingsWoocommerce})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},p,(0,e.createElement)(Mi,{message:(0,l.__)("For products with variable pricing, display each variable price separately in the WooCommerce control. Products without variable pricing display as usual.","block-visibility"),link:k.settingsWoocommerce}))))}function Xi(t){var n,i;const{variables:o,visibilityControls:r,setVisibilityControls:a}=t;if(null===(n=o?.integrations?.wp_fusion?.active)||void 0===n||!n)return null;const s=null===(i=r?.wp_fusion?.enable)||void 0===i||i;return(0,e.createElement)("div",{className:"settings-panel control-wp-fusion"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(g,{icon:O}),(0,l.__)("WP Fusion","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable the WP Fusion control.","block-visibility"),checked:s,onChange:()=>{a({...r,wp_fusion:{...r.wp_fusion,enable:!s}})}}),(0,e.createElement)(Mi,{message:(0,l.__)("The WP Fusion control allows you to conditionally display blocks based on WP Fusion tags.","block-visibility"),link:k.settingsWpFusion}))))}window.wp.htmlEntities,window.wp.url,window.wp.apiFetch;var Qi=(0,e.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(d.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"}));function Ji(n){const[i,s]=(0,e.useState)("saved"),[u,d]=(0,e.useState)(!1),{settings:p,setSettings:b,hasUpdates:m,setHasUpdates:f,tabSlug:v,tabSettings:h}=n,{saveEntityRecord:y}=(0,r.useDispatch)(a.store),_="saving"===i?(0,l.__)("Updating…","block-visibility"):(0,l.__)("Update","block-visibility");async function k(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"save",n="";"reset"===e?(s("resetting"),n={reset:v}):"resetAll"===e?(s("resetting"),n={reset:"all"}):(s("saving"),n=(0,t.assign)({...p},{[v]:h}));let i="";i=await y("block-visibility/v1","settings",n),i?(b(i),"reset"===e||"resetAll"===e?(s("reset"),d(!1)):(s("saved"),f(!1))):s("error")}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-controls__save-settings"},["saving"===i&&(0,e.createElement)(c.Animate,{type:"loading"},(t=>{let{className:n}=t;return(0,e.createElement)("span",{className:o()("message",n)},(0,e.createElement)(g,{icon:Qi}),(0,l.__)("Saving","block-visibility"))})),"error"===i&&(0,e.createElement)("span",{className:"message update-failed"},(0,l.__)("Update failed. Try again or get in touch with support.","block-visibility"))],"saving"!==i&&(0,e.createElement)(c.Button,{className:"reset-settings__save-button",onClick:()=>d(!0),isTertiary:!0},(0,l.__)("Reset Settings","block-visibility")),(0,e.createElement)(c.Button,{className:o()("save-settings__save-button",{"is-busy":"saving"===i}),onClick:()=>k(),disabled:!m&&"error"!==i,isPrimary:!0},_)),u&&(0,e.createElement)(c.Modal,{className:"block-visibility__reset-modal",title:(0,l.__)("Reset Settings","block-visibility"),onRequestClose:()=>d(!1)},(0,e.createElement)("p",null,(0,l.__)("Resetting will restore all configured settings on the current tab to their default values. To restore all plugin settings, choose Reset All.","block-visibility")),(0,e.createElement)("div",{className:"block-visibility__reset-modal--buttons"},(0,e.createElement)("div",{className:"block-visibility__reset-modal--buttons-reset"},(0,e.createElement)(c.Button,{isPrimary:!0,onClick:()=>k("reset")},(0,l.__)("Reset","block-visibility")),(0,e.createElement)(c.Button,{isSecondary:!0,onClick:()=>k("resetAll")},(0,l.__)("Reset All","block-visibility")),"resetting"===i&&(0,e.createElement)(c.Spinner,null)),(0,e.createElement)(c.Button,{isTertiary:!0,onClick:()=>d(!1)},(0,l.__)("Cancel","block-visibility"))),"error"===i&&(0,e.createElement)("div",{className:"message update-failed"},(0,l.__)("Reset failed. Try again or get in touch with support.","block-visibility"))))}function eo(t){var n;const{variables:i,visibilityControls:o}=t;let r=null!==(n=i?.integrations)&&void 0!==n?n:{};return r=Object.keys(r).map((e=>r[e])),r=r.filter((e=>!0===e.active)),0===r.length?null:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-tabs__setting-controls integrations"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,l.__)("Third-Party Integration Controls","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The settings below allow you to configure all third-party integration controls for Block Visibility. If you are looking for an integration, and do not see it below, make sure the respective third-party plugin is installed and activated on your website.","block-visibility"),subMessage:(0,l.__)("Visit the plugin Knowledge Base for more information on configuring third-party integration controls and what integrations are currently available in Block Visibility.","block-visibility"),link:k.settingsVisibilityContolsIntegrations})),(0,e.createElement)(Ji,N({tabSlug:"visibility_controls",tabSettings:o},t))),(0,e.createElement)("div",{className:"setting-tabs__setting-panels integrations"},(0,e.createElement)(qi,t),(0,e.createElement)(Yi,t),(0,e.createElement)(Ki,t),(0,e.createElement)(Xi,t),(0,e.createElement)(c.Slot,{name:"VisibilityControlsIntegrations"}),(0,e.createElement)(c.Slot,{name:"VisibilityControlsIntegrationsBottom"})))}const to=(0,c.withFilters)("blockVisibility.VisibilityControls")((t=>(0,e.createElement)(e.Fragment,null)));function no(t){var n;const[i,o]=(0,e.useState)(!1),{settings:r,setSettings:a}=t,s=null!==(n=r?.visibility_controls)&&void 0!==n?n:{};function u(e){a({...r,visibility_controls:e}),o(!0)}return(0,e.createElement)("div",{className:"setting-tabs__visibility-controls inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,l.__)("Visibility Controls","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The settings below allow you to configure the visibility controls that power Block Visibility. Pick and choose which controls you want to enable and how you would like them to function.","block-visibility"),subMessage:(0,l.__)("When a visibility control is disabled, blocks that rely on the disabled control will become visible again unless other enabled controls hide them.","block-visibility"),link:k.settingsVisibilityControls})),(0,e.createElement)(Ji,N({tabSlug:"visibility_controls",tabSettings:s,hasUpdates:i,setHasUpdates:o},t))),(0,e.createElement)("div",{className:"setting-tabs__setting-panels"},(0,e.createElement)(Ni,N({visibilityControls:s,setVisibilityControls:u,setHasUpdates:o},t)),(0,e.createElement)(Ti,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Zi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Di,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Ri,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Ii,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Fi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Li,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Ai,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Bi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)($i,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Gi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(Wi,N({visibilityControls:s,setVisibilityControls:u},t)),(0,e.createElement)(c.Slot,{name:"VisibilityControls"})),(0,e.createElement)(eo,N({visibilityControls:s,setVisibilityControls:u,hasUpdates:i,setHasUpdates:o},t)),(0,e.createElement)(to,N({visibilityControls:s,setVisibilityControls:u},t)))}var io=window.wp.blockEditor;function oo(t){const{blockType:n,disabledBlocks:i,handleBlockTypeChange:o}=t,l=!i.includes(n.name);return(0,e.createElement)("li",{key:n.name,className:"blocks-category__block"},(0,e.createElement)(c.CheckboxControl,{checked:l,onChange:e=>function(e){o(e,n.name)}(e),label:(0,e.createElement)("span",null,n.title,n.icon&&(0,e.createElement)(io.BlockIcon,{icon:n.icon}))}))}function lo(n){const{blockTypes:i,category:r,disabledBlocks:a,handleBlockCategoryChange:s,handleBlockTypeChange:u}=n;if(!i.length)return null;const d=(0,t.map)(i,"name"),p=(0,t.without)(d,...a),b=p.length===d.length;let m;m=b?"true":p.length>0?"mixed":"false";const g="block-manager__category-title-"+r.slug;return(0,e.createElement)("div",{role:"group","aria-labelledby":g,className:"block-manager__block-category"},(0,e.createElement)("div",{className:o()("block-category__title",{"has-info-popover":"uncategorized"===r.slug})},(0,e.createElement)(c.CheckboxControl,{checked:b,onChange:e=>function(e){const n=(0,t.map)(i,"name");s(e,n)}(e),"aria-checked":m,label:(0,e.createElement)("span",{id:g},r.title,r.icon&&(0,e.createElement)(io.BlockIcon,{icon:r.icon}))}),"uncategorized"===r.slug&&(0,e.createElement)(Mi,{message:(0,l.__)("Some blocks may appear in the Block Manager as uncategorized even though they have an assigned category in the Editor. This is due to how the block is registered in WordPress.","block-visibility")})),(0,e.createElement)("ul",{className:"block-category__blocks-list"},i.map((t=>(0,e.createElement)(oo,{key:t,blockType:t,handleBlockTypeChange:u,disabledBlocks:a})))))}var ro=(0,r.withSelect)((e=>{const{getCategories:t,getBlockTypes:n,hasBlockSupport:i,isMatchingSearchTerm:o}=e("core/blocks");return{blockTypes:n(),categories:t(),hasBlockSupport:i,isMatchingSearchTerm:o}}))((function(n){var i,o;const[r,a]=(0,e.useState)(!1),[s,u]=(0,e.useState)(""),{settings:d,setSettings:p,blockTypes:b,categories:m,hasBlockSupport:g,isMatchingSearchTerm:f}=n,v=null!==(i=d?.disabled_blocks)&&void 0!==i?i:{};function h(e){p({...d,disabled_blocks:e}),a(!0)}function y(e,n){let i=[...v];i=e?(0,t.difference)(i,n):(0,t.union)(i,n),h(i),a(!0)}function _(e,n){let i=[...v];e?i=(0,t.without)(i,n):i.push(n),h(i),a(!0)}let E;E=null!==(o=d?.plugin_settings?.enable_full_control_mode)&&void 0!==o&&o?b:b.filter((e=>g(e,"inserter",!0)&&!e.parent));const S=["core/freeform"];E=E.filter((e=>!S.includes(e.name)));const x=E.filter((e=>!s||f(e,s))),O=x.filter((e=>!e?.category)),V=(0,t.intersection)(v,(0,t.map)(x,"name")),P=(0,t.intersection)(v,(0,t.map)(E,"name"));let M=w,T=(0,l.__)("Visibility is enabled for all blocks","block-visibility");return P.length&&(M=C,T=(0,l.sprintf)(/* translators: %s: The total number of visible block types */ (0,l._n)("Visibility is disabled for %s block type","Visibility is disabled for %s block types",P.length,"block-visibility"),P.length)),(0,e.createElement)("div",{className:"setting-tabs__block-manager inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,l.__)("Block Manager","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("Only some block types may need visibility controls. The Block Manager allows you to restrict visibility controls to specific block types.","block-visibility"),subMessage:(0,l.__)("If you are looking for a block and do not see it listed, you may need to enable Full Control Mode on the General Settings tab.","block-visibility"),link:k.settingsBlockManager})),(0,e.createElement)(Ji,N({tabSlug:"disabled_blocks",tabSettings:v,hasUpdates:r,setHasUpdates:a},n))),(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)(c.TextControl,{className:"setting-controls__search-blocks",type:"search",placeholder:(0,l.__)("Search for a block","block-visibility"),value:s,onChange:e=>u(e)}),(0,e.createElement)("span",{className:"message"},(0,e.createElement)(c.Icon,{icon:M}),T)),(0,e.createElement)("div",{className:"block-manager__category-container"},m.map((n=>(0,e.createElement)(lo,{key:n.slug,category:n,blockTypes:(0,t.filter)(x,{category:n.slug}),disabledBlocks:V,handleBlockCategoryChange:y,handleBlockTypeChange:_}))),O&&(0,e.createElement)(lo,{key:"uncategorized",category:{slug:"uncategorized",title:"Uncategorized"},blockTypes:O,disabledBlocks:V,handleBlockCategoryChange:y,handleBlockTypeChange:_})))}));function ao(t){var n,i,o,r,a,s,u;const{pluginSettings:d,setPluginSettings:p}=t,b=null===(n=d?.enable_contextual_indicators)||void 0===n||n,m=null!==(i=d?.contextual_indicator_color)&&void 0!==i?i:"",g=null!==(o=d?.enable_block_opacity)&&void 0!==o&&o,f=null!==(r=d?.block_opacity)&&void 0!==r?r:100,v=null===(a=d?.enable_toolbar_controls)||void 0===a||a,h=null===(s=d?.enable_editor_notices)||void 0===s||s,y=null===(u=d?.enable_control_set_utilities)||void 0===u||u,_=[{name:(0,l.__)("Black","block-visibility"),color:"#121212"},{name:(0,l.__)("Light Grey","block-visibility"),color:"#F1F1F1"},{name:(0,l.__)("Red","block-visibility"),color:"#DC3232"},{name:(0,l.__)("Orange","block-visibility"),color:"#F56E28"},{name:(0,l.__)("Yellow","block-visibility"),color:"#FFB900"},{name:(0,l.__)("Green","block-visibility"),color:"#46B450"},{name:(0,l.__)("Medium Blue","block-visibility"),color:"#00A0D2"},{name:(0,l.__)("WordPress Blue","block-visibility"),color:"#0073AA"},{name:(0,l.__)("Purple","block-visibility"),color:"#826EB4"}],E=m||"var(--wp-admin-theme-color)";let w=(0,e.createElement)("div",{className:"settings-type__color"},(0,e.createElement)("div",null,(0,e.createElement)(c.BaseControl,{id:"indicator-color",className:"settings-type__color-selected",label:(0,l.__)("Indicator color","block-visibility")},(0,e.createElement)(c.ColorIndicator,{colorValue:E})),(0,e.createElement)(c.ColorPalette,{colors:_,value:m,onChange:e=>{p({...d,contextual_indicator_color:e})}})));b||(w=(0,e.createElement)(c.Disabled,null,w));let C=(0,e.createElement)("div",{className:"settings-type__range"},(0,e.createElement)(c.RangeControl,{label:(0,l.__)("Block Opacity","block-visibility"),value:f,onChange:e=>{p({...d,block_opacity:e})},min:10,max:100,step:10}));return g||(C=(0,e.createElement)(c.Disabled,null,C)),(0,e.createElement)("div",{className:"settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Editor","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("Settings that impact the Editor, such as contextual indicators for when a block has visibility controls, as well as additional toolbar options.","block-visibility"),link:k.settingsGeneral})),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Contextual Indicators","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable contextual indicators.","block-visibility"),checked:b,onChange:()=>{p({...d,enable_contextual_indicators:!b})}}),(0,e.createElement)(Mi,{message:(0,l.__)("Contextual indicators assist users in quickly determining which blocks have active visibility controls.","block-visibility")})),w,(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Contextual Block Opacity","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Reduce block opacity when visibility controls are applied.","block-visibility"),checked:g,onChange:()=>{p({...d,enable_block_opacity:!g})}}),(0,e.createElement)(Mi,{message:(0,l.__)("Combining contextual indicators with reduced block opacity can assist users in quickly determining which blocks have active visibility controls.","block-visibility")})),C,(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Toolbar Controls","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable block toolbar controls for visibility settings.","block-visibility"),checked:v,onChange:()=>{p({...d,enable_toolbar_controls:!v})}}),(0,e.createElement)(Mi,{message:(0,l.__)("Some visibility controls (currently just the Hide Block control) can be made available in the toolbar of each block.","block-visibility")})),(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Help Notices & Popovers","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable help notices and popovers in the Editor.","block-visibility"),checked:h,onChange:()=>{p({...d,enable_editor_notices:!h})}}),(0,e.createElement)(Mi,{message:(0,l.__)("By default, help notices and popovers display in the Editor providing additional information about how to use Block Visibility. Disable for a more simplified interface.","block-visibility")})),(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,l.__)("Utilities","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Enable utilities for managing visibility settings (copy, import, etc.)","block-visibility"),checked:y,onChange:()=>{p({...d,enable_control_set_utilities:!y})}}),(0,e.createElement)(Mi,{message:(0,l.__)("Control set utilities allow you to copy and import visibility settings. This functionality is useful when advanced setting configurations need to be applied to multiple blocks.","block-visibility")}))))}function so(n){var i;const{pluginSettings:o,setPluginSettings:r}=n,a=null!==(i=o?.enabled_user_roles)&&void 0!==i?i:[];return(0,e.createElement)("div",{className:"subsetting"},["editor","author","contributor"].map((n=>{const i=[...a],l=a.includes(n);if(l){const e=i.indexOf(n);e>-1&&i.splice(e,1)}else-1===i.indexOf(n)&&i.push(n);return(0,e.createElement)(c.CheckboxControl,{key:n,checked:l,label:(0,e.createElement)("span",null,(0,t.startCase)(n)+"s"),onChange:()=>{r({...o,enabled_user_roles:i})}})})),(0,e.createElement)("div",{className:"settings-panel__help has-top-margin"},(0,l.__)("Choose which user roles should be allowed to control visibility settings in the Editor. Administrators will always have permission.","block-visibility")))}function co(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,r=null!==(n=i?.enable_user_role_restrictions)&&void 0!==n&&n;let a=(0,e.createElement)(so,{pluginSettings:i,setPluginSettings:o});return r||(a=(0,e.createElement)(c.Disabled,null,a)),(0,e.createElement)("div",{className:"settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("User Permissions","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Restrict block visibility controls to selected user roles.","block-visibility"),checked:r,onChange:()=>{o({...i,enable_user_role_restrictions:!r})}}),(0,e.createElement)(Mi,{message:(0,l.__)("By default, all users that can edit blocks will be able to use the visibility controls provided by Block Visibility.","block-visibility")})),a))}function uo(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,r=null!==(n=i?.enable_full_control_mode)&&void 0!==n&&n;return(0,e.createElement)("div",{className:"settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Full Control Mode","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(c.ToggleControl,{label:(0,e.createInterpolateElement)((0,l.__)("Enable Full Control Mode to add visibility controls to every block. Use with caution.","block-visibility"),{strong:(0,e.createElement)("strong",null),a:(0,e.createElement)(c.ExternalLink,{href:k.settingsGeneral,target:"_blank",rel:"noreferrer"})}),checked:r,onChange:()=>{o({...i,enable_full_control_mode:!r})}}),(0,e.createElement)(Mi,{message:(0,l.__)("Some blocks do not have visibility controls enabled by default. These include child blocks and blocks that may exist in WordPress but cannot be added directly to the Editor. You will not need Full Control Mode most of the time, but it's here in case you do.","block-visibility"),link:k.settingsGeneral}))))}function po(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,r=null!==(n=i?.remove_on_uninstall)&&void 0!==n&&n;return(0,e.createElement)("div",{className:"settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,l.__)("Uninstall","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle"},(0,e.createElement)(c.ToggleControl,{label:(0,l.__)("Remove all plugin settings when Block Visibility is uninstalled.","block-visibility"),checked:r,onChange:()=>{o({...i,remove_on_uninstall:!r})}}))))}const bo=(0,c.withFilters)("blockVisibility.PluginSettings")((t=>(0,e.createElement)(e.Fragment,null)));function mo(t){var n;const[i,o]=(0,e.useState)(!1),{settings:r,setSettings:a}=t,s=null!==(n=r?.plugin_settings)&&void 0!==n?n:{};function u(e){a({...r,plugin_settings:e}),o(!0)}return(0,e.createElement)("div",{className:"settings-tab__plugin-settings inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,l.__)("General Settings","block-visibility")),(0,e.createElement)(Mi,{message:(0,l.__)("The settings below allow you to configure general functionality for the Block Visibility plugin.","block-visibility"),link:k.settingsGeneral})),(0,e.createElement)(Ji,N({tabSlug:"plugin_settings",tabSettings:s,hasUpdates:i,setHasUpdates:o},t))),(0,e.createElement)("div",{className:"setting-tabs__setting-panels"},(0,e.createElement)(ao,N({pluginSettings:s,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)("div",{className:"setting-tabs__setting-panels__sub-panel"},(0,e.createElement)(co,N({pluginSettings:s,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(uo,N({pluginSettings:s,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(po,N({pluginSettings:s,setPluginSettings:u,setHasUpdates:o},t))),(0,e.createElement)(c.Slot,{name:"PluginSettings"})),(0,e.createElement)(bo,N({pluginSettings:s,setPluginSettings:u,setHasUpdates:o},t)))}function go(t){const{variables:n}=t;return n?.is_pro?null:(0,e.createElement)("div",{className:"ads-container"},(0,e.createElement)("div",{className:"ads-container__support"},(0,e.createElement)("span",{className:"ads-container__header"},(0,l.__)("Need Support?","block-visibility")),(0,e.createElement)("p",null,(0,l.__)("Whether you need help or have a new feature request, please create a topic in the support forum on WordPress.org.","block-visibility"),(0,e.createElement)(c.ExternalLink,{href:k.blockVisibilityOrgSupport,target:"_blank",rel:"noreferrer"},(0,l.__)("Support Forum","block-visibility"))),(0,e.createElement)("p",null,(0,l.__)("Detailed documentation is also available on the plugin website.","block-visibility"),(0,e.createElement)(c.ExternalLink,{href:k.settingsKnowledgeBase,target:"_blank"},(0,l.__)("View Knowledge Base","block-visibility")))),(0,e.createElement)("div",{className:"ads-container__reviews"},(0,e.createElement)("span",{className:"ads-container__header"},(0,l.__)("Share Your Feedback","block-visibility")),(0,e.createElement)("p",null,(0,l.__)("If you are enjoying Block Visibility and find it useful, please consider leaving a ★★★★★ review on WordPress.org. Your feedback is greatly appreciated and helps others discover the plugin.","block-visibility"),(0,e.createElement)(c.ExternalLink,{href:k.blockVisibilityOrgReviews,target:"_blank",rel:"noreferrer"},(0,l.__)("Submit a Review","block-visibility")))))}(0,r.dispatch)("core").addEntities([{label:(0,l.__)("Block Visibility Settings","block-visibility"),kind:"block-visibility/v1",name:"settings",baseURL:"/block-visibility/v1/settings"},{label:(0,l.__)("Block Visibility Variables","block-visibility"),kind:"block-visibility/v1",name:"variables",baseURL:"/block-visibility/v1/variables",baseURLParams:{type:"simplified"}}]);const fo=(0,c.withFilters)("blockVisibility.SettingTabsContent")((t=>(0,e.createElement)(e.Fragment,null)));function vo(){const[n,i]=(0,e.useState)(null),r=(0,a.useEntityRecord)("block-visibility/v1","settings"),s=(0,a.useEntityRecord)("block-visibility/v1","variables");function d(e){i(e)}if(!r.hasResolved||!s.hasResolved)return(0,e.createElement)("div",{className:"loading-settings"},(0,e.createElement)(c.Spinner,null),(0,e.createElement)("span",{className:"description"},(0,l.__)("Loading settings…","block-visibility")));const p=[{name:"plugin-settings",title:(0,l.__)("General Settings","block-visibility"),className:"setting-tabs__plugin-settings"},{name:"visibility-controls",title:(0,l.__)("Visibility Controls","block-visibility"),className:"setting-tabs__visibility-controls"},{name:"block-manager",title:(0,l.__)("Block Manager","block-visibility"),className:"setting-tabs__blocks-manager"}];(0,u.applyFilters)("blockVisibility.SettingTabs",p);const b=new URLSearchParams(window.location.search),m=b.get("tab"),g=(0,t.findKey)(p,["name",m])?m:"plugin-settings";return(0,e.createElement)(c.SlotFillProvider,null,(0,e.createElement)(P,{variables:s.record}),(0,e.createElement)(c.TabPanel,{className:o()({"setting-tabs":!0,is_pro:s.record?.is_pro}),activeClass:"active-tab",initialTabName:g,tabs:p,onSelect:e=>(e=>{if(b.set("tab",e),history.pushState){const e=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+b.toString()+window.location.hash;window.history.replaceState({path:e},"",e)}else window.location.search=b.toString()})(e)},(t=>{switch(t.name){case"visibility-controls":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(go,{variables:s.record}),(0,e.createElement)(no,{settings:null!=n?n:r.record,setSettings:d,variables:s.record}));case"block-manager":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(go,{variables:s.record}),(0,e.createElement)(ro,{settings:null!=n?n:r.record,setSettings:d,variables:s.record}));case"plugin-settings":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(go,{variables:s.record}),(0,e.createElement)(mo,{settings:null!=n?n:r.record,setSettings:d,variables:s.record}));default:return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(c.Slot,{name:"SettingTabs"}),(0,e.createElement)(fo,{tabName:t.name,settings:null!=n?n:r.record,setSettings:d,variables:s.record}))}})),(0,e.createElement)(M,{variables:s.record}))}wp.domReady((()=>{(0,s.registerCoreBlocks)(),(0,e.render)((0,e.createElement)(vo,null),document.getElementById("block-visibility__plugin-settings"))}))}()}(); \ No newline at end of file