From 957b99ac1b44d26369b4438699869c755ea333fb Mon Sep 17 00:00:00 2001 From: Nick Diego Date: Fri, 14 Jul 2023 06:43:55 -0500 Subject: [PATCH 1/2] Fix multi-select bug in the Relative Hierarchy rule. --- block-visibility.php | 2 +- build/block-visibility-editor.asset.php | 2 +- build/block-visibility-editor.js | 4 ++-- includes/frontend/visibility-tests/location.php | 3 ++- languages/block-visibility.pot | 4 ++-- package.json | 2 +- readme.txt | 6 ++++++ .../rule-sets/async-rule-fields/posts-select.js | 10 ++++++++-- src/components/rule-sets/rule-field.js | 4 +++- src/controls/location/fields.js | 2 +- 10 files changed, 27 insertions(+), 12 deletions(-) diff --git a/block-visibility.php b/block-visibility.php index 6ea0bc61..1a557a56 100644 --- a/block-visibility.php +++ b/block-visibility.php @@ -3,7 +3,7 @@ * Plugin Name: Block Visibility * Plugin URI: https://www.blockvisibilitywp.com/ * Description: Provides visibility controls and scheduling functionality to all WordPress blocks. - * Version: 3.0.3 + * Version: 3.0.4 * Requires at least: 6.0 * Requires PHP: 5.6 * Author: Nick Diego diff --git a/build/block-visibility-editor.asset.php b/build/block-visibility-editor.asset.php index 0b486fee..47ae86fd 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-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'), 'version' => 'cac7b5296df49b1e812c'); + array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', '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'), 'version' => '6c921ae87f356978e95e'); diff --git a/build/block-visibility-editor.js b/build/block-visibility-editor.js index 62168d34..71a0955d 100644 --- a/build/block-visibility-editor.js +++ b/build/block-visibility-editor.js @@ -12,7 +12,7 @@ // translators: %s: The name of the control being toggled e.g. "Hide Block". (0,n.__)("Toggle %s"),l.label),onClick:()=>{i(l),(0,le.speak)((0,n.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". -(0,n.__)("%s toggled"),l.label),"assertive")}},l.icon&&(0,t.createElement)(q,{className:"control-branding-icon",icon:l.icon}),l.label)}const me=[{type:"text",label:(0,n.__)("Text","block-visibility")},{type:"textarea",label:(0,n.__)("Text Area","block-visibility")},{type:"number",label:(0,n.__)("Number","block-visibility"),options:"numeric"},{type:"range",label:(0,n.__)("Range","block-visibility"),options:"numeric"},{type:"email",label:(0,n.__)("Email","block-visibility")},{type:"url",label:(0,n.__)("Url","block-visibility")},{type:"password",label:(0,n.__)("Password","block-visibility")},{type:"image",label:(0,n.__)("Image","block-visibility")},{type:"file",label:(0,n.__)("File","block-visibility")},{type:"wysiwyg",label:(0,n.__)("Wysiwyg Editor","block-visibility")},{type:"oembed",label:(0,n.__)("oEmbed","block-visibility")},{type:"select",label:(0,n.__)("Select","block-visibility")},{type:"checkbox",label:(0,n.__)("Checkbox","block-visibility")},{type:"radio",label:(0,n.__)("Radio Button","block-visibility")},{type:"button_group",label:(0,n.__)("Button Group","block-visibility")},{type:"true_false",label:(0,n.__)("True / False","block-visibility"),options:"boolean"},{type:"link",label:(0,n.__)("Link","block-visibility")},{type:"post_object",label:(0,n.__)("Post Object","block-visibility")},{type:"page_link",label:(0,n.__)("Page Link","block-visibility")},{type:"relationship",label:(0,n.__)("Relationship","block-visibility")},{type:"taxonomy",label:(0,n.__)("Taxonomy","block-visibility")},{type:"user",label:(0,n.__)("User","block-visibility")},{type:"google_map",label:(0,n.__)("Google Map","block-visibility")},{type:"date_picker",label:(0,n.__)("Date Picker","block-visibility"),options:"dateTime"},{type:"date_time_picker",label:(0,n.__)("Date Time Picker","block-visibility"),options:"dateTime"},{type:"time_picker",label:(0,n.__)("Time Picker","block-visibility"),options:"dateTime"},{type:"color_picker",label:(0,n.__)("Color Picker","block-visibility")},{type:"message",label:(0,n.__)("Message","block-visibility")},{type:"accordion",label:(0,n.__)("Accordion","block-visibility")},{type:"tab",label:(0,n.__)("Tab","block-visibility")},{type:"group",label:(0,n.__)("Group","block-visibility")},{type:"repeater",label:(0,n.__)("Repeater","block-visibility")},{type:"flexible_content",label:(0,n.__)("Flexible Content","block-visibility")},{type:"clone",label:(0,n.__)("Clone","block-visibility")}];function ve(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:"",r=null!==(l=e?.fields)&&void 0!==l?l:[];0!==r.length&&r.forEach((e=>{var t,l;const r=null!==(t=e?.key)&&void 0!==t?t:"",s=null!==(l=e?.label)&&void 0!==l?l:"";i.push({value:r,label:s,group:o,help:"Field type: "+me.filter((t=>t?.type===e?.type))[0]?.label,fields:[{type:"subField",name:"isUserField",valueType:"toggle",placeholder:(0,n.__)("Evaluate as user field","block-visibility")},{type:"operatorField",valueType:"select",options:fe(e),placeholder:(0,n.__)("Select Condition…","block-visibility")},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","greaterThan","greaterThanEqual","lessThan","lessThanEqual","contains","notContain"]}]}]})}))})),i}function fe(e){const t=me.filter((t=>t?.type===e?.type))[0]?.options,l=[{value:"notEmpty",label:(0,n.__)("True","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("False","block-visibility"),disableValue:!0}],i=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"greaterThan",label:(0,n.__)("Value is greater than","block-visibility")},{value:"greaterThanEqual",label:(0,n.__)("Value is greater or equal to","block-visibility")},{value:"lessThan",label:(0,n.__)("Value is less than","block-visibility")},{value:"lessThanEqual",label:(0,n.__)("Value is less than or equal to","block-visibility")}],o=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,n.__)("Value contains","block-visibility")},{value:"notContain",label:(0,n.__)("Value does not contain","block-visibility")}];return"boolean"===t?l:"dateTime"===t||"numeric"===t?i:o}function ye(e){const{value:l,onDateChange:i,setPopoverOpen:n,includeTime:o}=e,r=(0,Z.__experimentalGetSettings)(),s=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",onClose:n.bind(null,!1)},[o&&(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{i(e),n(!1)},is12Hour:s}),!o&&(0,t.createElement)(u.DatePicker,{currentDate:l,onChange:e=>{i(e),n(!1)},is12Hour:s})])}const he=(0,t.createElement)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(j.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"})),ge=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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 _e(e){const{value:l,setPopoverOpen:i,onClearDateTime:o,includeTime:r}=e;let s=r?(0,n.__)("Select Date and Time…","block-visibility"):(0,n.__)("Select Date…","block-visibility");const a=(0,Z.__experimentalGetSettings)();if(l){const e=r?`${a.formats.date} ${a.formats.time}`:`${a.formats.date}`;s=(0,Z.format)(e,l)}return(0,t.createElement)("div",{className:b()("date-time__date-time-field",{"has-value":l})},(0,t.createElement)(u.Button,{icon:he,title:(0,n.__)("Select date/time","block-visibility"),onClick:()=>i((e=>!e)),isLink:!0},(0,t.createElement)("span",null,s)),l&&(0,t.createElement)(u.Button,{icon:ge,className:"clear-date-time",title:(0,n.__)("Clear date/time","block-visibility"),onClick:()=>o("")}))}function ke(e){const{value:l,onChange:i,includeTime:n}=e,[o,r]=(0,t.useState)(!1);return(0,t.createElement)("div",{className:"date-time"},(0,t.createElement)(_e,{value:l,setPopoverOpen:r,onClearDateTime:()=>i(""),includeTime:n}),o&&(0,t.createElement)(ye,{value:l,onDateChange:e=>i(e),setPopoverOpen:r,includeTime:n}))}const Ee=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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 Se(e){const{message:l,subMessage:i,link:o,position:r}=e,s=null!=r?r:"middle left";return(0,t.createElement)("div",{className:"information-popover"},(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("More Information","block-visibility"),icon:Ee,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:s,noArrow:!1}},(()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,l),i&&(0,t.createElement)("p",null,i),o&&(0,t.createElement)(u.ExternalLink,{href:o},(0,n.__)("Learn More","block-visibility"))))))}function we(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function Ce(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 Oe(e){for(var t=1;te.length)&&(t=e.length);for(var l=0,i=new Array(t);l=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}var Re=l(196),Ae=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Me(e,t){for(var l=0;l0?$e(lt,--et):0,Qe--,10===tt&&(Qe=1,Ke--),tt}function rt(){return tt=et2||ut(tt)>3?"":" "}function vt(e,t){for(;--t&&rt()&&!(tt<48||tt>102||tt>57&&tt<65||tt>70&&tt<97););return ct(e,at()+(t<6&&32==st()&&32==rt()))}function ft(e){for(;rt();)switch(tt){case e:return et;case 34:case 39:34!==e&&39!==e&&ft(tt);break;case 40:41===e&&ft(e);break;case 92:rt()}return et}function yt(e,t){for(;rt()&&e+tt!==57&&(e+tt!==84||47!==st()););return"/*"+ct(t,et-1)+"*"+Ue(47===e?e:rt())}function ht(e){for(;!ut(st());)rt();return ct(e,et)}var gt="-ms-",_t="-moz-",kt="-webkit-",Et="comm",St="rule",wt="decl",Ct="@keyframes";function Ot(e,t){for(var l="",i=Ye(e),n=0;n0&&Ze(S)-d&&Xe(b>32?At(S+";",i,l,d-1):At(qe(S," ","")+";",i,l,d-2),a);break;case 59:S+=";";default:if(Xe(E=Nt(S,t,l,c,u,n,s,g,_=[],k=[],d),o),123===h)if(0===u)Pt(S,t,E,E,_,o,d,s,k);else switch(99===p&&110===$e(S,3)?100:p){case 100:case 109:case 115:Pt(e,E,E,i&&Xe(Nt(e,E,E,0,0,n,s,g,n,_=[],d),k),n,k,d,s,i?_:k);break;default:Pt(S,E,E,E,[""],k,0,s,k)}}c=u=b=0,v=y=1,g=S="",d=r;break;case 58:d=1+Ze(S),b=m;default:if(v<1)if(123==h)--v;else if(125==h&&0==v++&&125==ot())continue;switch(S+=Ue(h),h*v){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Ze(S)-1)*y,y=1;break;case 64:45===st()&&(S+=bt(rt())),p=st(),u=d=Ze(g=S+=ht(at())),h++;break;case 45:45===m&&2==Ze(S)&&(v=0)}}return o}function Nt(e,t,l,i,n,o,r,s,a,c,u){for(var d=n-1,p=0===n?o:[""],b=Ye(p),m=0,v=0,f=0;m0?p[y]+" "+h:qe(h,/&\f/g,p[y])))&&(a[f++]=g);return it(e,t,l,0===n?St:s,a,c,u)}function Rt(e,t,l){return it(e,t,l,Et,Ue(tt),We(e,2,-2),0)}function At(e,t,l,i){return it(e,t,l,wt,We(e,0,i),We(e,i+1,-1),i)}var Mt=function(e,t,l){for(var i=0,n=0;i=n,n=st(),38===i&&12===n&&(t[l]=1),!ut(n);)rt();return ct(e,et)},Vt=new WeakMap,Ft=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)||Vt.get(l))&&!i){Vt.set(e,!0);for(var n=[],o=function(e,t){return pt(function(e,t){var l=-1,i=44;do{switch(ut(i)){case 0:38===i&&12===st()&&(t[l]=1),e[l]+=Mt(et-1,t,l);break;case 2:e[l]+=bt(i);break;case 4:if(44===i){e[++l]=58===st()?"&\f":"",t[l]=e[l].length;break}default:e[l]+=Ue(i)}}while(i=rt());return e}(dt(e),t))}(t,n),r=l.props,s=0,a=0;s6)switch($e(e,t+1)){case 109:if(45!==$e(e,t+4))break;case 102:return qe(e,/(.+:)(.+)-([^]+)/,"$1"+kt+"$2-$3$1"+_t+(108==$e(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ge(e,"stretch")?Dt(qe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==$e(e,t+1))break;case 6444:switch($e(e,Ze(e)-3-(~Ge(e,"!important")&&10))){case 107:return qe(e,":",":"+kt)+e;case 101:return qe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+kt+(45===$e(e,14)?"inline-":"")+"box$3$1"+kt+"$2$3$1"+gt+"$2box$3")+e}break;case 5936:switch($e(e,t+11)){case 114:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return kt+e+gt+e+e}return e}var Lt=[function(e,t,l,i){if(e.length>-1&&!e.return)switch(e.type){case wt:e.return=Dt(e.value,e.length);break;case Ct:return Ot([nt(e,{value:qe(e.value,"@","@"+kt)})],i);case St: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 Ot([nt(e,{props:[qe(t,/:(read-\w+)/,":"+_t+"$1")]})],i);case"::placeholder":return Ot([nt(e,{props:[qe(t,/:(plac\w+)/,":"+kt+"input-$1")]}),nt(e,{props:[qe(t,/:(plac\w+)/,":"+_t+"$1")]}),nt(e,{props:[qe(t,/:(plac\w+)/,gt+"input-$1")]})],i)}return""}))}}];const Ht=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,n,o=e.stylisPlugins||Lt,r={},s=[];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,n-=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(n){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)},jt={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};var zt=/[A-Z]|^ms/g,qt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Gt=function(e){return 45===e.charCodeAt(1)},$t=function(e){return null!=e&&"boolean"!=typeof e},Wt=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Gt(l=e)?l:l.replace(zt,"-$&").toLowerCase()),t[e];var l}}(),Zt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(qt,(function(e,t,l){return Xt={name:t,styles:l,next:Xt},t}))}return 1===jt[e]||Gt(e)||"number"!=typeof t||0===t?t:t+"px"};function Yt(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 Xt={name:l.name,styles:l.styles,next:Xt},l.name;if(void 0!==l.styles){var i=l.next;if(void 0!==i)for(;void 0!==i;)Xt={name:i.name,styles:i.styles,next:Xt},i=i.next;return l.styles+";"}return function(e,t,l){var i="";if(Array.isArray(l))for(var n=0;ne.brand+"/"+e.version)).join(" "),vl):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const kl=Math.round;function El(e){return yl(e)?e:e.contextElement}const Sl={x:1,y:1};function wl(e){const t=El(e);if(!fl(t))return Sl;const l=t.getBoundingClientRect(),{width:i,height:n,fallback:o}=function(e){const t=pl(e);let l=parseFloat(t.width),i=parseFloat(t.height);const n=fl(e),o=n?e.offsetWidth:l,r=n?e.offsetHeight:i,s=kl(l)!==o||kl(i)!==r;return s&&(l=o,i=r),{width:l,height:i,fallback:s}}(t);let r=(o?kl(l.width):l.width)/i,s=(o?kl(l.height):l.height)/n;return r&&Number.isFinite(r)||(r=1),s&&Number.isFinite(s)||(s=1),{x:r,y:s}}function Cl(e,t,l,i){var n,o;void 0===t&&(t=!1),void 0===l&&(l=!1);const r=e.getBoundingClientRect(),s=El(e);let a=Sl;t&&(i?yl(i)&&(a=wl(i)):a=wl(e));const c=s?dl(s):window,u=_l()&&l;let d=(r.left+(u&&(null==(n=c.visualViewport)?void 0:n.offsetLeft)||0))/a.x,p=(r.top+(u&&(null==(o=c.visualViewport)?void 0:o.offsetTop)||0))/a.y,b=r.width/a.x,m=r.height/a.y;if(s){const e=dl(s),t=i&&yl(i)?dl(i):i;let l=e.frameElement;for(;l&&i&&t!==e;){const e=wl(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,m*=e.y,d+=t.x,p+=t.y,l=dl(l).frameElement}}return v={width:b,height:m,x:d,y:p},{...v,top:v.y,left:v.x,right:v.x+v.width,bottom:v.y+v.height};var v}function Ol(e){if("html"===ml(e))return e;const t=e.assignedSlot||e.parentNode||hl(e)&&e.host||function(e){return((bl(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return hl(t)?t.host:t}function xl(e){const t=Ol(e);return function(e){return["html","body","#document"].includes(ml(e))}(t)?t.ownerDocument.body:fl(t)&&gl(t)?t:xl(t)}function Tl(e,t){var l;void 0===t&&(t=[]);const i=xl(e),n=i===(null==(l=e.ownerDocument)?void 0:l.body),o=dl(i);return n?t.concat(o,o.visualViewport||[],gl(i)?i:[]):t.concat(i,Tl(i))}const Pl=Re.useLayoutEffect;var Nl=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Rl=function(){};function Al(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Ml(e,t){for(var l=arguments.length,i=new Array(l>2?l-2:0),n=2;n-1}function Ll(e){return Dl(e)?window.pageYOffset:e.scrollTop}function Hl(e,t){Dl(e)?window.scrollTo(0,t):e.scrollTop=t}function Bl(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,n=Ll(e),o=t-n,r=0;!function t(){var s,a=(s=r+=10,o*((s=s/l-1)*s*s+1)+n);Hl(e,a),rl.bottom?Hl(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):i.top-n=m)return{placement:"bottom",maxHeight:t};if(w>=m&&!r)return o&&Bl(a,C,x),{placement:"bottom",maxHeight:t};if(!r&&w>=i||r&&E>=i)return o&&Bl(a,C,x),{placement:"bottom",maxHeight:r?E-g:w-g};if("auto"===n||r){var T=t,P=r?k:S;return P>=i&&(T=Math.min(P-g-s,t)),{placement:"top",maxHeight:T}}if("bottom"===n)return o&&Hl(a,C),{placement:"bottom",maxHeight:t};break;case"top":if(k>=m)return{placement:"top",maxHeight:t};if(S>=m&&!r)return o&&Bl(a,O,x),{placement:"top",maxHeight:t};if(!r&&S>=i||r&&k>=i){var N=t;return(!r&&S>=i||r&&k>=i)&&(N=r?k-_:S-_),o&&Bl(a,O,x),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return c}({maxHeight:i,menuEl:e,minHeight:l,placement:n,shouldScroll:r&&!t,isFixedPosition:t,controlHeight:f});p(s.maxHeight),v(s.placement),null==a||a(s.placement)}}),[i,n,o,r,l,a,f]),t({ref:c,placerProps:Oe(Oe({},e),{},{placement:m||Yl(n),maxHeight:d})})},Ql=function(e,t){var l=e.theme,i=l.spacing.baseUnit,n=l.colors;return Oe({textAlign:"center"},t?{}:{color:n.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},Jl=Ql,ei=Ql,ti=function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),l)};ti.defaultProps={children:"No options"};var li=function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),l)};li.defaultProps={children:"Loading..."};var ii,ni,oi,ri=["size"],si={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ai=function(t){var l=t.size,i=Ne(t,ri);return al("svg",e({height:l,width:l,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:si},i))},ci=function(t){return al(ai,e({size:20},t),al("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"}))},ui=function(t){return al(ai,e({size:20},t),al("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"}))},di=function(e,t){var l=e.isFocused,i=e.theme,n=i.spacing.baseUnit,o=i.colors;return Oe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:l?o.neutral60:o.neutral20,padding:2*n,":hover":{color:l?o.neutral80:o.neutral40}})},pi=di,bi=di,mi=function(){var e=cl.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_"}}}(ii||(ni=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],oi||(oi=ni.slice(0)),ii=Object.freeze(Object.defineProperties(ni,{raw:{value:Object.freeze(oi)}})))),vi=function(e){var t=e.delay,l=e.offset;return al("span",{css:cl({animation:"".concat(mi," 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"},"","")})},fi=function(t){var l=t.innerProps,i=t.isRtl;return al("div",e({},Il(t,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),l),al(vi,{delay:0,offset:i}),al(vi,{delay:160,offset:!0}),al(vi,{delay:320,offset:!i}))};fi.defaultProps={size:4};var yi=["data"],hi=["innerRef","isDisabled","isHidden","inputClassName"],gi={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},_i={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Oe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},gi)},ki=function(e){return Oe({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},gi)},Ei=function(e){var t=e.children,l=e.innerProps;return al("div",l,t)},Si={ClearIndicator:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),l||al(ci,null))},Control:function(t){var l=t.children,i=t.isDisabled,n=t.isFocused,o=t.innerRef,r=t.innerProps,s=t.menuIsOpen;return al("div",e({ref:o},Il(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":n,"control--menu-is-open":s}),r),l)},DropdownIndicator:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),l||al(ui,null))},DownChevron:ui,CrossIcon:ci,Group:function(t){var l=t.children,i=t.cx,n=t.getStyles,o=t.getClassNames,r=t.Heading,s=t.headingProps,a=t.innerProps,c=t.label,u=t.theme,d=t.selectProps;return al("div",e({},Il(t,"group",{group:!0}),a),al(r,e({},s,{selectProps:d,theme:u,getStyles:n,getClassNames:o,cx:i}),c),al("div",null,l))},GroupHeading:function(t){var l=Fl(t);l.data;var i=Ne(l,yi);return al("div",e({},Il(t,"groupHeading",{"group-heading":!0}),i))},IndicatorsContainer:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"indicatorsContainer",{indicators:!0}),i),l)},IndicatorSeparator:function(t){var l=t.innerProps;return al("span",e({},l,Il(t,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(t){var l=t.cx,i=t.value,n=Fl(t),o=n.innerRef,r=n.isDisabled,s=n.isHidden,a=n.inputClassName,c=Ne(n,hi);return al("div",e({},Il(t,"input",{"input-container":!0}),{"data-value":i||""}),al("input",e({className:l({input:!0},a),ref:o,style:ki(s),disabled:r},c)))},LoadingIndicator:fi,Menu:function(t){var l=t.children,i=t.innerRef,n=t.innerProps;return al("div",e({},Il(t,"menu",{menu:!0}),{ref:i},n),l)},MenuList:function(t){var l=t.children,i=t.innerProps,n=t.innerRef,o=t.isMulti;return al("div",e({},Il(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:n},i),l)},MenuPortal:function(t){var l=t.appendTo,i=t.children,n=t.controlElement,o=t.innerProps,r=t.menuPlacement,s=t.menuPosition,a=(0,Re.useRef)(null),c=(0,Re.useRef)(null),u=Pe((0,Re.useState)(Yl(r)),2),d=u[0],p=u[1],b=(0,Re.useMemo)((function(){return{setPortalPlacement:p}}),[]),m=Pe((0,Re.useState)(null),2),v=m[0],f=m[1],y=(0,Re.useCallback)((function(){if(n){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}}(n),t="fixed"===s?0:window.pageYOffset,l=e[d]+t;l===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||f({offset:l,rect:e})}}),[n,s,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);Pl((function(){y()}),[y]);var h=(0,Re.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),n&&a.current&&(c.current=function(e,t,l,i){void 0===i&&(i={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r=!0,animationFrame:s=!1}=i,a=n&&!s,c=a||o?[...yl(e)?Tl(e):e.contextElement?Tl(e.contextElement):[],...Tl(t)]:[];c.forEach((e=>{a&&e.addEventListener("scroll",l,{passive:!0}),o&&e.addEventListener("resize",l)}));let u,d=null;r&&(d=new ResizeObserver((()=>{l()})),yl(e)&&!s&&d.observe(e),yl(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t));let p=s?Cl(e):null;return s&&function t(){const i=Cl(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=>{a&&e.removeEventListener("scroll",l),o&&e.removeEventListener("resize",l)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(u)}}(n,a.current,y,{elementResize:"ResizeObserver"in window}))}),[n,y]);Pl((function(){h()}),[h]);var g=(0,Re.useCallback)((function(e){a.current=e,h()}),[h]);if(!l&&"fixed"!==s||!v)return null;var _=al("div",e({ref:g},Il(Oe(Oe({},t),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),i);return al(Xl.Provider,{value:b},l?(0,ul.createPortal)(_,l):_)},LoadingMessage:li,NoOptionsMessage:ti,MultiValue:function(e){var t=e.children,l=e.components,i=e.data,n=e.innerProps,o=e.isDisabled,r=e.removeProps,s=e.selectProps,a=l.Container,c=l.Label,u=l.Remove;return al(a,{data:i,innerProps:Oe(Oe({},Il(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),n),selectProps:s},al(c,{data:i,innerProps:Oe({},Il(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),al(u,{data:i,innerProps:Oe(Oe({},Il(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},r),selectProps:s}))},MultiValueContainer:Ei,MultiValueLabel:Ei,MultiValueRemove:function(t){var l=t.children,i=t.innerProps;return al("div",e({role:"button"},i),l||al(ci,{size:14}))},Option:function(t){var l=t.children,i=t.isDisabled,n=t.isFocused,o=t.isSelected,r=t.innerRef,s=t.innerProps;return al("div",e({},Il(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":n,"option--is-selected":o}),{ref:r,"aria-disabled":i},s),l)},Placeholder:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"placeholder",{placeholder:!0}),i),l)},SelectContainer:function(t){var l=t.children,i=t.innerProps,n=t.isDisabled,o=t.isRtl;return al("div",e({},Il(t,"container",{"--is-disabled":n,"--is-rtl":o}),i),l)},SingleValue:function(t){var l=t.children,i=t.isDisabled,n=t.innerProps;return al("div",e({},Il(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),n),l)},ValueContainer:function(t){var l=t.children,i=t.innerProps,n=t.isMulti,o=t.hasValue;return al("div",e({},Il(t,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":o}),i),l)}},wi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ci(e,t){if(e.length!==t.length)return!1;for(var l=0;l1?"s":""," ").concat(n.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,l=e.focused,i=e.options,n=e.label,o=void 0===n?"":n,r=e.selectValue,s=e.isDisabled,a=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(o," focused, ").concat(c(r,l),".");if("menu"===t){var u=s?" disabled":"",d="".concat(a?"selected":"focused").concat(u);return"option ".concat(o," ").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:"",".")}},Pi=function(e){var t=e.ariaSelection,l=e.focusedOption,i=e.focusedValue,n=e.focusableOptions,o=e.isFocused,r=e.selectValue,s=e.selectProps,a=e.id,c=s.ariaLiveMessages,u=s.getOptionLabel,d=s.inputValue,p=s.isMulti,b=s.isOptionDisabled,m=s.isSearchable,v=s.menuIsOpen,f=s.options,y=s.screenReaderStatus,h=s.tabSelectsValue,g=s["aria-label"],_=s["aria-live"],k=(0,Re.useMemo)((function(){return Oe(Oe({},Ti),c||{})}),[c]),E=(0,Re.useMemo)((function(){var e,l="";if(t&&k.onChange){var i=t.option,n=t.options,o=t.removedValue,s=t.removedValues,a=t.value,c=o||i||(e=a,Array.isArray(e)?null:e),d=c?u(c):"",p=n||s||void 0,m=p?p.map(u):[],v=Oe({isDisabled:c&&b(c,r),label:d,labels:m},t);l=k.onChange(v)}return l}),[t,k,b,r,u]),S=(0,Re.useMemo)((function(){var e="",t=l||i,o=!!(l&&r&&r.includes(l));if(t&&k.onFocus){var s={focused:t,label:u(t),isDisabled:b(t,r),isSelected:o,options:n,context:t===l?"menu":"value",selectValue:r};e=k.onFocus(s)}return e}),[l,i,u,b,k,n,r]),w=(0,Re.useMemo)((function(){var e="";if(v&&f.length&&k.onFilter){var t=y({count:n.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[n,d,v,k,f,y]),C=(0,Re.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":v?"menu":"input";e=k.guidance({"aria-label":g,context:t,isDisabled:l&&b(l,r),isMulti:p,isSearchable:m,tabSelectsValue:h})}return e}),[g,l,i,p,b,m,v,k,r,h]),O="".concat(S," ").concat(w," ").concat(C),x=al(Re.Fragment,null,al("span",{id:"aria-selection"},E),al("span",{id:"aria-context"},O)),T="initial-input-focus"===(null==t?void 0:t.action);return al(Re.Fragment,null,al(xi,{id:a},T&&x),al(xi,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},o&&!T&&x))},Ni=[{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("["+Ni.map((function(e){return e.letters})).join("")+"]","g"),Ai={},Mi=0;Mi1?t-1:0),i=1;i0,v=d-p-u,f=!1;v>t&&r.current&&(i&&i(e),r.current=!1),m&&s.current&&(o&&o(e),s.current=!1),m&&t>v?(l&&!r.current&&l(e),b.scrollTop=d,f=!0,r.current=!0):!m&&-t>u&&(n&&!s.current&&n(e),b.scrollTop=0,f=!0,s.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[l,i,n,o]),d=(0,Re.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,Re.useCallback)((function(e){a.current=e.changedTouches[0].clientY}),[]),b=(0,Re.useCallback)((function(e){var t=a.current-e.changedTouches[0].clientY;u(e,t)}),[u]),m=(0,Re.useCallback)((function(e){if(e){var t=!!$l&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",b,t)}}),[b,p,d]),v=(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 m(e),function(){v(e)}}}),[t,m,v]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),o=function(e){var t=e.isEnabled,l=e.accountForScrollbars,i=void 0===l||l,n=(0,Re.useRef)({}),o=(0,Re.useRef)(null),r=(0,Re.useCallback)((function(e){if(Zi){var t=document.body,l=t&&t.style;if(i&&ji.forEach((function(e){var t=l&&l[e];n.current[e]=t})),i&&Yi<1){var o=parseInt(n.current.paddingRight,10)||0,r=document.body?document.body.clientWidth:0,s=window.innerWidth-r+o||0;Object.keys(zi).forEach((function(e){var t=zi[e];l&&(l[e]=t)})),l&&(l.paddingRight="".concat(s,"px"))}t&&Wi()&&(t.addEventListener("touchmove",qi,Xi),e&&(e.addEventListener("touchstart",$i,Xi),e.addEventListener("touchmove",Gi,Xi))),Yi+=1}}),[i]),s=(0,Re.useCallback)((function(e){if(Zi){var t=document.body,l=t&&t.style;Yi=Math.max(Yi-1,0),i&&Yi<1&&ji.forEach((function(e){var t=n.current[e];l&&(l[e]=t)})),t&&Wi()&&(t.removeEventListener("touchmove",qi,Xi),e&&(e.removeEventListener("touchstart",$i,Xi),e.removeEventListener("touchmove",Gi,Xi)))}}),[i]);return(0,Re.useEffect)((function(){if(t){var e=o.current;return r(e),function(){s(e)}}}),[t,r,s]),function(e){o.current=e}}({isEnabled:l});return al(Re.Fragment,null,l&&al("div",{onClick:Ki,css:Qi}),t((function(e){n(e),o(e)})))}var en={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},tn=function(e){var t=e.name,l=e.onFocus;return al("input",{required:!0,name:t,tabIndex:-1,onFocus:l,css:en,value:"",onChange:function(){}})},ln={clearIndicator:bi,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,n=e.theme,o=n.colors,r=n.borderRadius;return Oe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:n.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:l?o.neutral5:o.neutral0,borderColor:l?o.neutral10:i?o.primary:o.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},dropdownIndicator:pi,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,n=l.spacing;return Oe({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*n.baseUnit,paddingRight:3*n.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,n=i.spacing.baseUnit,o=i.colors;return Oe({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:l?o.neutral10:o.neutral20,marginBottom:2*n,marginTop:2*n})},input:function(e,t){var l=e.isDisabled,i=e.value,n=e.theme,o=n.spacing,r=n.colors;return Oe(Oe({visibility:l?"hidden":"visible",transform:i?"translateZ(0)":""},_i),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:r.neutral80})},loadingIndicator:function(e,t){var l=e.isFocused,i=e.size,n=e.theme,o=n.colors,r=n.spacing.baseUnit;return Oe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:l?o.neutral60:o.neutral20,padding:2*r})},loadingMessage:ei,menu:function(e,t){var l,i=e.placement,n=e.theme,o=n.borderRadius,r=n.spacing,s=n.colors;return Oe((we(l={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),we(l,"position","absolute"),we(l,"width","100%"),we(l,"zIndex",1),l),t?{}:{backgroundColor:s.neutral0,borderRadius:o,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 l=e.maxHeight,i=e.theme.spacing.baseUnit;return Oe({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,n=l.borderRadius,o=l.colors;return Oe({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:n/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var l=e.theme,i=l.borderRadius,n=l.colors,o=e.cropWithEllipsis;return Oe({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:n.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var l=e.theme,i=l.spacing,n=l.borderRadius,o=l.colors,r=e.isFocused;return Oe({alignItems:"center",display:"flex"},t?{}:{borderRadius:n/2,backgroundColor:r?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:Jl,option:function(e,t){var l=e.isDisabled,i=e.isFocused,n=e.isSelected,o=e.theme,r=o.spacing,s=o.colors;return Oe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:n?s.primary:i?s.primary25:"transparent",color:l?s.neutral20:n?s.neutral0:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),":active":{backgroundColor:l?void 0:n?s.primary:s.primary50}})},placeholder:function(e,t){var l=e.theme,i=l.spacing,n=l.colors;return Oe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:n.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var l=e.isDisabled,i=e.theme,n=i.spacing,o=i.colors;return Oe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:l?o.neutral40:o.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},valueContainer:function(e,t){var l=e.theme.spacing,i=e.isMulti,n=e.hasValue,o=e.selectProps.controlShouldRenderValue;return Oe({alignItems:"center",display:i&&n&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(l.baseUnit/2,"px ").concat(2*l.baseUnit,"px")})}},nn={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}},on={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:jl(),captureMenuScroll:!jl(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var l=Oe({ignoreCase:!0,ignoreAccents:!0,stringify:Hi,trim:!0,matchFrom:"any"},undefined),i=l.ignoreCase,n=l.ignoreAccents,o=l.stringify,r=l.trim,s=l.matchFrom,a=r?Li(t):t,c=r?Li(o(e)):o(e);return i&&(a=a.toLowerCase(),c=c.toLowerCase()),n&&(a=Di(a),c=Ii(c)),"start"===s?c.substr(0,a.length)===a:c.indexOf(a)>-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 rn(e,t,l,i){return{type:"option",data:t,isDisabled:pn(e,t,l),isSelected:bn(e,t,l),label:un(e,t),value:dn(e,t),index:i}}function sn(e,t){return e.options.map((function(l,i){if("options"in l){var n=l.options.map((function(l,i){return rn(e,l,t,i)})).filter((function(t){return cn(e,t)}));return n.length>0?{type:"group",data:l,options:n,index:i}:void 0}var o=rn(e,l,t,i);return cn(e,o)?o:void 0})).filter(Wl)}function an(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Le(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function cn(e,t){var l=e.inputValue,i=void 0===l?"":l,n=t.data,o=t.isSelected,r=t.label,s=t.value;return(!vn(e)||!o)&&mn(e,{label:r,value:s,data:n},i)}var un=function(e,t){return e.getOptionLabel(t)},dn=function(e,t){return e.getOptionValue(t)};function pn(e,t,l){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,l)}function bn(e,t,l){if(l.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,l);var i=dn(e,t);return l.some((function(t){return dn(e,t)===i}))}function mn(e,t,l){return!e.filterOption||e.filterOption(t,l)}var vn=function(e){var t=e.hideSelectedOptions,l=e.isMulti;return void 0===t?l:t},fn=1,yn=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&&Ve(e,t)}(r,t);var l,i,n,o=De(r);function r(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(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,l){var i=t.props,n=i.onChange,o=i.name;l.name=o,t.ariaOnChange(e,l),n(e,l)},t.setValue=function(e,l,i){var n=t.props,o=n.closeMenuOnSelect,r=n.isMulti,s=n.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(t.setState({inputIsHiddenAfterUpdate:!r}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:l,option:i})},t.selectOption=function(e){var l=t.props,i=l.blurInputOnSelect,n=l.isMulti,o=l.name,r=t.state.selectValue,s=n&&t.isOptionSelected(e,r),a=t.isOptionDisabled(e,r);if(s){var c=t.getOptionValue(e);t.setValue(r.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(a)return void t.ariaOnChange(e,{action:"select-option",option:e,name:o});n?t.setValue([].concat(Le(r),[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,n=t.getOptionValue(e),o=i.filter((function(e){return t.getOptionValue(e)!==n})),r=Zl(l,o,o[0]||null);t.onChange(r,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(Zl(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],n=l.slice(0,l.length-1),o=Zl(e,n,n[0]||null);t.onChange(o,{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||o>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 vn(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var l=t.props,i=l.isMulti,n=l.backspaceRemovesValue,o=l.escapeClearsValue,r=l.inputValue,s=l.isClearable,a=l.isDisabled,c=l.menuIsOpen,u=l.onKeyDown,d=l.tabSelectsValue,p=l.openMenuOnFocus,b=t.state,m=b.focusedOption,v=b.focusedValue,f=b.selectValue;if(!(a||"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(v)t.removeValue(v);else{if(!n)return;i?t.popValue():s&&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()):s&&o&&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||++fn),t.state.selectValue=Vl(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=r,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&&Ul(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,l=t.isDisabled,i=t.menuIsOpen,n=this.state.isFocused;(n&&!l&&e.isDisabled||n&&i&&!e.menuIsOpen)&&this.focusInput(),n&&l&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):n||l||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Ul(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,n=l.isFocused,o=this.buildFocusableOptions(),r="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(i[0]);s>-1&&(r=s)}this.scrollToFocusedOptionOnUpdate=!(n&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[r]},(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 n=l.indexOf(i);i||(n=-1);var o=l.length-1,r=-1;if(l.length){switch(e){case"previous":r=0===n?0:-1===n?o:n-1;break;case"next":n>-1&&n0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,l=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var n=0,o=i.indexOf(l);l||(o=-1),"up"===e?n=o>0?o-1:i.length-1:"down"===e?n=(o+1)%i.length:"pageup"===e?(n=o-t)<0&&(n=0):"pagedown"===e?(n=o+t)>i.length-1&&(n=i.length-1):"last"===e&&(n=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[n],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(nn):Oe(Oe({},nn),this.props.theme):nn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,l=this.getStyles,i=this.getClassNames,n=this.getValue,o=this.selectOption,r=this.setValue,s=this.props,a=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:l,getClassNames:i,getValue:n,hasValue:this.hasValue(),isMulti:a,isRtl:c,options:u,selectOption:o,selectProps:s,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,l=e.isMulti;return void 0===t?l:t}},{key:"isOptionDisabled",value:function(e,t){return pn(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return bn(this.props,e,t)}},{key:"filterOption",value:function(e,t){return mn(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,n=t.inputId,o=t.inputValue,r=t.tabIndex,s=t.form,a=t.menuIsOpen,c=t.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,b=d.ariaSelection,m=this.commonProps,v=n||this.getElementId("input"),f=Oe(Oe(Oe({"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":c,role:"combobox"},a&&{"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({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:l,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:s,type:"text",value:o},f)):Re.createElement(Ui,e({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Rl,onFocus:this.onInputFocus,disabled:l,tabIndex:r,inputMode:"none",form:s,value:""},f))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,l=this.getComponents(),i=l.MultiValue,n=l.MultiValueContainer,o=l.MultiValueLabel,r=l.MultiValueRemove,s=l.SingleValue,a=l.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,b=u.isMulti,m=u.inputValue,v=u.placeholder,f=this.state,y=f.selectValue,h=f.focusedValue,g=f.isFocused;if(!this.hasValue()||!d)return m?null:Re.createElement(a,e({},c,{key:"placeholder",isDisabled:p,isFocused:g,innerProps:{id:this.getElementId("placeholder")}}),v);if(b)return y.map((function(l,s){var a=l===h,u="".concat(t.getOptionLabel(l),"-").concat(t.getOptionValue(l));return Re.createElement(i,e({},c,{components:{Container:n,Label:o,Remove:r},isFocused:a,isDisabled:p,key:u,index:s,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(m)return null;var _=y[0];return Re.createElement(s,e({},c,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,l=this.commonProps,i=this.props,n=i.isDisabled,o=i.isLoading,r=this.state.isFocused;if(!this.isClearable()||!t||n||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Re.createElement(t,e({},l,{innerProps:s,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,l=this.commonProps,i=this.props,n=i.isDisabled,o=i.isLoading,r=this.state.isFocused;return t&&o?Re.createElement(t,e({},l,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),l=t.DropdownIndicator,i=t.IndicatorSeparator;if(!l||!i)return null;var n=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return Re.createElement(i,e({},n,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var l=this.commonProps,i=this.props.isDisabled,n=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Re.createElement(t,e({},l,{innerProps:o,isDisabled:i,isFocused:n}))}},{key:"renderMenu",value:function(){var t=this,l=this.getComponents(),i=l.Group,n=l.GroupHeading,o=l.Menu,r=l.MenuList,s=l.MenuPortal,a=l.LoadingMessage,c=l.NoOptionsMessage,u=l.Option,d=this.commonProps,p=this.state.focusedOption,b=this.props,m=b.captureMenuScroll,v=b.inputValue,f=b.isLoading,y=b.loadingMessage,h=b.minMenuHeight,g=b.maxMenuHeight,_=b.menuIsOpen,k=b.menuPlacement,E=b.menuPosition,S=b.menuPortalTarget,w=b.menuShouldBlockScroll,C=b.menuShouldScrollIntoView,O=b.noOptionsMessage,x=b.onMenuScrollToTop,T=b.onMenuScrollToBottom;if(!_)return null;var P,N=function(l,i){var n=l.type,o=l.data,r=l.isDisabled,s=l.isSelected,a=l.label,c=l.value,b=p===o,m=r?void 0:function(){return t.onOptionHover(o)},v=r?void 0:function(){return t.selectOption(o)},f="".concat(t.getElementId("option"),"-").concat(i),y={id:f,onClick:v,onMouseMove:m,onMouseOver:m,tabIndex:-1};return Re.createElement(u,e({},d,{innerProps:y,data:o,isDisabled:r,isSelected:s,key:f,label:a,type:n,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 o=l.data,r=l.options,s=l.index,a="".concat(t.getElementId("group"),"-").concat(s),c="".concat(a,"-heading");return Re.createElement(i,e({},d,{key:a,data:o,options:r,Heading:n,headingProps:{id:c,data:l.data},label:t.formatGroupLabel(l.data)}),l.options.map((function(e){return N(e,"".concat(s,"-").concat(e.index))})))}if("option"===l.type)return N(l,"".concat(l.index))}));else if(f){var R=y({inputValue:v});if(null===R)return null;P=Re.createElement(a,d,R)}else{var A=O({inputValue:v});if(null===A)return null;P=Re.createElement(c,d,A)}var M={minMenuHeight:h,maxMenuHeight:g,menuPlacement:k,menuPosition:E,menuShouldScrollIntoView:C},V=Re.createElement(Kl,e({},d,M),(function(l){var i=l.ref,n=l.placerProps,s=n.placement,a=n.maxHeight;return Re.createElement(o,e({},d,M,{innerRef:i,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:f,placement:s}),Re.createElement(Ji,{captureEnabled:m,onTopArrive:x,onBottomArrive:T,lockEnabled:w},(function(l){return Re.createElement(r,e({},d,{innerRef:function(e){t.getMenuListRef(e),l(e)},isLoading:f,maxHeight:a,focusedOption:p}),P)})))}));return S||"fixed"===E?Re.createElement(s,e({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:k,menuPosition:E}),V):V}},{key:"renderFormField",value:function(){var e=this,t=this.props,l=t.delimiter,i=t.isDisabled,n=t.isMulti,o=t.name,r=t.required,s=this.state.selectValue;if(o&&!i){if(r&&!this.hasValue())return Re.createElement(tn,{name:o,onFocus:this.onValueInputFocus});if(n){if(l){var a=s.map((function(t){return e.getOptionValue(t)})).join(l);return Re.createElement("input",{name:o,type:"hidden",value:a})}var c=s.length>0?s.map((function(t,l){return Re.createElement("input",{key:"i-".concat(l),name:o,type:"hidden",value:e.getOptionValue(t)})})):Re.createElement("input",{name:o,type:"hidden",value:""});return Re.createElement("div",null,c)}var u=s[0]?this.getOptionValue(s[0]):"";return Re.createElement("input",{name:o,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,l=this.state,i=l.ariaSelection,n=l.focusedOption,o=l.focusedValue,r=l.isFocused,s=l.selectValue,a=this.getFocusableOptions();return Re.createElement(Pi,e({},t,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:n,focusedValue:o,isFocused:r,selectValue:s,focusableOptions:a}))}},{key:"render",value:function(){var t=this.getComponents(),l=t.Control,i=t.IndicatorsContainer,n=t.SelectContainer,o=t.ValueContainer,r=this.props,s=r.className,a=r.id,c=r.isDisabled,u=r.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return Re.createElement(n,e({},p,{className:s,innerProps:{id:a,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(o,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())}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){var l=t.prevProps,i=t.clearFocusValueOnUpdate,n=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,r=t.isFocused,s=t.prevWasFocused,a=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,b=Vl(c),m={};if(l&&(c!==l.value||a!==l.options||u!==l.menuIsOpen||d!==l.inputValue)){var v=u?function(e,t){return an(sn(e,t))}(e,b):[],f=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,v);m={selectValue:b,focusedOption:y,focusedValue:f,clearFocusValueOnUpdate:!1}}var h=null!=n&&e!==l?{inputIsHidden:n,inputIsHiddenAfterUpdate:void 0}:{},g=o,_=r&&s;return r&&!_&&(g={value:Zl(p,b,b[0]||null),options:b,action:"initial-input-focus"},_=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(g=null),Oe(Oe(Oe({},m),h),{},{prevProps:e,ariaSelection:g,prevWasFocused:_})}}],i&&Me(l.prototype,i),n&&Me(l,n),Object.defineProperty(l,"prototype",{writable:!1}),r}(Re.Component);yn.defaultProps=on;var hn=(0,Re.forwardRef)((function(t,l){var i=function(e){var t=e.defaultInputValue,l=void 0===t?"":t,i=e.defaultMenuIsOpen,n=void 0!==i&&i,o=e.defaultValue,r=void 0===o?null:o,s=e.inputValue,a=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,b=e.value,m=Ne(e,Ae),v=Pe((0,Re.useState)(void 0!==s?s:l),2),f=v[0],y=v[1],h=Pe((0,Re.useState)(void 0!==a?a:n),2),g=h[0],_=h[1],k=Pe((0,Re.useState)(void 0!==b?b:r),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)),y(void 0!==l?l:e)}),[u]),O=(0,Re.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),x=(0,Re.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),T=void 0!==s?s:f,P=void 0!==a?a:g,N=void 0!==b?b:E;return Oe(Oe({},m),{},{inputValue:T,menuIsOpen:P,onChange:w,onInputChange:C,onMenuClose:x,onMenuOpen:O,value:N})}(t);return Re.createElement(yn,e({ref:l},i))}));const gn=hn,kn=window.wp.htmlEntities,En={context:"view",orderby:"name",order:"asc",per_page:-1,who:"authors",_fields:"id,name"};function Sn(e){const{className:l,fieldType:i,fieldName:r,handleRuleChange:s,triggerReset:a,value:c}=e,{authors:u,loading:d}=(0,o.useSelect)((e=>{const{getUsers:t,isResolving:l}=e("core");return{authors:t(En),loading:l("getUsers",[En])}}),[]),p=(0,t.useMemo)((()=>(null!=u?u:[]).map((e=>({value:e.id,label:(0,kn.decodeEntities)(e.name)})))),[u]),m=p.filter((e=>c.includes(e.value)));return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:m,options:p,placeholder:(0,n.__)("Select Author…","block-visibility"),onChange:e=>s(e,"multiSelect",i,r,a),isLoading:d,isMulti:!0})}const wn={context:"view",orderby:"name",order:"asc",per_page:-1,_fields:"id,name"};function Cn(e){const{className:l,fieldType:i,fieldName:n,handleRuleChange:r,placeholder:s,taxonomySlug:a,triggerReset:c,value:u}=e,{availableTerms:d,loading:p}=(0,o.useSelect)((e=>{const{getEntityRecords:t,isResolving:l}=e("core");return{availableTerms:t("taxonomy",a,wn),loading:l("getEntityRecords",["taxonomy",a,wn])}}),[a]),m=(0,t.useMemo)((()=>(null!=d?d:[]).map((e=>({value:e.id,label:(0,kn.decodeEntities)(e.name)})))),[d]),v=m.filter((e=>u.includes(e.value)));return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:v,options:m,placeholder:s,onChange:e=>r(e,"multiSelect",i,n,c),isLoading:p,isMulti:!0})}function On(e){const t=e?.title?.raw?(0,kn.decodeEntities)(e.title.rendered):`${(0,n.__)("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 xn(e){const{className:l,fieldType:r,fieldName:s,handleRuleChange:a,placeholder:c,postType:u,triggerReset:d,value:p}=e,[m,v]=(0,t.useState)(!1),[f,y]=(0,t.useState)(!1),{availablePosts:h,loadingAvailablePosts:g}=(0,o.useSelect)((e=>{const{getPostType:t,getEntityRecords:l,isResolving:n}=e("core"),o=t(u),r=(0,i.get)(o,["hierarchical"],!1),s={orderby:r?"title":"date",order:r?"asc":"desc",per_page:25,status:"publish,draft,private,pending",_fields:"id,title,status"};return f&&(s.search=f),{availablePosts:l("postType",u,s),loadingAvailablePosts:n("getEntityRecords",["postType",u,s])}}),[f]),{savedPosts:_,loadingSavedPosts:k}=(0,o.useSelect)((e=>{if(0!==p.length&&!m){const t={include:p.join(","),per_page:-1,status:"publish,draft,private,pending",_fields:"id,title,status"},{getEntityRecords:l,isResolving:i}=e("core");return{savedPosts:l("postType",u,t),selectedLoading:i("getEntityRecords",["postType",u,t])}}return{savedPosts:[],loadingSavedPosts:!1}})),E=(0,t.useMemo)((()=>(null!=h?h:[]).map((e=>({value:e.id,label:On(e)})))),[h]);let S=[];return S=m||(null!=_?_:[]).map((e=>({value:e.id,label:On(e)}))),(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:S,options:E,onChange:e=>{v(e),a(e,"multiSelect",r,s,d)},onInputChange:(0,i.debounce)((e=>{(0===e.length||e.length>=3)&&y(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,n.__)("No options found","block-visibility"):(0,n.__)("Enter 3 characters to begin search","block-visibility")},placeholder:c,isLoading:g||k,isMulti:!0})}function Tn(l){const{rule:i,fieldType:o,fieldName:r,valueType:s,valueTypeVariant:a,options:c,placeholder:d,handleRuleChange:p,triggerReset:m,isLoading:v,hasGroupedFields:f,hasGroupedOptions:y,dependantFieldValue:h}=l;if(f&&!i.field&&"ruleField"!==o)return null;let g="";var _;if("ruleField"===o)g=null!==(_=i?.field)&&void 0!==_?_:"";else if("subField"===o){var k,E;g=i?.subFields?null!==(k=i.subFields[r])&&void 0!==k?k:"":null!==(E=i?.subField)&&void 0!==E?E:""}else{var S;g=null!==(S=i["operatorField"===o?"operator":"value"])&&void 0!==S?S:""}if("select"===s||"multiSelect"===s){let e="",t=c;if(y){const e=[];c.forEach((t=>{e.push(...t.options)})),t=e}"multiSelect"===s?e=t.filter((e=>g.includes(e.value))):(e=t.filter((e=>e.value===g)),0!==e.length&&(e=e[0])),g=e}const w="field__"+o;if("select"===s||"multiSelect"===s){const e=d||(0,n.__)("Select…","block-visibility");return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",w),classNamePrefix:"react-select",value:g,options:c,placeholder:e,onChange:e=>p(e,s,o,r,m),isMulti:"multiSelect"===s,isLoading:v})}if("date"===s||"dateTime"===s)return(0,t.createElement)(ke,{className:w,value:g,onChange:e=>p(e,s,o,r,m),includeTime:"dateTime"===s});if("toggle"===s)return(0,t.createElement)(u.ToggleControl,{className:w,label:d,checked:g,onChange:()=>p(!g,s,o,r,m)});if("authorsSelect"===s)return(0,t.createElement)(Sn,e({className:w,value:g},l));if("termsSelect"===s){let i;return h&&!a?i=h:a&&(i=a),(0,t.createElement)(Cn,e({key:i,taxonomySlug:i,className:w,value:g},l))}if("postsSelect"===s){let i;return h&&!a?i=h:a&&(i=a),(0,t.createElement)(xn,e({key:i,postType:i,className:w,value:g},l))}return(0,t.createElement)(u.TextControl,{className:w,type:s,min:"number"===s?0:"",value:g,placeholder:d,onChange:e=>p(e,"text",o,r,m),autocomplete:"off"})}function Pn(e){var l,o,r,s;const{rule:a,ruleIndex:c,ruleSet:d,ruleSetIndex:p,ruleSets:m,hideOnRuleSets:v,rulePlaceholder:f,ruleLabel:y,controlName:h,controlAtts:g,setControlAtts:_,groupedFields:k,allFields:E}=e;let S=E.filter((e=>e.value===a.field));k||(S=E.filter((e=>"ruleField"===e.type))),0!==S.length&&(S=S[0]);const w=k?null!==(l=S?.fields)&&void 0!==l?l:[]:E,C=null!==(o=S?.help)&&void 0!==o&&o,O=null!==(r=S?.hasMultipleSubFields)&&void 0!==r&&r,x=null!==(s=S?.hasSimplifiedLayout)&&void 0!==s&&s;let T=y;T||(T=()=>0===c?(0,n.sprintf)( +(0,n.__)("%s toggled"),l.label),"assertive")}},l.icon&&(0,t.createElement)(q,{className:"control-branding-icon",icon:l.icon}),l.label)}const me=[{type:"text",label:(0,n.__)("Text","block-visibility")},{type:"textarea",label:(0,n.__)("Text Area","block-visibility")},{type:"number",label:(0,n.__)("Number","block-visibility"),options:"numeric"},{type:"range",label:(0,n.__)("Range","block-visibility"),options:"numeric"},{type:"email",label:(0,n.__)("Email","block-visibility")},{type:"url",label:(0,n.__)("Url","block-visibility")},{type:"password",label:(0,n.__)("Password","block-visibility")},{type:"image",label:(0,n.__)("Image","block-visibility")},{type:"file",label:(0,n.__)("File","block-visibility")},{type:"wysiwyg",label:(0,n.__)("Wysiwyg Editor","block-visibility")},{type:"oembed",label:(0,n.__)("oEmbed","block-visibility")},{type:"select",label:(0,n.__)("Select","block-visibility")},{type:"checkbox",label:(0,n.__)("Checkbox","block-visibility")},{type:"radio",label:(0,n.__)("Radio Button","block-visibility")},{type:"button_group",label:(0,n.__)("Button Group","block-visibility")},{type:"true_false",label:(0,n.__)("True / False","block-visibility"),options:"boolean"},{type:"link",label:(0,n.__)("Link","block-visibility")},{type:"post_object",label:(0,n.__)("Post Object","block-visibility")},{type:"page_link",label:(0,n.__)("Page Link","block-visibility")},{type:"relationship",label:(0,n.__)("Relationship","block-visibility")},{type:"taxonomy",label:(0,n.__)("Taxonomy","block-visibility")},{type:"user",label:(0,n.__)("User","block-visibility")},{type:"google_map",label:(0,n.__)("Google Map","block-visibility")},{type:"date_picker",label:(0,n.__)("Date Picker","block-visibility"),options:"dateTime"},{type:"date_time_picker",label:(0,n.__)("Date Time Picker","block-visibility"),options:"dateTime"},{type:"time_picker",label:(0,n.__)("Time Picker","block-visibility"),options:"dateTime"},{type:"color_picker",label:(0,n.__)("Color Picker","block-visibility")},{type:"message",label:(0,n.__)("Message","block-visibility")},{type:"accordion",label:(0,n.__)("Accordion","block-visibility")},{type:"tab",label:(0,n.__)("Tab","block-visibility")},{type:"group",label:(0,n.__)("Group","block-visibility")},{type:"repeater",label:(0,n.__)("Repeater","block-visibility")},{type:"flexible_content",label:(0,n.__)("Flexible Content","block-visibility")},{type:"clone",label:(0,n.__)("Clone","block-visibility")}];function ve(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:"",r=null!==(l=e?.fields)&&void 0!==l?l:[];0!==r.length&&r.forEach((e=>{var t,l;const r=null!==(t=e?.key)&&void 0!==t?t:"",s=null!==(l=e?.label)&&void 0!==l?l:"";i.push({value:r,label:s,group:o,help:"Field type: "+me.filter((t=>t?.type===e?.type))[0]?.label,fields:[{type:"subField",name:"isUserField",valueType:"toggle",placeholder:(0,n.__)("Evaluate as user field","block-visibility")},{type:"operatorField",valueType:"select",options:fe(e),placeholder:(0,n.__)("Select Condition…","block-visibility")},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","greaterThan","greaterThanEqual","lessThan","lessThanEqual","contains","notContain"]}]}]})}))})),i}function fe(e){const t=me.filter((t=>t?.type===e?.type))[0]?.options,l=[{value:"notEmpty",label:(0,n.__)("True","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("False","block-visibility"),disableValue:!0}],i=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"greaterThan",label:(0,n.__)("Value is greater than","block-visibility")},{value:"greaterThanEqual",label:(0,n.__)("Value is greater or equal to","block-visibility")},{value:"lessThan",label:(0,n.__)("Value is less than","block-visibility")},{value:"lessThanEqual",label:(0,n.__)("Value is less than or equal to","block-visibility")}],o=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,n.__)("Value contains","block-visibility")},{value:"notContain",label:(0,n.__)("Value does not contain","block-visibility")}];return"boolean"===t?l:"dateTime"===t||"numeric"===t?i:o}function ye(e){const{value:l,onDateChange:i,setPopoverOpen:n,includeTime:o}=e,r=(0,Z.__experimentalGetSettings)(),s=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",onClose:n.bind(null,!1)},[o&&(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{i(e),n(!1)},is12Hour:s}),!o&&(0,t.createElement)(u.DatePicker,{currentDate:l,onChange:e=>{i(e),n(!1)},is12Hour:s})])}const he=(0,t.createElement)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(j.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"})),ge=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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 _e(e){const{value:l,setPopoverOpen:i,onClearDateTime:o,includeTime:r}=e;let s=r?(0,n.__)("Select Date and Time…","block-visibility"):(0,n.__)("Select Date…","block-visibility");const a=(0,Z.__experimentalGetSettings)();if(l){const e=r?`${a.formats.date} ${a.formats.time}`:`${a.formats.date}`;s=(0,Z.format)(e,l)}return(0,t.createElement)("div",{className:b()("date-time__date-time-field",{"has-value":l})},(0,t.createElement)(u.Button,{icon:he,title:(0,n.__)("Select date/time","block-visibility"),onClick:()=>i((e=>!e)),isLink:!0},(0,t.createElement)("span",null,s)),l&&(0,t.createElement)(u.Button,{icon:ge,className:"clear-date-time",title:(0,n.__)("Clear date/time","block-visibility"),onClick:()=>o("")}))}function ke(e){const{value:l,onChange:i,includeTime:n}=e,[o,r]=(0,t.useState)(!1);return(0,t.createElement)("div",{className:"date-time"},(0,t.createElement)(_e,{value:l,setPopoverOpen:r,onClearDateTime:()=>i(""),includeTime:n}),o&&(0,t.createElement)(ye,{value:l,onDateChange:e=>i(e),setPopoverOpen:r,includeTime:n}))}const Ee=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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 Se(e){const{message:l,subMessage:i,link:o,position:r}=e,s=null!=r?r:"middle left";return(0,t.createElement)("div",{className:"information-popover"},(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("More Information","block-visibility"),icon:Ee,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:s,noArrow:!1}},(()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,l),i&&(0,t.createElement)("p",null,i),o&&(0,t.createElement)(u.ExternalLink,{href:o},(0,n.__)("Learn More","block-visibility"))))))}function we(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function Ce(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 Oe(e){for(var t=1;te.length)&&(t=e.length);for(var l=0,i=new Array(t);l=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}var Re=l(196),Ae=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Me(e,t){for(var l=0;l0?$e(lt,--et):0,Qe--,10===tt&&(Qe=1,Ke--),tt}function rt(){return tt=et2||ut(tt)>3?"":" "}function vt(e,t){for(;--t&&rt()&&!(tt<48||tt>102||tt>57&&tt<65||tt>70&&tt<97););return ct(e,at()+(t<6&&32==st()&&32==rt()))}function ft(e){for(;rt();)switch(tt){case e:return et;case 34:case 39:34!==e&&39!==e&&ft(tt);break;case 40:41===e&&ft(e);break;case 92:rt()}return et}function yt(e,t){for(;rt()&&e+tt!==57&&(e+tt!==84||47!==st()););return"/*"+ct(t,et-1)+"*"+Ue(47===e?e:rt())}function ht(e){for(;!ut(st());)rt();return ct(e,et)}var gt="-ms-",_t="-moz-",kt="-webkit-",Et="comm",St="rule",wt="decl",Ct="@keyframes";function Ot(e,t){for(var l="",i=Ye(e),n=0;n0&&Ze(S)-d&&Xe(b>32?At(S+";",i,l,d-1):At(qe(S," ","")+";",i,l,d-2),a);break;case 59:S+=";";default:if(Xe(E=Nt(S,t,l,c,u,n,s,g,_=[],k=[],d),o),123===h)if(0===u)Pt(S,t,E,E,_,o,d,s,k);else switch(99===p&&110===$e(S,3)?100:p){case 100:case 109:case 115:Pt(e,E,E,i&&Xe(Nt(e,E,E,0,0,n,s,g,n,_=[],d),k),n,k,d,s,i?_:k);break;default:Pt(S,E,E,E,[""],k,0,s,k)}}c=u=b=0,v=y=1,g=S="",d=r;break;case 58:d=1+Ze(S),b=m;default:if(v<1)if(123==h)--v;else if(125==h&&0==v++&&125==ot())continue;switch(S+=Ue(h),h*v){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Ze(S)-1)*y,y=1;break;case 64:45===st()&&(S+=bt(rt())),p=st(),u=d=Ze(g=S+=ht(at())),h++;break;case 45:45===m&&2==Ze(S)&&(v=0)}}return o}function Nt(e,t,l,i,n,o,r,s,a,c,u){for(var d=n-1,p=0===n?o:[""],b=Ye(p),m=0,v=0,f=0;m0?p[y]+" "+h:qe(h,/&\f/g,p[y])))&&(a[f++]=g);return it(e,t,l,0===n?St:s,a,c,u)}function Rt(e,t,l){return it(e,t,l,Et,Ue(tt),We(e,2,-2),0)}function At(e,t,l,i){return it(e,t,l,wt,We(e,0,i),We(e,i+1,-1),i)}var Mt=function(e,t,l){for(var i=0,n=0;i=n,n=st(),38===i&&12===n&&(t[l]=1),!ut(n);)rt();return ct(e,et)},Vt=new WeakMap,Ft=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)||Vt.get(l))&&!i){Vt.set(e,!0);for(var n=[],o=function(e,t){return pt(function(e,t){var l=-1,i=44;do{switch(ut(i)){case 0:38===i&&12===st()&&(t[l]=1),e[l]+=Mt(et-1,t,l);break;case 2:e[l]+=bt(i);break;case 4:if(44===i){e[++l]=58===st()?"&\f":"",t[l]=e[l].length;break}default:e[l]+=Ue(i)}}while(i=rt());return e}(dt(e),t))}(t,n),r=l.props,s=0,a=0;s6)switch($e(e,t+1)){case 109:if(45!==$e(e,t+4))break;case 102:return qe(e,/(.+:)(.+)-([^]+)/,"$1"+kt+"$2-$3$1"+_t+(108==$e(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ge(e,"stretch")?Dt(qe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==$e(e,t+1))break;case 6444:switch($e(e,Ze(e)-3-(~Ge(e,"!important")&&10))){case 107:return qe(e,":",":"+kt)+e;case 101:return qe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+kt+(45===$e(e,14)?"inline-":"")+"box$3$1"+kt+"$2$3$1"+gt+"$2box$3")+e}break;case 5936:switch($e(e,t+11)){case 114:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return kt+e+gt+e+e}return e}var Lt=[function(e,t,l,i){if(e.length>-1&&!e.return)switch(e.type){case wt:e.return=Dt(e.value,e.length);break;case Ct:return Ot([nt(e,{value:qe(e.value,"@","@"+kt)})],i);case St: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 Ot([nt(e,{props:[qe(t,/:(read-\w+)/,":"+_t+"$1")]})],i);case"::placeholder":return Ot([nt(e,{props:[qe(t,/:(plac\w+)/,":"+kt+"input-$1")]}),nt(e,{props:[qe(t,/:(plac\w+)/,":"+_t+"$1")]}),nt(e,{props:[qe(t,/:(plac\w+)/,gt+"input-$1")]})],i)}return""}))}}];const Ht=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,n,o=e.stylisPlugins||Lt,r={},s=[];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,n-=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(n){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)},jt={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};var zt=/[A-Z]|^ms/g,qt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Gt=function(e){return 45===e.charCodeAt(1)},$t=function(e){return null!=e&&"boolean"!=typeof e},Wt=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Gt(l=e)?l:l.replace(zt,"-$&").toLowerCase()),t[e];var l}}(),Zt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(qt,(function(e,t,l){return Xt={name:t,styles:l,next:Xt},t}))}return 1===jt[e]||Gt(e)||"number"!=typeof t||0===t?t:t+"px"};function Yt(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 Xt={name:l.name,styles:l.styles,next:Xt},l.name;if(void 0!==l.styles){var i=l.next;if(void 0!==i)for(;void 0!==i;)Xt={name:i.name,styles:i.styles,next:Xt},i=i.next;return l.styles+";"}return function(e,t,l){var i="";if(Array.isArray(l))for(var n=0;ne.brand+"/"+e.version)).join(" "),vl):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const kl=Math.round;function El(e){return yl(e)?e:e.contextElement}const Sl={x:1,y:1};function wl(e){const t=El(e);if(!fl(t))return Sl;const l=t.getBoundingClientRect(),{width:i,height:n,fallback:o}=function(e){const t=pl(e);let l=parseFloat(t.width),i=parseFloat(t.height);const n=fl(e),o=n?e.offsetWidth:l,r=n?e.offsetHeight:i,s=kl(l)!==o||kl(i)!==r;return s&&(l=o,i=r),{width:l,height:i,fallback:s}}(t);let r=(o?kl(l.width):l.width)/i,s=(o?kl(l.height):l.height)/n;return r&&Number.isFinite(r)||(r=1),s&&Number.isFinite(s)||(s=1),{x:r,y:s}}function Cl(e,t,l,i){var n,o;void 0===t&&(t=!1),void 0===l&&(l=!1);const r=e.getBoundingClientRect(),s=El(e);let a=Sl;t&&(i?yl(i)&&(a=wl(i)):a=wl(e));const c=s?dl(s):window,u=_l()&&l;let d=(r.left+(u&&(null==(n=c.visualViewport)?void 0:n.offsetLeft)||0))/a.x,p=(r.top+(u&&(null==(o=c.visualViewport)?void 0:o.offsetTop)||0))/a.y,b=r.width/a.x,m=r.height/a.y;if(s){const e=dl(s),t=i&&yl(i)?dl(i):i;let l=e.frameElement;for(;l&&i&&t!==e;){const e=wl(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,m*=e.y,d+=t.x,p+=t.y,l=dl(l).frameElement}}return v={width:b,height:m,x:d,y:p},{...v,top:v.y,left:v.x,right:v.x+v.width,bottom:v.y+v.height};var v}function Ol(e){if("html"===ml(e))return e;const t=e.assignedSlot||e.parentNode||hl(e)&&e.host||function(e){return((bl(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return hl(t)?t.host:t}function xl(e){const t=Ol(e);return function(e){return["html","body","#document"].includes(ml(e))}(t)?t.ownerDocument.body:fl(t)&&gl(t)?t:xl(t)}function Tl(e,t){var l;void 0===t&&(t=[]);const i=xl(e),n=i===(null==(l=e.ownerDocument)?void 0:l.body),o=dl(i);return n?t.concat(o,o.visualViewport||[],gl(i)?i:[]):t.concat(i,Tl(i))}const Pl=Re.useLayoutEffect;var Nl=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Rl=function(){};function Al(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Ml(e,t){for(var l=arguments.length,i=new Array(l>2?l-2:0),n=2;n-1}function Ll(e){return Dl(e)?window.pageYOffset:e.scrollTop}function Hl(e,t){Dl(e)?window.scrollTo(0,t):e.scrollTop=t}function Bl(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,n=Ll(e),o=t-n,r=0;!function t(){var s,a=(s=r+=10,o*((s=s/l-1)*s*s+1)+n);Hl(e,a),rl.bottom?Hl(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):i.top-n=m)return{placement:"bottom",maxHeight:t};if(w>=m&&!r)return o&&Bl(a,C,x),{placement:"bottom",maxHeight:t};if(!r&&w>=i||r&&E>=i)return o&&Bl(a,C,x),{placement:"bottom",maxHeight:r?E-g:w-g};if("auto"===n||r){var T=t,P=r?k:S;return P>=i&&(T=Math.min(P-g-s,t)),{placement:"top",maxHeight:T}}if("bottom"===n)return o&&Hl(a,C),{placement:"bottom",maxHeight:t};break;case"top":if(k>=m)return{placement:"top",maxHeight:t};if(S>=m&&!r)return o&&Bl(a,O,x),{placement:"top",maxHeight:t};if(!r&&S>=i||r&&k>=i){var N=t;return(!r&&S>=i||r&&k>=i)&&(N=r?k-_:S-_),o&&Bl(a,O,x),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return c}({maxHeight:i,menuEl:e,minHeight:l,placement:n,shouldScroll:r&&!t,isFixedPosition:t,controlHeight:f});p(s.maxHeight),v(s.placement),null==a||a(s.placement)}}),[i,n,o,r,l,a,f]),t({ref:c,placerProps:Oe(Oe({},e),{},{placement:m||Yl(n),maxHeight:d})})},Ql=function(e,t){var l=e.theme,i=l.spacing.baseUnit,n=l.colors;return Oe({textAlign:"center"},t?{}:{color:n.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},Jl=Ql,ei=Ql,ti=function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),l)};ti.defaultProps={children:"No options"};var li=function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),l)};li.defaultProps={children:"Loading..."};var ii,ni,oi,ri=["size"],si={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ai=function(t){var l=t.size,i=Ne(t,ri);return al("svg",e({height:l,width:l,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:si},i))},ci=function(t){return al(ai,e({size:20},t),al("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"}))},ui=function(t){return al(ai,e({size:20},t),al("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"}))},di=function(e,t){var l=e.isFocused,i=e.theme,n=i.spacing.baseUnit,o=i.colors;return Oe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:l?o.neutral60:o.neutral20,padding:2*n,":hover":{color:l?o.neutral80:o.neutral40}})},pi=di,bi=di,mi=function(){var e=cl.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_"}}}(ii||(ni=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],oi||(oi=ni.slice(0)),ii=Object.freeze(Object.defineProperties(ni,{raw:{value:Object.freeze(oi)}})))),vi=function(e){var t=e.delay,l=e.offset;return al("span",{css:cl({animation:"".concat(mi," 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"},"","")})},fi=function(t){var l=t.innerProps,i=t.isRtl;return al("div",e({},Il(t,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),l),al(vi,{delay:0,offset:i}),al(vi,{delay:160,offset:!0}),al(vi,{delay:320,offset:!i}))};fi.defaultProps={size:4};var yi=["data"],hi=["innerRef","isDisabled","isHidden","inputClassName"],gi={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},_i={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Oe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},gi)},ki=function(e){return Oe({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},gi)},Ei=function(e){var t=e.children,l=e.innerProps;return al("div",l,t)},Si={ClearIndicator:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),l||al(ci,null))},Control:function(t){var l=t.children,i=t.isDisabled,n=t.isFocused,o=t.innerRef,r=t.innerProps,s=t.menuIsOpen;return al("div",e({ref:o},Il(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":n,"control--menu-is-open":s}),r),l)},DropdownIndicator:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),l||al(ui,null))},DownChevron:ui,CrossIcon:ci,Group:function(t){var l=t.children,i=t.cx,n=t.getStyles,o=t.getClassNames,r=t.Heading,s=t.headingProps,a=t.innerProps,c=t.label,u=t.theme,d=t.selectProps;return al("div",e({},Il(t,"group",{group:!0}),a),al(r,e({},s,{selectProps:d,theme:u,getStyles:n,getClassNames:o,cx:i}),c),al("div",null,l))},GroupHeading:function(t){var l=Fl(t);l.data;var i=Ne(l,yi);return al("div",e({},Il(t,"groupHeading",{"group-heading":!0}),i))},IndicatorsContainer:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"indicatorsContainer",{indicators:!0}),i),l)},IndicatorSeparator:function(t){var l=t.innerProps;return al("span",e({},l,Il(t,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(t){var l=t.cx,i=t.value,n=Fl(t),o=n.innerRef,r=n.isDisabled,s=n.isHidden,a=n.inputClassName,c=Ne(n,hi);return al("div",e({},Il(t,"input",{"input-container":!0}),{"data-value":i||""}),al("input",e({className:l({input:!0},a),ref:o,style:ki(s),disabled:r},c)))},LoadingIndicator:fi,Menu:function(t){var l=t.children,i=t.innerRef,n=t.innerProps;return al("div",e({},Il(t,"menu",{menu:!0}),{ref:i},n),l)},MenuList:function(t){var l=t.children,i=t.innerProps,n=t.innerRef,o=t.isMulti;return al("div",e({},Il(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:n},i),l)},MenuPortal:function(t){var l=t.appendTo,i=t.children,n=t.controlElement,o=t.innerProps,r=t.menuPlacement,s=t.menuPosition,a=(0,Re.useRef)(null),c=(0,Re.useRef)(null),u=Pe((0,Re.useState)(Yl(r)),2),d=u[0],p=u[1],b=(0,Re.useMemo)((function(){return{setPortalPlacement:p}}),[]),m=Pe((0,Re.useState)(null),2),v=m[0],f=m[1],y=(0,Re.useCallback)((function(){if(n){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}}(n),t="fixed"===s?0:window.pageYOffset,l=e[d]+t;l===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||f({offset:l,rect:e})}}),[n,s,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);Pl((function(){y()}),[y]);var h=(0,Re.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),n&&a.current&&(c.current=function(e,t,l,i){void 0===i&&(i={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r=!0,animationFrame:s=!1}=i,a=n&&!s,c=a||o?[...yl(e)?Tl(e):e.contextElement?Tl(e.contextElement):[],...Tl(t)]:[];c.forEach((e=>{a&&e.addEventListener("scroll",l,{passive:!0}),o&&e.addEventListener("resize",l)}));let u,d=null;r&&(d=new ResizeObserver((()=>{l()})),yl(e)&&!s&&d.observe(e),yl(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t));let p=s?Cl(e):null;return s&&function t(){const i=Cl(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=>{a&&e.removeEventListener("scroll",l),o&&e.removeEventListener("resize",l)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(u)}}(n,a.current,y,{elementResize:"ResizeObserver"in window}))}),[n,y]);Pl((function(){h()}),[h]);var g=(0,Re.useCallback)((function(e){a.current=e,h()}),[h]);if(!l&&"fixed"!==s||!v)return null;var _=al("div",e({ref:g},Il(Oe(Oe({},t),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),i);return al(Xl.Provider,{value:b},l?(0,ul.createPortal)(_,l):_)},LoadingMessage:li,NoOptionsMessage:ti,MultiValue:function(e){var t=e.children,l=e.components,i=e.data,n=e.innerProps,o=e.isDisabled,r=e.removeProps,s=e.selectProps,a=l.Container,c=l.Label,u=l.Remove;return al(a,{data:i,innerProps:Oe(Oe({},Il(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),n),selectProps:s},al(c,{data:i,innerProps:Oe({},Il(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),al(u,{data:i,innerProps:Oe(Oe({},Il(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},r),selectProps:s}))},MultiValueContainer:Ei,MultiValueLabel:Ei,MultiValueRemove:function(t){var l=t.children,i=t.innerProps;return al("div",e({role:"button"},i),l||al(ci,{size:14}))},Option:function(t){var l=t.children,i=t.isDisabled,n=t.isFocused,o=t.isSelected,r=t.innerRef,s=t.innerProps;return al("div",e({},Il(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":n,"option--is-selected":o}),{ref:r,"aria-disabled":i},s),l)},Placeholder:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"placeholder",{placeholder:!0}),i),l)},SelectContainer:function(t){var l=t.children,i=t.innerProps,n=t.isDisabled,o=t.isRtl;return al("div",e({},Il(t,"container",{"--is-disabled":n,"--is-rtl":o}),i),l)},SingleValue:function(t){var l=t.children,i=t.isDisabled,n=t.innerProps;return al("div",e({},Il(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),n),l)},ValueContainer:function(t){var l=t.children,i=t.innerProps,n=t.isMulti,o=t.hasValue;return al("div",e({},Il(t,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":o}),i),l)}},wi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ci(e,t){if(e.length!==t.length)return!1;for(var l=0;l1?"s":""," ").concat(n.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,l=e.focused,i=e.options,n=e.label,o=void 0===n?"":n,r=e.selectValue,s=e.isDisabled,a=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(o," focused, ").concat(c(r,l),".");if("menu"===t){var u=s?" disabled":"",d="".concat(a?"selected":"focused").concat(u);return"option ".concat(o," ").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:"",".")}},Pi=function(e){var t=e.ariaSelection,l=e.focusedOption,i=e.focusedValue,n=e.focusableOptions,o=e.isFocused,r=e.selectValue,s=e.selectProps,a=e.id,c=s.ariaLiveMessages,u=s.getOptionLabel,d=s.inputValue,p=s.isMulti,b=s.isOptionDisabled,m=s.isSearchable,v=s.menuIsOpen,f=s.options,y=s.screenReaderStatus,h=s.tabSelectsValue,g=s["aria-label"],_=s["aria-live"],k=(0,Re.useMemo)((function(){return Oe(Oe({},Ti),c||{})}),[c]),E=(0,Re.useMemo)((function(){var e,l="";if(t&&k.onChange){var i=t.option,n=t.options,o=t.removedValue,s=t.removedValues,a=t.value,c=o||i||(e=a,Array.isArray(e)?null:e),d=c?u(c):"",p=n||s||void 0,m=p?p.map(u):[],v=Oe({isDisabled:c&&b(c,r),label:d,labels:m},t);l=k.onChange(v)}return l}),[t,k,b,r,u]),S=(0,Re.useMemo)((function(){var e="",t=l||i,o=!!(l&&r&&r.includes(l));if(t&&k.onFocus){var s={focused:t,label:u(t),isDisabled:b(t,r),isSelected:o,options:n,context:t===l?"menu":"value",selectValue:r};e=k.onFocus(s)}return e}),[l,i,u,b,k,n,r]),w=(0,Re.useMemo)((function(){var e="";if(v&&f.length&&k.onFilter){var t=y({count:n.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[n,d,v,k,f,y]),C=(0,Re.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":v?"menu":"input";e=k.guidance({"aria-label":g,context:t,isDisabled:l&&b(l,r),isMulti:p,isSearchable:m,tabSelectsValue:h})}return e}),[g,l,i,p,b,m,v,k,r,h]),O="".concat(S," ").concat(w," ").concat(C),x=al(Re.Fragment,null,al("span",{id:"aria-selection"},E),al("span",{id:"aria-context"},O)),T="initial-input-focus"===(null==t?void 0:t.action);return al(Re.Fragment,null,al(xi,{id:a},T&&x),al(xi,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},o&&!T&&x))},Ni=[{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("["+Ni.map((function(e){return e.letters})).join("")+"]","g"),Ai={},Mi=0;Mi1?t-1:0),i=1;i0,v=d-p-u,f=!1;v>t&&r.current&&(i&&i(e),r.current=!1),m&&s.current&&(o&&o(e),s.current=!1),m&&t>v?(l&&!r.current&&l(e),b.scrollTop=d,f=!0,r.current=!0):!m&&-t>u&&(n&&!s.current&&n(e),b.scrollTop=0,f=!0,s.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[l,i,n,o]),d=(0,Re.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,Re.useCallback)((function(e){a.current=e.changedTouches[0].clientY}),[]),b=(0,Re.useCallback)((function(e){var t=a.current-e.changedTouches[0].clientY;u(e,t)}),[u]),m=(0,Re.useCallback)((function(e){if(e){var t=!!$l&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",b,t)}}),[b,p,d]),v=(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 m(e),function(){v(e)}}}),[t,m,v]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),o=function(e){var t=e.isEnabled,l=e.accountForScrollbars,i=void 0===l||l,n=(0,Re.useRef)({}),o=(0,Re.useRef)(null),r=(0,Re.useCallback)((function(e){if(Zi){var t=document.body,l=t&&t.style;if(i&&ji.forEach((function(e){var t=l&&l[e];n.current[e]=t})),i&&Yi<1){var o=parseInt(n.current.paddingRight,10)||0,r=document.body?document.body.clientWidth:0,s=window.innerWidth-r+o||0;Object.keys(zi).forEach((function(e){var t=zi[e];l&&(l[e]=t)})),l&&(l.paddingRight="".concat(s,"px"))}t&&Wi()&&(t.addEventListener("touchmove",qi,Xi),e&&(e.addEventListener("touchstart",$i,Xi),e.addEventListener("touchmove",Gi,Xi))),Yi+=1}}),[i]),s=(0,Re.useCallback)((function(e){if(Zi){var t=document.body,l=t&&t.style;Yi=Math.max(Yi-1,0),i&&Yi<1&&ji.forEach((function(e){var t=n.current[e];l&&(l[e]=t)})),t&&Wi()&&(t.removeEventListener("touchmove",qi,Xi),e&&(e.removeEventListener("touchstart",$i,Xi),e.removeEventListener("touchmove",Gi,Xi)))}}),[i]);return(0,Re.useEffect)((function(){if(t){var e=o.current;return r(e),function(){s(e)}}}),[t,r,s]),function(e){o.current=e}}({isEnabled:l});return al(Re.Fragment,null,l&&al("div",{onClick:Ki,css:Qi}),t((function(e){n(e),o(e)})))}var en={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},tn=function(e){var t=e.name,l=e.onFocus;return al("input",{required:!0,name:t,tabIndex:-1,onFocus:l,css:en,value:"",onChange:function(){}})},ln={clearIndicator:bi,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,n=e.theme,o=n.colors,r=n.borderRadius;return Oe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:n.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:l?o.neutral5:o.neutral0,borderColor:l?o.neutral10:i?o.primary:o.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},dropdownIndicator:pi,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,n=l.spacing;return Oe({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*n.baseUnit,paddingRight:3*n.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,n=i.spacing.baseUnit,o=i.colors;return Oe({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:l?o.neutral10:o.neutral20,marginBottom:2*n,marginTop:2*n})},input:function(e,t){var l=e.isDisabled,i=e.value,n=e.theme,o=n.spacing,r=n.colors;return Oe(Oe({visibility:l?"hidden":"visible",transform:i?"translateZ(0)":""},_i),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:r.neutral80})},loadingIndicator:function(e,t){var l=e.isFocused,i=e.size,n=e.theme,o=n.colors,r=n.spacing.baseUnit;return Oe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:l?o.neutral60:o.neutral20,padding:2*r})},loadingMessage:ei,menu:function(e,t){var l,i=e.placement,n=e.theme,o=n.borderRadius,r=n.spacing,s=n.colors;return Oe((we(l={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),we(l,"position","absolute"),we(l,"width","100%"),we(l,"zIndex",1),l),t?{}:{backgroundColor:s.neutral0,borderRadius:o,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 l=e.maxHeight,i=e.theme.spacing.baseUnit;return Oe({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,n=l.borderRadius,o=l.colors;return Oe({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:n/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var l=e.theme,i=l.borderRadius,n=l.colors,o=e.cropWithEllipsis;return Oe({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:n.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var l=e.theme,i=l.spacing,n=l.borderRadius,o=l.colors,r=e.isFocused;return Oe({alignItems:"center",display:"flex"},t?{}:{borderRadius:n/2,backgroundColor:r?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:Jl,option:function(e,t){var l=e.isDisabled,i=e.isFocused,n=e.isSelected,o=e.theme,r=o.spacing,s=o.colors;return Oe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:n?s.primary:i?s.primary25:"transparent",color:l?s.neutral20:n?s.neutral0:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),":active":{backgroundColor:l?void 0:n?s.primary:s.primary50}})},placeholder:function(e,t){var l=e.theme,i=l.spacing,n=l.colors;return Oe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:n.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var l=e.isDisabled,i=e.theme,n=i.spacing,o=i.colors;return Oe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:l?o.neutral40:o.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},valueContainer:function(e,t){var l=e.theme.spacing,i=e.isMulti,n=e.hasValue,o=e.selectProps.controlShouldRenderValue;return Oe({alignItems:"center",display:i&&n&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(l.baseUnit/2,"px ").concat(2*l.baseUnit,"px")})}},nn={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}},on={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:jl(),captureMenuScroll:!jl(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var l=Oe({ignoreCase:!0,ignoreAccents:!0,stringify:Hi,trim:!0,matchFrom:"any"},undefined),i=l.ignoreCase,n=l.ignoreAccents,o=l.stringify,r=l.trim,s=l.matchFrom,a=r?Li(t):t,c=r?Li(o(e)):o(e);return i&&(a=a.toLowerCase(),c=c.toLowerCase()),n&&(a=Di(a),c=Ii(c)),"start"===s?c.substr(0,a.length)===a:c.indexOf(a)>-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 rn(e,t,l,i){return{type:"option",data:t,isDisabled:pn(e,t,l),isSelected:bn(e,t,l),label:un(e,t),value:dn(e,t),index:i}}function sn(e,t){return e.options.map((function(l,i){if("options"in l){var n=l.options.map((function(l,i){return rn(e,l,t,i)})).filter((function(t){return cn(e,t)}));return n.length>0?{type:"group",data:l,options:n,index:i}:void 0}var o=rn(e,l,t,i);return cn(e,o)?o:void 0})).filter(Wl)}function an(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Le(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function cn(e,t){var l=e.inputValue,i=void 0===l?"":l,n=t.data,o=t.isSelected,r=t.label,s=t.value;return(!vn(e)||!o)&&mn(e,{label:r,value:s,data:n},i)}var un=function(e,t){return e.getOptionLabel(t)},dn=function(e,t){return e.getOptionValue(t)};function pn(e,t,l){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,l)}function bn(e,t,l){if(l.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,l);var i=dn(e,t);return l.some((function(t){return dn(e,t)===i}))}function mn(e,t,l){return!e.filterOption||e.filterOption(t,l)}var vn=function(e){var t=e.hideSelectedOptions,l=e.isMulti;return void 0===t?l:t},fn=1,yn=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&&Ve(e,t)}(r,t);var l,i,n,o=De(r);function r(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(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,l){var i=t.props,n=i.onChange,o=i.name;l.name=o,t.ariaOnChange(e,l),n(e,l)},t.setValue=function(e,l,i){var n=t.props,o=n.closeMenuOnSelect,r=n.isMulti,s=n.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(t.setState({inputIsHiddenAfterUpdate:!r}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:l,option:i})},t.selectOption=function(e){var l=t.props,i=l.blurInputOnSelect,n=l.isMulti,o=l.name,r=t.state.selectValue,s=n&&t.isOptionSelected(e,r),a=t.isOptionDisabled(e,r);if(s){var c=t.getOptionValue(e);t.setValue(r.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(a)return void t.ariaOnChange(e,{action:"select-option",option:e,name:o});n?t.setValue([].concat(Le(r),[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,n=t.getOptionValue(e),o=i.filter((function(e){return t.getOptionValue(e)!==n})),r=Zl(l,o,o[0]||null);t.onChange(r,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(Zl(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],n=l.slice(0,l.length-1),o=Zl(e,n,n[0]||null);t.onChange(o,{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||o>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 vn(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var l=t.props,i=l.isMulti,n=l.backspaceRemovesValue,o=l.escapeClearsValue,r=l.inputValue,s=l.isClearable,a=l.isDisabled,c=l.menuIsOpen,u=l.onKeyDown,d=l.tabSelectsValue,p=l.openMenuOnFocus,b=t.state,m=b.focusedOption,v=b.focusedValue,f=b.selectValue;if(!(a||"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(v)t.removeValue(v);else{if(!n)return;i?t.popValue():s&&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()):s&&o&&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||++fn),t.state.selectValue=Vl(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=r,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&&Ul(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,l=t.isDisabled,i=t.menuIsOpen,n=this.state.isFocused;(n&&!l&&e.isDisabled||n&&i&&!e.menuIsOpen)&&this.focusInput(),n&&l&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):n||l||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Ul(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,n=l.isFocused,o=this.buildFocusableOptions(),r="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(i[0]);s>-1&&(r=s)}this.scrollToFocusedOptionOnUpdate=!(n&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[r]},(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 n=l.indexOf(i);i||(n=-1);var o=l.length-1,r=-1;if(l.length){switch(e){case"previous":r=0===n?0:-1===n?o:n-1;break;case"next":n>-1&&n0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,l=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var n=0,o=i.indexOf(l);l||(o=-1),"up"===e?n=o>0?o-1:i.length-1:"down"===e?n=(o+1)%i.length:"pageup"===e?(n=o-t)<0&&(n=0):"pagedown"===e?(n=o+t)>i.length-1&&(n=i.length-1):"last"===e&&(n=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[n],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(nn):Oe(Oe({},nn),this.props.theme):nn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,l=this.getStyles,i=this.getClassNames,n=this.getValue,o=this.selectOption,r=this.setValue,s=this.props,a=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:l,getClassNames:i,getValue:n,hasValue:this.hasValue(),isMulti:a,isRtl:c,options:u,selectOption:o,selectProps:s,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,l=e.isMulti;return void 0===t?l:t}},{key:"isOptionDisabled",value:function(e,t){return pn(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return bn(this.props,e,t)}},{key:"filterOption",value:function(e,t){return mn(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,n=t.inputId,o=t.inputValue,r=t.tabIndex,s=t.form,a=t.menuIsOpen,c=t.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,b=d.ariaSelection,m=this.commonProps,v=n||this.getElementId("input"),f=Oe(Oe(Oe({"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":c,role:"combobox"},a&&{"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({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:l,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:s,type:"text",value:o},f)):Re.createElement(Ui,e({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Rl,onFocus:this.onInputFocus,disabled:l,tabIndex:r,inputMode:"none",form:s,value:""},f))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,l=this.getComponents(),i=l.MultiValue,n=l.MultiValueContainer,o=l.MultiValueLabel,r=l.MultiValueRemove,s=l.SingleValue,a=l.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,b=u.isMulti,m=u.inputValue,v=u.placeholder,f=this.state,y=f.selectValue,h=f.focusedValue,g=f.isFocused;if(!this.hasValue()||!d)return m?null:Re.createElement(a,e({},c,{key:"placeholder",isDisabled:p,isFocused:g,innerProps:{id:this.getElementId("placeholder")}}),v);if(b)return y.map((function(l,s){var a=l===h,u="".concat(t.getOptionLabel(l),"-").concat(t.getOptionValue(l));return Re.createElement(i,e({},c,{components:{Container:n,Label:o,Remove:r},isFocused:a,isDisabled:p,key:u,index:s,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(m)return null;var _=y[0];return Re.createElement(s,e({},c,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,l=this.commonProps,i=this.props,n=i.isDisabled,o=i.isLoading,r=this.state.isFocused;if(!this.isClearable()||!t||n||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Re.createElement(t,e({},l,{innerProps:s,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,l=this.commonProps,i=this.props,n=i.isDisabled,o=i.isLoading,r=this.state.isFocused;return t&&o?Re.createElement(t,e({},l,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),l=t.DropdownIndicator,i=t.IndicatorSeparator;if(!l||!i)return null;var n=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return Re.createElement(i,e({},n,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var l=this.commonProps,i=this.props.isDisabled,n=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Re.createElement(t,e({},l,{innerProps:o,isDisabled:i,isFocused:n}))}},{key:"renderMenu",value:function(){var t=this,l=this.getComponents(),i=l.Group,n=l.GroupHeading,o=l.Menu,r=l.MenuList,s=l.MenuPortal,a=l.LoadingMessage,c=l.NoOptionsMessage,u=l.Option,d=this.commonProps,p=this.state.focusedOption,b=this.props,m=b.captureMenuScroll,v=b.inputValue,f=b.isLoading,y=b.loadingMessage,h=b.minMenuHeight,g=b.maxMenuHeight,_=b.menuIsOpen,k=b.menuPlacement,E=b.menuPosition,S=b.menuPortalTarget,w=b.menuShouldBlockScroll,C=b.menuShouldScrollIntoView,O=b.noOptionsMessage,x=b.onMenuScrollToTop,T=b.onMenuScrollToBottom;if(!_)return null;var P,N=function(l,i){var n=l.type,o=l.data,r=l.isDisabled,s=l.isSelected,a=l.label,c=l.value,b=p===o,m=r?void 0:function(){return t.onOptionHover(o)},v=r?void 0:function(){return t.selectOption(o)},f="".concat(t.getElementId("option"),"-").concat(i),y={id:f,onClick:v,onMouseMove:m,onMouseOver:m,tabIndex:-1};return Re.createElement(u,e({},d,{innerProps:y,data:o,isDisabled:r,isSelected:s,key:f,label:a,type:n,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 o=l.data,r=l.options,s=l.index,a="".concat(t.getElementId("group"),"-").concat(s),c="".concat(a,"-heading");return Re.createElement(i,e({},d,{key:a,data:o,options:r,Heading:n,headingProps:{id:c,data:l.data},label:t.formatGroupLabel(l.data)}),l.options.map((function(e){return N(e,"".concat(s,"-").concat(e.index))})))}if("option"===l.type)return N(l,"".concat(l.index))}));else if(f){var R=y({inputValue:v});if(null===R)return null;P=Re.createElement(a,d,R)}else{var A=O({inputValue:v});if(null===A)return null;P=Re.createElement(c,d,A)}var M={minMenuHeight:h,maxMenuHeight:g,menuPlacement:k,menuPosition:E,menuShouldScrollIntoView:C},V=Re.createElement(Kl,e({},d,M),(function(l){var i=l.ref,n=l.placerProps,s=n.placement,a=n.maxHeight;return Re.createElement(o,e({},d,M,{innerRef:i,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:f,placement:s}),Re.createElement(Ji,{captureEnabled:m,onTopArrive:x,onBottomArrive:T,lockEnabled:w},(function(l){return Re.createElement(r,e({},d,{innerRef:function(e){t.getMenuListRef(e),l(e)},isLoading:f,maxHeight:a,focusedOption:p}),P)})))}));return S||"fixed"===E?Re.createElement(s,e({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:k,menuPosition:E}),V):V}},{key:"renderFormField",value:function(){var e=this,t=this.props,l=t.delimiter,i=t.isDisabled,n=t.isMulti,o=t.name,r=t.required,s=this.state.selectValue;if(o&&!i){if(r&&!this.hasValue())return Re.createElement(tn,{name:o,onFocus:this.onValueInputFocus});if(n){if(l){var a=s.map((function(t){return e.getOptionValue(t)})).join(l);return Re.createElement("input",{name:o,type:"hidden",value:a})}var c=s.length>0?s.map((function(t,l){return Re.createElement("input",{key:"i-".concat(l),name:o,type:"hidden",value:e.getOptionValue(t)})})):Re.createElement("input",{name:o,type:"hidden",value:""});return Re.createElement("div",null,c)}var u=s[0]?this.getOptionValue(s[0]):"";return Re.createElement("input",{name:o,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,l=this.state,i=l.ariaSelection,n=l.focusedOption,o=l.focusedValue,r=l.isFocused,s=l.selectValue,a=this.getFocusableOptions();return Re.createElement(Pi,e({},t,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:n,focusedValue:o,isFocused:r,selectValue:s,focusableOptions:a}))}},{key:"render",value:function(){var t=this.getComponents(),l=t.Control,i=t.IndicatorsContainer,n=t.SelectContainer,o=t.ValueContainer,r=this.props,s=r.className,a=r.id,c=r.isDisabled,u=r.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return Re.createElement(n,e({},p,{className:s,innerProps:{id:a,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(o,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())}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){var l=t.prevProps,i=t.clearFocusValueOnUpdate,n=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,r=t.isFocused,s=t.prevWasFocused,a=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,b=Vl(c),m={};if(l&&(c!==l.value||a!==l.options||u!==l.menuIsOpen||d!==l.inputValue)){var v=u?function(e,t){return an(sn(e,t))}(e,b):[],f=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,v);m={selectValue:b,focusedOption:y,focusedValue:f,clearFocusValueOnUpdate:!1}}var h=null!=n&&e!==l?{inputIsHidden:n,inputIsHiddenAfterUpdate:void 0}:{},g=o,_=r&&s;return r&&!_&&(g={value:Zl(p,b,b[0]||null),options:b,action:"initial-input-focus"},_=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(g=null),Oe(Oe(Oe({},m),h),{},{prevProps:e,ariaSelection:g,prevWasFocused:_})}}],i&&Me(l.prototype,i),n&&Me(l,n),Object.defineProperty(l,"prototype",{writable:!1}),r}(Re.Component);yn.defaultProps=on;var hn=(0,Re.forwardRef)((function(t,l){var i=function(e){var t=e.defaultInputValue,l=void 0===t?"":t,i=e.defaultMenuIsOpen,n=void 0!==i&&i,o=e.defaultValue,r=void 0===o?null:o,s=e.inputValue,a=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,b=e.value,m=Ne(e,Ae),v=Pe((0,Re.useState)(void 0!==s?s:l),2),f=v[0],y=v[1],h=Pe((0,Re.useState)(void 0!==a?a:n),2),g=h[0],_=h[1],k=Pe((0,Re.useState)(void 0!==b?b:r),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)),y(void 0!==l?l:e)}),[u]),O=(0,Re.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),x=(0,Re.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),T=void 0!==s?s:f,P=void 0!==a?a:g,N=void 0!==b?b:E;return Oe(Oe({},m),{},{inputValue:T,menuIsOpen:P,onChange:w,onInputChange:C,onMenuClose:x,onMenuOpen:O,value:N})}(t);return Re.createElement(yn,e({ref:l},i))}));const gn=hn,kn=window.wp.htmlEntities,En={context:"view",orderby:"name",order:"asc",per_page:-1,who:"authors",_fields:"id,name"};function Sn(e){const{className:l,fieldType:i,fieldName:r,handleRuleChange:s,triggerReset:a,value:c}=e,{authors:u,loading:d}=(0,o.useSelect)((e=>{const{getUsers:t,isResolving:l}=e("core");return{authors:t(En),loading:l("getUsers",[En])}}),[]),p=(0,t.useMemo)((()=>(null!=u?u:[]).map((e=>({value:e.id,label:(0,kn.decodeEntities)(e.name)})))),[u]),m=p.filter((e=>c.includes(e.value)));return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:m,options:p,placeholder:(0,n.__)("Select Author…","block-visibility"),onChange:e=>s(e,"multiSelect",i,r,a),isLoading:d,isMulti:!0})}const wn={context:"view",orderby:"name",order:"asc",per_page:-1,_fields:"id,name"};function Cn(e){const{className:l,fieldType:i,fieldName:n,handleRuleChange:r,placeholder:s,taxonomySlug:a,triggerReset:c,value:u}=e,{availableTerms:d,loading:p}=(0,o.useSelect)((e=>{const{getEntityRecords:t,isResolving:l}=e("core");return{availableTerms:t("taxonomy",a,wn),loading:l("getEntityRecords",["taxonomy",a,wn])}}),[a]),m=(0,t.useMemo)((()=>(null!=d?d:[]).map((e=>({value:e.id,label:(0,kn.decodeEntities)(e.name)})))),[d]),v=m.filter((e=>u.includes(e.value)));return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:v,options:m,placeholder:s,onChange:e=>r(e,"multiSelect",i,n,c),isLoading:p,isMulti:!0})}function On(e){const t=e?.title?.raw?(0,kn.decodeEntities)(e.title.rendered):`${(0,n.__)("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 xn(e){const{className:l,fieldType:r,fieldName:s,handleRuleChange:a,placeholder:c,postType:u,triggerReset:d,value:p,valueType:m,isMulti:v}=e,[f,y]=(0,t.useState)(!1),[h,g]=(0,t.useState)(!1),{availablePosts:_,loadingAvailablePosts:k}=(0,o.useSelect)((e=>{const{getPostType:t,getEntityRecords:l,isResolving:n}=e("core"),o=t(u),r=(0,i.get)(o,["hierarchical"],!1),s={orderby:r?"title":"date",order:r?"asc":"desc",per_page:25,status:"publish,draft,private,pending",_fields:"id,title,status"};return h&&(s.search=h),{availablePosts:l("postType",u,s),loadingAvailablePosts:n("getEntityRecords",["postType",u,s])}}),[h]),{savedPosts:E,loadingSavedPosts:S}=(0,o.useSelect)((e=>{if(0!==p.length&&!f){const t={include:p.join(","),per_page:-1,status:"publish,draft,private,pending",_fields:"id,title,status"},{getEntityRecords:l,isResolving:i}=e("core");return{savedPosts:l("postType",u,t),selectedLoading:i("getEntityRecords",["postType",u,t])}}return{savedPosts:[],loadingSavedPosts:!1}})),w=(0,t.useMemo)((()=>(null!=_?_:[]).map((e=>({value:e.id,label:On(e)})))),[_]);let C=[];return C=f||(null!=E?E:[]).map((e=>({value:e.id,label:On(e)}))),(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:C,options:w,onChange:e=>{const t="postSelect"===m?"select":"multiSelect";y(e),a(e,t,r,s,d)},onInputChange:(0,i.debounce)((e=>{(0===e.length||e.length>=3)&&g(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,n.__)("No options found","block-visibility"):(0,n.__)("Enter 3 characters to begin search","block-visibility")},placeholder:c,isLoading:k||S,isMulti:v})}function Tn(l){const{rule:i,fieldType:o,fieldName:r,valueType:s,valueTypeVariant:a,options:c,placeholder:d,handleRuleChange:p,triggerReset:m,isLoading:v,hasGroupedFields:f,hasGroupedOptions:y,dependantFieldValue:h}=l;if(f&&!i.field&&"ruleField"!==o)return null;let g="";var _;if("ruleField"===o)g=null!==(_=i?.field)&&void 0!==_?_:"";else if("subField"===o){var k,E;g=i?.subFields?null!==(k=i.subFields[r])&&void 0!==k?k:"":null!==(E=i?.subField)&&void 0!==E?E:""}else{var S;g=null!==(S=i["operatorField"===o?"operator":"value"])&&void 0!==S?S:""}if("select"===s||"multiSelect"===s){let e="",t=c;if(y){const e=[];c.forEach((t=>{e.push(...t.options)})),t=e}"multiSelect"===s?e=t.filter((e=>g.includes(e.value))):(e=t.filter((e=>e.value===g)),0!==e.length&&(e=e[0])),g=e}const w="field__"+o;if("select"===s||"multiSelect"===s){const e=d||(0,n.__)("Select…","block-visibility");return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",w),classNamePrefix:"react-select",value:g,options:c,placeholder:e,onChange:e=>p(e,s,o,r,m),isMulti:"multiSelect"===s,isLoading:v})}if("date"===s||"dateTime"===s)return(0,t.createElement)(ke,{className:w,value:g,onChange:e=>p(e,s,o,r,m),includeTime:"dateTime"===s});if("toggle"===s)return(0,t.createElement)(u.ToggleControl,{className:w,label:d,checked:g,onChange:()=>p(!g,s,o,r,m)});if("authorsSelect"===s)return(0,t.createElement)(Sn,e({className:w,value:g},l));if("termsSelect"===s){let i;return h&&!a?i=h:a&&(i=a),(0,t.createElement)(Cn,e({key:i,taxonomySlug:i,className:w,value:g},l))}if("postsSelect"===s||"postSelect"===s){let i;return h&&!a?i=h:a&&(i=a),(0,t.createElement)(xn,e({key:i,postType:i,className:w,value:g,valueType:s,isMulti:"postsSelect"===s},l))}return(0,t.createElement)(u.TextControl,{className:w,type:s,min:"number"===s?0:"",value:g,placeholder:d,onChange:e=>p(e,"text",o,r,m),autocomplete:"off"})}function Pn(e){var l,o,r,s;const{rule:a,ruleIndex:c,ruleSet:d,ruleSetIndex:p,ruleSets:m,hideOnRuleSets:v,rulePlaceholder:f,ruleLabel:y,controlName:h,controlAtts:g,setControlAtts:_,groupedFields:k,allFields:E}=e;let S=E.filter((e=>e.value===a.field));k||(S=E.filter((e=>"ruleField"===e.type))),0!==S.length&&(S=S[0]);const w=k?null!==(l=S?.fields)&&void 0!==l?l:[]:E,C=null!==(o=S?.help)&&void 0!==o&&o,O=null!==(r=S?.hasMultipleSubFields)&&void 0!==r&&r,x=null!==(s=S?.hasSimplifiedLayout)&&void 0!==s&&s;let T=y;T||(T=()=>0===c?(0,n.sprintf)( // Translators: Whether the block is hidden or visible. (0,n.__)("%s the block if","block-visibility"),v?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility")):(0,n.__)("And if","block-visibility"));const P=function(e,t,l){let n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];"select"===t?n=e.value:"multiSelect"===t?(n=[],0!==e.length&&e.forEach((e=>{n.push(e.value)}))):n=e;const s=[...m],a=[...d.rules];if("ruleField"===l)a[c]=k?{field:n}:(0,i.assign)({...a[c]},{field:n});else if("subField"===l)a[c]=O?(0,i.assign)({...a[c]},{subFields:{...a[c].subFields,[o]:n}}):(0,i.assign)({...a[c]},{subField:n}),r&&delete a[c].value;else{const e="operatorField"===l?"operator":"value";a[c]=(0,i.assign)({...a[c]},{[e]:n})}s[p]=(0,i.assign)({...d},{rules:a}),_(h,(0,i.assign)({...g},{ruleSets:[...s]}))};return(0,t.createElement)("div",{key:c,className:"rule"},(0,t.createElement)("div",{className:"rule__header"},(0,t.createElement)("span",null,T(c)),d.rules.length>1&&(0,t.createElement)(u.Button,{label:(0,n.__)("Delete Rule","block-visibility"),icon:ge,onClick:()=>(()=>{const e=[...m],t=d.rules.filter(((e,t)=>t!==c));e[p]=(0,i.assign)({...d},{rules:[...t]}),_(h,(0,i.assign)({...g},{ruleSets:[...e]}))})()})),(0,t.createElement)("div",{className:"rule__fields"},(0,t.createElement)("div",{className:b()("fields-container",{"is-simplified":x})},k&&(0,t.createElement)(Tn,{rule:a,fieldType:"ruleField",valueType:"select",options:k,placeholder:null!=f?f:(0,n.__)("Select Rule…","block-visibility"),handleRuleChange:P,hasGroupedOptions:!0}),w.map((e=>{var l,i,n,o,r,s,c,u,d,p;let b=e?.valueType,m=e?.valueTypeVariant,v=e?.options,f=e?.placeholder,y="";const h=e?.conditionalValueTypes;h&&h.forEach((e=>{var t;if(y=null!==(t=a[e.dependencyType])&&void 0!==t?t:"",e.dependencyValues.includes(y)){var l,i,n,o,r;const t=null!==(l=e?.valueTypes)&&void 0!==l?l:[],s=t.filter((e=>e.value===y)),a=t.filter((e=>"default"===e.value));b=null!==(i=s[0]?.valueType)&&void 0!==i?i:a[0]?.valueType,m=null!==(n=s[0]?.valueTypeVariant)&&void 0!==n?n:m,v=null!==(o=s[0]?.options)&&void 0!==o?o:v,f=null!==(r=s[0]?.placeholder)&&void 0!==r?r:f}}));const g=e?.displayConditions;if(g){const e=[];if(g.forEach((t=>{let l;if(O&&"subField"===t.dependencyType){var i,n;const e=null!==(i=a?.subFields)&&void 0!==i?i:[];l=null!==(n=e[t.dependencyName])&&void 0!==n?n:""}else{var o;const e="operatorField"===t.dependencyType?"operator":"subField";l=null!==(o=a[e])&&void 0!==o?o:""}var r;"dynamic"===t.dependencyValues?0!==(null!==(r=t?.options)&&void 0!==r?r:[]).filter((e=>e.value===l)).length&&e.push(!0):t.dependencyValues.includes(l)&&e.push(!0)})),e.length!==g.length)return null}const _=e?.conditionalOptions;return _&&_.forEach((e=>{let t;if(O&&"subField"===e.dependencyType){var l,i;const n=null!==(l=a?.subFields)&&void 0!==l?l:[];t=null!==(i=n[e.dependencyName])&&void 0!==i?i:""}else{var n;t=null!==(n=a[e.dependencyType])&&void 0!==n?n:""}if("dynamic"===e.dependencyValues){var o,r,s;const l=(null!==(o=e?.options)&&void 0!==o?o:[]).filter((e=>e.value===t));v=null!==(r=l[0]?.valueOptions)&&void 0!==r?r:[],f=null!==(s=e?.placeholder)&&void 0!==s?s:""}else e.dependencyValues.includes(t)&&(v=e?.options,f=e?.placeholder)})),(0,t.createElement)(Tn,{key:null!==(l=e?.type)&&void 0!==l?l:"valueField",rule:a,fieldType:null!==(i=e?.type)&&void 0!==i?i:"valueField",fieldName:null!==(n=e?.name)&&void 0!==n?n:"",valueType:null!==(o=b)&&void 0!==o?o:"text",valueTypeVariant:null!==(r=m)&&void 0!==r?r:"",dependantFieldValue:null!==(s=y)&&void 0!==s?s:"",options:null!==(c=v)&&void 0!==c?c:[],handleRuleChange:P,hasGroupedFields:!!k,hasGroupedOptions:null!==(u=e?.hasGroupedOptions)&&void 0!==u&&u,placeholder:null!==(d=f)&&void 0!==d?d:"",isLoading:e?.isLoading,triggerReset:null!==(p=e?.triggerReset)&&void 0!==p&&p})}))),C&&(0,t.createElement)("div",{className:"control-fields-item__help"},S.help)))}function Nn(l){var o,r,s;const{ruleSet:a,ruleSetIndex:c,ruleSets:d,controlName:p,controlAtts:m,setControlAtts:v}=l,f=null!==(o=a?.title)&&void 0!==o?o:"",y=f||(0,n.__)("Rule Set","block-visibility"),h=null===(r=a?.enable)||void 0===r||r,g=null!==(s=a?.rules)&&void 0!==s?s:[];0===g.length&&g.push({field:""});const _=(e,t)=>{const l={...a},n=[...d];l[e]=t,n[c]=l,v(p,(0,i.assign)({...m},{ruleSets:[...n]}))},k=(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("Edit","block-visibility"),icon:ie,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:f,label:(0,n.__)("Rule set title","block-visibility"),placeholder:(0,n.__)("Rule Set","block-visibility"),onChange:e=>_("title",e)}))),E=d.length<=1?(0,n.__)("Clear rule set","block-visibility"):(0,n.__)("Remove rule set","block-visibility"),S=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,n.__)("Options","block-visibility"),icon:$,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>_("enable",!h)},h?(0,n.__)("Disable","block-visibility"):(0,n.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{className:"more-settings__tools-duplicate",onClick:()=>{!function(){const e=[...d,a];v(p,(0,i.assign)({...m},{ruleSets:[...e]}))}(),l()}},(0,n.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=d.filter(((e,t)=>t!==c));v(p,(0,i.assign)({...m},{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,n)=>(0,t.createElement)(Pn,e({key:n,rule:i,ruleIndex:n,ruleSet:a,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=[...a.rules,{field:""}];e[c]=(0,i.assign)({...a},{rules:t}),v(p,(0,i.assign)({...m},{ruleSets:[...e]}))}(),isLink:!0},(0,n.__)("Add rule","block-visibility"))));return h||(w=(0,t.createElement)(u.Disabled,null,w)),(0,t.createElement)("div",{key:c,className:b()("rule-sets__rule-set",{disabled:!h})},(0,t.createElement)("div",{className:"rule-set__header section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,y),k),(0,t.createElement)("div",{className:"section-header__toolbar"},S)),w)}function Rn(l){var o,r,s,a,c,d;const{controlSetAtts:p,enabledControls:b,setControlAtts:m,settings:v,variables:f}=l,y=null!==(o=f?.integrations?.acf?.active)&&void 0!==o&&o;if(!b.some((e=>"acf"===e.settingSlug&&e?.isActive))||!y)return null;const h=null===(r=v?.plugin_settings?.enable_editor_notices)||void 0===r||r,g=null!==(s=f?.integrations?.acf?.fields)&&void 0!==s?s:[],_=null!==(a=p?.controls?.acf)&&void 0!==a?a:{},k=null!==(c=_?.hideOnRuleSets)&&void 0!==c&&c;let E=null!==(d=_?.ruleSets)&&void 0!==d?d:[];if(0===E.length)E.push({enable:!0,rules:[{field:""}]});else if(1===E.length&&!E[0]?.rules){const e=E[0];0!==e.length&&e.forEach((e=>{var t;const l=null!==(t=e?.operator)&&void 0!==t?t:"";e.operator="!=empty"===l?"notEmpty":"==empty"===l?"empty":"=="===l?"equal":"!="===l?"notEqual":"==contains"===l?"contains":"!=contains"===l?"notContain":""})),E=[{enable:!0,rules:e}]}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 n=null!==(t=e?.key)&&void 0!==t?t:"",o=null!==(l=e?.title)&&void 0!==l?l:"";i.push({value:n,label:o})})),i}(e),l=ve(e),i=[];return t.forEach((e=>{var t,n;const o=null!==(t=e?.value)&&void 0!==t?t:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=l.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(f),w=ve(f);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)(q,{icon:D}),(0,t.createElement)("span",null,(0,n.__)("Advanced Custom Fields","block-visibility")),h&&(0,t.createElement)(Se,{message:(0,n.__)("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:ee.editorACF,position:"bottom right"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...E,{enable:!0,rules:[{field:""}]}];m("acf",(0,i.assign)({..._},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),h&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. @@ -24,7 +24,7 @@ // Translators: Whether the block is hidden or visible. (0,n.__)("%s the block","block-visibility"),h?(0,n.__)("Hide","block-visibility"):(0,n.__)("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,n.__)("From","block-visibility")),(0,t.createElement)(zn,{label:F,title:(0,n.__)("Choose a start date/time","block-visibility"),dateType:"start",hasDateTime:T,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,n.__)("To","block-visibility")),(0,t.createElement)(zn,{label:I,title:(0,n.__)("Choose a end date/time","block-visibility"),dateType:"end",hasDateTime:P,setAttribute:L,setPickerType:S,setPickerOpen:k})),_&&E&&(0,t.createElement)(Gn,{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})(T,P,M):((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})(T,P,M),label:"start"===E?(0,n.__)("Start Date/Time","block-visibility"):(0,n.__)("End Date/Time","block-visibility"),isOpen:k,setAttribute:L,setPickerOpen:k,pickerType:E})),D&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("The start time is after the stop time. Please fix for date/time settings to function properly.","block-visibility"))),w&&N&&(0,t.createElement)(In,e({setAttribute:L},l)),C&&R&&(0,t.createElement)(jn,e({setAttribute:L},l)));return x||(j=(0,t.createElement)(u.Disabled,null,j)),(0,t.createElement)("div",{className:b()("schedules-item",{disabled:!x})},(0,t.createElement)("div",{className:"section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,V),H),(0,t.createElement)("div",{className:"section-header__toolbar"},C&&(0,t.createElement)(u.Button,{icon:A,isPressed:R,onClick:()=>L("timeOfDay","enable",!R),isSmall:!0,label:(0,n.__)("Set time of day controls","block-visibility")}),w&&(0,t.createElement)(u.Button,{icon:he,isPressed:N,onClick:()=>L("dayOfWeek","enable",!N),isSmall:!0,label:(0,n.__)("Set day of week controls","block-visibility")}),U)),j)}function Zn(l){var o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"date_time"===e.settingSlug&&e?.isActive)))return null;const m=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,v=null!==(r=d?.controls?.dateTime)&&void 0!==r?r:{},f=null!==(s=v?.hideOnSchedules)&&void 0!==s&&s;let y=null!==(a=v?.schedules)&&void 0!==a?a:[];if(0===y.length){const e={enable:!0,start:"",end:""};v.schedules=[e],y=v.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,n.__)("Date & Time","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("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:ee.editorDateTime,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...y];e.push({enable:!0,start:"",end:""}),p("dateTime",(0,i.assign)({...v},{schedules:[...e]}))})(),label:(0,n.__)("Add schedule","block-visibility"),isSmall:!0}))),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. -(0,n.__)("%s the block if at least one schedule applies.","block-visibility"),f?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"control-fields-item__schedules"},y.map(((i,n)=>(0,t.createElement)(Wn,e({key:n,dateTime:v,schedules:y,scheduleIndex:n,scheduleAtts:i,hideOnSchedules:f},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when schedules apply","block-visibility"),checked:f,onChange:()=>p("dateTime",(0,i.assign)({...v},{hideOnSchedules:!f}))}))))}function Yn(e){var l,o;const{attributes:r,setAttributes:s,enabledControls:a,settings:c}=e;if(!a.some((e=>"hide_block"===e.settingSlug&&e.isActive)))return null;const{blockVisibility:d}=r,p=null!==(l=d?.hideBlock)&&void 0!==l&&l,b=null===(o=c?.plugin_settings?.enable_editor_notices)||void 0===o||o;return(0,t.createElement)("div",{className:"controls-panel-item hide-block-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Hide Block","block-visibility")),b&&(0,t.createElement)(Se,{message:(0,n.__)("The Hide Block control overrides all other visibility controls when enabled.","block-visibility"),link:ee.editorHideBlock,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide the block from everyone","block-visibility"),checked:p,onChange:()=>{s({blockVisibility:(0,i.assign)({...d},{hideBlock:!p})})}})))}function Xn(){const e=(0,o.useSelect)((e=>{var t;const l=e("core").getPostTypes({per_page:-1});let i=[];return l&&0!==l.length&&(i=l.filter((e=>e.viewable&&"attachment"!==e.slug))),(null!==(t=i)&&void 0!==t?t:[]).map((e=>{var t;const l=null!==(t=e.labels?.singular_name)&&void 0!==t?t:e.name;return{value:e.slug,label:(0,kn.decodeEntities)(l),taxonomies:e.taxonomies,hasArchive:"post"===e.slug||e.has_archive,isHierarchical:e.hierarchical}}))}),[]),l=(0,o.useSelect)((e=>{const t=e("core").getTaxonomies({per_page:-1});let l=[];return t&&0!==t.length&&(l=t.filter((e=>e.visibility?.show_ui))),l}),[]),i=(0,t.useMemo)((()=>(null!=l?l:[]).map((e=>e.slug))),[l]),r=(0,t.useMemo)((()=>{const t=[];return e.forEach((e=>{var i;const n=null!==(i=e?.taxonomies)&&void 0!==i?i:[];if(0!==n.length){const i={value:e.value,label:e.label,options:[]};n.forEach((t=>{const n=l.filter((e=>e.slug===t));if(n.length>0){var o;let t=null!==(o=n[0].labels?.singular_name)&&void 0!==o?o:n[0].name;"Category"!==t&&"Tag"!==t||"post"===e.value||(t=t+" ("+e.label+")");const l={value:n[0].slug,label:t};i.options.push(l)}})),t.push(i)}})),t}),[e]),s=(0,t.useMemo)((()=>(null!=e?e:[]).map((e=>e.value))),[e]),a=e.filter((e=>e?.isHierarchical)),c=(0,t.useMemo)((()=>(null!=a?a:[]).map((e=>e.value))),[a]),u=e.filter((e=>e?.hasArchive)),d=[{value:"equal",label:(0,n.__)("Is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Is not equal to","block-visibility")},{value:"greaterThan",label:(0,n.__)("Is greater than","block-visibility")},{value:"lessThan",label:(0,n.__)("Is less than","block-visibility")},{value:"greaterThanEqual",label:(0,n.__)("Is greater or equal to","block-visibility")},{value:"lessThanEqual",label:(0,n.__)("Is less than or equal to","block-visibility")}],p=[{value:"atLeastOne",label:(0,n.__)("Is at least one of the selected","block-visibility")},{value:"all",label:(0,n.__)("Is all of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")},{value:"noTerms",label:(0,n.__)("Post has no taxonomy terms","block-visibility")}],b=[{value:"any",label:(0,n.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")}],m=[{value:"equal",label:(0,n.__)("Is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Is not equal to","block-visibility")}],v=(0,n.__)("Select Condition…","block-visibility"),f=(0,n.__)("Select Type…","block-visibility"),y=(0,n.__)("Select Posts…","block-visibility");return[{value:"pageType",label:(0,n.__)("Page Type","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:[{value:"frontPage",label:(0,n.__)("Front Page (Homepage)","block-visibility")},{value:"postsPage",label:(0,n.__)("Posts Page (Blog page)","block-visibility")},{value:"singular",label:(0,n.__)("Singular Page","block-visibility")},{value:"archive",label:(0,n.__)("Archive Page","block-visibility")},{value:"search",label:(0,n.__)("Search Results Page","block-visibility")},{value:"404",label:(0,n.__)("404 Page","block-visibility")}],placeholder:f}]},{value:"postType",label:(0,n.__)("Post Type","block-visibility"),group:"post",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:e,placeholder:f,isLoading:0===e.length}]},{value:"postTaxonomy",label:(0,n.__)("Post Taxonomy","block-visibility"),group:"post",fields:[{type:"subField",valueType:"select",options:r,placeholder:(0,n.__)("Select Taxonomy…","block-visibility"),hasGroupedOptions:!0,triggerReset:!0,isLoading:0===r.length},{type:"operatorField",valueType:"select",options:p,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:i,valueTypes:[{value:"default",valueType:"termsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:i},{dependencyType:"operatorField",dependencyValues:["atLeastOne","all","none"]}],placeholder:(0,n.__)("Select Terms…","block-visibility")}]},{value:"post",label:(0,n.__)("Post","block-visibility"),group:"post",fields:[{type:"subField",valueType:"select",options:e,placeholder:(0,n.__)("Select Post Type…","block-visibility"),isLoading:0===e.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:s,valueTypes:[{value:"default",valueType:"postsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:s}],placeholder:y}]},{value:"postID",label:(0,n.__)("Post ID","block-visibility"),help:(0,n.__)("For multiple, comma seperate each post ID.","block-visibility"),group:"post",fields:[{type:"operatorField",valueType:"select",options:m,placeholder:v},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Post ID…","block-visibility")}]},{value:"attributesAuthor",label:(0,n.__)("Author","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"authorsSelect",placeholder:(0,n.__)("Select Author…","block-visibility")}]},{value:"attributesComments",label:(0,n.__)("Comments","block-visibility"),group:"attributes",fields:[{type:"subField",valueType:"select",options:[{value:"hasComments",label:(0,n.__)("Post has comments","block-visibility")},{value:"noComments",label:(0,n.__)("Post has no comments","block-visibility")},{value:"commentCount",label:(0,n.__)("Post comment count","block-visibility")}],placeholder:v,triggerReset:!0},{type:"operatorField",valueType:"select",options:d,placeholder:v,displayConditions:[{dependencyType:"subField",dependencyValues:["commentCount"]}]},{type:"valueField",valueType:"number",displayConditions:[{dependencyType:"subField",dependencyValues:["commentCount"]}]}],hasSimplifiedLayout:!0},{value:"attributesThumbnail",label:(0,n.__)("Featured Image","block-visibility"),group:"attributes",fields:[{type:"valueField",valueType:"select",options:[{value:"hasThumbnail",label:(0,n.__)("Post has a featured image","block-visibility")},{value:"noThumbnail",label:(0,n.__)("Post has no featured image","block-visibility")}]}]},{value:"attributesHierarchy",label:(0,n.__)("Hierarchy","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:[{value:"is",label:(0,n.__)("Post is a","block-visibility")},{value:"isNot",label:(0,n.__)("Post is not a","block-visibility")}],placeholder:v},{type:"valueField",valueType:"select",options:[{value:"topLevel",label:(0,n.__)("Top level post (no parent)","block-visibility")},{value:"parent",label:(0,n.__)("Parent (has children)","block-visibility")},{value:"child",label:(0,n.__)("Child (has parent)","block-visibility")}]}]},{value:"attributesRelativeHierarchy",label:(0,n.__)("Relative Hierarchy","block-visibility"),group:"attributes",fields:[{type:"subField",valueType:"select",options:a,placeholder:(0,n.__)("Select Post Type…","block-visibility"),isLoading:0===a.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:[{value:"parentOf",label:(0,n.__)("Is a parent of","block-visibility")},{value:"notParentOf",label:(0,n.__)("Is not a parent of","block-visibility")},{value:"childOf",label:(0,n.__)("Is a child of","block-visibility")},{value:"notChildOf",label:(0,n.__)("Is not a child of","block-visibility")}],placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:c,valueTypes:[{value:"default",valueType:"postsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:c}],placeholder:y}]},{value:"attributesSupports",label:(0,n.__)("Supports","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:[{value:"supports",label:(0,n.__)("Post type supports","block-visibility")},{value:"notSupport",label:(0,n.__)("Post type does not support","block-visibility")}],placeholder:v},{type:"valueField",valueType:"select",options:[{value:"comments",label:(0,n.__)("Comments","block-visibility")},{value:"excerpt",label:(0,n.__)("Excerpts","block-visibility")},{value:"thumbnail",label:(0,n.__)("Featured Images (Thumbnail)","block-visibility")},{value:"hierarchical",label:(0,n.__)("Post Hierarchy","block-visibility")}]}]},{value:"archiveType",label:(0,n.__)("Archive Type","block-visibility"),group:"archive",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:[{value:"postTypes",label:(0,n.__)("Post Types","block-visibility"),options:u},...r,{value:"internal",label:(0,n.__)("Internal","block-visibility"),options:[{value:"author",label:(0,n.__)("Author","block-visibility")},{value:"date",label:(0,n.__)("Date","block-visibility")}]}],placeholder:f,hasGroupedOptions:!0,isLoading:0===r.length||0===u.length}]},{value:"archive",label:(0,n.__)("Archive","block-visibility"),group:"archive",fields:[{type:"subField",valueType:"select",options:[...r,{value:"internal",label:(0,n.__)("Internal","block-visibility"),options:[{value:"author",label:(0,n.__)("Author","block-visibility")}]}],placeholder:f,hasGroupedOptions:!0,isLoading:0===r.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:["author",...i],valueTypes:[{value:"author",valueType:"authorsSelect"},{value:"default",valueType:"termsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:["author",...i]}],placeholder:(0,n.__)("Select Value…","block-visibility")}]}]}function Kn(l){var o,r,s,a;const{controlSetAtts:c,enabledControls:d,setControlAtts:p,settings:b,variables:m}=l;if(!d.some((e=>"location"===e.settingSlug&&e?.isActive)))return null;const v=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,f=null!==(r=c?.controls?.location)&&void 0!==r?r:{},y=null!==(s=f?.hideOnRuleSets)&&void 0!==s&&s,h=null!==(a=f?.ruleSets)&&void 0!==a?a:[];0===h.length&&h.push({enable:!0,rules:[{field:""}]});const g=function(e){const t=[{value:"type",label:(0,n.__)("Type","block-visibility")},{value:"post",label:(0,n.__)("Post","block-visibility")},{value:"attributes",label:(0,n.__)("Post Attributes","block-visibility")},{value:"archive",label:(0,n.__)("Archive","block-visibility")}],l=Xn(),i=[];return t.forEach((e=>{var t,n;const o=null!==(t=e?.value)&&void 0!==t?t:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=l.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(),_=Xn();return(0,t.createElement)("div",{className:"controls-panel-item location-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Location","block-visibility")),v&&(0,t.createElement)(Se,{message:(0,n.__)("The Location control allows you to configure block visibility based on where the block is located on your website using various rules.","block-visibility"),link:ee.editorLocation,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...h,{enable:!0,rules:[{field:""}]}];p("location",(0,i.assign)({...f},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),v&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( +(0,n.__)("%s the block if at least one schedule applies.","block-visibility"),f?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"control-fields-item__schedules"},y.map(((i,n)=>(0,t.createElement)(Wn,e({key:n,dateTime:v,schedules:y,scheduleIndex:n,scheduleAtts:i,hideOnSchedules:f},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when schedules apply","block-visibility"),checked:f,onChange:()=>p("dateTime",(0,i.assign)({...v},{hideOnSchedules:!f}))}))))}function Yn(e){var l,o;const{attributes:r,setAttributes:s,enabledControls:a,settings:c}=e;if(!a.some((e=>"hide_block"===e.settingSlug&&e.isActive)))return null;const{blockVisibility:d}=r,p=null!==(l=d?.hideBlock)&&void 0!==l&&l,b=null===(o=c?.plugin_settings?.enable_editor_notices)||void 0===o||o;return(0,t.createElement)("div",{className:"controls-panel-item hide-block-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Hide Block","block-visibility")),b&&(0,t.createElement)(Se,{message:(0,n.__)("The Hide Block control overrides all other visibility controls when enabled.","block-visibility"),link:ee.editorHideBlock,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide the block from everyone","block-visibility"),checked:p,onChange:()=>{s({blockVisibility:(0,i.assign)({...d},{hideBlock:!p})})}})))}function Xn(){const e=(0,o.useSelect)((e=>{var t;const l=e("core").getPostTypes({per_page:-1});let i=[];return l&&0!==l.length&&(i=l.filter((e=>e.viewable&&"attachment"!==e.slug))),(null!==(t=i)&&void 0!==t?t:[]).map((e=>{var t;const l=null!==(t=e.labels?.singular_name)&&void 0!==t?t:e.name;return{value:e.slug,label:(0,kn.decodeEntities)(l),taxonomies:e.taxonomies,hasArchive:"post"===e.slug||e.has_archive,isHierarchical:e.hierarchical}}))}),[]),l=(0,o.useSelect)((e=>{const t=e("core").getTaxonomies({per_page:-1});let l=[];return t&&0!==t.length&&(l=t.filter((e=>e.visibility?.show_ui))),l}),[]),i=(0,t.useMemo)((()=>(null!=l?l:[]).map((e=>e.slug))),[l]),r=(0,t.useMemo)((()=>{const t=[];return e.forEach((e=>{var i;const n=null!==(i=e?.taxonomies)&&void 0!==i?i:[];if(0!==n.length){const i={value:e.value,label:e.label,options:[]};n.forEach((t=>{const n=l.filter((e=>e.slug===t));if(n.length>0){var o;let t=null!==(o=n[0].labels?.singular_name)&&void 0!==o?o:n[0].name;"Category"!==t&&"Tag"!==t||"post"===e.value||(t=t+" ("+e.label+")");const l={value:n[0].slug,label:t};i.options.push(l)}})),t.push(i)}})),t}),[e]),s=(0,t.useMemo)((()=>(null!=e?e:[]).map((e=>e.value))),[e]),a=e.filter((e=>e?.isHierarchical)),c=(0,t.useMemo)((()=>(null!=a?a:[]).map((e=>e.value))),[a]),u=e.filter((e=>e?.hasArchive)),d=[{value:"equal",label:(0,n.__)("Is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Is not equal to","block-visibility")},{value:"greaterThan",label:(0,n.__)("Is greater than","block-visibility")},{value:"lessThan",label:(0,n.__)("Is less than","block-visibility")},{value:"greaterThanEqual",label:(0,n.__)("Is greater or equal to","block-visibility")},{value:"lessThanEqual",label:(0,n.__)("Is less than or equal to","block-visibility")}],p=[{value:"atLeastOne",label:(0,n.__)("Is at least one of the selected","block-visibility")},{value:"all",label:(0,n.__)("Is all of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")},{value:"noTerms",label:(0,n.__)("Post has no taxonomy terms","block-visibility")}],b=[{value:"any",label:(0,n.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")}],m=[{value:"equal",label:(0,n.__)("Is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Is not equal to","block-visibility")}],v=(0,n.__)("Select Condition…","block-visibility"),f=(0,n.__)("Select Type…","block-visibility"),y=(0,n.__)("Select Posts…","block-visibility");return[{value:"pageType",label:(0,n.__)("Page Type","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:[{value:"frontPage",label:(0,n.__)("Front Page (Homepage)","block-visibility")},{value:"postsPage",label:(0,n.__)("Posts Page (Blog page)","block-visibility")},{value:"singular",label:(0,n.__)("Singular Page","block-visibility")},{value:"archive",label:(0,n.__)("Archive Page","block-visibility")},{value:"search",label:(0,n.__)("Search Results Page","block-visibility")},{value:"404",label:(0,n.__)("404 Page","block-visibility")}],placeholder:f}]},{value:"postType",label:(0,n.__)("Post Type","block-visibility"),group:"post",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:e,placeholder:f,isLoading:0===e.length}]},{value:"postTaxonomy",label:(0,n.__)("Post Taxonomy","block-visibility"),group:"post",fields:[{type:"subField",valueType:"select",options:r,placeholder:(0,n.__)("Select Taxonomy…","block-visibility"),hasGroupedOptions:!0,triggerReset:!0,isLoading:0===r.length},{type:"operatorField",valueType:"select",options:p,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:i,valueTypes:[{value:"default",valueType:"termsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:i},{dependencyType:"operatorField",dependencyValues:["atLeastOne","all","none"]}],placeholder:(0,n.__)("Select Terms…","block-visibility")}]},{value:"post",label:(0,n.__)("Post","block-visibility"),group:"post",fields:[{type:"subField",valueType:"select",options:e,placeholder:(0,n.__)("Select Post Type…","block-visibility"),isLoading:0===e.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:s,valueTypes:[{value:"default",valueType:"postsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:s}],placeholder:y}]},{value:"postID",label:(0,n.__)("Post ID","block-visibility"),help:(0,n.__)("For multiple, comma seperate each post ID.","block-visibility"),group:"post",fields:[{type:"operatorField",valueType:"select",options:m,placeholder:v},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Post ID…","block-visibility")}]},{value:"attributesAuthor",label:(0,n.__)("Author","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"authorsSelect",placeholder:(0,n.__)("Select Author…","block-visibility")}]},{value:"attributesComments",label:(0,n.__)("Comments","block-visibility"),group:"attributes",fields:[{type:"subField",valueType:"select",options:[{value:"hasComments",label:(0,n.__)("Post has comments","block-visibility")},{value:"noComments",label:(0,n.__)("Post has no comments","block-visibility")},{value:"commentCount",label:(0,n.__)("Post comment count","block-visibility")}],placeholder:v,triggerReset:!0},{type:"operatorField",valueType:"select",options:d,placeholder:v,displayConditions:[{dependencyType:"subField",dependencyValues:["commentCount"]}]},{type:"valueField",valueType:"number",displayConditions:[{dependencyType:"subField",dependencyValues:["commentCount"]}]}],hasSimplifiedLayout:!0},{value:"attributesThumbnail",label:(0,n.__)("Featured Image","block-visibility"),group:"attributes",fields:[{type:"valueField",valueType:"select",options:[{value:"hasThumbnail",label:(0,n.__)("Post has a featured image","block-visibility")},{value:"noThumbnail",label:(0,n.__)("Post has no featured image","block-visibility")}]}]},{value:"attributesHierarchy",label:(0,n.__)("Hierarchy","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:[{value:"is",label:(0,n.__)("Post is a","block-visibility")},{value:"isNot",label:(0,n.__)("Post is not a","block-visibility")}],placeholder:v},{type:"valueField",valueType:"select",options:[{value:"topLevel",label:(0,n.__)("Top level post (no parent)","block-visibility")},{value:"parent",label:(0,n.__)("Parent (has children)","block-visibility")},{value:"child",label:(0,n.__)("Child (has parent)","block-visibility")}]}]},{value:"attributesRelativeHierarchy",label:(0,n.__)("Relative Hierarchy","block-visibility"),group:"attributes",fields:[{type:"subField",valueType:"select",options:a,placeholder:(0,n.__)("Select Post Type…","block-visibility"),isLoading:0===a.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:[{value:"parentOf",label:(0,n.__)("Is a parent of","block-visibility")},{value:"notParentOf",label:(0,n.__)("Is not a parent of","block-visibility")},{value:"childOf",label:(0,n.__)("Is a child of","block-visibility")},{value:"notChildOf",label:(0,n.__)("Is not a child of","block-visibility")}],placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:c,valueTypes:[{value:"default",valueType:"postSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:c}],placeholder:y}]},{value:"attributesSupports",label:(0,n.__)("Supports","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:[{value:"supports",label:(0,n.__)("Post type supports","block-visibility")},{value:"notSupport",label:(0,n.__)("Post type does not support","block-visibility")}],placeholder:v},{type:"valueField",valueType:"select",options:[{value:"comments",label:(0,n.__)("Comments","block-visibility")},{value:"excerpt",label:(0,n.__)("Excerpts","block-visibility")},{value:"thumbnail",label:(0,n.__)("Featured Images (Thumbnail)","block-visibility")},{value:"hierarchical",label:(0,n.__)("Post Hierarchy","block-visibility")}]}]},{value:"archiveType",label:(0,n.__)("Archive Type","block-visibility"),group:"archive",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:[{value:"postTypes",label:(0,n.__)("Post Types","block-visibility"),options:u},...r,{value:"internal",label:(0,n.__)("Internal","block-visibility"),options:[{value:"author",label:(0,n.__)("Author","block-visibility")},{value:"date",label:(0,n.__)("Date","block-visibility")}]}],placeholder:f,hasGroupedOptions:!0,isLoading:0===r.length||0===u.length}]},{value:"archive",label:(0,n.__)("Archive","block-visibility"),group:"archive",fields:[{type:"subField",valueType:"select",options:[...r,{value:"internal",label:(0,n.__)("Internal","block-visibility"),options:[{value:"author",label:(0,n.__)("Author","block-visibility")}]}],placeholder:f,hasGroupedOptions:!0,isLoading:0===r.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:["author",...i],valueTypes:[{value:"author",valueType:"authorsSelect"},{value:"default",valueType:"termsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:["author",...i]}],placeholder:(0,n.__)("Select Value…","block-visibility")}]}]}function Kn(l){var o,r,s,a;const{controlSetAtts:c,enabledControls:d,setControlAtts:p,settings:b,variables:m}=l;if(!d.some((e=>"location"===e.settingSlug&&e?.isActive)))return null;const v=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,f=null!==(r=c?.controls?.location)&&void 0!==r?r:{},y=null!==(s=f?.hideOnRuleSets)&&void 0!==s&&s,h=null!==(a=f?.ruleSets)&&void 0!==a?a:[];0===h.length&&h.push({enable:!0,rules:[{field:""}]});const g=function(e){const t=[{value:"type",label:(0,n.__)("Type","block-visibility")},{value:"post",label:(0,n.__)("Post","block-visibility")},{value:"attributes",label:(0,n.__)("Post Attributes","block-visibility")},{value:"archive",label:(0,n.__)("Archive","block-visibility")}],l=Xn(),i=[];return t.forEach((e=>{var t,n;const o=null!==(t=e?.value)&&void 0!==t?t:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=l.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(),_=Xn();return(0,t.createElement)("div",{className:"controls-panel-item location-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Location","block-visibility")),v&&(0,t.createElement)(Se,{message:(0,n.__)("The Location control allows you to configure block visibility based on where the block is located on your website using various rules.","block-visibility"),link:ee.editorLocation,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...h,{enable:!0,rules:[{field:""}]}];p("location",(0,i.assign)({...f},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),v&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. (0,n.__)("%s the block if at least one rule set applies.","block-visibility"),y?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},h.map(((i,n)=>(0,t.createElement)(Nn,e({key:n,ruleSet:i,ruleSetIndex:n,ruleSets:h,groupedFields:g,allFields:_,controlName:"location",controlAtts:f,hideOnRuleSets:y},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:y,onChange:()=>p("location",(0,i.assign)({...f},{hideOnRuleSets:!y}))}))))}function Qn(){const e=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,n.__)("Value contains","block-visibility")},{value:"notContain",label:(0,n.__)("Value does not contain","block-visibility")}],t=(0,n.__)("Select Condition…","block-visibility");return[{value:"postMetadata",label:(0,n.__)("Post Metadata","block-visibility"),group:"type",fields:[{type:"subField",valueType:"text",placeholder:(0,n.__)("Enter Meta Key (Name)…","block-visibility")},{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Meta Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","contains","notContain"]}]}]},{value:"userMetadata",label:(0,n.__)("User Metadata","block-visibility"),group:"type",fields:[{type:"subField",valueType:"text",placeholder:(0,n.__)("Enter Meta Key (Name)…","block-visibility")},{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Meta Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","contains","notContain"]}]}]}]}function Jn(l){var o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"metadata"===e.settingSlug&&e?.isActive)))return null;const m=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,v=null!==(r=d?.controls?.metadata)&&void 0!==r?r:{},f=null!==(s=v?.hideOnRuleSets)&&void 0!==s&&s,y=null!==(a=v?.ruleSets)&&void 0!==a?a:[];0===y.length&&y.push({enable:!0,rules:[{field:""}]});const h=function(){const e=[{value:"type",label:(0,n.__)("Metadata Type","block-visibility")}],t=Qn(),l=[];return e.forEach((e=>{var i,n;const o=null!==(i=e?.value)&&void 0!==i?i:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=t.filter((e=>e.group===o));l.push({value:o,label:r,options:s})})),l}(),g=Qn();return(0,t.createElement)("div",{className:"controls-panel-item metadata-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Metadata","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("The Metadata control allows you to configure block visibility based on post or user metadata.","block-visibility"),link:ee.editorMetadata,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...y,{enable:!0,rules:[{field:""}]}];p("metadata",(0,i.assign)({...v},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. diff --git a/includes/frontend/visibility-tests/location.php b/includes/frontend/visibility-tests/location.php index 0c0c4c6e..3fbd9d1e 100644 --- a/includes/frontend/visibility-tests/location.php +++ b/includes/frontend/visibility-tests/location.php @@ -644,7 +644,8 @@ function run_location_relative_hierarchy_test( $rule ) { // Assume error and try to disprove. $test_result = 'error'; - $relative_id = $rule['value']; + // Account for a bug in v3 that allowed multiple values to be stored. + $relative_id = is_array( $rule['value'] ) ? $rule['value'][0] : $rule['value']; $hierarchy = $rule['operator']; $post_id = get_the_ID(); diff --git a/languages/block-visibility.pot b/languages/block-visibility.pot index 5ebb374c..50d65d5a 100644 --- a/languages/block-visibility.pot +++ b/languages/block-visibility.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPLv2. msgid "" msgstr "" -"Project-Id-Version: Block Visibility 3.0.3\n" +"Project-Id-Version: Block Visibility 3.0.4\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/block-visibility\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2023-06-04T16:39:57+00:00\n" +"POT-Creation-Date: 2023-07-14T11:42:12+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: block-visibility\n" diff --git a/package.json b/package.json index 7995f2b0..24078dd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "block-visibility", - "version": "3.0.3", + "version": "3.0.4", "description": "Provides visibility controls and scheduling functionality to all WordPress blocks.", "author": "Nick Diego", "license": "GPL-2.0-or-later", diff --git a/readme.txt b/readme.txt index 7c39ca18..adcf89aa 100644 --- a/readme.txt +++ b/readme.txt @@ -189,6 +189,12 @@ The **one exception** to this is the Screen Size block controls. Visibility by s == Changelog === += 3.0.4 - 2023-07-14 = + +**Fixed** + +* [Location] Fixed bug that prevented the Relative Hierarchy rule from working. The value field was set to multi-select when it should be a single selection. + = 3.0.3 - 2023-06-04 = **Changed** diff --git a/src/components/rule-sets/async-rule-fields/posts-select.js b/src/components/rule-sets/async-rule-fields/posts-select.js index 3691c8f6..555b5385 100644 --- a/src/components/rule-sets/async-rule-fields/posts-select.js +++ b/src/components/rule-sets/async-rule-fields/posts-select.js @@ -55,6 +55,8 @@ export default function PostsSelect( props ) { postType, triggerReset, value, + valueType, + isMulti, } = props; const [ selectedValues, setSelectedValues ] = useState( false ); const [ searchValue, setSearchValue ] = useState( false ); @@ -158,10 +160,14 @@ export default function PostsSelect( props ) { } const handleChange = ( values ) => { + // Need for value handling. + const valueHandling = + valueType === 'postSelect' ? 'select' : 'multiSelect'; + setSelectedValues( values ); handleRuleChange( values, - 'multiSelect', // Need for value handling. + valueHandling, fieldType, fieldName, triggerReset @@ -205,7 +211,7 @@ export default function PostsSelect( props ) { noOptionsMessage={ noOptionsMessage } placeholder={ placeholder } isLoading={ loadingAvailablePosts || loadingSavedPosts } - isMulti + isMulti={ isMulti } /> ); } diff --git a/src/components/rule-sets/rule-field.js b/src/components/rule-sets/rule-field.js index be4ccb35..36d60261 100644 --- a/src/components/rule-sets/rule-field.js +++ b/src/components/rule-sets/rule-field.js @@ -192,7 +192,7 @@ export default function RuleField( props ) { { ...props } /> ); - } else if ( valueType === 'postsSelect' ) { + } else if ( valueType === 'postsSelect' || valueType === 'postSelect' ) { let postType; // A defined variant will take precedent. @@ -208,6 +208,8 @@ export default function RuleField( props ) { postType={ postType } className={ className } value={ value } + valueType={ valueType } + isMulti={ valueType === 'postsSelect' } { ...props } /> ); diff --git a/src/controls/location/fields.js b/src/controls/location/fields.js index 89876a54..075f3ca7 100644 --- a/src/controls/location/fields.js +++ b/src/controls/location/fields.js @@ -582,7 +582,7 @@ export function GetAllFields() { dependencyType: 'subField', dependencyValues: postTypesHierarchicalList, valueTypes: [ - { value: 'default', valueType: 'postsSelect' }, + { value: 'default', valueType: 'postSelect' }, ], }, ], From b842f6e2c02ed12c7e829f1469557cbf925913bd Mon Sep 17 00:00:00 2001 From: Nick Diego Date: Fri, 14 Jul 2023 06:56:50 -0500 Subject: [PATCH 2/2] Detect if the value is an array or not. --- build/block-visibility-editor.asset.php | 2 +- build/block-visibility-editor.js | 28 +++++++++---------- .../async-rule-fields/posts-select.js | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/build/block-visibility-editor.asset.php b/build/block-visibility-editor.asset.php index 47ae86fd..e80e2ee6 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-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'), 'version' => '6c921ae87f356978e95e'); + array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', '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'), 'version' => '98babb0bfe71941655a4'); diff --git a/build/block-visibility-editor.js b/build/block-visibility-editor.js index 71a0955d..1132eecf 100644 --- a/build/block-visibility-editor.js +++ b/build/block-visibility-editor.js @@ -1,42 +1,42 @@ -(()=>{var e={184:(e,t)=>{var l;!function(){"use strict";var i={}.hasOwnProperty;function n(){for(var e=[],t=0;t{"use strict";var i=l(742),n={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var l,o,r,s,a,c,u=!1;t||(t={}),l=t.debug||!1;try{if(r=i(),s=document.createRange(),a=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(i){if(i.stopPropagation(),t.format)if(i.preventDefault(),void 0===i.clipboardData){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=n[t.format]||n.default;window.clipboardData.setData(o,e)}else i.clipboardData.clearData(),i.clipboardData.setData(t.format,e);t.onCopy&&(i.preventDefault(),t.onCopy(i.clipboardData))})),document.body.appendChild(c),s.selectNodeContents(c),a.addRange(s),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(i){l&&console.error("unable to copy using execCommand: ",i),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(i){l&&console.error("unable to copy using clipboardData: ",i),l&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(s):a.removeAllRanges()),c&&document.body.removeChild(c),r()}return u}},679:(e,t,l)=>{"use strict";var i=l(864),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function a(e){return i.isMemo(e)?r:s[e.$$typeof]||n}s[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[i.Memo]=r;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,b=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,l,i){if("string"!=typeof l){if(m){var n=b(l);n&&n!==m&&e(t,n,i)}var r=u(l);d&&(r=r.concat(d(l)));for(var s=a(t),v=a(l),f=0;f{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var n=s(l(196)),o=s(l(640)),r=["text","onCopy","options","children"];function s(e){return e&&e.__esModule?e:{default:e}}function a(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 c(e){for(var t=1;t=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}(e,r),i=n.default.Children.only(t);return n.default.cloneElement(i,c(c({},l),{},{onClick:this.onClick}))}}])&&u(t.prototype,l),Object.defineProperty(t,"prototype",{writable:!1}),f}(n.default.PureComponent);t.CopyToClipboard=v,m(v,"defaultProps",{onCopy:void 0,options:void 0})},855:(e,t,l)=>{"use strict";var i=l(300).CopyToClipboard;i.CopyToClipboard=i,e.exports=i},921:(e,t)=>{"use strict";var l="function"==typeof Symbol&&Symbol.for,i=l?Symbol.for("react.element"):60103,n=l?Symbol.for("react.portal"):60106,o=l?Symbol.for("react.fragment"):60107,r=l?Symbol.for("react.strict_mode"):60108,s=l?Symbol.for("react.profiler"):60114,a=l?Symbol.for("react.provider"):60109,c=l?Symbol.for("react.context"):60110,u=l?Symbol.for("react.async_mode"):60111,d=l?Symbol.for("react.concurrent_mode"):60111,p=l?Symbol.for("react.forward_ref"):60112,b=l?Symbol.for("react.suspense"):60113,m=l?Symbol.for("react.suspense_list"):60120,v=l?Symbol.for("react.memo"):60115,f=l?Symbol.for("react.lazy"):60116,y=l?Symbol.for("react.block"):60121,h=l?Symbol.for("react.fundamental"):60117,g=l?Symbol.for("react.responder"):60118,_=l?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 o:case s:case r:case b:return e;default:switch(e=e&&e.$$typeof){case c:case p:case f:case v:case a:return e;default:return t}}case n:return t}}}function E(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=a,t.Element=i,t.ForwardRef=p,t.Fragment=o,t.Lazy=f,t.Memo=v,t.Portal=n,t.Profiler=s,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)===a},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)===o},t.isLazy=function(e){return k(e)===f},t.isMemo=function(e){return k(e)===v},t.isPortal=function(e){return k(e)===n},t.isProfiler=function(e){return k(e)===s},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===o||e===d||e===s||e===r||e===b||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===a||e.$$typeof===c||e.$$typeof===p||e.$$typeof===h||e.$$typeof===g||e.$$typeof===_||e.$$typeof===y)},t.typeOf=k},864:(e,t,l)=>{"use strict";e.exports=l(921)},742:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,l=[],i=0;i{"use strict";e.exports=window.React}},t={};function l(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,l),o.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(){return e=Object.assign||function(e){for(var t=1;t"acf"===e.settingSlug)))return!1;if(t&&!e.hasOwnProperty("acf"))return!1;let r=!0;return 0===(null!==(o=e?.acf?.ruleSets)&&void 0!==o?o:[]).length&&(r=!1),r}function v(e,t,l){var i;if(t&&!e.hasOwnProperty("browserDevice"))return!1;if(!l.some((e=>"browser_device"===e.settingSlug)))return!1;let n=!0;return 0===(null!==(i=e?.browserDevice?.ruleSets)&&void 0!==i?i:[]).length&&(n=!1),n}function f(e,t,l){var i;if(t&&!e.hasOwnProperty("cookie"))return!1;if(!l.some((e=>"cookie"===e.settingSlug)))return!1;let n=!0;return 0===(null!==(i=e?.cookie?.ruleSets)&&void 0!==i?i:[]).length&&(n=!1),n}function y(e,t,l){if(t&&!e.hasOwnProperty("dateTime"))return!1;if(!l.some((e=>"date_time"===e.settingSlug)))return!1;let i=[],n=!1;var o,r;if(t?(i=null!==(o=e.dateTime?.schedules)&&void 0!==o?o:[],n=null!==(r=e.dateTime?.hideOnSchedules)&&void 0!==r&&r):i=e?.scheduling?[e?.scheduling]:[],0===i.length)return!1;const s=[];return i.forEach((e=>{var t,l,i,o,r;const a=null!==(t=e?.enable)&&void 0!==t&&t,c=null!==(l=e?.start)&&void 0!==l?l:"",u=null!==(i=e?.end)&&void 0!==i?i:"",d=null!==(o=e?.dayOfWeek?.enable)&&void 0!==o&&o,p=null!==(r=e?.timeOfDay?.enable)&&void 0!==r&&r;let b=!0;a||(b=!1),n||!a||c||u||d||p||(b=!1),a&&c&&u&&c>=u&&(b=!1),s.push(b)})),s.includes(!0)}function h(e,t,l){var i;if(t&&!e.hasOwnProperty("location"))return!1;if(!l.some((e=>"location"===e.settingSlug)))return!1;let n=!0;return 0===(null!==(i=e?.location?.ruleSets)&&void 0!==i?i:[]).length&&(n=!1),n}function g(e,t,l){var i;if(t&&!e.hasOwnProperty("metadata"))return!1;if(!l.some((e=>"metadata"===e.settingSlug)))return!1;let n=!0;return 0===(null!==(i=e?.metadata?.ruleSets)&&void 0!==i?i:[]).length&&(n=!1),n}function _(e,t,l){var i,n,o;if(t&&!e.hasOwnProperty("queryString"))return!1;if(!l.some((e=>"query_string"===e.settingSlug)))return!1;const r=null!==(i=e?.queryString?.queryStringAny)&&void 0!==i?i:"",s=null!==(n=e?.queryString?.queryStringAll)&&void 0!==n?n:"",a=null!==(o=e?.queryString?.queryStringNot)&&void 0!==o?o:"";let c=!0;return r||s||a||(c=!1),c}function k(e,t,l){var i,n;if(t&&!e.hasOwnProperty("referralSource"))return!1;if(!l.some((e=>"referral_source"===e.settingSlug)))return!1;const o=null!==(i=e?.referralSource?.contains)&&void 0!==i?i:"",r=null!==(n=e?.referralSource?.doesNotContain)&&void 0!==n?n:"";let s=!0;return o||r||(s=!1),s}function E(e,t,l,i){var n,o;if(t&&!e.hasOwnProperty("screenSize"))return!1;const r=t?e.screenSize:e,s=null!==(n=r?.hideOnScreenSize)&&void 0!==n?n:{extraLarge:!1,large:!1,medium:!1,small:!1,extraSmall:!1},a=null!==(o=i?.visibility_controls?.screen_size?.controls)&&void 0!==o?o:{extra_large:!0,large:!0,medium:!0,small:!0,extra_small:!0},c=[!(!s.extraLarge||!a.extra_large),!(!s.large||!a.large),!(!s.medium||!a.medium),!(!s.small||!a.small),!(!s.extraSmall||!a.extra_small)];let u=!0;return l.some((e=>"screen_size"===e.settingSlug))&&c.includes(!0)||(u=!1),u}function S(e,t,l){var i,n;if(t&&!e.hasOwnProperty("urlPath"))return!1;if(!l.some((e=>"url_path"===e.settingSlug)))return!1;const o=null!==(i=e?.urlPath?.contains)&&void 0!==i?i:"",r=null!==(n=e?.urlPath?.doesNotContain)&&void 0!==n?n:"";let s=!0;return o||r||(s=!1),s}function w(e,t,l){var i,n,o,r,s,a;if(t&&!e.hasOwnProperty("userRole"))return!1;const c=t?e.userRole:e,u=null!==(i=c?.visibilityByRole)&&void 0!==i?i:"public",d=null!==(n=c?.restrictedRoles)&&void 0!==n?n:[],p=null!==(o=c?.hideOnRestrictedRoles)&&void 0!==o&&o,b=null!==(r=c?.restrictedUsers)&&void 0!==r?r:[],m=null!==(s=c?.hideOnRestrictedUsers)&&void 0!==s&&s,v=null!==(a=c?.ruleSets)&&void 0!==a?a:[];let f=!0;return l.some((e=>"visibility_by_role"===e.settingSlug))&&u&&"public"!==u&&"all"!==u||(f=!1),"user-role"===u&&0===d.length&&p&&(f=!1),"users"===u&&0===b.length&&m&&(f=!1),"user-rule-sets"===u&&0===v.length&&(f=!1),f}function C(e,t){var l;return!!t.some((e=>"visibility_presets"===e.settingSlug))&&0!==(null!==(l=e?.visibilityPresets?.presets)&&void 0!==l?l:[]).length}function O(e,t,l,i){var n,o,r,s,a,c;if(null===(n=i?.integrations?.wp_fusion?.active)||void 0===n||!n||!l.some((e=>"wp_fusion"===e.settingSlug)))return!1;if(t&&!e.hasOwnProperty("wpFusion"))return!1;const u=null!==(o=e.hasOwnProperty("userRole"))&&void 0!==o&&o,d=null!==(r=e?.userRole?.visibilityByRole)&&void 0!==r?r:"public",p="public"===d||"logged-out"===d,b=null!==(s=e?.wpFusion?.tagsAny)&&void 0!==s?s:[],m=null!==(a=e?.wpFusion?.tagsAll)&&void 0!==a?a:[],v=null!==(c=e?.wpFusion?.tagsNot)&&void 0!==c?c:[];let f=!0;return(!u&&0===v.length||"public"===d&&0===v.length||"logged-out"===d)&&(f=!1),p||0!==b.length||0!==m.length||0!==v.length||(f=!1),f}function x(e,t){if(!e||0===e.length)return!1;const l=e.disabled_blocks.includes(t),i=(0,a.getBlockSupport)(t,"blockVisibility",!1);return!(l||!i)}function T(e){const{data:t="fetching"}=(0,o.useSelect)((t=>{const{getEntityRecord:l}=t("core");return{data:l("block-visibility/v1",e)}}),[]);return t}function P(e,t){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||0===e.length)return!1;const n=e.plugin_settings;return(0,i.has)(n,t)?n[t]:l}(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},(0,t.createElement)(u.Path,{d:"M128 0c70.7 0 128 57.3 128 128s-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0Zm0 67a95.67 95.67 0 0 0-88.56 59.65l-.44 1.09v.52l.47 1.19A95.67 95.67 0 0 0 128 189a95.67 95.67 0 0 0 88.56-59.65l.44-1.09v-.52l-.47-1.19A95.67 95.67 0 0 0 128 67Zm0 21a40 40 0 1 1 0 80 40 40 0 0 1 0-80Zm8 16a16 16 0 1 0 0 32 16 16 0 0 0 0-32Z"}));const N=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M12 16c2.208 0 4-1.792 4-4s-1.792-4-4-4-4 1.792-4 4 1.792 4 4 4Zm0-1.5c-1.3796 0-2.5-1.1204-2.5-2.5s1.1204-2.5 2.5-2.5 2.5 1.1204 2.5 2.5-1.1204 2.5-2.5 2.5Z"}),(0,t.createElement)(u.Path,{d:"M12 16c2.208 0 4-1.792 4-4s-1.792-4-4-4-4 1.792-4 4 1.792 4 4 4Zm0-1.5c-1.3796 0-2.5-1.1204-2.5-2.5s1.1204-2.5 2.5-2.5 2.5 1.1204 2.5 2.5-1.1204 2.5-2.5 2.5Z"}),(0,t.createElement)(u.Path,{d:"M12 4.5c5 0 9.27 3.11 11 7.5-1.73 4.39-6 7.5-11 7.5S2.73 16.39 1 12c1.73-4.39 6-7.5 11-7.5Zm9.3474 7.5C19.6714 8.4585 16.0654 6.1071 12 6.1071c-4.0653 0-7.6714 2.3514-9.3474 5.8929 1.676 3.5415 5.282 5.8929 9.3474 5.8929 4.0653 0 7.6714-2.3514 9.3474-5.8929Z"})),R=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M13.9709 15.481A3.9797 3.9797 0 0 1 12 16c-2.208 0-4-1.792-4-4a3.98 3.98 0 0 1 .4854-1.9106l1.1417 1.1222A2.4937 2.4937 0 0 0 9.5 12c0 1.3796 1.1204 2.5 2.5 2.5.2906 0 .5697-.0497.8292-.141l1.1417 1.122ZM15.8137 13.2094l-1.315-1.2926c-.0436-1.3279-1.1252-2.3955-2.4587-2.4165l-1.315-1.2925A3.9918 3.9918 0 0 1 12 8c2.208 0 4 1.792 4 4a3.994 3.994 0 0 1-.1863 1.2094Z"}),(0,t.createElement)(u.Path,{d:"M16.9542 18.4125C15.4477 19.1105 13.7696 19.5 12 19.5c-5 0-9.27-3.11-11-7.5.8355-2.1201 2.2634-3.9417 4.0798-5.2586l1.1408 1.1212C4.697 8.8849 3.454 10.3063 2.6526 12c1.676 3.5415 5.282 5.8929 9.3474 5.8929 1.3052 0 2.563-.2424 3.7249-.6887l1.2293 1.2083ZM19.4899 16.8186l-1.1243-1.105c1.2566-.9771 2.2857-2.2427 2.9818-3.7136-1.676-3.5415-5.282-5.8929-9.3474-5.8929-1.027 0-2.0246.15-2.9692.4315L7.7566 5.2862C9.0734 4.7784 10.504 4.5 12 4.5c5 0 9.27 3.11 11 7.5-.746 1.8932-1.9645 3.5483-3.5101 4.8186ZM2.7243 4.4261l16.5 16.2175a.75.75 0 0 0 1.0514-1.0697l-16.5-16.2175A.75.75 0 0 0 2.7243 4.426Z"})),A=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M12 3c4.9706 0 9 4.0294 9 9s-4.0294 9-9 9-9-4.0294-9-9 4.0294-9 9-9Zm0 1.595c-4.0897 0-7.405 3.3153-7.405 7.405 0 4.0897 3.3153 7.405 7.405 7.405 4.0897 0 7.405-3.3153 7.405-7.405 0-4.0897-3.3153-7.405-7.405-7.405Zm0 2.5063c.4066 0 .742.3042.7913.6974l.0062.1v3.7714l2.9563 2.9559a.7975.7975 0 0 1-1.0462 1.1991l-.0816-.0713-3.2213-3.2231-.0749-.0983-.0304-.051a.7931.7931 0 0 1-.0907-.2814l-.0062-.1V7.8987c0-.4404.357-.7974.7975-.7974Z"})),M=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"})),V=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M20 19c0 1.1046-.8954 2-2 2H6c-1.1046 0-2-.8954-2-2V5c0-1.1046.8954-2 2-2h12c1.1046 0 2 .8954 2 2v14ZM18.5 8.5V5a.5002.5002 0 0 0-.4101-.492L18 4.5H6a.5002.5002 0 0 0-.492.4101L5.5 5v3.5h13Zm0 5.5v-4h-13v4h13Zm0 5v-3.5h-13V19c0 .2455.1769.4496.4101.492L6 19.5h12a.5002.5002 0 0 0 .492-.4101L18.5 19Z"})),F=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M19 4c1.1046 0 2 .8954 2 2v12c0 1.1046-.8954 2-2 2H5c-1.1046 0-2-.8954-2-2V6c0-1.1046.8954-2 2-2h14ZM8.5 5.5H5a.5002.5002 0 0 0-.492.4101L4.5 6v12c0 .2455.1769.4496.4101.492L5 18.5h3.5v-13Zm5.5 0h-4v13h4v-13Zm5 0h-3.5v13H19a.5002.5002 0 0 0 .492-.4101L19.5 18V6a.5002.5002 0 0 0-.4101-.492L19 5.5Z"})),I=((0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M12 0a11.96 11.96 0 0 1 12 12 11.96 11.96 0 0 1-12 12A11.96 11.96 0 0 1 0 12 11.96 11.96 0 0 1 12 0Zm.69 13.9H11.4v.92l-.13.03c-.3.1-.57.22-.79.38-.22.17-.4.37-.51.6-.12.23-.19.48-.19.76 0 .32.09.6.26.85.16.24.38.44.67.6.2.13.43.24.68.33l.27.09c.24.08.43.16.58.24.13.07.21.14.26.2.04.06.06.13.06.21 0 .1-.03.17-.08.24a.56.56 0 0 1-.25.17c-.14.05-.3.07-.52.08a3.2 3.2 0 0 1-1.37-.33l-.3-.15-.41 1.37.2.1c.13.08.3.14.49.2s.4.1.62.14l.23.03.23.01v.87h1.29v-.98l.06-.02c.33-.1.6-.24.83-.42a1.76 1.76 0 0 0 .68-1.38 1.64 1.64 0 0 0-.83-1.46c-.2-.13-.45-.26-.73-.36l-.22-.08c-.27-.1-.48-.18-.64-.26a.9.9 0 0 1-.3-.2.27.27 0 0 1-.06-.19c0-.05.02-.1.06-.16a.48.48 0 0 1 .21-.15c.12-.05.28-.08.48-.08a2.9 2.9 0 0 1 1.12.24l.28.13.44-1.32-.21-.11a2.9 2.9 0 0 0-.67-.23l-.18-.03-.18-.02-.14-.02v-.85ZM12 1.67A10.32 10.32 0 0 0 1.68 11.9L6.4 7.17 8 8.75l-3.47 3.47h14.94L16 8.75l1.59-1.58 4.73 4.73A10.32 10.32 0 0 0 12 1.68Zm0 .48c.81 0 1.48.48 1.48 1.08V5.5h2.92L12 10.13 7.6 5.5h2.92V3.24c0-.6.67-1.08 1.48-1.08Z",fill:"#000"})),(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M19.2 0A4.8 4.8 0 0 1 24 4.8v14.4a4.8 4.8 0 0 1-4.8 4.8H4.8A4.8 4.8 0 0 1 0 19.2V4.8A4.8 4.8 0 0 1 4.8 0h14.4Zm-.51 4h-.15c-.45.04-.8.27-1.02.74-.97 1.87-1.65 4.9-2.05 9.12a32.67 32.67 0 0 1-1.48-5.68c-.17-.97-.59-1.44-1.27-1.39-.46.03-.85.37-1.16 1l-3.4 6.91C7.6 12.3 7.07 9.36 6.6 5.9c-.1-.87-.55-1.26-1.35-1.2-.43.04-.76.2-.97.52-.22.3-.31.68-.25 1.1.91 6.23 1.77 10.42 2.56 12.6.3.8.67 1.17 1.08 1.14.66-.05 1.43-1.01 2.35-2.89a319.4 319.4 0 0 1 2.23-4.77c.84 3.13 1.99 5.49 3.43 7.06.4.45.82.65 1.22.62.36-.04.64-.24.83-.6.15-.32.21-.68.18-1.1a33 33 0 0 1 .44-6.31c.4-2.79.9-4.8 1.5-6 .13-.24.17-.49.16-.79-.03-.38-.19-.7-.48-.94a1.3 1.3 0 0 0-.98-.33Z",fill:"#683FA6"})),(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M5.05 0H24v18.95A5.05 5.05 0 0 1 18.95 24H0V5.05A5.05 5.05 0 0 1 5.05 0Z",fill:"#E55B10"}),(0,t.createElement)(u.Path,{d:"M19.58 9.79c0 .52-.43.95-.95.95h-7.58v7.58c0 .52-.42.94-.94.94h-.64a.95.95 0 0 1-.94-.94V9.47c0-.34.18-.64.45-.8a.95.95 0 0 1 .8-.46h8.85c.52 0 .95.42.95.95v.63Z",fill:"#FFFFFF"}),(0,t.createElement)(u.Path,{d:"M5.05 14.53c0-.53.43-.95.95-.95h7.58V6c0-.52.42-.95.95-.95h.63c.52 0 .95.43.95.95v8.84c0 .34-.19.64-.46.81a.95.95 0 0 1-.8.46H6a.95.95 0 0 1-.95-.95v-.63Z",fill:"#FFFFFF"}))),D=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M19.2 0A4.8 4.8 0 0 1 24 4.8v14.4a4.8 4.8 0 0 1-4.8 4.8H4.8A4.8 4.8 0 0 1 0 19.2V4.8A4.8 4.8 0 0 1 4.8 0h14.4ZM6.89 7.2H5.11l-3.87 9.79-.04.11h2.46l.64-1.63h3.4l.65 1.63h2.45l-.05-.11-.14-.38a4.93 4.93 0 0 0 5.9-1.23l-.01 1.72h2.4v-3.6h3.75v-2.4H18.9V9.6h3.9V7.2h-6.3v1.72a4.94 4.94 0 0 0-8.36 1.43L6.89 7.2Zm5.86 2.28c1.14 0 2.12.72 2.5 1.73l.06.2 1.19-.01v1.8h-1.3a2.67 2.67 0 0 1-2.25 1.61l-.2.01a2.67 2.67 0 1 1 0-5.34ZM6 11.16l.9 2.26H5.1l.9-2.26Z",fill:"#5DE8BF"}));function L(e,t){var l,o;let r=[];if(!e||!t||0===e.length||0===t.length)return r;let a=function(){let e=[{label:(0,n.__)("Hide Block","block-visibility"),attributeSlug:"hideBlock",settingSlug:"hide_block"},{label:(0,n.__)("Browser & Device","block-visibility"),attributeSlug:"browserDevice",settingSlug:"browser_device"},{label:(0,n.__)("Cookie","block-visibility"),attributeSlug:"cookie",settingSlug:"cookie"},{label:(0,n.__)("Date & Time","block-visibility"),attributeSlug:"dateTime",settingSlug:"date_time"},{label:(0,n.__)("Location","block-visibility"),attributeSlug:"location",settingSlug:"location"},{label:(0,n.__)("Metadata","block-visibility"),attributeSlug:"metadata",settingSlug:"metadata"},{label:(0,n.__)("Query String","block-visibility"),attributeSlug:"queryString",settingSlug:"query_string"},{label:(0,n.__)("Referral Source","block-visibility"),attributeSlug:"referralSource",settingSlug:"referral_source"},{label:(0,n.__)("Screen Size","block-visibility"),attributeSlug:"screenSize",settingSlug:"screen_size"},{label:(0,n.__)("URL Path","block-visibility"),attributeSlug:"urlPath",settingSlug:"url_path"},{label:(0,n.__)("User Role","block-visibility"),attributeSlug:"userRole",settingSlug:"visibility_by_role"},{label:(0,n.__)("Visibility Presets","block-visibility"),attributeSlug:"visibilityPresets",settingSlug:"visibility_presets"},{label:(0,n.__)("Advanced Custom Fields","block-visibility"),type:"integration",attributeSlug:"acf",settingSlug:"acf",icon:D},{label:(0,n.__)("WP Fusion","block-visibility"),type:"integration",attributeSlug:"wpFusion",settingSlug:"wp_fusion",icon:I}];return e=(0,s.applyFilters)("blockVisibility.controls",e),e=(0,s.applyFilters)("blockVisibility.coreControls",e),e=(0,s.applyFilters)("blockVisibility.integrationControls",e),e=e.filter(((e,t,l)=>t===l.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 l=!1;var i;return t?.integrations&&(l=null!==(i=t?.integrations[e]?.active)&&void 0!==i&&i),l})(e.settingSlug)||(a=a.filter((t=>t.settingSlug!==e.settingSlug)))}));const c=null!==(l=e?.visibility_controls)&&void 0!==l?l:{};(0,i.isEmpty)(c)||a.forEach((function(e){var t;let l=!1;(0,i.has)(c,e.settingSlug)||(l=!0),(null===(t=c[e.settingSlug]?.enable)||void 0===t||t)&&(l=!0),l&&r.push(e)}));const u=null!==(o=e?.plugin_settings?.default_controls)&&void 0!==o?o:[];return r.forEach((function(e){u.includes(e.settingSlug)&&(e.isDefault=!0)})),r=(0,s.applyFilters)("blockVisibility.enabledControls",r,e,t),r}(0,s.addFilter)("editor.BlockListBlock","block-visibility/contextual-indicators",(function(l){return i=>{var n,o,r;const a=T("settings"),c=T("variables");if("fetching"===a)return(0,t.createElement)(l,i);const{name:u,attributes:d}=i,p=P(a,"enable_contextual_indicators"),N=x(a,u),R=L(a,c);if(!p||!N||0===R.length)return(0,t.createElement)(l,i);const{blockVisibility:A}=d,M=null!==(n=A?.hideBlock)&&void 0!==n&&n&&R.some((e=>"hide_block"===e.settingSlug)),V=null!==(o=A?.controlSets)&&void 0!==o&&o;let F=null!=A?A:{};V&&(F=0!==A.controlSets.length&&A.controlSets[0]?.controls?A.controlSets[0].controls:{});let I={acf:m(F,V,R,c),"browser-device":v(F,V,R),cookie:f(F,V,R),"date-time":y(F,V,R),location:h(F,V,R),metadata:g(F,V,R),"query-string":_(F,V,R),"referral-source":k(F,V,R),"screen-size":E(F,V,R,a),"url-path":S(F,V,R),"user-role":w(F,V,R),"visibility-presets":C(A,R),"wp-fusion":O(F,V,R,c)};I=(0,s.applyFilters)("blockVisibility.contextualIndicatorActiveControls",I,A,F,V,R,c),I=(0,s.applyFilters)("blockVisibility.conditionalIndicatorActiveCoreControls",I,A,F,V,R,c),I=Object.keys(I).filter((e=>!0===I[e])),null===(r=a?.visibility_controls?.general?.enable_local_controls)||void 0===r||r||(I=I.filter((e=>"hide-block"===e||"visibility-presets"===e))),I.sort();let D="";I.length>1?D="block-visibility__has-"+I.length+"-controls":0!==I.length&&(D="block-visibility__has-"+I.join("-"));let H=b()({"block-visibility__is-hidden":M},D);H&&(H+=" block-visibility__has-visibility"),H=(0,s.applyFilters)("blockVisibility.contextualIndicatorClasses",H,I,F,R,c),H=(0,s.applyFilters)("blockVisibility.conditionalIndicatorClasses",H);const B=b()(i?.className,H);return(0,t.createElement)(l,e({},i,{className:B}))}}));const H=window.wp.blockEditor;function B(e,t){var l,i,n;let o=!0;if(null===(l=e?.plugin_settings?.enable_user_role_restrictions)||void 0===l||!l)return o;const r=null!==(i=e?.plugin_settings?.enabled_user_roles)&&void 0!==i?i:[];-1===r.indexOf("administrator")&&r.push("administrator");const s=null!==(n=t?.current_users_roles)&&void 0!==n?n:[];return o=0!==s.length&&s.every((e=>-1!==r.indexOf(e))),o}const U=(0,o.withSelect)((e=>{var t,l;const{getEntityRecord:i}=e("core"),{getBlocks:n,getBlockName:o,getSelectedBlockClientIds:r,getBlockAttributes:s,hasMultiSelection:a}=e("core/block-editor"),{getBlockType:c}=e("core/blocks"),u=!a(),d=r(),p=0===d.length?null:d[0],b=c(o(p)),m=s(p),v=null!==(t=i("block-visibility/v1","settings"))&&void 0!==t?t:"fetching";let f=null!==(l=i("block-visibility/v1","variables"))&&void 0!==l?l:"fetching";const y=n().filter((e=>"core/widget-area"===e.name));return"fetching"!==f&&(f={...f,isWidgetEditor:y.length>0}),{enableMenuItem:u,clientId:p,blockType:b,blockAttributes:m,settings:v,variables:f}}))((function(e){var l;const{flashBlock:r,updateBlockAttributes:s}=(0,o.useDispatch)("core/block-editor"),{createSuccessNotice:a}=(0,o.useDispatch)("core/notices"),{blockAttributes:c,blockType:d,clientId:p,enableMenuItem:b,globallyRestricted:m,settings:v,variables:f,widgetAreaRestricted:y}=e;if("fetching"===v||"fetching"===f)return null;if(!B(v,f))return null;if(!b||!d)return null;if(y.includes(d.name)&&f?.isWidgetEditor||m.includes(d.name))return null;const h=P(v,"enable_toolbar_controls"),g=x(v,d.name),_=L(v,f);if(!h||!g||!_.some((e=>"hide_block"===e.settingSlug)))return null;const{blockVisibility:k}=c,E=null!==(l=k?.hideBlock)&&void 0!==l&&l,S=E?N:R,w=E?(0,n.__)("Enable block","block-visibility"):(0,n.__)("Hide block","block-visibility"),C=d.title,O=E?(0,n.sprintf)( +(()=>{var e={184:(e,t)=>{var l;!function(){"use strict";var i={}.hasOwnProperty;function n(){for(var e=[],t=0;t{"use strict";var i=l(742),n={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var l,o,r,s,a,c,u=!1;t||(t={}),l=t.debug||!1;try{if(r=i(),s=document.createRange(),a=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(i){if(i.stopPropagation(),t.format)if(i.preventDefault(),void 0===i.clipboardData){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=n[t.format]||n.default;window.clipboardData.setData(o,e)}else i.clipboardData.clearData(),i.clipboardData.setData(t.format,e);t.onCopy&&(i.preventDefault(),t.onCopy(i.clipboardData))})),document.body.appendChild(c),s.selectNodeContents(c),a.addRange(s),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(i){l&&console.error("unable to copy using execCommand: ",i),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(i){l&&console.error("unable to copy using clipboardData: ",i),l&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(s):a.removeAllRanges()),c&&document.body.removeChild(c),r()}return u}},679:(e,t,l)=>{"use strict";var i=l(864),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function a(e){return i.isMemo(e)?r:s[e.$$typeof]||n}s[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[i.Memo]=r;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,b=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,l,i){if("string"!=typeof l){if(m){var n=b(l);n&&n!==m&&e(t,n,i)}var r=u(l);d&&(r=r.concat(d(l)));for(var s=a(t),v=a(l),f=0;f{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var n=s(l(196)),o=s(l(640)),r=["text","onCopy","options","children"];function s(e){return e&&e.__esModule?e:{default:e}}function a(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 c(e){for(var t=1;t=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}(e,r),i=n.default.Children.only(t);return n.default.cloneElement(i,c(c({},l),{},{onClick:this.onClick}))}}])&&u(t.prototype,l),Object.defineProperty(t,"prototype",{writable:!1}),f}(n.default.PureComponent);t.CopyToClipboard=v,m(v,"defaultProps",{onCopy:void 0,options:void 0})},855:(e,t,l)=>{"use strict";var i=l(300).CopyToClipboard;i.CopyToClipboard=i,e.exports=i},921:(e,t)=>{"use strict";var l="function"==typeof Symbol&&Symbol.for,i=l?Symbol.for("react.element"):60103,n=l?Symbol.for("react.portal"):60106,o=l?Symbol.for("react.fragment"):60107,r=l?Symbol.for("react.strict_mode"):60108,s=l?Symbol.for("react.profiler"):60114,a=l?Symbol.for("react.provider"):60109,c=l?Symbol.for("react.context"):60110,u=l?Symbol.for("react.async_mode"):60111,d=l?Symbol.for("react.concurrent_mode"):60111,p=l?Symbol.for("react.forward_ref"):60112,b=l?Symbol.for("react.suspense"):60113,m=l?Symbol.for("react.suspense_list"):60120,v=l?Symbol.for("react.memo"):60115,f=l?Symbol.for("react.lazy"):60116,y=l?Symbol.for("react.block"):60121,h=l?Symbol.for("react.fundamental"):60117,g=l?Symbol.for("react.responder"):60118,_=l?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 o:case s:case r:case b:return e;default:switch(e=e&&e.$$typeof){case c:case p:case f:case v:case a:return e;default:return t}}case n:return t}}}function E(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=a,t.Element=i,t.ForwardRef=p,t.Fragment=o,t.Lazy=f,t.Memo=v,t.Portal=n,t.Profiler=s,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)===a},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)===o},t.isLazy=function(e){return k(e)===f},t.isMemo=function(e){return k(e)===v},t.isPortal=function(e){return k(e)===n},t.isProfiler=function(e){return k(e)===s},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===o||e===d||e===s||e===r||e===b||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===a||e.$$typeof===c||e.$$typeof===p||e.$$typeof===h||e.$$typeof===g||e.$$typeof===_||e.$$typeof===y)},t.typeOf=k},864:(e,t,l)=>{"use strict";e.exports=l(921)},742:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,l=[],i=0;i{"use strict";e.exports=window.React}},t={};function l(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,l),o.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(){return e=Object.assign||function(e){for(var t=1;t"acf"===e.settingSlug)))return!1;if(t&&!e.hasOwnProperty("acf"))return!1;let r=!0;return 0===(null!==(o=e?.acf?.ruleSets)&&void 0!==o?o:[]).length&&(r=!1),r}function v(e,t,l){var i;if(t&&!e.hasOwnProperty("browserDevice"))return!1;if(!l.some((e=>"browser_device"===e.settingSlug)))return!1;let n=!0;return 0===(null!==(i=e?.browserDevice?.ruleSets)&&void 0!==i?i:[]).length&&(n=!1),n}function f(e,t,l){var i;if(t&&!e.hasOwnProperty("cookie"))return!1;if(!l.some((e=>"cookie"===e.settingSlug)))return!1;let n=!0;return 0===(null!==(i=e?.cookie?.ruleSets)&&void 0!==i?i:[]).length&&(n=!1),n}function y(e,t,l){if(t&&!e.hasOwnProperty("dateTime"))return!1;if(!l.some((e=>"date_time"===e.settingSlug)))return!1;let i=[],n=!1;var o,r;if(t?(i=null!==(o=e.dateTime?.schedules)&&void 0!==o?o:[],n=null!==(r=e.dateTime?.hideOnSchedules)&&void 0!==r&&r):i=e?.scheduling?[e?.scheduling]:[],0===i.length)return!1;const s=[];return i.forEach((e=>{var t,l,i,o,r;const a=null!==(t=e?.enable)&&void 0!==t&&t,c=null!==(l=e?.start)&&void 0!==l?l:"",u=null!==(i=e?.end)&&void 0!==i?i:"",d=null!==(o=e?.dayOfWeek?.enable)&&void 0!==o&&o,p=null!==(r=e?.timeOfDay?.enable)&&void 0!==r&&r;let b=!0;a||(b=!1),n||!a||c||u||d||p||(b=!1),a&&c&&u&&c>=u&&(b=!1),s.push(b)})),s.includes(!0)}function h(e,t,l){var i;if(t&&!e.hasOwnProperty("location"))return!1;if(!l.some((e=>"location"===e.settingSlug)))return!1;let n=!0;return 0===(null!==(i=e?.location?.ruleSets)&&void 0!==i?i:[]).length&&(n=!1),n}function g(e,t,l){var i;if(t&&!e.hasOwnProperty("metadata"))return!1;if(!l.some((e=>"metadata"===e.settingSlug)))return!1;let n=!0;return 0===(null!==(i=e?.metadata?.ruleSets)&&void 0!==i?i:[]).length&&(n=!1),n}function _(e,t,l){var i,n,o;if(t&&!e.hasOwnProperty("queryString"))return!1;if(!l.some((e=>"query_string"===e.settingSlug)))return!1;const r=null!==(i=e?.queryString?.queryStringAny)&&void 0!==i?i:"",s=null!==(n=e?.queryString?.queryStringAll)&&void 0!==n?n:"",a=null!==(o=e?.queryString?.queryStringNot)&&void 0!==o?o:"";let c=!0;return r||s||a||(c=!1),c}function k(e,t,l){var i,n;if(t&&!e.hasOwnProperty("referralSource"))return!1;if(!l.some((e=>"referral_source"===e.settingSlug)))return!1;const o=null!==(i=e?.referralSource?.contains)&&void 0!==i?i:"",r=null!==(n=e?.referralSource?.doesNotContain)&&void 0!==n?n:"";let s=!0;return o||r||(s=!1),s}function E(e,t,l,i){var n,o;if(t&&!e.hasOwnProperty("screenSize"))return!1;const r=t?e.screenSize:e,s=null!==(n=r?.hideOnScreenSize)&&void 0!==n?n:{extraLarge:!1,large:!1,medium:!1,small:!1,extraSmall:!1},a=null!==(o=i?.visibility_controls?.screen_size?.controls)&&void 0!==o?o:{extra_large:!0,large:!0,medium:!0,small:!0,extra_small:!0},c=[!(!s.extraLarge||!a.extra_large),!(!s.large||!a.large),!(!s.medium||!a.medium),!(!s.small||!a.small),!(!s.extraSmall||!a.extra_small)];let u=!0;return l.some((e=>"screen_size"===e.settingSlug))&&c.includes(!0)||(u=!1),u}function S(e,t,l){var i,n;if(t&&!e.hasOwnProperty("urlPath"))return!1;if(!l.some((e=>"url_path"===e.settingSlug)))return!1;const o=null!==(i=e?.urlPath?.contains)&&void 0!==i?i:"",r=null!==(n=e?.urlPath?.doesNotContain)&&void 0!==n?n:"";let s=!0;return o||r||(s=!1),s}function w(e,t,l){var i,n,o,r,s,a;if(t&&!e.hasOwnProperty("userRole"))return!1;const c=t?e.userRole:e,u=null!==(i=c?.visibilityByRole)&&void 0!==i?i:"public",d=null!==(n=c?.restrictedRoles)&&void 0!==n?n:[],p=null!==(o=c?.hideOnRestrictedRoles)&&void 0!==o&&o,b=null!==(r=c?.restrictedUsers)&&void 0!==r?r:[],m=null!==(s=c?.hideOnRestrictedUsers)&&void 0!==s&&s,v=null!==(a=c?.ruleSets)&&void 0!==a?a:[];let f=!0;return l.some((e=>"visibility_by_role"===e.settingSlug))&&u&&"public"!==u&&"all"!==u||(f=!1),"user-role"===u&&0===d.length&&p&&(f=!1),"users"===u&&0===b.length&&m&&(f=!1),"user-rule-sets"===u&&0===v.length&&(f=!1),f}function C(e,t){var l;return!!t.some((e=>"visibility_presets"===e.settingSlug))&&0!==(null!==(l=e?.visibilityPresets?.presets)&&void 0!==l?l:[]).length}function O(e,t,l,i){var n,o,r,s,a,c;if(null===(n=i?.integrations?.wp_fusion?.active)||void 0===n||!n||!l.some((e=>"wp_fusion"===e.settingSlug)))return!1;if(t&&!e.hasOwnProperty("wpFusion"))return!1;const u=null!==(o=e.hasOwnProperty("userRole"))&&void 0!==o&&o,d=null!==(r=e?.userRole?.visibilityByRole)&&void 0!==r?r:"public",p="public"===d||"logged-out"===d,b=null!==(s=e?.wpFusion?.tagsAny)&&void 0!==s?s:[],m=null!==(a=e?.wpFusion?.tagsAll)&&void 0!==a?a:[],v=null!==(c=e?.wpFusion?.tagsNot)&&void 0!==c?c:[];let f=!0;return(!u&&0===v.length||"public"===d&&0===v.length||"logged-out"===d)&&(f=!1),p||0!==b.length||0!==m.length||0!==v.length||(f=!1),f}function x(e,t){if(!e||0===e.length)return!1;const l=e.disabled_blocks.includes(t),i=(0,a.getBlockSupport)(t,"blockVisibility",!1);return!(l||!i)}function T(e){const{data:t="fetching"}=(0,o.useSelect)((t=>{const{getEntityRecord:l}=t("core");return{data:l("block-visibility/v1",e)}}),[]);return t}function P(e,t){let l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||0===e.length)return!1;const n=e.plugin_settings;return(0,i.has)(n,t)?n[t]:l}(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},(0,t.createElement)(u.Path,{d:"M128 0c70.7 0 128 57.3 128 128s-57.3 128-128 128S0 198.7 0 128 57.3 0 128 0Zm0 67a95.67 95.67 0 0 0-88.56 59.65l-.44 1.09v.52l.47 1.19A95.67 95.67 0 0 0 128 189a95.67 95.67 0 0 0 88.56-59.65l.44-1.09v-.52l-.47-1.19A95.67 95.67 0 0 0 128 67Zm0 21a40 40 0 1 1 0 80 40 40 0 0 1 0-80Zm8 16a16 16 0 1 0 0 32 16 16 0 0 0 0-32Z"}));const N=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M12 16c2.208 0 4-1.792 4-4s-1.792-4-4-4-4 1.792-4 4 1.792 4 4 4Zm0-1.5c-1.3796 0-2.5-1.1204-2.5-2.5s1.1204-2.5 2.5-2.5 2.5 1.1204 2.5 2.5-1.1204 2.5-2.5 2.5Z"}),(0,t.createElement)(u.Path,{d:"M12 16c2.208 0 4-1.792 4-4s-1.792-4-4-4-4 1.792-4 4 1.792 4 4 4Zm0-1.5c-1.3796 0-2.5-1.1204-2.5-2.5s1.1204-2.5 2.5-2.5 2.5 1.1204 2.5 2.5-1.1204 2.5-2.5 2.5Z"}),(0,t.createElement)(u.Path,{d:"M12 4.5c5 0 9.27 3.11 11 7.5-1.73 4.39-6 7.5-11 7.5S2.73 16.39 1 12c1.73-4.39 6-7.5 11-7.5Zm9.3474 7.5C19.6714 8.4585 16.0654 6.1071 12 6.1071c-4.0653 0-7.6714 2.3514-9.3474 5.8929 1.676 3.5415 5.282 5.8929 9.3474 5.8929 4.0653 0 7.6714-2.3514 9.3474-5.8929Z"})),A=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M13.9709 15.481A3.9797 3.9797 0 0 1 12 16c-2.208 0-4-1.792-4-4a3.98 3.98 0 0 1 .4854-1.9106l1.1417 1.1222A2.4937 2.4937 0 0 0 9.5 12c0 1.3796 1.1204 2.5 2.5 2.5.2906 0 .5697-.0497.8292-.141l1.1417 1.122ZM15.8137 13.2094l-1.315-1.2926c-.0436-1.3279-1.1252-2.3955-2.4587-2.4165l-1.315-1.2925A3.9918 3.9918 0 0 1 12 8c2.208 0 4 1.792 4 4a3.994 3.994 0 0 1-.1863 1.2094Z"}),(0,t.createElement)(u.Path,{d:"M16.9542 18.4125C15.4477 19.1105 13.7696 19.5 12 19.5c-5 0-9.27-3.11-11-7.5.8355-2.1201 2.2634-3.9417 4.0798-5.2586l1.1408 1.1212C4.697 8.8849 3.454 10.3063 2.6526 12c1.676 3.5415 5.282 5.8929 9.3474 5.8929 1.3052 0 2.563-.2424 3.7249-.6887l1.2293 1.2083ZM19.4899 16.8186l-1.1243-1.105c1.2566-.9771 2.2857-2.2427 2.9818-3.7136-1.676-3.5415-5.282-5.8929-9.3474-5.8929-1.027 0-2.0246.15-2.9692.4315L7.7566 5.2862C9.0734 4.7784 10.504 4.5 12 4.5c5 0 9.27 3.11 11 7.5-.746 1.8932-1.9645 3.5483-3.5101 4.8186ZM2.7243 4.4261l16.5 16.2175a.75.75 0 0 0 1.0514-1.0697l-16.5-16.2175A.75.75 0 0 0 2.7243 4.426Z"})),R=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M12 3c4.9706 0 9 4.0294 9 9s-4.0294 9-9 9-9-4.0294-9-9 4.0294-9 9-9Zm0 1.595c-4.0897 0-7.405 3.3153-7.405 7.405 0 4.0897 3.3153 7.405 7.405 7.405 4.0897 0 7.405-3.3153 7.405-7.405 0-4.0897-3.3153-7.405-7.405-7.405Zm0 2.5063c.4066 0 .742.3042.7913.6974l.0062.1v3.7714l2.9563 2.9559a.7975.7975 0 0 1-1.0462 1.1991l-.0816-.0713-3.2213-3.2231-.0749-.0983-.0304-.051a.7931.7931 0 0 1-.0907-.2814l-.0062-.1V7.8987c0-.4404.357-.7974.7975-.7974Z"})),M=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"})),V=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M20 19c0 1.1046-.8954 2-2 2H6c-1.1046 0-2-.8954-2-2V5c0-1.1046.8954-2 2-2h12c1.1046 0 2 .8954 2 2v14ZM18.5 8.5V5a.5002.5002 0 0 0-.4101-.492L18 4.5H6a.5002.5002 0 0 0-.492.4101L5.5 5v3.5h13Zm0 5.5v-4h-13v4h13Zm0 5v-3.5h-13V19c0 .2455.1769.4496.4101.492L6 19.5h12a.5002.5002 0 0 0 .492-.4101L18.5 19Z"})),F=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M19 4c1.1046 0 2 .8954 2 2v12c0 1.1046-.8954 2-2 2H5c-1.1046 0-2-.8954-2-2V6c0-1.1046.8954-2 2-2h14ZM8.5 5.5H5a.5002.5002 0 0 0-.492.4101L4.5 6v12c0 .2455.1769.4496.4101.492L5 18.5h3.5v-13Zm5.5 0h-4v13h4v-13Zm5 0h-3.5v13H19a.5002.5002 0 0 0 .492-.4101L19.5 18V6a.5002.5002 0 0 0-.4101-.492L19 5.5Z"})),I=((0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M12 0a11.96 11.96 0 0 1 12 12 11.96 11.96 0 0 1-12 12A11.96 11.96 0 0 1 0 12 11.96 11.96 0 0 1 12 0Zm.69 13.9H11.4v.92l-.13.03c-.3.1-.57.22-.79.38-.22.17-.4.37-.51.6-.12.23-.19.48-.19.76 0 .32.09.6.26.85.16.24.38.44.67.6.2.13.43.24.68.33l.27.09c.24.08.43.16.58.24.13.07.21.14.26.2.04.06.06.13.06.21 0 .1-.03.17-.08.24a.56.56 0 0 1-.25.17c-.14.05-.3.07-.52.08a3.2 3.2 0 0 1-1.37-.33l-.3-.15-.41 1.37.2.1c.13.08.3.14.49.2s.4.1.62.14l.23.03.23.01v.87h1.29v-.98l.06-.02c.33-.1.6-.24.83-.42a1.76 1.76 0 0 0 .68-1.38 1.64 1.64 0 0 0-.83-1.46c-.2-.13-.45-.26-.73-.36l-.22-.08c-.27-.1-.48-.18-.64-.26a.9.9 0 0 1-.3-.2.27.27 0 0 1-.06-.19c0-.05.02-.1.06-.16a.48.48 0 0 1 .21-.15c.12-.05.28-.08.48-.08a2.9 2.9 0 0 1 1.12.24l.28.13.44-1.32-.21-.11a2.9 2.9 0 0 0-.67-.23l-.18-.03-.18-.02-.14-.02v-.85ZM12 1.67A10.32 10.32 0 0 0 1.68 11.9L6.4 7.17 8 8.75l-3.47 3.47h14.94L16 8.75l1.59-1.58 4.73 4.73A10.32 10.32 0 0 0 12 1.68Zm0 .48c.81 0 1.48.48 1.48 1.08V5.5h2.92L12 10.13 7.6 5.5h2.92V3.24c0-.6.67-1.08 1.48-1.08Z",fill:"#000"})),(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M19.2 0A4.8 4.8 0 0 1 24 4.8v14.4a4.8 4.8 0 0 1-4.8 4.8H4.8A4.8 4.8 0 0 1 0 19.2V4.8A4.8 4.8 0 0 1 4.8 0h14.4Zm-.51 4h-.15c-.45.04-.8.27-1.02.74-.97 1.87-1.65 4.9-2.05 9.12a32.67 32.67 0 0 1-1.48-5.68c-.17-.97-.59-1.44-1.27-1.39-.46.03-.85.37-1.16 1l-3.4 6.91C7.6 12.3 7.07 9.36 6.6 5.9c-.1-.87-.55-1.26-1.35-1.2-.43.04-.76.2-.97.52-.22.3-.31.68-.25 1.1.91 6.23 1.77 10.42 2.56 12.6.3.8.67 1.17 1.08 1.14.66-.05 1.43-1.01 2.35-2.89a319.4 319.4 0 0 1 2.23-4.77c.84 3.13 1.99 5.49 3.43 7.06.4.45.82.65 1.22.62.36-.04.64-.24.83-.6.15-.32.21-.68.18-1.1a33 33 0 0 1 .44-6.31c.4-2.79.9-4.8 1.5-6 .13-.24.17-.49.16-.79-.03-.38-.19-.7-.48-.94a1.3 1.3 0 0 0-.98-.33Z",fill:"#683FA6"})),(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M5.05 0H24v18.95A5.05 5.05 0 0 1 18.95 24H0V5.05A5.05 5.05 0 0 1 5.05 0Z",fill:"#E55B10"}),(0,t.createElement)(u.Path,{d:"M19.58 9.79c0 .52-.43.95-.95.95h-7.58v7.58c0 .52-.42.94-.94.94h-.64a.95.95 0 0 1-.94-.94V9.47c0-.34.18-.64.45-.8a.95.95 0 0 1 .8-.46h8.85c.52 0 .95.42.95.95v.63Z",fill:"#FFFFFF"}),(0,t.createElement)(u.Path,{d:"M5.05 14.53c0-.53.43-.95.95-.95h7.58V6c0-.52.42-.95.95-.95h.63c.52 0 .95.43.95.95v8.84c0 .34-.19.64-.46.81a.95.95 0 0 1-.8.46H6a.95.95 0 0 1-.95-.95v-.63Z",fill:"#FFFFFF"}))),D=(0,t.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(u.Path,{d:"M19.2 0A4.8 4.8 0 0 1 24 4.8v14.4a4.8 4.8 0 0 1-4.8 4.8H4.8A4.8 4.8 0 0 1 0 19.2V4.8A4.8 4.8 0 0 1 4.8 0h14.4ZM6.89 7.2H5.11l-3.87 9.79-.04.11h2.46l.64-1.63h3.4l.65 1.63h2.45l-.05-.11-.14-.38a4.93 4.93 0 0 0 5.9-1.23l-.01 1.72h2.4v-3.6h3.75v-2.4H18.9V9.6h3.9V7.2h-6.3v1.72a4.94 4.94 0 0 0-8.36 1.43L6.89 7.2Zm5.86 2.28c1.14 0 2.12.72 2.5 1.73l.06.2 1.19-.01v1.8h-1.3a2.67 2.67 0 0 1-2.25 1.61l-.2.01a2.67 2.67 0 1 1 0-5.34ZM6 11.16l.9 2.26H5.1l.9-2.26Z",fill:"#5DE8BF"}));function L(e,t){var l,o;let r=[];if(!e||!t||0===e.length||0===t.length)return r;let a=function(){let e=[{label:(0,n.__)("Hide Block","block-visibility"),attributeSlug:"hideBlock",settingSlug:"hide_block"},{label:(0,n.__)("Browser & Device","block-visibility"),attributeSlug:"browserDevice",settingSlug:"browser_device"},{label:(0,n.__)("Cookie","block-visibility"),attributeSlug:"cookie",settingSlug:"cookie"},{label:(0,n.__)("Date & Time","block-visibility"),attributeSlug:"dateTime",settingSlug:"date_time"},{label:(0,n.__)("Location","block-visibility"),attributeSlug:"location",settingSlug:"location"},{label:(0,n.__)("Metadata","block-visibility"),attributeSlug:"metadata",settingSlug:"metadata"},{label:(0,n.__)("Query String","block-visibility"),attributeSlug:"queryString",settingSlug:"query_string"},{label:(0,n.__)("Referral Source","block-visibility"),attributeSlug:"referralSource",settingSlug:"referral_source"},{label:(0,n.__)("Screen Size","block-visibility"),attributeSlug:"screenSize",settingSlug:"screen_size"},{label:(0,n.__)("URL Path","block-visibility"),attributeSlug:"urlPath",settingSlug:"url_path"},{label:(0,n.__)("User Role","block-visibility"),attributeSlug:"userRole",settingSlug:"visibility_by_role"},{label:(0,n.__)("Visibility Presets","block-visibility"),attributeSlug:"visibilityPresets",settingSlug:"visibility_presets"},{label:(0,n.__)("Advanced Custom Fields","block-visibility"),type:"integration",attributeSlug:"acf",settingSlug:"acf",icon:D},{label:(0,n.__)("WP Fusion","block-visibility"),type:"integration",attributeSlug:"wpFusion",settingSlug:"wp_fusion",icon:I}];return e=(0,s.applyFilters)("blockVisibility.controls",e),e=(0,s.applyFilters)("blockVisibility.coreControls",e),e=(0,s.applyFilters)("blockVisibility.integrationControls",e),e=e.filter(((e,t,l)=>t===l.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 l=!1;var i;return t?.integrations&&(l=null!==(i=t?.integrations[e]?.active)&&void 0!==i&&i),l})(e.settingSlug)||(a=a.filter((t=>t.settingSlug!==e.settingSlug)))}));const c=null!==(l=e?.visibility_controls)&&void 0!==l?l:{};(0,i.isEmpty)(c)||a.forEach((function(e){var t;let l=!1;(0,i.has)(c,e.settingSlug)||(l=!0),(null===(t=c[e.settingSlug]?.enable)||void 0===t||t)&&(l=!0),l&&r.push(e)}));const u=null!==(o=e?.plugin_settings?.default_controls)&&void 0!==o?o:[];return r.forEach((function(e){u.includes(e.settingSlug)&&(e.isDefault=!0)})),r=(0,s.applyFilters)("blockVisibility.enabledControls",r,e,t),r}(0,s.addFilter)("editor.BlockListBlock","block-visibility/contextual-indicators",(function(l){return i=>{var n,o,r;const a=T("settings"),c=T("variables");if("fetching"===a)return(0,t.createElement)(l,i);const{name:u,attributes:d}=i,p=P(a,"enable_contextual_indicators"),N=x(a,u),A=L(a,c);if(!p||!N||0===A.length)return(0,t.createElement)(l,i);const{blockVisibility:R}=d,M=null!==(n=R?.hideBlock)&&void 0!==n&&n&&A.some((e=>"hide_block"===e.settingSlug)),V=null!==(o=R?.controlSets)&&void 0!==o&&o;let F=null!=R?R:{};V&&(F=0!==R.controlSets.length&&R.controlSets[0]?.controls?R.controlSets[0].controls:{});let I={acf:m(F,V,A,c),"browser-device":v(F,V,A),cookie:f(F,V,A),"date-time":y(F,V,A),location:h(F,V,A),metadata:g(F,V,A),"query-string":_(F,V,A),"referral-source":k(F,V,A),"screen-size":E(F,V,A,a),"url-path":S(F,V,A),"user-role":w(F,V,A),"visibility-presets":C(R,A),"wp-fusion":O(F,V,A,c)};I=(0,s.applyFilters)("blockVisibility.contextualIndicatorActiveControls",I,R,F,V,A,c),I=(0,s.applyFilters)("blockVisibility.conditionalIndicatorActiveCoreControls",I,R,F,V,A,c),I=Object.keys(I).filter((e=>!0===I[e])),null===(r=a?.visibility_controls?.general?.enable_local_controls)||void 0===r||r||(I=I.filter((e=>"hide-block"===e||"visibility-presets"===e))),I.sort();let D="";I.length>1?D="block-visibility__has-"+I.length+"-controls":0!==I.length&&(D="block-visibility__has-"+I.join("-"));let H=b()({"block-visibility__is-hidden":M},D);H&&(H+=" block-visibility__has-visibility"),H=(0,s.applyFilters)("blockVisibility.contextualIndicatorClasses",H,I,F,A,c),H=(0,s.applyFilters)("blockVisibility.conditionalIndicatorClasses",H);const B=b()(i?.className,H);return(0,t.createElement)(l,e({},i,{className:B}))}}));const H=window.wp.blockEditor;function B(e,t){var l,i,n;let o=!0;if(null===(l=e?.plugin_settings?.enable_user_role_restrictions)||void 0===l||!l)return o;const r=null!==(i=e?.plugin_settings?.enabled_user_roles)&&void 0!==i?i:[];-1===r.indexOf("administrator")&&r.push("administrator");const s=null!==(n=t?.current_users_roles)&&void 0!==n?n:[];return o=0!==s.length&&s.every((e=>-1!==r.indexOf(e))),o}const U=(0,o.withSelect)((e=>{var t,l;const{getEntityRecord:i}=e("core"),{getBlocks:n,getBlockName:o,getSelectedBlockClientIds:r,getBlockAttributes:s,hasMultiSelection:a}=e("core/block-editor"),{getBlockType:c}=e("core/blocks"),u=!a(),d=r(),p=0===d.length?null:d[0],b=c(o(p)),m=s(p),v=null!==(t=i("block-visibility/v1","settings"))&&void 0!==t?t:"fetching";let f=null!==(l=i("block-visibility/v1","variables"))&&void 0!==l?l:"fetching";const y=n().filter((e=>"core/widget-area"===e.name));return"fetching"!==f&&(f={...f,isWidgetEditor:y.length>0}),{enableMenuItem:u,clientId:p,blockType:b,blockAttributes:m,settings:v,variables:f}}))((function(e){var l;const{flashBlock:r,updateBlockAttributes:s}=(0,o.useDispatch)("core/block-editor"),{createSuccessNotice:a}=(0,o.useDispatch)("core/notices"),{blockAttributes:c,blockType:d,clientId:p,enableMenuItem:b,globallyRestricted:m,settings:v,variables:f,widgetAreaRestricted:y}=e;if("fetching"===v||"fetching"===f)return null;if(!B(v,f))return null;if(!b||!d)return null;if(y.includes(d.name)&&f?.isWidgetEditor||m.includes(d.name))return null;const h=P(v,"enable_toolbar_controls"),g=x(v,d.name),_=L(v,f);if(!h||!g||!_.some((e=>"hide_block"===e.settingSlug)))return null;const{blockVisibility:k}=c,E=null!==(l=k?.hideBlock)&&void 0!==l&&l,S=E?N:A,w=E?(0,n.__)("Enable block","block-visibility"):(0,n.__)("Hide block","block-visibility"),C=d.title,O=E?(0,n.sprintf)( // Translators: Name of the block being made visible, e.g. "Paragraph". (0,n.__)('"%s" is now visible.'),C):(0,n.sprintf)( // Translators: Name of the block being hidden, e.g. "Paragraph". -(0,n.__)('"%s" is now hidden.'),C);return(0,t.createElement)(H.BlockSettingsMenuControls,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{s(p,{blockVisibility:(0,i.assign)({...k},{hideBlock:!E})}),r(p),a(O,{type:"snackbar"})},icon:S,label:w},w))})),j=window.wp.primitives,z=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),q=function(e){let{icon:l,size:i=24,...n}=e;return(0,t.cloneElement)(l,{width:i,height:i,...n})};function G(e){const{presetAttributes:l,setPresetAttributes:o,presets:r,addNewPreset:s,hasUpdates:a,setHasUpdates:c}=e,[d,p]=(0,t.useState)(""),[m,v]=(0,t.useState)({open:!1}),f="fetching"===r;let y=r;function h(e){const t=r.filter((t=>t.id===e));if(!(0,i.isEmpty)(t)){var l,n,s,a;const e=t[0];o({id:e.id,title:e.title.raw,date:e?.date,modified:e?.modified,enable:null===(l=e?.meta?.enable)||void 0===l||l,layout:null!==(n=e?.meta?.layout)&&void 0!==n?n:"columns",hideBlock:null!==(s=e?.meta?.hide_block)&&void 0!==s&&s,controlSets:null!==(a=e?.meta?.control_sets)&&void 0!==a?a:[]}),c(!1)}}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a?v({open:!0,type:e,id:t}):"edit"===e?h(t):s()}!f&&d&&d.length>1&&(y=r.filter((e=>{var t;const l=d.toLowerCase();let i=null!==(t=e?.title?.raw)&&void 0!==t?t:"";return i=!!i&&i.toLowerCase(),!!i.includes(l)})));const _=(0,t.createElement)(u.Modal,{className:"block-visibility__confirmation-modal",title:(0,n.__)("Unsaved changes","block-visibility"),onRequestClose:()=>v({open:!1}),shouldCloseOnClickOutside:!1},(0,t.createElement)("p",null,(0,n.__)("The current preset has unsaved changes. Would you like to continue? This action cannot be undone.","block-visibility")),(0,t.createElement)("div",{className:"block-visibility__confirmation-modal--buttons"},(0,t.createElement)(u.Button,{isSecondary:!0,onClick:()=>v({open:!1})},(0,n.__)("Cancel","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>{"edit"===m?.type?h(m?.id):s(),v({open:!1})}},(0,n.__)("Confirm","block-visibility"))));return(0,t.createElement)("div",{className:"preset-manager__sidebar"},(0,t.createElement)(u.SearchControl,{className:b()({"is-disabled":(0,i.isEmpty)(r)||f}),value:d,onChange:p,disabled:(0,i.isEmpty)(r)||f}),(0,t.createElement)("div",{className:"sidebar__presets-title"},(0,t.createElement)("span",null,(0,n.__)("Presets","block-visibility")),(0,t.createElement)(u.Button,{label:(0,n.__)("Add new preset","block-visibility"),icon:z,onClick:()=>g("add")})),f&&(0,t.createElement)(u.Spinner,null),!f&&(0,i.isEmpty)(y)&&d&&(0,t.createElement)("div",{className:"sidebar__presets-no-results"},(0,t.createElement)(q,{icon:R}),(0,t.createElement)("p",null,(0,n.__)("No presets found.","block-visibility"))),!f&&(0,i.isEmpty)(y)&&!d&&(0,t.createElement)("div",{className:"sidebar__presets-placeholder"},(0,t.createElement)("span",null),(0,t.createElement)("span",null),(0,t.createElement)("span",null),(0,t.createElement)("span",null)),!f&&!(0,i.isEmpty)(y)&&(0,t.createElement)(u.MenuGroup,{className:"sidebar__presets-list"},y.map((e=>{const i=e?.title?.raw?e?.title?.raw:(0,n.__)("(no title)","block-visibility"),o=l?.id===e.id,r=e?.meta?.enable;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuItem,{key:`category-${e.id}`,className:b()({"is-active":o}),isPressed:o,onClick:()=>g("edit",e.id)},(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"title"},i),!r&&(0,t.createElement)(u.Tooltip,{text:(0,n.__)("Disabled","block-visibility")},(0,t.createElement)("span",{className:"is-disabled"},(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("circle",{cx:"12",cy:"12",r:"12"})))))))}))),m?.open&&_)}const $=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),W=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),Z=window.wp.date,Y="https://www.blockvisibilitywp.com/",X="https://www.blockvisibilitywp.com/knowledge-base/",K="utm_source=plugin&utm_medium=editor&utm_campaign=plugin_referrals",Q="utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",J="bv_query=learn_more",ee={blockVisibilityHome:Y,blockVisibilityOrgSupport:"https://wordpress.org/support/plugin/block-visibility",blockVisibilityOrgReviews:"https://wordpress.org/support/plugin/block-visibility/reviews/?filter=5",gitHub:"https://github.com/ndiego/block-visibility",twitter:"https://twitter.com/BlockVisibility",settingsHome:Y+"?"+J+"&"+Q,settingsKnowledgeBase:X+"?"+J+"&"+Q,settingsGeneral:X+"how-to-configure-the-general-settings/?"+J+"&"+Q,settingsBlockManager:X+"how-to-configure-the-block-manager/?"+J+"&"+Q,settingsACF:X+"how-to-use-the-advanced-custom-fields-control/?"+J+"&"+Q,settingsBrowserDevice:X+"how-to-use-the-browser-device-control/?"+J+"&"+Q,settingsCookie:X+"how-to-use-the-cookie-control/?"+J+"&"+Q,settingsDateTime:X+"how-to-use-the-date-time-control/?"+J+"&"+Q,settingsEDD:X+"how-to-use-the-easy-digital-downloads-control/?"+J+"&"+Q,settingsHideBlock:X+"how-to-use-the-hide-block-control/?"+J+"&"+Q,settingsLocation:X+"how-to-use-the-location-control/?"+J+"&"+Q,settingsMetadata:X+"how-to-use-the-metadata-control/?"+J+"&"+Q,settingsQueryString:X+"how-to-use-the-query-string-control/?"+J+"&"+Q,settingsReferralSource:X+"how-to-use-the-referral-source-control/?"+J+"&"+Q,settingsScreenSize:X+"how-to-use-the-screen-size-control//?"+J+"&"+Q,settingsUrlPath:X+"how-to-use-the-url-path-control/?"+J+"&"+Q,settingsUserRole:X+"how-to-use-the-user-role-control/?"+J+"&"+Q,settingsVisibilityControls:X+"guide-to-visibility-controls-in-block-visibility/?"+J+"&"+Q,settingsVisibilityContolsIntegrations:X+"guide-to-third-party-integrations-in-block-visibility/?"+J+"&"+Q,settingsVisibilityPresets:X+"guide-to-visibility-presets/?"+J+"&"+Q,settingsWoocommerce:X+"how-to-use-the-woocommerce-control/?"+J+"&"+Q,settingsWpFusion:X+"how-to-use-the-wp-fusion-control/?"+J+"&"+Q,editorACF:X+"how-to-use-the-advanced-custom-fields-control/?"+J+"&"+K,editorBrowserDevice:X+"how-to-use-the-browser-device-control/?"+J+"&"+K,editorCookie:X+"how-to-use-the-cookie-control/?"+J+"&"+K,editorDateTime:X+"how-to-use-the-date-time-control/?"+J+"&"+K,editorEDD:X+"how-to-use-the-easy-digital-downloads-control/?"+J+"&"+K,editorHideBlock:X+"how-to-use-the-hide-block-control/?"+J+"&"+K,editorLocation:X+"how-to-use-the-location-control/?"+J+"&"+K,editorMetadata:X+"how-to-use-the-metadata-control/?"+J+"&"+K,editorQueryString:X+"how-to-use-the-query-string-control/?"+J+"&"+K,editorReferralSource:X+"how-to-use-the-referral-source-control/?"+J+"&"+K,editorScreenSize:X+"how-to-use-the-screen-size-control//?"+J+"&"+K,editorUrlPath:X+"how-to-use-the-url-path-control/?"+J+"&"+K,editorUserRole:X+"how-to-use-the-user-role-control/?"+J+"&"+K,editorVisibilityPresets:X+"guide-to-visibility-presets/?"+J+"&"+K,editorWoocommerce:X+"how-to-use-the-woocommerce-control/?"+J+"&"+K,editorWpFusion:X+"how-to-use-the-wp-fusion-control/?"+J+"&"+K};function te(e){var l,s,a,c,d,p;const{presetAttributes:m,setPresetAttributes:v,presets:f,controlSets:y,hasUpdates:h,setHasUpdates:g}=e,{deleteEntityRecord:_,editEntityRecord:k,saveEditedEntityRecord:E,saveEntityRecord:S}=(0,o.useDispatch)(r.store),[w,C]=(0,t.useState)(!1),[O,x]=(0,t.useState)("complete");async function T(){var e,t,l,o,r,s,a,c,u,d,p;let b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publish";x("working");const y="visibility_preset",h=null!==(e=m?.id)&&void 0!==e?e:null;let _=null!==(t=m?.title)&&void 0!==t?t:"";_="duplicate"===b?(0,n.sprintf)( +(0,n.__)('"%s" is now hidden.'),C);return(0,t.createElement)(H.BlockSettingsMenuControls,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{s(p,{blockVisibility:(0,i.assign)({...k},{hideBlock:!E})}),r(p),a(O,{type:"snackbar"})},icon:S,label:w},w))})),j=window.wp.primitives,z=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),q=function(e){let{icon:l,size:i=24,...n}=e;return(0,t.cloneElement)(l,{width:i,height:i,...n})};function G(e){const{presetAttributes:l,setPresetAttributes:o,presets:r,addNewPreset:s,hasUpdates:a,setHasUpdates:c}=e,[d,p]=(0,t.useState)(""),[m,v]=(0,t.useState)({open:!1}),f="fetching"===r;let y=r;function h(e){const t=r.filter((t=>t.id===e));if(!(0,i.isEmpty)(t)){var l,n,s,a;const e=t[0];o({id:e.id,title:e.title.raw,date:e?.date,modified:e?.modified,enable:null===(l=e?.meta?.enable)||void 0===l||l,layout:null!==(n=e?.meta?.layout)&&void 0!==n?n:"columns",hideBlock:null!==(s=e?.meta?.hide_block)&&void 0!==s&&s,controlSets:null!==(a=e?.meta?.control_sets)&&void 0!==a?a:[]}),c(!1)}}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a?v({open:!0,type:e,id:t}):"edit"===e?h(t):s()}!f&&d&&d.length>1&&(y=r.filter((e=>{var t;const l=d.toLowerCase();let i=null!==(t=e?.title?.raw)&&void 0!==t?t:"";return i=!!i&&i.toLowerCase(),!!i.includes(l)})));const _=(0,t.createElement)(u.Modal,{className:"block-visibility__confirmation-modal",title:(0,n.__)("Unsaved changes","block-visibility"),onRequestClose:()=>v({open:!1}),shouldCloseOnClickOutside:!1},(0,t.createElement)("p",null,(0,n.__)("The current preset has unsaved changes. Would you like to continue? This action cannot be undone.","block-visibility")),(0,t.createElement)("div",{className:"block-visibility__confirmation-modal--buttons"},(0,t.createElement)(u.Button,{isSecondary:!0,onClick:()=>v({open:!1})},(0,n.__)("Cancel","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>{"edit"===m?.type?h(m?.id):s(),v({open:!1})}},(0,n.__)("Confirm","block-visibility"))));return(0,t.createElement)("div",{className:"preset-manager__sidebar"},(0,t.createElement)(u.SearchControl,{className:b()({"is-disabled":(0,i.isEmpty)(r)||f}),value:d,onChange:p,disabled:(0,i.isEmpty)(r)||f}),(0,t.createElement)("div",{className:"sidebar__presets-title"},(0,t.createElement)("span",null,(0,n.__)("Presets","block-visibility")),(0,t.createElement)(u.Button,{label:(0,n.__)("Add new preset","block-visibility"),icon:z,onClick:()=>g("add")})),f&&(0,t.createElement)(u.Spinner,null),!f&&(0,i.isEmpty)(y)&&d&&(0,t.createElement)("div",{className:"sidebar__presets-no-results"},(0,t.createElement)(q,{icon:A}),(0,t.createElement)("p",null,(0,n.__)("No presets found.","block-visibility"))),!f&&(0,i.isEmpty)(y)&&!d&&(0,t.createElement)("div",{className:"sidebar__presets-placeholder"},(0,t.createElement)("span",null),(0,t.createElement)("span",null),(0,t.createElement)("span",null),(0,t.createElement)("span",null)),!f&&!(0,i.isEmpty)(y)&&(0,t.createElement)(u.MenuGroup,{className:"sidebar__presets-list"},y.map((e=>{const i=e?.title?.raw?e?.title?.raw:(0,n.__)("(no title)","block-visibility"),o=l?.id===e.id,r=e?.meta?.enable;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuItem,{key:`category-${e.id}`,className:b()({"is-active":o}),isPressed:o,onClick:()=>g("edit",e.id)},(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"title"},i),!r&&(0,t.createElement)(u.Tooltip,{text:(0,n.__)("Disabled","block-visibility")},(0,t.createElement)("span",{className:"is-disabled"},(0,t.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("circle",{cx:"12",cy:"12",r:"12"})))))))}))),m?.open&&_)}const $=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),W=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),Z=window.wp.date,Y="https://www.blockvisibilitywp.com/",X="https://www.blockvisibilitywp.com/knowledge-base/",K="utm_source=plugin&utm_medium=editor&utm_campaign=plugin_referrals",Q="utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",J="bv_query=learn_more",ee={blockVisibilityHome:Y,blockVisibilityOrgSupport:"https://wordpress.org/support/plugin/block-visibility",blockVisibilityOrgReviews:"https://wordpress.org/support/plugin/block-visibility/reviews/?filter=5",gitHub:"https://github.com/ndiego/block-visibility",twitter:"https://twitter.com/BlockVisibility",settingsHome:Y+"?"+J+"&"+Q,settingsKnowledgeBase:X+"?"+J+"&"+Q,settingsGeneral:X+"how-to-configure-the-general-settings/?"+J+"&"+Q,settingsBlockManager:X+"how-to-configure-the-block-manager/?"+J+"&"+Q,settingsACF:X+"how-to-use-the-advanced-custom-fields-control/?"+J+"&"+Q,settingsBrowserDevice:X+"how-to-use-the-browser-device-control/?"+J+"&"+Q,settingsCookie:X+"how-to-use-the-cookie-control/?"+J+"&"+Q,settingsDateTime:X+"how-to-use-the-date-time-control/?"+J+"&"+Q,settingsEDD:X+"how-to-use-the-easy-digital-downloads-control/?"+J+"&"+Q,settingsHideBlock:X+"how-to-use-the-hide-block-control/?"+J+"&"+Q,settingsLocation:X+"how-to-use-the-location-control/?"+J+"&"+Q,settingsMetadata:X+"how-to-use-the-metadata-control/?"+J+"&"+Q,settingsQueryString:X+"how-to-use-the-query-string-control/?"+J+"&"+Q,settingsReferralSource:X+"how-to-use-the-referral-source-control/?"+J+"&"+Q,settingsScreenSize:X+"how-to-use-the-screen-size-control//?"+J+"&"+Q,settingsUrlPath:X+"how-to-use-the-url-path-control/?"+J+"&"+Q,settingsUserRole:X+"how-to-use-the-user-role-control/?"+J+"&"+Q,settingsVisibilityControls:X+"guide-to-visibility-controls-in-block-visibility/?"+J+"&"+Q,settingsVisibilityContolsIntegrations:X+"guide-to-third-party-integrations-in-block-visibility/?"+J+"&"+Q,settingsVisibilityPresets:X+"guide-to-visibility-presets/?"+J+"&"+Q,settingsWoocommerce:X+"how-to-use-the-woocommerce-control/?"+J+"&"+Q,settingsWpFusion:X+"how-to-use-the-wp-fusion-control/?"+J+"&"+Q,editorACF:X+"how-to-use-the-advanced-custom-fields-control/?"+J+"&"+K,editorBrowserDevice:X+"how-to-use-the-browser-device-control/?"+J+"&"+K,editorCookie:X+"how-to-use-the-cookie-control/?"+J+"&"+K,editorDateTime:X+"how-to-use-the-date-time-control/?"+J+"&"+K,editorEDD:X+"how-to-use-the-easy-digital-downloads-control/?"+J+"&"+K,editorHideBlock:X+"how-to-use-the-hide-block-control/?"+J+"&"+K,editorLocation:X+"how-to-use-the-location-control/?"+J+"&"+K,editorMetadata:X+"how-to-use-the-metadata-control/?"+J+"&"+K,editorQueryString:X+"how-to-use-the-query-string-control/?"+J+"&"+K,editorReferralSource:X+"how-to-use-the-referral-source-control/?"+J+"&"+K,editorScreenSize:X+"how-to-use-the-screen-size-control//?"+J+"&"+K,editorUrlPath:X+"how-to-use-the-url-path-control/?"+J+"&"+K,editorUserRole:X+"how-to-use-the-user-role-control/?"+J+"&"+K,editorVisibilityPresets:X+"guide-to-visibility-presets/?"+J+"&"+K,editorWoocommerce:X+"how-to-use-the-woocommerce-control/?"+J+"&"+K,editorWpFusion:X+"how-to-use-the-wp-fusion-control/?"+J+"&"+K};function te(e){var l,s,a,c,d,p;const{presetAttributes:m,setPresetAttributes:v,presets:f,controlSets:y,hasUpdates:h,setHasUpdates:g}=e,{deleteEntityRecord:_,editEntityRecord:k,saveEditedEntityRecord:E,saveEntityRecord:S}=(0,o.useDispatch)(r.store),[w,C]=(0,t.useState)(!1),[O,x]=(0,t.useState)("complete");async function T(){var e,t,l,o,r,s,a,c,u,d,p;let b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publish";x("working");const y="visibility_preset",h=null!==(e=m?.id)&&void 0!==e?e:null;let _=null!==(t=m?.title)&&void 0!==t?t:"";_="duplicate"===b?(0,n.sprintf)( // translators: %s: Title of preset. -(0,n.__)("%s (copy)","block-visibility"),_):_;const w={enable:null===(l=m?.enable)||void 0===l||l,layout:null!==(o=m?.layout)&&void 0!==o?o:"columns",hide_block:null!==(r=m?.hideBlock)&&void 0!==r&&r,control_sets:null!==(s=m?.controlSets)&&void 0!==s?s:[]},C=f.filter((e=>e.id===h)),O=null!==(a=C[0]?.title?.raw)&&void 0!==a?a:"",T={enable:null===(c=C[0]?.meta?.enable)||void 0===c||c,layout:null!==(u=C[0]?.meta?.layout)&&void 0!==u?u:"columns",hide_block:null!==(d=C[0]?.meta?.hide_block)&&void 0!==d&&d,control_sets:null!==(p=C[0]?.meta?.control_sets)&&void 0!==p?p:[]};if((0,i.isEqual)(T,w)&&O===_)return x("complete"),void g(!1);const P={title:_,status:"publish",meta:w};let N="";"update"===b&&h?(N=await k("postType",y,h,P),N=await E("postType",y,h)):N=await S("postType",y,P),N?(v({...m,id:N.id,title:N.title.raw,date:N?.date,modified:N?.modified}),x("complete"),g(!1)):x("error")}const P=null!==(l=m?.id)&&void 0!==l?l:null,N=null!==(s=m?.title)&&void 0!==s?s:"",R=null!==(a=m?.modified)&&void 0!==a?a:"",A=null===(c=m?.enable)||void 0===c||c,M=null!==(d=m?.hideBlock)&&void 0!==d&&d,I=null!==(p=m?.layout)&&void 0!==p?p:"columns",D=(0,Z.__experimentalGetSettings)();function L(e,t){v({...m,[e]:t}),g(!0)}const H=(0,t.createElement)(u.Modal,{className:"block-visibility__confirmation-modal",title:(0,n.__)("Remove preset","block-visibility"),onRequestClose:()=>C(!1),shouldCloseOnClickOutside:!1},(0,t.createElement)("p",null,(0,n.__)("Any blocks that are currently hidden by this preset will become visible again if no other visibility controls are set. Would you like to continue? This action cannot be undone.","block-visibility")),(0,t.createElement)("div",{className:"block-visibility__confirmation-modal--buttons"},(0,t.createElement)(u.Button,{isSecondary:!0,onClick:()=>C(!1)},(0,n.__)("Cancel","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>(_("postType","visibility_preset",P),v({}),g(!1),void C(!1))},(0,n.__)("Remove","block-visibility")))),B=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,n.__)("Options","block-visibility"),icon:$,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>{T("duplicate"),l()},disabled:!P||h},(0,n.__)("Duplicate","block-visibility")),(0,t.createElement)("a",{href:ee.editorVisibilityPresets,target:"_blank",role:"menuitem",rel:"noopener noreferrer",className:"components-button components-menu-item__button"},(0,t.createElement)("span",{className:"components-menu-item__item"},(0,n.__)("Help","block-visibility"),(0,t.createElement)(u.VisuallyHidden,null,(0,n.__)("(opens in a new tab)","block-visibility"))),(0,t.createElement)(q,{icon:W,size:20}))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{C(!0),l()}},(0,n.__)("Remove preset","block-visibility"))))})),U="working"!==O?(0,n.__)("Publish","block-visibility"):(0,n.__)("Publishing","block-visibility"),j="working"!==O?(0,n.__)("Update","block-visibility"):(0,n.__)("Updating","block-visibility"),G=P?j:U;return(0,t.createElement)("div",{className:"preset-manager__preset-header"},(0,t.createElement)("div",{className:"preset-header__toolbar"},(0,t.createElement)("div",{className:"toolbar__control-set-tools"},(0,t.createElement)(u.Button,{label:(0,n.__)("Add control set","block-visibility"),icon:z,onClick:function(){const e={id:Math.max(...y.map((e=>e.id)),0)+1,enable:!0,controls:{}};v({...m,controlSets:[...y,e]}),g(!0)},isPrimary:!0}),(0,t.createElement)(u.Button,{label:(0,n.__)("Display as rows","block-visibility"),icon:V,onClick:()=>L("layout","rows"),isPressed:"rows"===I}),(0,t.createElement)(u.Button,{label:(0,n.__)("Display as columns","block-visibility"),icon:F,onClick:()=>L("layout","columns"),isPressed:"columns"===I})),(0,t.createElement)("div",{className:"toolbar__publish-tools"},(0,t.createElement)(u.Button,{className:b()({"is-busy":"working"===O}),onClick:()=>T(P?"update":"publish"),disabled:!h&&"error"!==O,isPrimary:!0},G),B,w&&H)),"error"===O&&(0,t.createElement)("div",{className:"preset-header__notices"},(0,t.createElement)(u.Notice,{status:"error",isDismissible:!1},(0,n.__)("Something went wrong. Please try again or contact support.","block-visibility"))),(0,t.createElement)("div",{className:"preset-header__settings"},(0,t.createElement)("div",{className:"preset-title"},(0,t.createElement)("div",{className:"preset-title__label"},(0,t.createElement)("span",null,(0,n.__)("Preset Title","block-visibility"))),(0,t.createElement)(u.TextControl,{value:N,onChange:e=>L("title",e),placeholder:(0,n.__)("Add preset title","block-visibility")}),(0,t.createElement)("div",{className:"preset-title__meta"},R&&(0,t.createElement)("span",null,(0,n.sprintf)( +(0,n.__)("%s (copy)","block-visibility"),_):_;const w={enable:null===(l=m?.enable)||void 0===l||l,layout:null!==(o=m?.layout)&&void 0!==o?o:"columns",hide_block:null!==(r=m?.hideBlock)&&void 0!==r&&r,control_sets:null!==(s=m?.controlSets)&&void 0!==s?s:[]},C=f.filter((e=>e.id===h)),O=null!==(a=C[0]?.title?.raw)&&void 0!==a?a:"",T={enable:null===(c=C[0]?.meta?.enable)||void 0===c||c,layout:null!==(u=C[0]?.meta?.layout)&&void 0!==u?u:"columns",hide_block:null!==(d=C[0]?.meta?.hide_block)&&void 0!==d&&d,control_sets:null!==(p=C[0]?.meta?.control_sets)&&void 0!==p?p:[]};if((0,i.isEqual)(T,w)&&O===_)return x("complete"),void g(!1);const P={title:_,status:"publish",meta:w};let N="";"update"===b&&h?(N=await k("postType",y,h,P),N=await E("postType",y,h)):N=await S("postType",y,P),N?(v({...m,id:N.id,title:N.title.raw,date:N?.date,modified:N?.modified}),x("complete"),g(!1)):x("error")}const P=null!==(l=m?.id)&&void 0!==l?l:null,N=null!==(s=m?.title)&&void 0!==s?s:"",A=null!==(a=m?.modified)&&void 0!==a?a:"",R=null===(c=m?.enable)||void 0===c||c,M=null!==(d=m?.hideBlock)&&void 0!==d&&d,I=null!==(p=m?.layout)&&void 0!==p?p:"columns",D=(0,Z.__experimentalGetSettings)();function L(e,t){v({...m,[e]:t}),g(!0)}const H=(0,t.createElement)(u.Modal,{className:"block-visibility__confirmation-modal",title:(0,n.__)("Remove preset","block-visibility"),onRequestClose:()=>C(!1),shouldCloseOnClickOutside:!1},(0,t.createElement)("p",null,(0,n.__)("Any blocks that are currently hidden by this preset will become visible again if no other visibility controls are set. Would you like to continue? This action cannot be undone.","block-visibility")),(0,t.createElement)("div",{className:"block-visibility__confirmation-modal--buttons"},(0,t.createElement)(u.Button,{isSecondary:!0,onClick:()=>C(!1)},(0,n.__)("Cancel","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>(_("postType","visibility_preset",P),v({}),g(!1),void C(!1))},(0,n.__)("Remove","block-visibility")))),B=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,n.__)("Options","block-visibility"),icon:$,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>{T("duplicate"),l()},disabled:!P||h},(0,n.__)("Duplicate","block-visibility")),(0,t.createElement)("a",{href:ee.editorVisibilityPresets,target:"_blank",role:"menuitem",rel:"noopener noreferrer",className:"components-button components-menu-item__button"},(0,t.createElement)("span",{className:"components-menu-item__item"},(0,n.__)("Help","block-visibility"),(0,t.createElement)(u.VisuallyHidden,null,(0,n.__)("(opens in a new tab)","block-visibility"))),(0,t.createElement)(q,{icon:W,size:20}))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{C(!0),l()}},(0,n.__)("Remove preset","block-visibility"))))})),U="working"!==O?(0,n.__)("Publish","block-visibility"):(0,n.__)("Publishing","block-visibility"),j="working"!==O?(0,n.__)("Update","block-visibility"):(0,n.__)("Updating","block-visibility"),G=P?j:U;return(0,t.createElement)("div",{className:"preset-manager__preset-header"},(0,t.createElement)("div",{className:"preset-header__toolbar"},(0,t.createElement)("div",{className:"toolbar__control-set-tools"},(0,t.createElement)(u.Button,{label:(0,n.__)("Add control set","block-visibility"),icon:z,onClick:function(){const e={id:Math.max(...y.map((e=>e.id)),0)+1,enable:!0,controls:{}};v({...m,controlSets:[...y,e]}),g(!0)},isPrimary:!0}),(0,t.createElement)(u.Button,{label:(0,n.__)("Display as rows","block-visibility"),icon:V,onClick:()=>L("layout","rows"),isPressed:"rows"===I}),(0,t.createElement)(u.Button,{label:(0,n.__)("Display as columns","block-visibility"),icon:F,onClick:()=>L("layout","columns"),isPressed:"columns"===I})),(0,t.createElement)("div",{className:"toolbar__publish-tools"},(0,t.createElement)(u.Button,{className:b()({"is-busy":"working"===O}),onClick:()=>T(P?"update":"publish"),disabled:!h&&"error"!==O,isPrimary:!0},G),B,w&&H)),"error"===O&&(0,t.createElement)("div",{className:"preset-header__notices"},(0,t.createElement)(u.Notice,{status:"error",isDismissible:!1},(0,n.__)("Something went wrong. Please try again or contact support.","block-visibility"))),(0,t.createElement)("div",{className:"preset-header__settings"},(0,t.createElement)("div",{className:"preset-title"},(0,t.createElement)("div",{className:"preset-title__label"},(0,t.createElement)("span",null,(0,n.__)("Preset Title","block-visibility"))),(0,t.createElement)(u.TextControl,{value:N,onChange:e=>L("title",e),placeholder:(0,n.__)("Add preset title","block-visibility")}),(0,t.createElement)("div",{className:"preset-title__meta"},A&&(0,t.createElement)("span",null,(0,n.sprintf)( // translators: %s: Date/time preset was created. -(0,n.__)("Modified: %s","block-visibility"),(0,Z.format)(`${D.formats.date} ${D.formats.time}`,R))),P&&(0,t.createElement)("span",null,(0,n.sprintf)( +(0,n.__)("Modified: %s","block-visibility"),(0,Z.format)(`${D.formats.date} ${D.formats.time}`,A))),P&&(0,t.createElement)("span",null,(0,n.sprintf)( // translators: %s: Id of preset. -(0,n.__)("Id: %s","block-visibility"),P)))),(0,t.createElement)("div",{className:"preset-controls"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Enable preset","block-visibility"),checked:A,onChange:()=>L("enable",!A)}),(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide block","block-visibility"),checked:M,onChange:()=>L("hideBlock",!M),help:(0,n.__)("Hide the block from everyone.","block-visibility")}))))}const le=window.wp.a11y,ie=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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"})),ne=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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"})),oe=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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"})),re=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var se=l(855);const ae=window.wp.notices;function ce(e){var l;const{canResetAll:i,controlSetAtts:r}=e,s=null!==(l=r?.controls)&&void 0!==l?l:"";let a="";s&&(a=JSON.stringify(s));const{createSuccessNotice:c}=(0,o.useDispatch)(ae.store),d=(0,n.__)("Copied visibility controls to clipboard.","block-visibility"),p=(0,n.__)("Nothing to copy. Current block has no configured visibility controls.","block-visibility"),b=s?d:p;return i?(0,t.createElement)(se.CopyToClipboard,{text:a},(0,t.createElement)(u.MenuItem,{"aria-disabled":!i,onClick:()=>c(b,{type:"snackbar"})},(0,n.__)("Copy","block-visibility"))):(0,t.createElement)(u.MenuItem,{"aria-disabled":!0},(0,n.__)("Copy","block-visibility"))}function ue(e){const{onClose:l,setModalOpen:i}=e;return(0,t.createElement)(u.MenuItem,{className:"import",onClick:()=>{i("import"),l()}},(0,n.__)("Import","block-visibility"))}function de(e){const[l,r]=(0,t.useState)(""),{controlSetAtts:s,setControlSetAtts:a,modalOpen:c,setModalOpen:d}=e,p=!l||function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(l),{createSuccessNotice:b}=(0,o.useDispatch)(ae.store),m=(0,n.__)("Visibility settings successfully imported.","block-visibility"),v="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,n.__)("Import Visibility Control Settings","block-visibility"),onRequestClose:()=>d(!1)},!p&&(0,t.createElement)(u.Notice,{status:"error",isDismissible:!1},(0,n.__)("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,n.__)("Paste from clipboard","block-visibility"),onClick:()=>{navigator.clipboard.readText().then((e=>{r(e)}))},disabled:l||!v,isTertiary:!0,isSmall:!0,icon:M}),(0,t.createElement)(u.TextareaControl,{value:l,onChange:e=>r(e),placeholder:(0,n.__)("Paste copied settings or input manually.","block-visibility"),help:(0,n.__)("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,n.__)("Cancel","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>function(e){const t=JSON.parse(e),l=(0,i.assign)({...s},{controls:t});a(l),d(!1),b(m,{type:"snackbar"})}(l),disabled:!p||!l},(0,n.__)("Import","block-visibility")))))}function pe(l){var o,r;const[s,a]=(0,t.useState)(!1),{activeSetControls:c,enabledSetControls:d,controlSets:p,controlSetAtts:b,setControlSetAtts:m}=l,v=d.filter((e=>"integration"!==e.type)),f=d.filter((e=>"integration"===e.type));function y(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}});m(l)}function h(e,t){m({...b,[e]:t})}const g=null!==(o=b?.title)&&void 0!==o?o:"",_=null===(r=b?.enable)||void 0===r||r,k=g||(0,n.__)("Control Set","block-visibility"),E=[...v,...f].some((e=>e.isActive)),S=(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("Edit","block-visibility"),icon:ie,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:g,label:(0,n.__)("Control set title","block-visibility"),placeholder:k,onChange:e=>h("title",e)}))),w=(0,t.createElement)(u.DropdownMenu,{className:"controls-dropdown",label:(0,n.__)("Visibility Controls","block-visibility"),icon:0===c.length?z:$,popoverProps:{className:"block-visibility__control-popover visibility-controls",focusOnMount:"container"},toggleProps:{isSmall:!0,disabled:0===d.length}},(o=>{let{onClose:r}=o;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Controls","block-visibility")},v.map(((e,l)=>(0,t.createElement)(be,{key:l,control:e,toggleControls:y})))),0!==f.length&&(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Integrations","block-visibility")},f.map(((e,l)=>(0,t.createElement)(be,{key:l,control:e,toggleControls:y})))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(ce,e({canResetAll:E},l)),(0,t.createElement)(ue,{modalOpen:s,onClose:r,setModalOpen:a}),(0,t.createElement)(u.MenuItem,{onClick:()=>h("enable",!_)},_?(0,n.__)("Disable all","block-visibility"):(0,n.__)("Enable all","block-visibility")),(0,t.createElement)(u.MenuItem,{"aria-disabled":!E,variant:"tertiary",onClick:()=>{E&&(function(){const e=(0,i.assign)({...b},{controls:{}});m(e)}(),(0,le.speak)((0,n.__)("All controls reset","block-visibility"),"assertive"))}},(0,n.__)("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:ne,isSmall:!0,label:(0,n.__)("Remove","block-visibility"),onClick:()=>{m(b,!0)}}),(0,t.createElement)(u.Button,{disabled:0===c.length,icon:oe,isSmall:!0,label:(0,n.__)("Duplicate","block-visibility"),onClick:()=>function(){const e=Math.max(...p.map((e=>e.id)),0)+1,t={...b,id:e};m(t)}(),style:{padding:0}}),w)),s&&(0,t.createElement)(de,e({modalOpen:s,setModalOpen:a,toggleControls:y,coreControls:v,integrationControls:f},l)))}function be(e){const{control:l,toggleControls:i}=e;return(0,t.createElement)(u.MenuItem,{key:l.attributeSlug,icon:l.isActive&&re,label:(0,n.sprintf)( +(0,n.__)("Id: %s","block-visibility"),P)))),(0,t.createElement)("div",{className:"preset-controls"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Enable preset","block-visibility"),checked:R,onChange:()=>L("enable",!R)}),(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide block","block-visibility"),checked:M,onChange:()=>L("hideBlock",!M),help:(0,n.__)("Hide the block from everyone.","block-visibility")}))))}const le=window.wp.a11y,ie=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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"})),ne=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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"})),oe=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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"})),re=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var se=l(855);const ae=window.wp.notices;function ce(e){var l;const{canResetAll:i,controlSetAtts:r}=e,s=null!==(l=r?.controls)&&void 0!==l?l:"";let a="";s&&(a=JSON.stringify(s));const{createSuccessNotice:c}=(0,o.useDispatch)(ae.store),d=(0,n.__)("Copied visibility controls to clipboard.","block-visibility"),p=(0,n.__)("Nothing to copy. Current block has no configured visibility controls.","block-visibility"),b=s?d:p;return i?(0,t.createElement)(se.CopyToClipboard,{text:a},(0,t.createElement)(u.MenuItem,{"aria-disabled":!i,onClick:()=>c(b,{type:"snackbar"})},(0,n.__)("Copy","block-visibility"))):(0,t.createElement)(u.MenuItem,{"aria-disabled":!0},(0,n.__)("Copy","block-visibility"))}function ue(e){const{onClose:l,setModalOpen:i}=e;return(0,t.createElement)(u.MenuItem,{className:"import",onClick:()=>{i("import"),l()}},(0,n.__)("Import","block-visibility"))}function de(e){const[l,r]=(0,t.useState)(""),{controlSetAtts:s,setControlSetAtts:a,modalOpen:c,setModalOpen:d}=e,p=!l||function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(l),{createSuccessNotice:b}=(0,o.useDispatch)(ae.store),m=(0,n.__)("Visibility settings successfully imported.","block-visibility"),v="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,n.__)("Import Visibility Control Settings","block-visibility"),onRequestClose:()=>d(!1)},!p&&(0,t.createElement)(u.Notice,{status:"error",isDismissible:!1},(0,n.__)("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,n.__)("Paste from clipboard","block-visibility"),onClick:()=>{navigator.clipboard.readText().then((e=>{r(e)}))},disabled:l||!v,isTertiary:!0,isSmall:!0,icon:M}),(0,t.createElement)(u.TextareaControl,{value:l,onChange:e=>r(e),placeholder:(0,n.__)("Paste copied settings or input manually.","block-visibility"),help:(0,n.__)("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,n.__)("Cancel","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:!0,onClick:()=>function(e){const t=JSON.parse(e),l=(0,i.assign)({...s},{controls:t});a(l),d(!1),b(m,{type:"snackbar"})}(l),disabled:!p||!l},(0,n.__)("Import","block-visibility")))))}function pe(l){var o,r;const[s,a]=(0,t.useState)(!1),{activeSetControls:c,enabledSetControls:d,controlSets:p,controlSetAtts:b,setControlSetAtts:m}=l,v=d.filter((e=>"integration"!==e.type)),f=d.filter((e=>"integration"===e.type));function y(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}});m(l)}function h(e,t){m({...b,[e]:t})}const g=null!==(o=b?.title)&&void 0!==o?o:"",_=null===(r=b?.enable)||void 0===r||r,k=g||(0,n.__)("Control Set","block-visibility"),E=[...v,...f].some((e=>e.isActive)),S=(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("Edit","block-visibility"),icon:ie,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:g,label:(0,n.__)("Control set title","block-visibility"),placeholder:k,onChange:e=>h("title",e)}))),w=(0,t.createElement)(u.DropdownMenu,{className:"controls-dropdown",label:(0,n.__)("Visibility Controls","block-visibility"),icon:0===c.length?z:$,popoverProps:{className:"block-visibility__control-popover visibility-controls",focusOnMount:"container"},toggleProps:{isSmall:!0,disabled:0===d.length}},(o=>{let{onClose:r}=o;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Controls","block-visibility")},v.map(((e,l)=>(0,t.createElement)(be,{key:l,control:e,toggleControls:y})))),0!==f.length&&(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Integrations","block-visibility")},f.map(((e,l)=>(0,t.createElement)(be,{key:l,control:e,toggleControls:y})))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(ce,e({canResetAll:E},l)),(0,t.createElement)(ue,{modalOpen:s,onClose:r,setModalOpen:a}),(0,t.createElement)(u.MenuItem,{onClick:()=>h("enable",!_)},_?(0,n.__)("Disable all","block-visibility"):(0,n.__)("Enable all","block-visibility")),(0,t.createElement)(u.MenuItem,{"aria-disabled":!E,variant:"tertiary",onClick:()=>{E&&(function(){const e=(0,i.assign)({...b},{controls:{}});m(e)}(),(0,le.speak)((0,n.__)("All controls reset","block-visibility"),"assertive"))}},(0,n.__)("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:ne,isSmall:!0,label:(0,n.__)("Remove","block-visibility"),onClick:()=>{m(b,!0)}}),(0,t.createElement)(u.Button,{disabled:0===c.length,icon:oe,isSmall:!0,label:(0,n.__)("Duplicate","block-visibility"),onClick:()=>function(){const e=Math.max(...p.map((e=>e.id)),0)+1,t={...b,id:e};m(t)}(),style:{padding:0}}),w)),s&&(0,t.createElement)(de,e({modalOpen:s,setModalOpen:a,toggleControls:y,coreControls:v,integrationControls:f},l)))}function be(e){const{control:l,toggleControls:i}=e;return(0,t.createElement)(u.MenuItem,{key:l.attributeSlug,icon:l.isActive&&re,label:(0,n.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". (0,n.__)("Toggle %s"),l.label),onClick:()=>{i(l),(0,le.speak)((0,n.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". -(0,n.__)("%s toggled"),l.label),"assertive")}},l.icon&&(0,t.createElement)(q,{className:"control-branding-icon",icon:l.icon}),l.label)}const me=[{type:"text",label:(0,n.__)("Text","block-visibility")},{type:"textarea",label:(0,n.__)("Text Area","block-visibility")},{type:"number",label:(0,n.__)("Number","block-visibility"),options:"numeric"},{type:"range",label:(0,n.__)("Range","block-visibility"),options:"numeric"},{type:"email",label:(0,n.__)("Email","block-visibility")},{type:"url",label:(0,n.__)("Url","block-visibility")},{type:"password",label:(0,n.__)("Password","block-visibility")},{type:"image",label:(0,n.__)("Image","block-visibility")},{type:"file",label:(0,n.__)("File","block-visibility")},{type:"wysiwyg",label:(0,n.__)("Wysiwyg Editor","block-visibility")},{type:"oembed",label:(0,n.__)("oEmbed","block-visibility")},{type:"select",label:(0,n.__)("Select","block-visibility")},{type:"checkbox",label:(0,n.__)("Checkbox","block-visibility")},{type:"radio",label:(0,n.__)("Radio Button","block-visibility")},{type:"button_group",label:(0,n.__)("Button Group","block-visibility")},{type:"true_false",label:(0,n.__)("True / False","block-visibility"),options:"boolean"},{type:"link",label:(0,n.__)("Link","block-visibility")},{type:"post_object",label:(0,n.__)("Post Object","block-visibility")},{type:"page_link",label:(0,n.__)("Page Link","block-visibility")},{type:"relationship",label:(0,n.__)("Relationship","block-visibility")},{type:"taxonomy",label:(0,n.__)("Taxonomy","block-visibility")},{type:"user",label:(0,n.__)("User","block-visibility")},{type:"google_map",label:(0,n.__)("Google Map","block-visibility")},{type:"date_picker",label:(0,n.__)("Date Picker","block-visibility"),options:"dateTime"},{type:"date_time_picker",label:(0,n.__)("Date Time Picker","block-visibility"),options:"dateTime"},{type:"time_picker",label:(0,n.__)("Time Picker","block-visibility"),options:"dateTime"},{type:"color_picker",label:(0,n.__)("Color Picker","block-visibility")},{type:"message",label:(0,n.__)("Message","block-visibility")},{type:"accordion",label:(0,n.__)("Accordion","block-visibility")},{type:"tab",label:(0,n.__)("Tab","block-visibility")},{type:"group",label:(0,n.__)("Group","block-visibility")},{type:"repeater",label:(0,n.__)("Repeater","block-visibility")},{type:"flexible_content",label:(0,n.__)("Flexible Content","block-visibility")},{type:"clone",label:(0,n.__)("Clone","block-visibility")}];function ve(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:"",r=null!==(l=e?.fields)&&void 0!==l?l:[];0!==r.length&&r.forEach((e=>{var t,l;const r=null!==(t=e?.key)&&void 0!==t?t:"",s=null!==(l=e?.label)&&void 0!==l?l:"";i.push({value:r,label:s,group:o,help:"Field type: "+me.filter((t=>t?.type===e?.type))[0]?.label,fields:[{type:"subField",name:"isUserField",valueType:"toggle",placeholder:(0,n.__)("Evaluate as user field","block-visibility")},{type:"operatorField",valueType:"select",options:fe(e),placeholder:(0,n.__)("Select Condition…","block-visibility")},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","greaterThan","greaterThanEqual","lessThan","lessThanEqual","contains","notContain"]}]}]})}))})),i}function fe(e){const t=me.filter((t=>t?.type===e?.type))[0]?.options,l=[{value:"notEmpty",label:(0,n.__)("True","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("False","block-visibility"),disableValue:!0}],i=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"greaterThan",label:(0,n.__)("Value is greater than","block-visibility")},{value:"greaterThanEqual",label:(0,n.__)("Value is greater or equal to","block-visibility")},{value:"lessThan",label:(0,n.__)("Value is less than","block-visibility")},{value:"lessThanEqual",label:(0,n.__)("Value is less than or equal to","block-visibility")}],o=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,n.__)("Value contains","block-visibility")},{value:"notContain",label:(0,n.__)("Value does not contain","block-visibility")}];return"boolean"===t?l:"dateTime"===t||"numeric"===t?i:o}function ye(e){const{value:l,onDateChange:i,setPopoverOpen:n,includeTime:o}=e,r=(0,Z.__experimentalGetSettings)(),s=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",onClose:n.bind(null,!1)},[o&&(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{i(e),n(!1)},is12Hour:s}),!o&&(0,t.createElement)(u.DatePicker,{currentDate:l,onChange:e=>{i(e),n(!1)},is12Hour:s})])}const he=(0,t.createElement)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(j.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"})),ge=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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 _e(e){const{value:l,setPopoverOpen:i,onClearDateTime:o,includeTime:r}=e;let s=r?(0,n.__)("Select Date and Time…","block-visibility"):(0,n.__)("Select Date…","block-visibility");const a=(0,Z.__experimentalGetSettings)();if(l){const e=r?`${a.formats.date} ${a.formats.time}`:`${a.formats.date}`;s=(0,Z.format)(e,l)}return(0,t.createElement)("div",{className:b()("date-time__date-time-field",{"has-value":l})},(0,t.createElement)(u.Button,{icon:he,title:(0,n.__)("Select date/time","block-visibility"),onClick:()=>i((e=>!e)),isLink:!0},(0,t.createElement)("span",null,s)),l&&(0,t.createElement)(u.Button,{icon:ge,className:"clear-date-time",title:(0,n.__)("Clear date/time","block-visibility"),onClick:()=>o("")}))}function ke(e){const{value:l,onChange:i,includeTime:n}=e,[o,r]=(0,t.useState)(!1);return(0,t.createElement)("div",{className:"date-time"},(0,t.createElement)(_e,{value:l,setPopoverOpen:r,onClearDateTime:()=>i(""),includeTime:n}),o&&(0,t.createElement)(ye,{value:l,onDateChange:e=>i(e),setPopoverOpen:r,includeTime:n}))}const Ee=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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 Se(e){const{message:l,subMessage:i,link:o,position:r}=e,s=null!=r?r:"middle left";return(0,t.createElement)("div",{className:"information-popover"},(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("More Information","block-visibility"),icon:Ee,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:s,noArrow:!1}},(()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,l),i&&(0,t.createElement)("p",null,i),o&&(0,t.createElement)(u.ExternalLink,{href:o},(0,n.__)("Learn More","block-visibility"))))))}function we(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function Ce(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 Oe(e){for(var t=1;te.length)&&(t=e.length);for(var l=0,i=new Array(t);l=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}var Re=l(196),Ae=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Me(e,t){for(var l=0;l0?$e(lt,--et):0,Qe--,10===tt&&(Qe=1,Ke--),tt}function rt(){return tt=et2||ut(tt)>3?"":" "}function vt(e,t){for(;--t&&rt()&&!(tt<48||tt>102||tt>57&&tt<65||tt>70&&tt<97););return ct(e,at()+(t<6&&32==st()&&32==rt()))}function ft(e){for(;rt();)switch(tt){case e:return et;case 34:case 39:34!==e&&39!==e&&ft(tt);break;case 40:41===e&&ft(e);break;case 92:rt()}return et}function yt(e,t){for(;rt()&&e+tt!==57&&(e+tt!==84||47!==st()););return"/*"+ct(t,et-1)+"*"+Ue(47===e?e:rt())}function ht(e){for(;!ut(st());)rt();return ct(e,et)}var gt="-ms-",_t="-moz-",kt="-webkit-",Et="comm",St="rule",wt="decl",Ct="@keyframes";function Ot(e,t){for(var l="",i=Ye(e),n=0;n0&&Ze(S)-d&&Xe(b>32?At(S+";",i,l,d-1):At(qe(S," ","")+";",i,l,d-2),a);break;case 59:S+=";";default:if(Xe(E=Nt(S,t,l,c,u,n,s,g,_=[],k=[],d),o),123===h)if(0===u)Pt(S,t,E,E,_,o,d,s,k);else switch(99===p&&110===$e(S,3)?100:p){case 100:case 109:case 115:Pt(e,E,E,i&&Xe(Nt(e,E,E,0,0,n,s,g,n,_=[],d),k),n,k,d,s,i?_:k);break;default:Pt(S,E,E,E,[""],k,0,s,k)}}c=u=b=0,v=y=1,g=S="",d=r;break;case 58:d=1+Ze(S),b=m;default:if(v<1)if(123==h)--v;else if(125==h&&0==v++&&125==ot())continue;switch(S+=Ue(h),h*v){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Ze(S)-1)*y,y=1;break;case 64:45===st()&&(S+=bt(rt())),p=st(),u=d=Ze(g=S+=ht(at())),h++;break;case 45:45===m&&2==Ze(S)&&(v=0)}}return o}function Nt(e,t,l,i,n,o,r,s,a,c,u){for(var d=n-1,p=0===n?o:[""],b=Ye(p),m=0,v=0,f=0;m0?p[y]+" "+h:qe(h,/&\f/g,p[y])))&&(a[f++]=g);return it(e,t,l,0===n?St:s,a,c,u)}function Rt(e,t,l){return it(e,t,l,Et,Ue(tt),We(e,2,-2),0)}function At(e,t,l,i){return it(e,t,l,wt,We(e,0,i),We(e,i+1,-1),i)}var Mt=function(e,t,l){for(var i=0,n=0;i=n,n=st(),38===i&&12===n&&(t[l]=1),!ut(n);)rt();return ct(e,et)},Vt=new WeakMap,Ft=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)||Vt.get(l))&&!i){Vt.set(e,!0);for(var n=[],o=function(e,t){return pt(function(e,t){var l=-1,i=44;do{switch(ut(i)){case 0:38===i&&12===st()&&(t[l]=1),e[l]+=Mt(et-1,t,l);break;case 2:e[l]+=bt(i);break;case 4:if(44===i){e[++l]=58===st()?"&\f":"",t[l]=e[l].length;break}default:e[l]+=Ue(i)}}while(i=rt());return e}(dt(e),t))}(t,n),r=l.props,s=0,a=0;s6)switch($e(e,t+1)){case 109:if(45!==$e(e,t+4))break;case 102:return qe(e,/(.+:)(.+)-([^]+)/,"$1"+kt+"$2-$3$1"+_t+(108==$e(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ge(e,"stretch")?Dt(qe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==$e(e,t+1))break;case 6444:switch($e(e,Ze(e)-3-(~Ge(e,"!important")&&10))){case 107:return qe(e,":",":"+kt)+e;case 101:return qe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+kt+(45===$e(e,14)?"inline-":"")+"box$3$1"+kt+"$2$3$1"+gt+"$2box$3")+e}break;case 5936:switch($e(e,t+11)){case 114:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return kt+e+gt+e+e}return e}var Lt=[function(e,t,l,i){if(e.length>-1&&!e.return)switch(e.type){case wt:e.return=Dt(e.value,e.length);break;case Ct:return Ot([nt(e,{value:qe(e.value,"@","@"+kt)})],i);case St: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 Ot([nt(e,{props:[qe(t,/:(read-\w+)/,":"+_t+"$1")]})],i);case"::placeholder":return Ot([nt(e,{props:[qe(t,/:(plac\w+)/,":"+kt+"input-$1")]}),nt(e,{props:[qe(t,/:(plac\w+)/,":"+_t+"$1")]}),nt(e,{props:[qe(t,/:(plac\w+)/,gt+"input-$1")]})],i)}return""}))}}];const Ht=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,n,o=e.stylisPlugins||Lt,r={},s=[];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,n-=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(n){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)},jt={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};var zt=/[A-Z]|^ms/g,qt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Gt=function(e){return 45===e.charCodeAt(1)},$t=function(e){return null!=e&&"boolean"!=typeof e},Wt=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Gt(l=e)?l:l.replace(zt,"-$&").toLowerCase()),t[e];var l}}(),Zt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(qt,(function(e,t,l){return Xt={name:t,styles:l,next:Xt},t}))}return 1===jt[e]||Gt(e)||"number"!=typeof t||0===t?t:t+"px"};function Yt(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 Xt={name:l.name,styles:l.styles,next:Xt},l.name;if(void 0!==l.styles){var i=l.next;if(void 0!==i)for(;void 0!==i;)Xt={name:i.name,styles:i.styles,next:Xt},i=i.next;return l.styles+";"}return function(e,t,l){var i="";if(Array.isArray(l))for(var n=0;ne.brand+"/"+e.version)).join(" "),vl):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const kl=Math.round;function El(e){return yl(e)?e:e.contextElement}const Sl={x:1,y:1};function wl(e){const t=El(e);if(!fl(t))return Sl;const l=t.getBoundingClientRect(),{width:i,height:n,fallback:o}=function(e){const t=pl(e);let l=parseFloat(t.width),i=parseFloat(t.height);const n=fl(e),o=n?e.offsetWidth:l,r=n?e.offsetHeight:i,s=kl(l)!==o||kl(i)!==r;return s&&(l=o,i=r),{width:l,height:i,fallback:s}}(t);let r=(o?kl(l.width):l.width)/i,s=(o?kl(l.height):l.height)/n;return r&&Number.isFinite(r)||(r=1),s&&Number.isFinite(s)||(s=1),{x:r,y:s}}function Cl(e,t,l,i){var n,o;void 0===t&&(t=!1),void 0===l&&(l=!1);const r=e.getBoundingClientRect(),s=El(e);let a=Sl;t&&(i?yl(i)&&(a=wl(i)):a=wl(e));const c=s?dl(s):window,u=_l()&&l;let d=(r.left+(u&&(null==(n=c.visualViewport)?void 0:n.offsetLeft)||0))/a.x,p=(r.top+(u&&(null==(o=c.visualViewport)?void 0:o.offsetTop)||0))/a.y,b=r.width/a.x,m=r.height/a.y;if(s){const e=dl(s),t=i&&yl(i)?dl(i):i;let l=e.frameElement;for(;l&&i&&t!==e;){const e=wl(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,m*=e.y,d+=t.x,p+=t.y,l=dl(l).frameElement}}return v={width:b,height:m,x:d,y:p},{...v,top:v.y,left:v.x,right:v.x+v.width,bottom:v.y+v.height};var v}function Ol(e){if("html"===ml(e))return e;const t=e.assignedSlot||e.parentNode||hl(e)&&e.host||function(e){return((bl(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return hl(t)?t.host:t}function xl(e){const t=Ol(e);return function(e){return["html","body","#document"].includes(ml(e))}(t)?t.ownerDocument.body:fl(t)&&gl(t)?t:xl(t)}function Tl(e,t){var l;void 0===t&&(t=[]);const i=xl(e),n=i===(null==(l=e.ownerDocument)?void 0:l.body),o=dl(i);return n?t.concat(o,o.visualViewport||[],gl(i)?i:[]):t.concat(i,Tl(i))}const Pl=Re.useLayoutEffect;var Nl=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Rl=function(){};function Al(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Ml(e,t){for(var l=arguments.length,i=new Array(l>2?l-2:0),n=2;n-1}function Ll(e){return Dl(e)?window.pageYOffset:e.scrollTop}function Hl(e,t){Dl(e)?window.scrollTo(0,t):e.scrollTop=t}function Bl(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,n=Ll(e),o=t-n,r=0;!function t(){var s,a=(s=r+=10,o*((s=s/l-1)*s*s+1)+n);Hl(e,a),rl.bottom?Hl(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):i.top-n=m)return{placement:"bottom",maxHeight:t};if(w>=m&&!r)return o&&Bl(a,C,x),{placement:"bottom",maxHeight:t};if(!r&&w>=i||r&&E>=i)return o&&Bl(a,C,x),{placement:"bottom",maxHeight:r?E-g:w-g};if("auto"===n||r){var T=t,P=r?k:S;return P>=i&&(T=Math.min(P-g-s,t)),{placement:"top",maxHeight:T}}if("bottom"===n)return o&&Hl(a,C),{placement:"bottom",maxHeight:t};break;case"top":if(k>=m)return{placement:"top",maxHeight:t};if(S>=m&&!r)return o&&Bl(a,O,x),{placement:"top",maxHeight:t};if(!r&&S>=i||r&&k>=i){var N=t;return(!r&&S>=i||r&&k>=i)&&(N=r?k-_:S-_),o&&Bl(a,O,x),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return c}({maxHeight:i,menuEl:e,minHeight:l,placement:n,shouldScroll:r&&!t,isFixedPosition:t,controlHeight:f});p(s.maxHeight),v(s.placement),null==a||a(s.placement)}}),[i,n,o,r,l,a,f]),t({ref:c,placerProps:Oe(Oe({},e),{},{placement:m||Yl(n),maxHeight:d})})},Ql=function(e,t){var l=e.theme,i=l.spacing.baseUnit,n=l.colors;return Oe({textAlign:"center"},t?{}:{color:n.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},Jl=Ql,ei=Ql,ti=function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),l)};ti.defaultProps={children:"No options"};var li=function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),l)};li.defaultProps={children:"Loading..."};var ii,ni,oi,ri=["size"],si={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ai=function(t){var l=t.size,i=Ne(t,ri);return al("svg",e({height:l,width:l,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:si},i))},ci=function(t){return al(ai,e({size:20},t),al("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"}))},ui=function(t){return al(ai,e({size:20},t),al("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"}))},di=function(e,t){var l=e.isFocused,i=e.theme,n=i.spacing.baseUnit,o=i.colors;return Oe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:l?o.neutral60:o.neutral20,padding:2*n,":hover":{color:l?o.neutral80:o.neutral40}})},pi=di,bi=di,mi=function(){var e=cl.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_"}}}(ii||(ni=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],oi||(oi=ni.slice(0)),ii=Object.freeze(Object.defineProperties(ni,{raw:{value:Object.freeze(oi)}})))),vi=function(e){var t=e.delay,l=e.offset;return al("span",{css:cl({animation:"".concat(mi," 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"},"","")})},fi=function(t){var l=t.innerProps,i=t.isRtl;return al("div",e({},Il(t,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),l),al(vi,{delay:0,offset:i}),al(vi,{delay:160,offset:!0}),al(vi,{delay:320,offset:!i}))};fi.defaultProps={size:4};var yi=["data"],hi=["innerRef","isDisabled","isHidden","inputClassName"],gi={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},_i={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Oe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},gi)},ki=function(e){return Oe({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},gi)},Ei=function(e){var t=e.children,l=e.innerProps;return al("div",l,t)},Si={ClearIndicator:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),l||al(ci,null))},Control:function(t){var l=t.children,i=t.isDisabled,n=t.isFocused,o=t.innerRef,r=t.innerProps,s=t.menuIsOpen;return al("div",e({ref:o},Il(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":n,"control--menu-is-open":s}),r),l)},DropdownIndicator:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),l||al(ui,null))},DownChevron:ui,CrossIcon:ci,Group:function(t){var l=t.children,i=t.cx,n=t.getStyles,o=t.getClassNames,r=t.Heading,s=t.headingProps,a=t.innerProps,c=t.label,u=t.theme,d=t.selectProps;return al("div",e({},Il(t,"group",{group:!0}),a),al(r,e({},s,{selectProps:d,theme:u,getStyles:n,getClassNames:o,cx:i}),c),al("div",null,l))},GroupHeading:function(t){var l=Fl(t);l.data;var i=Ne(l,yi);return al("div",e({},Il(t,"groupHeading",{"group-heading":!0}),i))},IndicatorsContainer:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"indicatorsContainer",{indicators:!0}),i),l)},IndicatorSeparator:function(t){var l=t.innerProps;return al("span",e({},l,Il(t,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(t){var l=t.cx,i=t.value,n=Fl(t),o=n.innerRef,r=n.isDisabled,s=n.isHidden,a=n.inputClassName,c=Ne(n,hi);return al("div",e({},Il(t,"input",{"input-container":!0}),{"data-value":i||""}),al("input",e({className:l({input:!0},a),ref:o,style:ki(s),disabled:r},c)))},LoadingIndicator:fi,Menu:function(t){var l=t.children,i=t.innerRef,n=t.innerProps;return al("div",e({},Il(t,"menu",{menu:!0}),{ref:i},n),l)},MenuList:function(t){var l=t.children,i=t.innerProps,n=t.innerRef,o=t.isMulti;return al("div",e({},Il(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:n},i),l)},MenuPortal:function(t){var l=t.appendTo,i=t.children,n=t.controlElement,o=t.innerProps,r=t.menuPlacement,s=t.menuPosition,a=(0,Re.useRef)(null),c=(0,Re.useRef)(null),u=Pe((0,Re.useState)(Yl(r)),2),d=u[0],p=u[1],b=(0,Re.useMemo)((function(){return{setPortalPlacement:p}}),[]),m=Pe((0,Re.useState)(null),2),v=m[0],f=m[1],y=(0,Re.useCallback)((function(){if(n){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}}(n),t="fixed"===s?0:window.pageYOffset,l=e[d]+t;l===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||f({offset:l,rect:e})}}),[n,s,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);Pl((function(){y()}),[y]);var h=(0,Re.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),n&&a.current&&(c.current=function(e,t,l,i){void 0===i&&(i={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r=!0,animationFrame:s=!1}=i,a=n&&!s,c=a||o?[...yl(e)?Tl(e):e.contextElement?Tl(e.contextElement):[],...Tl(t)]:[];c.forEach((e=>{a&&e.addEventListener("scroll",l,{passive:!0}),o&&e.addEventListener("resize",l)}));let u,d=null;r&&(d=new ResizeObserver((()=>{l()})),yl(e)&&!s&&d.observe(e),yl(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t));let p=s?Cl(e):null;return s&&function t(){const i=Cl(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=>{a&&e.removeEventListener("scroll",l),o&&e.removeEventListener("resize",l)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(u)}}(n,a.current,y,{elementResize:"ResizeObserver"in window}))}),[n,y]);Pl((function(){h()}),[h]);var g=(0,Re.useCallback)((function(e){a.current=e,h()}),[h]);if(!l&&"fixed"!==s||!v)return null;var _=al("div",e({ref:g},Il(Oe(Oe({},t),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),i);return al(Xl.Provider,{value:b},l?(0,ul.createPortal)(_,l):_)},LoadingMessage:li,NoOptionsMessage:ti,MultiValue:function(e){var t=e.children,l=e.components,i=e.data,n=e.innerProps,o=e.isDisabled,r=e.removeProps,s=e.selectProps,a=l.Container,c=l.Label,u=l.Remove;return al(a,{data:i,innerProps:Oe(Oe({},Il(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),n),selectProps:s},al(c,{data:i,innerProps:Oe({},Il(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),al(u,{data:i,innerProps:Oe(Oe({},Il(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},r),selectProps:s}))},MultiValueContainer:Ei,MultiValueLabel:Ei,MultiValueRemove:function(t){var l=t.children,i=t.innerProps;return al("div",e({role:"button"},i),l||al(ci,{size:14}))},Option:function(t){var l=t.children,i=t.isDisabled,n=t.isFocused,o=t.isSelected,r=t.innerRef,s=t.innerProps;return al("div",e({},Il(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":n,"option--is-selected":o}),{ref:r,"aria-disabled":i},s),l)},Placeholder:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"placeholder",{placeholder:!0}),i),l)},SelectContainer:function(t){var l=t.children,i=t.innerProps,n=t.isDisabled,o=t.isRtl;return al("div",e({},Il(t,"container",{"--is-disabled":n,"--is-rtl":o}),i),l)},SingleValue:function(t){var l=t.children,i=t.isDisabled,n=t.innerProps;return al("div",e({},Il(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),n),l)},ValueContainer:function(t){var l=t.children,i=t.innerProps,n=t.isMulti,o=t.hasValue;return al("div",e({},Il(t,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":o}),i),l)}},wi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ci(e,t){if(e.length!==t.length)return!1;for(var l=0;l1?"s":""," ").concat(n.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,l=e.focused,i=e.options,n=e.label,o=void 0===n?"":n,r=e.selectValue,s=e.isDisabled,a=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(o," focused, ").concat(c(r,l),".");if("menu"===t){var u=s?" disabled":"",d="".concat(a?"selected":"focused").concat(u);return"option ".concat(o," ").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:"",".")}},Pi=function(e){var t=e.ariaSelection,l=e.focusedOption,i=e.focusedValue,n=e.focusableOptions,o=e.isFocused,r=e.selectValue,s=e.selectProps,a=e.id,c=s.ariaLiveMessages,u=s.getOptionLabel,d=s.inputValue,p=s.isMulti,b=s.isOptionDisabled,m=s.isSearchable,v=s.menuIsOpen,f=s.options,y=s.screenReaderStatus,h=s.tabSelectsValue,g=s["aria-label"],_=s["aria-live"],k=(0,Re.useMemo)((function(){return Oe(Oe({},Ti),c||{})}),[c]),E=(0,Re.useMemo)((function(){var e,l="";if(t&&k.onChange){var i=t.option,n=t.options,o=t.removedValue,s=t.removedValues,a=t.value,c=o||i||(e=a,Array.isArray(e)?null:e),d=c?u(c):"",p=n||s||void 0,m=p?p.map(u):[],v=Oe({isDisabled:c&&b(c,r),label:d,labels:m},t);l=k.onChange(v)}return l}),[t,k,b,r,u]),S=(0,Re.useMemo)((function(){var e="",t=l||i,o=!!(l&&r&&r.includes(l));if(t&&k.onFocus){var s={focused:t,label:u(t),isDisabled:b(t,r),isSelected:o,options:n,context:t===l?"menu":"value",selectValue:r};e=k.onFocus(s)}return e}),[l,i,u,b,k,n,r]),w=(0,Re.useMemo)((function(){var e="";if(v&&f.length&&k.onFilter){var t=y({count:n.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[n,d,v,k,f,y]),C=(0,Re.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":v?"menu":"input";e=k.guidance({"aria-label":g,context:t,isDisabled:l&&b(l,r),isMulti:p,isSearchable:m,tabSelectsValue:h})}return e}),[g,l,i,p,b,m,v,k,r,h]),O="".concat(S," ").concat(w," ").concat(C),x=al(Re.Fragment,null,al("span",{id:"aria-selection"},E),al("span",{id:"aria-context"},O)),T="initial-input-focus"===(null==t?void 0:t.action);return al(Re.Fragment,null,al(xi,{id:a},T&&x),al(xi,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},o&&!T&&x))},Ni=[{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("["+Ni.map((function(e){return e.letters})).join("")+"]","g"),Ai={},Mi=0;Mi1?t-1:0),i=1;i0,v=d-p-u,f=!1;v>t&&r.current&&(i&&i(e),r.current=!1),m&&s.current&&(o&&o(e),s.current=!1),m&&t>v?(l&&!r.current&&l(e),b.scrollTop=d,f=!0,r.current=!0):!m&&-t>u&&(n&&!s.current&&n(e),b.scrollTop=0,f=!0,s.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[l,i,n,o]),d=(0,Re.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,Re.useCallback)((function(e){a.current=e.changedTouches[0].clientY}),[]),b=(0,Re.useCallback)((function(e){var t=a.current-e.changedTouches[0].clientY;u(e,t)}),[u]),m=(0,Re.useCallback)((function(e){if(e){var t=!!$l&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",b,t)}}),[b,p,d]),v=(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 m(e),function(){v(e)}}}),[t,m,v]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),o=function(e){var t=e.isEnabled,l=e.accountForScrollbars,i=void 0===l||l,n=(0,Re.useRef)({}),o=(0,Re.useRef)(null),r=(0,Re.useCallback)((function(e){if(Zi){var t=document.body,l=t&&t.style;if(i&&ji.forEach((function(e){var t=l&&l[e];n.current[e]=t})),i&&Yi<1){var o=parseInt(n.current.paddingRight,10)||0,r=document.body?document.body.clientWidth:0,s=window.innerWidth-r+o||0;Object.keys(zi).forEach((function(e){var t=zi[e];l&&(l[e]=t)})),l&&(l.paddingRight="".concat(s,"px"))}t&&Wi()&&(t.addEventListener("touchmove",qi,Xi),e&&(e.addEventListener("touchstart",$i,Xi),e.addEventListener("touchmove",Gi,Xi))),Yi+=1}}),[i]),s=(0,Re.useCallback)((function(e){if(Zi){var t=document.body,l=t&&t.style;Yi=Math.max(Yi-1,0),i&&Yi<1&&ji.forEach((function(e){var t=n.current[e];l&&(l[e]=t)})),t&&Wi()&&(t.removeEventListener("touchmove",qi,Xi),e&&(e.removeEventListener("touchstart",$i,Xi),e.removeEventListener("touchmove",Gi,Xi)))}}),[i]);return(0,Re.useEffect)((function(){if(t){var e=o.current;return r(e),function(){s(e)}}}),[t,r,s]),function(e){o.current=e}}({isEnabled:l});return al(Re.Fragment,null,l&&al("div",{onClick:Ki,css:Qi}),t((function(e){n(e),o(e)})))}var en={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},tn=function(e){var t=e.name,l=e.onFocus;return al("input",{required:!0,name:t,tabIndex:-1,onFocus:l,css:en,value:"",onChange:function(){}})},ln={clearIndicator:bi,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,n=e.theme,o=n.colors,r=n.borderRadius;return Oe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:n.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:l?o.neutral5:o.neutral0,borderColor:l?o.neutral10:i?o.primary:o.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},dropdownIndicator:pi,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,n=l.spacing;return Oe({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*n.baseUnit,paddingRight:3*n.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,n=i.spacing.baseUnit,o=i.colors;return Oe({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:l?o.neutral10:o.neutral20,marginBottom:2*n,marginTop:2*n})},input:function(e,t){var l=e.isDisabled,i=e.value,n=e.theme,o=n.spacing,r=n.colors;return Oe(Oe({visibility:l?"hidden":"visible",transform:i?"translateZ(0)":""},_i),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:r.neutral80})},loadingIndicator:function(e,t){var l=e.isFocused,i=e.size,n=e.theme,o=n.colors,r=n.spacing.baseUnit;return Oe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:l?o.neutral60:o.neutral20,padding:2*r})},loadingMessage:ei,menu:function(e,t){var l,i=e.placement,n=e.theme,o=n.borderRadius,r=n.spacing,s=n.colors;return Oe((we(l={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),we(l,"position","absolute"),we(l,"width","100%"),we(l,"zIndex",1),l),t?{}:{backgroundColor:s.neutral0,borderRadius:o,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 l=e.maxHeight,i=e.theme.spacing.baseUnit;return Oe({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,n=l.borderRadius,o=l.colors;return Oe({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:n/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var l=e.theme,i=l.borderRadius,n=l.colors,o=e.cropWithEllipsis;return Oe({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:n.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var l=e.theme,i=l.spacing,n=l.borderRadius,o=l.colors,r=e.isFocused;return Oe({alignItems:"center",display:"flex"},t?{}:{borderRadius:n/2,backgroundColor:r?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:Jl,option:function(e,t){var l=e.isDisabled,i=e.isFocused,n=e.isSelected,o=e.theme,r=o.spacing,s=o.colors;return Oe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:n?s.primary:i?s.primary25:"transparent",color:l?s.neutral20:n?s.neutral0:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),":active":{backgroundColor:l?void 0:n?s.primary:s.primary50}})},placeholder:function(e,t){var l=e.theme,i=l.spacing,n=l.colors;return Oe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:n.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var l=e.isDisabled,i=e.theme,n=i.spacing,o=i.colors;return Oe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:l?o.neutral40:o.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},valueContainer:function(e,t){var l=e.theme.spacing,i=e.isMulti,n=e.hasValue,o=e.selectProps.controlShouldRenderValue;return Oe({alignItems:"center",display:i&&n&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(l.baseUnit/2,"px ").concat(2*l.baseUnit,"px")})}},nn={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}},on={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:jl(),captureMenuScroll:!jl(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var l=Oe({ignoreCase:!0,ignoreAccents:!0,stringify:Hi,trim:!0,matchFrom:"any"},undefined),i=l.ignoreCase,n=l.ignoreAccents,o=l.stringify,r=l.trim,s=l.matchFrom,a=r?Li(t):t,c=r?Li(o(e)):o(e);return i&&(a=a.toLowerCase(),c=c.toLowerCase()),n&&(a=Di(a),c=Ii(c)),"start"===s?c.substr(0,a.length)===a:c.indexOf(a)>-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 rn(e,t,l,i){return{type:"option",data:t,isDisabled:pn(e,t,l),isSelected:bn(e,t,l),label:un(e,t),value:dn(e,t),index:i}}function sn(e,t){return e.options.map((function(l,i){if("options"in l){var n=l.options.map((function(l,i){return rn(e,l,t,i)})).filter((function(t){return cn(e,t)}));return n.length>0?{type:"group",data:l,options:n,index:i}:void 0}var o=rn(e,l,t,i);return cn(e,o)?o:void 0})).filter(Wl)}function an(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Le(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function cn(e,t){var l=e.inputValue,i=void 0===l?"":l,n=t.data,o=t.isSelected,r=t.label,s=t.value;return(!vn(e)||!o)&&mn(e,{label:r,value:s,data:n},i)}var un=function(e,t){return e.getOptionLabel(t)},dn=function(e,t){return e.getOptionValue(t)};function pn(e,t,l){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,l)}function bn(e,t,l){if(l.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,l);var i=dn(e,t);return l.some((function(t){return dn(e,t)===i}))}function mn(e,t,l){return!e.filterOption||e.filterOption(t,l)}var vn=function(e){var t=e.hideSelectedOptions,l=e.isMulti;return void 0===t?l:t},fn=1,yn=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&&Ve(e,t)}(r,t);var l,i,n,o=De(r);function r(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(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,l){var i=t.props,n=i.onChange,o=i.name;l.name=o,t.ariaOnChange(e,l),n(e,l)},t.setValue=function(e,l,i){var n=t.props,o=n.closeMenuOnSelect,r=n.isMulti,s=n.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(t.setState({inputIsHiddenAfterUpdate:!r}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:l,option:i})},t.selectOption=function(e){var l=t.props,i=l.blurInputOnSelect,n=l.isMulti,o=l.name,r=t.state.selectValue,s=n&&t.isOptionSelected(e,r),a=t.isOptionDisabled(e,r);if(s){var c=t.getOptionValue(e);t.setValue(r.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(a)return void t.ariaOnChange(e,{action:"select-option",option:e,name:o});n?t.setValue([].concat(Le(r),[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,n=t.getOptionValue(e),o=i.filter((function(e){return t.getOptionValue(e)!==n})),r=Zl(l,o,o[0]||null);t.onChange(r,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(Zl(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],n=l.slice(0,l.length-1),o=Zl(e,n,n[0]||null);t.onChange(o,{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||o>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 vn(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var l=t.props,i=l.isMulti,n=l.backspaceRemovesValue,o=l.escapeClearsValue,r=l.inputValue,s=l.isClearable,a=l.isDisabled,c=l.menuIsOpen,u=l.onKeyDown,d=l.tabSelectsValue,p=l.openMenuOnFocus,b=t.state,m=b.focusedOption,v=b.focusedValue,f=b.selectValue;if(!(a||"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(v)t.removeValue(v);else{if(!n)return;i?t.popValue():s&&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()):s&&o&&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||++fn),t.state.selectValue=Vl(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=r,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&&Ul(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,l=t.isDisabled,i=t.menuIsOpen,n=this.state.isFocused;(n&&!l&&e.isDisabled||n&&i&&!e.menuIsOpen)&&this.focusInput(),n&&l&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):n||l||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Ul(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,n=l.isFocused,o=this.buildFocusableOptions(),r="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(i[0]);s>-1&&(r=s)}this.scrollToFocusedOptionOnUpdate=!(n&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[r]},(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 n=l.indexOf(i);i||(n=-1);var o=l.length-1,r=-1;if(l.length){switch(e){case"previous":r=0===n?0:-1===n?o:n-1;break;case"next":n>-1&&n0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,l=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var n=0,o=i.indexOf(l);l||(o=-1),"up"===e?n=o>0?o-1:i.length-1:"down"===e?n=(o+1)%i.length:"pageup"===e?(n=o-t)<0&&(n=0):"pagedown"===e?(n=o+t)>i.length-1&&(n=i.length-1):"last"===e&&(n=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[n],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(nn):Oe(Oe({},nn),this.props.theme):nn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,l=this.getStyles,i=this.getClassNames,n=this.getValue,o=this.selectOption,r=this.setValue,s=this.props,a=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:l,getClassNames:i,getValue:n,hasValue:this.hasValue(),isMulti:a,isRtl:c,options:u,selectOption:o,selectProps:s,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,l=e.isMulti;return void 0===t?l:t}},{key:"isOptionDisabled",value:function(e,t){return pn(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return bn(this.props,e,t)}},{key:"filterOption",value:function(e,t){return mn(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,n=t.inputId,o=t.inputValue,r=t.tabIndex,s=t.form,a=t.menuIsOpen,c=t.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,b=d.ariaSelection,m=this.commonProps,v=n||this.getElementId("input"),f=Oe(Oe(Oe({"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":c,role:"combobox"},a&&{"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({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:l,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:s,type:"text",value:o},f)):Re.createElement(Ui,e({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Rl,onFocus:this.onInputFocus,disabled:l,tabIndex:r,inputMode:"none",form:s,value:""},f))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,l=this.getComponents(),i=l.MultiValue,n=l.MultiValueContainer,o=l.MultiValueLabel,r=l.MultiValueRemove,s=l.SingleValue,a=l.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,b=u.isMulti,m=u.inputValue,v=u.placeholder,f=this.state,y=f.selectValue,h=f.focusedValue,g=f.isFocused;if(!this.hasValue()||!d)return m?null:Re.createElement(a,e({},c,{key:"placeholder",isDisabled:p,isFocused:g,innerProps:{id:this.getElementId("placeholder")}}),v);if(b)return y.map((function(l,s){var a=l===h,u="".concat(t.getOptionLabel(l),"-").concat(t.getOptionValue(l));return Re.createElement(i,e({},c,{components:{Container:n,Label:o,Remove:r},isFocused:a,isDisabled:p,key:u,index:s,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(m)return null;var _=y[0];return Re.createElement(s,e({},c,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,l=this.commonProps,i=this.props,n=i.isDisabled,o=i.isLoading,r=this.state.isFocused;if(!this.isClearable()||!t||n||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Re.createElement(t,e({},l,{innerProps:s,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,l=this.commonProps,i=this.props,n=i.isDisabled,o=i.isLoading,r=this.state.isFocused;return t&&o?Re.createElement(t,e({},l,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),l=t.DropdownIndicator,i=t.IndicatorSeparator;if(!l||!i)return null;var n=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return Re.createElement(i,e({},n,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var l=this.commonProps,i=this.props.isDisabled,n=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Re.createElement(t,e({},l,{innerProps:o,isDisabled:i,isFocused:n}))}},{key:"renderMenu",value:function(){var t=this,l=this.getComponents(),i=l.Group,n=l.GroupHeading,o=l.Menu,r=l.MenuList,s=l.MenuPortal,a=l.LoadingMessage,c=l.NoOptionsMessage,u=l.Option,d=this.commonProps,p=this.state.focusedOption,b=this.props,m=b.captureMenuScroll,v=b.inputValue,f=b.isLoading,y=b.loadingMessage,h=b.minMenuHeight,g=b.maxMenuHeight,_=b.menuIsOpen,k=b.menuPlacement,E=b.menuPosition,S=b.menuPortalTarget,w=b.menuShouldBlockScroll,C=b.menuShouldScrollIntoView,O=b.noOptionsMessage,x=b.onMenuScrollToTop,T=b.onMenuScrollToBottom;if(!_)return null;var P,N=function(l,i){var n=l.type,o=l.data,r=l.isDisabled,s=l.isSelected,a=l.label,c=l.value,b=p===o,m=r?void 0:function(){return t.onOptionHover(o)},v=r?void 0:function(){return t.selectOption(o)},f="".concat(t.getElementId("option"),"-").concat(i),y={id:f,onClick:v,onMouseMove:m,onMouseOver:m,tabIndex:-1};return Re.createElement(u,e({},d,{innerProps:y,data:o,isDisabled:r,isSelected:s,key:f,label:a,type:n,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 o=l.data,r=l.options,s=l.index,a="".concat(t.getElementId("group"),"-").concat(s),c="".concat(a,"-heading");return Re.createElement(i,e({},d,{key:a,data:o,options:r,Heading:n,headingProps:{id:c,data:l.data},label:t.formatGroupLabel(l.data)}),l.options.map((function(e){return N(e,"".concat(s,"-").concat(e.index))})))}if("option"===l.type)return N(l,"".concat(l.index))}));else if(f){var R=y({inputValue:v});if(null===R)return null;P=Re.createElement(a,d,R)}else{var A=O({inputValue:v});if(null===A)return null;P=Re.createElement(c,d,A)}var M={minMenuHeight:h,maxMenuHeight:g,menuPlacement:k,menuPosition:E,menuShouldScrollIntoView:C},V=Re.createElement(Kl,e({},d,M),(function(l){var i=l.ref,n=l.placerProps,s=n.placement,a=n.maxHeight;return Re.createElement(o,e({},d,M,{innerRef:i,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:f,placement:s}),Re.createElement(Ji,{captureEnabled:m,onTopArrive:x,onBottomArrive:T,lockEnabled:w},(function(l){return Re.createElement(r,e({},d,{innerRef:function(e){t.getMenuListRef(e),l(e)},isLoading:f,maxHeight:a,focusedOption:p}),P)})))}));return S||"fixed"===E?Re.createElement(s,e({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:k,menuPosition:E}),V):V}},{key:"renderFormField",value:function(){var e=this,t=this.props,l=t.delimiter,i=t.isDisabled,n=t.isMulti,o=t.name,r=t.required,s=this.state.selectValue;if(o&&!i){if(r&&!this.hasValue())return Re.createElement(tn,{name:o,onFocus:this.onValueInputFocus});if(n){if(l){var a=s.map((function(t){return e.getOptionValue(t)})).join(l);return Re.createElement("input",{name:o,type:"hidden",value:a})}var c=s.length>0?s.map((function(t,l){return Re.createElement("input",{key:"i-".concat(l),name:o,type:"hidden",value:e.getOptionValue(t)})})):Re.createElement("input",{name:o,type:"hidden",value:""});return Re.createElement("div",null,c)}var u=s[0]?this.getOptionValue(s[0]):"";return Re.createElement("input",{name:o,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,l=this.state,i=l.ariaSelection,n=l.focusedOption,o=l.focusedValue,r=l.isFocused,s=l.selectValue,a=this.getFocusableOptions();return Re.createElement(Pi,e({},t,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:n,focusedValue:o,isFocused:r,selectValue:s,focusableOptions:a}))}},{key:"render",value:function(){var t=this.getComponents(),l=t.Control,i=t.IndicatorsContainer,n=t.SelectContainer,o=t.ValueContainer,r=this.props,s=r.className,a=r.id,c=r.isDisabled,u=r.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return Re.createElement(n,e({},p,{className:s,innerProps:{id:a,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(o,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())}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){var l=t.prevProps,i=t.clearFocusValueOnUpdate,n=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,r=t.isFocused,s=t.prevWasFocused,a=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,b=Vl(c),m={};if(l&&(c!==l.value||a!==l.options||u!==l.menuIsOpen||d!==l.inputValue)){var v=u?function(e,t){return an(sn(e,t))}(e,b):[],f=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,v);m={selectValue:b,focusedOption:y,focusedValue:f,clearFocusValueOnUpdate:!1}}var h=null!=n&&e!==l?{inputIsHidden:n,inputIsHiddenAfterUpdate:void 0}:{},g=o,_=r&&s;return r&&!_&&(g={value:Zl(p,b,b[0]||null),options:b,action:"initial-input-focus"},_=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(g=null),Oe(Oe(Oe({},m),h),{},{prevProps:e,ariaSelection:g,prevWasFocused:_})}}],i&&Me(l.prototype,i),n&&Me(l,n),Object.defineProperty(l,"prototype",{writable:!1}),r}(Re.Component);yn.defaultProps=on;var hn=(0,Re.forwardRef)((function(t,l){var i=function(e){var t=e.defaultInputValue,l=void 0===t?"":t,i=e.defaultMenuIsOpen,n=void 0!==i&&i,o=e.defaultValue,r=void 0===o?null:o,s=e.inputValue,a=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,b=e.value,m=Ne(e,Ae),v=Pe((0,Re.useState)(void 0!==s?s:l),2),f=v[0],y=v[1],h=Pe((0,Re.useState)(void 0!==a?a:n),2),g=h[0],_=h[1],k=Pe((0,Re.useState)(void 0!==b?b:r),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)),y(void 0!==l?l:e)}),[u]),O=(0,Re.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),x=(0,Re.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),T=void 0!==s?s:f,P=void 0!==a?a:g,N=void 0!==b?b:E;return Oe(Oe({},m),{},{inputValue:T,menuIsOpen:P,onChange:w,onInputChange:C,onMenuClose:x,onMenuOpen:O,value:N})}(t);return Re.createElement(yn,e({ref:l},i))}));const gn=hn,kn=window.wp.htmlEntities,En={context:"view",orderby:"name",order:"asc",per_page:-1,who:"authors",_fields:"id,name"};function Sn(e){const{className:l,fieldType:i,fieldName:r,handleRuleChange:s,triggerReset:a,value:c}=e,{authors:u,loading:d}=(0,o.useSelect)((e=>{const{getUsers:t,isResolving:l}=e("core");return{authors:t(En),loading:l("getUsers",[En])}}),[]),p=(0,t.useMemo)((()=>(null!=u?u:[]).map((e=>({value:e.id,label:(0,kn.decodeEntities)(e.name)})))),[u]),m=p.filter((e=>c.includes(e.value)));return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:m,options:p,placeholder:(0,n.__)("Select Author…","block-visibility"),onChange:e=>s(e,"multiSelect",i,r,a),isLoading:d,isMulti:!0})}const wn={context:"view",orderby:"name",order:"asc",per_page:-1,_fields:"id,name"};function Cn(e){const{className:l,fieldType:i,fieldName:n,handleRuleChange:r,placeholder:s,taxonomySlug:a,triggerReset:c,value:u}=e,{availableTerms:d,loading:p}=(0,o.useSelect)((e=>{const{getEntityRecords:t,isResolving:l}=e("core");return{availableTerms:t("taxonomy",a,wn),loading:l("getEntityRecords",["taxonomy",a,wn])}}),[a]),m=(0,t.useMemo)((()=>(null!=d?d:[]).map((e=>({value:e.id,label:(0,kn.decodeEntities)(e.name)})))),[d]),v=m.filter((e=>u.includes(e.value)));return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:v,options:m,placeholder:s,onChange:e=>r(e,"multiSelect",i,n,c),isLoading:p,isMulti:!0})}function On(e){const t=e?.title?.raw?(0,kn.decodeEntities)(e.title.rendered):`${(0,n.__)("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 xn(e){const{className:l,fieldType:r,fieldName:s,handleRuleChange:a,placeholder:c,postType:u,triggerReset:d,value:p,valueType:m,isMulti:v}=e,[f,y]=(0,t.useState)(!1),[h,g]=(0,t.useState)(!1),{availablePosts:_,loadingAvailablePosts:k}=(0,o.useSelect)((e=>{const{getPostType:t,getEntityRecords:l,isResolving:n}=e("core"),o=t(u),r=(0,i.get)(o,["hierarchical"],!1),s={orderby:r?"title":"date",order:r?"asc":"desc",per_page:25,status:"publish,draft,private,pending",_fields:"id,title,status"};return h&&(s.search=h),{availablePosts:l("postType",u,s),loadingAvailablePosts:n("getEntityRecords",["postType",u,s])}}),[h]),{savedPosts:E,loadingSavedPosts:S}=(0,o.useSelect)((e=>{if(0!==p.length&&!f){const t={include:p.join(","),per_page:-1,status:"publish,draft,private,pending",_fields:"id,title,status"},{getEntityRecords:l,isResolving:i}=e("core");return{savedPosts:l("postType",u,t),selectedLoading:i("getEntityRecords",["postType",u,t])}}return{savedPosts:[],loadingSavedPosts:!1}})),w=(0,t.useMemo)((()=>(null!=_?_:[]).map((e=>({value:e.id,label:On(e)})))),[_]);let C=[];return C=f||(null!=E?E:[]).map((e=>({value:e.id,label:On(e)}))),(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:C,options:w,onChange:e=>{const t="postSelect"===m?"select":"multiSelect";y(e),a(e,t,r,s,d)},onInputChange:(0,i.debounce)((e=>{(0===e.length||e.length>=3)&&g(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,n.__)("No options found","block-visibility"):(0,n.__)("Enter 3 characters to begin search","block-visibility")},placeholder:c,isLoading:k||S,isMulti:v})}function Tn(l){const{rule:i,fieldType:o,fieldName:r,valueType:s,valueTypeVariant:a,options:c,placeholder:d,handleRuleChange:p,triggerReset:m,isLoading:v,hasGroupedFields:f,hasGroupedOptions:y,dependantFieldValue:h}=l;if(f&&!i.field&&"ruleField"!==o)return null;let g="";var _;if("ruleField"===o)g=null!==(_=i?.field)&&void 0!==_?_:"";else if("subField"===o){var k,E;g=i?.subFields?null!==(k=i.subFields[r])&&void 0!==k?k:"":null!==(E=i?.subField)&&void 0!==E?E:""}else{var S;g=null!==(S=i["operatorField"===o?"operator":"value"])&&void 0!==S?S:""}if("select"===s||"multiSelect"===s){let e="",t=c;if(y){const e=[];c.forEach((t=>{e.push(...t.options)})),t=e}"multiSelect"===s?e=t.filter((e=>g.includes(e.value))):(e=t.filter((e=>e.value===g)),0!==e.length&&(e=e[0])),g=e}const w="field__"+o;if("select"===s||"multiSelect"===s){const e=d||(0,n.__)("Select…","block-visibility");return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",w),classNamePrefix:"react-select",value:g,options:c,placeholder:e,onChange:e=>p(e,s,o,r,m),isMulti:"multiSelect"===s,isLoading:v})}if("date"===s||"dateTime"===s)return(0,t.createElement)(ke,{className:w,value:g,onChange:e=>p(e,s,o,r,m),includeTime:"dateTime"===s});if("toggle"===s)return(0,t.createElement)(u.ToggleControl,{className:w,label:d,checked:g,onChange:()=>p(!g,s,o,r,m)});if("authorsSelect"===s)return(0,t.createElement)(Sn,e({className:w,value:g},l));if("termsSelect"===s){let i;return h&&!a?i=h:a&&(i=a),(0,t.createElement)(Cn,e({key:i,taxonomySlug:i,className:w,value:g},l))}if("postsSelect"===s||"postSelect"===s){let i;return h&&!a?i=h:a&&(i=a),(0,t.createElement)(xn,e({key:i,postType:i,className:w,value:g,valueType:s,isMulti:"postsSelect"===s},l))}return(0,t.createElement)(u.TextControl,{className:w,type:s,min:"number"===s?0:"",value:g,placeholder:d,onChange:e=>p(e,"text",o,r,m),autocomplete:"off"})}function Pn(e){var l,o,r,s;const{rule:a,ruleIndex:c,ruleSet:d,ruleSetIndex:p,ruleSets:m,hideOnRuleSets:v,rulePlaceholder:f,ruleLabel:y,controlName:h,controlAtts:g,setControlAtts:_,groupedFields:k,allFields:E}=e;let S=E.filter((e=>e.value===a.field));k||(S=E.filter((e=>"ruleField"===e.type))),0!==S.length&&(S=S[0]);const w=k?null!==(l=S?.fields)&&void 0!==l?l:[]:E,C=null!==(o=S?.help)&&void 0!==o&&o,O=null!==(r=S?.hasMultipleSubFields)&&void 0!==r&&r,x=null!==(s=S?.hasSimplifiedLayout)&&void 0!==s&&s;let T=y;T||(T=()=>0===c?(0,n.sprintf)( +(0,n.__)("%s toggled"),l.label),"assertive")}},l.icon&&(0,t.createElement)(q,{className:"control-branding-icon",icon:l.icon}),l.label)}const me=[{type:"text",label:(0,n.__)("Text","block-visibility")},{type:"textarea",label:(0,n.__)("Text Area","block-visibility")},{type:"number",label:(0,n.__)("Number","block-visibility"),options:"numeric"},{type:"range",label:(0,n.__)("Range","block-visibility"),options:"numeric"},{type:"email",label:(0,n.__)("Email","block-visibility")},{type:"url",label:(0,n.__)("Url","block-visibility")},{type:"password",label:(0,n.__)("Password","block-visibility")},{type:"image",label:(0,n.__)("Image","block-visibility")},{type:"file",label:(0,n.__)("File","block-visibility")},{type:"wysiwyg",label:(0,n.__)("Wysiwyg Editor","block-visibility")},{type:"oembed",label:(0,n.__)("oEmbed","block-visibility")},{type:"select",label:(0,n.__)("Select","block-visibility")},{type:"checkbox",label:(0,n.__)("Checkbox","block-visibility")},{type:"radio",label:(0,n.__)("Radio Button","block-visibility")},{type:"button_group",label:(0,n.__)("Button Group","block-visibility")},{type:"true_false",label:(0,n.__)("True / False","block-visibility"),options:"boolean"},{type:"link",label:(0,n.__)("Link","block-visibility")},{type:"post_object",label:(0,n.__)("Post Object","block-visibility")},{type:"page_link",label:(0,n.__)("Page Link","block-visibility")},{type:"relationship",label:(0,n.__)("Relationship","block-visibility")},{type:"taxonomy",label:(0,n.__)("Taxonomy","block-visibility")},{type:"user",label:(0,n.__)("User","block-visibility")},{type:"google_map",label:(0,n.__)("Google Map","block-visibility")},{type:"date_picker",label:(0,n.__)("Date Picker","block-visibility"),options:"dateTime"},{type:"date_time_picker",label:(0,n.__)("Date Time Picker","block-visibility"),options:"dateTime"},{type:"time_picker",label:(0,n.__)("Time Picker","block-visibility"),options:"dateTime"},{type:"color_picker",label:(0,n.__)("Color Picker","block-visibility")},{type:"message",label:(0,n.__)("Message","block-visibility")},{type:"accordion",label:(0,n.__)("Accordion","block-visibility")},{type:"tab",label:(0,n.__)("Tab","block-visibility")},{type:"group",label:(0,n.__)("Group","block-visibility")},{type:"repeater",label:(0,n.__)("Repeater","block-visibility")},{type:"flexible_content",label:(0,n.__)("Flexible Content","block-visibility")},{type:"clone",label:(0,n.__)("Clone","block-visibility")}];function ve(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:"",r=null!==(l=e?.fields)&&void 0!==l?l:[];0!==r.length&&r.forEach((e=>{var t,l;const r=null!==(t=e?.key)&&void 0!==t?t:"",s=null!==(l=e?.label)&&void 0!==l?l:"";i.push({value:r,label:s,group:o,help:"Field type: "+me.filter((t=>t?.type===e?.type))[0]?.label,fields:[{type:"subField",name:"isUserField",valueType:"toggle",placeholder:(0,n.__)("Evaluate as user field","block-visibility")},{type:"operatorField",valueType:"select",options:fe(e),placeholder:(0,n.__)("Select Condition…","block-visibility")},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","greaterThan","greaterThanEqual","lessThan","lessThanEqual","contains","notContain"]}]}]})}))})),i}function fe(e){const t=me.filter((t=>t?.type===e?.type))[0]?.options,l=[{value:"notEmpty",label:(0,n.__)("True","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("False","block-visibility"),disableValue:!0}],i=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"greaterThan",label:(0,n.__)("Value is greater than","block-visibility")},{value:"greaterThanEqual",label:(0,n.__)("Value is greater or equal to","block-visibility")},{value:"lessThan",label:(0,n.__)("Value is less than","block-visibility")},{value:"lessThanEqual",label:(0,n.__)("Value is less than or equal to","block-visibility")}],o=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,n.__)("Value contains","block-visibility")},{value:"notContain",label:(0,n.__)("Value does not contain","block-visibility")}];return"boolean"===t?l:"dateTime"===t||"numeric"===t?i:o}function ye(e){const{value:l,onDateChange:i,setPopoverOpen:n,includeTime:o}=e,r=(0,Z.__experimentalGetSettings)(),s=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",onClose:n.bind(null,!1)},[o&&(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{i(e),n(!1)},is12Hour:s}),!o&&(0,t.createElement)(u.DatePicker,{currentDate:l,onChange:e=>{i(e),n(!1)},is12Hour:s})])}const he=(0,t.createElement)(j.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(j.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"})),ge=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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 _e(e){const{value:l,setPopoverOpen:i,onClearDateTime:o,includeTime:r}=e;let s=r?(0,n.__)("Select Date and Time…","block-visibility"):(0,n.__)("Select Date…","block-visibility");const a=(0,Z.__experimentalGetSettings)();if(l){const e=r?`${a.formats.date} ${a.formats.time}`:`${a.formats.date}`;s=(0,Z.format)(e,l)}return(0,t.createElement)("div",{className:b()("date-time__date-time-field",{"has-value":l})},(0,t.createElement)(u.Button,{icon:he,title:(0,n.__)("Select date/time","block-visibility"),onClick:()=>i((e=>!e)),isLink:!0},(0,t.createElement)("span",null,s)),l&&(0,t.createElement)(u.Button,{icon:ge,className:"clear-date-time",title:(0,n.__)("Clear date/time","block-visibility"),onClick:()=>o("")}))}function ke(e){const{value:l,onChange:i,includeTime:n}=e,[o,r]=(0,t.useState)(!1);return(0,t.createElement)("div",{className:"date-time"},(0,t.createElement)(_e,{value:l,setPopoverOpen:r,onClearDateTime:()=>i(""),includeTime:n}),o&&(0,t.createElement)(ye,{value:l,onDateChange:e=>i(e),setPopoverOpen:r,includeTime:n}))}const Ee=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.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 Se(e){const{message:l,subMessage:i,link:o,position:r}=e,s=null!=r?r:"middle left";return(0,t.createElement)("div",{className:"information-popover"},(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("More Information","block-visibility"),icon:Ee,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:s,noArrow:!1}},(()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",null,l),i&&(0,t.createElement)("p",null,i),o&&(0,t.createElement)(u.ExternalLink,{href:o},(0,n.__)("Learn More","block-visibility"))))))}function we(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function Ce(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 Oe(e){for(var t=1;te.length)&&(t=e.length);for(var l=0,i=new Array(t);l=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}var Ae=l(196),Re=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Me(e,t){for(var l=0;l0?$e(lt,--et):0,Qe--,10===tt&&(Qe=1,Ke--),tt}function rt(){return tt=et2||ut(tt)>3?"":" "}function vt(e,t){for(;--t&&rt()&&!(tt<48||tt>102||tt>57&&tt<65||tt>70&&tt<97););return ct(e,at()+(t<6&&32==st()&&32==rt()))}function ft(e){for(;rt();)switch(tt){case e:return et;case 34:case 39:34!==e&&39!==e&&ft(tt);break;case 40:41===e&&ft(e);break;case 92:rt()}return et}function yt(e,t){for(;rt()&&e+tt!==57&&(e+tt!==84||47!==st()););return"/*"+ct(t,et-1)+"*"+Ue(47===e?e:rt())}function ht(e){for(;!ut(st());)rt();return ct(e,et)}var gt="-ms-",_t="-moz-",kt="-webkit-",Et="comm",St="rule",wt="decl",Ct="@keyframes";function Ot(e,t){for(var l="",i=Ye(e),n=0;n0&&Ze(S)-d&&Xe(b>32?Rt(S+";",i,l,d-1):Rt(qe(S," ","")+";",i,l,d-2),a);break;case 59:S+=";";default:if(Xe(E=Nt(S,t,l,c,u,n,s,g,_=[],k=[],d),o),123===h)if(0===u)Pt(S,t,E,E,_,o,d,s,k);else switch(99===p&&110===$e(S,3)?100:p){case 100:case 109:case 115:Pt(e,E,E,i&&Xe(Nt(e,E,E,0,0,n,s,g,n,_=[],d),k),n,k,d,s,i?_:k);break;default:Pt(S,E,E,E,[""],k,0,s,k)}}c=u=b=0,v=y=1,g=S="",d=r;break;case 58:d=1+Ze(S),b=m;default:if(v<1)if(123==h)--v;else if(125==h&&0==v++&&125==ot())continue;switch(S+=Ue(h),h*v){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Ze(S)-1)*y,y=1;break;case 64:45===st()&&(S+=bt(rt())),p=st(),u=d=Ze(g=S+=ht(at())),h++;break;case 45:45===m&&2==Ze(S)&&(v=0)}}return o}function Nt(e,t,l,i,n,o,r,s,a,c,u){for(var d=n-1,p=0===n?o:[""],b=Ye(p),m=0,v=0,f=0;m0?p[y]+" "+h:qe(h,/&\f/g,p[y])))&&(a[f++]=g);return it(e,t,l,0===n?St:s,a,c,u)}function At(e,t,l){return it(e,t,l,Et,Ue(tt),We(e,2,-2),0)}function Rt(e,t,l,i){return it(e,t,l,wt,We(e,0,i),We(e,i+1,-1),i)}var Mt=function(e,t,l){for(var i=0,n=0;i=n,n=st(),38===i&&12===n&&(t[l]=1),!ut(n);)rt();return ct(e,et)},Vt=new WeakMap,Ft=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)||Vt.get(l))&&!i){Vt.set(e,!0);for(var n=[],o=function(e,t){return pt(function(e,t){var l=-1,i=44;do{switch(ut(i)){case 0:38===i&&12===st()&&(t[l]=1),e[l]+=Mt(et-1,t,l);break;case 2:e[l]+=bt(i);break;case 4:if(44===i){e[++l]=58===st()?"&\f":"",t[l]=e[l].length;break}default:e[l]+=Ue(i)}}while(i=rt());return e}(dt(e),t))}(t,n),r=l.props,s=0,a=0;s6)switch($e(e,t+1)){case 109:if(45!==$e(e,t+4))break;case 102:return qe(e,/(.+:)(.+)-([^]+)/,"$1"+kt+"$2-$3$1"+_t+(108==$e(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ge(e,"stretch")?Dt(qe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==$e(e,t+1))break;case 6444:switch($e(e,Ze(e)-3-(~Ge(e,"!important")&&10))){case 107:return qe(e,":",":"+kt)+e;case 101:return qe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+kt+(45===$e(e,14)?"inline-":"")+"box$3$1"+kt+"$2$3$1"+gt+"$2box$3")+e}break;case 5936:switch($e(e,t+11)){case 114:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return kt+e+gt+qe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return kt+e+gt+e+e}return e}var Lt=[function(e,t,l,i){if(e.length>-1&&!e.return)switch(e.type){case wt:e.return=Dt(e.value,e.length);break;case Ct:return Ot([nt(e,{value:qe(e.value,"@","@"+kt)})],i);case St: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 Ot([nt(e,{props:[qe(t,/:(read-\w+)/,":"+_t+"$1")]})],i);case"::placeholder":return Ot([nt(e,{props:[qe(t,/:(plac\w+)/,":"+kt+"input-$1")]}),nt(e,{props:[qe(t,/:(plac\w+)/,":"+_t+"$1")]}),nt(e,{props:[qe(t,/:(plac\w+)/,gt+"input-$1")]})],i)}return""}))}}];const Ht=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,n,o=e.stylisPlugins||Lt,r={},s=[];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,n-=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(n){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)},jt={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};var zt=/[A-Z]|^ms/g,qt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Gt=function(e){return 45===e.charCodeAt(1)},$t=function(e){return null!=e&&"boolean"!=typeof e},Wt=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Gt(l=e)?l:l.replace(zt,"-$&").toLowerCase()),t[e];var l}}(),Zt=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(qt,(function(e,t,l){return Xt={name:t,styles:l,next:Xt},t}))}return 1===jt[e]||Gt(e)||"number"!=typeof t||0===t?t:t+"px"};function Yt(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 Xt={name:l.name,styles:l.styles,next:Xt},l.name;if(void 0!==l.styles){var i=l.next;if(void 0!==i)for(;void 0!==i;)Xt={name:i.name,styles:i.styles,next:Xt},i=i.next;return l.styles+";"}return function(e,t,l){var i="";if(Array.isArray(l))for(var n=0;ne.brand+"/"+e.version)).join(" "),vl):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const kl=Math.round;function El(e){return yl(e)?e:e.contextElement}const Sl={x:1,y:1};function wl(e){const t=El(e);if(!fl(t))return Sl;const l=t.getBoundingClientRect(),{width:i,height:n,fallback:o}=function(e){const t=pl(e);let l=parseFloat(t.width),i=parseFloat(t.height);const n=fl(e),o=n?e.offsetWidth:l,r=n?e.offsetHeight:i,s=kl(l)!==o||kl(i)!==r;return s&&(l=o,i=r),{width:l,height:i,fallback:s}}(t);let r=(o?kl(l.width):l.width)/i,s=(o?kl(l.height):l.height)/n;return r&&Number.isFinite(r)||(r=1),s&&Number.isFinite(s)||(s=1),{x:r,y:s}}function Cl(e,t,l,i){var n,o;void 0===t&&(t=!1),void 0===l&&(l=!1);const r=e.getBoundingClientRect(),s=El(e);let a=Sl;t&&(i?yl(i)&&(a=wl(i)):a=wl(e));const c=s?dl(s):window,u=_l()&&l;let d=(r.left+(u&&(null==(n=c.visualViewport)?void 0:n.offsetLeft)||0))/a.x,p=(r.top+(u&&(null==(o=c.visualViewport)?void 0:o.offsetTop)||0))/a.y,b=r.width/a.x,m=r.height/a.y;if(s){const e=dl(s),t=i&&yl(i)?dl(i):i;let l=e.frameElement;for(;l&&i&&t!==e;){const e=wl(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,m*=e.y,d+=t.x,p+=t.y,l=dl(l).frameElement}}return v={width:b,height:m,x:d,y:p},{...v,top:v.y,left:v.x,right:v.x+v.width,bottom:v.y+v.height};var v}function Ol(e){if("html"===ml(e))return e;const t=e.assignedSlot||e.parentNode||hl(e)&&e.host||function(e){return((bl(e)?e.ownerDocument:e.document)||window.document).documentElement}(e);return hl(t)?t.host:t}function xl(e){const t=Ol(e);return function(e){return["html","body","#document"].includes(ml(e))}(t)?t.ownerDocument.body:fl(t)&&gl(t)?t:xl(t)}function Tl(e,t){var l;void 0===t&&(t=[]);const i=xl(e),n=i===(null==(l=e.ownerDocument)?void 0:l.body),o=dl(i);return n?t.concat(o,o.visualViewport||[],gl(i)?i:[]):t.concat(i,Tl(i))}const Pl=Ae.useLayoutEffect;var Nl=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Al=function(){};function Rl(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Ml(e,t){for(var l=arguments.length,i=new Array(l>2?l-2:0),n=2;n-1}function Ll(e){return Dl(e)?window.pageYOffset:e.scrollTop}function Hl(e,t){Dl(e)?window.scrollTo(0,t):e.scrollTop=t}function Bl(e,t){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Al,n=Ll(e),o=t-n,r=0;!function t(){var s,a=(s=r+=10,o*((s=s/l-1)*s*s+1)+n);Hl(e,a),rl.bottom?Hl(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):i.top-n=m)return{placement:"bottom",maxHeight:t};if(w>=m&&!r)return o&&Bl(a,C,x),{placement:"bottom",maxHeight:t};if(!r&&w>=i||r&&E>=i)return o&&Bl(a,C,x),{placement:"bottom",maxHeight:r?E-g:w-g};if("auto"===n||r){var T=t,P=r?k:S;return P>=i&&(T=Math.min(P-g-s,t)),{placement:"top",maxHeight:T}}if("bottom"===n)return o&&Hl(a,C),{placement:"bottom",maxHeight:t};break;case"top":if(k>=m)return{placement:"top",maxHeight:t};if(S>=m&&!r)return o&&Bl(a,O,x),{placement:"top",maxHeight:t};if(!r&&S>=i||r&&k>=i){var N=t;return(!r&&S>=i||r&&k>=i)&&(N=r?k-_:S-_),o&&Bl(a,O,x),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return c}({maxHeight:i,menuEl:e,minHeight:l,placement:n,shouldScroll:r&&!t,isFixedPosition:t,controlHeight:f});p(s.maxHeight),v(s.placement),null==a||a(s.placement)}}),[i,n,o,r,l,a,f]),t({ref:c,placerProps:Oe(Oe({},e),{},{placement:m||Yl(n),maxHeight:d})})},Ql=function(e,t){var l=e.theme,i=l.spacing.baseUnit,n=l.colors;return Oe({textAlign:"center"},t?{}:{color:n.neutral40,padding:"".concat(2*i,"px ").concat(3*i,"px")})},Jl=Ql,ei=Ql,ti=function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),l)};ti.defaultProps={children:"No options"};var li=function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),l)};li.defaultProps={children:"Loading..."};var ii,ni,oi,ri=["size"],si={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ai=function(t){var l=t.size,i=Ne(t,ri);return al("svg",e({height:l,width:l,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:si},i))},ci=function(t){return al(ai,e({size:20},t),al("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"}))},ui=function(t){return al(ai,e({size:20},t),al("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"}))},di=function(e,t){var l=e.isFocused,i=e.theme,n=i.spacing.baseUnit,o=i.colors;return Oe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:l?o.neutral60:o.neutral20,padding:2*n,":hover":{color:l?o.neutral80:o.neutral40}})},pi=di,bi=di,mi=function(){var e=cl.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_"}}}(ii||(ni=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],oi||(oi=ni.slice(0)),ii=Object.freeze(Object.defineProperties(ni,{raw:{value:Object.freeze(oi)}})))),vi=function(e){var t=e.delay,l=e.offset;return al("span",{css:cl({animation:"".concat(mi," 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"},"","")})},fi=function(t){var l=t.innerProps,i=t.isRtl;return al("div",e({},Il(t,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),l),al(vi,{delay:0,offset:i}),al(vi,{delay:160,offset:!0}),al(vi,{delay:320,offset:!i}))};fi.defaultProps={size:4};var yi=["data"],hi=["innerRef","isDisabled","isHidden","inputClassName"],gi={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},_i={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Oe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},gi)},ki=function(e){return Oe({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},gi)},Ei=function(e){var t=e.children,l=e.innerProps;return al("div",l,t)},Si={ClearIndicator:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),l||al(ci,null))},Control:function(t){var l=t.children,i=t.isDisabled,n=t.isFocused,o=t.innerRef,r=t.innerProps,s=t.menuIsOpen;return al("div",e({ref:o},Il(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":n,"control--menu-is-open":s}),r),l)},DropdownIndicator:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),l||al(ui,null))},DownChevron:ui,CrossIcon:ci,Group:function(t){var l=t.children,i=t.cx,n=t.getStyles,o=t.getClassNames,r=t.Heading,s=t.headingProps,a=t.innerProps,c=t.label,u=t.theme,d=t.selectProps;return al("div",e({},Il(t,"group",{group:!0}),a),al(r,e({},s,{selectProps:d,theme:u,getStyles:n,getClassNames:o,cx:i}),c),al("div",null,l))},GroupHeading:function(t){var l=Fl(t);l.data;var i=Ne(l,yi);return al("div",e({},Il(t,"groupHeading",{"group-heading":!0}),i))},IndicatorsContainer:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"indicatorsContainer",{indicators:!0}),i),l)},IndicatorSeparator:function(t){var l=t.innerProps;return al("span",e({},l,Il(t,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(t){var l=t.cx,i=t.value,n=Fl(t),o=n.innerRef,r=n.isDisabled,s=n.isHidden,a=n.inputClassName,c=Ne(n,hi);return al("div",e({},Il(t,"input",{"input-container":!0}),{"data-value":i||""}),al("input",e({className:l({input:!0},a),ref:o,style:ki(s),disabled:r},c)))},LoadingIndicator:fi,Menu:function(t){var l=t.children,i=t.innerRef,n=t.innerProps;return al("div",e({},Il(t,"menu",{menu:!0}),{ref:i},n),l)},MenuList:function(t){var l=t.children,i=t.innerProps,n=t.innerRef,o=t.isMulti;return al("div",e({},Il(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:n},i),l)},MenuPortal:function(t){var l=t.appendTo,i=t.children,n=t.controlElement,o=t.innerProps,r=t.menuPlacement,s=t.menuPosition,a=(0,Ae.useRef)(null),c=(0,Ae.useRef)(null),u=Pe((0,Ae.useState)(Yl(r)),2),d=u[0],p=u[1],b=(0,Ae.useMemo)((function(){return{setPortalPlacement:p}}),[]),m=Pe((0,Ae.useState)(null),2),v=m[0],f=m[1],y=(0,Ae.useCallback)((function(){if(n){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}}(n),t="fixed"===s?0:window.pageYOffset,l=e[d]+t;l===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||f({offset:l,rect:e})}}),[n,s,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);Pl((function(){y()}),[y]);var h=(0,Ae.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),n&&a.current&&(c.current=function(e,t,l,i){void 0===i&&(i={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r=!0,animationFrame:s=!1}=i,a=n&&!s,c=a||o?[...yl(e)?Tl(e):e.contextElement?Tl(e.contextElement):[],...Tl(t)]:[];c.forEach((e=>{a&&e.addEventListener("scroll",l,{passive:!0}),o&&e.addEventListener("resize",l)}));let u,d=null;r&&(d=new ResizeObserver((()=>{l()})),yl(e)&&!s&&d.observe(e),yl(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t));let p=s?Cl(e):null;return s&&function t(){const i=Cl(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=>{a&&e.removeEventListener("scroll",l),o&&e.removeEventListener("resize",l)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(u)}}(n,a.current,y,{elementResize:"ResizeObserver"in window}))}),[n,y]);Pl((function(){h()}),[h]);var g=(0,Ae.useCallback)((function(e){a.current=e,h()}),[h]);if(!l&&"fixed"!==s||!v)return null;var _=al("div",e({ref:g},Il(Oe(Oe({},t),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),i);return al(Xl.Provider,{value:b},l?(0,ul.createPortal)(_,l):_)},LoadingMessage:li,NoOptionsMessage:ti,MultiValue:function(e){var t=e.children,l=e.components,i=e.data,n=e.innerProps,o=e.isDisabled,r=e.removeProps,s=e.selectProps,a=l.Container,c=l.Label,u=l.Remove;return al(a,{data:i,innerProps:Oe(Oe({},Il(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),n),selectProps:s},al(c,{data:i,innerProps:Oe({},Il(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),al(u,{data:i,innerProps:Oe(Oe({},Il(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},r),selectProps:s}))},MultiValueContainer:Ei,MultiValueLabel:Ei,MultiValueRemove:function(t){var l=t.children,i=t.innerProps;return al("div",e({role:"button"},i),l||al(ci,{size:14}))},Option:function(t){var l=t.children,i=t.isDisabled,n=t.isFocused,o=t.isSelected,r=t.innerRef,s=t.innerProps;return al("div",e({},Il(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":n,"option--is-selected":o}),{ref:r,"aria-disabled":i},s),l)},Placeholder:function(t){var l=t.children,i=t.innerProps;return al("div",e({},Il(t,"placeholder",{placeholder:!0}),i),l)},SelectContainer:function(t){var l=t.children,i=t.innerProps,n=t.isDisabled,o=t.isRtl;return al("div",e({},Il(t,"container",{"--is-disabled":n,"--is-rtl":o}),i),l)},SingleValue:function(t){var l=t.children,i=t.isDisabled,n=t.innerProps;return al("div",e({},Il(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),n),l)},ValueContainer:function(t){var l=t.children,i=t.innerProps,n=t.isMulti,o=t.hasValue;return al("div",e({},Il(t,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":o}),i),l)}},wi=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ci(e,t){if(e.length!==t.length)return!1;for(var l=0;l1?"s":""," ").concat(n.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,l=e.focused,i=e.options,n=e.label,o=void 0===n?"":n,r=e.selectValue,s=e.isDisabled,a=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(o," focused, ").concat(c(r,l),".");if("menu"===t){var u=s?" disabled":"",d="".concat(a?"selected":"focused").concat(u);return"option ".concat(o," ").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:"",".")}},Pi=function(e){var t=e.ariaSelection,l=e.focusedOption,i=e.focusedValue,n=e.focusableOptions,o=e.isFocused,r=e.selectValue,s=e.selectProps,a=e.id,c=s.ariaLiveMessages,u=s.getOptionLabel,d=s.inputValue,p=s.isMulti,b=s.isOptionDisabled,m=s.isSearchable,v=s.menuIsOpen,f=s.options,y=s.screenReaderStatus,h=s.tabSelectsValue,g=s["aria-label"],_=s["aria-live"],k=(0,Ae.useMemo)((function(){return Oe(Oe({},Ti),c||{})}),[c]),E=(0,Ae.useMemo)((function(){var e,l="";if(t&&k.onChange){var i=t.option,n=t.options,o=t.removedValue,s=t.removedValues,a=t.value,c=o||i||(e=a,Array.isArray(e)?null:e),d=c?u(c):"",p=n||s||void 0,m=p?p.map(u):[],v=Oe({isDisabled:c&&b(c,r),label:d,labels:m},t);l=k.onChange(v)}return l}),[t,k,b,r,u]),S=(0,Ae.useMemo)((function(){var e="",t=l||i,o=!!(l&&r&&r.includes(l));if(t&&k.onFocus){var s={focused:t,label:u(t),isDisabled:b(t,r),isSelected:o,options:n,context:t===l?"menu":"value",selectValue:r};e=k.onFocus(s)}return e}),[l,i,u,b,k,n,r]),w=(0,Ae.useMemo)((function(){var e="";if(v&&f.length&&k.onFilter){var t=y({count:n.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[n,d,v,k,f,y]),C=(0,Ae.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":v?"menu":"input";e=k.guidance({"aria-label":g,context:t,isDisabled:l&&b(l,r),isMulti:p,isSearchable:m,tabSelectsValue:h})}return e}),[g,l,i,p,b,m,v,k,r,h]),O="".concat(S," ").concat(w," ").concat(C),x=al(Ae.Fragment,null,al("span",{id:"aria-selection"},E),al("span",{id:"aria-context"},O)),T="initial-input-focus"===(null==t?void 0:t.action);return al(Ae.Fragment,null,al(xi,{id:a},T&&x),al(xi,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},o&&!T&&x))},Ni=[{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źẑżžẓẕƶȥɀⱬꝣ"}],Ai=new RegExp("["+Ni.map((function(e){return e.letters})).join("")+"]","g"),Ri={},Mi=0;Mi1?t-1:0),i=1;i0,v=d-p-u,f=!1;v>t&&r.current&&(i&&i(e),r.current=!1),m&&s.current&&(o&&o(e),s.current=!1),m&&t>v?(l&&!r.current&&l(e),b.scrollTop=d,f=!0,r.current=!0):!m&&-t>u&&(n&&!s.current&&n(e),b.scrollTop=0,f=!0,s.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[l,i,n,o]),d=(0,Ae.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,Ae.useCallback)((function(e){a.current=e.changedTouches[0].clientY}),[]),b=(0,Ae.useCallback)((function(e){var t=a.current-e.changedTouches[0].clientY;u(e,t)}),[u]),m=(0,Ae.useCallback)((function(e){if(e){var t=!!$l&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",b,t)}}),[b,p,d]),v=(0,Ae.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",b,!1))}),[b,p,d]);return(0,Ae.useEffect)((function(){if(t){var e=c.current;return m(e),function(){v(e)}}}),[t,m,v]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),o=function(e){var t=e.isEnabled,l=e.accountForScrollbars,i=void 0===l||l,n=(0,Ae.useRef)({}),o=(0,Ae.useRef)(null),r=(0,Ae.useCallback)((function(e){if(Zi){var t=document.body,l=t&&t.style;if(i&&ji.forEach((function(e){var t=l&&l[e];n.current[e]=t})),i&&Yi<1){var o=parseInt(n.current.paddingRight,10)||0,r=document.body?document.body.clientWidth:0,s=window.innerWidth-r+o||0;Object.keys(zi).forEach((function(e){var t=zi[e];l&&(l[e]=t)})),l&&(l.paddingRight="".concat(s,"px"))}t&&Wi()&&(t.addEventListener("touchmove",qi,Xi),e&&(e.addEventListener("touchstart",$i,Xi),e.addEventListener("touchmove",Gi,Xi))),Yi+=1}}),[i]),s=(0,Ae.useCallback)((function(e){if(Zi){var t=document.body,l=t&&t.style;Yi=Math.max(Yi-1,0),i&&Yi<1&&ji.forEach((function(e){var t=n.current[e];l&&(l[e]=t)})),t&&Wi()&&(t.removeEventListener("touchmove",qi,Xi),e&&(e.removeEventListener("touchstart",$i,Xi),e.removeEventListener("touchmove",Gi,Xi)))}}),[i]);return(0,Ae.useEffect)((function(){if(t){var e=o.current;return r(e),function(){s(e)}}}),[t,r,s]),function(e){o.current=e}}({isEnabled:l});return al(Ae.Fragment,null,l&&al("div",{onClick:Ki,css:Qi}),t((function(e){n(e),o(e)})))}var en={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},tn=function(e){var t=e.name,l=e.onFocus;return al("input",{required:!0,name:t,tabIndex:-1,onFocus:l,css:en,value:"",onChange:function(){}})},ln={clearIndicator:bi,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,n=e.theme,o=n.colors,r=n.borderRadius;return Oe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:n.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:l?o.neutral5:o.neutral0,borderColor:l?o.neutral10:i?o.primary:o.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},dropdownIndicator:pi,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,n=l.spacing;return Oe({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*n.baseUnit,paddingRight:3*n.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,n=i.spacing.baseUnit,o=i.colors;return Oe({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:l?o.neutral10:o.neutral20,marginBottom:2*n,marginTop:2*n})},input:function(e,t){var l=e.isDisabled,i=e.value,n=e.theme,o=n.spacing,r=n.colors;return Oe(Oe({visibility:l?"hidden":"visible",transform:i?"translateZ(0)":""},_i),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:r.neutral80})},loadingIndicator:function(e,t){var l=e.isFocused,i=e.size,n=e.theme,o=n.colors,r=n.spacing.baseUnit;return Oe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:l?o.neutral60:o.neutral20,padding:2*r})},loadingMessage:ei,menu:function(e,t){var l,i=e.placement,n=e.theme,o=n.borderRadius,r=n.spacing,s=n.colors;return Oe((we(l={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(i),"100%"),we(l,"position","absolute"),we(l,"width","100%"),we(l,"zIndex",1),l),t?{}:{backgroundColor:s.neutral0,borderRadius:o,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 l=e.maxHeight,i=e.theme.spacing.baseUnit;return Oe({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,n=l.borderRadius,o=l.colors;return Oe({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:n/2,margin:i.baseUnit/2})},multiValueLabel:function(e,t){var l=e.theme,i=l.borderRadius,n=l.colors,o=e.cropWithEllipsis;return Oe({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:n.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var l=e.theme,i=l.spacing,n=l.borderRadius,o=l.colors,r=e.isFocused;return Oe({alignItems:"center",display:"flex"},t?{}:{borderRadius:n/2,backgroundColor:r?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:Jl,option:function(e,t){var l=e.isDisabled,i=e.isFocused,n=e.isSelected,o=e.theme,r=o.spacing,s=o.colors;return Oe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:n?s.primary:i?s.primary25:"transparent",color:l?s.neutral20:n?s.neutral0:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),":active":{backgroundColor:l?void 0:n?s.primary:s.primary50}})},placeholder:function(e,t){var l=e.theme,i=l.spacing,n=l.colors;return Oe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:n.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},singleValue:function(e,t){var l=e.isDisabled,i=e.theme,n=i.spacing,o=i.colors;return Oe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:l?o.neutral40:o.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},valueContainer:function(e,t){var l=e.theme.spacing,i=e.isMulti,n=e.hasValue,o=e.selectProps.controlShouldRenderValue;return Oe({alignItems:"center",display:i&&n&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(l.baseUnit/2,"px ").concat(2*l.baseUnit,"px")})}},nn={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}},on={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:jl(),captureMenuScroll:!jl(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var l=Oe({ignoreCase:!0,ignoreAccents:!0,stringify:Hi,trim:!0,matchFrom:"any"},undefined),i=l.ignoreCase,n=l.ignoreAccents,o=l.stringify,r=l.trim,s=l.matchFrom,a=r?Li(t):t,c=r?Li(o(e)):o(e);return i&&(a=a.toLowerCase(),c=c.toLowerCase()),n&&(a=Di(a),c=Ii(c)),"start"===s?c.substr(0,a.length)===a:c.indexOf(a)>-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 rn(e,t,l,i){return{type:"option",data:t,isDisabled:pn(e,t,l),isSelected:bn(e,t,l),label:un(e,t),value:dn(e,t),index:i}}function sn(e,t){return e.options.map((function(l,i){if("options"in l){var n=l.options.map((function(l,i){return rn(e,l,t,i)})).filter((function(t){return cn(e,t)}));return n.length>0?{type:"group",data:l,options:n,index:i}:void 0}var o=rn(e,l,t,i);return cn(e,o)?o:void 0})).filter(Wl)}function an(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Le(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function cn(e,t){var l=e.inputValue,i=void 0===l?"":l,n=t.data,o=t.isSelected,r=t.label,s=t.value;return(!vn(e)||!o)&&mn(e,{label:r,value:s,data:n},i)}var un=function(e,t){return e.getOptionLabel(t)},dn=function(e,t){return e.getOptionValue(t)};function pn(e,t,l){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,l)}function bn(e,t,l){if(l.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,l);var i=dn(e,t);return l.some((function(t){return dn(e,t)===i}))}function mn(e,t,l){return!e.filterOption||e.filterOption(t,l)}var vn=function(e){var t=e.hideSelectedOptions,l=e.isMulti;return void 0===t?l:t},fn=1,yn=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&&Ve(e,t)}(r,t);var l,i,n,o=De(r);function r(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(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,l){var i=t.props,n=i.onChange,o=i.name;l.name=o,t.ariaOnChange(e,l),n(e,l)},t.setValue=function(e,l,i){var n=t.props,o=n.closeMenuOnSelect,r=n.isMulti,s=n.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(t.setState({inputIsHiddenAfterUpdate:!r}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:l,option:i})},t.selectOption=function(e){var l=t.props,i=l.blurInputOnSelect,n=l.isMulti,o=l.name,r=t.state.selectValue,s=n&&t.isOptionSelected(e,r),a=t.isOptionDisabled(e,r);if(s){var c=t.getOptionValue(e);t.setValue(r.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(a)return void t.ariaOnChange(e,{action:"select-option",option:e,name:o});n?t.setValue([].concat(Le(r),[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,n=t.getOptionValue(e),o=i.filter((function(e){return t.getOptionValue(e)!==n})),r=Zl(l,o,o[0]||null);t.onChange(r,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(Zl(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],n=l.slice(0,l.length-1),o=Zl(e,n,n[0]||null);t.onChange(o,{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||o>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 vn(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var l=t.props,i=l.isMulti,n=l.backspaceRemovesValue,o=l.escapeClearsValue,r=l.inputValue,s=l.isClearable,a=l.isDisabled,c=l.menuIsOpen,u=l.onKeyDown,d=l.tabSelectsValue,p=l.openMenuOnFocus,b=t.state,m=b.focusedOption,v=b.focusedValue,f=b.selectValue;if(!(a||"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(v)t.removeValue(v);else{if(!n)return;i?t.popValue():s&&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()):s&&o&&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||++fn),t.state.selectValue=Vl(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=r,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&&Ul(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,l=t.isDisabled,i=t.menuIsOpen,n=this.state.isFocused;(n&&!l&&e.isDisabled||n&&i&&!e.menuIsOpen)&&this.focusInput(),n&&l&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):n||l||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Ul(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,n=l.isFocused,o=this.buildFocusableOptions(),r="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(i[0]);s>-1&&(r=s)}this.scrollToFocusedOptionOnUpdate=!(n&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[r]},(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 n=l.indexOf(i);i||(n=-1);var o=l.length-1,r=-1;if(l.length){switch(e){case"previous":r=0===n?0:-1===n?o:n-1;break;case"next":n>-1&&n0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,l=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var n=0,o=i.indexOf(l);l||(o=-1),"up"===e?n=o>0?o-1:i.length-1:"down"===e?n=(o+1)%i.length:"pageup"===e?(n=o-t)<0&&(n=0):"pagedown"===e?(n=o+t)>i.length-1&&(n=i.length-1):"last"===e&&(n=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[n],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(nn):Oe(Oe({},nn),this.props.theme):nn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,l=this.getStyles,i=this.getClassNames,n=this.getValue,o=this.selectOption,r=this.setValue,s=this.props,a=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:l,getClassNames:i,getValue:n,hasValue:this.hasValue(),isMulti:a,isRtl:c,options:u,selectOption:o,selectProps:s,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,l=e.isMulti;return void 0===t?l:t}},{key:"isOptionDisabled",value:function(e,t){return pn(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return bn(this.props,e,t)}},{key:"filterOption",value:function(e,t){return mn(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,n=t.inputId,o=t.inputValue,r=t.tabIndex,s=t.form,a=t.menuIsOpen,c=t.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,b=d.ariaSelection,m=this.commonProps,v=n||this.getElementId("input"),f=Oe(Oe(Oe({"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":c,role:"combobox"},a&&{"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?Ae.createElement(u,e({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:l,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:s,type:"text",value:o},f)):Ae.createElement(Ui,e({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Al,onFocus:this.onInputFocus,disabled:l,tabIndex:r,inputMode:"none",form:s,value:""},f))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,l=this.getComponents(),i=l.MultiValue,n=l.MultiValueContainer,o=l.MultiValueLabel,r=l.MultiValueRemove,s=l.SingleValue,a=l.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,b=u.isMulti,m=u.inputValue,v=u.placeholder,f=this.state,y=f.selectValue,h=f.focusedValue,g=f.isFocused;if(!this.hasValue()||!d)return m?null:Ae.createElement(a,e({},c,{key:"placeholder",isDisabled:p,isFocused:g,innerProps:{id:this.getElementId("placeholder")}}),v);if(b)return y.map((function(l,s){var a=l===h,u="".concat(t.getOptionLabel(l),"-").concat(t.getOptionValue(l));return Ae.createElement(i,e({},c,{components:{Container:n,Label:o,Remove:r},isFocused:a,isDisabled:p,key:u,index:s,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(m)return null;var _=y[0];return Ae.createElement(s,e({},c,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,l=this.commonProps,i=this.props,n=i.isDisabled,o=i.isLoading,r=this.state.isFocused;if(!this.isClearable()||!t||n||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Ae.createElement(t,e({},l,{innerProps:s,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,l=this.commonProps,i=this.props,n=i.isDisabled,o=i.isLoading,r=this.state.isFocused;return t&&o?Ae.createElement(t,e({},l,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),l=t.DropdownIndicator,i=t.IndicatorSeparator;if(!l||!i)return null;var n=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return Ae.createElement(i,e({},n,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var l=this.commonProps,i=this.props.isDisabled,n=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Ae.createElement(t,e({},l,{innerProps:o,isDisabled:i,isFocused:n}))}},{key:"renderMenu",value:function(){var t=this,l=this.getComponents(),i=l.Group,n=l.GroupHeading,o=l.Menu,r=l.MenuList,s=l.MenuPortal,a=l.LoadingMessage,c=l.NoOptionsMessage,u=l.Option,d=this.commonProps,p=this.state.focusedOption,b=this.props,m=b.captureMenuScroll,v=b.inputValue,f=b.isLoading,y=b.loadingMessage,h=b.minMenuHeight,g=b.maxMenuHeight,_=b.menuIsOpen,k=b.menuPlacement,E=b.menuPosition,S=b.menuPortalTarget,w=b.menuShouldBlockScroll,C=b.menuShouldScrollIntoView,O=b.noOptionsMessage,x=b.onMenuScrollToTop,T=b.onMenuScrollToBottom;if(!_)return null;var P,N=function(l,i){var n=l.type,o=l.data,r=l.isDisabled,s=l.isSelected,a=l.label,c=l.value,b=p===o,m=r?void 0:function(){return t.onOptionHover(o)},v=r?void 0:function(){return t.selectOption(o)},f="".concat(t.getElementId("option"),"-").concat(i),y={id:f,onClick:v,onMouseMove:m,onMouseOver:m,tabIndex:-1};return Ae.createElement(u,e({},d,{innerProps:y,data:o,isDisabled:r,isSelected:s,key:f,label:a,type:n,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 o=l.data,r=l.options,s=l.index,a="".concat(t.getElementId("group"),"-").concat(s),c="".concat(a,"-heading");return Ae.createElement(i,e({},d,{key:a,data:o,options:r,Heading:n,headingProps:{id:c,data:l.data},label:t.formatGroupLabel(l.data)}),l.options.map((function(e){return N(e,"".concat(s,"-").concat(e.index))})))}if("option"===l.type)return N(l,"".concat(l.index))}));else if(f){var A=y({inputValue:v});if(null===A)return null;P=Ae.createElement(a,d,A)}else{var R=O({inputValue:v});if(null===R)return null;P=Ae.createElement(c,d,R)}var M={minMenuHeight:h,maxMenuHeight:g,menuPlacement:k,menuPosition:E,menuShouldScrollIntoView:C},V=Ae.createElement(Kl,e({},d,M),(function(l){var i=l.ref,n=l.placerProps,s=n.placement,a=n.maxHeight;return Ae.createElement(o,e({},d,M,{innerRef:i,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove,id:t.getElementId("listbox")},isLoading:f,placement:s}),Ae.createElement(Ji,{captureEnabled:m,onTopArrive:x,onBottomArrive:T,lockEnabled:w},(function(l){return Ae.createElement(r,e({},d,{innerRef:function(e){t.getMenuListRef(e),l(e)},isLoading:f,maxHeight:a,focusedOption:p}),P)})))}));return S||"fixed"===E?Ae.createElement(s,e({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:k,menuPosition:E}),V):V}},{key:"renderFormField",value:function(){var e=this,t=this.props,l=t.delimiter,i=t.isDisabled,n=t.isMulti,o=t.name,r=t.required,s=this.state.selectValue;if(o&&!i){if(r&&!this.hasValue())return Ae.createElement(tn,{name:o,onFocus:this.onValueInputFocus});if(n){if(l){var a=s.map((function(t){return e.getOptionValue(t)})).join(l);return Ae.createElement("input",{name:o,type:"hidden",value:a})}var c=s.length>0?s.map((function(t,l){return Ae.createElement("input",{key:"i-".concat(l),name:o,type:"hidden",value:e.getOptionValue(t)})})):Ae.createElement("input",{name:o,type:"hidden",value:""});return Ae.createElement("div",null,c)}var u=s[0]?this.getOptionValue(s[0]):"";return Ae.createElement("input",{name:o,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,l=this.state,i=l.ariaSelection,n=l.focusedOption,o=l.focusedValue,r=l.isFocused,s=l.selectValue,a=this.getFocusableOptions();return Ae.createElement(Pi,e({},t,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:n,focusedValue:o,isFocused:r,selectValue:s,focusableOptions:a}))}},{key:"render",value:function(){var t=this.getComponents(),l=t.Control,i=t.IndicatorsContainer,n=t.SelectContainer,o=t.ValueContainer,r=this.props,s=r.className,a=r.id,c=r.isDisabled,u=r.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return Ae.createElement(n,e({},p,{className:s,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),Ae.createElement(l,e({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),Ae.createElement(o,e({},p,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),Ae.createElement(i,e({},p,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){var l=t.prevProps,i=t.clearFocusValueOnUpdate,n=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,r=t.isFocused,s=t.prevWasFocused,a=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,b=Vl(c),m={};if(l&&(c!==l.value||a!==l.options||u!==l.menuIsOpen||d!==l.inputValue)){var v=u?function(e,t){return an(sn(e,t))}(e,b):[],f=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,v);m={selectValue:b,focusedOption:y,focusedValue:f,clearFocusValueOnUpdate:!1}}var h=null!=n&&e!==l?{inputIsHidden:n,inputIsHiddenAfterUpdate:void 0}:{},g=o,_=r&&s;return r&&!_&&(g={value:Zl(p,b,b[0]||null),options:b,action:"initial-input-focus"},_=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(g=null),Oe(Oe(Oe({},m),h),{},{prevProps:e,ariaSelection:g,prevWasFocused:_})}}],i&&Me(l.prototype,i),n&&Me(l,n),Object.defineProperty(l,"prototype",{writable:!1}),r}(Ae.Component);yn.defaultProps=on;var hn=(0,Ae.forwardRef)((function(t,l){var i=function(e){var t=e.defaultInputValue,l=void 0===t?"":t,i=e.defaultMenuIsOpen,n=void 0!==i&&i,o=e.defaultValue,r=void 0===o?null:o,s=e.inputValue,a=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,b=e.value,m=Ne(e,Re),v=Pe((0,Ae.useState)(void 0!==s?s:l),2),f=v[0],y=v[1],h=Pe((0,Ae.useState)(void 0!==a?a:n),2),g=h[0],_=h[1],k=Pe((0,Ae.useState)(void 0!==b?b:r),2),E=k[0],S=k[1],w=(0,Ae.useCallback)((function(e,t){"function"==typeof c&&c(e,t),S(e)}),[c]),C=(0,Ae.useCallback)((function(e,t){var l;"function"==typeof u&&(l=u(e,t)),y(void 0!==l?l:e)}),[u]),O=(0,Ae.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),x=(0,Ae.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),T=void 0!==s?s:f,P=void 0!==a?a:g,N=void 0!==b?b:E;return Oe(Oe({},m),{},{inputValue:T,menuIsOpen:P,onChange:w,onInputChange:C,onMenuClose:x,onMenuOpen:O,value:N})}(t);return Ae.createElement(yn,e({ref:l},i))}));const gn=hn,kn=window.wp.htmlEntities,En={context:"view",orderby:"name",order:"asc",per_page:-1,who:"authors",_fields:"id,name"};function Sn(e){const{className:l,fieldType:i,fieldName:r,handleRuleChange:s,triggerReset:a,value:c}=e,{authors:u,loading:d}=(0,o.useSelect)((e=>{const{getUsers:t,isResolving:l}=e("core");return{authors:t(En),loading:l("getUsers",[En])}}),[]),p=(0,t.useMemo)((()=>(null!=u?u:[]).map((e=>({value:e.id,label:(0,kn.decodeEntities)(e.name)})))),[u]),m=p.filter((e=>c.includes(e.value)));return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:m,options:p,placeholder:(0,n.__)("Select Author…","block-visibility"),onChange:e=>s(e,"multiSelect",i,r,a),isLoading:d,isMulti:!0})}const wn={context:"view",orderby:"name",order:"asc",per_page:-1,_fields:"id,name"};function Cn(e){const{className:l,fieldType:i,fieldName:n,handleRuleChange:r,placeholder:s,taxonomySlug:a,triggerReset:c,value:u}=e,{availableTerms:d,loading:p}=(0,o.useSelect)((e=>{const{getEntityRecords:t,isResolving:l}=e("core");return{availableTerms:t("taxonomy",a,wn),loading:l("getEntityRecords",["taxonomy",a,wn])}}),[a]),m=(0,t.useMemo)((()=>(null!=d?d:[]).map((e=>({value:e.id,label:(0,kn.decodeEntities)(e.name)})))),[d]),v=m.filter((e=>u.includes(e.value)));return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:v,options:m,placeholder:s,onChange:e=>r(e,"multiSelect",i,n,c),isLoading:p,isMulti:!0})}function On(e){const t=e?.title?.raw?(0,kn.decodeEntities)(e.title.rendered):`${(0,n.__)("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 xn(e){const{className:l,fieldType:r,fieldName:s,handleRuleChange:a,placeholder:c,postType:u,triggerReset:d,value:p,valueType:m,isMulti:v}=e,[f,y]=(0,t.useState)(!1),[h,g]=(0,t.useState)(!1),{availablePosts:_,loadingAvailablePosts:k}=(0,o.useSelect)((e=>{const{getPostType:t,getEntityRecords:l,isResolving:n}=e("core"),o=t(u),r=(0,i.get)(o,["hierarchical"],!1),s={orderby:r?"title":"date",order:r?"asc":"desc",per_page:25,status:"publish,draft,private,pending",_fields:"id,title,status"};return h&&(s.search=h),{availablePosts:l("postType",u,s),loadingAvailablePosts:n("getEntityRecords",["postType",u,s])}}),[h]),{savedPosts:E,loadingSavedPosts:S}=(0,o.useSelect)((e=>{if(0!==p.length&&!f){const t={include:Array.isArray(p)?p.join(","):p,per_page:-1,status:"publish,draft,private,pending",_fields:"id,title,status"},{getEntityRecords:l,isResolving:i}=e("core");return{savedPosts:l("postType",u,t),selectedLoading:i("getEntityRecords",["postType",u,t])}}return{savedPosts:[],loadingSavedPosts:!1}})),w=(0,t.useMemo)((()=>(null!=_?_:[]).map((e=>({value:e.id,label:On(e)})))),[_]);let C=[];return C=f||(null!=E?E:[]).map((e=>({value:e.id,label:On(e)}))),(0,t.createElement)(gn,{className:b()("block-visibility__react-select",l),classNamePrefix:"react-select",value:C,options:w,onChange:e=>{const t="postSelect"===m?"select":"multiSelect";y(e),a(e,t,r,s,d)},onInputChange:(0,i.debounce)((e=>{(0===e.length||e.length>=3)&&g(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,n.__)("No options found","block-visibility"):(0,n.__)("Enter 3 characters to begin search","block-visibility")},placeholder:c,isLoading:k||S,isMulti:v})}function Tn(l){const{rule:i,fieldType:o,fieldName:r,valueType:s,valueTypeVariant:a,options:c,placeholder:d,handleRuleChange:p,triggerReset:m,isLoading:v,hasGroupedFields:f,hasGroupedOptions:y,dependantFieldValue:h}=l;if(f&&!i.field&&"ruleField"!==o)return null;let g="";var _;if("ruleField"===o)g=null!==(_=i?.field)&&void 0!==_?_:"";else if("subField"===o){var k,E;g=i?.subFields?null!==(k=i.subFields[r])&&void 0!==k?k:"":null!==(E=i?.subField)&&void 0!==E?E:""}else{var S;g=null!==(S=i["operatorField"===o?"operator":"value"])&&void 0!==S?S:""}if("select"===s||"multiSelect"===s){let e="",t=c;if(y){const e=[];c.forEach((t=>{e.push(...t.options)})),t=e}"multiSelect"===s?e=t.filter((e=>g.includes(e.value))):(e=t.filter((e=>e.value===g)),0!==e.length&&(e=e[0])),g=e}const w="field__"+o;if("select"===s||"multiSelect"===s){const e=d||(0,n.__)("Select…","block-visibility");return(0,t.createElement)(gn,{className:b()("block-visibility__react-select",w),classNamePrefix:"react-select",value:g,options:c,placeholder:e,onChange:e=>p(e,s,o,r,m),isMulti:"multiSelect"===s,isLoading:v})}if("date"===s||"dateTime"===s)return(0,t.createElement)(ke,{className:w,value:g,onChange:e=>p(e,s,o,r,m),includeTime:"dateTime"===s});if("toggle"===s)return(0,t.createElement)(u.ToggleControl,{className:w,label:d,checked:g,onChange:()=>p(!g,s,o,r,m)});if("authorsSelect"===s)return(0,t.createElement)(Sn,e({className:w,value:g},l));if("termsSelect"===s){let i;return h&&!a?i=h:a&&(i=a),(0,t.createElement)(Cn,e({key:i,taxonomySlug:i,className:w,value:g},l))}if("postsSelect"===s||"postSelect"===s){let i;return h&&!a?i=h:a&&(i=a),(0,t.createElement)(xn,e({key:i,postType:i,className:w,value:g,valueType:s,isMulti:"postsSelect"===s},l))}return(0,t.createElement)(u.TextControl,{className:w,type:s,min:"number"===s?0:"",value:g,placeholder:d,onChange:e=>p(e,"text",o,r,m),autocomplete:"off"})}function Pn(e){var l,o,r,s;const{rule:a,ruleIndex:c,ruleSet:d,ruleSetIndex:p,ruleSets:m,hideOnRuleSets:v,rulePlaceholder:f,ruleLabel:y,controlName:h,controlAtts:g,setControlAtts:_,groupedFields:k,allFields:E}=e;let S=E.filter((e=>e.value===a.field));k||(S=E.filter((e=>"ruleField"===e.type))),0!==S.length&&(S=S[0]);const w=k?null!==(l=S?.fields)&&void 0!==l?l:[]:E,C=null!==(o=S?.help)&&void 0!==o&&o,O=null!==(r=S?.hasMultipleSubFields)&&void 0!==r&&r,x=null!==(s=S?.hasSimplifiedLayout)&&void 0!==s&&s;let T=y;T||(T=()=>0===c?(0,n.sprintf)( // Translators: Whether the block is hidden or visible. -(0,n.__)("%s the block if","block-visibility"),v?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility")):(0,n.__)("And if","block-visibility"));const P=function(e,t,l){let n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];"select"===t?n=e.value:"multiSelect"===t?(n=[],0!==e.length&&e.forEach((e=>{n.push(e.value)}))):n=e;const s=[...m],a=[...d.rules];if("ruleField"===l)a[c]=k?{field:n}:(0,i.assign)({...a[c]},{field:n});else if("subField"===l)a[c]=O?(0,i.assign)({...a[c]},{subFields:{...a[c].subFields,[o]:n}}):(0,i.assign)({...a[c]},{subField:n}),r&&delete a[c].value;else{const e="operatorField"===l?"operator":"value";a[c]=(0,i.assign)({...a[c]},{[e]:n})}s[p]=(0,i.assign)({...d},{rules:a}),_(h,(0,i.assign)({...g},{ruleSets:[...s]}))};return(0,t.createElement)("div",{key:c,className:"rule"},(0,t.createElement)("div",{className:"rule__header"},(0,t.createElement)("span",null,T(c)),d.rules.length>1&&(0,t.createElement)(u.Button,{label:(0,n.__)("Delete Rule","block-visibility"),icon:ge,onClick:()=>(()=>{const e=[...m],t=d.rules.filter(((e,t)=>t!==c));e[p]=(0,i.assign)({...d},{rules:[...t]}),_(h,(0,i.assign)({...g},{ruleSets:[...e]}))})()})),(0,t.createElement)("div",{className:"rule__fields"},(0,t.createElement)("div",{className:b()("fields-container",{"is-simplified":x})},k&&(0,t.createElement)(Tn,{rule:a,fieldType:"ruleField",valueType:"select",options:k,placeholder:null!=f?f:(0,n.__)("Select Rule…","block-visibility"),handleRuleChange:P,hasGroupedOptions:!0}),w.map((e=>{var l,i,n,o,r,s,c,u,d,p;let b=e?.valueType,m=e?.valueTypeVariant,v=e?.options,f=e?.placeholder,y="";const h=e?.conditionalValueTypes;h&&h.forEach((e=>{var t;if(y=null!==(t=a[e.dependencyType])&&void 0!==t?t:"",e.dependencyValues.includes(y)){var l,i,n,o,r;const t=null!==(l=e?.valueTypes)&&void 0!==l?l:[],s=t.filter((e=>e.value===y)),a=t.filter((e=>"default"===e.value));b=null!==(i=s[0]?.valueType)&&void 0!==i?i:a[0]?.valueType,m=null!==(n=s[0]?.valueTypeVariant)&&void 0!==n?n:m,v=null!==(o=s[0]?.options)&&void 0!==o?o:v,f=null!==(r=s[0]?.placeholder)&&void 0!==r?r:f}}));const g=e?.displayConditions;if(g){const e=[];if(g.forEach((t=>{let l;if(O&&"subField"===t.dependencyType){var i,n;const e=null!==(i=a?.subFields)&&void 0!==i?i:[];l=null!==(n=e[t.dependencyName])&&void 0!==n?n:""}else{var o;const e="operatorField"===t.dependencyType?"operator":"subField";l=null!==(o=a[e])&&void 0!==o?o:""}var r;"dynamic"===t.dependencyValues?0!==(null!==(r=t?.options)&&void 0!==r?r:[]).filter((e=>e.value===l)).length&&e.push(!0):t.dependencyValues.includes(l)&&e.push(!0)})),e.length!==g.length)return null}const _=e?.conditionalOptions;return _&&_.forEach((e=>{let t;if(O&&"subField"===e.dependencyType){var l,i;const n=null!==(l=a?.subFields)&&void 0!==l?l:[];t=null!==(i=n[e.dependencyName])&&void 0!==i?i:""}else{var n;t=null!==(n=a[e.dependencyType])&&void 0!==n?n:""}if("dynamic"===e.dependencyValues){var o,r,s;const l=(null!==(o=e?.options)&&void 0!==o?o:[]).filter((e=>e.value===t));v=null!==(r=l[0]?.valueOptions)&&void 0!==r?r:[],f=null!==(s=e?.placeholder)&&void 0!==s?s:""}else e.dependencyValues.includes(t)&&(v=e?.options,f=e?.placeholder)})),(0,t.createElement)(Tn,{key:null!==(l=e?.type)&&void 0!==l?l:"valueField",rule:a,fieldType:null!==(i=e?.type)&&void 0!==i?i:"valueField",fieldName:null!==(n=e?.name)&&void 0!==n?n:"",valueType:null!==(o=b)&&void 0!==o?o:"text",valueTypeVariant:null!==(r=m)&&void 0!==r?r:"",dependantFieldValue:null!==(s=y)&&void 0!==s?s:"",options:null!==(c=v)&&void 0!==c?c:[],handleRuleChange:P,hasGroupedFields:!!k,hasGroupedOptions:null!==(u=e?.hasGroupedOptions)&&void 0!==u&&u,placeholder:null!==(d=f)&&void 0!==d?d:"",isLoading:e?.isLoading,triggerReset:null!==(p=e?.triggerReset)&&void 0!==p&&p})}))),C&&(0,t.createElement)("div",{className:"control-fields-item__help"},S.help)))}function Nn(l){var o,r,s;const{ruleSet:a,ruleSetIndex:c,ruleSets:d,controlName:p,controlAtts:m,setControlAtts:v}=l,f=null!==(o=a?.title)&&void 0!==o?o:"",y=f||(0,n.__)("Rule Set","block-visibility"),h=null===(r=a?.enable)||void 0===r||r,g=null!==(s=a?.rules)&&void 0!==s?s:[];0===g.length&&g.push({field:""});const _=(e,t)=>{const l={...a},n=[...d];l[e]=t,n[c]=l,v(p,(0,i.assign)({...m},{ruleSets:[...n]}))},k=(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("Edit","block-visibility"),icon:ie,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:f,label:(0,n.__)("Rule set title","block-visibility"),placeholder:(0,n.__)("Rule Set","block-visibility"),onChange:e=>_("title",e)}))),E=d.length<=1?(0,n.__)("Clear rule set","block-visibility"):(0,n.__)("Remove rule set","block-visibility"),S=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,n.__)("Options","block-visibility"),icon:$,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>_("enable",!h)},h?(0,n.__)("Disable","block-visibility"):(0,n.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{className:"more-settings__tools-duplicate",onClick:()=>{!function(){const e=[...d,a];v(p,(0,i.assign)({...m},{ruleSets:[...e]}))}(),l()}},(0,n.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=d.filter(((e,t)=>t!==c));v(p,(0,i.assign)({...m},{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,n)=>(0,t.createElement)(Pn,e({key:n,rule:i,ruleIndex:n,ruleSet:a,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=[...a.rules,{field:""}];e[c]=(0,i.assign)({...a},{rules:t}),v(p,(0,i.assign)({...m},{ruleSets:[...e]}))}(),isLink:!0},(0,n.__)("Add rule","block-visibility"))));return h||(w=(0,t.createElement)(u.Disabled,null,w)),(0,t.createElement)("div",{key:c,className:b()("rule-sets__rule-set",{disabled:!h})},(0,t.createElement)("div",{className:"rule-set__header section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,y),k),(0,t.createElement)("div",{className:"section-header__toolbar"},S)),w)}function Rn(l){var o,r,s,a,c,d;const{controlSetAtts:p,enabledControls:b,setControlAtts:m,settings:v,variables:f}=l,y=null!==(o=f?.integrations?.acf?.active)&&void 0!==o&&o;if(!b.some((e=>"acf"===e.settingSlug&&e?.isActive))||!y)return null;const h=null===(r=v?.plugin_settings?.enable_editor_notices)||void 0===r||r,g=null!==(s=f?.integrations?.acf?.fields)&&void 0!==s?s:[],_=null!==(a=p?.controls?.acf)&&void 0!==a?a:{},k=null!==(c=_?.hideOnRuleSets)&&void 0!==c&&c;let E=null!==(d=_?.ruleSets)&&void 0!==d?d:[];if(0===E.length)E.push({enable:!0,rules:[{field:""}]});else if(1===E.length&&!E[0]?.rules){const e=E[0];0!==e.length&&e.forEach((e=>{var t;const l=null!==(t=e?.operator)&&void 0!==t?t:"";e.operator="!=empty"===l?"notEmpty":"==empty"===l?"empty":"=="===l?"equal":"!="===l?"notEqual":"==contains"===l?"contains":"!=contains"===l?"notContain":""})),E=[{enable:!0,rules:e}]}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 n=null!==(t=e?.key)&&void 0!==t?t:"",o=null!==(l=e?.title)&&void 0!==l?l:"";i.push({value:n,label:o})})),i}(e),l=ve(e),i=[];return t.forEach((e=>{var t,n;const o=null!==(t=e?.value)&&void 0!==t?t:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=l.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(f),w=ve(f);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)(q,{icon:D}),(0,t.createElement)("span",null,(0,n.__)("Advanced Custom Fields","block-visibility")),h&&(0,t.createElement)(Se,{message:(0,n.__)("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:ee.editorACF,position:"bottom right"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...E,{enable:!0,rules:[{field:""}]}];m("acf",(0,i.assign)({..._},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),h&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( +(0,n.__)("%s the block if","block-visibility"),v?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility")):(0,n.__)("And if","block-visibility"));const P=function(e,t,l){let n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];"select"===t?n=e.value:"multiSelect"===t?(n=[],0!==e.length&&e.forEach((e=>{n.push(e.value)}))):n=e;const s=[...m],a=[...d.rules];if("ruleField"===l)a[c]=k?{field:n}:(0,i.assign)({...a[c]},{field:n});else if("subField"===l)a[c]=O?(0,i.assign)({...a[c]},{subFields:{...a[c].subFields,[o]:n}}):(0,i.assign)({...a[c]},{subField:n}),r&&delete a[c].value;else{const e="operatorField"===l?"operator":"value";a[c]=(0,i.assign)({...a[c]},{[e]:n})}s[p]=(0,i.assign)({...d},{rules:a}),_(h,(0,i.assign)({...g},{ruleSets:[...s]}))};return(0,t.createElement)("div",{key:c,className:"rule"},(0,t.createElement)("div",{className:"rule__header"},(0,t.createElement)("span",null,T(c)),d.rules.length>1&&(0,t.createElement)(u.Button,{label:(0,n.__)("Delete Rule","block-visibility"),icon:ge,onClick:()=>(()=>{const e=[...m],t=d.rules.filter(((e,t)=>t!==c));e[p]=(0,i.assign)({...d},{rules:[...t]}),_(h,(0,i.assign)({...g},{ruleSets:[...e]}))})()})),(0,t.createElement)("div",{className:"rule__fields"},(0,t.createElement)("div",{className:b()("fields-container",{"is-simplified":x})},k&&(0,t.createElement)(Tn,{rule:a,fieldType:"ruleField",valueType:"select",options:k,placeholder:null!=f?f:(0,n.__)("Select Rule…","block-visibility"),handleRuleChange:P,hasGroupedOptions:!0}),w.map((e=>{var l,i,n,o,r,s,c,u,d,p;let b=e?.valueType,m=e?.valueTypeVariant,v=e?.options,f=e?.placeholder,y="";const h=e?.conditionalValueTypes;h&&h.forEach((e=>{var t;if(y=null!==(t=a[e.dependencyType])&&void 0!==t?t:"",e.dependencyValues.includes(y)){var l,i,n,o,r;const t=null!==(l=e?.valueTypes)&&void 0!==l?l:[],s=t.filter((e=>e.value===y)),a=t.filter((e=>"default"===e.value));b=null!==(i=s[0]?.valueType)&&void 0!==i?i:a[0]?.valueType,m=null!==(n=s[0]?.valueTypeVariant)&&void 0!==n?n:m,v=null!==(o=s[0]?.options)&&void 0!==o?o:v,f=null!==(r=s[0]?.placeholder)&&void 0!==r?r:f}}));const g=e?.displayConditions;if(g){const e=[];if(g.forEach((t=>{let l;if(O&&"subField"===t.dependencyType){var i,n;const e=null!==(i=a?.subFields)&&void 0!==i?i:[];l=null!==(n=e[t.dependencyName])&&void 0!==n?n:""}else{var o;const e="operatorField"===t.dependencyType?"operator":"subField";l=null!==(o=a[e])&&void 0!==o?o:""}var r;"dynamic"===t.dependencyValues?0!==(null!==(r=t?.options)&&void 0!==r?r:[]).filter((e=>e.value===l)).length&&e.push(!0):t.dependencyValues.includes(l)&&e.push(!0)})),e.length!==g.length)return null}const _=e?.conditionalOptions;return _&&_.forEach((e=>{let t;if(O&&"subField"===e.dependencyType){var l,i;const n=null!==(l=a?.subFields)&&void 0!==l?l:[];t=null!==(i=n[e.dependencyName])&&void 0!==i?i:""}else{var n;t=null!==(n=a[e.dependencyType])&&void 0!==n?n:""}if("dynamic"===e.dependencyValues){var o,r,s;const l=(null!==(o=e?.options)&&void 0!==o?o:[]).filter((e=>e.value===t));v=null!==(r=l[0]?.valueOptions)&&void 0!==r?r:[],f=null!==(s=e?.placeholder)&&void 0!==s?s:""}else e.dependencyValues.includes(t)&&(v=e?.options,f=e?.placeholder)})),(0,t.createElement)(Tn,{key:null!==(l=e?.type)&&void 0!==l?l:"valueField",rule:a,fieldType:null!==(i=e?.type)&&void 0!==i?i:"valueField",fieldName:null!==(n=e?.name)&&void 0!==n?n:"",valueType:null!==(o=b)&&void 0!==o?o:"text",valueTypeVariant:null!==(r=m)&&void 0!==r?r:"",dependantFieldValue:null!==(s=y)&&void 0!==s?s:"",options:null!==(c=v)&&void 0!==c?c:[],handleRuleChange:P,hasGroupedFields:!!k,hasGroupedOptions:null!==(u=e?.hasGroupedOptions)&&void 0!==u&&u,placeholder:null!==(d=f)&&void 0!==d?d:"",isLoading:e?.isLoading,triggerReset:null!==(p=e?.triggerReset)&&void 0!==p&&p})}))),C&&(0,t.createElement)("div",{className:"control-fields-item__help"},S.help)))}function Nn(l){var o,r,s;const{ruleSet:a,ruleSetIndex:c,ruleSets:d,controlName:p,controlAtts:m,setControlAtts:v}=l,f=null!==(o=a?.title)&&void 0!==o?o:"",y=f||(0,n.__)("Rule Set","block-visibility"),h=null===(r=a?.enable)||void 0===r||r,g=null!==(s=a?.rules)&&void 0!==s?s:[];0===g.length&&g.push({field:""});const _=(e,t)=>{const l={...a},n=[...d];l[e]=t,n[c]=l,v(p,(0,i.assign)({...m},{ruleSets:[...n]}))},k=(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("Edit","block-visibility"),icon:ie,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"}},(()=>(0,t.createElement)(u.TextControl,{value:f,label:(0,n.__)("Rule set title","block-visibility"),placeholder:(0,n.__)("Rule Set","block-visibility"),onChange:e=>_("title",e)}))),E=d.length<=1?(0,n.__)("Clear rule set","block-visibility"):(0,n.__)("Remove rule set","block-visibility"),S=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,n.__)("Options","block-visibility"),icon:$,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>_("enable",!h)},h?(0,n.__)("Disable","block-visibility"):(0,n.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{className:"more-settings__tools-duplicate",onClick:()=>{!function(){const e=[...d,a];v(p,(0,i.assign)({...m},{ruleSets:[...e]}))}(),l()}},(0,n.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=d.filter(((e,t)=>t!==c));v(p,(0,i.assign)({...m},{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,n)=>(0,t.createElement)(Pn,e({key:n,rule:i,ruleIndex:n,ruleSet:a,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=[...a.rules,{field:""}];e[c]=(0,i.assign)({...a},{rules:t}),v(p,(0,i.assign)({...m},{ruleSets:[...e]}))}(),isLink:!0},(0,n.__)("Add rule","block-visibility"))));return h||(w=(0,t.createElement)(u.Disabled,null,w)),(0,t.createElement)("div",{key:c,className:b()("rule-sets__rule-set",{disabled:!h})},(0,t.createElement)("div",{className:"rule-set__header section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,y),k),(0,t.createElement)("div",{className:"section-header__toolbar"},S)),w)}function An(l){var o,r,s,a,c,d;const{controlSetAtts:p,enabledControls:b,setControlAtts:m,settings:v,variables:f}=l,y=null!==(o=f?.integrations?.acf?.active)&&void 0!==o&&o;if(!b.some((e=>"acf"===e.settingSlug&&e?.isActive))||!y)return null;const h=null===(r=v?.plugin_settings?.enable_editor_notices)||void 0===r||r,g=null!==(s=f?.integrations?.acf?.fields)&&void 0!==s?s:[],_=null!==(a=p?.controls?.acf)&&void 0!==a?a:{},k=null!==(c=_?.hideOnRuleSets)&&void 0!==c&&c;let E=null!==(d=_?.ruleSets)&&void 0!==d?d:[];if(0===E.length)E.push({enable:!0,rules:[{field:""}]});else if(1===E.length&&!E[0]?.rules){const e=E[0];0!==e.length&&e.forEach((e=>{var t;const l=null!==(t=e?.operator)&&void 0!==t?t:"";e.operator="!=empty"===l?"notEmpty":"==empty"===l?"empty":"=="===l?"equal":"!="===l?"notEqual":"==contains"===l?"contains":"!=contains"===l?"notContain":""})),E=[{enable:!0,rules:e}]}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 n=null!==(t=e?.key)&&void 0!==t?t:"",o=null!==(l=e?.title)&&void 0!==l?l:"";i.push({value:n,label:o})})),i}(e),l=ve(e),i=[];return t.forEach((e=>{var t,n;const o=null!==(t=e?.value)&&void 0!==t?t:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=l.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(f),w=ve(f);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)(q,{icon:D}),(0,t.createElement)("span",null,(0,n.__)("Advanced Custom Fields","block-visibility")),h&&(0,t.createElement)(Se,{message:(0,n.__)("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:ee.editorACF,position:"bottom right"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...E,{enable:!0,rules:[{field:""}]}];m("acf",(0,i.assign)({..._},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),h&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. -(0,n.__)("%s the block if at least one rule set applies. Rules targeting user fields will fail if the current user is not logged in.","block-visibility"),k?(0,n.__)("Hide","block-visibility"):(0,n.__)("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,n.__)("It does not appear that your website contains any published fields yet.","block-visibility")),(0,t.createElement)("div",{className:"rule-sets"},E.map(((i,o)=>(0,t.createElement)(Nn,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:E,groupedFields:S,allFields:w,controlName:"acf",controlAtts:_,hideOnRuleSets:k,rulePlaceholder:(0,n.__)("Select Field…","block-visibility")},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:k,onChange:()=>m("acf",(0,i.assign)({..._},{hideOnRuleSets:!k}))}))))}function An(){const e=[{value:"any",label:(0,n.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")}],t=(0,n.__)("Select Condition…","block-visibility");return[{value:"browserType",label:(0,n.__)("Browser","block-visibility"),group:"browser",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"chrome",label:(0,n.__)("Chrome","block-visibility")},{value:"firefox",label:(0,n.__)("Firefox","block-visibility")},{value:"edge",label:(0,n.__)("Microsoft Edge","block-visibility")},{value:"ie",label:(0,n.__)("Internet Explorer","block-visibility")},{value:"opera",label:(0,n.__)("Opera","block-visibility")},{value:"safari",label:(0,n.__)("Safari","block-visibility")},{value:"samsung",label:(0,n.__)("Samsung Internet","block-visibility")}],placeholder:(0,n.__)("Select Browser…","block-visibility")}]},{value:"devicePlatform",label:(0,n.__)("Platform","block-visibility"),group:"device",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"android",label:(0,n.__)("Android","block-visibility")},{value:"ios",label:(0,n.__)("iOS (iPhone and iPad)","block-visibility")},{value:"linux",label:(0,n.__)("Linux","block-visibility")},{value:"macintosh",label:(0,n.__)("Macintosh","block-visibility")},{value:"windows",label:(0,n.__)("Windows","block-visibility")}],placeholder:(0,n.__)("Select Platform…","block-visibility")}]},{value:"deviceType",label:(0,n.__)("Device Type","block-visibility"),group:"device",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"mobile",label:(0,n.__)("Is Mobile","block-visibility")},{value:"robot",label:(0,n.__)("Is Robot","block-visibility")},{value:"other",label:(0,n.__)("Is Desktop (Other)","block-visibility")}],placeholder:(0,n.__)("Select Type…","block-visibility")}]}]}function Mn(l){var o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"browser_device"===e.settingSlug&&e?.isActive)))return null;const m=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,v=null!==(r=d?.controls?.browserDevice)&&void 0!==r?r:{},f=null!==(s=v?.hideOnRuleSets)&&void 0!==s&&s,y=null!==(a=v?.ruleSets)&&void 0!==a?a:[];0===y.length&&y.push({enable:!0,rules:[{field:""}]});const h=function(){const e=[{value:"browser",label:(0,n.__)("Browser","block-visibility")},{value:"device",label:(0,n.__)("Device","block-visibility")}],t=An(),l=[];return e.forEach((e=>{var i,n;const o=null!==(i=e?.value)&&void 0!==i?i:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=t.filter((e=>e.group===o));l.push({value:o,label:r,options:s})})),l}(),g=An();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,n.__)("Browser & Device","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("The Browser & Device control allows you to configure block visibility based on the current user's browser or device.","block-visibility"),link:ee.editorBrowserDevice,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...y,{enable:!0,rules:[{field:""}]}];p("browserDevice",(0,i.assign)({...v},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( +(0,n.__)("%s the block if at least one rule set applies. Rules targeting user fields will fail if the current user is not logged in.","block-visibility"),k?(0,n.__)("Hide","block-visibility"):(0,n.__)("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,n.__)("It does not appear that your website contains any published fields yet.","block-visibility")),(0,t.createElement)("div",{className:"rule-sets"},E.map(((i,o)=>(0,t.createElement)(Nn,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:E,groupedFields:S,allFields:w,controlName:"acf",controlAtts:_,hideOnRuleSets:k,rulePlaceholder:(0,n.__)("Select Field…","block-visibility")},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:k,onChange:()=>m("acf",(0,i.assign)({..._},{hideOnRuleSets:!k}))}))))}function Rn(){const e=[{value:"any",label:(0,n.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")}],t=(0,n.__)("Select Condition…","block-visibility");return[{value:"browserType",label:(0,n.__)("Browser","block-visibility"),group:"browser",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"chrome",label:(0,n.__)("Chrome","block-visibility")},{value:"firefox",label:(0,n.__)("Firefox","block-visibility")},{value:"edge",label:(0,n.__)("Microsoft Edge","block-visibility")},{value:"ie",label:(0,n.__)("Internet Explorer","block-visibility")},{value:"opera",label:(0,n.__)("Opera","block-visibility")},{value:"safari",label:(0,n.__)("Safari","block-visibility")},{value:"samsung",label:(0,n.__)("Samsung Internet","block-visibility")}],placeholder:(0,n.__)("Select Browser…","block-visibility")}]},{value:"devicePlatform",label:(0,n.__)("Platform","block-visibility"),group:"device",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"android",label:(0,n.__)("Android","block-visibility")},{value:"ios",label:(0,n.__)("iOS (iPhone and iPad)","block-visibility")},{value:"linux",label:(0,n.__)("Linux","block-visibility")},{value:"macintosh",label:(0,n.__)("Macintosh","block-visibility")},{value:"windows",label:(0,n.__)("Windows","block-visibility")}],placeholder:(0,n.__)("Select Platform…","block-visibility")}]},{value:"deviceType",label:(0,n.__)("Device Type","block-visibility"),group:"device",fields:[{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"multiSelect",options:[{value:"mobile",label:(0,n.__)("Is Mobile","block-visibility")},{value:"robot",label:(0,n.__)("Is Robot","block-visibility")},{value:"other",label:(0,n.__)("Is Desktop (Other)","block-visibility")}],placeholder:(0,n.__)("Select Type…","block-visibility")}]}]}function Mn(l){var o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"browser_device"===e.settingSlug&&e?.isActive)))return null;const m=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,v=null!==(r=d?.controls?.browserDevice)&&void 0!==r?r:{},f=null!==(s=v?.hideOnRuleSets)&&void 0!==s&&s,y=null!==(a=v?.ruleSets)&&void 0!==a?a:[];0===y.length&&y.push({enable:!0,rules:[{field:""}]});const h=function(){const e=[{value:"browser",label:(0,n.__)("Browser","block-visibility")},{value:"device",label:(0,n.__)("Device","block-visibility")}],t=Rn(),l=[];return e.forEach((e=>{var i,n;const o=null!==(i=e?.value)&&void 0!==i?i:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=t.filter((e=>e.group===o));l.push({value:o,label:r,options:s})})),l}(),g=Rn();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,n.__)("Browser & Device","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("The Browser & Device control allows you to configure block visibility based on the current user's browser or device.","block-visibility"),link:ee.editorBrowserDevice,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...y,{enable:!0,rules:[{field:""}]}];p("browserDevice",(0,i.assign)({...v},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. (0,n.__)("%s the block if at least one rule set applies.","block-visibility"),f?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},y.map(((i,n)=>(0,t.createElement)(Nn,e({key:n,ruleSet:i,ruleSetIndex:n,ruleSets:y,groupedFields:h,allFields:g,controlName:"browserDevice",controlAtts:v,hideOnRuleSets:f},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:f,onChange:()=>p("browserDevice",(0,i.assign)({...v},{hideOnRuleSets:!f}))}))))}function Vn(l){var o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"cookie"===e.settingSlug&&e?.isActive)))return null;const m=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,v=null!==(r=d?.controls?.cookie)&&void 0!==r?r:{},f=null!==(s=v?.hideOnRuleSets)&&void 0!==s&&s,y=null!==(a=v?.ruleSets)&&void 0!==a?a:[];0===y.length&&y.push({enable:!0,rules:[{field:""}]});const h=function(){const e=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value (Does not exist)","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,n.__)("Value contains","block-visibility")},{value:"notContain",label:(0,n.__)("Value does not contain","block-visibility")}],t=(0,n.__)("Select Condition…","block-visibility");return[{type:"ruleField",valueType:"text",placeholder:(0,n.__)("Enter Cookie Name…","block-visibility")},{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"text",placeholder:(0,n.__)("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,n.__)("Cookie","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("The Cookie control allows you to configure block visibility based on HTML cookies.","block-visibility"),link:ee.editorCookie,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...y,{enable:!0,rules:[{field:""}]}];p("cookie",(0,i.assign)({...v},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. -(0,n.__)("%s the block if at least one rule set applies.","block-visibility"),f?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},y.map(((i,n)=>(0,t.createElement)(Nn,e({key:n,ruleSet:i,ruleSetIndex:n,ruleSets:y,allFields:h,controlName:"cookie",controlAtts:v,hideOnRuleSets:f},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:f,onChange:()=>p("cookie",(0,i.assign)({...v},{hideOnRuleSets:!f}))}))))}const Fn=[{index:1,slug:"Sun",title:(0,n.__)("Sunday","block-visibility")},{index:2,slug:"Mon",title:(0,n.__)("Monday","block-visibility")},{index:3,slug:"Tue",title:(0,n.__)("Tuesday","block-visibility")},{index:4,slug:"Wed",title:(0,n.__)("Wednesday","block-visibility")},{index:5,slug:"Thu",title:(0,n.__)("Thursday","block-visibility")},{index:6,slug:"Fri",title:(0,n.__)("Friday","block-visibility")},{index:7,slug:"Sat",title:(0,n.__)("Saturday","block-visibility")}];function In(e){var l;const{scheduleAtts:o,setAttribute:r}=e,s=null!==(l=o?.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,n.__)("On these days","block-visibility")),(0,t.createElement)("div",{className:"day-of-week__checkbox-controls"},Fn.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:s.includes(e.slug),onChange:t=>{let l=[...s];t?l.push(e.slug):l=(0,i.without)(l,e.slug),r("dayOfWeek","days",l)}})))))}const Dn=window.moment;var Ln=l.n(Dn);const Hn="HH:mm:ss";function Bn(e){let{value:l,onUpdate:n,...o}=e;return(0,t.createElement)("input",{key:l,defaultValue:l,onBlur:function(e){const{target:t}=e;if(l===t.value)return;const r=parseInt(t.value,10);!(0,i.isInteger)(r)||void 0!==o.max&&r>o.max||void 0!==o.min&&r({minutes:s.format("mm"),hours:s.format(o?"hh":"HH"),am:s.format("H")<=11?"AM":"PM"})),[s,o]);function m(e){c(e);let t=e.format(Hn);t="23:59:00"===t?"23:59:59":t,r(t)}function v(e,t){let l=t;o&&"hours"===e&&"PM"===b&&(l=12!==l?t+12:l),m(a.clone()[e](l))}function f(e){return()=>{if(b===e)return;const t=parseInt(p,10);m(a.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)(Bn,{"aria-label":(0,n.__)("Hours","block-visibility"),type:"number",name:"hours",step:1,min:o?1:0,max:o?12:23,value:p,onUpdate:v}),(0,t.createElement)("span",{"aria-hidden":"true"},":"),(0,t.createElement)(Bn,{"aria-label":(0,n.__)("Minutes","block-visibility"),type:"number",name:"minutes",step:1,min:0,max:59,value:d,onUpdate:v})),o&&(0,t.createElement)(u.ButtonGroup,{className:"time-picker__fields-am-pm"},(0,t.createElement)(u.Button,{isPrimary:"AM"===b,isSecondary:"AM"!==b,onClick:f("AM"),className:"time-picker__am-button"},(0,n.__)("AM","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:"PM"===b,isSecondary:"PM"!==b,onClick:f("PM"),className:"time-picker__pm-button"},(0,n.__)("PM","block-visibility")))))}function jn(e){var l,i;const{scheduleAtts:o,setAttribute:r}=e,s=(0,Z.__experimentalGetSettings)(),a=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join("")),c=null!==(l=o?.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],n={...p[l]};n[e]=t,i[l]=n,r("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,n._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)(Un,{label:(0,n.__)("From","block-visibility"),currentTime:e.start,is12Hour:a,onChange:e=>b("start",e,l),intervalIndex:l}),(0,t.createElement)(Un,{label:(0,n.__)("To","block-visibility"),currentTime:e.end,is12Hour:a,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,n.__)("Clear time interval","block-visibility"),onClick:()=>(e=>{const t=p.filter(((t,l)=>l!==e));r("timeOfDay","intervals",t)})(l),icon:ge})),e.end(()=>{const e=[...p];e.push(d),r("timeOfDay","intervals",e)})(),isLink:!0},(0,n.__)("Add interval","block-visibility"))))}function zn(e){const{dateType:l,label:i,title:o,hasDateTime:r,setAttribute:s,setPickerOpen:a,setPickerType:c}=e;return(0,t.createElement)("div",{className:"date-time-item__field"},(0,t.createElement)(u.Button,{title:o,onClick:()=>{c(l),a(!0)}},(0,t.createElement)("span",null,i)),r&&(0,t.createElement)(u.Button,{icon:ge,className:"clear-date-time",title:(0,n.__)("Clear date/time","block-visibility"),onClick:()=>s(l,!1,""),isSmall:!0}))}function qn(e,t){const l=(0,Z.__experimentalGetSettings)();let i=t;return e&&(i=(0,Z.format)(`M j, Y ${l.formats.time}`,e)),i}function Gn(e){const{currentDate:l,label:i,setAttribute:o,setPickerOpen:r,pickerType:s}=e,a=(0,Z.__experimentalGetSettings)(),c=/a(?!\\)/i.test(a.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",focusOnMount:!0,onClose:()=>r(!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,n.__)("Close","block-visibility"),onClick:()=>r(!1),icon:ge,isSmall:!0})),(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{o(s,!1,e)},is12Hour:c,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0}))}function $n(e,t,l){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e||0===e.length)return!1;const o=e.visibility_controls;return(0,i.has)(o,t)&&(0,i.has)(o[t],l)?o[t][l]:n}function Wn(l){var o,r,s,a,c,d;const{dateTime:p,schedules:m,scheduleIndex:v,scheduleAtts:f,setControlAtts:y,hideOnSchedules:h,settings:g}=l,[_,k]=(0,t.useState)(!1),[E,S]=(0,t.useState)(null),w=$n(g,"date_time","enable_day_of_week"),C=$n(g,"date_time","enable_time_of_day"),O=null!==(o=f?.title)&&void 0!==o?o:"",x=null===(r=f?.enable)||void 0===r||r,T=null!==(s=f?.start)&&void 0!==s?s:null,P=null!==(a=f?.end)&&void 0!==a?a:null,N=null!==(c=f?.dayOfWeek?.enable)&&void 0!==c&&c,R=null!==(d=f?.timeOfDay?.enable)&&void 0!==d&&d,M=new Date((new Date).setHours(0,0,0,0)),V=O||(0,n.__)("Schedule","block-visibility"),F=qn(T,(0,n.__)("Now","block-visibility")),I=qn(P,(0,n.__)("Forever","block-visibility"));let D=!1;T&&P&&(D=T>=P);const L=(e,t,l)=>{const n={...f},o=[...m];n[e]=t?(0,i.assign)({...n[e]},{[t]:l}):l,o[v]=n,y("dateTime",(0,i.assign)({...p},{schedules:[...o]}))},H=(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("Edit","block-visibility"),icon:ie,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"},toggleProps:{isSmall:!0}},(()=>(0,t.createElement)(u.TextControl,{value:O,label:(0,n.__)("Schedule title","block-visibility"),placeholder:(0,n.__)("Schedule","block-visibility"),onChange:e=>L("title",!1,e)}))),B=m.length<=1?(0,n.__)("Clear schedule","block-visibility"):(0,n.__)("Remove schedule","block-visibility"),U=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,n.__)("Options","block-visibility"),icon:$,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>L("enable",!1,!x)},x?(0,n.__)("Disable","block-visibility"):(0,n.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=[...m,f];y("dateTime",(0,i.assign)({...p},{schedules:[...e]}))}(),l()}},(0,n.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=m.filter(((e,t)=>t!==v));y("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,n.sprintf)( +(0,n.__)("%s the block if at least one rule set applies.","block-visibility"),f?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},y.map(((i,n)=>(0,t.createElement)(Nn,e({key:n,ruleSet:i,ruleSetIndex:n,ruleSets:y,allFields:h,controlName:"cookie",controlAtts:v,hideOnRuleSets:f},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:f,onChange:()=>p("cookie",(0,i.assign)({...v},{hideOnRuleSets:!f}))}))))}const Fn=[{index:1,slug:"Sun",title:(0,n.__)("Sunday","block-visibility")},{index:2,slug:"Mon",title:(0,n.__)("Monday","block-visibility")},{index:3,slug:"Tue",title:(0,n.__)("Tuesday","block-visibility")},{index:4,slug:"Wed",title:(0,n.__)("Wednesday","block-visibility")},{index:5,slug:"Thu",title:(0,n.__)("Thursday","block-visibility")},{index:6,slug:"Fri",title:(0,n.__)("Friday","block-visibility")},{index:7,slug:"Sat",title:(0,n.__)("Saturday","block-visibility")}];function In(e){var l;const{scheduleAtts:o,setAttribute:r}=e,s=null!==(l=o?.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,n.__)("On these days","block-visibility")),(0,t.createElement)("div",{className:"day-of-week__checkbox-controls"},Fn.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:s.includes(e.slug),onChange:t=>{let l=[...s];t?l.push(e.slug):l=(0,i.without)(l,e.slug),r("dayOfWeek","days",l)}})))))}const Dn=window.moment;var Ln=l.n(Dn);const Hn="HH:mm:ss";function Bn(e){let{value:l,onUpdate:n,...o}=e;return(0,t.createElement)("input",{key:l,defaultValue:l,onBlur:function(e){const{target:t}=e;if(l===t.value)return;const r=parseInt(t.value,10);!(0,i.isInteger)(r)||void 0!==o.max&&r>o.max||void 0!==o.min&&r({minutes:s.format("mm"),hours:s.format(o?"hh":"HH"),am:s.format("H")<=11?"AM":"PM"})),[s,o]);function m(e){c(e);let t=e.format(Hn);t="23:59:00"===t?"23:59:59":t,r(t)}function v(e,t){let l=t;o&&"hours"===e&&"PM"===b&&(l=12!==l?t+12:l),m(a.clone()[e](l))}function f(e){return()=>{if(b===e)return;const t=parseInt(p,10);m(a.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)(Bn,{"aria-label":(0,n.__)("Hours","block-visibility"),type:"number",name:"hours",step:1,min:o?1:0,max:o?12:23,value:p,onUpdate:v}),(0,t.createElement)("span",{"aria-hidden":"true"},":"),(0,t.createElement)(Bn,{"aria-label":(0,n.__)("Minutes","block-visibility"),type:"number",name:"minutes",step:1,min:0,max:59,value:d,onUpdate:v})),o&&(0,t.createElement)(u.ButtonGroup,{className:"time-picker__fields-am-pm"},(0,t.createElement)(u.Button,{isPrimary:"AM"===b,isSecondary:"AM"!==b,onClick:f("AM"),className:"time-picker__am-button"},(0,n.__)("AM","block-visibility")),(0,t.createElement)(u.Button,{isPrimary:"PM"===b,isSecondary:"PM"!==b,onClick:f("PM"),className:"time-picker__pm-button"},(0,n.__)("PM","block-visibility")))))}function jn(e){var l,i;const{scheduleAtts:o,setAttribute:r}=e,s=(0,Z.__experimentalGetSettings)(),a=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join("")),c=null!==(l=o?.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],n={...p[l]};n[e]=t,i[l]=n,r("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,n._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)(Un,{label:(0,n.__)("From","block-visibility"),currentTime:e.start,is12Hour:a,onChange:e=>b("start",e,l),intervalIndex:l}),(0,t.createElement)(Un,{label:(0,n.__)("To","block-visibility"),currentTime:e.end,is12Hour:a,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,n.__)("Clear time interval","block-visibility"),onClick:()=>(e=>{const t=p.filter(((t,l)=>l!==e));r("timeOfDay","intervals",t)})(l),icon:ge})),e.end(()=>{const e=[...p];e.push(d),r("timeOfDay","intervals",e)})(),isLink:!0},(0,n.__)("Add interval","block-visibility"))))}function zn(e){const{dateType:l,label:i,title:o,hasDateTime:r,setAttribute:s,setPickerOpen:a,setPickerType:c}=e;return(0,t.createElement)("div",{className:"date-time-item__field"},(0,t.createElement)(u.Button,{title:o,onClick:()=>{c(l),a(!0)}},(0,t.createElement)("span",null,i)),r&&(0,t.createElement)(u.Button,{icon:ge,className:"clear-date-time",title:(0,n.__)("Clear date/time","block-visibility"),onClick:()=>s(l,!1,""),isSmall:!0}))}function qn(e,t){const l=(0,Z.__experimentalGetSettings)();let i=t;return e&&(i=(0,Z.format)(`M j, Y ${l.formats.time}`,e)),i}function Gn(e){const{currentDate:l,label:i,setAttribute:o,setPickerOpen:r,pickerType:s}=e,a=(0,Z.__experimentalGetSettings)(),c=/a(?!\\)/i.test(a.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(u.Popover,{className:"block-visibility__date-time-popover",focusOnMount:!0,onClose:()=>r(!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,n.__)("Close","block-visibility"),onClick:()=>r(!1),icon:ge,isSmall:!0})),(0,t.createElement)(u.DateTimePicker,{currentDate:l,onChange:e=>{o(s,!1,e)},is12Hour:c,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0}))}function $n(e,t,l){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e||0===e.length)return!1;const o=e.visibility_controls;return(0,i.has)(o,t)&&(0,i.has)(o[t],l)?o[t][l]:n}function Wn(l){var o,r,s,a,c,d;const{dateTime:p,schedules:m,scheduleIndex:v,scheduleAtts:f,setControlAtts:y,hideOnSchedules:h,settings:g}=l,[_,k]=(0,t.useState)(!1),[E,S]=(0,t.useState)(null),w=$n(g,"date_time","enable_day_of_week"),C=$n(g,"date_time","enable_time_of_day"),O=null!==(o=f?.title)&&void 0!==o?o:"",x=null===(r=f?.enable)||void 0===r||r,T=null!==(s=f?.start)&&void 0!==s?s:null,P=null!==(a=f?.end)&&void 0!==a?a:null,N=null!==(c=f?.dayOfWeek?.enable)&&void 0!==c&&c,A=null!==(d=f?.timeOfDay?.enable)&&void 0!==d&&d,M=new Date((new Date).setHours(0,0,0,0)),V=O||(0,n.__)("Schedule","block-visibility"),F=qn(T,(0,n.__)("Now","block-visibility")),I=qn(P,(0,n.__)("Forever","block-visibility"));let D=!1;T&&P&&(D=T>=P);const L=(e,t,l)=>{const n={...f},o=[...m];n[e]=t?(0,i.assign)({...n[e]},{[t]:l}):l,o[v]=n,y("dateTime",(0,i.assign)({...p},{schedules:[...o]}))},H=(0,t.createElement)(u.DropdownMenu,{label:(0,n.__)("Edit","block-visibility"),icon:ie,popoverProps:{className:"block-visibility__control-popover edit-title",focusOnMount:"container"},toggleProps:{isSmall:!0}},(()=>(0,t.createElement)(u.TextControl,{value:O,label:(0,n.__)("Schedule title","block-visibility"),placeholder:(0,n.__)("Schedule","block-visibility"),onChange:e=>L("title",!1,e)}))),B=m.length<=1?(0,n.__)("Clear schedule","block-visibility"):(0,n.__)("Remove schedule","block-visibility"),U=(0,t.createElement)(u.DropdownMenu,{className:"options-dropdown",label:(0,n.__)("Options","block-visibility"),icon:$,popoverProps:{focusOnMount:"container"}},(e=>{let{onClose:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Tools","block-visibility")},(0,t.createElement)(u.MenuItem,{onClick:()=>L("enable",!1,!x)},x?(0,n.__)("Disable","block-visibility"):(0,n.__)("Enable","block-visibility")),(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=[...m,f];y("dateTime",(0,i.assign)({...p},{schedules:[...e]}))}(),l()}},(0,n.__)("Duplicate","block-visibility"))),(0,t.createElement)(u.MenuGroup,null,(0,t.createElement)(u.MenuItem,{onClick:()=>{!function(){const e=m.filter(((e,t)=>t!==v));y("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,n.sprintf)( // Translators: Whether the block is hidden or visible. -(0,n.__)("%s the block","block-visibility"),h?(0,n.__)("Hide","block-visibility"):(0,n.__)("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,n.__)("From","block-visibility")),(0,t.createElement)(zn,{label:F,title:(0,n.__)("Choose a start date/time","block-visibility"),dateType:"start",hasDateTime:T,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,n.__)("To","block-visibility")),(0,t.createElement)(zn,{label:I,title:(0,n.__)("Choose a end date/time","block-visibility"),dateType:"end",hasDateTime:P,setAttribute:L,setPickerType:S,setPickerOpen:k})),_&&E&&(0,t.createElement)(Gn,{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})(T,P,M):((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})(T,P,M),label:"start"===E?(0,n.__)("Start Date/Time","block-visibility"):(0,n.__)("End Date/Time","block-visibility"),isOpen:k,setAttribute:L,setPickerOpen:k,pickerType:E})),D&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("The start time is after the stop time. Please fix for date/time settings to function properly.","block-visibility"))),w&&N&&(0,t.createElement)(In,e({setAttribute:L},l)),C&&R&&(0,t.createElement)(jn,e({setAttribute:L},l)));return x||(j=(0,t.createElement)(u.Disabled,null,j)),(0,t.createElement)("div",{className:b()("schedules-item",{disabled:!x})},(0,t.createElement)("div",{className:"section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,V),H),(0,t.createElement)("div",{className:"section-header__toolbar"},C&&(0,t.createElement)(u.Button,{icon:A,isPressed:R,onClick:()=>L("timeOfDay","enable",!R),isSmall:!0,label:(0,n.__)("Set time of day controls","block-visibility")}),w&&(0,t.createElement)(u.Button,{icon:he,isPressed:N,onClick:()=>L("dayOfWeek","enable",!N),isSmall:!0,label:(0,n.__)("Set day of week controls","block-visibility")}),U)),j)}function Zn(l){var o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"date_time"===e.settingSlug&&e?.isActive)))return null;const m=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,v=null!==(r=d?.controls?.dateTime)&&void 0!==r?r:{},f=null!==(s=v?.hideOnSchedules)&&void 0!==s&&s;let y=null!==(a=v?.schedules)&&void 0!==a?a:[];if(0===y.length){const e={enable:!0,start:"",end:""};v.schedules=[e],y=v.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,n.__)("Date & Time","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("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:ee.editorDateTime,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...y];e.push({enable:!0,start:"",end:""}),p("dateTime",(0,i.assign)({...v},{schedules:[...e]}))})(),label:(0,n.__)("Add schedule","block-visibility"),isSmall:!0}))),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( +(0,n.__)("%s the block","block-visibility"),h?(0,n.__)("Hide","block-visibility"):(0,n.__)("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,n.__)("From","block-visibility")),(0,t.createElement)(zn,{label:F,title:(0,n.__)("Choose a start date/time","block-visibility"),dateType:"start",hasDateTime:T,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,n.__)("To","block-visibility")),(0,t.createElement)(zn,{label:I,title:(0,n.__)("Choose a end date/time","block-visibility"),dateType:"end",hasDateTime:P,setAttribute:L,setPickerType:S,setPickerOpen:k})),_&&E&&(0,t.createElement)(Gn,{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})(T,P,M):((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})(T,P,M),label:"start"===E?(0,n.__)("Start Date/Time","block-visibility"):(0,n.__)("End Date/Time","block-visibility"),isOpen:k,setAttribute:L,setPickerOpen:k,pickerType:E})),D&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("The start time is after the stop time. Please fix for date/time settings to function properly.","block-visibility"))),w&&N&&(0,t.createElement)(In,e({setAttribute:L},l)),C&&A&&(0,t.createElement)(jn,e({setAttribute:L},l)));return x||(j=(0,t.createElement)(u.Disabled,null,j)),(0,t.createElement)("div",{className:b()("schedules-item",{disabled:!x})},(0,t.createElement)("div",{className:"section-header"},(0,t.createElement)("div",{className:"section-header__title"},(0,t.createElement)("span",null,V),H),(0,t.createElement)("div",{className:"section-header__toolbar"},C&&(0,t.createElement)(u.Button,{icon:R,isPressed:A,onClick:()=>L("timeOfDay","enable",!A),isSmall:!0,label:(0,n.__)("Set time of day controls","block-visibility")}),w&&(0,t.createElement)(u.Button,{icon:he,isPressed:N,onClick:()=>L("dayOfWeek","enable",!N),isSmall:!0,label:(0,n.__)("Set day of week controls","block-visibility")}),U)),j)}function Zn(l){var o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"date_time"===e.settingSlug&&e?.isActive)))return null;const m=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,v=null!==(r=d?.controls?.dateTime)&&void 0!==r?r:{},f=null!==(s=v?.hideOnSchedules)&&void 0!==s&&s;let y=null!==(a=v?.schedules)&&void 0!==a?a:[];if(0===y.length){const e={enable:!0,start:"",end:""};v.schedules=[e],y=v.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,n.__)("Date & Time","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("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:ee.editorDateTime,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...y];e.push({enable:!0,start:"",end:""}),p("dateTime",(0,i.assign)({...v},{schedules:[...e]}))})(),label:(0,n.__)("Add schedule","block-visibility"),isSmall:!0}))),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. (0,n.__)("%s the block if at least one schedule applies.","block-visibility"),f?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"control-fields-item__schedules"},y.map(((i,n)=>(0,t.createElement)(Wn,e({key:n,dateTime:v,schedules:y,scheduleIndex:n,scheduleAtts:i,hideOnSchedules:f},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when schedules apply","block-visibility"),checked:f,onChange:()=>p("dateTime",(0,i.assign)({...v},{hideOnSchedules:!f}))}))))}function Yn(e){var l,o;const{attributes:r,setAttributes:s,enabledControls:a,settings:c}=e;if(!a.some((e=>"hide_block"===e.settingSlug&&e.isActive)))return null;const{blockVisibility:d}=r,p=null!==(l=d?.hideBlock)&&void 0!==l&&l,b=null===(o=c?.plugin_settings?.enable_editor_notices)||void 0===o||o;return(0,t.createElement)("div",{className:"controls-panel-item hide-block-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Hide Block","block-visibility")),b&&(0,t.createElement)(Se,{message:(0,n.__)("The Hide Block control overrides all other visibility controls when enabled.","block-visibility"),link:ee.editorHideBlock,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide the block from everyone","block-visibility"),checked:p,onChange:()=>{s({blockVisibility:(0,i.assign)({...d},{hideBlock:!p})})}})))}function Xn(){const e=(0,o.useSelect)((e=>{var t;const l=e("core").getPostTypes({per_page:-1});let i=[];return l&&0!==l.length&&(i=l.filter((e=>e.viewable&&"attachment"!==e.slug))),(null!==(t=i)&&void 0!==t?t:[]).map((e=>{var t;const l=null!==(t=e.labels?.singular_name)&&void 0!==t?t:e.name;return{value:e.slug,label:(0,kn.decodeEntities)(l),taxonomies:e.taxonomies,hasArchive:"post"===e.slug||e.has_archive,isHierarchical:e.hierarchical}}))}),[]),l=(0,o.useSelect)((e=>{const t=e("core").getTaxonomies({per_page:-1});let l=[];return t&&0!==t.length&&(l=t.filter((e=>e.visibility?.show_ui))),l}),[]),i=(0,t.useMemo)((()=>(null!=l?l:[]).map((e=>e.slug))),[l]),r=(0,t.useMemo)((()=>{const t=[];return e.forEach((e=>{var i;const n=null!==(i=e?.taxonomies)&&void 0!==i?i:[];if(0!==n.length){const i={value:e.value,label:e.label,options:[]};n.forEach((t=>{const n=l.filter((e=>e.slug===t));if(n.length>0){var o;let t=null!==(o=n[0].labels?.singular_name)&&void 0!==o?o:n[0].name;"Category"!==t&&"Tag"!==t||"post"===e.value||(t=t+" ("+e.label+")");const l={value:n[0].slug,label:t};i.options.push(l)}})),t.push(i)}})),t}),[e]),s=(0,t.useMemo)((()=>(null!=e?e:[]).map((e=>e.value))),[e]),a=e.filter((e=>e?.isHierarchical)),c=(0,t.useMemo)((()=>(null!=a?a:[]).map((e=>e.value))),[a]),u=e.filter((e=>e?.hasArchive)),d=[{value:"equal",label:(0,n.__)("Is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Is not equal to","block-visibility")},{value:"greaterThan",label:(0,n.__)("Is greater than","block-visibility")},{value:"lessThan",label:(0,n.__)("Is less than","block-visibility")},{value:"greaterThanEqual",label:(0,n.__)("Is greater or equal to","block-visibility")},{value:"lessThanEqual",label:(0,n.__)("Is less than or equal to","block-visibility")}],p=[{value:"atLeastOne",label:(0,n.__)("Is at least one of the selected","block-visibility")},{value:"all",label:(0,n.__)("Is all of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")},{value:"noTerms",label:(0,n.__)("Post has no taxonomy terms","block-visibility")}],b=[{value:"any",label:(0,n.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")}],m=[{value:"equal",label:(0,n.__)("Is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Is not equal to","block-visibility")}],v=(0,n.__)("Select Condition…","block-visibility"),f=(0,n.__)("Select Type…","block-visibility"),y=(0,n.__)("Select Posts…","block-visibility");return[{value:"pageType",label:(0,n.__)("Page Type","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:[{value:"frontPage",label:(0,n.__)("Front Page (Homepage)","block-visibility")},{value:"postsPage",label:(0,n.__)("Posts Page (Blog page)","block-visibility")},{value:"singular",label:(0,n.__)("Singular Page","block-visibility")},{value:"archive",label:(0,n.__)("Archive Page","block-visibility")},{value:"search",label:(0,n.__)("Search Results Page","block-visibility")},{value:"404",label:(0,n.__)("404 Page","block-visibility")}],placeholder:f}]},{value:"postType",label:(0,n.__)("Post Type","block-visibility"),group:"post",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:e,placeholder:f,isLoading:0===e.length}]},{value:"postTaxonomy",label:(0,n.__)("Post Taxonomy","block-visibility"),group:"post",fields:[{type:"subField",valueType:"select",options:r,placeholder:(0,n.__)("Select Taxonomy…","block-visibility"),hasGroupedOptions:!0,triggerReset:!0,isLoading:0===r.length},{type:"operatorField",valueType:"select",options:p,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:i,valueTypes:[{value:"default",valueType:"termsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:i},{dependencyType:"operatorField",dependencyValues:["atLeastOne","all","none"]}],placeholder:(0,n.__)("Select Terms…","block-visibility")}]},{value:"post",label:(0,n.__)("Post","block-visibility"),group:"post",fields:[{type:"subField",valueType:"select",options:e,placeholder:(0,n.__)("Select Post Type…","block-visibility"),isLoading:0===e.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:s,valueTypes:[{value:"default",valueType:"postsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:s}],placeholder:y}]},{value:"postID",label:(0,n.__)("Post ID","block-visibility"),help:(0,n.__)("For multiple, comma seperate each post ID.","block-visibility"),group:"post",fields:[{type:"operatorField",valueType:"select",options:m,placeholder:v},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Post ID…","block-visibility")}]},{value:"attributesAuthor",label:(0,n.__)("Author","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"authorsSelect",placeholder:(0,n.__)("Select Author…","block-visibility")}]},{value:"attributesComments",label:(0,n.__)("Comments","block-visibility"),group:"attributes",fields:[{type:"subField",valueType:"select",options:[{value:"hasComments",label:(0,n.__)("Post has comments","block-visibility")},{value:"noComments",label:(0,n.__)("Post has no comments","block-visibility")},{value:"commentCount",label:(0,n.__)("Post comment count","block-visibility")}],placeholder:v,triggerReset:!0},{type:"operatorField",valueType:"select",options:d,placeholder:v,displayConditions:[{dependencyType:"subField",dependencyValues:["commentCount"]}]},{type:"valueField",valueType:"number",displayConditions:[{dependencyType:"subField",dependencyValues:["commentCount"]}]}],hasSimplifiedLayout:!0},{value:"attributesThumbnail",label:(0,n.__)("Featured Image","block-visibility"),group:"attributes",fields:[{type:"valueField",valueType:"select",options:[{value:"hasThumbnail",label:(0,n.__)("Post has a featured image","block-visibility")},{value:"noThumbnail",label:(0,n.__)("Post has no featured image","block-visibility")}]}]},{value:"attributesHierarchy",label:(0,n.__)("Hierarchy","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:[{value:"is",label:(0,n.__)("Post is a","block-visibility")},{value:"isNot",label:(0,n.__)("Post is not a","block-visibility")}],placeholder:v},{type:"valueField",valueType:"select",options:[{value:"topLevel",label:(0,n.__)("Top level post (no parent)","block-visibility")},{value:"parent",label:(0,n.__)("Parent (has children)","block-visibility")},{value:"child",label:(0,n.__)("Child (has parent)","block-visibility")}]}]},{value:"attributesRelativeHierarchy",label:(0,n.__)("Relative Hierarchy","block-visibility"),group:"attributes",fields:[{type:"subField",valueType:"select",options:a,placeholder:(0,n.__)("Select Post Type…","block-visibility"),isLoading:0===a.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:[{value:"parentOf",label:(0,n.__)("Is a parent of","block-visibility")},{value:"notParentOf",label:(0,n.__)("Is not a parent of","block-visibility")},{value:"childOf",label:(0,n.__)("Is a child of","block-visibility")},{value:"notChildOf",label:(0,n.__)("Is not a child of","block-visibility")}],placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:c,valueTypes:[{value:"default",valueType:"postSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:c}],placeholder:y}]},{value:"attributesSupports",label:(0,n.__)("Supports","block-visibility"),group:"attributes",fields:[{type:"operatorField",valueType:"select",options:[{value:"supports",label:(0,n.__)("Post type supports","block-visibility")},{value:"notSupport",label:(0,n.__)("Post type does not support","block-visibility")}],placeholder:v},{type:"valueField",valueType:"select",options:[{value:"comments",label:(0,n.__)("Comments","block-visibility")},{value:"excerpt",label:(0,n.__)("Excerpts","block-visibility")},{value:"thumbnail",label:(0,n.__)("Featured Images (Thumbnail)","block-visibility")},{value:"hierarchical",label:(0,n.__)("Post Hierarchy","block-visibility")}]}]},{value:"archiveType",label:(0,n.__)("Archive Type","block-visibility"),group:"archive",fields:[{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",valueType:"multiSelect",options:[{value:"postTypes",label:(0,n.__)("Post Types","block-visibility"),options:u},...r,{value:"internal",label:(0,n.__)("Internal","block-visibility"),options:[{value:"author",label:(0,n.__)("Author","block-visibility")},{value:"date",label:(0,n.__)("Date","block-visibility")}]}],placeholder:f,hasGroupedOptions:!0,isLoading:0===r.length||0===u.length}]},{value:"archive",label:(0,n.__)("Archive","block-visibility"),group:"archive",fields:[{type:"subField",valueType:"select",options:[...r,{value:"internal",label:(0,n.__)("Internal","block-visibility"),options:[{value:"author",label:(0,n.__)("Author","block-visibility")}]}],placeholder:f,hasGroupedOptions:!0,isLoading:0===r.length,triggerReset:!0},{type:"operatorField",valueType:"select",options:b,placeholder:v},{type:"valueField",conditionalValueTypes:[{dependencyType:"subField",dependencyValues:["author",...i],valueTypes:[{value:"author",valueType:"authorsSelect"},{value:"default",valueType:"termsSelect"}]}],displayConditions:[{dependencyType:"subField",dependencyValues:["author",...i]}],placeholder:(0,n.__)("Select Value…","block-visibility")}]}]}function Kn(l){var o,r,s,a;const{controlSetAtts:c,enabledControls:d,setControlAtts:p,settings:b,variables:m}=l;if(!d.some((e=>"location"===e.settingSlug&&e?.isActive)))return null;const v=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,f=null!==(r=c?.controls?.location)&&void 0!==r?r:{},y=null!==(s=f?.hideOnRuleSets)&&void 0!==s&&s,h=null!==(a=f?.ruleSets)&&void 0!==a?a:[];0===h.length&&h.push({enable:!0,rules:[{field:""}]});const g=function(e){const t=[{value:"type",label:(0,n.__)("Type","block-visibility")},{value:"post",label:(0,n.__)("Post","block-visibility")},{value:"attributes",label:(0,n.__)("Post Attributes","block-visibility")},{value:"archive",label:(0,n.__)("Archive","block-visibility")}],l=Xn(),i=[];return t.forEach((e=>{var t,n;const o=null!==(t=e?.value)&&void 0!==t?t:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=l.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(),_=Xn();return(0,t.createElement)("div",{className:"controls-panel-item location-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Location","block-visibility")),v&&(0,t.createElement)(Se,{message:(0,n.__)("The Location control allows you to configure block visibility based on where the block is located on your website using various rules.","block-visibility"),link:ee.editorLocation,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...h,{enable:!0,rules:[{field:""}]}];p("location",(0,i.assign)({...f},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),v&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. (0,n.__)("%s the block if at least one rule set applies.","block-visibility"),y?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},h.map(((i,n)=>(0,t.createElement)(Nn,e({key:n,ruleSet:i,ruleSetIndex:n,ruleSets:h,groupedFields:g,allFields:_,controlName:"location",controlAtts:f,hideOnRuleSets:y},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:y,onChange:()=>p("location",(0,i.assign)({...f},{hideOnRuleSets:!y}))}))))}function Qn(){const e=[{value:"notEmpty",label:(0,n.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,n.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,n.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,n.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,n.__)("Value contains","block-visibility")},{value:"notContain",label:(0,n.__)("Value does not contain","block-visibility")}],t=(0,n.__)("Select Condition…","block-visibility");return[{value:"postMetadata",label:(0,n.__)("Post Metadata","block-visibility"),group:"type",fields:[{type:"subField",valueType:"text",placeholder:(0,n.__)("Enter Meta Key (Name)…","block-visibility")},{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Meta Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","contains","notContain"]}]}]},{value:"userMetadata",label:(0,n.__)("User Metadata","block-visibility"),group:"type",fields:[{type:"subField",valueType:"text",placeholder:(0,n.__)("Enter Meta Key (Name)…","block-visibility")},{type:"operatorField",valueType:"select",options:e,placeholder:t},{type:"valueField",valueType:"text",placeholder:(0,n.__)("Enter Meta Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","contains","notContain"]}]}]}]}function Jn(l){var o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=l;if(!c.some((e=>"metadata"===e.settingSlug&&e?.isActive)))return null;const m=null===(o=b?.plugin_settings?.enable_editor_notices)||void 0===o||o,v=null!==(r=d?.controls?.metadata)&&void 0!==r?r:{},f=null!==(s=v?.hideOnRuleSets)&&void 0!==s&&s,y=null!==(a=v?.ruleSets)&&void 0!==a?a:[];0===y.length&&y.push({enable:!0,rules:[{field:""}]});const h=function(){const e=[{value:"type",label:(0,n.__)("Metadata Type","block-visibility")}],t=Qn(),l=[];return e.forEach((e=>{var i,n;const o=null!==(i=e?.value)&&void 0!==i?i:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=t.filter((e=>e.group===o));l.push({value:o,label:r,options:s})})),l}(),g=Qn();return(0,t.createElement)("div",{className:"controls-panel-item metadata-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Metadata","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("The Metadata control allows you to configure block visibility based on post or user metadata.","block-visibility"),link:ee.editorMetadata,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...y,{enable:!0,rules:[{field:""}]}];p("metadata",(0,i.assign)({...v},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. -(0,n.__)("%s the block if at least one rule set applies. Rules targeting user metadata will fail if the current user is not logged in.","block-visibility"),f?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},y.map(((i,o)=>(0,t.createElement)(Nn,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:y,groupedFields:h,allFields:g,controlName:"metadata",controlAtts:v,hideOnRuleSets:f,rulePlaceholder:(0,n.__)("Select Metadata Type…","block-visibility")},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:f,onChange:()=>p("metadata",(0,i.assign)({...v},{hideOnRuleSets:!f}))}))))}function eo(e){var l,o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=e;if(!c.some((e=>"query_string"===e.settingSlug&&e.isActive)))return null;const m=null!==(l=d?.controls?.queryString)&&void 0!==l?l:{},v=null!==(o=m?.queryStringAny)&&void 0!==o?o:"",f=null!==(r=m?.queryStringAll)&&void 0!==r?r:"",y=null!==(s=m?.queryStringNot)&&void 0!==s?s:"",h=null===(a=b?.plugin_settings?.enable_editor_notices)||void 0===a||a,g=(e,t)=>p("queryString",(0,i.assign)({...m},{[e]:t}));return(0,t.createElement)("div",{className:"controls-panel-item query-string-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Query String","block-visibility")),h&&(0,t.createElement)(Se,{message:(0,n.__)("The Query String control allows you to configure block visibility based on URL query strings.","block-visibility"),link:ee.editorQueryString,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.__)("Enter one URL query string per line.","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Required Queries (Any)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:h&&(0,n.__)("Show the block if at least one of the provided URL query strings is present.","block-visibility"),value:v,onChange:e=>g("queryStringAny",e),rows:"2"}),(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Required Queries (All)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:h&&(0,t.createInterpolateElement)((0,n.__)("Show the block if all of the provided URL query strings are present.","block-visibility"),{strong:(0,t.createElement)("strong",null)}),value:f,onChange:e=>g("queryStringAll",e),rows:"2"}),(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Required Queries (Not)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:h&&(0,n.__)("Hide the block if at least one of the provided URL query strings is present.","block-visibility"),value:y,onChange:e=>g("queryStringNot",e),rows:"2"})))}function to(e){var l,o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=e;if(!c.some((e=>"referral_source"===e.settingSlug&&e?.isActive)))return null;const m=null===(l=b?.plugin_settings?.enable_editor_notices)||void 0===l||l,v=null!==(o=d?.controls?.referralSource)&&void 0!==o?o:{},f=null!==(r=v?.contains)&&void 0!==r?r:"",y=null!==(s=v?.doesNotContain)&&void 0!==s?s:"",h=null!==(a=v?.showIfNoReferral)&&void 0!==a?a:"",g=(e,t)=>p("referralSource",(0,i.assign)({...v},{[e]:t}));return(0,t.createElement)("div",{className:"controls-panel-item referral-source-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Referral Source","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("The Referral Source control allows you to configure block visibility based on the referral source URL. Restrict visibility by specific domains, complete URLs, or URL fragments.","block-visibility"),link:ee.editorReferralSource,position:"bottom center"})),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.__)("Enter one domain, complete URL, or URL fragment per line.","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-item__fields"},(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Referral URL (Contains)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:m&&(0,n.__)("Show the block if the referral URL contains at least one of the provided values.","block-visibility"),value:f,onChange:e=>g("contains",e),rows:"2"}),(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Referral URL (Does Not Contain)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:m&&(0,n.__)("Hide the block if the referral URL contains at least one of the provided values.","block-visibility"),value:y,onChange:e=>g("doesNotContain",e),rows:"2"}),(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Show if no referral URL","block-visibility"),help:m&&(0,t.createInterpolateElement)((0,n.__)("Show the block when no referral URL is present. Learn more","block-visibility"),{a:(0,t.createElement)(u.ExternalLink,{href:ee.editorReferralSource})}),checked:h,onChange:()=>{g("showIfNoReferral",!h)}})))}function lo(e){var l,o,r,s;const{enabledControls:a,controlSetAtts:c,setControlAtts:d,settings:p}=e;if(!a.some((e=>"url_path"===e.settingSlug&&e?.isActive)))return null;const b=null===(l=p?.plugin_settings?.enable_editor_notices)||void 0===l||l,m=null!==(o=c?.controls?.urlPath)&&void 0!==o?o:{},v=null!==(r=m?.contains)&&void 0!==r?r:"",f=null!==(s=m?.doesNotContain)&&void 0!==s?s:"",y=(e,t)=>d("urlPath",(0,i.assign)({...m},{[e]:t}));return(0,t.createElement)("div",{className:"controls-panel-item url-path-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("URL Path","block-visibility")),b&&(0,t.createElement)(Se,{message:(0,n.__)("The URL Path control allows you to configure block visibility based on the URL of the page that it's located on.","block-visibility"),link:ee.editorUrlPath,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.__)("Enter one URL path per line.","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-item__fields"},(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("URL Path (Contains)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:b&&(0,n.__)("Only visible when the current URL contains at least one of the provided paths.","block-visibility"),value:v,onChange:e=>y("contains",e),rows:"2"}),(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("URL Path (Does Not Contain)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:b&&(0,n.__)("Hide when the current URL contains at least one of the provided paths.","block-visibility"),value:f,onChange:e=>y("doesNotContain",e),rows:"2"})))}function io(e){var l,o,r,a,c,d,p,b,m;const{name:v,settings:f,enabledControls:y,controlSetAtts:h,setControlAtts:g}=e;if(!y.some((e=>"screen_size"===e.settingSlug&&e.isActive)))return null;const _=null!==(l=h?.controls?.screenSize)&&void 0!==l?l:{},k=null!==(o=_?.hideOnScreenSize)&&void 0!==o?o:{},E=$n(f,"screen_size","enable_advanced_controls",!1),S=null!==(r=f?.visibility_controls?.screen_size?.controls)&&void 0!==r?r:{extraLarge:!0,large:!0,medium:!0,small:!0,extraSmall:!0},w=null===(a=f?.plugin_settings?.enable_editor_notices)||void 0===a||a,C=(e,t)=>g("screenSize",(0,i.assign)({..._},{hideOnScreenSize:(0,i.assign)({...k},{[e]:t})})),O=null!==(c=k?.extraLarge)&&void 0!==c&&c,x=null!==(d=k?.large)&&void 0!==d&&d,T=null!==(p=k?.medium)&&void 0!==p&&p,P=null!==(b=k?.small)&&void 0!==b&&b,N=null!==(m=k?.extraSmall)&&void 0!==m&&m;let R=(0,t.createElement)(t.Fragment,null,E&&S.extra_large&&(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide on large desktop","block-visibility"),checked:O,onChange:()=>{C("extraLarge",!O)}}),S.large&&(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide on desktop","block-visibility"),checked:x,onChange:()=>{C("large",!x)}}),S.medium&&(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide on tablet","block-visibility"),checked:T,onChange:()=>{C("medium",!T)}}),S.small&&(0,t.createElement)(u.ToggleControl,{label:[!E&&(0,n.__)("Hide on mobile","block-visibility"),E&&(0,n.__)("Hide on mobile (landscape)","block-visibility")],checked:P,onChange:()=>{C("small",!P)}}),E&&S.extra_small&&(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide on mobile (portrait)","block-visibility"),checked:N,onChange:()=>{C("extraSmall",!N)}}));const A=(0,s.applyFilters)("blockVisibility.screenSizeIncompatibleBlockTypes",["core/shortcode","core/html","meow-gallery/gallery"]);return A.includes(v)&&(R=(0,t.createElement)(u.Disabled,null,R)),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"controls-panel-item screen-size-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Screen Size","block-visibility")),w&&(0,t.createElement)(Se,{message:(0,n.__)("The Screen Size control allows you to configure block visibility based on the width of the current screen.","block-visibility"),link:ee.editorScreenSize,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},R,A.includes(v)&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,n.__)("The Screen Size control is unfortunately not compatible with this block type. For more information and a workaround, visit the Knowledge Base.","block-visibility"),{a:(0,t.createElement)(u.ExternalLink,{href:ee.editorScreenSize,target:"_blank",rel:"noreferrer"})})))))}function no(e){var l,o,r;const{variables:s,userRole:a,setControlAtts:c,enableNotices:d}=e,p=null!==(l=a?.restrictedRoles)&&void 0!==l?l:[],b=null!==(o=a?.hideOnRestrictedRoles)&&void 0!==o&&o,m=null!==(r=s?.user_roles)&&void 0!==r?r:[],v=b?(0,n.__)("Hide the block from","block-visibility"):(0,n.__)("Show the block to","block-visibility"),f=m.filter((e=>p.includes(e.value)));return(0,t.createElement)("div",{className:"control-fields-item"},d&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,n.sprintf)( +(0,n.__)("%s the block if at least one rule set applies. Rules targeting user metadata will fail if the current user is not logged in.","block-visibility"),f?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"rule-sets"},y.map(((i,o)=>(0,t.createElement)(Nn,e({key:o,ruleSet:i,ruleSetIndex:o,ruleSets:y,groupedFields:h,allFields:g,controlName:"metadata",controlAtts:v,hideOnRuleSets:f,rulePlaceholder:(0,n.__)("Select Metadata Type…","block-visibility")},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:f,onChange:()=>p("metadata",(0,i.assign)({...v},{hideOnRuleSets:!f}))}))))}function eo(e){var l,o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=e;if(!c.some((e=>"query_string"===e.settingSlug&&e.isActive)))return null;const m=null!==(l=d?.controls?.queryString)&&void 0!==l?l:{},v=null!==(o=m?.queryStringAny)&&void 0!==o?o:"",f=null!==(r=m?.queryStringAll)&&void 0!==r?r:"",y=null!==(s=m?.queryStringNot)&&void 0!==s?s:"",h=null===(a=b?.plugin_settings?.enable_editor_notices)||void 0===a||a,g=(e,t)=>p("queryString",(0,i.assign)({...m},{[e]:t}));return(0,t.createElement)("div",{className:"controls-panel-item query-string-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Query String","block-visibility")),h&&(0,t.createElement)(Se,{message:(0,n.__)("The Query String control allows you to configure block visibility based on URL query strings.","block-visibility"),link:ee.editorQueryString,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.__)("Enter one URL query string per line.","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Required Queries (Any)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:h&&(0,n.__)("Show the block if at least one of the provided URL query strings is present.","block-visibility"),value:v,onChange:e=>g("queryStringAny",e),rows:"2"}),(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Required Queries (All)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:h&&(0,t.createInterpolateElement)((0,n.__)("Show the block if all of the provided URL query strings are present.","block-visibility"),{strong:(0,t.createElement)("strong",null)}),value:f,onChange:e=>g("queryStringAll",e),rows:"2"}),(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Required Queries (Not)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:h&&(0,n.__)("Hide the block if at least one of the provided URL query strings is present.","block-visibility"),value:y,onChange:e=>g("queryStringNot",e),rows:"2"})))}function to(e){var l,o,r,s,a;const{enabledControls:c,controlSetAtts:d,setControlAtts:p,settings:b}=e;if(!c.some((e=>"referral_source"===e.settingSlug&&e?.isActive)))return null;const m=null===(l=b?.plugin_settings?.enable_editor_notices)||void 0===l||l,v=null!==(o=d?.controls?.referralSource)&&void 0!==o?o:{},f=null!==(r=v?.contains)&&void 0!==r?r:"",y=null!==(s=v?.doesNotContain)&&void 0!==s?s:"",h=null!==(a=v?.showIfNoReferral)&&void 0!==a?a:"",g=(e,t)=>p("referralSource",(0,i.assign)({...v},{[e]:t}));return(0,t.createElement)("div",{className:"controls-panel-item referral-source-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Referral Source","block-visibility")),m&&(0,t.createElement)(Se,{message:(0,n.__)("The Referral Source control allows you to configure block visibility based on the referral source URL. Restrict visibility by specific domains, complete URLs, or URL fragments.","block-visibility"),link:ee.editorReferralSource,position:"bottom center"})),m&&(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.__)("Enter one domain, complete URL, or URL fragment per line.","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-item__fields"},(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Referral URL (Contains)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:m&&(0,n.__)("Show the block if the referral URL contains at least one of the provided values.","block-visibility"),value:f,onChange:e=>g("contains",e),rows:"2"}),(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("Referral URL (Does Not Contain)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:m&&(0,n.__)("Hide the block if the referral URL contains at least one of the provided values.","block-visibility"),value:y,onChange:e=>g("doesNotContain",e),rows:"2"}),(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Show if no referral URL","block-visibility"),help:m&&(0,t.createInterpolateElement)((0,n.__)("Show the block when no referral URL is present. Learn more","block-visibility"),{a:(0,t.createElement)(u.ExternalLink,{href:ee.editorReferralSource})}),checked:h,onChange:()=>{g("showIfNoReferral",!h)}})))}function lo(e){var l,o,r,s;const{enabledControls:a,controlSetAtts:c,setControlAtts:d,settings:p}=e;if(!a.some((e=>"url_path"===e.settingSlug&&e?.isActive)))return null;const b=null===(l=p?.plugin_settings?.enable_editor_notices)||void 0===l||l,m=null!==(o=c?.controls?.urlPath)&&void 0!==o?o:{},v=null!==(r=m?.contains)&&void 0!==r?r:"",f=null!==(s=m?.doesNotContain)&&void 0!==s?s:"",y=(e,t)=>d("urlPath",(0,i.assign)({...m},{[e]:t}));return(0,t.createElement)("div",{className:"controls-panel-item url-path-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("URL Path","block-visibility")),b&&(0,t.createElement)(Se,{message:(0,n.__)("The URL Path control allows you to configure block visibility based on the URL of the page that it's located on.","block-visibility"),link:ee.editorUrlPath,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__description"},(0,n.__)("Enter one URL path per line.","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-item__fields"},(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("URL Path (Contains)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:b&&(0,n.__)("Only visible when the current URL contains at least one of the provided paths.","block-visibility"),value:v,onChange:e=>y("contains",e),rows:"2"}),(0,t.createElement)(u.TextareaControl,{label:(0,t.createInterpolateElement)((0,n.__)("URL Path (Does Not Contain)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})}),help:b&&(0,n.__)("Hide when the current URL contains at least one of the provided paths.","block-visibility"),value:f,onChange:e=>y("doesNotContain",e),rows:"2"})))}function io(e){var l,o,r,a,c,d,p,b,m;const{name:v,settings:f,enabledControls:y,controlSetAtts:h,setControlAtts:g}=e;if(!y.some((e=>"screen_size"===e.settingSlug&&e.isActive)))return null;const _=null!==(l=h?.controls?.screenSize)&&void 0!==l?l:{},k=null!==(o=_?.hideOnScreenSize)&&void 0!==o?o:{},E=$n(f,"screen_size","enable_advanced_controls",!1),S=null!==(r=f?.visibility_controls?.screen_size?.controls)&&void 0!==r?r:{extraLarge:!0,large:!0,medium:!0,small:!0,extraSmall:!0},w=null===(a=f?.plugin_settings?.enable_editor_notices)||void 0===a||a,C=(e,t)=>g("screenSize",(0,i.assign)({..._},{hideOnScreenSize:(0,i.assign)({...k},{[e]:t})})),O=null!==(c=k?.extraLarge)&&void 0!==c&&c,x=null!==(d=k?.large)&&void 0!==d&&d,T=null!==(p=k?.medium)&&void 0!==p&&p,P=null!==(b=k?.small)&&void 0!==b&&b,N=null!==(m=k?.extraSmall)&&void 0!==m&&m;let A=(0,t.createElement)(t.Fragment,null,E&&S.extra_large&&(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide on large desktop","block-visibility"),checked:O,onChange:()=>{C("extraLarge",!O)}}),S.large&&(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide on desktop","block-visibility"),checked:x,onChange:()=>{C("large",!x)}}),S.medium&&(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide on tablet","block-visibility"),checked:T,onChange:()=>{C("medium",!T)}}),S.small&&(0,t.createElement)(u.ToggleControl,{label:[!E&&(0,n.__)("Hide on mobile","block-visibility"),E&&(0,n.__)("Hide on mobile (landscape)","block-visibility")],checked:P,onChange:()=>{C("small",!P)}}),E&&S.extra_small&&(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide on mobile (portrait)","block-visibility"),checked:N,onChange:()=>{C("extraSmall",!N)}}));const R=(0,s.applyFilters)("blockVisibility.screenSizeIncompatibleBlockTypes",["core/shortcode","core/html","meow-gallery/gallery"]);return R.includes(v)&&(A=(0,t.createElement)(u.Disabled,null,A)),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"controls-panel-item screen-size-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Screen Size","block-visibility")),w&&(0,t.createElement)(Se,{message:(0,n.__)("The Screen Size control allows you to configure block visibility based on the width of the current screen.","block-visibility"),link:ee.editorScreenSize,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},A,R.includes(v)&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,n.__)("The Screen Size control is unfortunately not compatible with this block type. For more information and a workaround, visit the Knowledge Base.","block-visibility"),{a:(0,t.createElement)(u.ExternalLink,{href:ee.editorScreenSize,target:"_blank",rel:"noreferrer"})})))))}function no(e){var l,o,r;const{variables:s,userRole:a,setControlAtts:c,enableNotices:d}=e,p=null!==(l=a?.restrictedRoles)&&void 0!==l?l:[],b=null!==(o=a?.hideOnRestrictedRoles)&&void 0!==o&&o,m=null!==(r=s?.user_roles)&&void 0!==r?r:[],v=b?(0,n.__)("Hide the block from","block-visibility"):(0,n.__)("Show the block to","block-visibility"),f=m.filter((e=>p.includes(e.value)));return(0,t.createElement)("div",{className:"control-fields-item"},d&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. (0,n.__)("%s users with at least one of the selected roles.","block-visibility"),v)),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:m,value:f,placeholder:(0,n.__)("Select Role…","block-visibility"),onChange:e=>(e=>{const t=[];0!==e.length&&e.forEach((e=>{t.push(e.value)})),c("userRole",(0,i.assign)({...a},{restrictedRoles:t}))})(e),isMulti:!0}),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide from selected roles","block-visibility"),checked:b,onChange:()=>c("userRole",(0,i.assign)({...a},{hideOnRestrictedRoles:!b}))})))}function oo(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,o.useSelect)((t=>{if(!e)return[];const l=t("core").getUsers({per_page:-1,_fields:"id,name"}),i=[];return l&&0!==l.length&&l.forEach((e=>{const t={value:e.id,label:e.name};i.push(t)})),i}),[])}function ro(e){var t;const l=oo();let i=null!==(t=e?.user_roles)&&void 0!==t?t:[];i=i.filter((e=>"logged-out"!==e.value));const o=[{value:"any",label:(0,n.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")}],r=[{value:"atLeastOne",label:(0,n.__)("Is at least one of the selected","block-visibility")},{value:"all",label:(0,n.__)("Is all of the selected","block-visibility")},{value:"none",label:(0,n.__)("Is none of the selected","block-visibility")}],s=(0,n.__)("Select Condition…","block-visibility");return[{value:"logged-out",label:(0,n.__)("User is logged-out","block-visibility"),group:"type"},{value:"logged-in",label:(0,n.__)("User is logged-in","block-visibility"),group:"type"},{value:"user-role",label:(0,n.__)("User's role","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:r,placeholder:s},{type:"valueField",valueType:"multiSelect",options:i,placeholder:(0,n.__)("Select User Roles…","block-visibility"),isMulti:!0}]},{value:"users",label:(0,n.__)("User","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:o,placeholder:s},{type:"valueField",valueType:"multiSelect",options:l,placeholder:(0,n.__)("Select Users…","block-visibility"),isMulti:!0}]}]}function so(l){var o,r,s;const{ruleSets:a,setControlAtts:c,userRole:d,variables:p,enableNotices:b}=l,m=null!==(o=d?.hideOnRuleSets)&&void 0!==o&&o,v=function(e){const t=[{value:"type",label:(0,n.__)("User Rule Type","block-visibility")}],l=ro(e),i=[];return t.forEach((e=>{var t,n;const o=null!==(t=e?.value)&&void 0!==t?t:"",r=null!==(n=e?.label)&&void 0!==n?n:"",s=l.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(),f=ro(p);return null!==(s=(null!==(r=p?.current_users_roles)&&void 0!==r?r:[]).includes("administrator"))&&void 0!==s&&s?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"control-fields-item"},b&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. (0,n.__)("%s the block if at least one user rule set applies.","block-visibility"),m?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"rule-sets"},a.map(((i,n)=>(0,t.createElement)(Nn,e({key:n,ruleSet:i,ruleSetIndex:n,ruleSets:a,groupedFields:v,allFields:f,controlName:"userRole",controlAtts:d,hideOnRuleSets:m},l))))),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide when rules apply","block-visibility"),checked:m,onChange:()=>c("userRole",(0,i.assign)({...d},{hideOnRuleSets:!m}))})))):(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("Website Administrators can only configure the User rule sets option. Please choose another option.","block-visibility"))}function ao(e){var l,o,r,s;const{variables:a,userRole:c,setControlAtts:d,enableNotices:p}=e,b=null!==(l=c?.restrictedUsers)&&void 0!==l?l:[],m=null!==(o=c?.hideOnRestrictedUsers)&&void 0!==o&&o,v=null!==(s=(null!==(r=a?.current_users_roles)&&void 0!==r?r:[]).includes("administrator"))&&void 0!==s&&s,f=oo(v);if(!v)return(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("Website Administrators can only configure the Users option. Please choose another option.","block-visibility"));const y=f.filter((e=>b.includes(e.value))),h=m?(0,n.__)("Hide the block from","block-visibility"):(0,n.__)("Show the block to","block-visibility");return(0,t.createElement)("div",{className:"control-fields-item"},p&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. -(0,n.__)("%s the selected users.","block-visibility"),h)),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:f,value:y,placeholder:(0,n.__)("Select Users…","block-visibility"),onChange:e=>(e=>{const t=[];0!==e.length&&e.forEach((e=>{t.push(e.value)})),d("userRole",(0,i.assign)({...c},{restrictedUsers:t}))})(e),isMulti:!0,isLoading:0===f.length}),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide from selected users","block-visibility"),checked:m,onChange:()=>d("userRole",(0,i.assign)({...c},{hideOnRestrictedUsers:!m}))})))}function co(l){var o,r,s,a,c,d;const{settings:p,variables:b,enabledControls:m,setControlAtts:v,controlSetAtts:f}=l;if(!m.some((e=>"visibility_by_role"===e.settingSlug&&e.isActive)))return null;const y=null!==(o=f?.controls?.userRole)&&void 0!==o?o:{},h=null!==(r=y?.visibilityByRole)&&void 0!==r?r:"public",g=null!==(s=b?.plugin_variables.settings_url)&&void 0!==s?s:"",_=null===(a=p?.plugin_settings?.enable_editor_notices)||void 0===a||a,k=$n(p,"visibility_by_role","enable_user_roles"),E=$n(p,"visibility_by_role","enable_users"),S=$n(p,"visibility_by_role","enable_user_rule_sets");let w=[{label:(0,n.__)("Public","block-visibility"),value:"public"},{label:(0,n.__)("Logged-out","block-visibility"),value:"logged-out"},{label:(0,n.__)("Logged-in","block-visibility"),value:"logged-in"},{label:(0,n.__)("User roles","block-visibility"),value:"user-role"},{label:(0,n.__)("Users","block-visibility"),value:"users"},{label:(0,n.__)("User rule sets","block-visibility"),value:"user-rule-sets"}];const C=[{label:(0,n.__)("Block is visible to everyone.","block-visibility"),value:"public"},{label:(0,n.__)("Block is only visible to logged-out users.","block-visibility"),value:"logged-out"},{label:(0,n.__)("Block is only visible to logged-in users.","block-visibility"),value:"logged-in"}];k||(w=w.filter((e=>"user-role"!==e.value))),E||(w=w.filter((e=>"users"!==e.value))),S||(w=w.filter((e=>"user-rule-sets"!==e.value)));const O=w.filter((e=>e.value===h)),x=null!==(c=C.filter((e=>e.value===h))[0]?.label)&&void 0!==c?c:"",T=S&&"user-rule-sets"===h,P=null!==(d=y?.ruleSets)&&void 0!==d?d:[];return 0===P.length&&P.push({enable:!0,rules:[{field:""}]}),(0,t.createElement)("div",{className:"controls-panel-item user-role-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("User Role","block-visibility")),_&&(0,t.createElement)(Se,{message:(0,n.__)("The User Role control allows you to configure block visibility based on the current user's role or specific users.","block-visibility"),link:ee.editorUserRole,position:"bottom center"}),T&&(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...P,{enable:!0,rules:[{field:""}]}];v("userRole",(0,i.assign)({...y},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:w,value:O,onChange:e=>v("userRole",(0,i.assign)({...y},{visibilityByRole:e.value}))}),_&&x&&(0,t.createElement)("div",{className:"control-fields-item__help"},x)),"user-role"===h&&k&&(0,t.createElement)(no,e({variables:b,userRole:y,setControlAtts:v,enableNotices:_},l)),"users"===h&&E&&(0,t.createElement)(ao,e({variables:b,userRole:y,setControlAtts:v,enableNotices:_},l)),"user-rule-sets"===h&&S&&(0,t.createElement)(so,e({ruleSets:P,setControlAtts:v,userRole:y,variables:b,enableNotices:_},l)),!w.some((e=>e.value===h))&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,n.__)("The previously selected User Role option has been disabled. Choose another option or update the Visibility Control settings.","block-visibility"),{a:(0,t.createElement)("a",{href:g+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))))}const uo=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));function po(e){var l,s,a,c,d,p;const[b,m]=(0,t.useState)(!1),{attributes:v,setAttributes:f,enabledControls:y,settings:h,variables:g}=e,{presets:_}=(0,o.useSelect)((e=>{const{getEntityRecords:t}=e(r.store),l=t("postType","visibility_preset",{per_page:-1}),i=[];return l&&0!==l.length&&l.forEach((e=>{var t;const l={value:e.id,label:null!==(t=e?.title?.raw)&&void 0!==t?t:""};i.push(l)})),{presets:null===l?null:i}}),[]);if(!y.some((e=>"visibility_presets"===e.settingSlug&&e?.isActive)))return null;const k=null===(l=h?.plugin_settings?.enable_editor_notices)||void 0===l||l,{blockVisibility:E}=v,S=null!==(s=E?.visibilityPresets)&&void 0!==s?s:{},w=null!==(a=S?.presets)&&void 0!==a?a:[],C=null!==(c=S?.operator)&&void 0!==c?c:"all",O=null!==(d=S?.hideOnPresets)&&void 0!==d&&d,x=null!==(p=g?.current_users_roles)&&void 0!==p?p:[];let T=!1;if(Array.isArray(x)){const e=["super-admin","administrator","editor"];T=x.some((t=>e.includes(t)))}else T=!0;let P=[],N=(0,n.__)("Select Preset…","block-visibility"),R="";null===_?N=(0,n.__)("Loading Presets…","block-visibility"):(0,i.isEmpty)(_)?(N=(0,n.__)("No Presets Found…","block-visibility"),R=(0,n.__)("Add new preset","block-visibility")):(P=_.filter((e=>w.includes(e.value))),R=(0,n.__)("Manage presets","block-visibility"));const A=[{value:"atLeastOne",label:(0,n.__)("At least one selected preset applies","block-visibility")},{value:"all",label:(0,n.__)("All selected presets apply","block-visibility")},{value:"none",label:(0,n.__)("No selected presets apply","block-visibility")}];return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"controls-panel-item visibility-presets-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Visibility Presets","block-visibility")),k&&(0,t.createElement)(Se,{message:(0,n.__)("A Visibility Preset is a collection of visibility conditions that can be applied to any number of blocks. This allows you to independently configure and manage the visibility of multiple blocks at once.","block-visibility"),link:ee.editorVisibilityPresets,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},null===_&&(0,t.createElement)(u.Spinner,null),R&&T&&(0,t.createElement)(u.Button,{icon:(0,i.isEmpty)(_)?z:uo,onClick:()=>m(!0),label:R,isSmall:!0}))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"control-fields-item__label"},(0,n.sprintf)( +(0,n.__)("%s the selected users.","block-visibility"),h)),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:f,value:y,placeholder:(0,n.__)("Select Users…","block-visibility"),onChange:e=>(e=>{const t=[];0!==e.length&&e.forEach((e=>{t.push(e.value)})),d("userRole",(0,i.assign)({...c},{restrictedUsers:t}))})(e),isMulti:!0,isLoading:0===f.length}),(0,t.createElement)("div",{className:"control-fields-item__hide-when"},(0,t.createElement)(u.ToggleControl,{label:(0,n.__)("Hide from selected users","block-visibility"),checked:m,onChange:()=>d("userRole",(0,i.assign)({...c},{hideOnRestrictedUsers:!m}))})))}function co(l){var o,r,s,a,c,d;const{settings:p,variables:b,enabledControls:m,setControlAtts:v,controlSetAtts:f}=l;if(!m.some((e=>"visibility_by_role"===e.settingSlug&&e.isActive)))return null;const y=null!==(o=f?.controls?.userRole)&&void 0!==o?o:{},h=null!==(r=y?.visibilityByRole)&&void 0!==r?r:"public",g=null!==(s=b?.plugin_variables.settings_url)&&void 0!==s?s:"",_=null===(a=p?.plugin_settings?.enable_editor_notices)||void 0===a||a,k=$n(p,"visibility_by_role","enable_user_roles"),E=$n(p,"visibility_by_role","enable_users"),S=$n(p,"visibility_by_role","enable_user_rule_sets");let w=[{label:(0,n.__)("Public","block-visibility"),value:"public"},{label:(0,n.__)("Logged-out","block-visibility"),value:"logged-out"},{label:(0,n.__)("Logged-in","block-visibility"),value:"logged-in"},{label:(0,n.__)("User roles","block-visibility"),value:"user-role"},{label:(0,n.__)("Users","block-visibility"),value:"users"},{label:(0,n.__)("User rule sets","block-visibility"),value:"user-rule-sets"}];const C=[{label:(0,n.__)("Block is visible to everyone.","block-visibility"),value:"public"},{label:(0,n.__)("Block is only visible to logged-out users.","block-visibility"),value:"logged-out"},{label:(0,n.__)("Block is only visible to logged-in users.","block-visibility"),value:"logged-in"}];k||(w=w.filter((e=>"user-role"!==e.value))),E||(w=w.filter((e=>"users"!==e.value))),S||(w=w.filter((e=>"user-rule-sets"!==e.value)));const O=w.filter((e=>e.value===h)),x=null!==(c=C.filter((e=>e.value===h))[0]?.label)&&void 0!==c?c:"",T=S&&"user-rule-sets"===h,P=null!==(d=y?.ruleSets)&&void 0!==d?d:[];return 0===P.length&&P.push({enable:!0,rules:[{field:""}]}),(0,t.createElement)("div",{className:"controls-panel-item user-role-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("User Role","block-visibility")),_&&(0,t.createElement)(Se,{message:(0,n.__)("The User Role control allows you to configure block visibility based on the current user's role or specific users.","block-visibility"),link:ee.editorUserRole,position:"bottom center"}),T&&(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},(0,t.createElement)(u.Button,{icon:z,onClick:()=>(()=>{const e=[...P,{enable:!0,rules:[{field:""}]}];v("userRole",(0,i.assign)({...y},{ruleSets:[...e]}))})(),label:(0,n.__)("Add rule set","block-visibility"),isSmall:!0}))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:w,value:O,onChange:e=>v("userRole",(0,i.assign)({...y},{visibilityByRole:e.value}))}),_&&x&&(0,t.createElement)("div",{className:"control-fields-item__help"},x)),"user-role"===h&&k&&(0,t.createElement)(no,e({variables:b,userRole:y,setControlAtts:v,enableNotices:_},l)),"users"===h&&E&&(0,t.createElement)(ao,e({variables:b,userRole:y,setControlAtts:v,enableNotices:_},l)),"user-rule-sets"===h&&S&&(0,t.createElement)(so,e({ruleSets:P,setControlAtts:v,userRole:y,variables:b,enableNotices:_},l)),!w.some((e=>e.value===h))&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,n.__)("The previously selected User Role option has been disabled. Choose another option or update the Visibility Control settings.","block-visibility"),{a:(0,t.createElement)("a",{href:g+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))))}const uo=(0,t.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(j.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));function po(e){var l,s,a,c,d,p;const[b,m]=(0,t.useState)(!1),{attributes:v,setAttributes:f,enabledControls:y,settings:h,variables:g}=e,{presets:_}=(0,o.useSelect)((e=>{const{getEntityRecords:t}=e(r.store),l=t("postType","visibility_preset",{per_page:-1}),i=[];return l&&0!==l.length&&l.forEach((e=>{var t;const l={value:e.id,label:null!==(t=e?.title?.raw)&&void 0!==t?t:""};i.push(l)})),{presets:null===l?null:i}}),[]);if(!y.some((e=>"visibility_presets"===e.settingSlug&&e?.isActive)))return null;const k=null===(l=h?.plugin_settings?.enable_editor_notices)||void 0===l||l,{blockVisibility:E}=v,S=null!==(s=E?.visibilityPresets)&&void 0!==s?s:{},w=null!==(a=S?.presets)&&void 0!==a?a:[],C=null!==(c=S?.operator)&&void 0!==c?c:"all",O=null!==(d=S?.hideOnPresets)&&void 0!==d&&d,x=null!==(p=g?.current_users_roles)&&void 0!==p?p:[];let T=!1;if(Array.isArray(x)){const e=["super-admin","administrator","editor"];T=x.some((t=>e.includes(t)))}else T=!0;let P=[],N=(0,n.__)("Select Preset…","block-visibility"),A="";null===_?N=(0,n.__)("Loading Presets…","block-visibility"):(0,i.isEmpty)(_)?(N=(0,n.__)("No Presets Found…","block-visibility"),A=(0,n.__)("Add new preset","block-visibility")):(P=_.filter((e=>w.includes(e.value))),A=(0,n.__)("Manage presets","block-visibility"));const R=[{value:"atLeastOne",label:(0,n.__)("At least one selected preset applies","block-visibility")},{value:"all",label:(0,n.__)("All selected presets apply","block-visibility")},{value:"none",label:(0,n.__)("No selected presets apply","block-visibility")}];return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"controls-panel-item visibility-presets-control"},(0,t.createElement)("h3",{className:"controls-panel-item__header has-icon"},(0,t.createElement)("span",null,(0,n.__)("Visibility Presets","block-visibility")),k&&(0,t.createElement)(Se,{message:(0,n.__)("A Visibility Preset is a collection of visibility conditions that can be applied to any number of blocks. This allows you to independently configure and manage the visibility of multiple blocks at once.","block-visibility"),link:ee.editorVisibilityPresets,position:"bottom center"}),(0,t.createElement)("div",{className:"controls-panel-item__header-toolbar"},null===_&&(0,t.createElement)(u.Spinner,null),A&&T&&(0,t.createElement)(u.Button,{icon:(0,i.isEmpty)(_)?z:uo,onClick:()=>m(!0),label:A,isSmall:!0}))),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},(0,t.createElement)("div",{className:"control-fields-item__label"},(0,n.sprintf)( // Translators: Whether the block is hidden or visible. -(0,n.__)("%s the block if","block-visibility"),O?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"fields-container"},(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:A,value:A.filter((e=>e.value===C)),placeholder:(0,n.__)("Select Condition…","block-visibility"),onChange:e=>function(e){var t;const l=null!==(t=e?.value)&&void 0!==t?t:"all";f({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{operator:l})})})}(e)}),(0,t.createElement)(gn,{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)})),f({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{presets:t})})})}(e),isMulti:!0,isLoading:null===_,isDisabled:null===_||(0,i.isEmpty)(_)})),null!==_&&0===_.length&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("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,n.__)("Hide when presets apply","block-visibility"),checked:O,onChange:()=>f({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{hideOnPresets:!O})})})})))),b&&(0,t.createElement)(u.Modal,{className:"block-visibility__preset-manager-modal",title:(0,n.__)("Block Visibility Presets","block-visibility"),onRequestClose:()=>m(!1),shouldCloseOnClickOutside:!1,isFullScreen:!0},(0,t.createElement)(yo,null)))}function bo(e){var l,o,r,s,a,c,d,p,b;const{controlSetAtts:m,enabledControls:v,setControlAtts:f,settings:y,variables:h}=e,g=null!==(l=h?.integrations?.wp_fusion?.active)&&void 0!==l&&l;if(!v.some((e=>"wp_fusion"===e.settingSlug&&e?.isActive))||!g)return null;const _=null===(o=y?.plugin_settings?.enable_editor_notices)||void 0===o||o,k=null!==(r=m?.controls.hasOwnProperty("userRole"))&&void 0!==r&&r,E=null!==(s=m?.controls?.userRole?.visibilityByRole)&&void 0!==s?s:"public",S=null!==(a=h?.integrations?.wp_fusion?.tags)&&void 0!==a?a:[],w=e=>S.filter((t=>e.includes(t.value))),C=null!==(c=m?.controls?.wpFusion)&&void 0!==c?c:{},O=w(null!==(d=C?.tagsAny)&&void 0!==d?d:[]),x=w(null!==(p=C?.tagsAll)&&void 0!==p?p:[]),T=w(null!==(b=C?.tagsNot)&&void 0!==b?b:[]),P=(e,t)=>{const l=[];0!==t.length&&t.forEach((e=>{l.push(e.value)})),f("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,n.__)("Required Tags (Any)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:O,placeholder:(0,n.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsAny",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,n.__)("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,n.__)("Required Tags (All)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:x,placeholder:(0,n.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsAll",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,t.createInterpolateElement)((0,n.__)("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 R=(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)("div",{className:"components-base-control__label"},(0,t.createInterpolateElement)((0,n.__)("Required Tags (Not)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:T,placeholder:(0,n.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsNot",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,n.__)("Hide from logged-in users with at least one of the selected tags.","block-visibility")));return"logged-out"===E&&(R=(0,t.createElement)(u.Disabled,null,R)),(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)(q,{icon:I}),(0,t.createElement)("span",null,(0,n.__)("WP Fusion","block-visibility")),_&&(0,t.createElement)(Se,{message:(0,n.__)("The WP Fusion control allows you to configure block visibility based on WP Fusion tags.","block-visibility"),subMessage:(0,n.__)("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:ee.editorWpFusion,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},N,R,!k&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("The WP Fusion control works best in coordination with the User Role control, which has been disabled.","block-visibility"))))}const mo=(0,u.withFilters)("blockVisibility.addControlSetControls")((e=>(0,t.createElement)(t.Fragment,null)));function vo(l){var o;const{index:r,controlSetAtts:s,setControlSetAtts:a,enabledControls:c}=l,d=null===(o=s?.enable)||void 0===o||o,p="multiple-"+s?.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:s?.controls?.hasOwnProperty(e.attributeSlug)})}));const m=b.filter((e=>e.isActive));function v(e,t){var l;const n=null!==(l=s?.controls)&&void 0!==l?l:{},o=(0,i.assign)({...s},{controls:(0,i.assign)({...n},{[e]:t})});a(o)}let f=(0,t.createElement)("div",{className:"control-set__controls"},(0,t.createElement)(Mn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(Vn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(Zn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(Kn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(Jn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(eo,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(to,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(io,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(lo,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(co,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(u.Slot,{name:"ControlSetControls-"+p}),(0,t.createElement)(Rn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(bo,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(u.Slot,{name:"ControlSetControlsIntegrations-"+p}),(0,t.createElement)(u.Slot,{name:"ControlSetControlsBottom-"+p}));return d||(f=(0,t.createElement)(u.Disabled,null,f)),(0,t.createElement)("div",{className:"control-set"},(0,t.createElement)(pe,e({},l,{key:r,activeSetControls:m,enabledSetControls:b,setControlSetAtts:a})),m.length>0&&f,0===m.length&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("Add visibility controls using the plus icon in the toolbar above.","block-visibility")),(0,t.createElement)(mo,e({},l,{uniqueIndex:p,setControlAtts:v,enabledControls:b})))}function fo(l){var o,r,s;const{enabledControls:a,presetAttributes:c,setPresetAttributes:d,controlSets:p,setHasUpdates:m,variables:v}=l,f=null!==(o=v?.plugin_variables?.settings_url)&&void 0!==o?o:"",y=null!==(r=c?.layout)&&void 0!==r?r:"columns",h=null!==(s=c?.hideBlock)&&void 0!==s&&s;function g(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const l=[...p];let n;l.forEach(((t,l)=>{t.id===e.id&&(n=l)})),t?l.splice(n,1):(0,i.isUndefined)(n)?l.push(e):l[n]=e,d({...c,controlSets:[...l]}),m(!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,n.__)("Control Sets","block-visibility")),(0,t.createElement)(Se,{message:(0,n.__)("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,n.__)('Multiple control sets allow you to create "OR" conditions between each set.',"block-visibility"),link:ee.editorVisibilityPresets,position:"bottom center"})),(0,t.createElement)("div",{className:"control-sets__description"},(0,n.__)("Show the block if at least one control set applies.","block-visibility"))),a.length>0&&(0,t.createElement)("div",{className:"control-sets__container-outer"},(0,t.createElement)("div",{className:b()("control-sets__container",{"is-rows":"rows"===y})},p.map(((i,n)=>(0,t.createElement)("div",{key:n,className:"control-set__container"},[!h&&(0,t.createElement)(vo,e({key:n,index:n,controlSetAtts:i,setControlSetAtts:g},l)),h&&(0,t.createElement)("div",{className:"control-set__disabled"},(0,t.createElement)(u.Disabled,null,(0,t.createElement)(vo,e({key:n,index:n,controlSetAtts:i,setControlSetAtts:g},l))))]))),(0,t.createElement)("div",{className:"control-set__inserter-button"},(0,t.createElement)(u.Button,{label:(0,n.__)("Add control set","block-visibility"),icon:z,onClick:function(){const e={id:Math.max(...p.map((e=>e.id)),0)+1,enable:!0,controls:{}};d({...c,controlSets:[...p,e]}),m(!0)},isPrimary:!0,isSmall:!0})))),0===a.length&&(0,t.createElement)("div",{className:"control-sets__notices"},(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,n.__)("All visibility controls have been manually disabled. Visit the plugin settings to re-enable.","block-visibility"),{a:(0,t.createElement)("a",{href:f+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))))}function yo(){var e;const[l,r]=(0,t.useState)({}),[s,a]=(0,t.useState)(!1),{presets:c,settings:d,variables:p}=(0,o.useSelect)((e=>{var t;const{getEntityRecords:l,getEntityRecord:i}=e("core");return{presets:null!==(t=l("postType","visibility_preset",{per_page:-1,orderby:"modified"}))&&void 0!==t?t:"fetching",settings:i("block-visibility/v1","settings"),variables:i("block-visibility/v1","variables")}}),[]),b=L(d,p).filter((e=>"hideBlock"!==e.attributeSlug&&"visibilityPresets"!==e.attributeSlug));let m=null!==(e=l?.controlSets)&&void 0!==e?e:[];function v(){r({title:"",enable:!0}),a(!0)}return 0===m.length&&(m=[{id:1,enable:!0}]),(0,t.createElement)("div",{className:"preset-manager"},(0,t.createElement)(G,{presetAttributes:l,setPresetAttributes:r,presets:c,addNewPreset:v,hasUpdates:s,setHasUpdates:a}),(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:()=>v()},(0,n.__)("New preset","block-visibility")),(0,t.createElement)("p",null,[(0,i.isEmpty)(c)&&(0,n.__)("To get started, create a new visibility preset.","block-visibility"),!(0,i.isEmpty)(c)&&(0,n.__)("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)(te,{presetAttributes:l,setPresetAttributes:r,presets:c,controlSets:m,enabledControls:b,hasUpdates:s,setHasUpdates:a,settings:d,variables:p}),(0,t.createElement)(fo,{presetAttributes:l,setPresetAttributes:r,controlSets:m,enabledControls:b,setHasUpdates:a,settings:d,variables:p}))))}function ho(l){var o;const[r,s]=(0,t.useState)(!1),{activeControls:a,attributes:c,setAttributes:d,enabledControls:p,controlSetAtts:b,setControlSetAtts:m,settings:v}=l,f=null!==(o=c?.blockVisibility)&&void 0!==o?o:{},y=p.filter((e=>e.isDefault)),h=P(v,"enable_control_set_utilities");y.forEach((e=>{"hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug?e.hasEdits=f.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)({...f},[e.attributeSlug])}):d({blockVisibility:(0,i.assign)({...f},{[e.attributeSlug]:"hideBlock"!==e.attributeSlug&&{}})});else if("reset"===t)m((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]:{}}),m((0,i.assign)({...b},{controls:{...t}}))}}const E=[...y,...g,..._].some((e=>e.isActive&&!e.isDefault||e.isDefault&&e.hasEdits)),S=(0,t.createElement)(u.DropdownMenu,{className:"controls-dropdown",icon:0===a.length?z:$,label:(0,n.__)("Visibility Controls","block-visibility"),popoverProps:{className:"block-visibility__control-popover visibility-controls",focusOnMount:"container"},toggleProps:{isSmall:!0,disabled:0===p.length}},(i=>{let{onClose:o}=i;return(0,t.createElement)(t.Fragment,null,0!==y.length&&(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Defaults","block-visibility")},y.map(((e,l)=>(0,t.createElement)(_o,{key:l,control:e,toggleControls:k})))),(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Controls","block-visibility")},g.map(((e,l)=>(0,t.createElement)(go,{key:l,control:e,toggleControls:k})))),0!==_.length&&(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Integrations","block-visibility")},_.map(((e,l)=>(0,t.createElement)(go,{key:l,control:e,toggleControls:k})))),(0,t.createElement)(u.MenuGroup,null,h&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(ce,e({canResetAll:E},l)),(0,t.createElement)(ue,{modalOpen:r,onClose:o,setModalOpen:s})),(0,t.createElement)(u.MenuItem,{"aria-disabled":!E,onClick:()=>{E&&(d({blockVisibility:void 0}),(0,le.speak)((0,n.__)("All controls reset","block-visibility"),"assertive"))},variant:"tertiary"},(0,n.__)("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,n.__)("Visibility","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-header__dropdown-menus"},S)),r&&h&&(0,t.createElement)(de,e({coreControls:g,integrationControls:_,modalOpen:r,setModalOpen:s,toggleControls:k},l)))}function go(e){const{control:l,toggleControls:i}=e;return(0,t.createElement)(u.MenuItem,{key:l.attributeSlug,icon:l.isActive&&re,label:(0,n.sprintf)( +(0,n.__)("%s the block if","block-visibility"),O?(0,n.__)("Hide","block-visibility"):(0,n.__)("Show","block-visibility"))),(0,t.createElement)("div",{className:"fields-container"},(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:R,value:R.filter((e=>e.value===C)),placeholder:(0,n.__)("Select Condition…","block-visibility"),onChange:e=>function(e){var t;const l=null!==(t=e?.value)&&void 0!==t?t:"all";f({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{operator:l})})})}(e)}),(0,t.createElement)(gn,{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)})),f({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{presets:t})})})}(e),isMulti:!0,isLoading:null===_,isDisabled:null===_||(0,i.isEmpty)(_)})),null!==_&&0===_.length&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("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,n.__)("Hide when presets apply","block-visibility"),checked:O,onChange:()=>f({blockVisibility:(0,i.assign)({...E},{visibilityPresets:(0,i.assign)({...S},{hideOnPresets:!O})})})})))),b&&(0,t.createElement)(u.Modal,{className:"block-visibility__preset-manager-modal",title:(0,n.__)("Block Visibility Presets","block-visibility"),onRequestClose:()=>m(!1),shouldCloseOnClickOutside:!1,isFullScreen:!0},(0,t.createElement)(yo,null)))}function bo(e){var l,o,r,s,a,c,d,p,b;const{controlSetAtts:m,enabledControls:v,setControlAtts:f,settings:y,variables:h}=e,g=null!==(l=h?.integrations?.wp_fusion?.active)&&void 0!==l&&l;if(!v.some((e=>"wp_fusion"===e.settingSlug&&e?.isActive))||!g)return null;const _=null===(o=y?.plugin_settings?.enable_editor_notices)||void 0===o||o,k=null!==(r=m?.controls.hasOwnProperty("userRole"))&&void 0!==r&&r,E=null!==(s=m?.controls?.userRole?.visibilityByRole)&&void 0!==s?s:"public",S=null!==(a=h?.integrations?.wp_fusion?.tags)&&void 0!==a?a:[],w=e=>S.filter((t=>e.includes(t.value))),C=null!==(c=m?.controls?.wpFusion)&&void 0!==c?c:{},O=w(null!==(d=C?.tagsAny)&&void 0!==d?d:[]),x=w(null!==(p=C?.tagsAll)&&void 0!==p?p:[]),T=w(null!==(b=C?.tagsNot)&&void 0!==b?b:[]),P=(e,t)=>{const l=[];0!==t.length&&t.forEach((e=>{l.push(e.value)})),f("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,n.__)("Required Tags (Any)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:O,placeholder:(0,n.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsAny",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,n.__)("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,n.__)("Required Tags (All)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:x,placeholder:(0,n.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsAll",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,t.createInterpolateElement)((0,n.__)("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 A=(0,t.createElement)("div",{className:"control-fields-item"},(0,t.createElement)("div",{className:"components-base-control__label"},(0,t.createInterpolateElement)((0,n.__)("Required Tags (Not)","block-visibility"),{span:(0,t.createElement)("span",{className:"components-base-control__label-hint"})})),(0,t.createElement)(gn,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:S,value:T,placeholder:(0,n.__)("Select Tag…","block-visibility"),onChange:e=>P("tagsNot",e),isMulti:!0}),_&&(0,t.createElement)("div",{className:"components-base-control__help"},(0,n.__)("Hide from logged-in users with at least one of the selected tags.","block-visibility")));return"logged-out"===E&&(A=(0,t.createElement)(u.Disabled,null,A)),(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)(q,{icon:I}),(0,t.createElement)("span",null,(0,n.__)("WP Fusion","block-visibility")),_&&(0,t.createElement)(Se,{message:(0,n.__)("The WP Fusion control allows you to configure block visibility based on WP Fusion tags.","block-visibility"),subMessage:(0,n.__)("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:ee.editorWpFusion,position:"bottom center"})),(0,t.createElement)("div",{className:"controls-panel-item__control-fields"},N,A,!k&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("The WP Fusion control works best in coordination with the User Role control, which has been disabled.","block-visibility"))))}const mo=(0,u.withFilters)("blockVisibility.addControlSetControls")((e=>(0,t.createElement)(t.Fragment,null)));function vo(l){var o;const{index:r,controlSetAtts:s,setControlSetAtts:a,enabledControls:c}=l,d=null===(o=s?.enable)||void 0===o||o,p="multiple-"+s?.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:s?.controls?.hasOwnProperty(e.attributeSlug)})}));const m=b.filter((e=>e.isActive));function v(e,t){var l;const n=null!==(l=s?.controls)&&void 0!==l?l:{},o=(0,i.assign)({...s},{controls:(0,i.assign)({...n},{[e]:t})});a(o)}let f=(0,t.createElement)("div",{className:"control-set__controls"},(0,t.createElement)(Mn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(Vn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(Zn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(Kn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(Jn,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(eo,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(to,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(io,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(lo,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(co,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(u.Slot,{name:"ControlSetControls-"+p}),(0,t.createElement)(An,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(bo,e({},l,{enabledControls:b,setControlAtts:v})),(0,t.createElement)(u.Slot,{name:"ControlSetControlsIntegrations-"+p}),(0,t.createElement)(u.Slot,{name:"ControlSetControlsBottom-"+p}));return d||(f=(0,t.createElement)(u.Disabled,null,f)),(0,t.createElement)("div",{className:"control-set"},(0,t.createElement)(pe,e({},l,{key:r,activeSetControls:m,enabledSetControls:b,setControlSetAtts:a})),m.length>0&&f,0===m.length&&(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,n.__)("Add visibility controls using the plus icon in the toolbar above.","block-visibility")),(0,t.createElement)(mo,e({},l,{uniqueIndex:p,setControlAtts:v,enabledControls:b})))}function fo(l){var o,r,s;const{enabledControls:a,presetAttributes:c,setPresetAttributes:d,controlSets:p,setHasUpdates:m,variables:v}=l,f=null!==(o=v?.plugin_variables?.settings_url)&&void 0!==o?o:"",y=null!==(r=c?.layout)&&void 0!==r?r:"columns",h=null!==(s=c?.hideBlock)&&void 0!==s&&s;function g(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const l=[...p];let n;l.forEach(((t,l)=>{t.id===e.id&&(n=l)})),t?l.splice(n,1):(0,i.isUndefined)(n)?l.push(e):l[n]=e,d({...c,controlSets:[...l]}),m(!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,n.__)("Control Sets","block-visibility")),(0,t.createElement)(Se,{message:(0,n.__)("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,n.__)('Multiple control sets allow you to create "OR" conditions between each set.',"block-visibility"),link:ee.editorVisibilityPresets,position:"bottom center"})),(0,t.createElement)("div",{className:"control-sets__description"},(0,n.__)("Show the block if at least one control set applies.","block-visibility"))),a.length>0&&(0,t.createElement)("div",{className:"control-sets__container-outer"},(0,t.createElement)("div",{className:b()("control-sets__container",{"is-rows":"rows"===y})},p.map(((i,n)=>(0,t.createElement)("div",{key:n,className:"control-set__container"},[!h&&(0,t.createElement)(vo,e({key:n,index:n,controlSetAtts:i,setControlSetAtts:g},l)),h&&(0,t.createElement)("div",{className:"control-set__disabled"},(0,t.createElement)(u.Disabled,null,(0,t.createElement)(vo,e({key:n,index:n,controlSetAtts:i,setControlSetAtts:g},l))))]))),(0,t.createElement)("div",{className:"control-set__inserter-button"},(0,t.createElement)(u.Button,{label:(0,n.__)("Add control set","block-visibility"),icon:z,onClick:function(){const e={id:Math.max(...p.map((e=>e.id)),0)+1,enable:!0,controls:{}};d({...c,controlSets:[...p,e]}),m(!0)},isPrimary:!0,isSmall:!0})))),0===a.length&&(0,t.createElement)("div",{className:"control-sets__notices"},(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,n.__)("All visibility controls have been manually disabled. Visit the plugin settings to re-enable.","block-visibility"),{a:(0,t.createElement)("a",{href:f+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))))}function yo(){var e;const[l,r]=(0,t.useState)({}),[s,a]=(0,t.useState)(!1),{presets:c,settings:d,variables:p}=(0,o.useSelect)((e=>{var t;const{getEntityRecords:l,getEntityRecord:i}=e("core");return{presets:null!==(t=l("postType","visibility_preset",{per_page:-1,orderby:"modified"}))&&void 0!==t?t:"fetching",settings:i("block-visibility/v1","settings"),variables:i("block-visibility/v1","variables")}}),[]),b=L(d,p).filter((e=>"hideBlock"!==e.attributeSlug&&"visibilityPresets"!==e.attributeSlug));let m=null!==(e=l?.controlSets)&&void 0!==e?e:[];function v(){r({title:"",enable:!0}),a(!0)}return 0===m.length&&(m=[{id:1,enable:!0}]),(0,t.createElement)("div",{className:"preset-manager"},(0,t.createElement)(G,{presetAttributes:l,setPresetAttributes:r,presets:c,addNewPreset:v,hasUpdates:s,setHasUpdates:a}),(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:()=>v()},(0,n.__)("New preset","block-visibility")),(0,t.createElement)("p",null,[(0,i.isEmpty)(c)&&(0,n.__)("To get started, create a new visibility preset.","block-visibility"),!(0,i.isEmpty)(c)&&(0,n.__)("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)(te,{presetAttributes:l,setPresetAttributes:r,presets:c,controlSets:m,enabledControls:b,hasUpdates:s,setHasUpdates:a,settings:d,variables:p}),(0,t.createElement)(fo,{presetAttributes:l,setPresetAttributes:r,controlSets:m,enabledControls:b,setHasUpdates:a,settings:d,variables:p}))))}function ho(l){var o;const[r,s]=(0,t.useState)(!1),{activeControls:a,attributes:c,setAttributes:d,enabledControls:p,controlSetAtts:b,setControlSetAtts:m,settings:v}=l,f=null!==(o=c?.blockVisibility)&&void 0!==o?o:{},y=p.filter((e=>e.isDefault)),h=P(v,"enable_control_set_utilities");y.forEach((e=>{"hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug?e.hasEdits=f.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)({...f},[e.attributeSlug])}):d({blockVisibility:(0,i.assign)({...f},{[e.attributeSlug]:"hideBlock"!==e.attributeSlug&&{}})});else if("reset"===t)m((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]:{}}),m((0,i.assign)({...b},{controls:{...t}}))}}const E=[...y,...g,..._].some((e=>e.isActive&&!e.isDefault||e.isDefault&&e.hasEdits)),S=(0,t.createElement)(u.DropdownMenu,{className:"controls-dropdown",icon:0===a.length?z:$,label:(0,n.__)("Visibility Controls","block-visibility"),popoverProps:{className:"block-visibility__control-popover visibility-controls",focusOnMount:"container"},toggleProps:{isSmall:!0,disabled:0===p.length}},(i=>{let{onClose:o}=i;return(0,t.createElement)(t.Fragment,null,0!==y.length&&(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Defaults","block-visibility")},y.map(((e,l)=>(0,t.createElement)(_o,{key:l,control:e,toggleControls:k})))),(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Controls","block-visibility")},g.map(((e,l)=>(0,t.createElement)(go,{key:l,control:e,toggleControls:k})))),0!==_.length&&(0,t.createElement)(u.MenuGroup,{label:(0,n.__)("Integrations","block-visibility")},_.map(((e,l)=>(0,t.createElement)(go,{key:l,control:e,toggleControls:k})))),(0,t.createElement)(u.MenuGroup,null,h&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(ce,e({canResetAll:E},l)),(0,t.createElement)(ue,{modalOpen:r,onClose:o,setModalOpen:s})),(0,t.createElement)(u.MenuItem,{"aria-disabled":!E,onClick:()=>{E&&(d({blockVisibility:void 0}),(0,le.speak)((0,n.__)("All controls reset","block-visibility"),"assertive"))},variant:"tertiary"},(0,n.__)("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,n.__)("Visibility","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-header__dropdown-menus"},S)),r&&h&&(0,t.createElement)(de,e({coreControls:g,integrationControls:_,modalOpen:r,setModalOpen:s,toggleControls:k},l)))}function go(e){const{control:l,toggleControls:i}=e;return(0,t.createElement)(u.MenuItem,{key:l.attributeSlug,icon:l.isActive&&re,label:(0,n.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". (0,n.__)("Toggle %s","block-visibility"),l.label),onClick:()=>{i(l),(0,le.speak)((0,n.sprintf)( // translators: %s: The name of the control being toggled e.g. "Hide Block". @@ -44,4 +44,4 @@ // translators: %s: The name of the control being reset e.g. "Hide Block". (0,n.__)("Reset %s","block-visibility"),l.label),onClick:()=>{i(l,"reset"),(0,le.speak)((0,n.sprintf)( // translators: %s: The name of the control being reset e.g. "Hide Block". -(0,n.__)("%s reset to default","block-visibility"),l.label),"assertive")},role:"menuitem"},l.icon&&(0,t.createElement)(q,{className:"control-branding-icon",icon:l.icon}),l.label,l.hasEdits&&(0,t.createElement)("span",{"aria-hidden":"true",className:"menu-item-reset"},(0,n.__)("Reset","block-visibility"))):(0,t.createElement)(u.MenuItem,{"aria-disabled":!0,isSelected:!0,key:l.attributeSlug,role:"menuitemcheckbox"},l.icon&&(0,t.createElement)(q,{className:"control-branding-icon",icon:l.icon}),l.label)}const ko=(0,u.withFilters)("blockVisibility.addControlSetControls")((e=>(0,t.createElement)(t.Fragment,null)));function Eo(l){var o,r;const{attributes:s,controlSetAtts:a,setControlSetAtts:c,enabledControls:d,variables:p}=l,b=null!==(o=s?.blockVisibility)&&void 0!==o?o:{},m=null!==(r=p?.plugin_variables?.settings_url)&&void 0!==r?r:"",v="inspector-controls-panel";d.forEach((e=>{(b?.hasOwnProperty(e.attributeSlug)||a?.controls.hasOwnProperty(e.attributeSlug)||e?.isDefault)&&(e.isActive=!0)}));const f=d.filter((e=>e.isActive));function y(e,t){var l;const n=null!==(l=a?.controls)&&void 0!==l?l:{},o=(0,i.assign)({...a},{controls:(0,i.assign)({...n},{[e]:t})});c(o)}let h=(0,t.createElement)(t.Fragment,null,(0,t.createElement)(po,l),(0,t.createElement)(Mn,e({setControlAtts:y},l)),(0,t.createElement)(Vn,e({setControlAtts:y},l)),(0,t.createElement)(Zn,e({setControlAtts:y},l)),(0,t.createElement)(Kn,e({setControlAtts:y},l)),(0,t.createElement)(Jn,e({setControlAtts:y},l)),(0,t.createElement)(eo,e({setControlAtts:y},l)),(0,t.createElement)(to,e({setControlAtts:y},l)),(0,t.createElement)(io,e({setControlAtts:y},l)),(0,t.createElement)(lo,e({setControlAtts:y},l)),(0,t.createElement)(co,e({setControlAtts:y},l)),(0,t.createElement)(u.Slot,{name:"ControlSetControls-"+v}),(0,t.createElement)(Rn,e({setControlAtts:y},l)),(0,t.createElement)(bo,e({setControlAtts:y},l)),(0,t.createElement)(u.Slot,{name:"ControlSetControlsIntegrations-"+v}),(0,t.createElement)(u.Slot,{name:"ControlSetControlsBottom-"+v}));return b?.hideBlock&&(h=f.length>1?(0,t.createElement)(u.Disabled,{className:"hide-block-enabled"},h):null),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(ho,e({activeControls:f,enabledControls:d,setControlSetAtts:c},l)),0!==f.length&&(0,t.createElement)("div",{className:"controls-panel-container"},(0,t.createElement)(Yn,l),h,(0,t.createElement)(ko,e({uniqueIndex:v,setControlAtts:y},l))),0===d.length&&(0,t.createElement)("div",{className:"controls-panel-notices"},(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,n.__)("All visibility controls have been manually disabled. Visit the plugin settings to re-enable.","block-visibility"),{a:(0,t.createElement)("a",{href:m+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))))}const So=(0,u.withFilters)("blockVisibility.addInspectorControls")((e=>(0,t.createElement)(t.Fragment,null))),wo=(0,o.withSelect)((e=>{var t,l;const{getEntityRecord:i}=e("core"),{getBlocks:n}=e("core/block-editor"),o=null!==(t=i("block-visibility/v1","settings"))&&void 0!==t?t:"fetching";let r=null!==(l=i("block-visibility/v1","variables"))&&void 0!==l?l:"fetching";const s=n().filter((e=>"core/widget-area"===e.name));return"fetching"!==r&&(r={...r,isWidgetEditor:s.length>0}),{settings:o,variables:r}}))((function(l){var o,r,s;const{attributes:a,globallyRestricted:c,name:d,setAttributes:p,settings:b,variables:m,widgetAreaRestricted:v}=l;if("fetching"===b||"fetching"===m)return(0,t.createElement)(H.InspectorControls,{group:"settings"},(0,t.createElement)("div",{className:"block-visibility__controls-panel"},(0,t.createElement)("div",{className:"controls-panel-header"},(0,t.createElement)("h2",null,(0,n.__)("Visibility","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-header__dropdown-menus"},(0,t.createElement)(u.Spinner,null)))));if(v.includes(d)&&m?.isWidgetEditor||c.includes(d))return null;if(!B(b,m)||!x(b,d))return null;let f=L(b,m);const y=null!==(o=b?.plugin_settings?.default_controls)&&void 0!==o?o:[],h=[];(0,i.isEmpty)(y)||f.forEach((e=>{y.includes(e.settingSlug)&&h.push[e.attributeSlug]}));let g=a?.blockVisibility,_=null!==(r=g?.controlSets)&&void 0!==r?r:[];return 0===_.length&&(_=[{id:1,enable:!0,controls:Object.fromEntries(h.map((e=>[e,{}])))}],g=(0,i.assign)({...g},{controlSets:_})),null===(s=b?.visibility_controls?.general?.enable_local_controls)||void 0===s||s||(f=f.filter((e=>"hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug))),(0,t.createElement)(H.InspectorControls,{group:"settings"},(0,t.createElement)("div",{className:"block-visibility__controls-panel"},(0,t.createElement)(Eo,e({blockAtts:g,controlSets:_,controlSetAtts:_[0],setControlSetAtts:function(e){p({blockVisibility:(0,i.assign)({...a.blockVisibility},{controlSets:[e]})})},enabledControls:f,defaultControls:h},l))),(0,t.createElement)(So,e({blockAtts:g,enabledControls:f},l)))})),Co={hideBlock:{type:"boolean"},controlSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},controls:{type:"object",properties:{browserDevice:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},operator:{type:"string"},value:{type:"string"}}}}}}}}},cookie:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},dateTime:{type:"object",properties:{schedules:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},start:{type:"string"},end:{type:"string"},dayOfWeek:{type:"object",properties:{enable:{type:"boolean"},days:{type:"array",items:{type:"string"}}}},timeOfDay:{type:"object",properties:{enable:{type:"boolean"},intervals:{type:"array",items:{type:"object",properties:{start:{type:"string"},end:{type:"string"}}}}}}}}},hideOnSchedules:{type:"boolean"}}},location:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},subFields:{type:"object"},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},metadata:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},queryString:{type:"object",properties:{enable:{type:"boolean"},queryStringAny:{type:"string"},queryStringAll:{type:"string"},queryStringNot:{type:"string"}}},referralSource:{type:"object",properties:{enable:{type:"boolean"},contains:{type:"string"},doesNotContain:{type:"string"},showIfNoReferral:{type:"boolean"}}},screenSize:{type:"object",properties:{enable:{type:"boolean"},hideOnScreenSize:{type:"object",properties:{extraLarge:{type:"boolean"},large:{type:"boolean"},medium:{type:"boolean"},small:{type:"boolean"},extraSmall:{type:"boolean"}}}}},urlPath:{type:"object",properties:{enable:{type:"boolean"},contains:{type:"string"},doesNotContain:{type:"string"}}},userRole:{type:"object",properties:{enable:{type:"boolean"},visibilityByRole:{type:"string"},hideOnRestrictedRoles:{type:"boolean"},restrictedRoles:{type:"array",items:{type:"string"}},hideOnRestrictedUsers:{type:"boolean"},restrictedUsers:{type:"array",items:{type:"string"}},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},subFields:{type:"object"},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},visibilityPresets:{type:"object",properties:{enable:{type:"boolean"},hideOnPresets:{type:"boolean"},presets:{type:"array",items:{type:"string"}},operator:{type:"string"}}},acf:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:["array","object"],items:{type:"object",properties:{field:{type:"string"},operator:{type:"string"},value:{type:"string"}}},properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},wpFusion:{type:"object",properties:{enable:{type:"boolean"},tagsAny:{type:"array",items:{type:["number","string"]}},tagsAll:{type:"array",items:{type:["number","string"]}},tagsNot:{type:"array",items:{type:["number","string"]}}}}}}}}}};(0,o.dispatch)("core").addEntities([{label:(0,n.__)("Block Visibility Settings","block-visibility"),kind:"block-visibility/v1",name:"settings",baseURL:"/block-visibility/v1/settings"},{label:(0,n.__)("Block Visibility Variables","block-visibility"),kind:"block-visibility/v1",name:"variables",baseURL:"/block-visibility/v1/variables"}]);const Oo=(0,s.applyFilters)("blockVisibility.globallyRestrictedBlockTypes",["core/freeform","core/legacy-widget","core/widget-area"]),xo=(0,s.applyFilters)("blockVisibility.widgetAreaRestrictedBlockTypes",["core/html"]);(0,s.addFilter)("blocks.registerBlockType","block-visibility/add-attributes",(function(e){if(Oo.includes(e.name))return e;const t=blockVisibilityFullControlMode;let l={blockVisibility:{type:"object",properties:Co}};return l=(0,s.applyFilters)("blockVisibility.attributes",l),(t||(0,a.hasBlockSupport)(e,"inserter",!0)&&!e.hasOwnProperty("parent"))&&(e.attributes=(0,i.assign)(e.attributes,l),e.supports=(0,i.assign)(e.supports,{blockVisibility:!0})),e})),(0,s.addFilter)("editor.BlockEdit","block-visibility/add-inspector-controls",(function(l){return i=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(l,i),(0,t.createElement)(wo,e({globallyRestricted:Oo,widgetAreaRestricted:xo},i)))}),100),(0,c.registerPlugin)("block-visibility-toolbar-options-hide-block",{render:l=>(0,t.createElement)(U,e({globallyRestricted:Oo,widgetAreaRestricted:xo},l))}),(0,c.registerPlugin)("block-visibility-preset-manager",{render:function(){var e;const[l,i]=(0,t.useState)(!1),{variables:s}=(0,o.useSelect)((e=>{const{getEntityRecord:t}=e(r.store);return{variables:t("block-visibility/v1","variables")}}),[]),a=null!==(e=s?.current_users_roles)&&void 0!==e?e:[];let c=!1;if(Array.isArray(a)){const e=["super-admin","administrator","editor"];c=a.some((t=>e.includes(t)))}else c=!0;return c?"widgets"===pagenow?null:(0,t.createElement)(t.Fragment,null,(0,t.createElement)(d.PluginMoreMenuItem,{icon:N,onClick:()=>i(!0)},(0,n.__)("Block Visibility Presets","block-visibility")),l&&(0,t.createElement)(u.Modal,{className:"block-visibility__preset-manager-modal",title:(0,n.__)("Block Visibility Presets","block-visibility"),onRequestClose:()=>i(!1),shouldCloseOnClickOutside:!1,isFullScreen:!0},(0,t.createElement)(yo,null))):null}}),0!==(0,c.getPlugins)().filter((e=>"block-visibility-pro-preset-manager"===e.name)).length&&(0,c.unregisterPlugin)("block-visibility-pro-preset-manager")})()})(); \ No newline at end of file +(0,n.__)("%s reset to default","block-visibility"),l.label),"assertive")},role:"menuitem"},l.icon&&(0,t.createElement)(q,{className:"control-branding-icon",icon:l.icon}),l.label,l.hasEdits&&(0,t.createElement)("span",{"aria-hidden":"true",className:"menu-item-reset"},(0,n.__)("Reset","block-visibility"))):(0,t.createElement)(u.MenuItem,{"aria-disabled":!0,isSelected:!0,key:l.attributeSlug,role:"menuitemcheckbox"},l.icon&&(0,t.createElement)(q,{className:"control-branding-icon",icon:l.icon}),l.label)}const ko=(0,u.withFilters)("blockVisibility.addControlSetControls")((e=>(0,t.createElement)(t.Fragment,null)));function Eo(l){var o,r;const{attributes:s,controlSetAtts:a,setControlSetAtts:c,enabledControls:d,variables:p}=l,b=null!==(o=s?.blockVisibility)&&void 0!==o?o:{},m=null!==(r=p?.plugin_variables?.settings_url)&&void 0!==r?r:"",v="inspector-controls-panel";d.forEach((e=>{(b?.hasOwnProperty(e.attributeSlug)||a?.controls.hasOwnProperty(e.attributeSlug)||e?.isDefault)&&(e.isActive=!0)}));const f=d.filter((e=>e.isActive));function y(e,t){var l;const n=null!==(l=a?.controls)&&void 0!==l?l:{},o=(0,i.assign)({...a},{controls:(0,i.assign)({...n},{[e]:t})});c(o)}let h=(0,t.createElement)(t.Fragment,null,(0,t.createElement)(po,l),(0,t.createElement)(Mn,e({setControlAtts:y},l)),(0,t.createElement)(Vn,e({setControlAtts:y},l)),(0,t.createElement)(Zn,e({setControlAtts:y},l)),(0,t.createElement)(Kn,e({setControlAtts:y},l)),(0,t.createElement)(Jn,e({setControlAtts:y},l)),(0,t.createElement)(eo,e({setControlAtts:y},l)),(0,t.createElement)(to,e({setControlAtts:y},l)),(0,t.createElement)(io,e({setControlAtts:y},l)),(0,t.createElement)(lo,e({setControlAtts:y},l)),(0,t.createElement)(co,e({setControlAtts:y},l)),(0,t.createElement)(u.Slot,{name:"ControlSetControls-"+v}),(0,t.createElement)(An,e({setControlAtts:y},l)),(0,t.createElement)(bo,e({setControlAtts:y},l)),(0,t.createElement)(u.Slot,{name:"ControlSetControlsIntegrations-"+v}),(0,t.createElement)(u.Slot,{name:"ControlSetControlsBottom-"+v}));return b?.hideBlock&&(h=f.length>1?(0,t.createElement)(u.Disabled,{className:"hide-block-enabled"},h):null),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(ho,e({activeControls:f,enabledControls:d,setControlSetAtts:c},l)),0!==f.length&&(0,t.createElement)("div",{className:"controls-panel-container"},(0,t.createElement)(Yn,l),h,(0,t.createElement)(ko,e({uniqueIndex:v,setControlAtts:y},l))),0===d.length&&(0,t.createElement)("div",{className:"controls-panel-notices"},(0,t.createElement)(u.Notice,{status:"warning",isDismissible:!1},(0,t.createInterpolateElement)((0,n.__)("All visibility controls have been manually disabled. Visit the plugin settings to re-enable.","block-visibility"),{a:(0,t.createElement)("a",{href:m+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))))}const So=(0,u.withFilters)("blockVisibility.addInspectorControls")((e=>(0,t.createElement)(t.Fragment,null))),wo=(0,o.withSelect)((e=>{var t,l;const{getEntityRecord:i}=e("core"),{getBlocks:n}=e("core/block-editor"),o=null!==(t=i("block-visibility/v1","settings"))&&void 0!==t?t:"fetching";let r=null!==(l=i("block-visibility/v1","variables"))&&void 0!==l?l:"fetching";const s=n().filter((e=>"core/widget-area"===e.name));return"fetching"!==r&&(r={...r,isWidgetEditor:s.length>0}),{settings:o,variables:r}}))((function(l){var o,r,s;const{attributes:a,globallyRestricted:c,name:d,setAttributes:p,settings:b,variables:m,widgetAreaRestricted:v}=l;if("fetching"===b||"fetching"===m)return(0,t.createElement)(H.InspectorControls,{group:"settings"},(0,t.createElement)("div",{className:"block-visibility__controls-panel"},(0,t.createElement)("div",{className:"controls-panel-header"},(0,t.createElement)("h2",null,(0,n.__)("Visibility","block-visibility")),(0,t.createElement)("div",{className:"controls-panel-header__dropdown-menus"},(0,t.createElement)(u.Spinner,null)))));if(v.includes(d)&&m?.isWidgetEditor||c.includes(d))return null;if(!B(b,m)||!x(b,d))return null;let f=L(b,m);const y=null!==(o=b?.plugin_settings?.default_controls)&&void 0!==o?o:[],h=[];(0,i.isEmpty)(y)||f.forEach((e=>{y.includes(e.settingSlug)&&h.push[e.attributeSlug]}));let g=a?.blockVisibility,_=null!==(r=g?.controlSets)&&void 0!==r?r:[];return 0===_.length&&(_=[{id:1,enable:!0,controls:Object.fromEntries(h.map((e=>[e,{}])))}],g=(0,i.assign)({...g},{controlSets:_})),null===(s=b?.visibility_controls?.general?.enable_local_controls)||void 0===s||s||(f=f.filter((e=>"hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug))),(0,t.createElement)(H.InspectorControls,{group:"settings"},(0,t.createElement)("div",{className:"block-visibility__controls-panel"},(0,t.createElement)(Eo,e({blockAtts:g,controlSets:_,controlSetAtts:_[0],setControlSetAtts:function(e){p({blockVisibility:(0,i.assign)({...a.blockVisibility},{controlSets:[e]})})},enabledControls:f,defaultControls:h},l))),(0,t.createElement)(So,e({blockAtts:g,enabledControls:f},l)))})),Co={hideBlock:{type:"boolean"},controlSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},controls:{type:"object",properties:{browserDevice:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},operator:{type:"string"},value:{type:"string"}}}}}}}}},cookie:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},dateTime:{type:"object",properties:{schedules:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},start:{type:"string"},end:{type:"string"},dayOfWeek:{type:"object",properties:{enable:{type:"boolean"},days:{type:"array",items:{type:"string"}}}},timeOfDay:{type:"object",properties:{enable:{type:"boolean"},intervals:{type:"array",items:{type:"object",properties:{start:{type:"string"},end:{type:"string"}}}}}}}}},hideOnSchedules:{type:"boolean"}}},location:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},subFields:{type:"object"},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},metadata:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},queryString:{type:"object",properties:{enable:{type:"boolean"},queryStringAny:{type:"string"},queryStringAll:{type:"string"},queryStringNot:{type:"string"}}},referralSource:{type:"object",properties:{enable:{type:"boolean"},contains:{type:"string"},doesNotContain:{type:"string"},showIfNoReferral:{type:"boolean"}}},screenSize:{type:"object",properties:{enable:{type:"boolean"},hideOnScreenSize:{type:"object",properties:{extraLarge:{type:"boolean"},large:{type:"boolean"},medium:{type:"boolean"},small:{type:"boolean"},extraSmall:{type:"boolean"}}}}},urlPath:{type:"object",properties:{enable:{type:"boolean"},contains:{type:"string"},doesNotContain:{type:"string"}}},userRole:{type:"object",properties:{enable:{type:"boolean"},visibilityByRole:{type:"string"},hideOnRestrictedRoles:{type:"boolean"},restrictedRoles:{type:"array",items:{type:"string"}},hideOnRestrictedUsers:{type:"boolean"},restrictedUsers:{type:"array",items:{type:"string"}},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},subFields:{type:"object"},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},visibilityPresets:{type:"object",properties:{enable:{type:"boolean"},hideOnPresets:{type:"boolean"},presets:{type:"array",items:{type:"string"}},operator:{type:"string"}}},acf:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:["array","object"],items:{type:"object",properties:{field:{type:"string"},operator:{type:"string"},value:{type:"string"}}},properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},wpFusion:{type:"object",properties:{enable:{type:"boolean"},tagsAny:{type:"array",items:{type:["number","string"]}},tagsAll:{type:"array",items:{type:["number","string"]}},tagsNot:{type:"array",items:{type:["number","string"]}}}}}}}}}};(0,o.dispatch)("core").addEntities([{label:(0,n.__)("Block Visibility Settings","block-visibility"),kind:"block-visibility/v1",name:"settings",baseURL:"/block-visibility/v1/settings"},{label:(0,n.__)("Block Visibility Variables","block-visibility"),kind:"block-visibility/v1",name:"variables",baseURL:"/block-visibility/v1/variables"}]);const Oo=(0,s.applyFilters)("blockVisibility.globallyRestrictedBlockTypes",["core/freeform","core/legacy-widget","core/widget-area"]),xo=(0,s.applyFilters)("blockVisibility.widgetAreaRestrictedBlockTypes",["core/html"]);(0,s.addFilter)("blocks.registerBlockType","block-visibility/add-attributes",(function(e){if(Oo.includes(e.name))return e;const t=blockVisibilityFullControlMode;let l={blockVisibility:{type:"object",properties:Co}};return l=(0,s.applyFilters)("blockVisibility.attributes",l),(t||(0,a.hasBlockSupport)(e,"inserter",!0)&&!e.hasOwnProperty("parent"))&&(e.attributes=(0,i.assign)(e.attributes,l),e.supports=(0,i.assign)(e.supports,{blockVisibility:!0})),e})),(0,s.addFilter)("editor.BlockEdit","block-visibility/add-inspector-controls",(function(l){return i=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(l,i),(0,t.createElement)(wo,e({globallyRestricted:Oo,widgetAreaRestricted:xo},i)))}),100),(0,c.registerPlugin)("block-visibility-toolbar-options-hide-block",{render:l=>(0,t.createElement)(U,e({globallyRestricted:Oo,widgetAreaRestricted:xo},l))}),(0,c.registerPlugin)("block-visibility-preset-manager",{render:function(){var e;const[l,i]=(0,t.useState)(!1),{variables:s}=(0,o.useSelect)((e=>{const{getEntityRecord:t}=e(r.store);return{variables:t("block-visibility/v1","variables")}}),[]),a=null!==(e=s?.current_users_roles)&&void 0!==e?e:[];let c=!1;if(Array.isArray(a)){const e=["super-admin","administrator","editor"];c=a.some((t=>e.includes(t)))}else c=!0;return c?"widgets"===pagenow?null:(0,t.createElement)(t.Fragment,null,(0,t.createElement)(d.PluginMoreMenuItem,{icon:N,onClick:()=>i(!0)},(0,n.__)("Block Visibility Presets","block-visibility")),l&&(0,t.createElement)(u.Modal,{className:"block-visibility__preset-manager-modal",title:(0,n.__)("Block Visibility Presets","block-visibility"),onRequestClose:()=>i(!1),shouldCloseOnClickOutside:!1,isFullScreen:!0},(0,t.createElement)(yo,null))):null}}),0!==(0,c.getPlugins)().filter((e=>"block-visibility-pro-preset-manager"===e.name)).length&&(0,c.unregisterPlugin)("block-visibility-pro-preset-manager")})()})(); \ No newline at end of file diff --git a/src/components/rule-sets/async-rule-fields/posts-select.js b/src/components/rule-sets/async-rule-fields/posts-select.js index 555b5385..1c59f6af 100644 --- a/src/components/rule-sets/async-rule-fields/posts-select.js +++ b/src/components/rule-sets/async-rule-fields/posts-select.js @@ -108,7 +108,7 @@ export default function PostsSelect( props ) { // selected values. Otherwise return an empty array. if ( value.length !== 0 && ! selectedValues ) { const selectedQuery = { - include: value.join( ',' ), + include: Array.isArray( value ) ? value.join( ',' ) : value, per_page: -1, status: 'publish,draft,private,pending', _fields: 'id,title,status',