(()=>{"use strict";var e={d:(t,o)=>{for(var a in o)e.o(o,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:o[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ADMIN_URL:()=>U,COUNTRIES:()=>E,CURRENCY:()=>V,CURRENT_USER_IS_ADMIN:()=>C,HOME_URL:()=>I,LOCALE:()=>R,ORDER_STATUSES:()=>P,PLACEHOLDER_IMG_SRC:()=>T,SITE_CURRENCY:()=>D,SITE_TITLE:()=>A,STORE_PAGES:()=>z,WC_ASSET_URL:()=>O,WC_VERSION:()=>q,WP_LOGIN_URL:()=>M,WP_VERSION:()=>N,allSettings:()=>i,defaultFields:()=>W,getAdminLink:()=>w,getCurrencyPrefix:()=>x,getCurrencySuffix:()=>L,getPaymentMethodData:()=>v,getSetting:()=>h,getSettingWithCoercion:()=>S,isWcVersion:()=>g,isWpVersion:()=>b}),(0,window.wp.hooks.addFilter)("woocommerce_admin_analytics_settings","woocommerce-blocks/exclude-draft-status-from-analytics",(e=>{const t=e=>"customStatuses"===e.key?{...e,options:e.options.filter((e=>"checkout-draft"!==e.value))}:e,o=e.woocommerce_actionable_order_statuses.options.map(t),a=e.woocommerce_excluded_report_order_statuses.options.map(t);return{...e,woocommerce_actionable_order_statuses:{...e.woocommerce_actionable_order_statuses,options:o},woocommerce_excluded_report_order_statuses:{...e.woocommerce_excluded_report_order_statuses,options:a}}}));const o={adminUrl:"",countries:[],countryData:{},currency:{code:"USD",precision:2,symbol:"$",symbolPosition:"left",decimalSeparator:".",priceFormat:"%1$s%2$s",thousandSeparator:","},currentUserId:0,currentUserIsAdmin:!1,homeUrl:"",locale:{siteLocale:"en_US",userLocale:"en_US",weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},orderStatuses:[],placeholderImgSrc:"",siteTitle:"",storePages:[],wcAssetUrl:"",wcVersion:"",wpLoginUrl:"",wpVersion:""},a="object"==typeof window.wcSettings?window.wcSettings:{},i={...o,...a};function n(e,t){const o=s(e),a=s(t),i=o.pop(),n=a.pop(),r=u(o,a);return 0!==r?r:i&&n?u(i.split("."),n.split(".")):i||n?i?-1:1:0}i.currency={...o.currency,...i.currency},i.locale={...o.locale,...i.locale};const r=(e,t,o)=>{_(o);const a=n(e,t);return m[o].includes(a)};n.validate=e=>"string"==typeof e&&/^[v\d]/.test(e)&&l.test(e),n.compare=r,n.sastisfies=(e,t)=>{const o=t.match(/^([<>=~^]+)/),a=o?o[1]:"=";if("^"!==a&&"~"!==a)return r(e,t,a);const[i,n,l]=s(e),[d,c,m]=s(t);return 0===p(i,d)&&("^"===a?u([n,l],[c,m])>=0:0===p(n,c)&&p(l,m)>=0)};const l=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,s=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(l);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},d=e=>"*"===e||"x"===e||"X"===e,c=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},p=(e,t)=>{if(d(e)||d(t))return 0;const[o,a]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(c(e),c(t));return o>a?1:o<a?-1:0},u=(e,t)=>{for(let o=0;o<Math.max(e.length,t.length);o++){const a=p(e[o]||0,t[o]||0);if(0!==a)return a}return 0},m={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},y=Object.keys(m),_=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===y.indexOf(e))throw new Error(`Invalid operator, expected one of ${y.join("|")}`)},h=(e,t=!1,o=(e,t)=>void 0!==e?e:t)=>{let a=t;if(e in i)a=i[e];else if(e.includes("_data")){const o=e.replace("_data",""),i=h("paymentMethodData",{});a=o in i?i[o]:t}return o(a,t)},S=(e,t,o)=>{const a=e in i?i[e]:t;return o(a,t)?a:t},f=(e,t,o)=>{let a=h(e,"");return/^\d+\.\d+-.*$/.test(a)&&(a=a.replace(/-[a-zA-Z0-9]*[\-.]*/,".0-rc."),a=a.endsWith(".")?a.substring(0,a.length-1):a),n.compare(a,t,o)},b=(e,t="=")=>f("wpVersion",e,t),g=(e,t="=")=>f("wcVersion",e,t),w=e=>h("adminUrl")+e,v=(e,t=null)=>{var o;return null!==(o=h("paymentMethodData",{})[e])&&void 0!==o?o:t},x=(e,t)=>({left:e,left_space:e+" ",right:"",right_space:""}[t]||""),L=(e,t)=>({left:"",left_space:"",right:e,right_space:" "+e}[t]||""),U=i.adminUrl,E=i.countries,C=i.currentUserIsAdmin,I=i.homeUrl,R=i.locale,P=i.orderStatuses,T=i.placeholderImgSrc,A=i.siteTitle,z=i.storePages,O=i.wcAssetUrl,q=i.wcVersion,M=i.wpLoginUrl,N=i.wpVersion,V=i.currency,D={code:V.code,symbol:V.symbol,thousandSeparator:V.thousandSeparator,decimalSeparator:V.decimalSeparator,minorUnit:V.precision,prefix:x(V.symbol,V.symbolPosition),suffix:L(V.symbol,V.symbolPosition)},F=window.wc.wcTypes,W=S("defaultFields",{email:{label:"Email address",optionalLabel:"Email address (optional)",required:!0,hidden:!1,autocomplete:"email",autocapitalize:"none",type:"email",index:0,validation:[]},country:{label:"Country/Region",optionalLabel:"Country/Region (optional)",required:!0,hidden:!1,autocomplete:"country",index:1,validation:[]},first_name:{label:"First name",optionalLabel:"First name (optional)",required:!0,hidden:!1,autocomplete:"given-name",autocapitalize:"sentences",index:10,validation:[]},last_name:{label:"Last name",optionalLabel:"Last name (optional)",required:!0,hidden:!1,autocomplete:"family-name",autocapitalize:"sentences",index:20,validation:[]},company:{label:"Company",optionalLabel:"Company (optional)",required:!1,hidden:!0,autocomplete:"organization",autocapitalize:"sentences",index:30,validation:[]},address_1:{label:"Address",optionalLabel:"Address (optional)",required:!0,hidden:!1,autocomplete:"address-line1",autocapitalize:"sentences",index:40,validation:[]},address_2:{label:"Apartment, suite, etc.",optionalLabel:"Apartment, suite, etc. (optional)",required:!1,hidden:!1,autocomplete:"address-line2",autocapitalize:"sentences",index:50,validation:[]},city:{label:"City",optionalLabel:"City (optional)",required:!0,hidden:!1,autocomplete:"address-level2",autocapitalize:"sentences",index:70,validation:[]},state:{label:"State/County",optionalLabel:"State/County (optional)",required:!0,hidden:!1,autocomplete:"address-level1",autocapitalize:"sentences",index:80,validation:[]},postcode:{label:"Postal code",optionalLabel:"Postal code (optional)",required:!0,hidden:!1,autocomplete:"postal-code",autocapitalize:"characters",index:90,validation:[]},phone:{label:"Phone",optionalLabel:"Phone (optional)",required:!0,hidden:!1,type:"tel",autocomplete:"tel",autocapitalize:"characters",index:100,validation:[]}},F.isFormFields);(this.wc=this.wc||{}).wcSettings=t})();
(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{__experimentalDeRegisterExpressPaymentMethod:()=>P,__experimentalDeRegisterPaymentMethod:()=>k,__experimentalRegisterProductCollection:()=>z,getExpressPaymentMethods:()=>S,getPaymentMethods:()=>I,getRegisteredBlockComponents:()=>A,getRegisteredInnerBlocks:()=>T,registerBlockComponent:()=>R,registerExpressPaymentMethod:()=>g,registerInnerBlock:()=>O,registerPaymentMethod:()=>h,registerPaymentMethodExtensionCallbacks:()=>v});const o=window.wp.deprecated;var r=e.n(o);const n=window.wp.data,a={},i=a,s=(e,t,o)=>{const r=((e,t)=>o=>(o?.paymentRequirements||[]).every((e=>t.includes(e)))&&e(o))(e,t);return Object.values(i).some((e=>o in e))?((e,t,o)=>r=>{let n=e(r);if(n){const e={};Object.entries(t).forEach((([t,r])=>{o in r&&"function"==typeof r[o]&&(e[t]=r[o])})),n=Object.keys(e).every((t=>{try{return e[t](r)}catch(e){return console.error(`Error when executing callback for ${o} in ${t}`,e),!0}}))}return n})(r,i,o):r},c=window.wp.element,l=(e,t)=>{if(null!==e&&!(0,c.isValidElement)(e))throw new TypeError(`The ${t} property for the payment method must be a React element or null.`)},u=(e,t=[])=>{const o=t.reduce(((t,o)=>(e.hasOwnProperty(o)||t.push(o),t)),[]);if(o.length>0)throw new TypeError("The payment method configuration object is missing the following properties:"+o.join(", "))},m=window.ReactJSXRuntime,d=()=>null;class p{constructor(e){p.assertValidConfig(e),this.name=e.name,this.label=e.label,this.placeOrderButtonLabel=e.placeOrderButtonLabel,this.ariaLabel=e.ariaLabel,this.content=e.content,this.savedTokenComponent=e.savedTokenComponent,this.icons=e.icons||null,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={showSavedCards:e?.supports?.showSavedCards||e?.supports?.savePaymentInfo||!1,showSaveOption:e?.supports?.showSaveOption||!1,features:e?.supports?.features||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return s(this.canMakePaymentFromConfig,this.supports.features,this.name)}static assertValidConfig=e=>{if(e.savedTokenComponent=e.savedTokenComponent||(0,m.jsx)(d,{}),u(e,["name","label","ariaLabel","content","edit","canMakePayment"]),"string"!=typeof e.name)throw new Error("The name property for the payment method must be a string");if(void 0!==e.icons&&!Array.isArray(e.icons)&&null!==e.icons)throw new Error("The icons property for the payment method must be an array or null.");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if("string"!=typeof e.placeOrderButtonLabel&&void 0!==e.placeOrderButtonLabel)throw new TypeError("The placeOrderButtonLabel property for the payment method must be a string");if((e=>{if(null!==e&&!(0,c.isValidElement)(e)&&"string"!=typeof e)throw new TypeError("The label property for the payment method must be a React element, a string, or null.")})(e.label),l(e.content,"content"),l(e.edit,"edit"),l(e.savedTokenComponent,"savedTokenComponent"),"string"!=typeof e.ariaLabel)throw new TypeError("The ariaLabel property for the payment method must be a string");if("function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the payment method must be a function.");if(void 0!==e.supports?.showSavedCards&&"boolean"!=typeof e.supports?.showSavedCards)throw new TypeError("If the payment method includes the `supports.showSavedCards` property, it must be a boolean");if(void 0!==e.supports?.savePaymentInfo&&r()("Passing savePaymentInfo when registering a payment method.",{alternative:"Pass showSavedCards and showSaveOption",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686"}),void 0!==e.supports?.features&&!Array.isArray(e.supports?.features))throw new Error("The features property for the payment method must be an array or undefined.");if(void 0!==e.supports?.showSaveOption&&"boolean"!=typeof e.supports?.showSaveOption)throw new TypeError("If the payment method includes the `supports.showSaveOption` property, it must be a boolean")}}class y{constructor(e){const t="string"==typeof e.name?e.name.replace(/[_-]/g," "):e.name,o="string"==typeof e?.description&&e.description.length>130?e.description.slice(0,130)+"...":e.description;y.assertValidConfig(e),this.name=e.name,this.title=e.title||t,this.description=o||"",this.gatewayId=e.gatewayId||"",this.content=e.content,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={features:e?.supports?.features||["products"],style:e?.supports?.style||[]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return s(this.canMakePaymentFromConfig,this.supports.features,this.name)}static assertValidConfig=e=>{if(u(e,["name","content","edit"]),"string"!=typeof e.name)throw new TypeError("The name property for the express payment method must be a string");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if(void 0!==e.supports?.features&&!Array.isArray(e.supports?.features))throw new Error("The features property for the payment method must be an array or undefined.");if(l(e.content,"content"),l(e.edit,"edit"),"function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the express payment method must be a function.")}}const b="wc/store/payment",w={},f={},h=e=>{let t;"function"==typeof e?(t=e(p),r()("Passing a callback to registerPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new p(e),t instanceof p&&(w[t.name]=t)},g=e=>{let t;"function"==typeof e?(t=e(y),r()("Passing a callback to registerExpressPaymentMethod()",{alternative:"a config options object",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404"})):t=new y(e),t instanceof y&&(f[t.name]=t)},v=(e,t)=>{a[e]?console.error(`The namespace provided to registerPaymentMethodExtensionCallbacks must be unique. Callbacks have already been registered for the ${e} namespace.`):(a[e]={},Object.entries(t).forEach((([t,o])=>{"function"==typeof o?a[e][t]=o:console.error(`All callbacks provided to registerPaymentMethodExtensionCallbacks must be functions. The callback for the ${t} payment method in the ${e} namespace was not a function.`)})))},k=e=>{delete w[e];const{__internalRemoveAvailablePaymentMethod:t}=(0,n.dispatch)(b);t(e)},P=e=>{delete f[e];const{__internalRemoveAvailableExpressPaymentMethod:t}=(0,n.dispatch)(b);t(e)},I=()=>w,S=()=>f,E={};function A(e){return{..."object"==typeof E[e]&&Object.keys(E[e]).length>0?E[e]:{},...E.any}}function T(e){return r()("getRegisteredInnerBlocks",{version:"2.8.0",alternative:"getRegisteredBlockComponents",plugin:"WooCommerce Blocks"}),A(e)}const C=(e,t,o)=>{const r=typeof e[t];if(r!==o)throw new Error(`Incorrect value for the ${t} argument when registering a block component. It was a ${r}, but must be a ${o}.`)},x=(e,t)=>{if(e[t]){if("function"==typeof e[t])return;if(e[t].$$typeof&&e[t].$$typeof===Symbol.for("react.lazy"))return}throw new Error(`Incorrect value for the ${t} argument when registering a block component. Component must be a valid React Element or Lazy callback.`)};function R(e){e.context||(e.context="any"),C(e,"context","string"),C(e,"blockName","string"),x(e,"component");const{context:t,blockName:o,component:r}=e;E[t]||(E[t]={}),E[t][o]=r}function O(e){r()("registerInnerBlock",{version:"2.8.0",alternative:"registerBlockComponent",plugin:"WooCommerce Blocks",hint:'"main" has been replaced with "context" and is now optional.'}),C(e,"main","string"),R({...e,context:e.main})}const q=window.wp.hooks;let M=function(e){return e.GRID="flex",e.STACK="list",e.CAROUSEL="carousel",e}({}),j=function(e){return e.FILL="fill",e.FIXED="fixed",e}({}),B=function(e){return e.ATTRIBUTES="attributes",e.CREATED="created",e.FEATURED="featured",e.HAND_PICKED="hand-picked",e.INHERIT="inherit",e.KEYWORD="keyword",e.ON_SALE="on-sale",e.ORDER="order",e.DEFAULT_ORDER="default-order",e.STOCK_STATUS="stock-status",e.TAXONOMY="taxonomy",e.PRICE_RANGE="price-range",e.FILTERABLE="filterable",e.PRODUCTS_PER_PAGE="products-per-page",e.MAX_PAGES_TO_SHOW="max-pages-to-show",e.OFFSET="offset",e.RELATED_BY="related-by",e}({});const L=window.wc.wcSettings,_=JSON.parse('{"UU":"woocommerce/product-collection"}');let F=function(e){return e.SINGLE="single",e.THUMBNAIL="thumbnail",e}({});const D=_.UU,$=`${D}/product-title`,H=(0,L.getSetting)("stockStatusOptions",[]),N={perPage:9,pages:0,offset:0,postType:"product",order:"asc",orderBy:"title",search:"",exclude:[],inherit:!1,taxQuery:{},isProductCollectionBlock:!0,featured:!1,woocommerceOnSale:!1,woocommerceStockStatus:(0,L.getSetting)("hideOutOfStockItems",!1)?Object.keys(function(e,t){const{[t]:o,...r}=e;return r}(H,"outofstock")):Object.keys(H),woocommerceAttributes:[],woocommerceHandPickedProducts:[],timeFrame:void 0,priceRange:void 0,filterable:!1,relatedBy:{categories:!0,tags:!0}},U={query:N,tagName:"div",displayLayout:{type:M.GRID,columns:3,shrinkColumns:!0},dimensions:{widthType:j.FILL},queryContextIncludes:["collection"],forcePageReload:!1},V=[["woocommerce/product-template",{},[["woocommerce/product-image",{imageSizing:F.THUMBNAIL,showSaleBadge:!1},[["woocommerce/product-sale-badge",{align:"right"}]]],["core/post-title",{textAlign:"center",level:2,fontSize:"medium",style:{spacing:{margin:{bottom:"0.75rem",top:"0"}},typography:{lineHeight:"1.4"}},isLink:!0,__woocommerceNamespace:$}],["woocommerce/product-price",{textAlign:"center",fontSize:"small"}],["woocommerce/product-button",{textAlign:"center",fontSize:"small"}]]],["core/query-pagination",{layout:{type:"flex",justifyContent:"center"}}],["woocommerce/product-collection-no-results"]],z=e=>{if(!(e=>"object"!=typeof e||null===e?(console.error("Invalid arguments: You must pass an object to __experimentalRegisterProductCollection."),!1):"string"!=typeof e.name||0===e.name.length?(console.error("Invalid name: name must be a non-empty string."),!1):(e.name.match(/^[a-zA-Z0-9-]+\/product-collection\/[a-zA-Z0-9-]+$/)||console.warn('To prevent conflicts with other collections, please use a unique name following the pattern: "<plugin-name>/product-collection/<collection-name>". Ensure "<plugin-name>" is your plugin name and "<collection-name>" is your collection name. Both should consist only of alphanumeric characters and hyphens (e.g., "my-plugin/product-collection/my-collection").'),"string"!=typeof e.title||0===e.title.length?(console.error("Invalid title: title must be a non-empty string."),!1):(void 0!==e.description&&"string"!=typeof e.description&&console.warn("Invalid description: description must be a string."),void 0!==e.category&&"string"!=typeof e.category&&console.warn("Invalid category: category must be a string."),void 0===e.keywords||Array.isArray(e.keywords)||console.warn("Invalid keywords: keywords must be an array of strings."),void 0!==e.icon&&"string"!=typeof e.icon&&"object"!=typeof e.icon&&console.warn("Invalid icon: icon must be a string or an object."),void 0!==e.example&&"object"!=typeof e.example&&console.warn("Invalid example: example must be an object."),void 0===e.scope||Array.isArray(e.scope)||console.warn("Invalid scope: scope must be an array of type WPBlockVariationScope."),void 0!==e.attributes&&"object"!=typeof e.attributes&&console.warn("Invalid attributes: attributes must be an object."),void 0!==e.attributes?.query&&"object"!=typeof e.attributes.query&&console.warn("Invalid query: query must be an object."),void 0!==e.attributes?.query?.offset&&"number"!=typeof e.attributes.query.offset&&console.warn("Invalid offset: offset must be a number."),void 0!==e.attributes?.query?.order&&"string"!=typeof e.attributes.query.order&&console.warn("Invalid order: order must be a string."),void 0!==e.attributes?.query?.orderBy&&"string"!=typeof e.attributes.query.orderBy&&console.warn("Invalid orderBy: orderBy must be a string."),void 0!==e.attributes?.query?.pages&&"number"!=typeof e.attributes.query.pages&&console.warn("Invalid pages: pages must be a number."),void 0!==e.attributes?.query?.perPage&&"number"!=typeof e.attributes.query.perPage&&console.warn("Invalid perPage: perPage must be a number."),void 0!==e.attributes?.query?.search&&"string"!=typeof e.attributes.query.search&&console.warn("Invalid search: search must be a string."),void 0!==e.attributes?.query?.taxQuery&&"object"!=typeof e.attributes.query.taxQuery&&console.warn("Invalid taxQuery: taxQuery must be an object."),void 0!==e.attributes?.query?.featured&&"boolean"!=typeof e.attributes.query.featured&&console.warn("Invalid featured: featured must be a boolean."),void 0!==e.attributes?.query?.timeFrame&&"object"!=typeof e.attributes.query.timeFrame&&console.warn("Invalid timeFrame: timeFrame must be an object."),void 0!==e.attributes?.query?.woocommerceOnSale&&"boolean"!=typeof e.attributes.query.woocommerceOnSale&&console.warn("Invalid woocommerceOnSale: woocommerceOnSale must be a boolean."),void 0===e.attributes?.query?.woocommerceStockStatus||Array.isArray(e.attributes.query.woocommerceStockStatus)||console.warn("Invalid woocommerceStockStatus: woocommerceStockStatus must be an array."),void 0===e.attributes?.query?.woocommerceAttributes||Array.isArray(e.attributes.query.woocommerceAttributes)||console.warn("Invalid woocommerceAttributes: woocommerceAttributes must be an array."),void 0===e.attributes?.query?.woocommerceHandPickedProducts||Array.isArray(e.attributes.query.woocommerceHandPickedProducts)||console.warn("Invalid woocommerceHandPickedProducts: woocommerceHandPickedProducts must be an array."),void 0!==e.attributes?.query?.priceRange&&"object"!=typeof e.attributes.query.priceRange&&console.warn("Invalid priceRange: priceRange must be an object."),void 0!==e.attributes?.displayLayout&&"object"!=typeof e.attributes.displayLayout&&console.warn("Invalid displayLayout: displayLayout must be an object."),void 0!==e.attributes?.dimensions&&"object"!=typeof e.attributes.dimensions&&console.warn("Invalid dimensions: dimensions must be an object."),void 0===e.attributes?.hideControls||Array.isArray(e.attributes.hideControls)||console.warn("Invalid hideControls: hideControls must be an array of strings."),void 0===e.attributes?.queryContextIncludes||Array.isArray(e.attributes.queryContextIncludes)||console.warn("Invalid queryContextIncludes: queryContextIncludes must be an array of strings."),void 0!==e.preview&&("object"==typeof e.preview&&null!==e.preview||console.warn("Invalid preview: preview must be an object."),void 0!==e.preview.setPreviewState&&"function"!=typeof e.preview.setPreviewState&&console.warn("Invalid preview: setPreviewState must be a function."),void 0!==e.preview.initialPreviewState&&("object"!=typeof e.preview.initialPreviewState&&console.warn("Invalid preview: initialPreviewState must be an object."),"boolean"!=typeof e.preview.initialPreviewState.isPreview&&console.warn("Invalid preview: preview.isPreview must be a boolean."),"string"!=typeof e.preview.initialPreviewState.previewMessage&&console.warn("Invalid preview: preview.previewMessage must be a string."))),!(void 0!==e.usesReference&&!Array.isArray(e.usesReference)&&(console.error("Invalid usesReference: usesReference must be an array of strings."),1)))))(e))return void console.error("Collection could not be registered due to invalid configuration.");const{preview:{setPreviewState:t,initialPreviewState:o}={},usesReference:r}=e,n=e.attributes?.query||{},a=[...new Set([B.INHERIT,...e.attributes?.hideControls||[]])],i={name:e.name,title:e.title,description:e.description,category:e.category,keywords:e.keywords,icon:e.icon,example:e.example,scope:e.scope,attributes:{...e.attributes,query:{...N,...void 0!==n.offset&&{offset:n.offset},...void 0!==n.order&&{order:n.order},...void 0!==n.orderBy&&{orderBy:n.orderBy},...void 0!==n.pages&&{pages:n.pages},...void 0!==n.perPage&&{perPage:n.perPage},...void 0!==n.search&&{search:n.search},...void 0!==n.taxQuery&&{taxQuery:n.taxQuery},...void 0!==n.featured&&{featured:n.featured},...void 0!==n.timeFrame&&{timeFrame:n.timeFrame},...void 0!==n.woocommerceOnSale&&{woocommerceOnSale:n.woocommerceOnSale},...void 0!==n.woocommerceStockStatus&&{woocommerceStockStatus:n.woocommerceStockStatus},...void 0!==n.woocommerceAttributes&&{woocommerceAttributes:n.woocommerceAttributes},...void 0!==n.woocommerceHandPickedProducts&&{woocommerceHandPickedProducts:n.woocommerceHandPickedProducts},...void 0!==n.priceRange&&{priceRange:n.priceRange}},hideControls:a,collection:e.name,inherit:!1},innerBlocks:e.innerBlocks||V,isActive:(e,t)=>e.collection===t.collection,isDefault:!1};if(t||o||Array.isArray(r)&&r.length>0){const e=e=>n=>n.attributes.collection!==i.name?(0,m.jsx)(e,{...n}):(0,m.jsx)(e,{...n,...o||t?{preview:{setPreviewState:t,initialPreviewState:o}}:{},usesReference:r});(0,q.addFilter)("editor.BlockEdit",i.name,e)}wp?.blocks?.registerBlockVariation&&wp.blocks.registerBlockVariation(D,{...i,attributes:{...U,...i.attributes,query:{...N,...i.attributes?.query},displayLayout:{...U.displayLayout,...i.attributes?.displayLayout}}})};(this.wc=this.wc||{}).wcBlocksRegistry=t})();
(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n;function o(e){if("string"!=typeof e||-1===e.indexOf("&"))return e;void 0===n&&(n=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea")),n.innerHTML=e;const t=n.textContent??"";return n.innerHTML="",t}e.r(t),e.d(t,{decodeEntities:()=>o}),(window.wp=window.wp||{}).htmlEntities=t})();
const registerPaymentMethod=window.wc.wcBlocksRegistry.registerPaymentMethod;
const getPaymentMethodData=window.wc.wcSettings.getPaymentMethodData;
const __=window.wp.i18n.__;
const settings=getPaymentMethodData('tabby_installments', {});
const defaultLabel='Pay in 4. No interest, no fees.';
const title=settings?.title||'';
const TabbyIcon=()=> {
return React.createElement('img', {
src: settings?.icon_src,
style: {marginRight:'10px'},
alt: title
}, null);
}
const TabbyInfo=()=> {
return React.createElement('img', settings?.config?.info, null);
}
const Label=()=> {
return [window.wp.element.createElement(TabbyIcon), React.createElement('span', null, title), window.wp.element.createElement(TabbyInfo)];
}
const InitTabbyCard=(className, classParams)=> {
if(eval('typeof ' + className)=='function'){
eval('new ' + className + '(' + classParams + ');');
return true;
}
return false;
};
const TabbyPromotionCard=()=> {
React.useEffect(()=> {
if(!InitTabbyCard(settings?.config?.jsClass, settings?.config?.jsConf)){
let timerId=setInterval(function (){
if(InitTabbyCard(settings?.config?.jsClass, settings?.config?.jsConf)){
clearInterval(timerId);
}}, 300);
}});
return React.createElement('div', {id: settings?.config?.id}, '');
}
const TabbyInstallmentsMethodName='tabby_installments';
const Content=()=> {
switch (settings?.config?.class){
case 'empty':
return null;
case 'tabbyDesc':
return React.createElement('span', null, settings?.config?.html||'');
default:
return window.wp.element.createElement(TabbyPromotionCard);
}};
const tabbyInstallmentsPaymentMethod={
name: TabbyInstallmentsMethodName,
label: Object(window.wp.element.createElement) (Label, null),
content: Object(window.wp.element.createElement) (Content, null),
edit: Object(window.wp.element.createElement) (Content, null),
canMakePayment: (props)=> {
return true;
},
ariaLabel: title,
placeOrderButtonLabel: __(
'Proceed to Tabby',
'tabby-checkout'
),
supports: {
features: settings?.supports ?? []
}};
registerPaymentMethod(tabbyInstallmentsPaymentMethod);