芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/public_html/wp-content/plugins/blocksy-companion/static/bundle/blocks/blocks.js
!function(){var e={487:function(e){var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],o=0;o
>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&o.rotl(e,8)|4278255360&o.rotl(e,24);for(var t=0;t
0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],o=0,r=0;o
>>5]|=e[o]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],o=0;o<32*e.length;o+=8)t.push(e[o>>>5]>>>24-o%32&255);return t},bytesToHex:function(e){for(var t=[],o=0;o
>>4).toString(16)),t.push((15&e[o]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],o=0;o
>>6*(3-l)&63)):o.push("=");return o.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],r=0,n=0;r
>>6-2*n);return o}},e.exports=o},738:function(e){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh
* @license MIT */ e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},568:function(e,t,o){var r,n,l,c,a;r=o(12),n=o(487).utf8,l=o(738),c=o(487).bin,(a=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?c.stringToBytes(e):n.stringToBytes(e):l(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var o=r.bytesToWords(e),i=8*e.length,s=1732584193,u=-271733879,p=-1732584194,m=271733878,d=0;d
>>24)|4278255360&(o[d]<<24|o[d]>>>8);o[i>>>5]|=128<
>>9<<4)]=i;var b=a._ff,f=a._gg,y=a._hh,v=a._ii;for(d=0;d
>>0,u=u+h>>>0,p=p+_>>>0,m=m+k>>>0}return r.endian([s,u,p,m])})._ff=function(e,t,o,r,n,l,c){var a=e+(t&o|~t&r)+(n>>>0)+c;return(a<
>>32-l)+t},a._gg=function(e,t,o,r,n,l,c){var a=e+(t&r|o&~r)+(n>>>0)+c;return(a<
>>32-l)+t},a._hh=function(e,t,o,r,n,l,c){var a=e+(t^o^r)+(n>>>0)+c;return(a<
>>32-l)+t},a._ii=function(e,t,o,r,n,l,c){var a=e+(o^(t|~r))+(n>>>0)+c;return(a<
>>32-l)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var o=r.wordsToBytes(a(e,t));return t&&t.asBytes?o:t&&t.asString?c.bytesToString(o):r.bytesToHex(o)}},588:function(e){e.exports=function(e,t){var o,r,n=0;function l(){var l,c,a=o,i=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(c=0;c
=0),a.type){case"b":o=parseInt(o,10).toString(2);break;case"c":o=String.fromCharCode(parseInt(o,10));break;case"d":case"i":o=parseInt(o,10);break;case"j":o=JSON.stringify(o,null,a.width?parseInt(a.width):0);break;case"e":o=a.precision?parseFloat(o).toExponential(a.precision):parseFloat(o).toExponential();break;case"f":o=a.precision?parseFloat(o).toFixed(a.precision):parseFloat(o);break;case"g":o=a.precision?String(Number(o.toPrecision(a.precision))):parseFloat(o);break;case"o":o=(parseInt(o,10)>>>0).toString(8);break;case"s":o=String(o),o=a.precision?o.substring(0,a.precision):o;break;case"t":o=String(!!o),o=a.precision?o.substring(0,a.precision):o;break;case"T":o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=a.precision?o.substring(0,a.precision):o;break;case"u":o=parseInt(o,10)>>>0;break;case"v":o=o.valueOf(),o=a.precision?o.substring(0,a.precision):o;break;case"x":o=(parseInt(o,10)>>>0).toString(16);break;case"X":o=(parseInt(o,10)>>>0).toString(16).toUpperCase()}n.json.test(a.type)?f+=o:(!n.number.test(a.type)||p&&!a.sign?m="":(m=p?"+":"-",o=o.toString().replace(n.sign,"")),s=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",u=a.width-(m+o).length,i=a.width&&u>0?s.repeat(u):"",f+=a.align?m+o+i:"0"===s?m+i+o:i+m+o)}return f}(function(e){if(a[e])return a[e];var t,o=e,r=[],l=0;for(;o;){if(null!==(t=n.text.exec(o)))r.push(t[0]);else if(null!==(t=n.modulo.exec(o)))r.push("%");else{if(null===(t=n.placeholder.exec(o)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){l|=1;var c=[],i=t[2],s=[];if(null===(s=n.key.exec(i)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(c.push(s[1]);""!==(i=i.substring(s[0].length));)if(null!==(s=n.key_access.exec(i)))c.push(s[1]);else{if(null===(s=n.index_access.exec(i)))throw new SyntaxError("[sprintf] failed to parse named argument key");c.push(s[1])}t[2]=c}else l|=2;if(3===l)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}o=o.substring(t[0].length)}return a[e]=r}(e),arguments)}function c(e,t){return l.apply(null,[e].concat(t||[]))}var a=Object.create(null);l,c,"undefined"!=typeof window&&(window.sprintf=l,window.vsprintf=c,void 0===(r=function(){return{sprintf:l,vsprintf:c}}.call(t,o,t,e))||(e.exports=r))}()},61:function(e,t,o){var r=o(698).default;function n(){"use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=n=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},o=Object.prototype,l=o.hasOwnProperty,c="function"==typeof Symbol?Symbol:{},a=c.iterator||"@@iterator",i=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function u(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,o){return e[t]=o}}function p(e,t,o,r){var n=t&&t.prototype instanceof b?t:b,l=Object.create(n.prototype),c=new E(r||[]);return l._invoke=function(e,t,o){var r="suspendedStart";return function(n,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw l;return P()}for(o.method=n,o.arg=l;;){var c=o.delegate;if(c){var a=O(c,o);if(a){if(a===d)continue;return a}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var i=m(e,t,o);if("normal"===i.type){if(r=o.done?"completed":"suspendedYield",i.arg===d)continue;return{value:i.arg,done:o.done}}"throw"===i.type&&(r="completed",o.method="throw",o.arg=i.arg)}}}(e,o,c),l}function m(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d={};function b(){}function f(){}function y(){}var v={};u(v,a,(function(){return this}));var g=Object.getPrototypeOf,h=g&&g(g(j([])));h&&h!==o&&l.call(h,a)&&(v=h);var _=y.prototype=b.prototype=Object.create(v);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(n,c,a,i){var s=m(e[n],e,c);if("throw"!==s.type){var u=s.arg,p=u.value;return p&&"object"==r(p)&&l.call(p,"__await")?t.resolve(p.__await).then((function(e){o("next",e,a,i)}),(function(e){o("throw",e,a,i)})):t.resolve(p).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,i)}))}i(s.arg)}var n;this._invoke=function(e,r){function l(){return new t((function(t,n){o(e,r,t,n)}))}return n=n?n.then(l,l):l()}}function O(e,t){var o=e.iterator[t.method];if(void 0===o){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=m(o,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var n=r.arg;return n?n.done?(t[e.resultName]=n.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):n:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function j(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o
=0;--r){var n=this.tryEntries[r],c=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var a=l.call(n,"catchLoc"),i=l.call(n,"finallyLoc");if(a&&i){if(this.prev
=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev
=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),x(o),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var n=r.arg;x(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:j(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),d}},t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},698:function(e){function t(o){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:function(e,t,o){var r=o(61)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},o={};function r(t){var n=o[t];if(void 0!==n)return n.exports;var l=o[t]={exports:{}};return e[t](l,l.exports,r),l.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";function e(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var o=window.wp.element,n=window.wp.i18n,l=window.wp.blocks,c=window.wp.blockEditor,a=window.wp.data,i=window.blc_blocks_data,s=i.breadcrumb_home_item,u=i.breadcrumb_home_text,p=i.breadcrumb_separator,m=i.breadcrumb_page_title,d=function(){var e=(0,o.useMemo)((function(){return"text"===s?u:(0,o.createElement)("svg",{class:"ct-home-icon",width:"15",viewBox:"0 0 24 20"},(0,o.createElement)("path",{d:"M12,0L0.4,10.5h3.2V20h6.3v-6.3h4.2V20h6.3v-9.5h3.2L12,0z"}))}),[]),t=(0,o.useMemo)((function(){return"type-2"===p?(0,o.createElement)("svg",{class:"separator",width:"8",height:"8",viewBox:"0 0 8 8"},(0,o.createElement)("polygon",{points:"2.5,0 6.9,4 2.5,8 "})):"type-3"===p?(0,o.createElement)("span",{className:"separator"},"/"):(0,o.createElement)("svg",{class:"separator",width:"8",height:"8",viewBox:"0 0 8 8"},(0,o.createElement)("path",{d:"M2,6.9L4.8,4L2,1.1L2.6,0l4,4l-4,4L2,6.9z"}))}),[]),r=(0,a.withSelect)((function(e){var t;return{title:(null===(t=e("core/editor"))||void 0===t?void 0:t.getEditedPostAttribute("title"))||""}}))((function(e){return(0,o.createElement)("span",null,(null==e?void 0:e.title)||(0,n.__)("Page","blocksy-companion"))}));return(0,o.createElement)(React.Fragment,null,(0,o.createElement)("span",null,(0,o.createElement)("span",null,e),t),(0,o.createElement)("span",null,(0,o.createElement)("span",null,(0,n.__)("Subpage","blocksy-companion")),m&&t),m&&(0,o.createElement)(r,null))};function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t
e.length)&&(t=e.length);for(var o=0,r=new Array(t);o
1&&(t=!0),t}var H=function(e){var t=e.attributes,r=e.clientId,n=e.setAttributes;(0,o.useEffect)((function(){t.uniqueId&&!T({attributes:t,clientId:r})||n({uniqueId:A(r)})}),[r]);var l=t.uniqueId||A(r);return{uniqueId:l,props:{"data-id":l}}},z=function(e){var t=e.clientId,r=e.setAttributes,i=e.setIsPatternSelectionModalOpen,s=(0,a.useDispatch)(c.store).replaceInnerBlocks;return(0,o.createElement)("div",{className:"components-placeholder is-large"},(0,o.createElement)("div",{className:"components-placeholder__label"},(0,o.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,o.createElement)("path",{d:"M5.5 18v-1c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v1c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zm.5 2c-1.1 0-2-.9-2-2v-1c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2v1c0 1.1-.9 2-2 2H6zm-.5-9V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zm.5 2c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2v5c0 1.1-.9 2-2 2H6zm8.5 0v5c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-5c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5zM13 18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-5c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v5zm1.5-11V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v1c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5zm.5 2c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2v1c0 1.1-.9 2-2 2h-3z","fill-rule":"evenodd"})),(0,n.__)("Advanced Posts","blocksy-companion")),(0,o.createElement)("fieldset",{className:"components-placeholder__fieldset"},(0,o.createElement)("legend",{className:"components-placeholder__instructions"},(0,n.__)("Inherit the Customizer layout, start with a pattern or create a custom layout","blocksy-companion")),(0,o.createElement)("button",{className:"components-button is-primary",onClick:function(e){e.preventDefault(),r({design:"default"})}},(0,n.__)("Inherit From Customizer","blocksy-companion")),(0,o.createElement)("button",{className:"components-button is-primary",onClick:function(e){e.preventDefault(),i(!0)}},(0,n.__)("Choose Pattern","blocksy-companion")),(0,o.createElement)("button",{className:"components-button is-primary",onClick:function(e){e.preventDefault(),s(t,(0,l.createBlocksFromInnerBlocksTemplate)([["blocksy/post-template",{},[["blocksy/dynamic-data",{tagName:"h2",field:"wp:title",has_title_link:"yes"}],["blocksy/dynamic-data",{field:"wp:date"}],["blocksy/dynamic-data",{field:"wp:excerpt"}]]]]),!1)}},(0,n.__)("Create Custom Layout","blocksy-companion"))))};function N(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var V=r(184),M=r.n(V),F=window.React,L=window.wp.primitives;var R=(0,F.createElement)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,F.createElement)(L.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"}));var q=(0,F.createElement)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,F.createElement)(L.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));var U=(0,F.createElement)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,F.createElement)(L.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),G=window.wp.a11y,J=function(e){var t=e.items,r=e.selectedItems,l=e.onItemClick,c=e.label,a=e.resetAll,i=r.length>0;return(0,o.createElement)(f.__experimentalHStack,null,(0,o.createElement)(f.__experimentalHeading,{style:{margin:0},level:2},c),(0,o.createElement)(f.DropdownMenu,{icon:0===r.length?R:q,label:(0,n.__)("Parameters options","blocksy-companion"),toggleProps:{isSmall:!0,describedBy:0===r.length?(0,n.__)("All options are currently hidden","blocksy-companion"):void 0}},(function(){return(0,o.createElement)(React.Fragment,null,t.map((function(e,t){return(0,o.createElement)(f.MenuGroup,{key:t,label:e.label},e.items.map((function(e,t){var n=r.includes(e.label);return(0,o.createElement)(f.MenuItem,{key:t,icon:n?U:null,isSelected:n,onClick:function(){return l(e.label)}},e.label)})))})),(0,o.createElement)(f.MenuGroup,null,(0,o.createElement)(f.MenuItem,{"aria-disabled":!i,variant:"tertiary",onClick:function(){i&&(a(),(0,G.speak)((0,n.__)("All options reset","blocksy-companion"),"assertive"))}},(0,n.__)("Reset all","blocksy-companion"))))})))},K=function(e){var t=e.className,r=e.attributes,n=e.setAttributes,l=e.resetAll,c=e.items,a=e.label,i=c.reduce((function(e,t){return[].concat(N(e),N(t.items.filter((function(e){return e.hasValue()})).map((function(e){return e.label}))))}),[]),s=O((0,o.useState)([]),2),u=s[0],p=s[1],m=N(new Set([].concat(N(u),N(i))));return(0,o.createElement)("div",{className:M()("ct-tools-panel",t)},(0,o.createElement)(J,{label:a,resetAll:function(){p([]),l()},items:c,selectedItems:m,attributes:r,setAttributes:n,onItemClick:function(e){if(m.includes(e)){var t=c.reduce((function(e,t){return[].concat(N(e),N(t.items))}),[]).find((function(t){return t.label===e}));p(u.filter((function(t){return t!==e}))),t.reset()}else p([].concat(N(u),[e]))}}),(0,o.createElement)("div",{className:"ct-tools-panel-items"},c.reduce((function(e,t){return[].concat(N(e),N(t.items))}),[]).filter((function(e){return m.includes(e.label)})).map((function(e){return e.render()}))))};function W(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o,r,n={},l=Object.keys(e);for(r=0;r
=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r
=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var Z=window.wp.coreData;function X(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function Y(t){for(var o=1;o
0;){var c,a=n.shift();"blocksy/query"===a.name&&(a.attributes.uniqueId="",r.push(a.clientId)),null===(c=a.innerBlocks)||void 0===c||c.forEach((function(e){n.push(e)}))}return{newBlocks:o,queryClientIds:r}};var ee=function(e){return(0,a.useSelect)((function(t){return((0,t(Z.store).getTaxonomies)({type:e,per_page:-1,context:"view"})||[]).filter((function(e){var t=e.slug;return!$.includes(t)}))}),[e])},te=window.wp.compose;function oe(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return re(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return re(e,t)}(e))){var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,n,l=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return l=e.done,e},e:function(e){c=!0,n=e},f:function(){try{l||null==r.return||r.return()}finally{if(c)throw n}}}}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o
0?{label:(0,n.__)("Taxonomies","blocksy-companion"),items:c}:null}},ye=function(t){var r=t.context,l=t.attributes,a=(t.attributes.post_type,t.setAttributes),i=function(e){var t=e.attributes,o=e.attributes.post_type,r=e.previewedPostMatchesType,l=e.setAttributes,c=ee(o),a=[];return c&&c.length>0&&(a=[].concat(N(c.map((function(e){return de({taxonomy:e,attributes:t,setAttributes:l,previewedPostMatchesType:r})}))),N(c.map((function(e){return be({taxonomy:e,attributes:t,setAttributes:l})}))))),{taxonomiesGroup:a.length>0?{label:(0,n.__)("Taxonomies","blocksy-companion"),items:a}:null}}({attributes:l,setAttributes:a,previewedPostMatchesType:l.post_type===r.postType}),s=i.taxonomiesGroup;return(0,o.createElement)(c.InspectorControls,null,(0,o.createElement)(K,{className:"ct-query-parameters-component",attributes:l,setAttributes:a,resetAll:function(){a({offset:0,sticky_posts:"include",orderby:"post_date",order:"desc",include_term_ids:{},exclude_term_ids:{}})},items:[{label:(0,n.__)("General","blocksy-companion"),items:[{label:(0,n.__)("Offset","blocksy-companion"),hasValue:function(){return 0!==l.offset},reset:function(){a({offset:0})},render:function(){return(0,o.createElement)(B.OptionsPanel,{purpose:"gutenberg",onChange:function(t,o){a(e({},t,o))},options:{offset:{type:"ct-number",label:(0,n.__)("Offset","blocksy-companion"),value:"",min:0,max:500}},value:l,hasRevertButton:!1})}},{label:(0,n.__)("Order by","blocksy-companion"),hasValue:function(){return"post_date"!==l.orderby},reset:function(){a({orderby:"post_date"})},render:function(){return(0,o.createElement)(B.OptionsPanel,{purpose:"gutenberg",onChange:function(t,o){a(e({},t,o))},options:{orderby:{type:"ct-select",label:(0,n.__)("Order by","blocksy-companion"),value:"",choices:[{key:"title",value:(0,n.__)("Title","blocksy-companion")},{key:"post_date",value:(0,n.__)("Publish Date","blocksy-companion")},{key:"modified",value:(0,n.__)("Modified Date","blocksy-companion")},{key:"comment_count",value:(0,n.__)("Most commented","blocksy-companion")},{key:"author",value:(0,n.__)("Author","blocksy-companion")},{key:"rand",value:(0,n.__)("Random","blocksy-companion")},{key:"menu_order",value:(0,n.__)("Menu Order","blocksy-companion")}]}},value:l,hasRevertButton:!1})}},{label:(0,n.__)("Order","blocksy-companion"),hasValue:function(){return"desc"!==l.order},reset:function(){a({order:"desc"})},render:function(){return(0,o.createElement)(B.OptionsPanel,{purpose:"gutenberg",onChange:function(t,o){a(e({},t,o))},options:{order:{type:"ct-select",label:(0,n.__)("Order","blocksy-companion"),value:"",choices:[{key:"DESC",value:(0,n.__)("Descending","blocksy-companion")},{key:"ASC",value:(0,n.__)("Ascending","blocksy-companion")}]}},value:l,hasRevertButton:!1})}},{label:(0,n.__)("Sticky Posts","blocksy-companion"),hasValue:function(){return"include"!==l.sticky_posts},reset:function(){a({sticky_posts:"include"})},render:function(){return(0,o.createElement)(B.OptionsPanel,{purpose:"gutenberg",onChange:function(t,o){a(e({},t,o))},options:{sticky_posts:{type:"ct-select",label:(0,n.__)("Sticky Posts","blocksy-companion"),value:"include",choices:[{key:"include",value:(0,n.__)("Include","blocksy-companion")},{key:"exclude",value:(0,n.__)("Exclude","blocksy-companion")},{key:"only",value:(0,n.__)("Only","blocksy-companion")}]}},value:l,hasRevertButton:!1})}}]}].concat(N(s?[s]:[])),label:(0,n.__)("Parameters","blocksy-companion")}))};function ve(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function ge(t){for(var o=1;o
0&&void 0!==arguments[0]?arguments[0]:"";return e=(e=we()(e)).trim().toLowerCase()}function Ce(e,t){var o=Oe(t),r=Oe(e.title),n=0;if(o===r)n+=30;else if(r.startsWith(o))n+=20;else{o.split(" ").every((function(e){return r.includes(e)}))&&(n+=10)}return n}function xe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t)return e;var o=e.map((function(e){return[e,Ce(e,t)]})).filter((function(e){return O(e,2)[1]>0}));return o.sort((function(e,t){var o=O(e,2)[1];return O(t,2)[1]-o})),o.map((function(e){return O(e,1)[0]}))}var Ee=function(e){var t=e.clientId,r=(e.attributes,e.setIsPatternSelectionModalOpen),i=e.postType,s=O((0,o.useState)(""),2),u=s[0],p=s[1],m=(0,a.useDispatch)(c.store),d=m.replaceBlock,b=m.selectBlock,y=O((0,o.useState)([]),2),v=y[0],g=y[1];(0,o.useEffect)((function(){new Promise((function(e){he?e(he):fetch("".concat(wp.ajax.settings.url,"?action=blocksy_get_posts_block_patterns"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify({}),signal:_e.signal}).then((function(e){return e.json()})).then((function(t){var o=t.success,r=t.data;o&&(he=r.patterns.map((function(e){return ge(ge({},e),{},{blocks:(0,l.parse)(e.content,{__unstableSkipMigrationLogs:!0})})})),e(he))}))})).then((function(e){g(e)}))}),[]);var h=(0,o.useMemo)((function(){return{previewPostType:i}}),[i]),_=(0,o.useMemo)((function(){return xe(v,u)}),[v,u]),k=(0,te.useAsyncList)(_);return(0,o.createElement)(f.Modal,{overlayClassName:"block-library-query-pattern__selection-modal",title:(0,n.__)("Choose a pattern","blocksy-companion"),onRequestClose:function(){return r(!1)},isFullScreen:!0},(0,o.createElement)("div",{className:"block-library-query-pattern__selection-content"},(0,o.createElement)("div",{className:"block-library-query-pattern__selection-search"},(0,o.createElement)(f.SearchControl,{__nextHasNoMarginBottom:!0,onChange:p,value:u,label:(0,n.__)("Search for patterns","blocksy-companion"),placeholder:(0,n.__)("Search","blocksy-companion")})),(0,o.createElement)(c.BlockContextProvider,{value:h},(0,o.createElement)(c.__experimentalBlockPatternsList,{blockPatterns:_,shownPatterns:k,onClickPattern:function(e,o){var r=Q(o),n=r.newBlocks,l=r.queryClientIds;d(t,n),l[0]&&b(l[0])}}))))};function je(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function Pe(t){for(var o=1;o
0&&void 0!==arguments[0]?arguments[0]:{}).hasPages,r=void 0!==t&&t,n=(0,a.useSelect)((function(e){var t,o=e(Z.store).getPostTypes,n=["attachment","product"].concat(N(r?[]:["page"]));return null===(t=o({per_page:-1}))||void 0===t?void 0:t.filter((function(e){var t=e.viewable,o=e.slug;return t&&!n.includes(o)&&!o.includes("ct_")&&!o.includes("blc-")}))}),[r]);return{postTypesTaxonomiesMap:(0,o.useMemo)((function(){if(null!=n&&n.length)return n.reduce((function(e,t){return e[t.slug]=t.taxonomies,e}),{})}),[n]),postTypesSelectOptions:(0,o.useMemo)((function(){return(n||[]).reduce((function(t,o){return Y(Y({},t),{},e({},o.slug,o.labels.singular_name))}),{})}),[n])}}({hasPages:m}),v=y.postTypesSelectOptions,g=H({attributes:i,setAttributes:s,clientId:r}),h=g.uniqueId,_=g.props,k=u.postId,w=(u.postType,(0,o.useRef)()),C=(0,c.__experimentalUseBorderProps)(i),x=(0,c.useBlockProps)({ref:w,className:l,style:Pe({},C.style)}),E=O((0,o.useState)(!1),2),j=E[0],P=E[1];return(0,o.createElement)(React.Fragment,null,j&&(0,o.createElement)(Ee,{clientId:r,attributes:i,setIsPatternSelectionModalOpen:P,postType:i.post_type}),d?(0,o.createElement)("div",b({},x,_),(0,o.createElement)(z,{setIsPatternSelectionModalOpen:P,attributes:i,setAttributes:s,clientId:r})):(0,o.createElement)("div",b({},x,_),"default"===i.design&&(0,o.createElement)(D,{uniqueId:h,attributes:i,postId:k}),m&&(0,o.createElement)("div",p)),(0,o.createElement)(c.BlockControls,null,(0,o.createElement)(f.ToolbarGroup,null,(0,o.createElement)(f.ToolbarButton,{className:"components-toolbar__control",icon:"layout",label:(0,n.__)("Reset layout","blocksy-companion"),disabled:d,onClick:function(){m?(0,a.dispatch)("core/block-editor").replaceInnerBlocks(r,[],!1):(0,a.dispatch)("core/block-editor").updateBlockAttributes(r,{design:""})}}))),!d&&(0,o.createElement)(React.Fragment,null,(0,o.createElement)(c.InspectorControls,null,(0,o.createElement)(f.PanelBody,null,(0,o.createElement)(B.OptionsPanel,{purpose:"gutenberg",onChange:function(t,o){s(Pe(e({},t,o),"post_type"===t?{include_term_ids:{},exclude_term_ids:{},include_post_ids:{ids:[],current_post:!1},exclude_post_ids:{ids:[],current_post:!1}}:{}))},options:{post_type:{type:"ct-select",label:(0,n.__)("Post Type","blocksy-companion"),value:"",defaultToFirstItem:!1,choices:v,purpose:"default"},limit:{type:"ct-number",label:(0,n.__)("Limit","blocksy-companion"),value:"",min:1,max:100},has_pagination:{type:"ct-switch",label:(0,n.__)("Pagination","blocksy-companion"),value:""}},value:i,hasRevertButton:!1}))),(0,o.createElement)(ye,{attributes:i,setAttributes:s,context:u})),(0,o.createElement)(c.InspectorControls,{group:"advanced"},(0,o.createElement)(f.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,n.__)("Block ID","blocksy-companion"),value:h,onChange:function(e){},onFocus:function(e){e.target.select()},help:(0,n.__)("Please look at the documentation for more information on why this is useful.","blocksy-companion")})))},Se=function(e){var t=c.useBlockProps.save(),r=c.useInnerBlocksProps.save(t);return(0,o.createElement)("div",r)},De=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"blocksy/query","category":"blocksy-blocks","attributes":{"uniqueId":{"type":"string","default":""},"type":{"type":"string","default":"post"},"post_type":{"type":"string","default":"post"},"limit":{"type":"number","default":5},"include_term_ids":{"type":"object","default":{}},"exclude_term_ids":{"type":"object","default":{}},"include_post_ids":{"type":"object","default":{"ids":[],"current_post":false}},"exclude_post_ids":{"type":"object","default":{"ids":[],"current_post":false}},"order":{"type":"string","default":"desc"},"orderby":{"type":"string","default":"post_date"},"orderby_custom":{"type":"string","default":""},"offset":{"type":"number","default":0},"design":{"type":"string","default":""},"has_pagination":{"type":"string","default":"no"},"textColor":{"type":"string"},"customTextColor":{"type":"string"},"linkColor":{"type":"string"},"customLinkColor":{"type":"string"},"linkHoverColor":{"type":"string"},"customLinkHoverColor":{"type":"string"},"sticky_posts":{"type":"string","default":"include"}},"supports":{"align":["wide","full"],"html":false,"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"__experimentalBorder":{"color":true,"radius":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"width":true},"__experimentalSelector":"img, .block-editor-media-placeholder, .wp-block-post-featured-image__overlay","__experimentalSkipSerialization":true},"color":{"gradients":true,"link":false,"__experimentalDefaultControls":{"text":false,"background":true,"link":false}}},"usesContext":["postId","postType"],"providesContext":{"uniqueId":"uniqueId","post_type":"post_type","limit":"limit","order":"order","orderby":"orderby","sticky_posts":"sticky_posts","orderby_custom":"orderby_custom","offset":"offset","has_pagination":"has_pagination","include_term_ids":"include_term_ids","exclude_term_ids":"exclude_term_ids"}}');function Be(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function Ae(t){for(var o=1;o
0?d[0].slug:""),{per_page:-1,post:n})||[]}})).terms,y=(null===(r=d.find((function(e){return e.slug===p})))||void 0===r?void 0:r.name)||"Category";if(!n)return"".concat(y);if(0===f.length)return c||"".concat(y);var v="span",g={};return"yes"===u&&(v="a",g.href="#",g.rel="noopener noreferrer"),f.map((function(t,r){return(0,o.createElement)(React.Fragment,null,(0,o.createElement)(v,b({},g,{className:M()(e({},"ct-term-".concat(t.id),"yes"===i.termAccentColor),i.termClass),dangerouslySetInnerHTML:{__html:t.name}})),r!==f.length-1?m.replace(/ /g," "):"")}))};function Yo(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function $o(t){for(var o=1;o
":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},nr=["(","?"],lr={")":["("],":":["?","?:"]},cr=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var ar={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e
":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,o){if(e)throw t;return o}};function ir(e){var t=function(e){for(var t,o,r,n,l=[],c=[];t=e.match(cr);){for(o=t[0],(r=e.substr(0,t.index).trim())&&l.push(r);n=c.pop();){if(lr[o]){if(lr[o][0]===n){o=lr[o][1]||o;break}}else if(nr.indexOf(n)>=0||rr[n]
1===e?0:1},mr=/^i18n\.(n?gettext|has_translation)(_|$)/;const dr=((e,t,o)=>{const r=new ur({}),n=new Set,l=()=>{n.forEach((e=>e()))},c=function(e){var t;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";r.data[o]={...r.data[o],...e},r.data[o][""]={...pr,...null===(t=r.data[o])||void 0===t?void 0:t[""]},delete r.pluralForms[o]},a=(e,t)=>{c(e,t),l()},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0;return r.data[e]||c(void 0,e),r.dcnpgettext(e,t,o,n,l)},s=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},u=(e,t,r)=>{let n=i(r,t,e);return o?(n=o.applyFilters("i18n.gettext_with_context",n,e,t,r),o.applyFilters("i18n.gettext_with_context_"+s(r),n,e,t,r)):n};if(e&&a(e,t),o){const e=e=>{mr.test(e)&&l()};o.addAction("hookAdded","core/i18n",e),o.addAction("hookRemoved","core/i18n",e)}return{getLocaleData:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:a,addLocaleData:function(e){var t;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";r.data[o]={...r.data[o],...e,"":{...pr,...null===(t=r.data[o])||void 0===t?void 0:t[""],...null==e?void 0:e[""]}},delete r.pluralForms[o],l()},resetLocaleData:(e,t)=>{r.data={},r.pluralForms={},a(e,t)},subscribe:e=>(n.add(e),()=>n.delete(e)),__:(e,t)=>{let r=i(t,void 0,e);return o?(r=o.applyFilters("i18n.gettext",r,e,t),o.applyFilters("i18n.gettext_"+s(t),r,e,t)):r},_x:u,_n:(e,t,r,n)=>{let l=i(n,void 0,e,t,r);return o?(l=o.applyFilters("i18n.ngettext",l,e,t,r,n),o.applyFilters("i18n.ngettext_"+s(n),l,e,t,r,n)):l},_nx:(e,t,r,n,l)=>{let c=i(l,n,e,t,r);return o?(c=o.applyFilters("i18n.ngettext_with_context",c,e,t,r,n,l),o.applyFilters("i18n.ngettext_with_context_"+s(l),c,e,t,r,n,l)):c},isRTL:()=>"rtl"===u("ltr","text direction"),hasTranslation:(e,t,n)=>{var l,c;const a=t?t+""+e:e;let i=!(null===(l=r.data)||void 0===l||null===(c=l[null!=n?n:"default"])||void 0===c||!c[a]);return o&&(i=o.applyFilters("i18n.has_translation",i,e,t,n),i=o.applyFilters("i18n.has_translation_"+s(n),i,e,t,n)),i}}})(void 0,void 0,window.wp.hooks.defaultHooks);dr.getLocaleData.bind(dr),dr.setLocaleData.bind(dr),dr.resetLocaleData.bind(dr),dr.subscribe.bind(dr),dr.__.bind(dr),dr._x.bind(dr),dr._n.bind(dr),dr._nx.bind(dr),dr.isRTL.bind(dr),dr.hasTranslation.bind(dr);function br(e){var t=e.postId,o=e.postType,r=(0,a.useSelect)((function(e){var r,n=e(Z.store),l=n.getEditedEntityRecord,c=n.getUser,a=null===(r=l("postType",o,t))||void 0===r?void 0:r.author;return{authorDetails:a?c(a):null}}),[o,t]).authorDetails,n=null!=r&&r.avatar_urls?Object.values(r.avatar_urls):null,l=(null!=r&&r.avatar_urls&&Object.keys(r.avatar_urls),(0,a.useSelect)((function(e){return(0,e(c.store).getSettings)().__experimentalDiscussionSettings})).avatarURL);return{src:n?n[n.length-1]:l}}function fr(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function yr(t){for(var o=1;o
2&&void 0!==arguments[2]?arguments[2]:{},r=P(Sr(Sr({},t),{},{url:e}));if(Tr[r]||(Tr[r]={state:Dr,response:null,waitingForResponse:[]}),Tr[r].state===Ar){var n=Pr();return n.resolve(Tr[r].response.clone()),n.promise}if(Tr[r].state===Br){var l=Pr();return Tr[r].waitingForResponse.push(l),l.promise}if(Tr[r].state===Dr){Tr[r].state=Br;var c=Pr(),a=Sr({method:"POST",headers:{"Content-Type":"application/json"}},o);return"POST"===a.method&&(a.body=JSON.stringify(t)),fetch(e,a).then((function(e){Tr[r].response=e.clone(),[c].concat(N(Tr[r].waitingForResponse)).forEach((function(e){e.resolve(Tr[r].response.clone())})),Tr[r].waitingForResponse=[],Tr[r].state=Ar})).catch((function(e){[c].concat(N(Tr[r].waitingForResponse)).forEach((function(e){e.reject(Tr[r].response)})),Tr[r].waitingForResponse=[],Tr[r].state=Dr})),c.promise}throw new Error("Invalid state",{cacheEntry:Tr[r]})};function zr(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function Nr(t){for(var o=1;o
0&&void 0!==arguments[0]?arguments[0]:{}).termId,t=document.body.classList.contains("post-type-ct_content_block"),o=[];return e&&(o=[{id:"term_title",label:(0,n.__)("Term Title","blocksy-companion")},{id:"term_description",label:(0,n.__)("Term Description","blocksy-companion")},{id:"term_image",label:(0,n.__)("Term Image","blocksy-companion")},{id:"term_count",label:(0,n.__)("Term Count","blocksy-companion")}]),e||(o=[{id:"title",label:(0,n.__)("Title","blocksy-companion")},{id:"excerpt",label:(0,n.__)("Excerpt","blocksy-companion")},{id:"date",label:(0,n.__)("Post Date","blocksy-companion")},{id:"comments",label:(0,n.__)("Comments","blocksy-companion")},{id:"terms",label:(0,n.__)("Terms","blocksy-companion")},{id:"author",label:(0,n.__)("Author","blocksy-companion")},{id:"featured_image",label:(0,n.__)("Featured Image","blocksy-companion")},{id:"author_avatar",label:(0,n.__)("Author Avatar","blocksy-companion")}]),!e&&t&&(o=[].concat(N(o),[{id:"archive_title",label:(0,n.__)("Archive Title","blocksy-companion")},{id:"archive_description",label:(0,n.__)("Archive Description","blocksy-companion")},{id:"archive_image",label:(0,n.__)("Archive Image","blocksy-companion")}])),{provider:"wp",fields:o}},sn=function(e){var t=e.postId,r=e.postType,l=e.termId,c=(e.taxonomy,ee(r)),a=O((0,o.useState)([]),2),i=a[0],s=a[1];(0,o.useEffect)((function(){t&&!l&&Hr("".concat(wp.ajax.settings.url,"?action=blocksy_blocks_retrieve_dynamic_data_descriptor"),{post_id:t}).then((function(e){return e.json()})).then((function(e){e.success;var t=e.data;s(t.fields)}))}),[t,l]);var u={fields:[an({termId:l})]},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===window.wc||"product"!==e)return null;var o=(t||[]).find((function(e){return"product_brands"===e.slug}));return{provider:"woo",fields:[{id:"price",label:(0,n.__)("Price","blocksy-companion")},{id:"rating",label:(0,n.__)("Rating","blocksy-companion")},{id:"stock_status",label:(0,n.__)("Stock Status","blocksy-companion")},{id:"sku",label:(0,n.__)("SKU","blocksy-companion")}].concat(N(o?[{id:"brands",label:(0,n.__)("Brands","blocksy-companion")}]:[]))}}(r,c);return p&&u.fields.push(p),i.length>0&&(u.fields=[].concat(N(u.fields),N(i))),{fieldsDescriptor:u,options:cn,fieldsChoices:u.fields.reduce((function(e,t){return[].concat(N(e),N(t.fields.filter((function(e){return"wp"!==t.provider||"terms"!==e.id||c&&c.length>0})).map((function(e){return{group:(o=t.provider,{wp:"WordPress",woo:"WooCommerce",acf:"ACF",metabox:"MetaBox",custom:(0,n.__)("Custom","blocksy-companion"),toolset:"Toolset",jetengine:"Jet Engine",pods:"Pods",acpt:"ACPT"}[o]||(0,n.__)("Unknown","blocksy-companion")),key:"".concat(t.provider,":").concat(e.id),value:e.label};var o}))))}),[])}},un=function(t){var r=t.clientId,l=t.attributes,i=l.aspectRatio,s=l.imageFit,u=l.width,p=l.height,m=l.sizeSlug,d=t.setAttributes,b=(0,a.useSelect)((function(e){return e(c.store).getSettings().imageSizes}),[]).map((function(e){var t=e.name;return{value:e.slug,label:t}})),y=(0,f.__experimentalUseCustomUnits)({availableUnits:(0,c.useSetting)("spacing.units")||["px","%","vw","em","rem"]}),v=function(t,o){var r=parseFloat(o);isNaN(r)&&o||d(e({},t,r<0?"0":o))};return(0,o.createElement)(f.__experimentalToolsPanel,{label:(0,n.__)("Image Settings","blocksy-companion"),resetAll:function(){d({aspectRatio:"auto",width:void 0,height:void 0,sizeSlug:void 0})}},(0,o.createElement)(f.__experimentalToolsPanelItem,{hasValue:function(){return!!i},label:(0,n.__)("Aspect Ratio","blocksy-companion"),onDeselect:function(){return d({aspectRatio:void 0})},resetAllFilter:function(){return{aspectRatio:"auto"}},isShownByDefault:!0,key:r},(0,o.createElement)(f.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Aspect Ratio","blocksy-companion"),value:i,options:[{label:(0,n.__)("Original","blocksy-companion"),value:"auto"},{label:(0,n.__)("Square","blocksy-companion"),value:"1"},{label:(0,n.__)("16:9","blocksy-companion"),value:"16/9"},{label:(0,n.__)("4:3","blocksy-companion"),value:"4/3"},{label:(0,n.__)("3:2","blocksy-companion"),value:"3/2"},{label:(0,n.__)("9:16","blocksy-companion"),value:"9/16"},{label:(0,n.__)("3:4","blocksy-companion"),value:"3/4"},{label:(0,n.__)("2:3","blocksy-companion"),value:"2/3"}],onChange:function(e){return d({aspectRatio:e})}})),(0,o.createElement)(f.__experimentalToolsPanelItem,{style:{"grid-column":"span 1 / auto"},hasValue:function(){return!!u},label:(0,n.__)("Width","blocksy-companion"),onDeselect:function(){return d({width:void 0})},resetAllFilter:function(){return{width:void 0}},isShownByDefault:!0,key:r},(0,o.createElement)(f.__experimentalUnitControl,{label:(0,n.__)("Width","blocksy-companion"),labelPosition:"top",value:u||"",min:0,onChange:function(e){return v("width",e)},units:y})),(0,o.createElement)(f.__experimentalToolsPanelItem,{style:{"grid-column":"span 1 / auto"},hasValue:function(){return!!p},label:(0,n.__)("Height","blocksy-companion"),onDeselect:function(){return d({height:void 0})},resetAllFilter:function(){return{height:void 0}},isShownByDefault:!0,key:r},(0,o.createElement)(f.__experimentalUnitControl,{label:(0,n.__)("Height","blocksy-companion"),labelPosition:"top",value:p||"",min:0,onChange:function(e){return v("height",e)},units:y})),(0,o.createElement)(f.__experimentalToolsPanelItem,{hasValue:function(){return!!s},label:(0,n.__)("Scale","blocksy-companion"),onDeselect:function(){return d({imageFit:void 0})},resetAllFilter:function(){return{imageFit:"cover"}},isShownByDefault:!0,key:r},(0,o.createElement)(f.__experimentalToggleGroupControl,{label:(0,n.__)("Scale","blocksy-companion"),value:s,isBlock:!0,onChange:function(e){return d({imageFit:e})}},(0,o.createElement)(f.__experimentalToggleGroupControlOption,{key:"cover",value:"cover",label:(0,n.__)("Cover","blocksy-companion")}),(0,o.createElement)(f.__experimentalToggleGroupControlOption,{key:"contain",value:"contain",label:(0,n.__)("Contain","blocksy-companion")}))),!!b.length&&(0,o.createElement)(f.__experimentalToolsPanelItem,{hasValue:function(){return!!m},label:(0,n.__)("Resolution","blocksy-companion"),onDeselect:function(){return d({sizeSlug:void 0})},resetAllFilter:function(){return{sizeSlug:void 0}},isShownByDefault:!1,key:r},(0,o.createElement)(f.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Resolution","blocksy-companion"),value:m||"full",options:b,onChange:function(e){return d({sizeSlug:e})},help:(0,n.__)("Select the size of the source image.","blocksy-companion")})))};function pn(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function mn(t){for(var o=1;o
0?{taxonomy:{type:"ct-select",label:(0,n.__)("Taxonomy","blocksy-companion"),value:"",design:"inline",purpose:"default",choices:m.map((function(e){var t=e.name;return{key:e.slug,value:t}}))}}:{}),"wp:term_image"===a.field?{imageSource:{type:"ct-radio",label:(0,n.__)("Image Source","blocksy-companion"),value:a.imageSource,design:"inline",purpose:"gutenberg",divider:"bottom",choices:{featured:(0,n.__)("Image","blocksy-companion"),icon:(0,n.__)("Icon/Logo","blocksy-companion")}}}:{}),s),value:mn(mn({},a),l&&l.has_taxonomies_customization?{has_taxonomies_customization:"yes"}:{}),hasRevertButton:!1}),nn(r)&&"wp:author_avatar"!==a.field&&"wp:archive_image"!==a.field&&(0,o.createElement)(B.OptionsPanel,{purpose:"gutenberg",onChange:function(t,o){i(e({},t,o))},options:mn(mn({lightbox_condition:{type:"ct-condition",condition:{has_field_link:"no"},options:{lightbox:{type:"ct-switch",label:(0,n.__)("Expand on click","blocksy-companion"),value:"no"}}}},"wp:featured_image"===a.field?{videoThumbnail:{type:"ct-switch",label:(0,n.__)("Video thumbnail","blocksy-companion"),value:"no"}}:{}),{},{image_hover_effect:{label:(0,n.__)("Image Hover Effect","blocksy-companion"),type:"ct-select",value:"none",view:"text",design:"inline",choices:{none:(0,n.__)("None","blocksy-companion"),"zoom-in":(0,n.__)("Zoom In","blocksy-companion"),"zoom-out":(0,n.__)("Zoom Out","blocksy-companion")}}}),value:a,hasRevertButton:!1})),nn(r)&&"wp:author_avatar"!==a.field&&(0,o.createElement)(React.Fragment,null,(0,o.createElement)(un,{clientId:p,attributes:a,setAttributes:i}),(0,o.createElement)(f.PanelBody,null,(0,o.createElement)(f.TextareaControl,{label:(0,n.__)("Alternative Text","blocksy-companion"),value:a.alt_text||"",onChange:function(e){i({alt_text:e})},help:(0,o.createElement)(React.Fragment,null,(0,o.createElement)(f.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,n.__)("Describe the purpose of the image.","blocksy-companion")),(0,o.createElement)("br",null),(0,n.__)("Leave empty if decorative.","blocksy-companion")),__nextHasNoMarginBottom:!0}))),"wp:author_avatar"===a.field&&(0,o.createElement)(f.PanelBody,null,(0,o.createElement)(f.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,n.__)("Image size","blocksy-companion"),onChange:function(e){return i({avatar_size:e})},min:5,max:500,initialPosition:null==a?void 0:a.avatar_size,value:null==a?void 0:a.avatar_size})),"woo:brands"===a.field&&(0,o.createElement)(f.PanelBody,null,(0,o.createElement)(f.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,n.__)("Logo Size","blocksy-companion"),onChange:function(e){return i({brands_size:e})},min:5,max:500,initialPosition:null==a?void 0:a.brands_size,value:null==a?void 0:a.brands_size}),(0,o.createElement)(f.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,n.__)("Logo Gap","blocksy-companion"),onChange:function(e){return i({brands_gap:e})},min:5,max:500,initialPosition:null==a?void 0:a.brands_gap,value:null==a?void 0:a.brands_gap})),!nn(r)&&"woo:brands"!==a.field&&(0,o.createElement)(f.PanelBody,null,(0,o.createElement)(B.OptionsPanel,{purpose:"gutenberg",onChange:function(t,o){i(e({},t,o))},options:mn({before:{type:"text",label:(0,n.__)("Before","blocksy-companion"),value:""},after:{type:"text",label:(0,n.__)("After","blocksy-companion"),value:""}},"wp"!==r.provider||"wp"===r.provider&&("excerpt"===r.id||"terms"===r.id||"author"===r.id)?{fallback:{type:"text",label:(0,n.__)("Fallback","blocksy-companion"),value:(0,n.__)("Custom field fallback","blocksy-companion")}}:{}),value:a,hasRevertButton:!1}))),"wp:terms"===a.field&&(0,o.createElement)(c.InspectorControls,{group:"advanced"},(0,o.createElement)(f.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,n.__)("Term additional class","blocksy-companion"),value:a.termClass,onChange:function(e){i({termClass:e})},help:(0,n.__)("Additional class for term items. Useful for styling.","blocksy-companion")})))};function bn(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function fn(t){for(var o=1;o