(()=>{"use strict";const t=window.wp.blocks,e=window.wp.blockEditor,o=window.wp.components,l=window.wp.i18n,a=window.wp.element,s=window.ReactJSXRuntime,i=({isPro:t,children:e})=>t?e:(0,s.jsxs)("div",{className:"pro-lock-wrapper",style:{position:"relative",cursor:"not-allowed"},children:[(0,s.jsx)("div",{style:{opacity:.4,pointerEvents:"none",filter:"grayscale(100%)"},children:e}),(0,s.jsx)("a",{href:"https://rswpthemes.com/author-portfolio-pro-wordpress-theme/",target:"_blank",rel:"noopener noreferrer",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:10,cursor:"pointer"},"aria-label":"Upgrade to Pro",children:(0,s.jsx)(o.Tooltip,{text:"🔒 Pro Feature - Click to Upgrade",children:(0,s.jsx)("div",{style:{width:"100%",height:"100%"}})})})]}),r=[["awt/child-author-fact-card",{icon:"🎨",text:"My favorite color is rainbow!"}],["awt/child-author-fact-card",{icon:"🍕",text:"I love pizza with extra cheese!"}],["awt/child-author-fact-card",{icon:"🐶",text:"I have a dog named Buddy!"}],["awt/child-author-fact-card",{icon:"📚",text:"I read 20 books this year!"}]],n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"awt/child-author-fun-facts","title":"Fun Facts (Child Author)","category":"author-website-templates","icon":"smiley","description":"Display fun facts with colorful background and repeatable fact cards","keywords":["fun-facts","about","facts","child-author"],"textdomain":"author-website-templates","editorScript":"file:./index.js","attributes":{"align":{"type":"string","default":"full"},"heading":{"type":"string","default":"My Fun Facts!"},"sectionBgColor":{"type":"string","default":""},"headingColor":{"type":"string","default":""},"blockId":{"type":"string","default":""},"factsStyle":{"type":"string","default":"fun"}},"providesContext":{"awt/factsStyle":"factsStyle"},"supports":{"html":false,"align":["full"]},"style":"file:./index.css"}');(0,t.registerBlockType)(n.name,{...n,edit:function({attributes:t,setAttributes:n,clientId:c}){const{heading:d,sectionBgColor:h,headingColor:p,blockId:u,factsStyle:x}=t,g=window.awtVars?.isPro||!1;(0,a.useEffect)(()=>{u||n({blockId:c})},[u,c,n]);const w="fun"===x||!x,m=h?"py-24 text-white":`py-24 ${w?"bg-coral-pop":"text-white"} text-white`,b=w?"text-4xl md:text-5xl font-black text-center mb-12":"text-3xl md:text-4xl font-serif font-bold text-center mb-16",f=w?"grid grid-cols-1 md:grid-cols-2 gap-8 text-xl font-bold":"grid grid-cols-1 md:grid-cols-2 gap-6",y=w?"max-w-4xl":"max-w-5xl",k=(0,e.useBlockProps)({className:`block-${u} ${m}`,style:{backgroundColor:h||(w?void 0:"#1e293b")}}),v=(0,e.useInnerBlocksProps)({className:f},{allowedBlocks:["awt/child-author-fact-card"],template:r});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e.InspectorControls,{children:[(0,s.jsx)(o.PanelBody,{title:(0,l.__)("Style Settings","author-website-templates"),initialOpen:!0,children:(0,s.jsx)(o.SelectControl,{label:(0,l.__)("Block Style","author-website-templates"),value:x,options:[{label:(0,l.__)("Fun (Child)","author-website-templates"),value:"fun"},{label:(0,l.__)("Elegant (Author)","author-website-templates"),value:"elegant"}],onChange:t=>n({factsStyle:t})})}),(0,s.jsxs)(o.PanelBody,{title:(0,l.__)("Design Settings","author-website-templates"),initialOpen:!1,children:[!g&&(0,s.jsx)(o.Notice,{status:"warning",isDismissible:!1,children:(0,l.__)("🔒 Upgrade to Pro to unlock styling controls","author-website-templates")}),(0,s.jsx)(i,{isPro:g,children:(0,s.jsx)(e.PanelColorSettings,{title:(0,l.__)("Colors","author-website-templates"),colorSettings:[{value:h,onChange:t=>n({sectionBgColor:t}),label:(0,l.__)("Section Background","author-website-templates")},{value:p,onChange:t=>n({headingColor:t}),label:(0,l.__)("Heading Color","author-website-templates")}]})})]})]}),(0,s.jsx)("section",{...k,children:(0,s.jsxs)("div",{className:`awt-container ${y} mx-auto px-6`,children:[(0,s.jsx)(e.RichText,{tagName:"h2",className:b,value:d,onChange:t=>n({heading:t}),placeholder:(0,l.__)("Section heading...","author-website-templates"),style:{color:p||void 0}}),(0,s.jsx)("div",{...v})]})})]})},save:function({attributes:t}){const{heading:o,sectionBgColor:l,headingColor:a,blockId:i,factsStyle:r}=t,n="fun"===r||!r,c=l?"py-24 text-white":`py-24 ${n?"bg-coral-pop":"text-white"} text-white`,d=n?"text-4xl md:text-5xl font-black text-center mb-12":"text-3xl md:text-4xl font-serif font-bold text-center mb-16",h=n?"grid grid-cols-1 md:grid-cols-2 gap-8 text-xl font-bold":"grid grid-cols-1 md:grid-cols-2 gap-6",p=n?"max-w-4xl":"max-w-5xl",u=e.useBlockProps.save({className:`block-${i} ${c}`,style:{backgroundColor:l||(n?void 0:"#1e293b")}}),x=e.useInnerBlocksProps.save({className:h});return(0,s.jsx)("section",{...u,children:(0,s.jsxs)("div",{className:`awt-container ${p} mx-auto px-6`,children:[(0,s.jsx)(e.RichText.Content,{tagName:"h2",className:d,value:o,style:{color:a||void 0}}),(0,s.jsx)("div",{...x})]})})}})})();