(()=>{"use strict";var e={d:(t,o)=>{for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},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,{isExternalProduct:()=>c,isProductResponseItem:()=>u,useProduct:()=>s});const o=window.wp.coreData,i=window.wp.data,r=window.wp.i18n,n={name:"product",kind:"root",baseURL:(0,window.wc.wcSettings.getSetting)("experimentalWcRestApiV4",!1)?"/wc/v4/products":"/wc/v3/products",label:(0,r.__)("Product","woocommerce"),plural:(0,r.__)("Products","woocommerce"),key:"id",supportsPagination:!0,getTitle:e=>e.name},d=[],s=e=>(0,i.useSelect)((t=>{if(!e)return{product:void 0,isResolving:!1};const i="string"==typeof e?parseInt(e,10):e;return{product:t(o.store).getEditedEntityRecord("root","product",i),isResolving:t(o.store).isResolving("getEditedEntityRecord",["root","product",i]),isResolutionFinished:t(o.store).hasFinishedResolution("getEditedEntityRecord",["root","product",i])}}),[e]),c=e=>"type"in e&&"external"===e.type,u=e=>!!e&&"id"in e&&0!==e.id;(()=>{if(d.includes(n.name))return;const{addEntities:e}=(0,i.dispatch)(o.store);e([n]),d.push(n.name)})(),(this.wc=this.wc||{}).wcEntities=t})();