| @@ -1 +1,2 @@ | ||
| 1 | -(()=>{"use strict";var t={5795:t=>{t.exports=window.ReactDOM},9940:(t,e,n)=>{var r=n(5795);e.H=r.createRoot,r.hydrateRoot}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var l=e[r]={exports:{}};return t[r](l,l.exports,n),l.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=window.React;var o=n.n(r),l=n(9940);const s="@media only screen and (max-width: 1024px)",a="@media only screen and (max-width: 640px)",i=(t,e,n=!1)=>{return null==(r=e)||""===r||Array.isArray(r)&&0===r.length||"object"==typeof r&&0===Object.keys(r).length||"string"==typeof r&&""===r.trim()||"number"==typeof r&&0===r?"":`${t}: ${e}${n?" !important":""};`;var r},c=(t,e,n=!0)=>{const{fontFamily:r="Default",fontCategory:o="sans-serif",fontVariant:l=400,fontWeight:c,isUploadFont:u=!0,fontSize:$={desktop:null,tablet:null,mobile:null},fontStyle:f,textTransform:m,textDecoration:p,lineHeight:d,letterSpace:h}=e||{},y=!n||!r||"Default"===r,g=$?.desktop||$,x=$?.tablet||g,b=$?.mobile||x,v=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${y?"":`font-family: '${r}', ${o};`}\n\t\t${i("font-weight",c)}\n\t\t${i("font-size",v(g))}\n\t\t${i("font-style",f)}\n\t\t${i("text-transform",m)}\n\t\t${i("text-decoration",p)}\n\t\t${i("line-height",d)}\n\t\t${i("letter-spacing",h)}\n\t`,w=l&&400!==l?"400i"===l?":ital@1":l?.includes("00i")?`: ital, wght@1, ${l?.replace("00i","00")} `:`: wght@${l} `:"",S=y?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!u||y?"":`@import url(${S});`,styles:`${t}{\n\t\t\t${k}\n\t\t}\n\t\t${s} {\n\t\t\t${t}{\n\t\t\t\t${i("font-size",v(x))}\n\t\t\t}\n\t\t}\n\t\t${a} {\n\t\t\t${t}{\n\t\t\t\t${i("font-size",v(b))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},u=({attributes:t,id:e})=>{const{styles:n}=t,{container:o,title:l,path:u}=n,$=`#${e} .b-blocks-text-path-container`,f=`${$} .b-blocks-text-path-svg`,m=`${f} .b-blocks-text-path-title`,p=(t="normal")=>{const e=l[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,o)=>{const{hOffset:l="0px",vOffset:s="0px",blur:a="0px",spreed:i="0px",color:c="#e7f0fe",isInset:u=!1}=r||{},$=u?"inset":"",f=`${l} ${s} ${a}`,m=o+1>=t.length?"":", ";n+="text"===e?`${f} ${c}${m}`:`${f} ${i} ${c} ${$}${m}`})),n||""})(e.textShadow,"text"))}\n\t\t\t${n}\n\t\t`};return(0,r.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\n\t\t${c("",l.typo).googleFontLink}\n\n\t\t${c(m,l.typo).styles}\n\n\t\t${$}{\n\t\t\t${i("justify-content",o.desktop.alignment)}\n\t\t}\n\n\t\t${f}{\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${m}{\n\t\t\t${p("normal")}\t\t\n\t\t\ttransition: all ${l.transition}s ease-in-out;\n\t\t}\n\n\t\t${m}:hover{\n\t\t\t${p("hover")}\t\t\n\t\t}\n\t\t\n\t\t${s}{\n\t\t\t\t${$}{\n\t\t\t${i("justify-content",o.tablet.alignment)}\n\t\t\t}\n\t\t}\n\t\t${a}{\n\t\t\t\t${$}{\n\t\t\t${i("justify-content",o.mobile.alignment)}\n\t\t\t}\n\t\t}\n\t\t\n\t`}})};function $(t,e,n){return Math.max(e,Math.min(n,t))}function f(t){if("number"==typeof t)return $(t,0,1);const e=String(t).trim();if(e.endsWith("%"))return $(parseFloat(e.slice(0,-1))/100,0,1);const n=Number(e);return Number.isFinite(n)?$(n,0,1):0}const m=({pathSize:t=300,alignment:e="start",customPath:n="",customSvgPathSelector:l="",showIcon:s=!1,icon:a=null,iconSize:i=24,iconStartOffset:c="5%",iconEndOffset:u="95%",attributes:$})=>{const{icon:m,styles:p}=$,{type:d,iconType:h,title:y}=m,{path:g}=p,x="custom"===d?"library"===h?m.library:m.upload:"",b=(0,r.useMemo)((()=>`textPath-${Math.random().toString(36).slice(2)}`),[]),v=(0,r.useRef)(null),[k,w]=(0,r.useState)(null),[S,E]=(0,r.useState)(null),M=(0,r.useMemo)((()=>x?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,l=(e?n.querySelector(e):null)||n.querySelector("path"),s=l?.getAttribute("d")||null;return s?{viewBox:o,d:s}:null}catch{return null}}(x,l||null):null),[x,l]),O="custom"===d&&M?.viewBox||M?.viewBox||`0 0 ${t} ${t}`;(0,r.useEffect)((()=>{if(!s)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=f(c),r=f(u),o=t.getPointAtLength(e*n),l=t.getPointAtLength(e*r);w({x:o.x,y:o.y}),E({x:l.x,y:l.y})}),[s,c,u,t,d,n,x,M?.d]);const A=()=>{var t,e;return a&&o().isValidElement(a)?o().cloneElement(a,{...a.props,width:i,height:i,fill:null!==(t=a.props.fill)&&void 0!==t?t:"currentColor",stroke:null!==(e=a.props.stroke)&&void 0!==e?e:"currentColor",style:{display:"block",...a.props.style||{}}}):null};return(0,r.createElement)("div",{className:"b-blocks-text-path-container"},(0,r.createElement)("svg",{viewBox:O,style:{transition:"transform 0.3s ease"},className:"b-blocks-text-path-svg"},(0,r.createElement)("defs",null,(0,r.createElement)("path",{ref:v,id:b,d:(()=>{const e=t,r=t,o=e/2,l=r/2;switch(d){case"arc":return`M 50,${l+50} Q ${o},${l-100} ${e-50},${l+50}`;case"wave":{const t=40,n=2;let r=`M 0,${l}`;for(let o=0;o<=e;o+=5)r+=` L ${o},${l+t*Math.sin(o/e*Math.PI*n)}`;return r}case"circle":{const t=Math.min(e,r)/2-20;return`M ${o-t},${l}\n A ${t},${t} 0 1,1 ${o+t},${l}\n A ${t},${t} 0 1,1 ${o-t},${l}`}case"custom":return x&&M?.d?M.d:n||`M 50,${l} L ${e-50},${l}`;case"line":return`M 50,${l} L ${e-50},${l}`}})(),fill:"none",stroke:g.color,strokeWidth:g.thickness,strokeLinecap:"round",style:{transition:"stroke 0.3s ease"}})),(0,r.createElement)("use",{href:`#${b}`}),s&&k&&(0,r.createElement)("g",{transform:`translate(${k.x}, ${k.y})`},(0,r.createElement)("g",{transform:`translate(${-i/2}, ${-i/2})`,fill:g.color,stroke:g.color},A())),s&&S&&(0,r.createElement)("g",{transform:`translate(${S.x}, ${S.y})`},(0,r.createElement)("g",{transform:`translate(${-i/2}, ${-i/2})`,fill:g.color,stroke:g.color},A())),(0,r.createElement)("text",{className:"b-blocks-text-path-title",textAnchor:e},(0,r.createElement)("textPath",{href:`#${b}`,startOffset:g.staringPoint,style:{textAnchor:e}},y))))};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-text-path").forEach((t=>{const e=JSON.parse(t.dataset.attributes);(0,l.H)(t).render((0,r.createElement)(r.Fragment,null,(0,r.createElement)(u,{attributes:e,id:t.id}),(0,r.createElement)(m,{attributes:e}))),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")}))}))})(); | |