| @@ -1 +1,4 @@ | ||
| 1 | -(()=>{"use strict";var t={5795:t=>{t.exports=window.ReactDOM},8744:(t,n,e)=>{var o=e(5795);n.H=o.createRoot,o.hydrateRoot}},n={};const e=window.React;var o=function e(o){var a=n[o];if(void 0!==a)return a.exports;var r=n[o]={exports:{}};return t[o](r,r.exports,e),r.exports}(8744);const a=t=>!(null==t||""===t||Array.isArray(t)&&0===t.length||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&""===t.trim()||"number"==typeof t&&0===t),r="@media only screen and (max-width: 1024px)",l="@media only screen and (max-width: 640px)",i="linear-gradient(135deg, #0040E3, #18D4FD)",s=(t,n,e=!1)=>a(n)?`${t}: ${n}${e?" !important":""};`:"",c=(t,n=!0,e=!0,o=!0)=>{const{type:a="solid",color:r="",gradient:l=i,image:c={},position:b="center center",attachment:d="",repeat:$="no-repeat",size:u="",overlayColor:v=""}=t||{};return"gradient"===a&&e?s("background",l):"image"===a&&o?`background: url(${c?.url});\n\t\t\t\t${s("background-color",v)}\n\t\t\t\t${s("background-position",b)}\n\t\t\t\t${s("background-size",u)}\n\t\t\t\t${s("background-repeat",$)}\n\t\t\t\t${s("background-attachment",d)}\n\t\t\t\t${s("background-repeat",$)}\n\t\t\t\tbackground-blend-mode: overlay;`:n&&s("background",r)},b=t=>{if(!t)return"";const n=t=>{const{color:n="#000000",style:e="solid",width:o="0px"}=t;return`${o} ${e} ${n}`};return"object"!=typeof t||Array.isArray(t)?"":t.hasOwnProperty("top")||t.hasOwnProperty("right")||t.hasOwnProperty("bottom")||t.hasOwnProperty("left")?["top","right","bottom","left"].map((e=>t[e]?`border-${e}: ${n(t[e])};`:"")).join(" ").trim():s("border",n(t))},d=(t,n,e=!0)=>{const{fontFamily:o="Default",fontCategory:a="sans-serif",fontVariant:i=400,fontWeight:c,isUploadFont:b=!0,fontSize:d={desktop:null,tablet:null,mobile:null},fontStyle:$,textTransform:u,textDecoration:v,lineHeight:m,letterSpace:p}=n||{},h=!e||!o||"Default"===o,g=d?.desktop||d,k=d?.tablet||g,f=d?.mobile||k,y=t=>{const n=String(t);return["px","em","rem","%","vh","vw"].some((t=>n.endsWith(t)))?n:"number"==typeof t?`${n}px`:""},w=`\n\t\t${h?"":`font-family: '${o}', ${a};`}\n\t\t${s("font-weight",c)}\n\t\t${s("font-size",y(g))}\n\t\t${s("font-style",$)}\n\t\t${s("text-transform",u)}\n\t\t${s("text-decoration",v)}\n\t\t${s("line-height",m)}\n\t\t${s("letter-spacing",p)}\n\t`,x=i&&400!==i?"400i"===i?":ital@1":i?.includes("00i")?`: ital, wght@1, ${i?.replace("00i","00")} `:`: wght@${i} `:"",S=h?"":`https://fonts.googleapis.com/css2?family=${o?.split(" ").join("+")}${x.replace(/ /g,"")}&display=swap`;return{googleFontLink:!b||h?"":`@import url(${S});`,styles:`${t}{\n\t\t\t${w}\n\t\t}\n\t\t${r} {\n\t\t\t${t}{\n\t\t\t\t${s("font-size",y(k))}\n\t\t\t}\n\t\t}\n\t\t${l} {\n\t\t\t${t}{\n\t\t\t\t${s("font-size",y(f))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},$=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const n=["top","right","bottom","left"];return n.map((n=>t[n]||"")).every((t=>!t))?"":n.map((n=>t[n]||"0")).join(" ")}return""},u=(t,n)=>{const{tabs:e,styles:o}=t,{tabContainer:i,tabs:u,tabTitle:v,tabSubTitle:m,icon:p,content:h}=o,g=`#${n} .b-blocks-advanced-tabs-main-wrapper`,k=`${g} .b-blocks-advanced-tabs-wrapper`,f=`${k} .b-blocks-advanced-tabs-button-lists`,y=`${f} .b-blocks-advanced-tabs-button`,w=`${y}.b-blocks-advanced-tabs-button-active`,x=`${y}.b-blocks-advanced-tabs-button-normal`,S=`${y} .b-blocks-advanced-tabs-button-title-container`,A=`${S} .b-blocks-advanced-tabs-button-title`,T=`${w} .b-blocks-advanced-tabs-button-title`,E=`${S} .b-blocks-advanced-tabs-button-subTitle`,J=`${w} .b-blocks-advanced-tabs-button-subTitle`,j=`${y} .b-blocks-advanced-tabs-button-icon`,z=`${g} .b-blocks-advanced-tabs-contents`,L=(t="desktop")=>"row-reverse"===e?.[t].direction||"row"===e?.[t].direction,N=(t="desktop")=>"column"===e?.[t].direction||"column-reverse"===e?.[t].direction,C=(t="normal",n="normal",e="desktop")=>`\n\t\t\t\t\t${s("margin",$(u[t][n][e].margin))}\n\t\t\t\t\t${s("padding",$(u[t][n][e].padding))}\n\t\t\t\t\t${s("border-radius",$(u[t][n][e].radius))}\n\t\t\t\t\t${"desktop"===e?c(u[t][n].bg):""}\n\t\t\t\t\t${"desktop"===e?b(u[t][n].border):""}\n\t\t\t\t`,D=(t="normal",n="normal",e="desktop")=>`\n\t\t\t\t${s("margin",$(p[t][n][e].margin))}\n\t\t\t\t${s("padding",$(p[t][n][e].padding))}\n\t\t\t\t${s("border-radius",$(p[t][n][e].radius))}\n\t\t\t\t${"desktop"===e?c(p[t][n].bg):""}\n\t\t\t\t${"desktop"===e?b(p[t][n].border):""}\n\t`,O=["row","row-reverse"],F=["column","column-reverse"];return`\n\n\t\t\t${d("",v.typography).googleFontLink}\n\t\t\t${d("",m.typography).googleFontLink}\n\n\t\t\t${d(A,v.typography).styles}\n\t\t\t${d(E,m.typography).styles}\n\n\t\t\t${k}{\n\t\t\t\t${s("flex-direction",e.desktop.direction)}\n\t\t\t}\n\n\t\t\t${f}{\n\t\t\t\t${s("justify-content",N("desktop")?e.desktop.columnJustify:e.desktop.rowJustify)}\n\t\t\t\t${s("flex-direction",L("desktop")?"column":"")}\n\t\t\t\t${s("gap",u.desktop.gap)}\n\t\t\t\t${s("padding",$(i.desktop.padding))}\n\t\t\t\t${s("margin",$(i.desktop.margin))}\n\t\t\t\t${s("border-radius",$(i.desktop.radius))}\n\t\t\t\t${b(i.border)}\n\t\t\t\t${c(i.bg)}\n\t\t\t\t${O.includes(e?.desktop?.direction)?s("width",u.desktop.width):""}\n\t\t\t\t${F.includes(e.desktop.direction)?s("flex-wrap",e.desktop.wrap):""}\n\t\t\t}\n\n\t\t\t${y}{\n\t\t\t\t${s("width",N("desktop")&&"stretch"===e.desktop.columnJustify?"100%":"")}\n\t\t\t\t${s("height",L("desktop")&&"stretch"===e.desktop.rowJustify?"100%":"")}\n\t\t\t\t${s("justify-content",e.desktop.contentAlign)}\n\t\t\t\t${s("flex-direction",p.desktop.position)}\n\t\t\t\t${C("normal","normal")}\n\t\t\t\ttransition:all ${u.normal.hover.transition}s ease-in-out; \n\t\t\t}\n\n\t\t\t${x}:hover{\n\t\t\t\t${C("normal","hover")}\n\t\t\t}\n\t\t\t\n\t\t\t${w}{\n\t\t\t\t${C("active","normal")}\n\t\t\t}\n\t\t\t${w}:hover{\n\t\t\t\t${C("active","hover")}\n\t\t\t}\n\n\t\t\t${S}{\n\t\t\t\t${s("text-align",e.desktop.contentAlign)}\n\t\t\t}\n\n\t\t\t${y}:hover .b-blocks-advanced-tabs-button-title{\n\t\t\t\t${s("color",v.normal.hover.color,!0)}\n\t\t\t}\n\n\t\t\t${w}:hover .b-blocks-advanced-tabs-button-title{\n\t\t\t\t${s("color",v.active.hover.color,!0)}\n\t\t\t}\n\n\t\t\t${A}{\n\t\t\t\t${s("color",v.normal.normal.color)}\n\t\t\t\ttransition:all ${u.normal.hover.transition}s ease-in-out; \n\t\t\t}\n\n\t\t\t${T}{\n\t\t\t\t${s("color",v.active.normal.color)}\n\t\t\t}\n\n\t\t\t${E}{\n\t\t\t ${s("color",m.normal.normal.color)}\n\t\t\t\ttransition:all ${u.normal.hover.transition}s ease-in-out;\n\t\t\t\t${e.isShowActiveSubTitle?s("display","none"):""}\n\t\t\t}\n\n\t\t\t${y}:hover .b-blocks-advanced-tabs-button-subTitle{\n\t\t\t\t${s("color",m.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${J}{\n\t\t\t\t${s("color",m.active.normal.color)}\n\t\t\t\t${e.isShowActiveSubTitle?s("display","block"):""}\n\t\t\t}\n\n\t\t\t${w}:hover .b-blocks-advanced-tabs-button-subTitle{\n\t\t\t\t${s("color",a(m.active.hover.color)?m.active.hover.color:m.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${j}{\n\t\t\t\t${D("normal","normal")}\n\t\t\t\ttransition:all ${u.normal.hover.transition}s ease-in-out;\n\t\t\t}\n\n\t\t\t${y}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t${D("normal","hover")}\n\t\t\t}\n\n\t\t\t${j}>svg{\n\t\t\t\t${s("height",p.desktop.size)}\n\t\t\t\t${s("width",p.desktop.size)}\n\t\t\t\t${s("fill",p.normal.normal.color)}\n\t\t\t\t${s("color",p.normal.normal.color)}\n\t\t\t\ttransition:all ${u.normal.hover.transition}s ease-in-out;\n\t\t\t}\n\n\t\t\t${y}:hover .b-blocks-advanced-tabs-button-icon>svg{\n\t\t\t\t${s("fill",p.normal.hover.color)}\n\t\t\t\t${s("color",p.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${w} .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t${D("active","normal")}\n\t\t\t}\n\n\t\t\t${w} .b-blocks-advanced-tabs-button-icon>svg{\n\t\t\t\t${s("fill",p.active.normal.color)}\n\t\t\t\t${s("color",p.active.normal.color)}\n\t\t\t}\n\n\t\t\t${w}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${D("active","hover")}\n\t\t\t}\n\n\t\t\t${w}:hover .b-blocks-advanced-tabs-button-icon>svg{\n\t\t\t\t${s("fill",a(p.active.hover.color)?p.active.hover.color:p.normal.hover.color)}\n\t\t\t\t${s("color",a(p.active.hover.color)?p.active.hover.color:p.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${z}{\n\t\t\t\t${O.includes(e?.desktop?.direction)&&s("max-width",h.desktop.width)}\n\t\t\t}\n\n\t\t\t${r}{\n\t\t\t\t${k}{\n\t\t\t\t\t${s("flex-direction",e?.tablet?.direction)}\n\t\t\t\t}\n\t\t\t\t\t${f}{\n\t\t\t\t\t${s("justify-content",N("tablet")?e?.tablet?.columnJustify:e?.tablet?.rowJustify)}\n\t\t\t\t\t${s("flex-direction",L("tablet")?"column":"")}\n\t\t\t\t\t${s("gap",u?.tablet?.gap)}\n\t\t\t\t\t${s("padding",$(i?.tablet?.padding))}\n\t\t\t\t\t${s("margin",$(i?.tablet?.margin))}\n\t\t\t\t\t${s("border-radius",$(i?.tablet?.radius))}\n\t\t\t\t\t${O.includes(e?.tablet?.direction)?s("width",u?.tablet?.width):""}\n\t\t\t\t\t${F.includes(e?.tablet?.direction)?s("flex-wrap",e?.tablet?.wrap):""}\n\t\t\t\t}\n\n\t\t\t\t${y}{\n\t\t\t\t\t${s("width",N("tablet")&&"stretch"===e?.tablet.columnJustify?"100%":"")}\n\t\t\t\t\t${s("height",L("tablet")&&"stretch"===e?.tablet.rowJustify?"100%":"")}\n\t\t\t\t\t${s("justify-content",e?.tablet.contentAlign)}\n\t\t\t\t\t${s("flex-direction",p?.tablet.position)}\n\t\t\t\t\t${C("normal","normal","tablet")}\n\t\t\t\t}\n\t\t\t\t${x}:hover{\n\t\t\t\t\t${C("normal","hover","tablet")}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t${w}{\n\t\t\t\t\t${C("active","normal","tablet")}\n\t\t\t\t}\n\t\t\t\t${w}:hover{\n\t\t\t\t\t${C("active","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${S}{\n\t\t\t\t\t${s("text-align",e?.tablet.contentAlign)}\n\t\t\t\t}\n\n\t\t\t\t${y}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${D("normal","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${j}>svg{\n\t\t\t\t\t${s("height",p?.tablet.size)}\n\t\t\t\t\t${s("width",p?.tablet.size)}\n\t\t\t\t}\n\n\t\t\t\t${w} .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${D("active","normal","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${w}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t\t${D("active","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${z}{\n\t\t\t\t\t${O.includes(e?.tablet?.direction)&&s("max-width",h?.tablet.width)}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t${l}{\n\t\t\t\t${k}{\n\t\t\t\t\t${s("flex-direction",e?.tablet?.direction)}\n\t\t\t\t}\n\t\t\t\t\t${f}{\n\t\t\t\t\t${s("justify-content",N("tablet")?e?.tablet?.columnJustify:e?.tablet?.rowJustify)}\n\t\t\t\t\t${s("flex-direction",L("tablet")?"column":"")}\n\t\t\t\t\t${s("gap",u?.tablet?.gap)}\n\t\t\t\t\t${s("padding",$(i?.tablet?.padding))}\n\t\t\t\t\t${s("margin",$(i?.tablet?.margin))}\n\t\t\t\t\t${s("border-radius",$(i?.tablet?.radius))}\n\t\t\t\t\t${O.includes(e?.tablet?.direction)?s("width",u?.tablet?.width):""}\n\t\t\t\t\t${F.includes(e?.tablet?.direction)?s("flex-wrap",e?.tablet?.wrap):""}\n\t\t\t\t}\n\n\t\t\t\t${y}{\n\t\t\t\t\t${s("width",N("tablet")&&"stretch"===e?.tablet.columnJustify?"100%":"")}\n\t\t\t\t\t${s("height",L("tablet")&&"stretch"===e?.tablet.rowJustify?"100%":"")}\n\t\t\t\t\t${s("justify-content",e?.tablet.contentAlign)}\n\t\t\t\t\t${s("flex-direction",p?.tablet.position)}\n\t\t\t\t\t${C("normal","normal","tablet")}\n\t\t\t\t}\n\t\t\t\t${x}:hover{\n\t\t\t\t\t${C("normal","hover","tablet")}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t${w}{\n\t\t\t\t\t${C("active","normal","tablet")}\n\t\t\t\t}\n\t\t\t\t${w}:hover{\n\t\t\t\t\t${C("active","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${S}{\n\t\t\t\t\t${s("text-align",e?.tablet.contentAlign)}\n\t\t\t\t}\n\n\t\t\t\t${y}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${D("normal","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${j}>svg{\n\t\t\t\t\t${s("height",p?.tablet.size)}\n\t\t\t\t\t${s("width",p?.tablet.size)}\n\t\t\t\t}\n\n\t\t\t\t${w} .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${D("active","normal","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${w}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t\t${D("active","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${z}{\n\t\t\t\t\t${O.includes(e?.tablet?.direction)&&s("max-width",h?.tablet.width)}\n\t\t\t\t}\n\t\t\t}\n\n\t`},v=({attributes:t,templateContent:n})=>{const{tabLists:o=[],tabs:a}=t,r=(0,e.useRef)(null),[l,i]=(0,e.useState)(!1),[s,c]=(0,e.useState)(null);(0,e.useEffect)((()=>{if(!r.current||!n)return;if("1"===n.dataset.moved)return void i(!0);const t=Array.from(n.children);r.current.append(...t),n.dataset.moved="1",i(!0)}),[r.current,n]);const b=t=>{c(String(t));const n=r?.current,e=n.querySelectorAll(".b-blocks-advanced-tabs-panel");(Array.from(e)||[]).forEach((n=>{n.classList.contains(`b-blocks-advanced-tabs-panel-${t}`)?n.style.display="block":n.style.display="none"}))};return(0,e.useEffect)((()=>{const t=r?.current,n=t.querySelectorAll(".b-blocks-advanced-tabs-panel");if(l)if(s)b(s);else{const t=(o||[]).find((t=>t.isDefault));if(c(a.isCloseAllTab?"":(t||{id:1})?.id),a.isCloseAllTab)return;(Array.from(n)||[]).forEach((n=>{n.classList.contains(`b-blocks-advanced-tabs-panel-${t.id}`)?n.style.display="block":n.style.display="none"}))}}),[l]),(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"b-blocks-advanced-tabs-main-wrapper"},(0,e.createElement)("div",{className:"b-blocks-advanced-tabs-wrapper","data-close-all":a?.isCloseAllTab},(0,e.createElement)("div",{className:"b-blocks-advanced-tabs-button-lists"},(o||[]).map(((t,n)=>(0,e.createElement)("button",{key:`${n}-${t.id}`,"data-title-tab-id":t.id,className:"b-blocks-advanced-tabs-button "+(s==t.id?"b-blocks-advanced-tabs-button-active":"b-blocks-advanced-tabs-button-normal"),"data-active-tab":t.isDefault,onClick:()=>b(t.id)},a.isShowIcon&&"none"!==t.iconType&&(0,e.createElement)("p",{className:"b-blocks-advanced-tabs-button-icon",dangerouslySetInnerHTML:{__html:t?.[t.iconType]}}),(0,e.createElement)("div",{className:"b-blocks-advanced-tabs-button-title-container"},a.isShowTitle&&(0,e.createElement)("span",{className:"b-blocks-advanced-tabs-button-title",placeholder:"Tab Title",dangerouslySetInnerHTML:{__html:t.title}}),a.isShowSubTitle&&(0,e.createElement)("p",{className:"b-blocks-advanced-tabs-button-subTitle"},t.subTitle)))))),(0,e.createElement)("div",{className:"b-blocks-advanced-tabs-contents",ref:r}))))};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-advanced-tabs[data-attributes]").forEach((t=>{let n={};try{const e=t.dataset.attributes;e&&"undefined"!==e&&""!==e&&(n=JSON.parse(e))}catch(t){console.warn("tab: Invalid attributes JSON",t)}const a=t.querySelector(".b-blocks-advanced-tabs-innerBlocks-contents");a&&((0,o.H)(t).render((0,e.createElement)(e.Fragment,null,(0,e.createElement)("style",{dangerouslySetInnerHTML:{__html:u(n,t.id)}}),(0,e.createElement)(v,{attributes:n,templateContent:a}))),t.removeAttribute("data-attributes"))}))}))})(); | |
| 1 | +(()=>{"use strict";const t=window.ReactDOM,n=t=>!(null==t||""===t||Array.isArray(t)&&0===t.length||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&""===t.trim()||"number"==typeof t&&0===t);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 n=(new DOMParser).parseFromString(t,"image/svg+xml"),e=n.documentElement;return!e||"svg"!==e.localName.toLowerCase()||n.getElementsByTagName("parsererror").length?"":(this.removeScripts(n),this.sanitizeElements(n),(new XMLSerializer).serializeToString(n.documentElement))}async sanitizeFile(t){const n=await fetch(t),e=await n.text();return this.sanitize(`${e}`)}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 n=t.localName.toLowerCase();this.allowedTagSet.has(n)?("style"===n&&this.options.sanitizeStyle&&(t.textContent=this.sanitizeCss(t.textContent)),this.sanitizeAttributes(t)):t.remove()}))}sanitizeAttributes(t){Array.from(t.attributes).forEach((n=>{const e=n.name,o=e.toLowerCase(),a=n.value;if(this.options.removeEvents&&o.startsWith("on"))return void t.removeAttribute(e);if(this.options.removeExternalResources&&("href"===o||o.endsWith(":href"))&&!this.isAllowedUrl(a))return void t.removeAttribute(e);const r=o.replace("xlink:","");this.allowedAttributeSet.has(o)||this.allowedAttributeSet.has(r)?this.options.removeExternalResources&&this.hasExternalUrl(a)?t.removeAttribute(e):"style"===o&&this.options.sanitizeStyle&&t.setAttribute(e,this.sanitizeCss(a)):t.removeAttribute(e)}))}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 n=String(t||"").trim();if(n.startsWith("#"))return!0;if(/^data:/i.test(n))return this.options.allowedProtocols.includes("data")&&/^data:image\/(png|jpe?g|gif|webp);base64,/i.test(n);try{return this.options.allowedProtocols.includes(new URL(n).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 e="@media only screen and (max-width: 1024px)",o="@media only screen and (max-width: 640px)",a="linear-gradient(135deg, #0040E3, #18D4FD)",r=window.React,i=t=>{const n=(t=>{try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.toString():null}catch(n){return"string"==typeof t&&t.startsWith("/")&&!t.startsWith("//")?t:null}})(t);return n?`url('${n.replace(/['"()]/g,"")}')`:"none"},s=(t,e)=>n(e)?`${t}: ${e};`:"",l=(t,n=!0,e=!0,o=!0)=>{const{type:r="solid",color:l="",gradient:c=a,image:d={},position:b="center center",attachment:u="",repeat:$="no-repeat",size:p="",overlayColor:h=""}=t||{};return"gradient"===r&&e?s("background",c):"image"===r&&o?`background: ${i(d?.url)};\n\t\t\t\t${s("background-color",h)}\n\t\t\t\t${s("background-position",b)}\n\t\t\t\t${s("background-size",p)}\n\t\t\t\t${s("background-repeat",$)}\n\t\t\t\t${s("background-attachment",u)}\n\t\t\t\t${s("background-repeat",$)}\n\t\t\t\tbackground-blend-mode: overlay;`:n&&s("background",l)},c=t=>{if(!t)return"";const n=t=>{const{color:n="#000000",style:e="solid",width:o="0px"}=t;return`${o} ${e} ${n}`};return"object"!=typeof t||Array.isArray(t)?"":t.hasOwnProperty("top")||t.hasOwnProperty("right")||t.hasOwnProperty("bottom")||t.hasOwnProperty("left")?["top","right","bottom","left"].map((e=>t[e]?`border-${e}: ${n(t[e])};`:"")).join(" ").trim():s("border",n(t))},d=(t,n,a=!0)=>{const{fontFamily:r="Default",fontCategory:i="sans-serif",fontVariant:l=400,fontWeight:c,isUploadFont:d=!0,fontSize:b={desktop:null,tablet:null,mobile:null},fontStyle:u,textTransform:$,textDecoration:p,lineHeight:h,letterSpace:m}=n||{},v=!a||!r||"Default"===r,g=b?.desktop||b,f=b?.tablet||g,y=b?.mobile||f,k=t=>{const n=String(t);return["px","em","rem","%","vh","vw"].some((t=>n.endsWith(t)))?n:"number"==typeof t?`${n}px`:""},w=`\n\t\t${v?"":`font-family: '${r}', ${i};`}\n\t\t${s("font-weight",c)}\n\t\t${s("font-size",k(g))}\n\t\t${s("font-style",u)}\n\t\t${s("text-transform",$)}\n\t\t${s("text-decoration",p)}\n\t\t${s("line-height",h)}\n\t\t${s("letter-spacing",m)}\n\t`,x=l&&400!==l?"400i"===l?":ital@1":l?.includes("00i")?`: ital, wght@1, ${l?.replace("00i","00")} `:`: wght@${l} `:"",S=v?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${x.replace(/ /g,"")}&display=swap`;return{googleFontLink:!d||v?"":`@import url(${S});`,styles:`${t}{\n\t\t\t${w}\n\t\t}\n\t\t${e} {\n\t\t\t${t}{\n\t\t\t\t${s("font-size",k(f))}\n\t\t\t}\n\t\t}\n\t\t${o} {\n\t\t\t${t}{\n\t\t\t\t${s("font-size",k(y))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},b=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const n=["top","right","bottom","left"];return n.map((n=>t[n]||"")).every((t=>!t))?"":n.map((n=>t[n]||"0")).join(" ")}return""},u=(t,a)=>{ | |
| 2 | +const{tabs:r,styles:i}=t,{tabContainer:u,tabs:$,tabTitle:p,tabSubTitle:h,icon:m,content:v}=i,g=`#${a} .b-blocks-advanced-tabs-main-wrapper`,f=`${g} .b-blocks-advanced-tabs-wrapper`,y=`${f} .b-blocks-advanced-tabs-button-lists`,k=`${y} .b-blocks-advanced-tabs-button`,w=`${k}.b-blocks-advanced-tabs-button-active`,x=`${k}.b-blocks-advanced-tabs-button-normal`,S=`${k} .b-blocks-advanced-tabs-button-title-container`,A=`${S} .b-blocks-advanced-tabs-button-title`,j=`${w} .b-blocks-advanced-tabs-button-title`,T=`${S} .b-blocks-advanced-tabs-button-subTitle`,z=`${w} .b-blocks-advanced-tabs-button-subTitle`,C=`${k} .b-blocks-advanced-tabs-button-icon`,E=`${g} .b-blocks-advanced-tabs-contents`,L=(t="desktop")=>"row-reverse"===r?.[t].direction||"row"===r?.[t].direction,J=(t="desktop")=>"column"===r?.[t].direction||"column-reverse"===r?.[t].direction,N=(t="normal",n="normal",e="desktop")=>`\n\t\t\t\t\t${s("margin",b($[t][n][e].margin))}\n\t\t\t\t\t${s("padding",b($[t][n][e].padding))}\n\t\t\t\t\t${s("border-radius",b($[t][n][e].radius))}\n\t\t\t\t\t${"desktop"===e?l($[t][n].bg):""}\n\t\t\t\t\t${"desktop"===e?c($[t][n].border):""}\n\t\t\t\t`,O=(t="normal",n="normal",e="desktop")=>`\n\t\t\t\t${s("margin",b(m[t][n][e].margin))}\n\t\t\t\t${s("padding",b(m[t][n][e].padding))}\n\t\t\t\t${s("border-radius",b(m[t][n][e].radius))}\n\t\t\t\t${"desktop"===e?l(m[t][n].bg):""}\n\t\t\t\t${"desktop"===e?c(m[t][n].border):""}\n\t`,R=["row","row-reverse"],P=["column","column-reverse"] | |
| 3 | +;return`\n\n\t\t\t${d("",p.typography).googleFontLink}\n\t\t\t${d("",h.typography).googleFontLink}\n\n\t\t\t${d(A,p.typography).styles}\n\t\t\t${d(T,h.typography).styles}\n\n\t\t\t${f}{\n\t\t\t\t${s("flex-direction",r.desktop.direction)}\n\t\t\t}\n\n\t\t\t${y}{\n\t\t\t\t${s("justify-content",J("desktop")?r.desktop.columnJustify:r.desktop.rowJustify)}\n\t\t\t\t${s("flex-direction",L("desktop")?"column":"")}\n\t\t\t\t${s("gap",$.desktop.gap)}\n\t\t\t\t${s("padding",b(u.desktop.padding))}\n\t\t\t\t${s("margin",b(u.desktop.margin))}\n\t\t\t\t${s("border-radius",b(u.desktop.radius))}\n\t\t\t\t${c(u.border)}\n\t\t\t\t${l(u.bg)}\n\t\t\t\t${R.includes(r?.desktop?.direction)?s("width",$.desktop.width):""}\n\t\t\t\t${P.includes(r.desktop.direction)?s("flex-wrap",r.desktop.wrap):""}\n\t\t\t}\n\n\t\t\t${k}{\n\t\t\t\t${s("width",J("desktop")&&"stretch"===r.desktop.columnJustify?"100%":"")}\n\t\t\t\t${s("height",L("desktop")&&"stretch"===r.desktop.rowJustify?"100%":"")}\n\t\t\t\t${s("justify-content",r.desktop.contentAlign)}\n\t\t\t\t${s("flex-direction",m.desktop.position)}\n\t\t\t\t${N("normal","normal")}\n\t\t\t\ttransition:all ${$.normal.hover.transition}s ease-in-out; \n\t\t\t}\n\n\t\t\t${x}:hover{\n\t\t\t\t${N("normal","hover")}\n\t\t\t}\n\t\t\t\n\t\t\t${w}{\n\t\t\t\t${N("active","normal")}\n\t\t\t}\n\t\t\t${w}:hover{\n\t\t\t\t${N("active","hover")}\n\t\t\t}\n\n\t\t\t${S}{\n\t\t\t\t${s("text-align",r.desktop.contentAlign)}\n\t\t\t}\n\n\t\t\t${k}:hover .b-blocks-advanced-tabs-button-title{\n\t\t\t\t${s("color",p.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${w}:hover .b-blocks-advanced-tabs-button-title{\n\t\t\t\t${s("color",p.active.hover.color)}\n\t\t\t}\n\n\t\t\t${A}{\n\t\t\t\t${s("color",p.normal.normal.color)}\n\t\t\t\ttransition:all ${$.normal.hover.transition}s ease-in-out; \n\t\t\t}\n\n\t\t\t${j}{\n\t\t\t\t${s("color",p.active.normal.color)}\n\t\t\t}\n\n\t\t\t${T}{\n\t\t\t ${s("color",h.normal.normal.color)}\n\t\t\t\ttransition:all ${$.normal.hover.transition}s ease-in-out;\n\t\t\t\t${r.isShowActiveSubTitle?s("display","none"):""}\n\t\t\t}\n\n\t\t\t${k}:hover .b-blocks-advanced-tabs-button-subTitle{\n\t\t\t\t${s("color",h.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${z}{\n\t\t\t\t${s("color",h.active.normal.color)}\n\t\t\t\t${r.isShowActiveSubTitle?s("display","block"):""}\n\t\t\t}\n\n\t\t\t${w}:hover .b-blocks-advanced-tabs-button-subTitle{\n\t\t\t\t${s("color",n(h.active.hover.color)?h.active.hover.color:h.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${C}{\n\t\t\t\t${O("normal","normal")}\n\t\t\t\ttransition:all ${$.normal.hover.transition}s ease-in-out;\n\t\t\t}\n\n\t\t\t${k}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t${O("normal","hover")}\n\t\t\t}\n\n\t\t\t${C}>svg{\n\t\t\t\t${s("height",m.desktop.size)}\n\t\t\t\t${s("width",m.desktop.size)}\n\t\t\t\t${s("fill",m.normal.normal.color)}\n\t\t\t\t${s("color",m.normal.normal.color)}\n\t\t\t\ttransition:all ${$.normal.hover.transition}s ease-in-out;\n\t\t\t}\n\n\t\t\t${k}:hover .b-blocks-advanced-tabs-button-icon>svg{\n\t\t\t\t${s("fill",m.normal.hover.color)}\n\t\t\t\t${s("color",m.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${w} .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t${O("active","normal")}\n\t\t\t}\n\n\t\t\t${w} .b-blocks-advanced-tabs-button-icon>svg{\n\t\t\t\t${s("fill",m.active.normal.color)}\n\t\t\t\t${s("color",m.active.normal.color)}\n\t\t\t}\n\n\t\t\t${w}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${O("active","hover")}\n\t\t\t}\n\n\t\t\t${w}:hover .b-blocks-advanced-tabs-button-icon>svg{\n\t\t\t\t${s("fill",n(m.active.hover.color)?m.active.hover.color:m.normal.hover.color)}\n\t\t\t\t${s("color",n(m.active.hover.color)?m.active.hover.color:m.normal.hover.color)}\n\t\t\t}\n\n\t\t\t${E}{\n\t\t\t\t${R.includes(r?.desktop?.direction)&&s("max-width",v.desktop.width)}\n\t\t\t}\n\n\t\t\t${e}{\n\t\t\t\t${f}{\n\t\t\t\t\t${s("flex-direction",r?.tablet?.direction)}\n\t\t\t\t}\n\t\t\t\t\t${y}{\n\t\t\t\t\t${s("justify-content",J("tablet")?r?.tablet?.columnJustify:r?.tablet?.rowJustify)}\n\t\t\t\t\t${s("flex-direction",L("tablet")?"column":"")}\n\t\t\t\t\t${s("gap",$?.tablet?.gap)}\n\t\t\t\t\t${s("padding",b(u?.tablet?.padding))}\n\t\t\t\t\t${s("margin",b(u?.tablet?.margin))}\n\t\t\t\t\t${s("border-radius",b(u?.tablet?.radius))}\n\t\t\t\t\t${R.includes(r?.tablet?.direction)?s("width",$?.tablet?.width):""}\n\t\t\t\t\t${P.includes(r?.tablet?.direction)?s("flex-wrap",r?.tablet?.wrap):""}\n\t\t\t\t}\n\n\t\t\t\t${k}{\n\t\t\t\t\t${s("width",J("tablet")&&"stretch"===r?.tablet.columnJustify?"100%":"")}\n\t\t\t\t\t${s("height",L("tablet")&&"stretch"===r?.tablet.rowJustify?"100%":"")}\n\t\t\t\t\t${s("justify-content",r?.tablet.contentAlign)}\n\t\t\t\t\t${s("flex-direction",m?.tablet.position)}\n\t\t\t\t\t${N("normal","normal","tablet")}\n\t\t\t\t}\n\t\t\t\t${x}:hover{\n\t\t\t\t\t${N("normal","hover","tablet")}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t${w}{\n\t\t\t\t\t${N("active","normal","tablet")}\n\t\t\t\t}\n\t\t\t\t${w}:hover{\n\t\t\t\t\t${N("active","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${S}{\n\t\t\t\t\t${s("text-align",r?.tablet.contentAlign)}\n\t\t\t\t}\n\n\t\t\t\t${k}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${O("normal","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${C}>svg{\n\t\t\t\t\t${s("height",m?.tablet.size)}\n\t\t\t\t\t${s("width",m?.tablet.size)}\n\t\t\t\t}\n\n\t\t\t\t${w} .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${O("active","normal","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${w}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t\t${O("active","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${E}{\n\t\t\t\t\t${R.includes(r?.tablet?.direction)&&s("max-width",v?.tablet.width)}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t${o}{\n\t\t\t\t${f}{\n\t\t\t\t\t${s("flex-direction",r?.tablet?.direction)}\n\t\t\t\t}\n\t\t\t\t\t${y}{\n\t\t\t\t\t${s("justify-content",J("tablet")?r?.tablet?.columnJustify:r?.tablet?.rowJustify)}\n\t\t\t\t\t${s("flex-direction",L("tablet")?"column":"")}\n\t\t\t\t\t${s("gap",$?.tablet?.gap)}\n\t\t\t\t\t${s("padding",b(u?.tablet?.padding))}\n\t\t\t\t\t${s("margin",b(u?.tablet?.margin))}\n\t\t\t\t\t${s("border-radius",b(u?.tablet?.radius))}\n\t\t\t\t\t${R.includes(r?.tablet?.direction)?s("width",$?.tablet?.width):""}\n\t\t\t\t\t${P.includes(r?.tablet?.direction)?s("flex-wrap",r?.tablet?.wrap):""}\n\t\t\t\t}\n\n\t\t\t\t${k}{\n\t\t\t\t\t${s("width",J("tablet")&&"stretch"===r?.tablet.columnJustify?"100%":"")}\n\t\t\t\t\t${s("height",L("tablet")&&"stretch"===r?.tablet.rowJustify?"100%":"")}\n\t\t\t\t\t${s("justify-content",r?.tablet.contentAlign)}\n\t\t\t\t\t${s("flex-direction",m?.tablet.position)}\n\t\t\t\t\t${N("normal","normal","tablet")}\n\t\t\t\t}\n\t\t\t\t${x}:hover{\n\t\t\t\t\t${N("normal","hover","tablet")}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t${w}{\n\t\t\t\t\t${N("active","normal","tablet")}\n\t\t\t\t}\n\t\t\t\t${w}:hover{\n\t\t\t\t\t${N("active","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${S}{\n\t\t\t\t\t${s("text-align",r?.tablet.contentAlign)}\n\t\t\t\t}\n\n\t\t\t\t${k}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${O("normal","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${C}>svg{\n\t\t\t\t\t${s("height",m?.tablet.size)}\n\t\t\t\t\t${s("width",m?.tablet.size)}\n\t\t\t\t}\n\n\t\t\t\t${w} .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t${O("active","normal","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${w}:hover .b-blocks-advanced-tabs-button-icon{\n\t\t\t\t\t\t${O("active","hover","tablet")}\n\t\t\t\t}\n\n\t\t\t\t${E}{\n\t\t\t\t\t${R.includes(r?.tablet?.direction)&&s("max-width",v?.tablet.width)}\n\t\t\t\t}\n\t\t\t}\n\n\t`},$=window.ReactJSXRuntime,p=({attributes:t,templateContent:n})=>{const{tabLists:e=[],tabs:o}=t,a=(0,r.useRef)(null),[i,s]=(0,r.useState)(!1),[l,c]=(0,r.useState)(null);(0,r.useEffect)((()=>{if(!a.current||!n)return;if("1"===n.dataset.moved)return void s(!0);const t=Array.from(n.children);a.current.append(...t),n.dataset.moved="1",s(!0)}),[a.current,n]);const d=t=>{c(String(t));const n=a?.current,e=n.querySelectorAll(".b-blocks-advanced-tabs-panel");(Array.from(e)||[]).forEach((n=>{ | |
| 4 | +n.classList.contains(`b-blocks-advanced-tabs-panel-${t}`)?n.style.display="block":n.style.display="none"}))};return(0,r.useEffect)((()=>{const t=a?.current,n=t.querySelectorAll(".b-blocks-advanced-tabs-panel");if(i)if(l)d(l);else{const t=(e||[]).find((t=>t.isDefault));if(c(o.isCloseAllTab?"":(t||{id:1})?.id),o.isCloseAllTab)return;(Array.from(n)||[]).forEach((n=>{n.classList.contains(`b-blocks-advanced-tabs-panel-${t.id}`)?n.style.display="block":n.style.display="none"}))}}),[i]),(0,$.jsx)("div",{children:(0,$.jsx)("div",{className:"b-blocks-advanced-tabs-main-wrapper",children:(0,$.jsxs)("div",{className:"b-blocks-advanced-tabs-wrapper","data-close-all":o?.isCloseAllTab,children:[(0,$.jsx)("div",{className:"b-blocks-advanced-tabs-button-lists",children:(e||[]).map(((t,n)=>(0,$.jsxs)("button",{"data-title-tab-id":t.id,className:"b-blocks-advanced-tabs-button "+(l==t.id?"b-blocks-advanced-tabs-button-active":"b-blocks-advanced-tabs-button-normal"),"data-active-tab":t.isDefault,onClick:()=>d(t.id),children:[o.isShowIcon&&"none"!==t.iconType&&(0,$.jsx)("p",{className:"b-blocks-advanced-tabs-button-icon",dangerouslySetInnerHTML:{__html:t?.[t.iconType]}}),(0,$.jsxs)("div",{className:"b-blocks-advanced-tabs-button-title-container",children:[o.isShowTitle&&(0,$.jsx)("span",{className:"b-blocks-advanced-tabs-button-title",placeholder:"Tab Title",dangerouslySetInnerHTML:{__html:t.title}}),o.isShowSubTitle&&(0,$.jsx)("p",{className:"b-blocks-advanced-tabs-button-subTitle",children:t.subTitle})]})]},`${n}-${t.id}`)))}),(0,$.jsx)("div",{className:"b-blocks-advanced-tabs-contents",ref:a})]})})})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-advanced-tabs[data-attributes]").forEach((n=>{let e={};try{const t=n.dataset.attributes;t&&"undefined"!==t&&""!==t&&(e=JSON.parse(t))}catch(t){console.warn("tab: Invalid attributes JSON",t)}const o=n.querySelector(".b-blocks-advanced-tabs-innerBlocks-contents");o&&((0,t.createRoot)(n).render((0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("style",{dangerouslySetInnerHTML:{__html:u(e,n.id)}}),(0,$.jsx)(p,{attributes:e,templateContent:o})]})),n.removeAttribute("data-attributes"))}))}))})(); | |