(()=>{"use strict";const e=window.wp.blocks,t=JSON.parse('{"UU":"jetix-store-toolkit/social-sharing"}'),i=window.wp.blockEditor,o=window.wp.components,s=window.wp.i18n,r=window.ReactJSXRuntime,l="#008710",n="rgba(0,135,16,0.08)",a={wrap:{position:"relative",display:"block",padding:"20px 20px 20px 24px",background:"#fafafa",border:"1px solid #e2e2e4",borderLeft:`3px solid ${l}`,borderRadius:"6px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',userSelect:"none"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"10px",marginBottom:"6px"},titleRow:{display:"flex",alignItems:"center",gap:"10px"},iconWrap:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",background:n,borderRadius:"6px",color:l,flexShrink:0},title:{margin:0,fontSize:"13px",fontWeight:600,lineHeight:1.3,color:"#262626"},badge:{display:"inline-flex",alignItems:"center",padding:"2px 7px",background:n,border:`1px solid ${l}`,borderRadius:"20px",fontSize:"10px",fontWeight:700,letterSpacing:"0.04em",color:l,textTransform:"uppercase",flexShrink:0},description:{margin:0,fontSize:"12px",color:"#858586",lineHeight:1.5,paddingLeft:"38px"}};function d({title:e,description:t,icon:i}){return(0,r.jsxs)("div",{style:a.wrap,children:[(0,r.jsxs)("div",{style:a.header,children:[(0,r.jsxs)("div",{style:a.titleRow,children:[i&&(0,r.jsx)("div",{style:a.iconWrap,"aria-hidden":"true",children:i}),(0,r.jsx)("p",{style:a.title,children:e})]}),(0,r.jsx)("span",{style:a.badge,children:"STK"})]}),t&&(0,r.jsx)("p",{style:a.description,children:t})]})}const c="#5a4000",p={wrap:{marginTop:"10px",padding:"8px 12px",background:"#fff8e1",border:"1px solid #f5c842",borderRadius:"4px",fontSize:"12px",color:c,lineHeight:1.5},link:{color:c,fontWeight:600}};function x({moduleSlug:e,moduleLabel:t,secondarySlug:i,secondaryLabel:o}){const l=window.jwpStkBlocksData?.activeModules??[],n=!l.includes(e),a=i&&!l.includes(i);if(!n&&!a)return null;const d=window.jwpStkDashboard?.adminUrl?window.jwpStkDashboard.adminUrl+"admin.php?page=jwp-stk-modules":"#";return(0,r.jsxs)("div",{style:p.wrap,children:[n&&(0,r.jsxs)("p",{style:{margin:a?"0 0 4px":0},children:[(0,s.__)("The ","jetix-store-toolkit"),(0,r.jsx)("strong",{children:t}),(0,s.__)(" module is not active. ","jetix-store-toolkit"),(0,r.jsx)("a",{href:d,style:p.link,children:(0,s.__)("Enable it in Store Toolkit → Modules","jetix-store-toolkit")}),(0,s.__)(" for this block to display anything on the frontend.","jetix-store-toolkit")]}),a&&(0,r.jsxs)("p",{style:{margin:0},children:[(0,s.__)("The ","jetix-store-toolkit"),(0,r.jsx)("strong",{children:o}),(0,s.__)(" module must also be active for this block to work correctly.","jetix-store-toolkit")]})]})}const h=(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"18",cy:"5",r:"3"}),(0,r.jsx)("circle",{cx:"6",cy:"12",r:"3"}),(0,r.jsx)("circle",{cx:"18",cy:"19",r:"3"}),(0,r.jsx)("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),(0,r.jsx)("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]});(0,e.registerBlockType)(t.UU,{edit:function({attributes:e,setAttributes:t}){const l=(0,i.useBlockProps)(),{context:n="product"}=e,a={product:(0,s.__)("Product Page","jetix-store-toolkit"),wishlist:(0,s.__)("Wishlist Page","jetix-store-toolkit")},c="wishlist"===n?(0,s.__)("Renders social sharing buttons for the wishlist page. Requires the Wishlist module to be active.","jetix-store-toolkit"):(0,s.__)("Renders social sharing buttons for the current product. Place inside a product template or query loop.","jetix-store-toolkit");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.InspectorControls,{children:(0,r.jsxs)(o.PanelBody,{title:(0,s.__)("Social Sharing Settings","jetix-store-toolkit"),children:[(0,r.jsx)(o.SelectControl,{label:(0,s.__)("Context","jetix-store-toolkit"),value:n,options:[{value:"product",label:(0,s.__)("Product Page","jetix-store-toolkit")},{value:"wishlist",label:(0,s.__)("Wishlist Page","jetix-store-toolkit")}],onChange:e=>t({context:e}),help:(0,s.__)("Choose whether this block displays product sharing links or wishlist sharing links.","jetix-store-toolkit")}),"wishlist"===n&&(0,r.jsx)("p",{style:{fontSize:"12px",color:"#757575",marginTop:"4px"},children:(0,s.__)("The Wishlist module must be active for sharing buttons to appear on the wishlist page.","jetix-store-toolkit")})]})}),(0,r.jsxs)("div",{...l,children:[(0,r.jsx)(d,{title:(0,s.__)("Social Sharing","jetix-store-toolkit")+" — "+a[n],description:c,icon:h}),(0,r.jsx)(x,{moduleSlug:"social-sharing",moduleLabel:(0,s.__)("Social Sharing","jetix-store-toolkit"),secondarySlug:"wishlist"===n?"wishlist":void 0,secondaryLabel:"wishlist"===n?(0,s.__)("Wishlist","jetix-store-toolkit"):void 0})]})]})},save:()=>null})})();