File: /home/mdosdorg/public_html/wp-content/plugins/blocksy-companion/static/bundle/options.js
!function(){var t={251:function(t,e){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,n,o,r){var i,a,c=8*r-o-1,s=(1<<c)-1,l=s>>1,u=-7,f=n?r-1:0,p=n?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-u)-1,d>>=-u,u+=c;u>0;i=256*i+t[e+f],f+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=o;u>0;a=256*a+t[e+f],f+=p,u-=8);if(0===i)i=1-l;else{if(i===s)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,o),i-=l}return(d?-1:1)*a*Math.pow(2,i-o)},e.write=function(t,e,n,o,r,i){var a,c,s,l=8*i-r-1,u=(1<<l)-1,f=u>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=o?0:i-1,h=o?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+f>=1?p/s:p*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=u?(c=0,a=u):a+f>=1?(c=(e*s-1)*Math.pow(2,r),a+=f):(c=e*Math.pow(2,f-1)*Math.pow(2,r),a=0));r>=8;t[n+d]=255&c,d+=h,c/=256,r-=8);for(a=a<<r|c,l+=r;l>0;t[n+d]=255&a,d+=h,a/=256,l-=8);t[n+d-h]|=128*m}},287:function(t,e,n){"use strict";
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
const o=n(526),r=n(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=s,e.IS=50;const a=2147483647;function c(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return l(t,e,n)}function l(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|m(t,e);let o=c(n);const r=o.write(t,e);r!==n&&(o=o.slice(0,r));return o}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return d(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return d(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return s.from(o,e,n);const r=function(t){if(s.isBuffer(t)){const e=0|h(t.length),n=c(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||X(t.length)?c(0):p(t);if("Buffer"===t.type&&Array.isArray(t.data))return p(t.data)}(t);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return u(t),c(t<0?0:0|h(t))}function p(t){const e=t.length<0?0:0|h(t.length),n=c(e);for(let o=0;o<e;o+=1)n[o]=255&t[o];return n}function d(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let o;return o=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(o,s.prototype),o}function h(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function m(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(t).length;default:if(r)return o?-1:q(t).length;e=(""+e).toLowerCase(),r=!0}}function y(t,e,n){let o=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,n);case"utf8":case"utf-8":return B(this,e,n);case"ascii":return x(this,e,n);case"latin1":case"binary":return N(this,e,n);case"base64":return C(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function g(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function b(t,e,n,o,r){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=s.from(e,o)),s.isBuffer(e))return 0===e.length?-1:_(t,e,n,o,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):_(t,[e],n,o,r);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,o,r){let i,a=1,c=t.length,s=e.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(t.length<2||e.length<2)return-1;a=2,c/=2,s/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(r){let o=-1;for(i=n;i<c;i++)if(l(t,i)===l(e,-1===o?0:i-o)){if(-1===o&&(o=i),i-o+1===s)return o*a}else-1!==o&&(i-=i-o),o=-1}else for(n+s>c&&(n=c-s),i=n;i>=0;i--){let n=!0;for(let o=0;o<s;o++)if(l(t,i+o)!==l(e,o)){n=!1;break}if(n)return i}return-1}function v(t,e,n,o){n=Number(n)||0;const r=t.length-n;o?(o=Number(o))>r&&(o=r):o=r;const i=e.length;let a;for(o>i/2&&(o=i/2),a=0;a<o;++a){const o=parseInt(e.substr(2*a,2),16);if(X(o))return a;t[n+a]=o}return a}function w(t,e,n,o){return W(q(e,t.length-n),t,n,o)}function E(t,e,n,o){return W(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,o)}function O(t,e,n,o){return W(G(e),t,n,o)}function k(t,e,n,o){return W(function(t,e){let n,o,r;const i=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),o=n>>8,r=n%256,i.push(r),i.push(o);return i}(e,t.length-n),t,n,o)}function C(t,e,n){return 0===e&&n===t.length?o.fromByteArray(t):o.fromByteArray(t.slice(e,n))}function B(t,e,n){n=Math.min(t.length,n);const o=[];let r=e;for(;r<n;){const e=t[r];let i=null,a=e>239?4:e>223?3:e>191?2:1;if(r+a<=n){let n,o,c,s;switch(a){case 1:e<128&&(i=e);break;case 2:n=t[r+1],128==(192&n)&&(s=(31&e)<<6|63&n,s>127&&(i=s));break;case 3:n=t[r+1],o=t[r+2],128==(192&n)&&128==(192&o)&&(s=(15&e)<<12|(63&n)<<6|63&o,s>2047&&(s<55296||s>57343)&&(i=s));break;case 4:n=t[r+1],o=t[r+2],c=t[r+3],128==(192&n)&&128==(192&o)&&128==(192&c)&&(s=(15&e)<<18|(63&n)<<12|(63&o)<<6|63&c,s>65535&&s<1114112&&(i=s))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,o.push(i>>>10&1023|55296),i=56320|1023&i),o.push(i),r+=a}return function(t){const e=t.length;if(e<=j)return String.fromCharCode.apply(String,t);let n="",o=0;for(;o<e;)n+=String.fromCharCode.apply(String,t.slice(o,o+=j));return n}(o)}s.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,n){return l(t,e,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,n){return function(t,e,n){return u(t),t<=0?c(t):void 0!==e?"string"==typeof n?c(t).fill(e,n):c(t).fill(e):c(t)}(t,e,n)},s.allocUnsafe=function(t){return f(t)},s.allocUnsafeSlow=function(t){return f(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(J(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,o=e.length;for(let r=0,i=Math.min(n,o);r<i;++r)if(t[r]!==e[r]){n=t[r],o=e[r];break}return n<o?-1:o<n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const o=s.allocUnsafe(e);let r=0;for(n=0;n<t.length;++n){let e=t[n];if(J(e,Uint8Array))r+e.length>o.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(o,r)):Uint8Array.prototype.set.call(o,e,r);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(o,r)}r+=e.length}return o},s.byteLength=m,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},s.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},s.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},s.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?B(this,0,t):y.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){let t="";const n=e.IS;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,n,o,r){if(J(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===r&&(r=this.length),e<0||n>t.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&e>=n)return 0;if(o>=r)return-1;if(e>=n)return 1;if(this===t)return 0;let i=(r>>>=0)-(o>>>=0),a=(n>>>=0)-(e>>>=0);const c=Math.min(i,a),l=this.slice(o,r),u=t.slice(e,n);for(let t=0;t<c;++t)if(l[t]!==u[t]){i=l[t],a=u[t];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return b(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return b(this,t,e,n,!1)},s.prototype.write=function(t,e,n,o){if(void 0===e)o="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)o=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===o&&(o="utf8")):(o=n,n=void 0)}const r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let i=!1;for(;;)switch(o){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":case"latin1":case"binary":return E(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const j=4096;function x(t,e,n){let o="";n=Math.min(t.length,n);for(let r=e;r<n;++r)o+=String.fromCharCode(127&t[r]);return o}function N(t,e,n){let o="";n=Math.min(t.length,n);for(let r=e;r<n;++r)o+=String.fromCharCode(t[r]);return o}function S(t,e,n){const o=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>o)&&(n=o);let r="";for(let o=e;o<n;++o)r+=K[t[o]];return r}function P(t,e,n){const o=t.slice(e,n);let r="";for(let t=0;t<o.length-1;t+=2)r+=String.fromCharCode(o[t]+256*o[t+1]);return r}function A(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,n,o,r,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<i)throw new RangeError('"value" argument is out of bounds');if(n+o>t.length)throw new RangeError("Index out of range")}function I(t,e,n,o,r){$(e,o,r,t,n,7);let i=Number(e&BigInt(4294967295));t[n++]=i,i>>=8,t[n++]=i,i>>=8,t[n++]=i,i>>=8,t[n++]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,n}function D(t,e,n,o,r){$(e,o,r,t,n,7);let i=Number(e&BigInt(4294967295));t[n+7]=i,i>>=8,t[n+6]=i,i>>=8,t[n+5]=i,i>>=8,t[n+4]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=a,a>>=8,t[n+2]=a,a>>=8,t[n+1]=a,a>>=8,t[n]=a,n+8}function R(t,e,n,o,r,i){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,o,i){return e=+e,n>>>=0,i||R(t,0,n,4),r.write(t,e,n,o,23,4),n+4}function L(t,e,n,o,i){return e=+e,n>>>=0,i||R(t,0,n,8),r.write(t,e,n,o,52,8),n+8}s.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const o=this.subarray(t,e);return Object.setPrototypeOf(o,s.prototype),o},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);let o=this[t],r=1,i=0;for(;++i<e&&(r*=256);)o+=this[t+i]*r;return o},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);let o=this[t+--e],r=1;for(;e>0&&(r*=256);)o+=this[t+--e]*r;return o},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=Z(function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||V(t,this.length-8);const o=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,r=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(o)+(BigInt(r)<<BigInt(32))}),s.prototype.readBigUInt64BE=Z(function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||V(t,this.length-8);const o=e*2**24+65536*this[++t]+256*this[++t]+this[++t],r=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(o)<<BigInt(32))+BigInt(r)}),s.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);let o=this[t],r=1,i=0;for(;++i<e&&(r*=256);)o+=this[t+i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*e)),o},s.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);let o=e,r=1,i=this[t+--o];for(;o>0&&(r*=256);)i+=this[t+--o]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=Z(function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||V(t,this.length-8);const o=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),s.prototype.readBigInt64BE=Z(function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||V(t,this.length-8);const o=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(o)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)}),s.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),r.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),r.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),r.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),r.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,n,o){if(t=+t,e>>>=0,n>>>=0,!o){T(this,t,e,n,Math.pow(2,8*n)-1,0)}let r=1,i=0;for(this[e]=255&t;++i<n&&(r*=256);)this[e+i]=t/r&255;return e+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,n,o){if(t=+t,e>>>=0,n>>>=0,!o){T(this,t,e,n,Math.pow(2,8*n)-1,0)}let r=n-1,i=1;for(this[e+r]=255&t;--r>=0&&(i*=256);)this[e+r]=t/i&255;return e+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=Z(function(t,e=0){return I(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Z(function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e>>>=0,!o){const o=Math.pow(2,8*n-1);T(this,t,e,n,o-1,-o)}let r=0,i=1,a=0;for(this[e]=255&t;++r<n&&(i*=256);)t<0&&0===a&&0!==this[e+r-1]&&(a=1),this[e+r]=(t/i|0)-a&255;return e+n},s.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e>>>=0,!o){const o=Math.pow(2,8*n-1);T(this,t,e,n,o-1,-o)}let r=n-1,i=1,a=0;for(this[e+r]=255&t;--r>=0&&(i*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/i|0)-a&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=Z(function(t,e=0){return I(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Z(function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,o){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o<n&&(o=n),o===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e<o-n&&(o=t.length-e+n);const r=o-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,o):Uint8Array.prototype.set.call(t,this.subarray(n,o),e),r},s.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){const e=t.charCodeAt(0);("utf8"===o&&e<128||"latin1"===o)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let r;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(r=e;r<n;++r)this[r]=t;else{const i=s.isBuffer(t)?t:s.from(t,o),a=i.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(r=0;r<n-e;++r)this[r+e]=i[r%a]}return this};const z={};function M(t,e,n){z[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function F(t){let e="",n=t.length;const o="-"===t[0]?1:0;for(;n>=o+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function $(t,e,n,o,r,i){if(t>n||t<e){const o="bigint"==typeof e?"n":"";let r;throw r=i>3?0===e||e===BigInt(0)?`>= 0${o} and < 2${o} ** ${8*(i+1)}${o}`:`>= -(2${o} ** ${8*(i+1)-1}${o}) and < 2 ** ${8*(i+1)-1}${o}`:`>= ${e}${o} and <= ${n}${o}`,new z.ERR_OUT_OF_RANGE("value",r,t)}!function(t,e,n){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||V(e,t.length-(n+1))}(o,r,i)}function H(t,e){if("number"!=typeof t)throw new z.ERR_INVALID_ARG_TYPE(e,"number",t)}function V(t,e,n){if(Math.floor(t)!==t)throw H(t,n),new z.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),M("ERR_OUT_OF_RANGE",function(t,e,n){let o=`The value of "${t}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=F(String(n)):"bigint"==typeof n&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=F(r)),r+="n"),o+=` It must be ${e}. Received ${r}`,o},RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function q(t,e){let n;e=e||1/0;const o=t.length;let r=null;const i=[];for(let a=0;a<o;++a){if(n=t.charCodeAt(a),n>55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===o){(e-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function G(t){return o.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,n,o){let r;for(r=0;r<o&&!(r+n>=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const o=16*n;for(let r=0;r<16;++r)e[o+r]=t[n]+t[r]}return e}();function Z(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},486:function(t){"use strict";t.exports=window.React},523:function(t,e,n){var o=n(575);function r(t,e,n,o,i){var a=new Error(n,o,i);return a.name="UseFetchError",a.status=t,a.statusText=e,Object.setPrototypeOf(a,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(a,r),a}r.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(r,Error),t.exports=function(t,e,n){var i=(n&&n.depends||e&&e.depends||[]).reduce(function(t,e){return t||!e},!1);return o(!i&&function(t,e,n){return fetch(t,e).then(n&&n.formatter||e&&e.formatter||function(t){if(!t.ok)throw new r(t.status,t.statusText,"Fetch error");return t.json()})},t,e||{},n||{})}},526:function(t,e){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],o=e[1];return 3*(n+o)/4-o},e.toByteArray=function(t){var e,n,i=c(t),a=i[0],s=i[1],l=new r(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),u=0,f=s>0?a-4:a;for(n=0;n<f;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],l[u++]=e>>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,l[u++]=255&e);1===s&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},e.fromByteArray=function(t){for(var e,o=t.length,r=o%3,i=[],a=16383,c=0,s=o-r;c<s;c+=a)i.push(l(t,c,c+a>s?s:c+a));1===r?(e=t[o-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[o-2]<<8)+t[o-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=i[a],o[i.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function s(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function l(t,e,n){for(var o,r=[],i=e;i<n;i+=3)o=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),r.push(s(o));return r.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},575:function(t,e,n){var o=n(486),r=n(779);t.exports=function(t){var e=Array.prototype.slice.call(arguments,[1]),n=o.useState({isLoading:!!t});return o.useEffect(function(){t&&(!n[0].isLoading&&n[1]({data:n[0].data,isLoading:!0}),t.apply(null,e).then(function(t){n[1]({data:t,isLoading:!1})}).catch(function(t){n[1]({error:t,isLoading:!1})}))},r(e)),n[0]}},763:function(t,e){var n,o,r;
/*!
* php-unserialize-js JavaScript Library
* https://github.com/bd808/php-unserialize-js
*
* Copyright 2013 Bryan Davis and contributors
* Released under the MIT license
* http://www.opensource.org/licenses/MIT
*/!function(){"use strict";o=[],void 0===(r="function"==typeof(n=function(){return function(t){var e,n=0,o=[],r=0,i=function(){var e=t.indexOf(":",n),o=t.substring(n,e);return n=e+2,parseInt(o,10)},a=function(){var e=t.indexOf(";",n),o=t.substring(n,e);return n=e+1,parseInt(o,10)},c=function(){var t=a();return o[r++]=t,t},s=function(){var e=t.indexOf(";",n),i=t.substring(n,e);return n=e+1,i=parseFloat(i),o[r++]=i,i},l=function(){var e=t.indexOf(";",n),i=t.substring(n,e);return n=e+1,i="1"===i,o[r++]=i,i},u=function(e){e=void 0!==e?e:'"';for(var o,r,a=i(),c=0,s=0;s<a;)(o=t.charCodeAt(n+c++))<=127?s++:s+=o>2047?3:2;return t.charAt(n+c)!==e&&(c+=t.indexOf('"',n+c)-n-c),r=t.substring(n,n+c),n+=c+2,r},f=function(){var t=u();return o[r++]=t,t},p=function(){var e=t.charAt(n);return n+=2,e},d=function(){var t=p();switch(t){case"i":return a();case"s":return u();default:throw new Error("Unknown key type '"+t+"' at position "+(n-2))}},h=function(){var t,a,c,s,l,u=i(),f=[],p={},h=f,m=r++;o[m]=h;try{for(c=0;c<u;c++)if(t=d(),a=e(),h===f&&t+""==c+"")f.push(a);else{if(h!==p){for(s=0,l=f.length;s<l;s++)p[s]=f[s];h=p,o[m]=h}p[t]=a}}catch(t){throw t.state=h,t}return n++,h},m=function(t,e){var o,r,i;if("string"==typeof t&&"\0"===t.charAt(0)){if((i=t.indexOf("\0",1))>0)return o=t.substring(1,i),r=t.substr(i+1),"*"===o||e===o?r:o+"::"+r;var a="Expected two <NUL> characters in non-public property name '"+t+"' at position "+(n-t.length-2);throw new Error(a)}return t},y=function(){var t,a,c,s,l={},f=r++,p=u();o[f]=l,t=i();try{for(s=0;s<t;s++)a=m(d(),p),c=e(),l[a]=c}catch(t){throw t.state=l,t}return n++,l},g=function(){var t=u(),e=u("}");return n--,{__PHP_Incomplete_Class_Name:t,serialized:e}},b=function(){var t=a(),e=o[t-1];return o[r++]=e,e},_=function(){var t=a();return o[t-1]},v=function(){var t=null;return o[r++]=t,t};return(e=function(){var t=p();switch(t){case"i":return c();case"d":return s();case"b":return l();case"s":case"E":return f();case"a":return h();case"O":return y();case"C":return g();case"r":return b();case"R":return _();case"N":return v();default:throw new Error("Unknown type '"+t+"' at position "+(n-2))}})()}})?n.apply(e,o):n)||(t.exports=r)}()},779:function(t){t.exports=function t(){for(var e=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o instanceof Array)for(var r=0;r<o.length;r++)e=e.concat(t(o[r]));else if("undefined"!=typeof URL&&o instanceof URL)e=e.concat(o.toJSON());else if(o instanceof Object)for(var i=Object.keys(o),a=0;a<i.length;a++){var c=i[a];e=e.concat([c]).concat(t(o[c]))}else e=e.concat(o)}return e}},942:function(t,e){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=a(t,i(n)))}return t}function i(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return r.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var n in t)o.call(t,n)&&t[n]&&(e=a(e,n));return e}function a(t,e){return e?t?t+" "+e:t+e:t}t.exports?(r.default=r,t.exports=r):void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n)}()}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=window.wp.element,e=window.wp.components,o=window.wp.i18n,r=window.blocksyOptions;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==i(e)?e:e+""}function c(t,e,n){return(e=a(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=n(942),l=n.n(s);const u=["title","id","sub_ids"];function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var d=function(e=null){const{isAdvancedMode:n,remoteConditions:o,allLanguages:r}=(0,t.useContext)(P);let i=o;return{isAdvancedMode:n,allRules:i.reduce(function(t,{rules:e,title:n}){return[...t,...e.map(function(t){return p(p({},t),{},{group:n})})]},[]).reduce(function(t,n){let{title:o,id:r,sub_ids:i=[]}=n,a=function(t,e){if(null==t)return{};var n,o,r=function(t,e){if(null==t)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(-1!==e.indexOf(o))continue;n[o]=t[o]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)n=i[o],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(n,u);return[...t,p({key:e&&i.length>0&&i.find(function(t){return t.id===e.rule})?e.rule:r,value:o,sub_ids:i},a)]},[]),rulesToUse:i,allLanguages:r}};function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},h.apply(null,arguments)}function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var g=function({onChange:e,condition:n}){const[i,a]=(0,t.useState)("start"),c=(0,t.useRef)(),[s,u]=(0,t.useState)(!1),{styles:f,popoverProps:p}=(0,r.usePopoverMaker)({ref:c,defaultHeight:228,shouldCalculate:!0}),d=n.payload.start||new Date,m=n.payload.end||new Date;let g=[wp.date.format("j/n/Y",d),wp.date.format("j/n/Y",m)];return g[0]===g[1]&&(g=[wp.date.format(wp.date.getSettings().formats.time,d),wp.date.format(wp.date.getSettings().formats.time,m)]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.OutsideClickHandler,{className:"ct-select-input",wrapperProps:{ref:c,role:"combobox","aria-expanded":s,"aria-haspopup":"listbox",onClick:function(){u(!s)}},onOutsideClick:function(t){t.target.closest(".ct-select-dropdown")||u(!1)}},(0,t.createElement)("input",{value:g.join(" - "),onChange:function(){},readOnly:!0})),s&&(0,t.createPortal)((0,t.createElement)("div",h({className:l()("ct-select-dropdown ct-date-time-picker-dropdown",{"ct-fixed":!0})},p,{style:f}),(0,t.createElement)("div",{className:"ct-start-end-date-switcher components-button-group"},["start","end"].map(function(e){return(0,t.createElement)("button",{key:e,className:l()("components-button",{"is-primary":e===i}),onClick:function(){a(e)}},"start"===e?"Start Date":"Expiration Date")})),(0,t.createElement)(r.DateTimePicker,{value:(n.payload||{})[i]||new Date,onChange:function(t){"end"===i&&new Date(t).getTime()<(n.payload.start?new Date(n.payload.start).getTime():(new Date).getTime())&&(t=n.payload.start,alert((0,o.__)("The expiration date cannot be set earlier than the start date.","blocksy-companion"))),"start"===i&&new Date(t).getTime()>(n.payload.end?new Date(n.payload.end).getTime():(new Date).getTime())&&(n.payload.end=t),e(y(y({},n),{},{payload:y(y(y({},n.payload),n.payload.start?{}:{start:d}),{},{[i]:t})}))}})),document.body))},b=window.wp.date;function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var w=function({onChange:n,condition:i}){const a=(0,t.useRef)(),[c,s]=(0,t.useState)(!1),{styles:u,popoverProps:f}=(0,r.usePopoverMaker)({ref:a,defaultHeight:228,shouldCalculate:!0}),p={monday:!0,tuesday:!0,wednesday:!0,thursday:!0,friday:!0,saturday:!0,sunday:!0},d=Object.keys(p).filter(function(t){return(i.payload.days||p)[t]});let m="Only "+d.map(function(t){return function(t){return{monday:(0,o.__)("Mon","blocksy-companion"),tuesday:(0,o.__)("Tue","blocksy-companion"),wednesday:(0,o.__)("Wed","blocksy-companion"),thursday:(0,o.__)("Thu","blocksy-companion"),friday:(0,o.__)("Fri","blocksy-companion"),saturday:(0,o.__)("Sat","blocksy-companion"),sunday:(0,o.__)("Sun","blocksy-companion")}[t]}(t)}).join(", ");7===d.length&&(m=(0,o.__)("Every day","blocksy-companion")),2===d.length&&d.includes("saturday")&&d.includes("sunday")&&(m=(0,o.__)("Only weekends","blocksy-companion")),5!==d.length||d.includes("saturday")||d.includes("sunday")||(m=(0,o.__)("Only weekdays","blocksy-companion")),0===d.length&&(m=(0,o.__)("Never","blocksy-companion"));const y=i.payload.time_start||"00:00",g=i.payload.time_end||"23:59",_=new Date;_.setHours(y.split(":")[0]),_.setMinutes(y.split(":")[1],0,0);const w=new Date;w.setHours(g.split(":")[0]),w.setMinutes(g.split(":")[1],0,0);const E=(0,b.getSettings)(),O=/a(?!\\)/i.test(E.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.OutsideClickHandler,{className:"ct-select-input",wrapperProps:{ref:a,role:"combobox","aria-expanded":c,"aria-haspopup":"listbox",onClick:function(){s(!c)}},onOutsideClick:function(t){t.target.closest(".ct-select-dropdown")||s(!1)}},(0,t.createElement)("input",{value:m,onChange:function(){},readOnly:!0})),c&&(0,t.createPortal)((0,t.createElement)("div",h({className:l()("ct-select-dropdown ct-recurring-scheduling-dropdown",{"ct-fixed":!0})},f,{style:u}),(0,t.createElement)("div",{className:"ct-recurring-scheduling-days"},(0,t.createElement)("label",{className:"ct-label"},(0,o.__)("Recurring Days","blocksy-companion")),[{key:"monday",value:(0,o.__)("Monday","blocksy-companion")},{key:"tuesday",value:(0,o.__)("Tuesday","blocksy-companion")},{key:"wednesday",value:(0,o.__)("Wednesday","blocksy-companion")},{key:"thursday",value:(0,o.__)("Thursday","blocksy-companion")},{key:"friday",value:(0,o.__)("Friday","blocksy-companion")},{key:"saturday",value:(0,o.__)("Saturday","blocksy-companion")},{key:"sunday",value:(0,o.__)("Sunday","blocksy-companion")}].map(function({key:o,value:r}){return(0,t.createElement)(e.CheckboxControl,{label:r,checked:(i.payload.days||p)[o],onChange:function(){n(v(v({},i),{},{payload:v(v({},i.payload),{},{days:v(v({},i.payload.days||p),{},{[o]:!(i.payload.days||p)[o]})})}))}})})),(0,t.createElement)("div",{className:"ct-recurring-scheduling-time"},(0,t.createElement)("div",{className:"ct-recurring-start-time"},(0,t.createElement)("label",{className:"ct-label"},(0,o.__)("Start Time","blocksy-companion")),(0,t.createElement)(e.TimePicker,{is12Hour:O,currentTime:_,onChange:function(t){n(v(v({},i),{},{payload:v(v({},i.payload),{},{time_start:wp.date.format("H:i",t)})}))}})),(0,t.createElement)("div",{className:"ct-recurring-stop-time"},(0,t.createElement)("label",{className:"ct-label"},(0,o.__)("Stop Time","blocksy-companion")),(0,t.createElement)(e.TimePicker,{is12Hour:O,currentTime:w,onChange:function(t){n(v(v({},i),{},{payload:v(v({},i.payload),{},{time_end:wp.date.format("H:i",t)})}))}})))),document.body))};function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var k=function({className:e="",condition:n,onRemove:i,onChange:a}){n=O(O({},n),{},{payload:O({},n.payload)});const{allRules:c,allLanguages:s}=d(n),u=c.find(function({key:t}){return t===n.rule}),f="post_ids"===n.rule||"page_ids"===n.rule||"product_ids"===n.rule||"custom_post_type_ids"===n.rule||"taxonomy_ids"===n.rule||"post_with_taxonomy_ids"===n.rule||"card_product_with_taxonomy_ids"===n.rule||"card_post_with_taxonomy_ids"===n.rule||"product_with_taxonomy_ids"===n.rule||"product_taxonomy_ids"===n.rule||"current_language"===n.rule||"user_post_author_id"===n.rule||"author"===n.rule||"start_end_date"===n.rule||"schedule_date"===n.rule||"request_referer"===n.rule||"request_cookie"===n.rule||"request_url"===n.rule||u&&u.sub_ids&&u.sub_ids.length>0||u&&u.is_custom_rule&&u.has_text_field||u&&u.is_custom_rule&&u.choices;return(0,t.createElement)("div",{className:l()("ct-condition-group",e,{"ct-cols-3":f,"ct-cols-2":!f})},(0,t.createElement)(r.Select,{key:"first",option:{inputClassName:"ct-condition-type",selectInputStart:function(){return"include"===n.type?(0,t.createElement)("span",{className:"ct-include"},(0,t.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,t.createElement)("path",{d:"M20,11h-9v9H9v-9H0V9h9V0h2v9h9V11z"}))):"exclude"===n.type?(0,t.createElement)("span",{className:"ct-exclude"},(0,t.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,t.createElement)("path",{d:"M20,9v2H0V9H20z"}))):null},placeholder:(0,o.__)("Select variation","blocksy-companion"),choices:{include:(0,o.__)("Include","blocksy-companion"),exclude:(0,o.__)("Exclude","blocksy-companion")}},value:n.type,onChange:function(t){a(O(O({},n),{},{type:t}))}}),(0,t.createElement)(r.Select,{key:"second",option:{appendToBody:!0,placeholder:(0,o.__)("Select rule","blocksy-companion"),choices:c,search:!0},value:n.rule,onChange:function(t){const e=c.find(function({key:e}){return e===t});e.sub_ids&&e.sub_ids.length>0?a(O(O({},n),{},{rule:e.sub_ids[0].id})):a(O(O({},n),{},{rule:t}))}}),("post_ids"===n.rule||"custom_post_type_ids"===n.rule||"product_ids"===n.rule||"page_ids"===n.rule)&&(0,t.createElement)(r.EntityIdPicker,{option:{placeholder:"post_ids"===n.rule?(0,o.__)("Select post","blocksy-companion"):"page_ids"===n.rule?(0,o.__)("Select page","blocksy-companion"):"product_ids"===n.rule?(0,o.__)("Select product","blocksy-companion"):(0,o.__)("Custom Post Type ID","blocksy-companion"),entity:"posts",post_type:{post_ids:"post",page_ids:"page",product_ids:"product",custom_post_type_ids:"ct_cpt"}[n.rule]},value:(n.payload||{}).post_id||"",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{post_id:t})}))}}),("taxonomy_ids"===n.rule||"post_with_taxonomy_ids"===n.rule||"card_post_with_taxonomy_ids"===n.rule)&&(0,t.createElement)(r.EntityIdPicker,{option:{placeholder:(0,o.__)("Select taxonomy","blocksy-companion"),entity:"taxonomies"},value:(n.payload||{}).taxonomy_id||"",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{taxonomy_id:t})}))}}),("product_with_taxonomy_ids"===n.rule||"product_taxonomy_ids"===n.rule||"card_product_with_taxonomy_ids"===n.rule)&&(0,t.createElement)(r.EntityIdPicker,{option:{placeholder:(0,o.__)("Select taxonomy","blocksy-companion"),entity:"taxonomies",post_type:"product"},value:(n.payload||{}).taxonomy_id||"",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{taxonomy_id:t})}))}}),"current_language"===n.rule&&(0,t.createElement)(r.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:(0,o.__)("Select language","blocksy-companion"),choices:s.map(function(t){return{key:t.id,value:t.name}}),search:!0},value:(n.payload||{}).language||"",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{language:t})}))}}),"user_post_author_id"===n.rule&&(0,t.createElement)(r.EntityIdPicker,{option:{placeholder:(0,o.__)("Select user","blocksy-companion"),entity:"users",additionOptions:[{key:"current_user",value:(0,o.__)("Current user","blocksy-companion")}]},value:(n.payload||{}).user_id||"",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{user_id:t})}))}}),"author"===n.rule&&(0,t.createElement)(r.EntityIdPicker,{option:{placeholder:(0,o.__)("Select user","blocksy-companion"),entity:"users",additionOptions:[{key:"all_users",value:(0,o.__)("All authors","blocksy-companion")}]},value:(n.payload||{}).user_id||"all_users",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{user_id:t})}))}}),u&&u.sub_ids&&u.sub_ids.length>0&&(0,t.createElement)(r.Select,{option:{appendToBody:!0,placeholder:(0,o.__)("Select sub field","blocksy-companion"),choices:u.sub_ids.map(function(t){return{key:t.id,value:t.title}}),search:!0,inputClassName:"ct-dropdown-normal-width"},value:n.rule,onChange:function(t){a(O(O({},n),{},{rule:t}))}}),"start_end_date"===n.rule&&(0,t.createElement)(g,{condition:n,onChange:a}),"schedule_date"===n.rule&&(0,t.createElement)(w,{condition:n,onChange:a}),"request_referer"===n.rule&&(0,t.createElement)("div",{className:"ct-option-input"},(0,t.createElement)("input",{type:"text",placeholder:"website.com",value:n.payload.referer,onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{referer:t.target.value})}))}}),(0,t.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,t.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,t.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,t.createElement)("i",{className:"ct-tooltip"},(0,o.__)("Display based on referer domain","blocksy-companion")))),"request_cookie"===n.rule&&(0,t.createElement)("div",{className:"ct-option-input"},(0,t.createElement)("input",{type:"text",placeholder:"cookie_name",value:(n.payload||{}).cookie||"",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{cookie:t.target.value})}))}}),(0,t.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,t.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,t.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,t.createElement)("i",{className:"ct-tooltip"},(0,o.__)("Display if cookie is present","blocksy-companion")))),"request_url"===n.rule&&(0,t.createElement)("div",{className:"ct-option-input"},(0,t.createElement)("input",{type:"text",placeholder:"example=campaignID",value:n.payload.url||"",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{url:t.target.value})}))}}),(0,t.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,t.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,t.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,t.createElement)("i",{className:"ct-tooltip"},(0,o.__)("Display if query string is present in URL","blocksy-companion")))),u&&u.is_custom_rule&&u.has_text_field&&(0,t.createElement)("div",{className:"ct-option-input"},(0,t.createElement)("input",{type:"text",placeholder:"",value:n.payload.value||"",onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{value:t.target.value})}))}})),u&&u.is_custom_rule&&u.choices&&(0,t.createElement)(r.Select,{option:{appendToBody:!0,placeholder:(0,o.__)("Select value","blocksy-companion"),choices:u.choices,search:!0,inputClassName:"ct-dropdown-normal-width"},value:n.payload.value||u.choices[0].key,onChange:function(t){a(O(O({},n),{},{payload:O(O({},n.payload),{},{value:t})}))}}),(0,t.createElement)("button",{type:"button",className:"ct-remove-condition-group",onClick:function(t){t.preventDefault(),i()}},(0,t.createElement)("svg",{width:"7px",height:"7px",fill:"currentColor",viewBox:"0 0 24 24"},(0,t.createElement)("path",{d:"m12 14.7 9.3 9.3 2.7-2.7-9.3-9.3L24 2.7 21.3 0 12 9.3 2.7 0 0 2.7 9.3 12 0 21.3 2.7 24l9.3-9.3z"}))))};function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}const j=function({conditionsListDescriptor:e,onChange:n,extractRulesIntoRoot:o=null,className:r=""}){const[i,a]=(0,t.useState)(null),{rulesToUse:c,isAdvancedMode:s}=d();if(0===e.conditions.length)return null;const u=e.conditions.map(function(r,u){let f=null,p="";return i!==u&&i-1!==u||(p="ct-hovered"),r.relation&&(f=(0,t.createElement)(j,{className:p,key:u,conditionsListDescriptor:r,extractRulesIntoRoot:function(t){const o=[...r.conditions.slice(0,t-1),...r.conditions.slice(t+1)];n([...e.conditions.slice(0,u),...r.conditions.slice(t-1,t+1),...o.length>0?[B(B({},r),{},{conditions:o})]:[],...e.conditions.slice(u+1)])},onChange:function(t){0===t.length?n([...e.conditions.slice(0,u),...e.conditions.slice(u+1)]):n(e.conditions.map(function(e,n){return B({},n===u?B(B({},e),{},{conditions:t}):e)}))}})),r.relation||(f=(0,t.createElement)(k,{className:p,condition:r,onChange:function(t){n(e.conditions.map(function(e,n){return B({},n===u?t:e)}))},onAdd:function(){"OR"!==e.relation?n([...e.conditions,{type:"include",rule:c[0].rules[0].id,payload:{}}]):n(e.conditions.map(function(t,e){return B({},e===u?{relation:"AND",conditions:[t,{type:"include",rule:c[0].rules[0].id,payload:{}}]}:t)}))},onRemove:function(){n([...e.conditions.slice(0,u),...e.conditions.slice(u+1)])}})),(0,t.createElement)(t.Fragment,{key:u},s&&u>0&&(0,t.createElement)("div",{className:l()("ct-condition-relation",{"ct-hovered":i===u})},(0,t.createElement)("ul",{onMouseEnter:function(){a(u)},onMouseLeave:function(){a(null)}},"AND"===e.relation&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("li",{onClick:function(){o&&(a(null),o(u))}},(0,t.createElement)("span",null,"OR")),(0,t.createElement)("li",{className:"active"},(0,t.createElement)("span",null,"AND"))),"OR"===e.relation&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("li",{className:"active"},(0,t.createElement)("span",null,"OR")),(0,t.createElement)("li",{onClick:function(){a(null),n([...e.conditions.slice(0,u-1),{relation:"AND",conditions:e.conditions.slice(u-1,u+1).reduce(function(t,e){return[...t,...e.conditions?e.conditions:[e]]},[])},...e.conditions.slice(u+1,e.conditions.length)])}},(0,t.createElement)("span",null,"AND"))))),f)});return"OR"===e.relation&&1===e.conditions.length||!s?u:(0,t.createElement)("div",{className:l()("ct-relation-group",r),"data-relation":e.relation},u,"AND"===e.relation&&(0,t.createElement)("div",{className:"ct-condition-relation ct-add-and-relation"},(0,t.createElement)("span",{onClick:function(){n([...e.conditions,{type:"include",rule:c[0].rules[0].id,payload:{}}])}},(0,t.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,t.createElement)("path",{d:"M20,11h-9v9H9v-9H0V9h9V0h2v9h9V11z"})))))};var x=j;function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function S(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?N(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}const P=(0,t.createContext)({allLanguages:[],remoteConditions:[]});let A=[],T=[];var I=function({value:e,onChange:n,filter:i="all",addConditionButtonLabel:a}){const[c,s]=(0,t.useState)(A),[l,u]=(0,t.useState)(T),[f,p]=(0,t.useState)("__EMPTY__");(0,t.useEffect)(function(){fetch(`${wp.ajax.settings.url}?action=blc_retrieve_conditions_data&filter=${i}`,{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"}).then(function(t){return t.json()}).then(function({data:{languages:t,conditions:e}}){s(t),A=t,u(e),T=e})},[]);const d=Array.isArray(e)?{relation:"OR",conditions:e}:e;let h="__EMPTY__"!==f&&f;return d.conditions.find(function(t){return t.relation})&&(h=!0),(0,t.createElement)(P.Provider,{value:{allLanguages:c,remoteConditions:l,isAdvancedMode:h}},(0,t.createElement)("div",{className:"ct-display-conditions"},(0,t.createElement)(x,{conditionsListDescriptor:d,onChange:function(t){n(S(S({},d),{},{conditions:t}))}}),(0,t.createElement)("div",{className:"ct-conditions-actions"},(0,t.createElement)("button",{type:"button",className:"button add-condition",onClick:function(t){t.preventDefault(),0!==l.length&&n(S(S({},d),{},{conditions:[...d.conditions,{type:"include",rule:l[0].rules[0].id,payload:{}}]}))}},a),(d.conditions.length>1||d.conditions.find(function(t){return t.relation}))&&(0,t.createElement)("span",null,(0,o.__)("Advanced Mode","blocksy-companion"),(0,t.createElement)(r.Switch,{value:h,onChange:function(t){d.conditions.find(function(t){return t.relation})&&n(S(S({},d),{},{conditions:d.conditions.reduce(function(t,e){return[...t,...e.conditions?e.conditions:[e]]},[])})),p(t)},option:{behavior:"boolean"}})))))};var D=function({option:{display:e="inline",filter:n="all",modalTitle:i=(0,o.__)("Transparent Header Display Conditions","blocksy-companion"),modalDescription:a=(0,o.__)("Add one or more conditions to display the transparent header.","blocksy-companion"),addConditionButtonLabel:c=(0,o.__)("Add Display Condition","blocksy-companion")},value:s,onChange:l}){const[u,f]=(0,t.useState)(!1),[p,d]=(0,t.useState)(null);return"inline"===e?(0,t.createElement)(I,{filter:n,value:s,onChange:l,addConditionButtonLabel:c}):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(t){t.preventDefault(),f(!0),d(null)}},Object.keys(s).length>0?(0,o.__)("Edit Conditions","blocksy-companion"):(0,o.__)("Add Conditions","blocksy-companion")),(0,t.createElement)(r.Overlay,{items:u,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){f(!1),d(null)},render:function(){return(0,t.createElement)("div",{className:"ct-modal-content"},(0,t.createElement)("h2",null,i),(0,t.createElement)("p",null,a),(0,t.createElement)("div",{className:"ct-modal-scroll"},(0,t.createElement)(I,{filter:n,value:p||s,onChange:function(t){d(t)},addConditionButtonLabel:c})),(0,t.createElement)("div",{className:"ct-modal-actions has-divider"},(0,t.createElement)("button",{className:"button-primary",disabled:!p,onClick:function(){l(p),f(!1)}},(0,o.__)("Save Conditions","blocksy-companion"))))}}))},R="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0;function U(t,e,n){var o=new XMLHttpRequest;o.open("GET",t),o.responseType="blob",o.onload=function(){M(o.response,e,n)},o.onerror=function(){console.error("could not download file")},o.send()}function L(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function z(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var M="object"!=typeof window||window!==R?function(){}:"download"in HTMLAnchorElement.prototype?function(t,e,n){var o=R.URL||R.webkitURL,r=document.createElement("a");e=e||t.name||"download",r.download=e,r.rel="noopener","string"==typeof t?(r.href=t,r.origin!==location.origin?L(r.href)?U(t,e,n):z(r,r.target="_blank"):z(r)):(r.href=o.createObjectURL(t),setTimeout(function(){o.revokeObjectURL(r.href)},4e4),setTimeout(function(){z(r)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download","string"==typeof t)if(L(t))U(t,e,n);else{var o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){z(o)})}else navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,n),e)}:function(t,e,n,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return U(t,e,n);var r="application/octet-stream"===t.type,i=/constructor/i.test(R.HTMLElement)||R.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||r&&i)&&"object"==typeof FileReader){var c=new FileReader;c.onloadend=function(){var t=c.result;t=a?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},c.readAsDataURL(t)}else{var s=R.URL||R.webkitURL,l=s.createObjectURL(t);o?o.location=l:location.href=l,o=null,setTimeout(function(){s.revokeObjectURL(l)},4e4)}},F=M,$=n(763),H=n.n($),V=n(287).hp;const Y=function(){return new Promise(function(t){const e=new FormData;e.append("action","blocksy_customizer_wipe_caches"),e.append("wp_customize","on"),fetch(window.ajaxurl,{method:"POST",body:e}).then(function(e){200===e.status&&e.json().then(function({success:e,data:n}){t()})})})};var q=function(){const[e,n]=(0,t.useState)(null),[i,a]=(0,t.useState)(null),[c,s]=(0,t.useState)(!1),[u,f]=(0,t.useState)(!1),[p,d]=(0,t.useState)(!1),[h,m]=(0,t.useState)(["options"]),y=(0,t.useRef)(),g=(0,t.useRef)();return(0,t.useEffect)(function(){const t=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy",s(!0)},e=function(t){t.stopPropagation(),t.preventDefault(),s(!1)},o=function(t){t.stopPropagation(),t.preventDefault(),s(!1);const e=Array.from(t.dataTransfer.files||[]);if(Array.from(t.dataTransfer.items||[]).length>0){const e=t.dataTransfer.items[0].getAsFile();n(e)}else e.length>0&&n(e[0])};return g.current.addEventListener("dragover",t,!1),g.current.addEventListener("dragleave",e,!1),g.current.addEventListener("drop",o,!1),function(){g.current&&(g.current.removeEventListener("dragover",t,!1),g.current.removeEventListener("dragleave",e,!1),g.current.removeEventListener("drop",o,!1))}},[]),(0,t.createElement)("div",{className:"ct-import-export"},(0,t.createElement)("div",{className:"ct-title","data-type":"simple"},(0,t.createElement)("h3",null,(0,o.__)("Export Options","blocksy-companion")),(0,t.createElement)("div",{className:"ct-option-description"},(0,o.__)("Easily export the theme customizer settings.","blocksy-companion"))),(0,t.createElement)("div",{className:"ct-control","data-design":"block"},(0,t.createElement)("header",null),(0,t.createElement)("section",null,(0,t.createElement)("button",{className:"button-primary",onClick:function(t){t.preventDefault(),f(!0)}},(0,o.__)("Export Customizations","blocksy-companion")))),(0,t.createElement)("div",{className:"ct-title","data-type":"simple"},(0,t.createElement)("h3",null,(0,o.__)("Import Options","blocksy-companion")),(0,t.createElement)("div",{className:"ct-option-description"},(0,o.__)("Easily import the theme customizer settings.","blocksy-companion"))),(0,t.createElement)("div",{className:"ct-control","data-design":"block"},(0,t.createElement)("header",null),(0,t.createElement)("section",null,(0,t.createElement)("div",{className:"ct-file-upload"},(0,t.createElement)("div",{className:"ct-attachment"},(0,t.createElement)("button",{type:"button",className:l()("ct-upload-button",{active:c}),ref:g,onClick:function(){y.current.click()}},e?e.name:(0,o.__)("Click or drop to upload a file...","blocksy-companion"))),(0,t.createElement)("input",{ref:y,type:"file",onChange:function({target:{files:[t]}}){n(t)}}),(0,t.createElement)("button",{className:l()("button-primary",{"ct-loading":p}),disabled:!e,onClick:function(t){if(t.preventDefault(),e){d(!0);var n=new FileReader;n.readAsText(e,"UTF-8"),n.onload=function(t){const e=function(t){const e=t.replace(/s:(\d+):"((?:\\.|[^"\\])*)";/g,function(t,e,n){return n.includes("\n")?`s:${e}:"${n}";`:`s:${V.byteLength(n,"utf8")}:"${n}";`});return H()(e)}(t.target.result);try{fetch(`${window.ajaxurl}?action=blocksy_customizer_import&wp_customize=on&nonce=${ct_customizer_localizations.customizer_reset_none}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(t){200===t.status&&t.json().then(function({success:t,data:e}){Y().then(function(){location.reload()})})})}catch(t){}}}}},p?(0,t.createElement)("svg",{width:"14",height:"14",viewBox:"0 0 100 100"},(0,t.createElement)("g",{transform:"translate(50,50)"},(0,t.createElement)("g",{transform:"scale(1)"},(0,t.createElement)("circle",{cx:"0",cy:"0",r:"50",fill:"currentColor"}),(0,t.createElement)("circle",{cx:"0",cy:"-26",r:"12",fill:"var(--ui-accent-color)",transform:"rotate(161.634)"},(0,t.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 0 0;360 0 0",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))))):(0,o.__)("Import Customizations","blocksy-companion"))))),ct_customizer_localizations.has_child_theme&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"ct-title","data-type":"simple"},(0,t.createElement)("h3",null,(0,o.__)("Copy Options","blocksy-companion")),(0,t.createElement)("div",{className:"ct-option-description"},(0,o.__)("Copy and import your customizations from parent or child theme.","blocksy-companion"))),ct_customizer_localizations.is_parent_theme&&(0,t.createElement)("div",{className:"ct-control","data-design":"block"},(0,t.createElement)("header",null),(0,t.createElement)("section",null,(0,t.createElement)("button",{className:"button-primary",onClick:function(t){t.preventDefault(),a("child")}},(0,o.__)("Copy From Child Theme","blocksy-companion")))),!ct_customizer_localizations.is_parent_theme&&(0,t.createElement)("div",{className:"ct-control","data-design":"block"},(0,t.createElement)("header",null),(0,t.createElement)("section",null,(0,t.createElement)("button",{className:"button-primary",onClick:function(t){t.preventDefault(),a("parent")}},(0,o.__)("Copy From Parent Theme","blocksy-companion"))))),(0,t.createElement)(r.Overlay,{items:i,className:"ct-admin-modal ct-import-export-modal",onDismiss:function(){return a(!1)},render:function(){return(0,t.createElement)("div",{className:"ct-modal-content"},(0,t.createElement)("h2",{className:"ct-modal-title"},!ct_customizer_localizations.is_parent_theme&&(0,o.__)("Copy From Parent Theme","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&(0,o.__)("Copy From Child Theme","blocksy-companion")),(0,t.createElement)("p",null,!ct_customizer_localizations.is_parent_theme&&(0,o.__)("You are about to copy all the settings from your parent theme into the child theme. Are you sure you want to continue?","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&(0,o.__)("You are about to copy all the settings from your child theme into the parent theme. Are you sure you want to continue?","blocksy-companion")),(0,t.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,t.createElement)("button",{onClick:function(t){t.preventDefault(),t.stopPropagation(),a(!1)},className:"button"},(0,o.__)("Cancel","blocksy-companion")),(0,t.createElement)("button",{className:"button button-primary",onClick:function(t){t.preventDefault();const e=new FormData;e.append("action","blocksy_customizer_copy_options"),e.append("wp_customize","on"),e.append("strategy",i);try{fetch(`${window.ajaxurl}?nonce=${ct_customizer_localizations.customizer_reset_none}`,{method:"POST",body:e}).then(function(t){200===t.status&&t.json().then(function({success:t,data:e}){Y().then(function(){location.reload()})})})}catch(t){}}},(0,o.__)("Yes, I am sure","blocksy-companion"))))}}),(0,t.createElement)(r.Overlay,{items:u,className:"ct-admin-modal ct-export-modal",onDismiss:function(){return f(!1)},render:function(){return(0,t.createElement)("div",{className:"ct-modal-content"},(0,t.createElement)("h2",{className:"ct-modal-title"},(0,o.__)("Export Settings","blocksy-companion")),(0,t.createElement)("p",null,(0,o.__)("Choose what set of settings you want to export.","blocksy-companion")),(0,t.createElement)("div",{className:"ct-checkboxes-container","data-type":"grid:bordered"},["options","widgets"].map(function(e){return(0,t.createElement)("div",{className:"ct-checkbox-container",onClick:function(){1===h.length&&h[0]===e||m(function(t){return t.includes(e)?t.filter(function(t){return t!==e}):[...t,e]})}},(0,t.createElement)("span",{className:l()("ct-checkbox",{active:h.includes(e)})},(0,t.createElement)("svg",{width:"10",height:"8",viewBox:"0 0 11.2 9.1"},(0,t.createElement)("polyline",{className:"check",points:"1.2,4.8 4.4,7.9 9.9,1.2 "}))),{options:(0,o.__)("Customizer settings","blocksy-companion"),widgets:(0,o.__)("Widgets settings","blocksy-companion")}[e])})),(0,t.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,t.createElement)("button",{onClick:function(t){t.preventDefault(),t.stopPropagation(),f(!1)},className:"button"},(0,o.__)("Cancel","blocksy-companion")),(0,t.createElement)("button",{className:"button button-primary",onClick:function(t){t.preventDefault();const e=new FormData;e.append("action","blocksy_customizer_export"),e.append("strategy",h.join(":")),e.append("wp_customize","on");try{fetch(`${window.ajaxurl}?nonce=${ct_customizer_localizations.customizer_reset_none}`,{method:"POST",body:e}).then(function(t){200===t.status&&t.json().then(function({success:t,data:e}){if(t){var n=new Blob([e.data],{type:"application/octet-stream;charset=utf-8"});F(n,`${e.site_url.replace("http://","").replace("https://","").replace(".","-").replace("/","-")}-export.dat`),f(!1)}})})}catch(t){}}},(0,o.__)("Export","blocksy-companion"))))}}))},G=window.ctEvents,W=n.n(G),J=window.wp.hooks,X=n(523),K=n.n(X);let Z=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[t]];return e};const Q=((tt=function(){tt.id=Z(),tt.subscribers.forEach(function(t){t()})}).id=Z(),tt.subscribers=[],tt.subscribe=function(t){tt.subscribers.push(t)},tt.unsubscribe=function(t){tt.subscribers.indexOf(t)>=0&&tt.subscribers.splice(tt.subscribers.indexOf(t),1)},tt);var tt;var et=function({forcedEdit:e=!1,headerId:n}){const[i,a]=(0,t.useState)(!1),[c,s]=(0,t.useState)(null),{builderValueCollection:l,builderValueDispatch:u}=(0,t.useContext)(r.PlacementsDragDropContext),f=(0,t.useRef)(),p=function(e){const n=(0,t.useState)(e.id);var o=function(){return n[1](e.id)};return(0,t.useEffect)(function(){return e.subscribe(o),function(){return e.unsubscribe(o)}},[]),n[0]}(Q),{data:d,isLoading:h,error:m}=K()(`${blocksy_admin.ajax_url}?action=blocksy_header_get_all_conditions`,{method:"POST",formatter:async function(t){const{success:e,data:n}=await t.json();if(!e||!n.conditions)throw new Error;return n.conditions},depends:[p]});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(t){t.preventDefault(),t.stopPropagation(),h||a(!0)}},(0,o.__)("Add/Edit Conditions","blocksy-companion")),(0,t.createElement)(r.Overlay,{items:i,initialFocusRef:f,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){a(!1),s(null)},render:function(){return(0,t.createElement)("div",{className:"ct-modal-content",ref:f},(0,t.createElement)("h2",null,sprintf((0,o.__)("Display Conditions","blocksy-companion"))),(0,t.createElement)("p",null,(0,o.__)("Add one or more conditions in order to display your header.","blocksy-companion")),(0,t.createElement)("div",{className:"ct-modal-scroll"},(0,t.createElement)(r.OptionsPanel,{onChange:function(t,e){s(function(t){return[...(t||d).filter(function({id:t}){return t!==n}),{id:n,conditions:e}]})},options:{conditions:{type:"blocksy-display-condition",design:"none",value:[],design:"none",label:!1}},value:{conditions:((c||d).find(function({id:t}){return t===n})||{conditions:[]}).conditions},hasRevertButton:!1})),(0,t.createElement)("div",{className:"ct-modal-actions has-divider"},(0,t.createElement)("button",{className:"button-primary",disabled:!c,onClick:function(){fetch(`${wp.ajax.settings.url}?action=blocksy_header_update_all_conditions`,{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(c)}).then(function(t){return t.json()}).then(function(){Q(),a(!1)})}},(0,o.__)("Save Conditions","blocksy-companion"))))}}))};function nt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function ot(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var rt=function(){const[n,i]=(0,t.useState)(!1),{builderValueDispatch:a,builderValue:c,option:s,builderValueCollection:u,panelsActions:f}=(ct_customizer_localizations.header_builder_data.secondary_items.header,ct_customizer_localizations.header_builder_data.header,(0,t.useContext)(r.PlacementsDragDropContext)),p=(0,J.applyFilters)("blocksy.header.available-sections",null,u.sections)||u.sections.filter(function({id:t}){return"type-2"!==t&&"type-3"!==t&&-1===t.indexOf("ct-custom")});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("ul",{className:l()("ct-panels-manager")},p.map(function({name:e,id:n}){let s=e||{"type-1":(0,o.__)("Global Header","blocksy-companion")}[n]||n;const u=`builder_header_panel_${n}`,p=ct_customizer_localizations.header_builder_data.header_data.header_options,d={label:s,"inner-options":ot(ot({},n.indexOf("ct-custom")>-1?{conditions_button:{label:(0,o.__)("Edit Conditions","blocksy-companion"),type:"jsx",design:"block",render:function(){return(0,t.createElement)(et,{headerId:n})}},divider:{type:"ct-divider"}}:{}),p)};return(0,t.createElement)(r.PanelMetaWrapper,h({id:u,key:n,option:d},f,{getActualOption:function({open:e}){return(0,t.createElement)(t.Fragment,null,n===c.id&&(0,t.createElement)(r.Panel,{id:u,getValues:function(){return ot({id:n},c.settings||{})},option:d,onChangeFor:function(t,e){a({type:"BUILDER_GLOBAL_SETTING_ON_CHANGE",payload:{optionId:t,optionValue:e,values:(0,r.getValueFromInput)(p,Array.isArray(c.settings)?{}:c.settings||{})}})},view:"simple"}),(0,t.createElement)("li",{className:l()({active:n===c.id,"ct-global":"type-1"===n}),onClick:function(){n===c.id?e():a({type:"PICK_BUILDER_SECTION",payload:{id:n}})}},(0,t.createElement)("span",{className:"ct-panel-name"},s),n.indexOf("ct-custom")>-1&&n!==c.id&&(0,t.createElement)("span",{className:"ct-remove-instance","data-tooltip-reveal":"top",onClick:function(t){t.preventDefault(),t.stopPropagation(),i(n)}},(0,t.createElement)("svg",{width:"11px",height:"11px",viewBox:"0 0 24 24"},(0,t.createElement)("path",{d:"M9.6,0l0,1.2H1.2v2.4h21.6V1.2h-8.4l0-1.2H9.6z M2.8,6l1.8,15.9C4.8,23.1,5.9,24,7.1,24h9.9c1.2,0,2.2-0.9,2.4-2.1L21.2,6H2.8z"})),(0,t.createElement)("i",{className:"ct-tooltip"},(0,o.__)("Remove header","blocksy-companion")))))}}))})),(0,t.createElement)(e.Slot,{name:"PlacementsBuilderPanelsManagerAfter"},function(t){return 0===t.length?null:t}),(0,t.createElement)(r.Overlay,{items:n,className:"ct-admin-modal ct-reset-options",onDismiss:function(){return i(!1)},render:function(){return(0,t.createElement)("div",{className:"ct-modal-content"},(0,t.createElement)("h2",{className:"ct-modal-title"},(0,o.__)("Remove Header","blocksy-companion")),(0,t.createElement)("p",null,(0,o.__)("You are about to remove a custom header, are you sure you want to continue?","blocksy-companion")),(0,t.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,t.createElement)("button",{onClick:function(t){t.preventDefault(),t.stopPropagation(),i(!1)},className:"button"},(0,o.__)("Cancel","blocksy-companion")),(0,t.createElement)("button",{className:"button button-primary",onClick:function(t){t.preventDefault(),a({type:"REMOVE_BUILDER_SECTION",payload:{id:n}}),i(!1)}},(0,o.__)("Confirm","blocksy-companion"))))}}))};W().on("blocksy:options:before-option",function(n){if(n.option&&"ct-header-builder"===n.option.type){let o=n.content;n.content=(0,t.createElement)(t.Fragment,null,o,(0,t.createElement)(e.Fill,{name:"PlacementsBuilderPanelsManager"},(0,t.createElement)(rt,null)))}}),W().on("blocksy:options:register",function(t){t["blocksy-display-condition"]=D,t["blocksy-customizer-options-manager"]=q})}()}();