| @@ -1 +1,2 @@ | ||
| 1 | -(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.ReactDOM,n="@media only screen and (max-width: 1024px)",r="@media only screen and (max-width: 640px)",o=window.React;var s=t.n(o);const l=(t,e)=>{return null==(n=e)||""===n||Array.isArray(n)&&0===n.length||"object"==typeof n&&0===Object.keys(n).length||"string"==typeof n&&""===n.trim()||"number"==typeof n&&0===n?"":`${t}: ${e};`;var n},i=(t,e,o=!0)=>{const{fontFamily:s="Default",fontCategory:i="sans-serif",fontVariant:a=400,fontWeight:c,isUploadFont:u=!0,fontSize:$={desktop:null,tablet:null,mobile:null},fontStyle:f,textTransform:h,textDecoration:d,lineHeight:p,letterSpace:m}=e||{},x=!o||!s||"Default"===s,y=$?.desktop||$,g=$?.tablet||y,b=$?.mobile||g,w=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},k=`\n\t\t${x?"":`font-family: '${s}', ${i};`}\n\t\t${l("font-weight",c)}\n\t\t${l("font-size",w(y))}\n\t\t${l("font-style",f)}\n\t\t${l("text-transform",h)}\n\t\t${l("text-decoration",d)}\n\t\t${l("line-height",p)}\n\t\t${l("letter-spacing",m)}\n\t`,S=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",v=x?"":`https://fonts.googleapis.com/css2?family=${s?.split(" ").join("+")}${S.replace(/ /g,"")}&display=swap`;return{googleFontLink:!u||x?"":`@import url(${v});`,styles:`${t}{\n\t\t\t${k}\n\t\t}\n\t\t${n} {\n\t\t\t${t}{\n\t\t\t\t${l("font-size",w(g))}\n\t\t\t}\n\t\t}\n\t\t${r} {\n\t\t\t${t}{\n\t\t\t\t${l("font-size",w(b))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},a=window.ReactJSXRuntime,c=({attributes:t,id:e})=>{const{styles:o}=t,{container:s,title:c,path:u}=o,$=`#${e} .b-blocks-text-path-container`,f=`${$} .b-blocks-text-path-svg`,h=`${f} .b-blocks-text-path-title`,d=(t="normal")=>{const e=c[t],n=e?.textStroke.isStroke?`${l("stroke-width",e.textStroke.size?e.textStroke.size+"px":"")}\n\t\t\t${l("stroke",e.textStroke.color)}`:"";return`\n\t\t\t${l("color",e.color)}\n\t\t\t${l("fill",e.color)}\n\t\t\t${l("text-shadow",((t,e="box")=>{let n="";return t?.map(((r,o)=>{const{hOffset:s="0px",vOffset:l="0px",blur:i="0px",spreed:a="0px",color:c="#e7f0fe",isInset:u=!1}=r||{},$=u?"inset":"",f=`${s} ${l} ${i}`,h=o+1>=t.length?"":", ";n+="text"===e?`${f} ${c}${h}`:`${f} ${a} ${c} ${$}${h}`})),n||""})(e.textShadow,"text"))}\n\t\t\t${n}\n\t\t`};return(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\n\t\t${i("",c.typo).googleFontLink}\n\n\t\t${i(h,c.typo).styles}\n\n\t\t${$}{\n\t\t\t${l("justify-content",s.desktop.alignment)}\n\t\t}\n\n\t\t${f}{\n\t\t\t${l("rotate",u.rotate?u.rotate+"deg":"")}\n\t\t\t${l("width",u.size)}\n\t\t\t${l("width",u.size)}\n\t\t}\n\n\t\t${h}{\n\t\t\t${d("normal")}\t\t\n\t\t\ttransition: all ${c.transition}s ease-in-out;\n\t\t}\n\n\t\t${h}:hover{\n\t\t\t${d("hover")}\t\t\n\t\t}\n\t\t\n\t\t${n}{\n\t\t\t\t${$}{\n\t\t\t${l("justify-content",s.tablet.alignment)}\n\t\t\t}\n\t\t}\n\t\t${r}{\n\t\t\t\t${$}{\n\t\t\t${l("justify-content",s.mobile.alignment)}\n\t\t\t}\n\t\t}\n\t\t\n\t`}})};function u(t,e,n){return Math.max(e,Math.min(n,t))}function $(t){if("number"==typeof t)return u(t,0,1);const e=String(t).trim();if(e.endsWith("%"))return u(parseFloat(e.slice(0,-1))/100,0,1);const n=Number(e);return Number.isFinite(n)?u(n,0,1):0}const f=({pathSize:t=300,alignment:e="start",customPath:n="",customSvgPathSelector:r="",showIcon:l=!1,icon:i=null,iconSize:c=24,iconStartOffset:u="5%",iconEndOffset:f="95%",attributes:h})=>{const{icon:d,styles:p}=h,{type:m,iconType:x,title:y}=d,{path:g}=p,b="custom"===m?"library"===x?d.library:d.upload:"",w=(0,o.useMemo)((()=>`textPath-${Math.random().toString(36).slice(2)}`),[]),k=(0,o.useRef)(null),[S,v]=(0,o.useState)(null),[j,M]=(0,o.useState)(null),O=(0,o.useMemo)((()=>b?function(t,e){if(!t||"string"!=typeof t)return null;if("undefined"==typeof window)return null;try{const n=(new DOMParser).parseFromString(t,"image/svg+xml"),r=n.querySelector("svg");if(!r)return null;const o=r.getAttribute("viewBox")||null,s=(e?n.querySelector(e):null)||n.querySelector("path"),l=s?.getAttribute("d")||null;return l?{viewBox:o,d:l}:null}catch{return null}}(b,r||null):null),[b,r]),A="custom"===m&&O?.viewBox||O?.viewBox||`0 0 ${t} ${t}`;(0,o.useEffect)((()=>{if(!l)return;const t=k.current;if(!t)return;let e=0;try{e=t.getTotalLength()}catch{return}if(!e||!Number.isFinite(e))return;const n=$(u),r=$(f),o=t.getPointAtLength(e*n),s=t.getPointAtLength(e*r);v({x:o.x,y:o.y}),M({x:s.x,y:s.y})}),[l,u,f,t,m,n,b,O?.d]);const L=()=>i&&s().isValidElement(i)?s().cloneElement(i,{...i.props,width:c,height:c,fill:i.props.fill??"currentColor",stroke:i.props.stroke??"currentColor",style:{display:"block",...i.props.style||{}}}):null;return(0,a.jsx)("div",{className:"b-blocks-text-path-container",children:(0,a.jsxs)("svg",{viewBox:A,style:{transition:"transform 0.3s ease"},className:"b-blocks-text-path-svg",children:[(0,a.jsx)("defs",{children:(0,a.jsx)("path",{ref:k,id:w,d:(()=>{const e=t,r=t,o=e/2,s=r/2;switch(m){case"arc":return`M 50,${s+50} Q ${o},${s-100} ${e-50},${s+50}`;case"wave":{const t=40,n=2;let r=`M 0,${s}`;for(let o=0;o<=e;o+=5)r+=` L ${o},${s+t*Math.sin(o/e*Math.PI*n)}`;return r}case"circle":{const t=Math.min(e,r)/2-20;return`M ${o-t},${s}\n A ${t},${t} 0 1,1 ${o+t},${s}\n A ${t},${t} 0 1,1 ${o-t},${s}`}case"custom":return b&&O?.d?O.d:n||`M 50,${s} L ${e-50},${s}`;case"line":return`M 50,${s} L ${e-50},${s}`}})(),fill:"none",stroke:g.color,strokeWidth:g.thickness,strokeLinecap:"round",style:{transition:"stroke 0.3s ease"}})}),(0,a.jsx)("use",{href:`#${w}`}),l&&S&&(0,a.jsx)("g",{transform:`translate(${S.x}, ${S.y})`,children:(0,a.jsx)("g",{transform:`translate(${-c/2}, ${-c/2})`,fill:g.color,stroke:g.color,children:L()})}),l&&j&&(0,a.jsx)("g",{transform:`translate(${j.x}, ${j.y})`,children:(0,a.jsx)("g",{transform:`translate(${-c/2}, ${-c/2})`,fill:g.color,stroke:g.color,children:L()})}),(0,a.jsx)("text",{className:"b-blocks-text-path-title",textAnchor:e,children:(0,a.jsx)("textPath",{href:`#${w}`,startOffset:g.staringPoint,style:{textAnchor:e},children:y})})]})})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-text-path").forEach((t=>{const n=JSON.parse(t.dataset.attributes);(0,e.createRoot)(t).render((0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{attributes:n,id:t.id}),(0,a.jsx)(f,{attributes:n})]})),t?.removeAttribute("data-attributes")}))}))})(); | |
| 1 | +(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.ReactDOM,n="@media only screen and (max-width: 1024px)",r="@media only screen and (max-width: 640px)",s=window.React;var o=t.n(s);new class{constructor(t={}){this.defaultOptions={allowedTags:["svg","g","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","defs","clipPath","mask","linearGradient","radialGradient","stop","style","title","desc"],allowedAttributes:["id","class","style","transform","xmlns","xmlns:xlink","version","baseProfile","xml:space","d","x","y","width","height","cx","cy","r","rx","ry","points","x1","y1","x2","y2","viewBox","preserveAspectRatio","overflow","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","opacity","color","paint-order","vector-effect","shape-rendering","display","visibility","clip-path","clip-rule","clipPathUnits","mask","maskUnits","maskContentUnits","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","fx","fy","fr","dx","dy","text-anchor","dominant-baseline","alignment-baseline","font-family","font-size","font-style","font-weight","letter-spacing","word-spacing","textLength","lengthAdjust","role","focusable","aria-hidden","aria-label","aria-labelledby","aria-describedby"],allowedProtocols:["http","https","data"],removeScripts:!0,removeEvents:!0,removeExternalResources:!0,sanitizeStyle:!0},this.options={...this.defaultOptions,...t},this.allowedTagSet=new Set(this.options.allowedTags.map((t=>t.toLowerCase()))),this.allowedAttributeSet=new Set(this.options.allowedAttributes.map((t=>t.toLowerCase())))}sanitize(t){if("string"!=typeof t||""===t.trim())return"";const e=(new DOMParser).parseFromString(t,"image/svg+xml"),n=e.documentElement;return!n||"svg"!==n.localName.toLowerCase()||e.getElementsByTagName("parsererror").length?"":(this.removeScripts(e),this.sanitizeElements(e),(new XMLSerializer).serializeToString(e.documentElement))}async sanitizeFile(t){const e=await fetch(t),n=await e.text();return this.sanitize(`${n}`)}removeScripts(t){this.options.removeScripts&&Array.from(t.querySelectorAll("*")).forEach((t=>{t.localName.toLowerCase().includes("script")&&t.remove()}))}sanitizeElements(t){Array.from(t.querySelectorAll("*")).forEach((t=>{const e=t.localName.toLowerCase();this.allowedTagSet.has(e)?("style"===e&&this.options.sanitizeStyle&&(t.textContent=this.sanitizeCss(t.textContent)),this.sanitizeAttributes(t)):t.remove()}))}sanitizeAttributes(t){Array.from(t.attributes).forEach((e=>{const n=e.name,r=n.toLowerCase(),s=e.value;if(this.options.removeEvents&&r.startsWith("on"))return void t.removeAttribute(n);if(this.options.removeExternalResources&&("href"===r||r.endsWith(":href"))&&!this.isAllowedUrl(s))return void t.removeAttribute(n);const o=r.replace("xlink:","");this.allowedAttributeSet.has(r)||this.allowedAttributeSet.has(o)?this.options.removeExternalResources&&this.hasExternalUrl(s)?t.removeAttribute(n):"style"===r&&this.options.sanitizeStyle&&t.setAttribute(n,this.sanitizeCss(s)):t.removeAttribute(n)}))}hasExternalUrl(t){return!("string"!=typeof t||!/url\s*\(/i.test(t))&&Array.from(t.matchAll(/url\s*\(\s*['"]?([^'")]*)/gi)).some((([,t])=>!t.trim().startsWith("#")))}isAllowedUrl(t){const e=String(t||"").trim();if(e.startsWith("#"))return!0;if(/^data:/i.test(e))return this.options.allowedProtocols.includes("data")&&/^data:image\/(png|jpe?g|gif|webp);base64,/i.test(e);try{return this.options.allowedProtocols.includes(new URL(e).protocol.replace(":",""))}catch{return!1}}sanitizeCss(t){return String(t||"").replace(/expression\s*\(/gi,"").replace(/javascript:/gi,"").replace(/behavior\s*:/gi,"").replace(/binding\s*:/gi,"").replace(/@import[^;]*;?/gi,"").replace(/url\s*\(\s*(['"]?)(?!#)[^)]*\)/gi,"none")}};const i=(t,e)=>{return null==(n=e)||""===n||Array.isArray(n)&&0===n.length||"object"==typeof n&&0===Object.keys(n).length||"string"==typeof n&&""===n.trim()||"number"==typeof n&&0===n?"":`${t}: ${e};`;var n},l=(t,e,s=!0)=>{const{fontFamily:o="Default",fontCategory:l="sans-serif",fontVariant:a=400,fontWeight:c,isUploadFont:u=!0,fontSize:h={desktop:null,tablet:null,mobile:null},fontStyle:p,textTransform:d,textDecoration:m,lineHeight:f,letterSpace:$}=e||{},g=!s||!o||"Default"===o,y=h?.desktop||h,x=h?.tablet||y,b=h?.mobile||x,w=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},v=`\n\t\t${g?"":`font-family: '${o}', ${l};`}\n\t\t${i("font-weight",c)}\n\t\t${i("font-size",w(y))}\n\t\t${i("font-style",p)}\n\t\t${i("text-transform",d)}\n\t\t${i("text-decoration",m)}\n\t\t${i("line-height",f)}\n\t\t${i("letter-spacing",$)}\n\t`,S=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",k=g?"":`https://fonts.googleapis.com/css2?family=${o?.split(" ").join("+")}${S.replace(/ /g,"")}&display=swap`;return{googleFontLink:!u||g?"":`@import url(${k});`,styles:`${t}{\n\t\t\t${v}\n\t\t}\n\t\t${n} {\n\t\t\t${t}{\n\t\t\t\t${i("font-size",w(x))}\n\t\t\t}\n\t\t}\n\t\t${r} {\n\t\t\t${t}{\n\t\t\t\t${i("font-size",w(b))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},a=window.ReactJSXRuntime,c=({attributes:t,id:e})=>{const{styles:s}=t,{container:o,title:c,path:u}=s,h=`#${e} .b-blocks-text-path-container`,p=`${h} .b-blocks-text-path-svg`,d=`${p} .b-blocks-text-path-title`,m=(t="normal")=>{const e=c[t],n=e?.textStroke.isStroke?`${i("stroke-width",e.textStroke.size?e.textStroke.size+"px":"")}\n\t\t\t${i("stroke",e.textStroke.color)}`:"";return`\n\t\t\t${i("color",e.color)}\n\t\t\t${i("fill",e.color)}\n\t\t\t${i("text-shadow",((t,e="box")=>{let n="";return t?.map(((r,s)=>{const{hOffset:o="0px",vOffset:i="0px",blur:l="0px",spreed:a="0px",color:c="#e7f0fe",isInset:u=!1}=r||{},h=u?"inset":"",p=`${o} ${i} ${l}`,d=s+1>=t.length?"":", ";n+="text"===e?`${p} ${c}${d}`:`${p} ${a} ${c} ${h}${d}`})),n||""})(e.textShadow,"text"))}\n\t\t\t${n}\n\t\t`};return(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\n\t\t${l("",c.typo).googleFontLink}\n\n\t\t${l(d,c.typo).styles}\n\n\t\t${h}{\n\t\t\t${i("justify-content",o.desktop.alignment)}\n\t\t}\n\n\t\t${p}{\n\t\t\t${i("rotate",u.rotate?u.rotate+"deg":"")}\n\t\t\t${i("width",u.size)}\n\t\t\t${i("width",u.size)}\n\t\t}\n\n\t\t${d}{\n\t\t\t${m("normal")}\t\t\n\t\t\ttransition: all ${c.transition}s ease-in-out;\n\t\t}\n\n\t\t${d}:hover{\n\t\t\t${m("hover")}\t\t\n\t\t}\n\t\t\n\t\t${n}{\n\t\t\t\t${h}{\n\t\t\t${i("justify-content",o.tablet.alignment)}\n\t\t\t}\n\t\t}\n\t\t${r}{\n\t\t\t\t${h}{\n\t\t\t${i("justify-content",o.mobile.alignment)}\n\t\t\t}\n\t\t}\n\t\t\n\t`}})};function u(t,e,n){return Math.max(e,Math.min(n,t))}function h(t){if("number"==typeof t)return u(t,0,1);const e=String(t).trim();if(e.endsWith("%"))return u(parseFloat(e.slice(0,-1))/100,0,1);const n=Number(e);return Number.isFinite(n)?u(n,0,1):0}const p=({pathSize:t=300,alignment:e="start",customPath:n="",customSvgPathSelector:r="",showIcon:i=!1,icon:l=null,iconSize:c=24,iconStartOffset:u="5%",iconEndOffset:p="95%",attributes:d})=>{const{icon:m,styles:f}=d,{type:$,iconType:g,title:y}=m,{path:x}=f,b="custom"===$?"library"===g?m.library:m.upload:"",w=(0,s.useMemo)((()=>`textPath-${Math.random().toString(36).slice(2)}`),[]),v=(0,s.useRef)(null),[S,k]=(0,s.useState)(null),[A,j]=(0,s.useState)(null),z=(0,s.useMemo)((()=>b?function(t,e){if(!t||"string"!=typeof t)return null;if("undefined"==typeof window)return null;try{const n=(new DOMParser).parseFromString(t,"image/svg+xml"),r=n.querySelector("svg");if(!r)return null;const s=r.getAttribute("viewBox")||null,o=(e?n.querySelector(e):null)||n.querySelector("path"),i=o?.getAttribute("d")||null;return i?{viewBox:s,d:i}:null}catch{return null} | |
| 2 | +}(b,r||null):null),[b,r]),E="custom"===$&&z?.viewBox||z?.viewBox||`0 0 ${t} ${t}`;(0,s.useEffect)((()=>{if(!i)return;const t=v.current;if(!t)return;let e=0;try{e=t.getTotalLength()}catch{return}if(!e||!Number.isFinite(e))return;const n=h(u),r=h(p),s=t.getPointAtLength(e*n),o=t.getPointAtLength(e*r);k({x:s.x,y:s.y}),j({x:o.x,y:o.y})}),[i,u,p,t,$,n,b,z?.d]);const L=()=>l&&o().isValidElement(l)?o().cloneElement(l,{...l.props,width:c,height:c,fill:l.props.fill??"currentColor",stroke:l.props.stroke??"currentColor",style:{display:"block",...l.props.style||{}}}):null;return(0,a.jsx)("div",{className:"b-blocks-text-path-container",children:(0,a.jsxs)("svg",{viewBox:E,style:{transition:"transform 0.3s ease"},className:"b-blocks-text-path-svg",children:[(0,a.jsx)("defs",{children:(0,a.jsx)("path",{ref:v,id:w,d:(()=>{const e=t,r=t,s=e/2,o=r/2;switch($){case"arc":return`M 50,${o+50} Q ${s},${o-100} ${e-50},${o+50}`;case"wave":{const t=40,n=2;let r=`M 0,${o}`;for(let s=0;s<=e;s+=5)r+=` L ${s},${o+t*Math.sin(s/e*Math.PI*n)}`;return r}case"circle":{const t=Math.min(e,r)/2-20;return`M ${s-t},${o}\n A ${t},${t} 0 1,1 ${s+t},${o}\n A ${t},${t} 0 1,1 ${s-t},${o}`}case"custom":return b&&z?.d?z.d:n||`M 50,${o} L ${e-50},${o}`;case"line":return`M 50,${o} L ${e-50},${o}`}})(),fill:"none",stroke:x.color,strokeWidth:x.thickness,strokeLinecap:"round",style:{transition:"stroke 0.3s ease"}})}),(0,a.jsx)("use",{href:`#${w}`}),i&&S&&(0,a.jsx)("g",{transform:`translate(${S.x}, ${S.y})`,children:(0,a.jsx)("g",{transform:`translate(${-c/2}, ${-c/2})`,fill:x.color,stroke:x.color,children:L()})}),i&&A&&(0,a.jsx)("g",{transform:`translate(${A.x}, ${A.y})`,children:(0,a.jsx)("g",{transform:`translate(${-c/2}, ${-c/2})`,fill:x.color,stroke:x.color,children:L()})}),(0,a.jsx)("text",{className:"b-blocks-text-path-title",textAnchor:e,children:(0,a.jsx)("textPath",{href:`#${w}`,startOffset:x.staringPoint,style:{textAnchor:e},children:y})})]})})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-text-path").forEach((t=>{const n=JSON.parse(t.dataset.attributes);(0,e.createRoot)(t).render((0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{attributes:n,id:t.id}),(0,a.jsx)(p,{attributes:n})]})),t?.removeAttribute("data-attributes")}))}))})(); | |