| 1 |
(()=>{"use strict";const t=window.ReactDOM,e=window.React,r=(t,e="box")=>{const{hOffset:r="0px",vOffset:s="0px",blur:n="0px",spreed:a="0px",color:i="#7090b0",isInset:c=!1}=t||{},l=`${r} ${s} ${n}`;return("text"===e?`${l} ${i}`:`${l} ${a} ${i} ${c?"inset":""}`)||"none"},s=t=>{const{side:e=2,vertical:r="0px",horizontal:s="0px",top:n="0px",right:a="0px",bottom:i="0px",left:c="0px"}=t||{};return 2===e?`${r} ${s}`:`${n} ${a} ${i} ${c}`},n="bBlocksPricingTable",a=window.ReactJSXRuntime,i=({attributes:t,id:e,isStandard:i})=>{const{pricingTables:c,columnGap:l,rowGap:o,textAlign:d,padding:p,shadow:u}=t,m=`#${e}`,x=`${m} .${n}`;return(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${x}{\n\t\t\tgrid-gap: ${o} ${l};\n\t\t\ttext-align: ${d};\n\t\t\tpadding: ${i?"30px 0":"0"}\n\t\t}\n\t\t${x} .priceItem{\n\t\t\tpadding: ${s(p)};\n\t\t\tbox-shadow: ${r(u)};\n\t\t}\n\n\t\t${c?.map(((t,e)=>{const{color:r}=t,s=`${x} #priceItem-${e} .priceItem`,a=t=>`${m}.is-style-${t} .${n} #priceItem-${e} .priceItem`;return`\n\t\t\t\t${s} .priceName,\n\t\t\t\t${a("basic")} .priceAmountWrap,\n\t\t\t\t${a("standard")} .priceAmountWrap{\n\t\t\t\t\tcolor: ${r};\n\t\t\t\t}\n\t\t\t\t${s} .priceLink,\n\t\t\t\t${a("basic")} .priceName,\n\t\t\t\t${a("standard")}::before,\n\t\t\t\t${a("ultimate")} .priceAmountWrap{\n\t\t\t\t\tcolor: #fff;\n\t\t\t\t\tbackground-color: ${r};\n\t\t\t\t}\n\t\t\t\t${a("basic")} .priceName::before{\n\t\t\t\t\tborder-top-color: ${r};\n\t\t\t\t}\n\t\t\t`})).join(" ")}\n\t\t`.replace(/\s+/g," ")}})},c=t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)?e.toString():null}catch(e){return"string"==typeof t&&t.startsWith("/")&&!t.startsWith("//")?t:null}},l=t=>{const e=(new DOMParser).parseFromString(t,"text/html"),r=["b","strong","i","em","span","a","br"],s=["style","href","target","rel","class"];return e.body.querySelectorAll("*").forEach((t=>{r.includes(t.tagName.toLowerCase())?[...t.attributes].forEach((e=>{if(s.includes(e.name)||t.removeAttribute(e.name),"href"===e.name){const r=c(e.value);r?t.setAttribute("href",r):t.removeAttribute("href")}})):t.remove()})),e.body.innerHTML},o=(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"priceFeatureEnabled",viewBox:"0 0 512 512",children:(0,a.jsx)("path",{fill:"#01944e",d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"})}),d=(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"priceFeatureDisabled",viewBox:"0 0 352 512",children:(0,a.jsx)("path",{fill:"#f00025",d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})}),p=({features:t})=>(0,a.jsx)("div",{className:"priceFeatures",children:t?.map(((t,e)=>{const{isEnable:r,label:s}=t;return(0,a.jsxs)("div",{className:"priceFeature",children:[r?o:d,(0,a.jsx)("span",{className:"priceFeatureLabel",dangerouslySetInnerHTML:{__html:l(s)}})]},e)}))}),u=({attributes:t,id:r,isBasic:s,isStandard:i,isUltimate:o})=>{const{pricingTables:d,columns:u}=t;(0,e.useEffect)((()=>{const t=document.querySelectorAll(`#${r} .priceItem .priceFeatures`),e=[];t?.forEach((t=>{e.push(t?.clientHeight)})),t?.forEach((t=>{t.style.height=Math.max(...e)+"px"}))}),[d]);const m=({priceTable:t,index:r})=>{const{name:n,price:d,priceCurrency:u,period:m,link:x,linkLabel:$,features:b}=t,h=(0,e.useRef)(null),f=(0,e.useRef)(null);(0,e.useEffect)((()=>{if(o){const t=h?.current?.clientHeight/100*82;f.current.style.width=`${t}px`,f.current.style.top=t/2+"px",f.current.style.left=-t/2+60+"px"}}),[]);const g=(0,a.jsxs)("span",{className:"priceAmount",children:[u,d]}),j=(0,a.jsx)("span",{className:"pricePeriod",dangerouslySetInnerHTML:{__html:l(m)}});return(0,a.jsx)("div",{id:`priceItem-${r}`,children:(0,a.jsxs)("div",{className:"priceItem",ref:h,children:[(0,a.jsx)("h3",{className:"priceName",dangerouslySetInnerHTML:{__html:l(n)}}),i||o?(0,a.jsxs)("div",{className:"priceAmountWrap",ref:f,children:[g,m?" / ":"",j]}):"",(0,a.jsx)(p,{features:b}),i||o?"":(0,a.jsx)("div",{className:"priceAmountWrap",children:g}),!s&&(0,a.jsx)("br",{}),$&&(0,a.jsx)("a",{className:"priceLink",href:c(x),dangerouslySetInnerHTML:{__html:l($)}})]})},r)};return(0,a.jsx)("div",{className:`${n} columns-${u.desktop} columns-tablet-${u.tablet} columns-mobile-${u.mobile}`,children:d?.map(((t,e)=>(0,a.jsx)(m,{priceTable:t,index:e},e)))})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-pricing-table").forEach((e=>{const r=JSON.parse(e.dataset.attributes),s=e.className.includes("basic"),n=e.className.includes("standard"),c=e.className.includes("ultimate");(0,t.createRoot)(e).render((0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i,{attributes:r,id:e.id,isStandard:n}),(0,a.jsx)(u,{attributes:r,id:e.id,isBasic:s,isStandard:n,isUltimate:c})]})),e?.removeAttribute("data-attributes")}))}))})(); |