webim-adapter 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +630 -364
- package/build/webim-embed.js +3 -3
- package/build/webim-ssr.js +382 -116
- package/package.json +1 -1
package/build/webim-embed.js
CHANGED
|
@@ -10,6 +10,6 @@ Error generating stack: `+e.message+`
|
|
|
10
10
|
`)}var ne=[{key:`tablet`,max:991},{key:`mobileLandscape`,max:767},{key:`mobile`,max:478}],re=e=>Object.entries(S(e)).map(([e,t])=>`${ee(e)}: ${t} !important;`).join(` `);function ie(e,t){return ne.map(({key:n,max:r})=>{let i=t?.[n]?re(t[n]):``;return i?`@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }`:``}).filter(Boolean).join(`
|
|
11
11
|
`)}function ae(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=ie(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
|
|
12
12
|
`)}function oe(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=te(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
|
|
13
|
-
`)}var se=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,O={light:{background:`#f2f2f2`,surface:`#f2f2f2`,border:`#d1d5db`,text:`#111827`,accent:`#111827`,accentText:`#ffffff`,primary:{light:`#4b5563`,main:`#111827`,dark:`#030712`,contrastText:`#ffffff`},secondary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`}},dark:{background:`#0f172a`,surface:`#1e293b`,border:`rgba(226, 232, 240, 0.18)`,text:`#e2e8f0`,accent:`#6366f1`,accentText:`#ffffff`,primary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`},secondary:{light:`#5eead4`,main:`#14b8a6`,dark:`#0f766e`,contrastText:`#052e2b`}}},k={font:`system`,headingFont:`inherit`,light:O.light,dark:O.dark},ce={system:{label:`System`,value:se},inter:{label:`Inter`,value:`"Inter", ${se}`},outfit:{label:`Outfit`,value:`"Outfit", ${se}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},le=(e,t)=>ce[e]?.value??_(e)??(typeof e==`string`&&e.trim()?`"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`:t),ue=(e,...t)=>{let n=Object.assign({},e,...t);return n.primary={...e.primary,...t.reduce((e,t)=>({...e,...t?.primary}),{})},n.secondary={...e.secondary,...t.reduce((e,t)=>({...e,...t?.secondary}),{})},n};function de(e){let{light:t,dark:n,font:r,headingFont:i,...a}=e??{};return{font:r??k.font,headingFont:i??k.headingFont,light:ue(O.light,a,t),dark:ue(O.dark,n)}}function A(e){return{"--page-bg":e.background,"--page-surface":e.surface??e.background,"--page-border":e.border??O.light.border,"--page-text":e.text,"--page-accent":e.accent,"--page-accent-text":e.accentText,"--page-primary-light":e.primary.light,"--page-primary":e.primary.main,"--page-primary-dark":e.primary.dark,"--page-primary-contrast":e.primary.contrastText,"--page-secondary-light":e.secondary.light,"--page-secondary":e.secondary.main,"--page-secondary-dark":e.secondary.dark,"--page-secondary-contrast":e.secondary.contrastText}}function j(e){let t=de(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:le(t.font,se),"--page-heading-font":t.headingFont===`inherit`?`inherit`:le(t.headingFont,`inherit`)}}function fe(e,t=`light`){let n=de(e);return{...j(e),...A(n[t]??n.light)}}function pe(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function me(e,t){return e===`light`||e===`dark`?e:t===`light`||t===`dark`?t:`auto`}function he({page:e,settings:t,tenant:n,apiUrl:r,locale:i}){let a={...t?.global??{},...t?.tenant??{}},o=e.meta??{};return{schema:1,title:e.title,slug:e.slug,blocks:i&&o.i18n?.[i]?.blocks||e.blocks,theme:pe(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,seo:o.seo,direction:o.direction,scheme:o.scheme,locale:i||a.locales?.default,locales:a.locales,tenant:n??``,apiUrl:r??``,settings:a}}var ge=async e=>{let t=await e.json().catch(()=>null);if(!e.ok||t?.success===!1)throw Error(t?.error?.message||`Request failed (${e.status})`);return t?.payload??t};async function _e({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,token:a,page:o,fetch:s}){if(!e)throw Error(`fetchPage: apiUrl is required`);if(!n)throw Error(`fetchPage: slug is required`);let c=s??fetch,l=e.replace(/\/$/,``),u={...t?{"x-tenant":t}:{},...a?{authorization:`Bearer ${a}`}:{}},[d,f]=await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i?`?preview=${encodeURIComponent(i)}`:``}`,{headers:u}).then(ge),c(`${l}/settings/public`,{headers:u}).then(ge)]),p=he({page:d,settings:f,tenant:t,apiUrl:l,locale:r}),m=[...new Set(Object.values(p.blocks??{}).map(e=>e?.type?.resolvedName===`CollectionList`?e.props?.collection:e?.type?.resolvedName===`TableBlock`||e?.type?.resolvedName===`OrgChartBlock`?e.props?.source:null).filter(Boolean))];if(m.length){let e=e=>e.startsWith(`api:`)?`${l}/data/${encodeURIComponent(e.slice(4))}`:`${l}/dynamic/${encodeURIComponent(e)}?all=1${r?`&locale=${encodeURIComponent(r)}`:``}`,t=await Promise.all(m.map(t=>c(e(t),{headers:u}).then(ge).then(e=>{let n=Array.isArray(e)?e:Array.isArray(e?.data)?e.data:[],r=Number(e?.total?.filtered??e?.total?.all??n.length);return[[t,n],[`${t}:total`,Number.isFinite(r)?r:n.length]]}).catch(()=>[[t,[]]])));p.datasets=Object.fromEntries(t.flat())}let h=Number(o);return Number.isFinite(h)&&h>=1&&(p.datasets={...p.datasets??{},__page:Math.floor(h)}),p}var ve=new Set([`ar`,`he`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`]),ye=e=>ve.has(String(e||``).toLowerCase().split(/[-_]/)[0])?`rtl`:`ltr`,be=(e,t)=>e===`ltr`||e===`rtl`?e:t?ye(t):void 0,xe=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),M=e(((e,t)=>{t.exports=xe()}))(),Se=(0,l.createContext)({tenant:``,apiUrl:`/api`,locale:``,settings:null}),Ce=(0,l.createContext)(null),we=e=>{let t=Number(e?.__page);if(Number.isFinite(t)&&t>=1)return Math.floor(t);if(typeof window>`u`)return 1;let n=Number(new URLSearchParams(window.location.search).get(`page`));return Number.isFinite(n)&&n>=1?Math.floor(n):1},Te=()=>{if(typeof window>`u`)return{};let e={};return new URLSearchParams(window.location.search).forEach((t,n)=>{n.startsWith(`f_`)&&n.length>2&&t!==``&&(e[n.slice(2)]=t)}),e},Ee=e=>{let t={...e&&typeof e==`object`&&!Array.isArray(e)?e:{},...Te()};return Object.fromEntries(Object.entries(t).filter(([,e])=>typeof e==`string`&&e.trim()!==``))},De=(0,l.createContext)(null),Oe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function ke(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Ae=e=>{let t=[];for(let[n,r]of Object.entries(e??{})){if(!/^[\w-]+$/.test(n))continue;t.push(n);let e=Array.isArray(r)?r[0]:r,i=Array.isArray(r)?`${n}.0`:n;if(e&&typeof e==`object`&&!Array.isArray(e))for(let n of Object.keys(e))/^[\w-]+$/.test(n)&&t.push(`${i}.${n}`)}return t};function je(e){return e==null?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):typeof e==`object`&&!Array.isArray(e)&&(`label`in e||`name`in e||`slug`in e)?String(e.label??e.name??e.slug??``):typeof e==`object`&&!Array.isArray(e)&&Number.isFinite(Number(e.lat))&&Number.isFinite(Number(e.lng))?`${e.lat}, ${e.lng}`:Array.isArray(e)?e.map(e=>typeof e==`string`?e:Array.isArray(e?.parts)?e.parts.map(e=>e?.text??``).join(``):Array.isArray(e?.items)?e.items.map(e=>e?.text??``).join(` `):e&&(e.label!=null||e.name!=null||e.slug!=null)?String(e.label??e.name??e.slug):``).filter(Boolean).join(` `):``}function Me(e,t){let n=t?.data??{},r=Ae(n);if(!r.length)return e;let i=RegExp(`:(${r.map(Oe).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>je(ke(n,t))):Array.isArray(e)?e.map(a):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,a(t)])):e;return a(e)}var Ne={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},Pe={margin:0},Fe={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},Ie={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},Le={display:`flex`,flexDirection:`column`};function Re({style:e}){let t=e?.backgroundVideo;if(!t)return null;let n={position:`absolute`,inset:0,width:`100%`,height:`100%`,zIndex:-1,pointerEvents:`none`},r=e?.overlayColor?`color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity??50}%, transparent)`:null;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,M.jsx)(`div`,{style:{...n,background:r}})]})}var ze=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...S(e)}:{...t,...S(e)};function Be({style:e,nodeRef:t,children:n}){return(0,M.jsxs)(`div`,{ref:t,style:{...Ie,...S(e)},children:[(0,M.jsx)(Re,{style:e}),n]})}function Ve({style:e,nodeRef:t,children:n}){return(0,M.jsxs)(`section`,{ref:t,style:ze(e,Le),children:[(0,M.jsx)(Re,{style:e}),n]})}function He({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,M.jsxs)(`div`,{ref:n,style:i?{...i,...ze(e)}:ze(e),children:[(0,M.jsx)(Re,{style:e}),r]})}function Ue({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,M.jsx)(n,{ref:a,style:{...Ne,...S(r)},children:Ke(t,e,i)})}var We={fontFamily:ce.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function Ge(e,t=[],n,r){let i=e;return t.includes(`sup`)?i=(0,M.jsx)(`sup`,{children:i}):t.includes(`sub`)&&(i=(0,M.jsx)(`sub`,{children:i})),t.includes(`code`)&&(i=(0,M.jsx)(`code`,{style:We,children:i})),t.includes(`strike`)&&(i=(0,M.jsx)(`s`,{children:i})),t.includes(`underline`)&&(i=(0,M.jsx)(`u`,{children:i})),t.includes(`italic`)&&(i=(0,M.jsx)(`em`,{children:i})),t.includes(`bold`)&&(i=(0,M.jsx)(`strong`,{children:i})),n&&(i=(0,M.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{color:`inherit`},children:i})),i}function Ke(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,M.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,M.jsx)(l.Fragment,{children:Ke(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,M.jsx)(`sup`,{children:r}):e.sub&&(r=(0,M.jsx)(`sub`,{children:r})),e.code&&(r=(0,M.jsx)(`code`,{style:We,children:r})),e.strike&&(r=(0,M.jsx)(`s`,{children:r})),e.underline&&(r=(0,M.jsx)(`u`,{children:r})),e.italic&&(r=(0,M.jsx)(`em`,{children:r})),e.bold&&(r=(0,M.jsx)(`strong`,{children:r})),(e.color||e.background)&&(r=(0,M.jsx)(`span`,{style:{...e.color&&{color:e.color},...e.background&&{backgroundColor:e.background}},children:r})),e.href&&(r=(0,M.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{color:e.color??`inherit`},children:r})),(0,M.jsx)(l.Fragment,{children:r},t)}):t}function qe({parts:e,text:t,marks:n,href:r,target:i,style:a}){return(0,M.jsx)(`span`,{style:S(a),children:e?.length?Ke(e,t):Ge(t,n,r,i)})}var Je={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16};function Ye({align:e=`center`,width:t,wrap:n}={}){let r=t?`${t}%`:void 0;if(e===`full`)return{width:`100%`};let i=e===`left`||e===`right`;return i&&(n??!0)?{float:e,width:r??`50%`,maxWidth:`100%`,marginTop:`4px`,marginBottom:`12px`,...e===`left`?{marginRight:`20px`,marginLeft:0}:{marginLeft:`20px`,marginRight:0}}:i?{width:r??`fit-content`,maxWidth:`100%`,...e===`left`?{marginLeft:0,marginRight:`auto`}:{marginLeft:`auto`,marginRight:0}}:{width:r??`fit-content`,maxWidth:`100%`,marginLeft:`auto`,marginRight:`auto`}}function Xe(e=[],t,n){let r=n??((e,n)=>Ke(e,n,t));return e.map((t,n)=>{let i={marginTop:0,marginBottom:n===e.length-1?0:14};if(t.type===`image`){if(!t.src)return null;let e=(0,M.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,M.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...Ye(t)},children:[t.href?(0,M.jsx)(`a`,{href:t.href,target:t.target||void 0,rel:t.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`},children:e}):e,t.caption&&(0,M.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return st(t.url)?(0,M.jsx)(`div`,{style:{...i,...Ye({align:t.align,wrap:t.wrap,width:t.width??100})},children:(0,M.jsx)(ct,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`divider`)return(0,M.jsx)(`hr`,{style:{...i,border:0,borderTop:`1px solid rgba(148, 163, 184, 0.4)`}},n);if(t.type===`table`){let e=Array.isArray(t.rows)?t.rows.filter(Array.isArray):[];if(!e.length)return null;let r=t.header!==!1,a={border:t.borders===!1?void 0:`1px solid rgba(148, 163, 184, 0.4)`,padding:`6px 10px`,textAlign:`left`,verticalAlign:`top`},o=r?e.slice(1):e,s=Array.isArray(t.widths)?t.widths:null;return(0,M.jsxs)(`table`,{style:{...i,borderCollapse:`collapse`,width:`100%`,fontSize:`inherit`,tableLayout:s?`fixed`:void 0},children:[s&&(0,M.jsx)(`colgroup`,{children:s.map((e,t)=>(0,M.jsx)(`col`,{style:{width:`${e}%`}},t))}),r&&(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e[0].map((e,t)=>(0,M.jsx)(`th`,{style:{...a,fontWeight:700},children:e},t))})}),(0,M.jsx)(`tbody`,{children:o.map((e,t)=>(0,M.jsx)(`tr`,{children:e.map((e,t)=>(0,M.jsx)(`td`,{style:a,children:e},t))},t))})]},n)}if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,M.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,M.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,M.jsx)(`blockquote`,{style:{...Qe,...i},children:r(t.parts,t.text)},n);if(Je[t.type]){let e=t.type;return(0,M.jsx)(e,{style:{...Ne,fontSize:Je[t.type],...i},children:r(t.parts,t.text)},n)}return(0,M.jsx)(`p`,{style:{...Pe,...i},children:r(t.parts,t.text)},n)})}function Ze({content:e,style:t,linked:n,nodeRef:r}){return(0,M.jsx)(`div`,{ref:r,style:{display:`flow-root`,...S(t)},children:Xe(e,n)})}var Qe={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function $e({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,M.jsx)(`blockquote`,{ref:i,style:{...Qe,...S(n)},children:Ke(t,e,r)})}function et({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,M.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...S(n)},children:t.map((e,t)=>(0,M.jsx)(`li`,{style:{marginBottom:4},children:Ke(e.parts,e.text)},t))})}function tt({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,M.jsx)(`p`,{ref:i,style:{...Pe,...S(n)},children:Ke(t,e,r)})}var nt={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function rt({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,M.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...nt,...S(i)},children:Ke(t,e,a)})}function it({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,M.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...Fe,...S(i)},children:Ke(t,e,a)})}function at({src:e,alt:t,style:n,nodeRef:r}){return e?(0,M.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...S(n)}}):null}function ot({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,M.jsx)(`video`,{ref:s,src:e,poster:t||void 0,controls:n,autoPlay:r,muted:a||r,loop:i,playsInline:!0,style:{display:`block`,width:`100%`,maxWidth:`100%`,...S(o)}}):null}var st=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function ct({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=st(e);if(!c)return null;let l=new URLSearchParams({rel:`0`});return t&&l.set(`autoplay`,`1`),(n||t)&&l.set(`mute`,`1`),i||l.set(`controls`,`0`),r&&(l.set(`loop`,`1`),l.set(`playlist`,c)),Number(a)>0&&l.set(`start`,String(Math.floor(Number(a)))),(0,M.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...S(o)},children:(0,M.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${c}?${l}`,title:`YouTube video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,border:0}})})}function lt({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,M.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...S(r)}}):null}function ut({code:e,runScripts:t=!0,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(null);return(0,l.useEffect)(()=>{i&&(i.innerHTML=e||``,t&&i.querySelectorAll(`script`).forEach(e=>{let t=document.createElement(`script`);for(let{name:n,value:r}of e.attributes)t.setAttribute(n,r);t.text=e.textContent,e.replaceWith(t)}))},[i,e,t]),(0,M.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:S(n)})}function dt({height:e,nodeRef:t}){return(0,M.jsx)(`div`,{ref:t,style:{height:e||32,flexShrink:0,alignSelf:`stretch`}})}function ft({style:e,nodeRef:t}){return(0,M.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...S(e)}})}var pt={position:`absolute`,top:`50%`,transform:`translateY(-50%)`,width:36,height:36,borderRadius:`50%`,border:0,cursor:`pointer`,background:`rgba(17, 24, 39, 0.45)`,color:`#fff`,fontSize:20,lineHeight:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:0},mt={bottom:{inset:`auto 0 0 0`,padding:`40px 24px 20px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.55))`},top:{inset:`0 0 auto 0`,padding:`20px 24px 40px`,background:`linear-gradient(rgba(0, 0, 0, 0.55), transparent)`},middle:{inset:0,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:24,textShadow:`0 2px 12px rgba(0, 0, 0, 0.6)`}},ht=48;function gt({count:e,renderSlide:t,autoplay:n=!0,interval:r=5,height:i=320,swipe:a=!0,style:o,nodeRef:s}){let[c,u]=(0,l.useState)(0),[d,f]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),h=e?Math.min(c,e-1):0;if((0,l.useEffect)(()=>{if(!n||d||p||e<2)return;let t=setInterval(()=>u(t=>(t+1)%e),Math.max(2,Number(r)||5)*1e3);return()=>clearInterval(t)},[n,d,p,r,e]),!e)return null;let g=t=>u((t+e)%e),_=()=>{if(!p)return;let{dx:e}=p;m(null),e<-48?g(h+1):e>ht&&g(h-1)};return(0,M.jsxs)(`div`,{ref:s,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onPointerDown:a&&e>1?e=>{e.pointerType===`mouse`&&e.button!==0||e.target.closest(`button`)||(e.currentTarget.setPointerCapture(e.pointerId),m({startX:e.clientX,dx:0}))}:void 0,onPointerMove:p?e=>m(t=>t&&{...t,dx:e.clientX-t.startX}):void 0,onPointerUp:_,onPointerCancel:_,style:{position:`relative`,overflow:`hidden`,width:`100%`,touchAction:`pan-y`,userSelect:p?`none`:void 0,cursor:p?`grabbing`:void 0,...S(o)},children:[(0,M.jsx)(`div`,{style:{display:`flex`,height:i,transform:`translateX(calc(${-h*100}% + ${p?.dx??0}px))`,transition:p?`none`:`transform 450ms ease`},children:Array.from({length:e},(e,n)=>(0,M.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...pt,left:12},onClick:()=>g(h-1),children:`‹`}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...pt,right:12},onClick:()=>g(h+1),children:`›`}),(0,M.jsx)(`div`,{style:{position:`absolute`,bottom:10,left:0,right:0,display:`flex`,justifyContent:`center`,gap:6},children:Array.from({length:e},(e,t)=>(0,M.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,onClick:()=>g(t),style:{width:8,height:8,borderRadius:`50%`,border:0,padding:0,cursor:`pointer`,background:t===h?`#ffffff`:`rgba(255, 255, 255, 0.45)`}},t))})]})]})}var _t=(e,t)=>({position:`absolute`,inset:0,backgroundImage:e?`url(${e})`:`none`,backgroundColor:t||(e?void 0:`rgba(148, 163, 184, 0.25)`),backgroundSize:`cover`,backgroundPosition:`center`});function vt({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,M.jsx)(gt,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{style:_t(i.image)}),(i.title||i.text)&&(0,M.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...mt[t]??mt.bottom},children:[i.title&&(0,M.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,M.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function yt({slides:e=[],linked:t,...n}){return e.length?(0,M.jsx)(gt,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{style:_t(r.image,r.color)}),(0,M.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}function bt({images:e=[],columns:t=3,gap:n=8,showNames:r=!1,lightbox:i=!0,style:a,nodeRef:o,inert:s}){let c=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],u=Math.max(0,Number(n)||0),d=s?e=>e.preventDefault():void 0,[f,p]=(0,l.useState)(null),m=i&&!s&&f!==null&&c[f];(0,l.useEffect)(()=>{if(!m)return;let e=e=>{e.key===`Escape`&&p(null),e.key===`ArrowRight`&&p(e=>(e+1)%c.length),e.key===`ArrowLeft`&&p(e=>(e-1+c.length)%c.length)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m,c.length]);let h=e=>{if(typeof e.name==`string`&&e.name.trim())return e.name;if(typeof e.alt==`string`&&e.alt.trim())return e.alt;try{let t=String(e.src).split(`?`)[0].split(`/`).pop();return decodeURIComponent(t??``)}catch{return``}};return(0,M.jsxs)(`div`,{ref:o,style:{columnCount:Math.min(Math.max(Number(t)||3,1),8),columnGap:u,width:`100%`,...S(a)},children:[c.map((e,t)=>{let n=(0,M.jsxs)(`span`,{style:{position:`relative`,display:`block`,borderRadius:`inherit`,overflow:`hidden`},children:[(0,M.jsx)(`img`,{src:e.src,alt:e.alt??``,style:{width:`100%`,display:`block`,borderRadius:`inherit`}}),r&&h(e)&&(0,M.jsx)(`span`,{style:{position:`absolute`,insetInline:0,bottom:0,padding:`14px 10px 8px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.65))`,color:`#fff`,fontSize:12,lineHeight:1.3,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:h(e)})]}),a=e.href?(0,M.jsx)(`a`,{href:e.href,onClick:d,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`,borderRadius:`inherit`},children:n}):i&&!s?(0,M.jsx)(`span`,{role:`button`,tabIndex:0,onClick:()=>p(t),onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&p(t),style:{display:`block`,borderRadius:`inherit`,cursor:`zoom-in`},children:n}):n;return(0,M.jsx)(`div`,{style:{breakInside:`avoid`,marginBottom:u,borderRadius:`inherit`,overflow:`hidden`},children:a},t)}),!c.length&&(0,M.jsx)(`div`,{style:{padding:`24px 12px`,fontSize:13,opacity:.55,textAlign:`center`,columnSpan:`all`},children:`Pick images in Settings to fill the gallery`}),m&&(0,M.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:()=>p(null),style:{position:`fixed`,inset:0,zIndex:1400,background:`rgba(0, 0, 0, 0.86)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24},children:[(0,M.jsx)(`img`,{src:c[f].src,alt:c[f].alt??``,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,maxHeight:`84vh`,borderRadius:8,boxShadow:`0 12px 48px rgba(0,0,0,0.5)`}}),h(c[f])&&(0,M.jsx)(`div`,{style:{color:`#fff`,fontSize:14,marginTop:12,opacity:.85},children:h(c[f])}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>p(null),style:{position:`absolute`,top:16,right:20,background:`transparent`,border:0,color:`#fff`,fontSize:28,lineHeight:1,cursor:`pointer`},children:`×`}),c.length>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),p(e=>(e-1+c.length)%c.length)},style:{position:`absolute`,left:16,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:0,color:`#fff`,fontSize:36,cursor:`pointer`,padding:12},children:`‹`}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),p(e=>(e+1)%c.length)},style:{position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:0,color:`#fff`,fontSize:36,cursor:`pointer`,padding:12},children:`›`})]})]})]})}var xt={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},St={background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.25)`,boxShadow:`0 16px 40px rgba(15, 23, 42, 0.16)`,zIndex:60};function Ct({brand:e,logo:t,brandHref:n,brandTarget:r,links:i=[],style:a,nodeRef:o,menu:s=`auto`,breakpoint:c=768}){let[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),[g,_]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!u)return;let e=new ResizeObserver(()=>p(u.offsetWidth<c));return e.observe(u),()=>e.disconnect()},[u,c]);let v=s===`hamburger`||s===`auto`&&f,y=(e,t)=>(0,M.jsxs)(`a`,{href:e.href||`#`,style:{...xt,display:`block`,...t},children:[e.label,e.desc&&(0,M.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]},e.key);return(0,M.jsxs)(`nav`,{ref:e=>{d(e),o&&o(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...S(a)},children:[(t||e)&&(()=>{let i=(0,M.jsxs)(M.Fragment,{children:[t&&(0,M.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,M.jsx)(`span`,{style:{fontWeight:700,fontSize:18,fontFamily:`var(--page-heading-font, inherit)`},children:e})]}),a={display:`flex`,alignItems:`center`,gap:10,color:`inherit`,textDecoration:`none`};return n?(0,M.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:a,children:i}):(0,M.jsx)(`div`,{style:a,children:i})})(),(0,M.jsx)(`div`,{style:{flexGrow:1}}),v?(0,M.jsx)(`button`,{type:`button`,"aria-label":m?`Close menu`:`Open menu`,onClick:()=>h(!m),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:m?`✕`:`☰`}):(0,M.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:i.map(e=>{let t=e.children??[];if(!t.length)return(0,M.jsx)(`a`,{href:e.href||`#`,style:xt,children:e.label},e.key);let n=e.type===`mega`;return(0,M.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>_(e.key),onMouseLeave:()=>_(null),children:[(0,M.jsxs)(`a`,{href:e.href||`#`,style:{...xt,cursor:`pointer`},children:[e.label,` `,(0,M.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),g===e.key&&(n?(0,M.jsx)(`div`,{style:{...St,position:`absolute`,left:0,right:0,top:`100%`,padding:24,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(170px, 1fr))`,gap:16},children:t.map(e=>y(e,{padding:`6px 8px`,borderRadius:6}))}):(0,M.jsx)(`div`,{style:{...St,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>y(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),v&&m&&(0,M.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:i.map(e=>(0,M.jsxs)(l.Fragment,{children:[(0,M.jsx)(`a`,{href:e.href||`#`,style:{...xt,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>y(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function wt({tabs:e=[],linked:t,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(0),o=e.length?Math.min(i,e.length-1):0;return e.length?(0,M.jsxs)(`div`,{ref:r,style:{width:`100%`,...S(n)},children:[(0,M.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>a(t),style:{background:`transparent`,border:0,padding:`10px 16px`,fontSize:14,fontFamily:`inherit`,color:`inherit`,cursor:`pointer`,opacity:t===o?1:.6,fontWeight:t===o?600:500,boxShadow:t===o?`inset 0 -2px 0 var(--page-accent, #111827)`:`none`},children:e.label||`Tab ${t+1}`},e.key))}),e.map((e,n)=>(0,M.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function Tt({items:e=[],linked:t,multiple:n=!1,style:r,nodeRef:i}){let[a,o]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let s=e=>o(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,M.jsx)(`div`,{ref:i,style:{width:`100%`,...S(r)},children:e.map((n,r)=>{let i=a.has(n.key);return(0,M.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid rgba(148, 163, 184, 0.35)`:`none`},children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>s(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:`transparent`,border:0,padding:`14px 4px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:`inherit`,textAlign:`left`,cursor:`pointer`},children:[n.title||`Item ${r+1}`,(0,M.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:i?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,M.jsx)(`div`,{style:{display:i?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var Et={display:`flex`,flexDirection:`column`,gap:`12px`},Dt={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},Ot={padding:`10px 12px`,border:`1px solid var(--page-border, #d1d5db)`,borderRadius:`6px`,fontSize:`14px`,fontFamily:`inherit`,width:`100%`,boxSizing:`border-box`,backgroundColor:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`},kt={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},At=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function jt(e,t){if(!e)return!0;let n=t[e.field],r=n==null||n===``?``:String(n),i=e.value??``;switch(e.op){case`eq`:return r===i;case`neq`:return r!==i;case`contains`:return r.toLowerCase().includes(i.toLowerCase());case`gt`:return Number(r)>Number(i);case`lt`:return Number(r)<Number(i);case`empty`:return r===``;case`notEmpty`:return r!==``;default:return!1}}var Mt={display:`flex`,flexDirection:`column`,gap:6},Nt={font:`inherit`,fontSize:15,padding:`10px 12px`,borderRadius:8,border:`1px solid rgba(148, 163, 184, 0.55)`,background:`transparent`,color:`inherit`,width:`100%`,boxSizing:`border-box`};function Pt(e,t){let n=Array.isArray(e?.options)?e.options:[];if(!e?.parentField)return n;let r=t?.[e.parentField];return r?n.filter(e=>typeof e==`string`?!1:!e.parent||e.parent===r):[]}function Ft({field:e,value:t,onChange:n,inert:r,values:i}){let a=(0,M.jsxs)(`span`,{style:{...Dt,fontSize:14},children:[e.label,e.required?` *`:``]}),o={name:e.name,required:e.required||void 0,placeholder:e.placeholder||void 0,disabled:r||void 0,style:Nt,value:t??``,onChange:t=>n(e.name,t.target.value)};return e.type===`display`?(0,M.jsx)(e.variant&&e.variant!==`p`?e.variant:`p`,{style:{margin:0,color:e.color||`inherit`,fontSize:{h1:32,h2:26,h3:21,h4:18,h5:16,h6:14,p:15}[e.variant]??16,fontWeight:e.variant===`p`?400:700,lineHeight:1.35},children:e.label}):e.type===`image`?e.src?(0,M.jsx)(`img`,{src:e.src,alt:e.label??``,style:{width:`100%`,borderRadius:8,display:`block`}}):null:e.type===`video`?e.src?/youtube\.com|youtu\.be|vimeo\.com/i.test(e.src)?(0,M.jsx)(ct,{url:e.src,style:{width:`100%`}}):(0,M.jsx)(`video`,{src:e.src,controls:!0,style:{width:`100%`,borderRadius:8,display:`block`}}):null:(0,M.jsxs)(`label`,{style:Mt,children:[a,e.type===`textarea`||e.multiline?(0,M.jsx)(`textarea`,{...o,rows:4,style:{...Nt,resize:`vertical`}}):e.type===`select`?(0,M.jsxs)(`select`,{...o,disabled:o.disabled||!!e.parentField&&!i?.[e.parentField],children:[(0,M.jsx)(`option`,{value:``,children:e.placeholder||`—`}),Pt(e,i).map((e,t)=>(0,M.jsx)(`option`,{value:typeof e==`string`?e:e.value,children:typeof e==`string`?e:e.label??e.value},t))]}):e.type===`checkbox`?(0,M.jsx)(`input`,{type:`checkbox`,name:e.name,required:e.required||void 0,disabled:r||void 0,checked:!!t,onChange:t=>n(e.name,t.target.checked),style:{width:18,height:18}}):e.type===`upload`?(0,M.jsx)(`input`,{type:`file`,name:e.name,accept:e.accept||void 0,required:e.required||void 0,disabled:r||void 0,onChange:t=>n(e.name,t.target.files?.[0]?.name??``),style:{font:`inherit`,fontSize:14}}):(0,M.jsx)(`input`,{...o,type:{email:`email`,number:`number`,date:`date`,datetime:`datetime-local`,phone:`tel`,link:`url`}[e.type]??`text`}),e.help&&(0,M.jsx)(`span`,{style:{fontSize:12,opacity:.65},children:e.help})]})}function It({style:e,action:t,method:n,name:r,enctype:i,formSlug:a,auto:o,submitLabel:s,nodeRef:c,inert:u,children:d,linked:f,show:p}){let{tenant:m,apiUrl:h}=(0,l.useContext)(Se),[g,_]=(0,l.useState)(`form`),[v,y]=(0,l.useState)(null),[b,x]=(0,l.useState)({}),[C,w]=(0,l.useState)(0),T=u?p||`form`:g;(0,l.useEffect)(()=>{if(!o||!a)return;let e=!0;return fetch(`${h||`/api`}/forms/${encodeURIComponent(a)}`,{headers:m?{"x-tenant":m}:{}}).then(e=>e.json()).then(t=>e&&y(t?.payload&&typeof t.payload==`object`?t.payload:null)).catch(()=>e&&y(null)),()=>{e=!1}},[o,a,m,h]);let E=[{section:null,fields:[]}];for(let e of Array.isArray(v?.fields)?v.fields:[])e.type===`section`?E.push({section:e,fields:[]}):E[E.length-1].fields.push(e);let ee=E.filter(e=>e.section||e.fields.length),D=ee.filter(e=>!e.section||jt(e.section.condition,b)).map(e=>({...e,fields:e.fields.filter(e=>jt(e.condition,b))})),te=ee.length>1,ne=Math.min(C,Math.max(0,D.length-1)),re=te?D[ne]?.fields??[]:D.flatMap(e=>e.fields),ie=re.filter(e=>{let t=b[e.name];return e.required&&(t==null||t===``||t===!1)}),ae=ne>=D.length-1,oe=(e,t)=>x(n=>{let r={...n,[e]:t};for(let t of Array.isArray(v?.fields)?v.fields:[])t?.parentField===e&&delete r[t.name];return r});return(0,M.jsxs)(`div`,{ref:c,style:S(e),children:[(0,M.jsx)(`form`,{action:t||void 0,method:n||`post`,name:r||void 0,encType:i||void 0,onSubmit:async e=>{if(e.preventDefault(),!u){if(a){let t={};if(o)for(let[e,n]of Object.entries(b))n!=null&&n!==``&&(t[e]=n);else for(let[n,r]of new FormData(e.currentTarget).entries())typeof r==`string`&&(t[n]=r===`on`||r);try{let e=await fetch(`${h||`/api`}/forms/${a}/submit`,{method:`post`,headers:{"content-type":`application/json`,...m?{"x-tenant":m}:{}},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);_(e.ok&&n?.success!==!1?`success`:`error`)}catch{_(`error`)}return}if(!t){_(`success`);return}try{let r=await fetch(t,{method:n||`post`,body:new FormData(e.currentTarget)});_(r.ok?`success`:`error`)}catch{_(`error`)}}},style:{...Et,display:T===`success`?`none`:`flex`},children:o&&a?(0,M.jsxs)(M.Fragment,{children:[te&&(0,M.jsx)(sn,{steps:D.map(e=>({label:e.section?.label??`Start`})),active:ne+1,style:{marginBottom:8}}),te&&D[ne]?.section?.help&&(0,M.jsx)(`p`,{style:{margin:0,fontSize:14,opacity:.7},children:D[ne].section.help}),re.map(e=>(0,M.jsx)(Ft,{field:e,value:b[e.name],values:b,onChange:oe,inert:u},e.name)),(0,M.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`,marginTop:4},children:[te&&ne>0&&(0,M.jsx)(`button`,{type:`button`,disabled:u||void 0,onClick:()=>w(ne-1),style:{...Fe,background:`transparent`,color:`inherit`,border:0,padding:`10px 16px`,cursor:`pointer`},children:`Back`}),te&&!ae?(0,M.jsx)(`button`,{type:`button`,disabled:u||ie.length>0,onClick:()=>w(ne+1),style:{...Fe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:ie.length?.5:1},children:`Next`}):(0,M.jsx)(`button`,{type:`submit`,disabled:u||void 0,style:{...Fe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`},children:s||`Submit`})]})]}):d}),(0,M.jsx)(`div`,{style:{display:T===`success`?`block`:`none`},children:f?.success??null}),(0,M.jsx)(`div`,{style:{display:T===`error`?`block`:`none`,marginTop:12},children:f?.error??null})]})}var Lt=null,Rt=null,zt=e=>{let t=typeof e==`string`&&e.trim()?e.trim():``;if(Lt&&Rt===t)return Lt;if(Lt&&typeof window<`u`){for(let e of[`grecaptcha`,`___grecaptcha_cfg`])try{delete window[e]}catch{window[e]=void 0}document.querySelectorAll(`script[src*="recaptcha"]`).forEach(e=>e.remove())}return Rt=t,Lt=new Promise(e=>{if(typeof window>`u`)return;if(window.grecaptcha?.render)return e(window.grecaptcha);window.__webimRecaptchaReady=()=>e(window.grecaptcha);let n=document.createElement(`script`);n.src=`https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t?`&hl=${encodeURIComponent(t)}`:``}`,n.async=!0,document.head.appendChild(n)}),Lt};function Bt({siteKey:e,theme:t,size:n,hl:r,style:i,nodeRef:a,inert:o,onChange:s}){let c=(0,l.useContext)(Se),u=c?.settings&&typeof c.settings==`object`?c.settings[`google.recaptchaKey`]:``,d=typeof e==`string`&&e.trim()||(typeof u==`string`?u.trim():``),f=(0,l.useRef)(null),p=(0,l.useRef)(s);if(p.current=s,(0,l.useEffect)(()=>{if(o||!d||!f.current)return;let e=!0,i=t=>{e&&typeof p.current==`function`&&p.current(t)};return zt(r).then(r=>{if(!(!e||!f.current||!r?.render)){f.current.innerHTML=``,i(``);try{r.render(f.current,{sitekey:d,theme:t===`dark`?`dark`:`light`,size:n===`compact`?`compact`:`normal`,callback:e=>i(typeof e==`string`?e:``),"expired-callback":()=>i(``),"error-callback":()=>i(``)})}catch{}}}),()=>{e=!1}},[o,d,t,n,r]),o){let e=t===`dark`;return(0,M.jsxs)(`div`,{ref:a,style:S(i),children:[(0,M.jsxs)(`div`,{style:{width:n===`compact`?164:302,boxSizing:`border-box`,padding:`12px 14px`,display:`flex`,alignItems:`center`,gap:12,borderRadius:4,border:`1px solid ${e?`#52565b`:`#d3d3d3`}`,background:e?`#222528`:`#f9f9f9`,color:e?`#f1f1f1`:`#282828`,fontSize:14,fontFamily:`Roboto, Arial, sans-serif`},children:[(0,M.jsx)(`span`,{style:{width:24,height:24,flexShrink:0,borderRadius:3,border:`2px solid ${e?`#8a8f94`:`#c1c1c1`}`,background:e?`#2f3337`:`#fff`}}),(0,M.jsx)(`span`,{style:{flexGrow:1},children:`I'm not a robot`}),(0,M.jsx)(`span`,{style:{fontSize:9,opacity:.6,textAlign:`center`,lineHeight:1.3},children:`reCAPTCHA`})]}),!d&&(0,M.jsx)(`div`,{style:{marginTop:6,fontSize:11,color:`#b45309`},children:`Set the google.recaptchaKey tenant setting (or a site key in Settings) to activate it.`})]})}return d?(0,M.jsx)(`div`,{ref:a,style:S(i),children:(0,M.jsx)(`div`,{ref:f})}):null}function Vt({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,M.jsx)(`label`,{ref:r,style:{...Dt,...S(n)},children:Ke(t,e,i)})}function Ht({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...Ot,...S(i)},...At(o)})}function Ut({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...Ot,resize:`vertical`,...S(i)},...At(o)})}function Wt({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,M.jsxs)(`label`,{ref:o,style:{...kt,...S(a)},children:[(0,M.jsx)(`input`,{type:e,name:n||void 0,value:r||void 0,required:!s&&!!i,onClick:s?e=>e.preventDefault():void 0,tabIndex:s?-1:void 0,style:{margin:0,accentColor:`var(--page-accent, #111827)`}}),t]})}function Gt({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsxs)(`select`,{ref:a,name:e||void 0,required:!o&&!!r,defaultValue:``,onMouseDown:o?e=>e.preventDefault():void 0,tabIndex:o?-1:void 0,style:{...Ot,appearance:`auto`,...S(i)},children:[t!==``&&(0,M.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,M.jsx)(`option`,{value:e,children:e},t))]})}function Kt({name:e,accept:t,required:n,text:r=`Choose a file…`,style:i,nodeRef:a,inert:o}){let[s,c]=(0,l.useState)(null);return(0,M.jsxs)(`label`,{ref:a,style:{...Ot,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...S(i)},children:[(0,M.jsx)(`input`,{type:`file`,name:e||void 0,accept:t||void 0,required:!o&&!!n,disabled:!!o,onChange:e=>c(e.target.files?.[0]?.name??null),style:{display:`none`}}),(0,M.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function qt({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,M.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...Fe,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...S(t)},children:e})}function Jt({cols:e=2,rows:t=1,style:n,nodeRef:r,linked:i}){let a=Math.max(1,(Number(e)||1)*(Number(t)||1));return(0,M.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...S(n)},children:Array.from({length:a},(e,t)=>(0,M.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function Yt({collection:e,limit:t=6,layout:n=`grid`,columns:r=3,imageField:i,titleField:a=`name`,textField:o,custom:s,templateId:c,paged:u,filters:d,style:f,nodeRef:p}){let{tenant:m,apiUrl:h,locale:g}=(0,l.useContext)(Se),_=(0,l.useContext)(De),v=(0,l.useContext)(Ce),[,y]=(0,l.useState)(0);(0,l.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>y(e=>e+1);return window.addEventListener(`popstate`,e),window.addEventListener(`webim:urlchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`webim:urlchange`,e)}},[]);let b=Ee(d),x=JSON.stringify(b),C=x!==`{}`&&!e?.startsWith?.(`api:`),w=C?null:v?.[e],T=u?we(v):1,[E,ee]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||w)return;let n=!0,r=new URLSearchParams;if(g&&r.set(`locale`,g),C&&r.set(`data_filter`,x),u&&!e.startsWith(`api:`)){let e=Math.max(1,Number(t)||6);r.set(`offset`,String((T-1)*e)),r.set(`limit`,String(e))}let i=r.toString(),a=e.startsWith(`api:`)?`${h}/data/${encodeURIComponent(e.slice(4))}`:`${h}/dynamic/${encodeURIComponent(e)}${i?`?${i}`:``}`;return fetch(a,{headers:m?{"x-tenant":m}:{}}).then(e=>e.json()).then(e=>{let t=Array.isArray(e?.payload)?e.payload:Array.isArray(e?.payload?.data)?e.payload.data:[];return n&&ee(t.filter(e=>e&&typeof e==`object`))}).catch(()=>n&&ee([])),()=>{n=!1}},[e,m,h,g,w,u,T,t,C,x]),!e)return null;let D=Math.max(1,Number(t)||6),te=u?w||e.startsWith(`api:`)?(w??E??[]).slice((T-1)*D,T*D):(E??[]).slice(0,D):(w??E??[]).slice(0,D),ne=Math.min(Math.max(Number(r)||3,1),6),re=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${ne}, minmax(0, 1fr))`,gap:24};return s&&c&&_?.render?(0,M.jsx)(`div`,{ref:p,style:{width:`100%`,...re,...S(f)},children:te.map(e=>(0,M.jsx)(`div`,{style:{minWidth:0},children:_.render(c,t=>Me(t,e))},e.id??e?.data?.slug))}):(0,M.jsx)(`div`,{ref:p,style:{width:`100%`,...re,...S(f)},children:te.map(e=>{let t=i?ke(e?.data,i):null,r=a?je(ke(e?.data,a)):null,s=o?ke(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:je(s),u=n===`list`;return(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,M.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,M.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,M.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,M.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:Xe(c)})]})]},e.id??e?.data?.slug)})})}function Xt({fields:e=[],buttonLabel:t=`Search`,style:n,nodeRef:r,inert:i}){let a=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&typeof e.name==`string`&&e.name):[],o=i?{}:Te(),s={height:34,padding:`0 12px`,borderRadius:8,border:`1px solid var(--page-border, rgba(100, 116, 139, 0.4))`,background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,fontSize:13,fontFamily:`inherit`,outline:`none`,minWidth:140,flex:`0 1 auto`,boxSizing:`border-box`},c=e=>{let t=e&&typeof e==`object`?e.value:e,n=e&&typeof e==`object`?e.label??e.value:e;return{value:String(t??``),label:String(n??``)}};return(0,M.jsxs)(`form`,{ref:r,method:`get`,onSubmit:e=>{if(i){e.preventDefault();return}if(typeof window>`u`||!window.history?.pushState)return;e.preventDefault();let t=new URLSearchParams(window.location.search);for(let e of[...t.keys()])(e.startsWith(`f_`)||e===`page`)&&t.delete(e);for(let[n,r]of new FormData(e.currentTarget).entries())n.startsWith(`f_`)&&typeof r==`string`&&r.trim()!==``&&t.set(n,r);let n=t.toString();window.history.pushState({},``,`${window.location.pathname}${n?`?${n}`:``}`),window.dispatchEvent(new Event(`webim:urlchange`))},style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,width:`100%`,...S(n)},children:[a.map(e=>Array.isArray(e.options)&&e.options.length>0||e.type===`option`||e.type===`select`?(0,M.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...At(i),children:[(0,M.jsx)(`option`,{value:``,children:e.label||e.name}),(Array.isArray(e.options)?e.options:[]).map(e=>{let t=c(e);return(0,M.jsx)(`option`,{value:t.value,children:t.label},t.value)})]},e.name):e.type===`switch`?(0,M.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...At(i),children:[(0,M.jsx)(`option`,{value:``,children:e.label||e.name}),(0,M.jsx)(`option`,{value:`true`,children:`Yes`}),(0,M.jsx)(`option`,{value:`false`,children:`No`})]},e.name):(0,M.jsx)(`input`,{type:`text`,name:`f_${e.name}`,defaultValue:o[e.name]??``,placeholder:e.label||e.name,style:s,...At(i)},e.name)),(0,M.jsx)(`button`,{type:`submit`,style:{...s,minWidth:0,padding:`0 18px`,border:`none`,background:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`,fontWeight:600,cursor:i?`default`:`pointer`},...At(i),children:t})]})}function Zt({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,M.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...S(n)},children:(0,M.jsx)(`ol`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,listStyle:`none`,margin:0,padding:0,fontSize:14},children:e.map((n,r)=>{let i=r===e.length-1;return(0,M.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,M.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,M.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,M.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function Qt({pages:e=5,current:t=1,prevNext:n=!0,href:r=`#`,source:i,pageSize:a=6,align:o,hideEmpty:s,inert:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(Se),m=(0,l.useContext)(Ce),[h,g]=(0,l.useState)(null),_=i?Number(m?.[`${i}:total`]):NaN;(0,l.useEffect)(()=>{if(!i||Number.isFinite(_))return;let e=!0,t=i.startsWith(`api:`)?`${p}/data/${encodeURIComponent(i.slice(4))}`:`${p}/dynamic/${encodeURIComponent(i)}?limit=1`;return fetch(t,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(t=>{if(!e)return;let n=t?.payload,r=Array.isArray(n)?n.length:Number(n?.total?.filtered??n?.total?.all??(Array.isArray(n?.data)?n.data.length:0));g(Number.isFinite(r)?r:0)}).catch(()=>e&&g(0)),()=>{e=!1}},[i,f,p,_]);let v=Math.max(1,Number(a)||6),y=Number.isFinite(_)?_:h;if(i&&y===null||i&&s&&!(y>0))return null;let b=Math.min(Math.max(i?Math.ceil(y/v):Number(e)||1,1),50),x=Math.min(Math.max(i?we(m):Number(t)||1,1),b),C=e=>{if(i){if(typeof window<`u`){let t=new URLSearchParams(window.location.search);return t.set(`page`,String(e)),`?${t.toString()}`}return`?page=${e}`}return r&&r!==`#`?r.replace(`{page}`,String(e)):`#`},w=o===`center`?`center`:o===`right`?`flex-end`:`flex-start`,T=c?e=>e.preventDefault():void 0,E=e=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:36,height:36,padding:`0 8px`,borderRadius:8,fontSize:14,textDecoration:`none`,color:e?`var(--page-accent-text, #ffffff)`:`inherit`,background:e?`var(--page-accent, #111827)`:`transparent`,border:e?`1px solid transparent`:`1px solid rgba(148, 163, 184, 0.4)`});return(0,M.jsxs)(`nav`,{ref:d,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,justifyContent:w,...S(u)},children:[n&&(0,M.jsx)(`a`,{href:x>1?C(x-1):`#`,onClick:T,"aria-label":`Previous`,style:{...E(!1),opacity:x>1?1:.4},children:`‹`}),Array.from({length:b},(e,t)=>t+1).map(e=>(0,M.jsx)(`a`,{href:C(e),onClick:T,"aria-current":e===x?`page`:void 0,style:E(e===x),children:e},e)),n&&(0,M.jsx)(`a`,{href:x<b?C(x+1):`#`,onClick:T,"aria-label":`Next`,style:{...E(!1),opacity:x<b?1:.4},children:`›`})]})}var $t=`webim.page_mode`,en=()=>{if(typeof window>`u`)return`auto`;try{let e=window.localStorage.getItem($t);return e===`light`||e===`dark`?e:`auto`}catch{return`auto`}},tn=e=>{let t={width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`light`?(0,M.jsxs)(`svg`,{...t,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,M.jsx)(`path`,{d:`M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4`})]}):e===`dark`?(0,M.jsx)(`svg`,{...t,children:(0,M.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})}):(0,M.jsxs)(`svg`,{...t,children:[(0,M.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`}),(0,M.jsx)(`path`,{d:`M8 21h8M12 17v4`})]})},nn={light:`Light theme`,dark:`Dark theme`,auto:`Follow the device theme`};function rn({variant:e,showSystem:t,style:n,nodeRef:r,inert:i}){let[a,o]=(0,l.useState)(i?`auto`:en),s=(0,l.useRef)(null),c=e=>{s.current=e,typeof r==`function`&&r(e)};(0,l.useEffect)(()=>{if(i)return;let e=s.current?.closest?.(`.webim-page`);e&&(a===`light`||a===`dark`?e.setAttribute(`data-webim-mode`,a):e.removeAttribute(`data-webim-mode`));try{a===`auto`?window.localStorage.removeItem($t):window.localStorage.setItem($t,a)}catch{}},[a,i]);let u=t===!1?[`light`,`dark`]:[`light`,`dark`,`auto`],d=u.includes(a)?a:u[0],f={appearance:`none`,border:0,margin:0,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`transparent`,color:`inherit`,font:`inherit`,cursor:i?`default`:`pointer`,borderRadius:999};if(e===`buttons`)return(0,M.jsx)(`div`,{ref:c,role:`group`,"aria-label":`Theme`,style:{display:`inline-flex`,alignItems:`center`,gap:2,padding:3,borderRadius:999,border:`1px solid rgba(148, 163, 184, 0.4)`,...S(n)},children:u.map(e=>(0,M.jsx)(`button`,{type:`button`,title:nn[e],"aria-label":nn[e],"aria-pressed":e===d,onClick:i?void 0:()=>o(e),style:{...f,width:28,height:28,color:e===d?`var(--page-accent-text, #ffffff)`:`inherit`,background:e===d?`var(--page-accent, #111827)`:`transparent`,opacity:e===d?1:.7},children:tn(e)},e))});let p=u[(u.indexOf(d)+1)%u.length];return(0,M.jsx)(`button`,{ref:c,type:`button`,title:nn[d],"aria-label":`Theme: ${nn[d]} — switch to ${nn[p]}`,onClick:i?void 0:()=>o(p),style:{...f,width:36,height:36,border:`1px solid rgba(148, 163, 184, 0.4)`,...S(n)},children:tn(d)})}var an={facebook:{label:`Facebook`,color:`#1877f2`,d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`},instagram:{label:`Instagram`,color:`#e4405f`,d:`M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06zm0 5.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z`},x:{label:`X (Twitter)`,color:`#000000`,d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`},linkedin:{label:`LinkedIn`,color:`#0a66c2`,d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`},youtube:{label:`YouTube`,color:`#ff0000`,d:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`},tiktok:{label:`TikTok`,color:`#000000`,d:`M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z`},whatsapp:{label:`WhatsApp`,color:`#25d366`,d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z`},telegram:{label:`Telegram`,color:`#26a5e4`,d:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`},pinterest:{label:`Pinterest`,color:`#bd081c`,d:`M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.03-.655 2.569-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z`},github:{label:`GitHub`,color:`#181717`,d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`},discord:{label:`Discord`,color:`#5865f2`,d:`M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.058a.082.082 0 00.031.056 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.873-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.009c.12.099.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z`},email:{label:`E-mail`,color:`#64748b`,d:`M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z`},website:{label:`Website`,color:`#64748b`,d:`M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z`}};function on({links:e=[],variant:t,color:n,size:r,gap:i,newTab:a,style:o,nodeRef:s,inert:c}){let l=Array.isArray(e)?e.filter(e=>e&&an[e.network]):[];if(!l.length)return null;let u=Math.min(Math.max(Number(r)||18,10),64),d=Math.round(u*1.9),f=Number.isFinite(Number(i))?Number(i):10,p=e=>n===`accent`?`var(--page-accent, #111827)`:n===`inherit`?`currentColor`:e.color,m=c?e=>e.preventDefault():void 0;return(0,M.jsx)(`div`,{ref:s,style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:f,...S(o)},children:l.map((e,r)=>{let i=an[e.network],o=t!==`outline`&&t!==`plain`,s=o?n===`accent`?`var(--page-accent-text, #ffffff)`:n===`inherit`?`var(--page-bg, #ffffff)`:`#ffffff`:p(i);return(0,M.jsx)(`a`,{href:e.url||`#`,onClick:m,"aria-label":e.label||i.label,title:e.label||i.label,...a!==!1&&!c?{target:`_blank`,rel:`noopener noreferrer`}:{},style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:t===`plain`?u:d,height:t===`plain`?u:d,borderRadius:`50%`,background:o?p(i):`transparent`,border:t===`outline`?`1px solid ${p(i)}`:`none`,color:`inherit`,textDecoration:`none`},children:(0,M.jsx)(`svg`,{width:u,height:u,viewBox:`0 0 24 24`,fill:s,"aria-hidden":!0,children:(0,M.jsx)(`path`,{d:i.d})})},`${e.network}-${r}`)})})}function sn({steps:e=[],active:t=1,vertical:n=!1,style:r,nodeRef:i}){if(!e.length)return null;let a=Math.min(Math.max(Number(t)||1,1),e.length),o=e=>({width:32,height:32,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:14,fontWeight:600,flexShrink:0,color:e===`todo`?`inherit`:`var(--page-accent-text, #ffffff)`,background:e===`todo`?`transparent`:`var(--page-accent, #111827)`,border:e===`todo`?`1px solid rgba(148, 163, 184, 0.5)`:`1px solid transparent`,opacity:e===`todo`?.6:1,boxShadow:e===`active`?`0 0 0 4px rgba(99, 102, 241, 0.2)`:`none`}),s=e=>({flexGrow:1,alignSelf:`center`,background:e?`var(--page-accent, #111827)`:`rgba(148, 163, 184, 0.4)`,...n?{width:2,minHeight:24,marginLeft:15,alignSelf:`auto`}:{height:2,minWidth:24}});return(0,M.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...S(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,M.jsxs)(l.Fragment,{children:[t>0&&(0,M.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,M.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[(0,M.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,M.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}var cn={small:{w:132,h:46,name:11.5,title:10,avatar:28},medium:{w:168,h:56,name:13,title:11,avatar:36},large:{w:210,h:70,name:15.5,title:12.5,avatar:46}},ln=e=>cn[e]??cn.medium;cn.medium.w,cn.medium.h;function un(e,{size:t=`medium`,horizontal:n=!1}={}){let r=ln(t),i=n?r.h:r.w,a=n?16:20,o=(n?r.w:r.h)+(n?56:48),s=Array.isArray(e)?e.filter(e=>e&&e.id):[],c=new Set(s.map(e=>e.id)),l=new Map,u=[];for(let e of s)e.parent&&c.has(e.parent)&&e.parent!==e.id?(l.has(e.parent)||l.set(e.parent,[]),l.get(e.parent).push(e)):u.push(e);let d=new Map,f=(e,t)=>{if(t.has(e.id))return 0;t.add(e.id);let n=(l.get(e.id)??[]).reduce((e,n,r)=>e+f(n,t)+(r?a:0),0),r=Math.max(i,n);return d.set(e.id,r),r};u.forEach(e=>f(e,new Set));let p=[],m=[],h=0,g=(e,t,s,c)=>{if(c.has(e.id))return;c.add(e.id);let u=t+((d.get(e.id)??i)-i)/2,f=s*o,_=n?f:u,v=n?u:f;p.push({node:e,x:_,y:v}),h=Math.max(h,f+(n?r.w:r.h));let y=t;for(let t of l.get(e.id)??[]){let e=y+((d.get(t.id)??i)-i)/2+i/2,l=(s+1)*o;m.push(n?{from:{x:f+r.w,y:u+r.h/2},to:{x:l,y:e}}:{from:{x:u+r.w/2,y:f+r.h},to:{x:e,y:l}}),g(t,y,s+1,c),y+=(d.get(t.id)??i)+a}},_=0,v=new Set;for(let e of u)g(e,_,0,v),_+=(d.get(e.id)??i)+a;let y=Math.max(_-a,i);return{boxes:p,links:m,width:n?Math.max(h,r.w):y,height:n?y:Math.max(h,r.h),horizontal:n}}var dn=(e,t)=>{let n=String(e??``);return n.length>t?`${n.slice(0,t-1)}…`:n},fn=e=>{let t=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e??``).trim());if(!t)return`#ffffff`;let n=t[1];n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=parseInt(n,16);return .299*(r>>16&255)+.587*(r>>8&255)+.114*(r&255)>150?`#111827`:`#ffffff`},pn=e=>!!(e?.cv?.trim?.()||e?.photo);function mn(e,t={}){let n=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.id):[],r=e=>Array.isArray(e)?e[0]:e,i=e=>e==null?``:je(e);return n.map(e=>{let n=e.data??{},a=r(n[t.parentField]),o=a&&typeof a==`object`?a.id??null:a||null;return{id:e.id,name:i(n[t.nameField||`name`])||i(n.name)||`Untitled`,title:t.titleField?i(n[t.titleField]):``,photo:t.photoField&&r(n[t.photoField])||``,parent:t.parentField?o:null,cv:t.cvField?i(n[t.cvField]):``,href:t.hrefField?i(n[t.hrefField]):``}})}var hn={size:36,pad:10};function gn({node:e,onClose:t}){return(0,l.useEffect)(()=>{let e=e=>e.key===`Escape`&&t();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),(0,M.jsx)(`div`,{onClick:t,role:`dialog`,"aria-modal":`true`,"aria-label":e.name,style:{position:`fixed`,inset:0,zIndex:1e3,background:`rgba(2, 6, 23, 0.6)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16},children:(0,M.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:{background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.35)`,borderRadius:14,maxWidth:420,width:`100%`,maxHeight:`80vh`,overflowY:`auto`,padding:24,position:`relative`,boxShadow:`0 24px 64px rgba(2, 6, 23, 0.5)`},children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:t,style:{position:`absolute`,top:10,right:10,width:30,height:30,border:0,borderRadius:8,background:`transparent`,color:`inherit`,fontSize:18,lineHeight:1,cursor:`pointer`,opacity:.6},children:`×`}),(0,M.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:e.cv?14:0},children:[e.photo&&(0,M.jsx)(`img`,{src:e.photo,alt:``,style:{width:72,height:72,borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[(0,M.jsx)(`div`,{style:{fontSize:18,fontWeight:700},children:e.name}),e.title&&(0,M.jsx)(`div`,{style:{fontSize:13,opacity:.65},children:e.title})]})]}),e.cv&&String(e.cv).split(/\n+/).map((e,t)=>(0,M.jsx)(`p`,{style:{fontSize:14,lineHeight:1.6,margin:`0 0 10px`},children:e},t)),e.href&&(0,M.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,style:{display:`inline-block`,marginTop:6,padding:`8px 14px`,borderRadius:8,fontSize:13,fontWeight:600,textDecoration:`none`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:`Open profile ↗`})]})})}function _n({nodes:e=[],source:t,nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,size:c=`medium`,horizontal:u=!1,style:d,nodeRef:f,interactive:p=!0}){let m=(0,l.useId)(),[h,g]=(0,l.useState)(null),{tenant:_,apiUrl:v}=(0,l.useContext)(Se),y=(0,l.useContext)(Ce)?.[t],[b,x]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!t||y)return;let e=!0;return fetch(`${v}/dynamic/${encodeURIComponent(t)}`,{headers:_?{"x-tenant":_}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&x(n)}).catch(()=>e&&x([])),()=>{e=!1}},[t,_,v,y]);let C=t?mn(y??b??[],{nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s}):e,w=ln(c),{boxes:T,links:E,width:ee,height:D}=un(C,{size:c,horizontal:u});if(!T.length)return!p&&t?(0,M.jsxs)(`div`,{ref:f,style:{padding:18,border:`1px dashed rgba(148, 163, 184, 0.6)`,borderRadius:10,fontSize:13,opacity:.7,textAlign:`center`,...S(d)},children:[`Org Chart — no published entries in “`,t,`” yet`]}):null;let te=new Set(T.filter(e=>e.node.parent==null||e.node.parent===``).map(e=>e.node.id));return(0,M.jsxs)(`div`,{ref:f,style:{maxWidth:`100%`,overflowX:`auto`,...S(d)},children:[(0,M.jsxs)(`svg`,{viewBox:`0 0 ${ee} ${D}`,role:`img`,"aria-label":`Organization chart`,style:{display:`block`,width:`100%`,maxWidth:ee,height:`auto`,margin:`0 auto`},children:[E.map((e,t)=>(0,M.jsx)(`path`,{d:u?`M ${e.from.x} ${e.from.y} H ${(e.from.x+e.to.x)/2} V ${e.to.y} H ${e.to.x}`:`M ${e.from.x} ${e.from.y} V ${(e.from.y+e.to.y)/2} H ${e.to.x} V ${e.to.y}`,fill:`none`,stroke:`rgba(148, 163, 184, 0.7)`,strokeWidth:`1.5`},t)),T.map(({node:e,x:t,y:n})=>{let r=te.has(e.id),i=!!e.color2,a=!!e.color||r||i,o=e.color||(r?`var(--page-accent, #4f46e5)`:`var(--page-bg, #ffffff)`),s=e.color?fn(e.color):r?`var(--page-accent-text, #ffffff)`:`var(--page-text, #111827)`,c=i?fn(e.color2):s,l=p&&(pn(e)||e.href),u=()=>pn(e)?g(e):window.open(e.href,`_blank`,`noreferrer`),d=e.photo?t+hn.pad+w.avatar+8:t+w.w/2,f=e.photo?`start`:`middle`,h=e.photo?Math.floor((w.w-w.avatar-26)/7):Math.floor(w.w/7.6),_=w.h/2,v=[e.name,e.title].map(e=>String(e??``).trim()).filter(Boolean);return(0,M.jsxs)(`g`,{onClick:l?u:void 0,style:l?{cursor:`pointer`}:void 0,role:l?`button`:void 0,"aria-label":l?`Open ${e.name||e.title}'s profile`:void 0,children:[i&&e.gradient?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`linearGradient`,{id:`${m}-${e.id}-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,M.jsx)(`stop`,{offset:`0%`,stopColor:e.color||`var(--page-accent, #4f46e5)`}),(0,M.jsx)(`stop`,{offset:`100%`,stopColor:e.color2})]}),(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`,fill:`url(#${m}-${e.id}-grad)`})]}):i?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`clipPath`,{id:`${m}-${e.id}-box`,children:(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`})}),(0,M.jsxs)(`g`,{clipPath:`url(#${m}-${e.id}-box)`,children:[(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:_,fill:o}),(0,M.jsx)(`rect`,{x:t,y:n+_,width:w.w,height:w.h-_,fill:e.color2})]})]}):(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`,fill:o,stroke:a?`none`:`var(--page-accent, #4f46e5)`,strokeWidth:a?0:1.5}),e.photo&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`clipPath`,{id:`${m}-${e.id}`,children:(0,M.jsx)(`circle`,{cx:t+hn.pad+w.avatar/2,cy:n+w.h/2,r:w.avatar/2})}),(0,M.jsx)(`image`,{href:e.photo,x:t+hn.pad,y:n+(w.h-w.avatar)/2,width:w.avatar,height:w.avatar,preserveAspectRatio:`xMidYMid slice`,clipPath:`url(#${m}-${e.id})`})]}),i&&!e.gradient?(0,M.jsxs)(M.Fragment,{children:[e.title&&(0,M.jsx)(`text`,{x:d,y:n+_/2+w.title*.35,textAnchor:f,fontSize:w.title,fontWeight:`600`,fill:s,children:dn(e.title,h+4)}),e.name&&(0,M.jsx)(`text`,{x:d,y:n+_+_/2+w.name*.35,textAnchor:f,fontSize:w.name,fontWeight:`600`,fill:c,children:dn(e.name,h)})]}):(0,M.jsxs)(M.Fragment,{children:[v[0]&&(0,M.jsx)(`text`,{x:d,y:n+(v[1]?w.h*.43:w.h*.57),textAnchor:f,fontSize:w.name,fontWeight:`600`,fill:s,children:dn(v[0],h)}),v[1]&&(0,M.jsx)(`text`,{x:d,y:n+w.h*.73,textAnchor:f,fontSize:w.title,opacity:`0.7`,fill:s,children:dn(v[1],h+4)})]})]},e.id)})]}),h&&(0,M.jsx)(gn,{node:h,onClose:()=>g(null)})]})}function vn({columns:e=[],rows:t=[],source:n,limit:r=10,striped:i=!0,bordered:a=!1,compact:o=!1,paged:s,emptyText:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(Se),m=(0,l.useContext)(Ce),h=m?.[n],g=s?we(m):1,[_,v]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!n||h)return;let e=!0,t=Math.max(1,Number(r)||10),i=s&&!n.startsWith(`api:`)?`?offset=${(g-1)*t}&limit=${t}`:``,a=n.startsWith(`api:`)?`${p}/data/${encodeURIComponent(n.slice(4))}`:`${p}/dynamic/${encodeURIComponent(n)}${i}`;return fetch(a,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];return e&&v(n)}).catch(()=>e&&v([])),()=>{e=!1}},[n,f,p,h,s,g,r]),!e.length)return null;let y=Math.max(1,Number(r)||10),b=n?s?h||n.startsWith(`api:`)?(h??_??[]).slice((g-1)*y,g*y):(_??[]).slice(0,y):(h??_??[]).slice(0,y):null,x=b?b.map(t=>e.map(e=>je(ke(t?.data,e.field)))):t,C=!!n&&!(n&&!h&&_===null)&&x.length===0,w=o?`6px 10px`:`10px 14px`,T=`1px solid rgba(148, 163, 184, 0.35)`,E=a?{border:T}:{borderBottom:T};return(0,M.jsx)(`div`,{ref:d,style:{width:`100%`,overflowX:`auto`,...S(u)},children:(0,M.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:14,...a?{border:T}:{}},children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e.map((e,t)=>(0,M.jsx)(`th`,{style:{textAlign:`left`,fontWeight:600,padding:w,background:`rgba(148, 163, 184, 0.12)`,...E},children:e.label??e},t))})}),(0,M.jsxs)(`tbody`,{children:[C&&(0,M.jsx)(`tr`,{children:(0,M.jsx)(`td`,{colSpan:e.length,style:{padding:w,textAlign:`center`,opacity:.6,...E},children:c||`No data yet`})}),x.map((t,n)=>(0,M.jsx)(`tr`,{style:i&&n%2==1?{background:`rgba(148, 163, 184, 0.07)`}:void 0,children:e.map((e,n)=>(0,M.jsx)(`td`,{style:{padding:w,...E},children:t?.[n]??``},n))},n))]})]})})}var yn={PageRoot:Be,Section:Ve,Container:He,Heading:Ue,TextBlock:tt,ButtonBlock:it,ImageBlock:at,Spacer:dt,Divider:ft,SliderBlock:vt,CanvasSlider:yt,TabsBlock:wt,QuickStack:Jt,CollectionList:Yt,CollectionSearch:Xt,BreadcrumbsBlock:Zt,PaginationBlock:Qt,StepperBlock:sn,SocialLinksBlock:on,ThemeModeBlock:rn,OrgChartBlock:_n,TableBlock:vn,MasonryBlock:bt,AccordionBlock:Tt,NavbarBlock:Ct,ListBlock:et,TextSpan:qe,QuoteBlock:$e,TextLink:rt,RichTextBlock:Ze,RichContentBlock:Ze,VideoBlock:ot,YouTubeBlock:ct,IframeBlock:lt,EmbedBlock:ut,FormBlock:It,FormLabel:Vt,FormInput:Ht,FormTextarea:Ut,FormCheckbox:e=>(0,M.jsx)(Wt,{kind:`checkbox`,...e}),FormRadio:e=>(0,M.jsx)(Wt,{kind:`radio`,...e}),FormSelect:Gt,FormFile:Kt,FormRecaptcha:Bt,FormSubmit:qt},bn={id:`auth`,label:`Accounts`,category:`Apps`,keys:[`SiteLoginForm`,`SiteAccountMenu`],ssr:`shell`,settings:[`site.authRedirect`]},xn=(0,l.createContext)({user:null,status:`idle`,ensure:()=>{},refresh:()=>{},signOut:()=>{}}),Sn=()=>{let e=(0,l.useContext)(xn);return(0,l.useEffect)(()=>{e.ensure()},[e]),e};function Cn({children:e,initialUser:t,disabled:n,apiUrl:r,tenant:i}){let a=(0,l.useContext)(Se),o=r||a?.apiUrl||`/api`,s=i||a?.tenant||``,[c,u]=(0,l.useState)(t??null),[d,f]=(0,l.useState)(t?`user`:n?`guest`:`idle`),p=(0,l.useRef)(!1),m=(0,l.useCallback)((e,t)=>fetch(`${o}${e}`,{...t,credentials:`include`,headers:{"content-type":`application/json`,...s?{"x-tenant":s}:{},...t?.headers}}),[o,s]),h=(0,l.useCallback)(()=>n?Promise.resolve(null):m(`/site/me`).then(e=>e.ok?e.json():null).then(e=>{let t=e?.payload??null;return u(t),f(t?`user`:`guest`),t}).catch(()=>(u(null),f(`guest`),null)),[m,n]),g=(0,l.useCallback)(()=>m(`/site/logout`,{method:`post`}).catch(()=>{}).then(()=>{u(null),f(`guest`)}),[m]),_=(0,l.useCallback)(()=>{p.current||n||t||(p.current=!0,f(`loading`),h())},[n,t,h]),v=(0,l.useMemo)(()=>({user:c,status:d,ensure:_,refresh:h,signOut:g}),[c,d,_,h,g]);return(0,M.jsx)(xn.Provider,{value:v,children:e})}function wn({when:e,children:t}){let{status:n}=Sn();return!e||e===`always`?t:n===`idle`||n===`loading`?null:e===`user`==(n===`user`)?t:null}function Tn({mode:e=`login`,redirect:t,emailLabel:n=`Email`,passwordLabel:r=`Password`,nameLabel:i=`Name`,submitLabel:a,style:o,nodeRef:s,inert:c,linked:u,show:d}){let{tenant:f,apiUrl:p,settings:m}=(0,l.useContext)(Se),[h,g]=(0,l.useState)(`form`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(!1),x=e===`register`,C=c?d||`form`:h,w=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:``,T=async e=>{if(e.preventDefault(),c)return;let n=new FormData(e.currentTarget);b(!0),v(``);try{let e=await fetch(`${p||`/api`}/site/${x?`register`:`login`}`,{method:`post`,headers:{"content-type":`application/json`,...f?{"x-tenant":f}:{}},credentials:`same-origin`,body:JSON.stringify({email:n.get(`email`),password:n.get(`password`),...x?{name:n.get(`name`)||``}:{}})}),r=await e.json().catch(()=>null);if(!e.ok||r?.success===!1){v(r?.error?.message||`Sign-in failed`),g(`error`),b(!1);return}if(g(`success`),typeof window<`u`){let e=w(t)||w(new URLSearchParams(window.location.search).get(`next`))||w(m?.[`site.authRedirect`])||w(m?.[`apps.auth.redirect`])||`/`;window.location.assign(e)}}catch{v(`Sign-in failed`),g(`error`),b(!1)}};return(0,M.jsxs)(`div`,{ref:s,style:{display:`grid`,gap:12,maxWidth:360,...S(o)},children:[(0,M.jsxs)(`form`,{onSubmit:T,style:{display:C===`form`?`grid`:`none`,gap:10},children:[x?(0,M.jsxs)(`label`,{style:{...Dt,display:`grid`,gap:6},children:[i,(0,M.jsx)(`input`,{name:`name`,type:`text`,style:Ot,...At(c)})]}):null,(0,M.jsxs)(`label`,{style:{...Dt,display:`grid`,gap:6},children:[n,(0,M.jsx)(`input`,{name:`email`,type:`email`,required:!c,style:Ot,...At(c)})]}),(0,M.jsxs)(`label`,{style:{...Dt,display:`grid`,gap:6},children:[r,(0,M.jsx)(`input`,{name:`password`,type:`password`,required:!c,style:Ot,...At(c)})]}),(0,M.jsx)(`button`,{type:c?`button`:`submit`,disabled:y||void 0,style:{...Fe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:y?.6:1},children:a||(x?`Create account`:`Sign in`)}),_?(0,M.jsx)(`p`,{style:{margin:0,fontSize:14,color:`#dc2626`},children:_}):null]}),(0,M.jsx)(`div`,{style:{display:C===`success`?`block`:`none`},children:u?.success??null}),(0,M.jsx)(`div`,{style:{display:C===`error`?`block`:`none`},children:u?.error??null})]})}function En({greeting:e=`Hi`,signOutLabel:t=`Sign out`,showEmail:n=!1,style:r,nodeRef:i,inert:a,linked:o,show:s}){let{user:c,status:l,signOut:u}=Sn(),d=a?s||`user`:l,f=a?{name:`Ada Lovelace`,email:`ada@example.com`}:c;return d===`loading`?(0,M.jsx)(`div`,{ref:i,style:{minHeight:24,...S(r)}}):d===`user`?(0,M.jsxs)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...S(r)},children:[(0,M.jsxs)(`span`,{style:{...Dt,fontWeight:600},children:[e,` `,f?.name||f?.email||``]}),n&&f?.email?(0,M.jsx)(`span`,{style:{...Dt,opacity:.7},children:f.email}):null,(0,M.jsx)(`button`,{type:`button`,onClick:a?void 0:u,style:{...Fe,border:0,padding:`8px 16px`,borderRadius:8,fontSize:14,cursor:a?`default`:`pointer`},...At(a),children:t})]}):(0,M.jsx)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...S(r)},children:o?.signedOut??null})}var Dn={id:`language`,label:`Language`,category:`Apps`,keys:[`SiteLanguagePicker`],ssr:`prefetch`,settings:[`locales`]};function On(e){let t=e?.locales,n=[typeof t?.default==`string`&&t.default.trim()?t.default.trim():``,...Array.isArray(t?.enabled)?t.enabled:[]].filter(e=>typeof e==`string`&&e.trim());return[...new Set(n.map(e=>e.trim()))]}var kn=e=>e&&e.charAt(0).toUpperCase()+e.slice(1);function An(e,t){let n=String(e??``).toUpperCase();if(t===`code`)return n;let r=``;try{r=kn(new Intl.DisplayNames([e],{type:`language`}).of(e)??``)}catch{}return!r||r.toUpperCase()===n?n:t===`both`?`${n} — ${r}`:r}function jn(e,t){let n=t?``:`?locale=${encodeURIComponent(e)}`;if(typeof window>`u`)return n||`?`;try{let n=new URL(window.location.href);return t?n.searchParams.delete(`locale`):n.searchParams.set(`locale`,e),n.searchParams.delete(`page`),`${n.pathname}${n.search}${n.hash}`}catch{return n||`/`}}function Mn({variant:e,display:t,separator:n,label:r,style:i,nodeRef:a,inert:o}){let s=(0,l.useContext)(Se),c=On(s?.settings),u=c[0]??``,d=c.includes(s?.locale)?s.locale:u,f={display:`inline-flex`,alignItems:`center`,gap:8,...S(i)};if(c.length<2)return o?(0,M.jsx)(`div`,{ref:a,style:{...f,padding:`8px 12px`,border:`1px dashed rgba(100, 116, 139, 0.45)`,borderRadius:6,color:`rgba(100, 116, 139, 0.8)`,fontSize:12},children:`Add site languages in Settings → Languages`}):null;let p=r?(0,M.jsx)(`span`,{style:{opacity:.7},children:r}):null;return e===`inline`?(0,M.jsxs)(`div`,{ref:a,style:f,children:[p,c.map((e,r)=>(0,M.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[r>0&&(0,M.jsx)(`span`,{style:{opacity:.4},children:n??`·`}),(0,M.jsx)(`a`,{href:jn(e,e===u),hrefLang:e,"aria-current":e===d?`true`:void 0,onClick:o?e=>e.preventDefault():void 0,style:{color:e===d?`var(--page-accent, inherit)`:`inherit`,fontWeight:e===d?600:400,textDecoration:`none`,cursor:o?`default`:`pointer`},children:An(e,t)})]},e))]}):(0,M.jsxs)(`div`,{ref:a,style:f,children:[p,(0,M.jsx)(`select`,{"aria-label":r||`Language`,value:d,onChange:o?void 0:e=>{let t=e.target.value;window.location.assign(jn(t,t===u))},onKeyDown:o?e=>e.preventDefault():void 0,style:{font:`inherit`,color:`inherit`,background:`var(--page-surface, transparent)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:6,padding:`4px 8px`,cursor:o?`default`:`pointer`},children:c.map(e=>(0,M.jsx)(`option`,{value:e,children:An(e,t)},e))})]})}var Nn=[bn,Dn],Pn={SiteLoginForm:Tn,SiteAccountMenu:En,SiteLanguagePicker:Mn};new Set(Nn.filter(e=>e.ssr===`shell`).flatMap(e=>e.keys));var Fn=new Map;function In(e){if(Fn.has(e))return Fn.get(e);let t=URL.createObjectURL(new Blob([e],{type:`text/javascript`})),n=import(t).finally(()=>URL.revokeObjectURL(t));return Fn.set(e,n),n}function Ln(e){let t=e&&typeof e==`object`?e.builder_plugins:null,n=t&&typeof t==`object`?t.plugins:null;return n&&typeof n==`object`?n:{}}async function Rn(e,t){let n=await In(e);return(Array.isArray(n?.default?.blocks)?n.default.blocks:[]).find(e=>e?.id===t&&typeof e.mount==`function`)??null}var zn={padding:`10px 12px`,border:`1px dashed rgba(148, 163, 184, 0.5)`,borderRadius:8,fontSize:12,opacity:.6};function Bn({pluginId:e,blockId:t,props:n,style:r,nodeRef:i}){let a=(0,l.useContext)(Se),o=Ln(a?.settings)[e],s=(0,l.useRef)(null),c=(0,l.useRef)(null),u={tenant:a?.tenant??``,apiUrl:a?.apiUrl??`/api`,locale:a?.locale??``,settings:a?.settings??null},d=(0,l.useRef)(u);d.current=u;let f=JSON.stringify(n??{});return(0,l.useEffect)(()=>{let e=s.current;if(!o?.code||!e)return;let n=!0;return Rn(o.code,t).then(e=>{if(!(!n||!e||!s.current)){c.current=e;try{e.mount(s.current,JSON.parse(f),d.current)}catch{c.current=null}}}).catch(()=>{}),()=>{n=!1;let t=c.current;c.current=null;try{t?.unmount?.(e)}catch{}e&&(e.innerHTML=``)}},[o?.code,t]),(0,l.useEffect)(()=>{let e=c.current,t=s.current;if(!(!e||!t))try{e.update?e.update(t,JSON.parse(f),d.current):(e.unmount?.(t),t.innerHTML=``,e.mount(t,JSON.parse(f),d.current))}catch{}},[f]),o?(0,M.jsx)(`div`,{ref:i,style:S(r),children:(0,M.jsx)(`div`,{ref:s})}):(0,M.jsxs)(`div`,{ref:i,style:{...zn,...S(r)},children:[`Plugin “`,e,`” is not installed`]})}var Vn={...yn,...Pn,PluginBlock:Bn};function Hn(e,t,n,r=new Set,i=void 0){let a=t[e];if(!a||a.hidden)return null;let o=a.type?.resolvedName,s=i?.mapProps?i.mapProps(a.props??{},o):a.props??{};if(o===`ComponentInstance`){let t=a.props?.componentId,o=n?.[t];if(!o?.template||r.has(t))return null;let s=new Set(r).add(t);return(0,M.jsx)(l.Fragment,{children:Hn(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=Vn[o];if(!c)return null;let u=(a.nodes??[]).map(e=>Hn(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,i])=>[e,Hn(i,t,n,r)])):void 0,p=(0,M.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),E(t,s))},children:u.length?u:void 0},e);return s.when&&s.when!==`always`?(0,M.jsx)(wn,{when:s.when,children:p},e):p}var Un=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `),Wn=e=>`.webim-page[data-webim-mode="light"] { ${Object.entries(A(e.light)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }
|
|
14
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(A(e.dark)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }`;function
|
|
15
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
13
|
+
`)}var se=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,O={light:{background:`#f2f2f2`,surface:`#f2f2f2`,border:`#d1d5db`,text:`#111827`,accent:`#111827`,accentText:`#ffffff`,primary:{light:`#4b5563`,main:`#111827`,dark:`#030712`,contrastText:`#ffffff`},secondary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`}},dark:{background:`#0f172a`,surface:`#1e293b`,border:`rgba(226, 232, 240, 0.18)`,text:`#e2e8f0`,accent:`#6366f1`,accentText:`#ffffff`,primary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`},secondary:{light:`#5eead4`,main:`#14b8a6`,dark:`#0f766e`,contrastText:`#052e2b`}}},k={font:`system`,headingFont:`inherit`,light:O.light,dark:O.dark},ce={system:{label:`System`,value:se},inter:{label:`Inter`,value:`"Inter", ${se}`},outfit:{label:`Outfit`,value:`"Outfit", ${se}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},le=(e,t)=>ce[e]?.value??_(e)??(typeof e==`string`&&e.trim()?`"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`:t),ue=(e,...t)=>{let n=Object.assign({},e,...t);return n.primary={...e.primary,...t.reduce((e,t)=>({...e,...t?.primary}),{})},n.secondary={...e.secondary,...t.reduce((e,t)=>({...e,...t?.secondary}),{})},n};function de(e){let{light:t,dark:n,font:r,headingFont:i,...a}=e??{};return{font:r??k.font,headingFont:i??k.headingFont,light:ue(O.light,a,t),dark:ue(O.dark,n)}}function A(e){return{"--page-bg":e.background,"--page-surface":e.surface??e.background,"--page-border":e.border??O.light.border,"--page-text":e.text,"--page-accent":e.accent,"--page-accent-text":e.accentText,"--page-primary-light":e.primary.light,"--page-primary":e.primary.main,"--page-primary-dark":e.primary.dark,"--page-primary-contrast":e.primary.contrastText,"--page-secondary-light":e.secondary.light,"--page-secondary":e.secondary.main,"--page-secondary-dark":e.secondary.dark,"--page-secondary-contrast":e.secondary.contrastText}}function j(e){let t=de(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:le(t.font,se),"--page-heading-font":t.headingFont===`inherit`?`inherit`:le(t.headingFont,`inherit`)}}function fe(e,t=`light`){let n=de(e);return{...j(e),...A(n[t]??n.light)}}function pe(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function me(e,t){return e===`light`||e===`dark`?e:t===`light`||t===`dark`?t:`auto`}function he({page:e,settings:t,tenant:n,apiUrl:r,locale:i}){let a={...t?.global??{},...t?.tenant??{}},o=e.meta??{};return{schema:1,title:e.title,slug:e.slug,blocks:i&&o.i18n?.[i]?.blocks||e.blocks,theme:pe(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,seo:o.seo,direction:o.direction,scheme:o.scheme,locale:i||a.locales?.default,locales:a.locales,tenant:n??``,apiUrl:r??``,settings:a}}var ge=async e=>{let t=await e.json().catch(()=>null);if(!e.ok||t?.success===!1)throw Error(t?.error?.message||`Request failed (${e.status})`);return t?.payload??t};async function _e({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,token:a,page:o,fetch:s}){if(!e)throw Error(`fetchPage: apiUrl is required`);if(!n)throw Error(`fetchPage: slug is required`);let c=s??fetch,l=e.replace(/\/$/,``),u={...t?{"x-tenant":t}:{},...a?{authorization:`Bearer ${a}`}:{}},[d,f]=await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i?`?preview=${encodeURIComponent(i)}`:``}`,{headers:u}).then(ge),c(`${l}/settings/public`,{headers:u}).then(ge)]),p=he({page:d,settings:f,tenant:t,apiUrl:l,locale:r}),m=[...new Set(Object.values(p.blocks??{}).map(e=>e?.type?.resolvedName===`CollectionList`?e.props?.collection:e?.type?.resolvedName===`TableBlock`||e?.type?.resolvedName===`OrgChartBlock`?e.props?.source:null).filter(Boolean))];if(m.length){let e=e=>e.startsWith(`api:`)?`${l}/data/${encodeURIComponent(e.slice(4))}`:`${l}/dynamic/${encodeURIComponent(e)}?all=1${r?`&locale=${encodeURIComponent(r)}`:``}`,t=await Promise.all(m.map(t=>c(e(t),{headers:u}).then(ge).then(e=>{let n=Array.isArray(e)?e:Array.isArray(e?.data)?e.data:[],r=Number(e?.total?.filtered??e?.total?.all??n.length);return[[t,n],[`${t}:total`,Number.isFinite(r)?r:n.length]]}).catch(()=>[[t,[]]])));p.datasets=Object.fromEntries(t.flat())}let h=Number(o);return Number.isFinite(h)&&h>=1&&(p.datasets={...p.datasets??{},__page:Math.floor(h)}),p}var ve=new Set([`ar`,`he`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`]),ye=e=>ve.has(String(e||``).toLowerCase().split(/[-_]/)[0])?`rtl`:`ltr`,be=(e,t)=>e===`ltr`||e===`rtl`?e:t?ye(t):void 0,xe=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),M=e(((e,t)=>{t.exports=xe()}))(),Se=(0,l.createContext)({tenant:``,apiUrl:`/api`,locale:``,settings:null}),Ce=(0,l.createContext)(null),we=e=>{let t=Number(e?.__page);if(Number.isFinite(t)&&t>=1)return Math.floor(t);if(typeof window>`u`)return 1;let n=Number(new URLSearchParams(window.location.search).get(`page`));return Number.isFinite(n)&&n>=1?Math.floor(n):1},Te=()=>{if(typeof window>`u`)return{};let e={};return new URLSearchParams(window.location.search).forEach((t,n)=>{n.startsWith(`f_`)&&n.length>2&&t!==``&&(e[n.slice(2)]=t)}),e},Ee=e=>{let t={...e&&typeof e==`object`&&!Array.isArray(e)?e:{},...Te()};return Object.fromEntries(Object.entries(t).filter(([,e])=>typeof e==`string`&&e.trim()!==``))},De=(0,l.createContext)(null),Oe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function ke(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Ae=e=>{let t=[];for(let[n,r]of Object.entries(e??{})){if(!/^[\w-]+$/.test(n))continue;t.push(n);let e=Array.isArray(r)?r[0]:r,i=Array.isArray(r)?`${n}.0`:n;if(e&&typeof e==`object`&&!Array.isArray(e))for(let n of Object.keys(e))/^[\w-]+$/.test(n)&&t.push(`${i}.${n}`)}return t};function je(e){return e==null?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):typeof e==`object`&&!Array.isArray(e)&&(`label`in e||`name`in e||`slug`in e)?String(e.label??e.name??e.slug??``):typeof e==`object`&&!Array.isArray(e)&&Number.isFinite(Number(e.lat))&&Number.isFinite(Number(e.lng))?`${e.lat}, ${e.lng}`:Array.isArray(e)?e.map(e=>typeof e==`string`?e:Array.isArray(e?.parts)?e.parts.map(e=>e?.text??``).join(``):Array.isArray(e?.items)?e.items.map(e=>e?.text??``).join(` `):e&&(e.label!=null||e.name!=null||e.slug!=null)?String(e.label??e.name??e.slug):``).filter(Boolean).join(` `):``}function Me(e,t){let n=t?.data??{},r=Ae(n);if(!r.length)return e;let i=RegExp(`:(${r.map(Oe).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>je(ke(n,t))):Array.isArray(e)?e.map(a):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,a(t)])):e;return a(e)}var Ne={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},Pe={margin:0},Fe={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},Ie={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},Le={display:`flex`,flexDirection:`column`};function Re({style:e}){let t=e?.backgroundVideo;if(!t)return null;let n={position:`absolute`,inset:0,width:`100%`,height:`100%`,zIndex:-1,pointerEvents:`none`},r=e?.overlayColor?`color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity??50}%, transparent)`:null;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,M.jsx)(`div`,{style:{...n,background:r}})]})}var ze=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...S(e)}:{...t,...S(e)};function Be({style:e,nodeRef:t,children:n}){return(0,M.jsxs)(`div`,{ref:t,style:{...Ie,...S(e)},children:[(0,M.jsx)(Re,{style:e}),n]})}function Ve({style:e,nodeRef:t,children:n}){return(0,M.jsxs)(`section`,{ref:t,style:ze(e,Le),children:[(0,M.jsx)(Re,{style:e}),n]})}function He({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,M.jsxs)(`div`,{ref:n,style:i?{...i,...ze(e)}:ze(e),children:[(0,M.jsx)(Re,{style:e}),r]})}function Ue({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,M.jsx)(n,{ref:a,style:{...Ne,...S(r)},children:Ke(t,e,i)})}var We={fontFamily:ce.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function Ge(e,t=[],n,r){let i=e;return t.includes(`sup`)?i=(0,M.jsx)(`sup`,{children:i}):t.includes(`sub`)&&(i=(0,M.jsx)(`sub`,{children:i})),t.includes(`code`)&&(i=(0,M.jsx)(`code`,{style:We,children:i})),t.includes(`strike`)&&(i=(0,M.jsx)(`s`,{children:i})),t.includes(`underline`)&&(i=(0,M.jsx)(`u`,{children:i})),t.includes(`italic`)&&(i=(0,M.jsx)(`em`,{children:i})),t.includes(`bold`)&&(i=(0,M.jsx)(`strong`,{children:i})),n&&(i=(0,M.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{color:`inherit`},children:i})),i}function Ke(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,M.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,M.jsx)(l.Fragment,{children:Ke(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,M.jsx)(`sup`,{children:r}):e.sub&&(r=(0,M.jsx)(`sub`,{children:r})),e.code&&(r=(0,M.jsx)(`code`,{style:We,children:r})),e.strike&&(r=(0,M.jsx)(`s`,{children:r})),e.underline&&(r=(0,M.jsx)(`u`,{children:r})),e.italic&&(r=(0,M.jsx)(`em`,{children:r})),e.bold&&(r=(0,M.jsx)(`strong`,{children:r})),(e.color||e.background)&&(r=(0,M.jsx)(`span`,{style:{...e.color&&{color:e.color},...e.background&&{backgroundColor:e.background}},children:r})),e.href&&(r=(0,M.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{color:e.color??`inherit`},children:r})),(0,M.jsx)(l.Fragment,{children:r},t)}):t}function qe({parts:e,text:t,marks:n,href:r,target:i,style:a}){return(0,M.jsx)(`span`,{style:S(a),children:e?.length?Ke(e,t):Ge(t,n,r,i)})}var Je={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16};function Ye({align:e=`center`,width:t,wrap:n}={}){let r=t?`${t}%`:void 0;if(e===`full`)return{width:`100%`};let i=e===`left`||e===`right`;return i&&(n??!0)?{float:e,width:r??`50%`,maxWidth:`100%`,marginTop:`4px`,marginBottom:`12px`,...e===`left`?{marginRight:`20px`,marginLeft:0}:{marginLeft:`20px`,marginRight:0}}:i?{width:r??`fit-content`,maxWidth:`100%`,...e===`left`?{marginLeft:0,marginRight:`auto`}:{marginLeft:`auto`,marginRight:0}}:{width:r??`fit-content`,maxWidth:`100%`,marginLeft:`auto`,marginRight:`auto`}}function Xe(e=[],t,n){let r=n??((e,n)=>Ke(e,n,t));return e.map((t,n)=>{let i={marginTop:0,marginBottom:n===e.length-1?0:14};if(t.type===`image`){if(!t.src)return null;let e=(0,M.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,M.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...Ye(t)},children:[t.href?(0,M.jsx)(`a`,{href:t.href,target:t.target||void 0,rel:t.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`},children:e}):e,t.caption&&(0,M.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return st(t.url)?(0,M.jsx)(`div`,{style:{...i,...Ye({align:t.align,wrap:t.wrap,width:t.width??100})},children:(0,M.jsx)(ct,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`divider`)return(0,M.jsx)(`hr`,{style:{...i,border:0,borderTop:`1px solid rgba(148, 163, 184, 0.4)`}},n);if(t.type===`table`){let e=Array.isArray(t.rows)?t.rows.filter(Array.isArray):[];if(!e.length)return null;let r=t.header!==!1,a={border:t.borders===!1?void 0:`1px solid rgba(148, 163, 184, 0.4)`,padding:`6px 10px`,textAlign:`left`,verticalAlign:`top`},o=r?e.slice(1):e,s=Array.isArray(t.widths)?t.widths:null;return(0,M.jsxs)(`table`,{style:{...i,borderCollapse:`collapse`,width:`100%`,fontSize:`inherit`,tableLayout:s?`fixed`:void 0},children:[s&&(0,M.jsx)(`colgroup`,{children:s.map((e,t)=>(0,M.jsx)(`col`,{style:{width:`${e}%`}},t))}),r&&(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e[0].map((e,t)=>(0,M.jsx)(`th`,{style:{...a,fontWeight:700},children:e},t))})}),(0,M.jsx)(`tbody`,{children:o.map((e,t)=>(0,M.jsx)(`tr`,{children:e.map((e,t)=>(0,M.jsx)(`td`,{style:a,children:e},t))},t))})]},n)}if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,M.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,M.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,M.jsx)(`blockquote`,{style:{...Qe,...i},children:r(t.parts,t.text)},n);if(Je[t.type]){let e=t.type;return(0,M.jsx)(e,{style:{...Ne,fontSize:Je[t.type],...i},children:r(t.parts,t.text)},n)}return(0,M.jsx)(`p`,{style:{...Pe,...i},children:r(t.parts,t.text)},n)})}function Ze({content:e,style:t,linked:n,nodeRef:r}){return(0,M.jsx)(`div`,{ref:r,style:{display:`flow-root`,...S(t)},children:Xe(e,n)})}var Qe={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function $e({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,M.jsx)(`blockquote`,{ref:i,style:{...Qe,...S(n)},children:Ke(t,e,r)})}function et({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,M.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...S(n)},children:t.map((e,t)=>(0,M.jsx)(`li`,{style:{marginBottom:4},children:Ke(e.parts,e.text)},t))})}function tt({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,M.jsx)(`p`,{ref:i,style:{...Pe,...S(n)},children:Ke(t,e,r)})}var nt={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function rt({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,M.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...nt,...S(i)},children:Ke(t,e,a)})}function it({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,M.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...Fe,...S(i)},children:Ke(t,e,a)})}function at({src:e,alt:t,style:n,nodeRef:r}){return e?(0,M.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...S(n)}}):null}function ot({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,M.jsx)(`video`,{ref:s,src:e,poster:t||void 0,controls:n,autoPlay:r,muted:a||r,loop:i,playsInline:!0,style:{display:`block`,width:`100%`,maxWidth:`100%`,...S(o)}}):null}var st=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function ct({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=st(e);if(!c)return null;let l=new URLSearchParams({rel:`0`});return t&&l.set(`autoplay`,`1`),(n||t)&&l.set(`mute`,`1`),i||l.set(`controls`,`0`),r&&(l.set(`loop`,`1`),l.set(`playlist`,c)),Number(a)>0&&l.set(`start`,String(Math.floor(Number(a)))),(0,M.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...S(o)},children:(0,M.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${c}?${l}`,title:`YouTube video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,border:0}})})}function lt({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,M.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...S(r)}}):null}function ut({code:e,runScripts:t=!0,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(null);return(0,l.useEffect)(()=>{i&&(i.innerHTML=e||``,t&&i.querySelectorAll(`script`).forEach(e=>{let t=document.createElement(`script`);for(let{name:n,value:r}of e.attributes)t.setAttribute(n,r);t.text=e.textContent,e.replaceWith(t)}))},[i,e,t]),(0,M.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:S(n)})}function dt({height:e,nodeRef:t}){return(0,M.jsx)(`div`,{ref:t,style:{height:e||32,flexShrink:0,alignSelf:`stretch`}})}function ft({style:e,nodeRef:t}){return(0,M.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...S(e)}})}var pt={position:`absolute`,top:`50%`,transform:`translateY(-50%)`,width:36,height:36,borderRadius:`50%`,border:0,cursor:`pointer`,background:`rgba(17, 24, 39, 0.45)`,color:`#fff`,fontSize:20,lineHeight:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:0},mt={bottom:{inset:`auto 0 0 0`,padding:`40px 24px 20px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.55))`},top:{inset:`0 0 auto 0`,padding:`20px 24px 40px`,background:`linear-gradient(rgba(0, 0, 0, 0.55), transparent)`},middle:{inset:0,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:24,textShadow:`0 2px 12px rgba(0, 0, 0, 0.6)`}},ht=48;function gt({count:e,renderSlide:t,autoplay:n=!0,interval:r=5,height:i=320,swipe:a=!0,style:o,nodeRef:s}){let[c,u]=(0,l.useState)(0),[d,f]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),h=e?Math.min(c,e-1):0;if((0,l.useEffect)(()=>{if(!n||d||p||e<2)return;let t=setInterval(()=>u(t=>(t+1)%e),Math.max(2,Number(r)||5)*1e3);return()=>clearInterval(t)},[n,d,p,r,e]),!e)return null;let g=t=>u((t+e)%e),_=()=>{if(!p)return;let{dx:e}=p;m(null),e<-48?g(h+1):e>ht&&g(h-1)};return(0,M.jsxs)(`div`,{ref:s,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onPointerDown:a&&e>1?e=>{e.pointerType===`mouse`&&e.button!==0||e.target.closest(`button`)||(e.currentTarget.setPointerCapture(e.pointerId),m({startX:e.clientX,dx:0}))}:void 0,onPointerMove:p?e=>m(t=>t&&{...t,dx:e.clientX-t.startX}):void 0,onPointerUp:_,onPointerCancel:_,style:{position:`relative`,overflow:`hidden`,width:`100%`,touchAction:`pan-y`,userSelect:p?`none`:void 0,cursor:p?`grabbing`:void 0,...S(o)},children:[(0,M.jsx)(`div`,{style:{display:`flex`,height:i,transform:`translateX(calc(${-h*100}% + ${p?.dx??0}px))`,transition:p?`none`:`transform 450ms ease`},children:Array.from({length:e},(e,n)=>(0,M.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...pt,left:12},onClick:()=>g(h-1),children:`‹`}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...pt,right:12},onClick:()=>g(h+1),children:`›`}),(0,M.jsx)(`div`,{style:{position:`absolute`,bottom:10,left:0,right:0,display:`flex`,justifyContent:`center`,gap:6},children:Array.from({length:e},(e,t)=>(0,M.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,onClick:()=>g(t),style:{width:8,height:8,borderRadius:`50%`,border:0,padding:0,cursor:`pointer`,background:t===h?`#ffffff`:`rgba(255, 255, 255, 0.45)`}},t))})]})]})}var _t=(e,t)=>({position:`absolute`,inset:0,backgroundImage:e?`url(${e})`:`none`,backgroundColor:t||(e?void 0:`rgba(148, 163, 184, 0.25)`),backgroundSize:`cover`,backgroundPosition:`center`});function vt({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,M.jsx)(gt,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{style:_t(i.image)}),(i.title||i.text)&&(0,M.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...mt[t]??mt.bottom},children:[i.title&&(0,M.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,M.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function yt({slides:e=[],linked:t,...n}){return e.length?(0,M.jsx)(gt,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{style:_t(r.image,r.color)}),(0,M.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}function bt({images:e=[],columns:t=3,gap:n=8,showNames:r=!1,lightbox:i=!0,style:a,nodeRef:o,inert:s}){let c=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],u=Math.max(0,Number(n)||0),d=s?e=>e.preventDefault():void 0,[f,p]=(0,l.useState)(null),m=i&&!s&&f!==null&&c[f];(0,l.useEffect)(()=>{if(!m)return;let e=e=>{e.key===`Escape`&&p(null),e.key===`ArrowRight`&&p(e=>(e+1)%c.length),e.key===`ArrowLeft`&&p(e=>(e-1+c.length)%c.length)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m,c.length]);let h=e=>{if(typeof e.name==`string`&&e.name.trim())return e.name;if(typeof e.alt==`string`&&e.alt.trim())return e.alt;try{let t=String(e.src).split(`?`)[0].split(`/`).pop();return decodeURIComponent(t??``)}catch{return``}};return(0,M.jsxs)(`div`,{ref:o,style:{columnCount:Math.min(Math.max(Number(t)||3,1),8),columnGap:u,width:`100%`,...S(a)},children:[c.map((e,t)=>{let n=(0,M.jsxs)(`span`,{style:{position:`relative`,display:`block`,borderRadius:`inherit`,overflow:`hidden`},children:[(0,M.jsx)(`img`,{src:e.src,alt:e.alt??``,style:{width:`100%`,display:`block`,borderRadius:`inherit`}}),r&&h(e)&&(0,M.jsx)(`span`,{style:{position:`absolute`,insetInline:0,bottom:0,padding:`14px 10px 8px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.65))`,color:`#fff`,fontSize:12,lineHeight:1.3,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:h(e)})]}),a=e.href?(0,M.jsx)(`a`,{href:e.href,onClick:d,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`,borderRadius:`inherit`},children:n}):i&&!s?(0,M.jsx)(`span`,{role:`button`,tabIndex:0,onClick:()=>p(t),onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&p(t),style:{display:`block`,borderRadius:`inherit`,cursor:`zoom-in`},children:n}):n;return(0,M.jsx)(`div`,{style:{breakInside:`avoid`,marginBottom:u,borderRadius:`inherit`,overflow:`hidden`},children:a},t)}),!c.length&&(0,M.jsx)(`div`,{style:{padding:`24px 12px`,fontSize:13,opacity:.55,textAlign:`center`,columnSpan:`all`},children:`Pick images in Settings to fill the gallery`}),m&&(0,M.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:()=>p(null),style:{position:`fixed`,inset:0,zIndex:1400,background:`rgba(0, 0, 0, 0.86)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24},children:[(0,M.jsx)(`img`,{src:c[f].src,alt:c[f].alt??``,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,maxHeight:`84vh`,borderRadius:8,boxShadow:`0 12px 48px rgba(0,0,0,0.5)`}}),h(c[f])&&(0,M.jsx)(`div`,{style:{color:`#fff`,fontSize:14,marginTop:12,opacity:.85},children:h(c[f])}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>p(null),style:{position:`absolute`,top:16,right:20,background:`transparent`,border:0,color:`#fff`,fontSize:28,lineHeight:1,cursor:`pointer`},children:`×`}),c.length>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),p(e=>(e-1+c.length)%c.length)},style:{position:`absolute`,left:16,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:0,color:`#fff`,fontSize:36,cursor:`pointer`,padding:12},children:`‹`}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),p(e=>(e+1)%c.length)},style:{position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:0,color:`#fff`,fontSize:36,cursor:`pointer`,padding:12},children:`›`})]})]})]})}var xt={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},St={background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.25)`,boxShadow:`0 16px 40px rgba(15, 23, 42, 0.16)`,zIndex:60};function Ct({brand:e,logo:t,brandHref:n,brandTarget:r,links:i=[],style:a,nodeRef:o,menu:s=`auto`,breakpoint:c=768}){let[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),[g,_]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!u)return;let e=new ResizeObserver(()=>p(u.offsetWidth<c));return e.observe(u),()=>e.disconnect()},[u,c]);let v=s===`hamburger`||s===`auto`&&f,y=(e,t)=>(0,M.jsxs)(`a`,{href:e.href||`#`,style:{...xt,display:`block`,...t},children:[e.label,e.desc&&(0,M.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]},e.key);return(0,M.jsxs)(`nav`,{ref:e=>{d(e),o&&o(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...S(a)},children:[(t||e)&&(()=>{let i=(0,M.jsxs)(M.Fragment,{children:[t&&(0,M.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,M.jsx)(`span`,{style:{fontWeight:700,fontSize:18,fontFamily:`var(--page-heading-font, inherit)`},children:e})]}),a={display:`flex`,alignItems:`center`,gap:10,color:`inherit`,textDecoration:`none`};return n?(0,M.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:a,children:i}):(0,M.jsx)(`div`,{style:a,children:i})})(),(0,M.jsx)(`div`,{style:{flexGrow:1}}),v?(0,M.jsx)(`button`,{type:`button`,"aria-label":m?`Close menu`:`Open menu`,onClick:()=>h(!m),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:m?`✕`:`☰`}):(0,M.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:i.map(e=>{let t=e.children??[];if(!t.length)return(0,M.jsx)(`a`,{href:e.href||`#`,style:xt,children:e.label},e.key);let n=e.type===`mega`;return(0,M.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>_(e.key),onMouseLeave:()=>_(null),children:[(0,M.jsxs)(`a`,{href:e.href||`#`,style:{...xt,cursor:`pointer`},children:[e.label,` `,(0,M.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),g===e.key&&(n?(0,M.jsx)(`div`,{style:{...St,position:`absolute`,left:0,right:0,top:`100%`,padding:24,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(170px, 1fr))`,gap:16},children:t.map(e=>y(e,{padding:`6px 8px`,borderRadius:6}))}):(0,M.jsx)(`div`,{style:{...St,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>y(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),v&&m&&(0,M.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:i.map(e=>(0,M.jsxs)(l.Fragment,{children:[(0,M.jsx)(`a`,{href:e.href||`#`,style:{...xt,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>y(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function wt({tabs:e=[],linked:t,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(0),o=e.length?Math.min(i,e.length-1):0;return e.length?(0,M.jsxs)(`div`,{ref:r,style:{width:`100%`,...S(n)},children:[(0,M.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>a(t),style:{background:`transparent`,border:0,padding:`10px 16px`,fontSize:14,fontFamily:`inherit`,color:`inherit`,cursor:`pointer`,opacity:t===o?1:.6,fontWeight:t===o?600:500,boxShadow:t===o?`inset 0 -2px 0 var(--page-accent, #111827)`:`none`},children:e.label||`Tab ${t+1}`},e.key))}),e.map((e,n)=>(0,M.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function Tt({items:e=[],linked:t,multiple:n=!1,style:r,nodeRef:i}){let[a,o]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let s=e=>o(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,M.jsx)(`div`,{ref:i,style:{width:`100%`,...S(r)},children:e.map((n,r)=>{let i=a.has(n.key);return(0,M.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid rgba(148, 163, 184, 0.35)`:`none`},children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>s(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:`transparent`,border:0,padding:`14px 4px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:`inherit`,textAlign:`left`,cursor:`pointer`},children:[n.title||`Item ${r+1}`,(0,M.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:i?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,M.jsx)(`div`,{style:{display:i?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var Et={display:`flex`,flexDirection:`column`,gap:`12px`},Dt={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},Ot={padding:`10px 12px`,border:`1px solid var(--page-border, #d1d5db)`,borderRadius:`6px`,fontSize:`14px`,fontFamily:`inherit`,width:`100%`,boxSizing:`border-box`,backgroundColor:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`},kt={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},At=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function jt(e,t){if(!e)return!0;let n=t[e.field],r=n==null||n===``?``:String(n),i=e.value??``;switch(e.op){case`eq`:return r===i;case`neq`:return r!==i;case`contains`:return r.toLowerCase().includes(i.toLowerCase());case`gt`:return Number(r)>Number(i);case`lt`:return Number(r)<Number(i);case`empty`:return r===``;case`notEmpty`:return r!==``;default:return!1}}var Mt={display:`flex`,flexDirection:`column`,gap:6},Nt={font:`inherit`,fontSize:15,padding:`10px 12px`,borderRadius:8,border:`1px solid rgba(148, 163, 184, 0.55)`,background:`transparent`,color:`inherit`,width:`100%`,boxSizing:`border-box`};function Pt(e,t){let n=Array.isArray(e?.options)?e.options:[];if(!e?.parentField)return n;let r=t?.[e.parentField];return r?n.filter(e=>typeof e==`string`?!1:!e.parent||e.parent===r):[]}function Ft({field:e,value:t,onChange:n,inert:r,values:i}){let a=(0,M.jsxs)(`span`,{style:{...Dt,fontSize:14},children:[e.label,e.required?` *`:``]}),o={name:e.name,required:e.required||void 0,placeholder:e.placeholder||void 0,disabled:r||void 0,style:Nt,value:t??``,onChange:t=>n(e.name,t.target.value)};return e.type===`display`?(0,M.jsx)(e.variant&&e.variant!==`p`?e.variant:`p`,{style:{margin:0,color:e.color||`inherit`,fontSize:{h1:32,h2:26,h3:21,h4:18,h5:16,h6:14,p:15}[e.variant]??16,fontWeight:e.variant===`p`?400:700,lineHeight:1.35},children:e.label}):e.type===`image`?e.src?(0,M.jsx)(`img`,{src:e.src,alt:e.label??``,style:{width:`100%`,borderRadius:8,display:`block`}}):null:e.type===`video`?e.src?/youtube\.com|youtu\.be|vimeo\.com/i.test(e.src)?(0,M.jsx)(ct,{url:e.src,style:{width:`100%`}}):(0,M.jsx)(`video`,{src:e.src,controls:!0,style:{width:`100%`,borderRadius:8,display:`block`}}):null:(0,M.jsxs)(`label`,{style:Mt,children:[a,e.type===`textarea`||e.multiline?(0,M.jsx)(`textarea`,{...o,rows:4,style:{...Nt,resize:`vertical`}}):e.type===`select`?(0,M.jsxs)(`select`,{...o,disabled:o.disabled||!!e.parentField&&!i?.[e.parentField],children:[(0,M.jsx)(`option`,{value:``,children:e.placeholder||`—`}),Pt(e,i).map((e,t)=>(0,M.jsx)(`option`,{value:typeof e==`string`?e:e.value,children:typeof e==`string`?e:e.label??e.value},t))]}):e.type===`checkbox`?(0,M.jsx)(`input`,{type:`checkbox`,name:e.name,required:e.required||void 0,disabled:r||void 0,checked:!!t,onChange:t=>n(e.name,t.target.checked),style:{width:18,height:18}}):e.type===`upload`?(0,M.jsx)(`input`,{type:`file`,name:e.name,accept:e.accept||void 0,required:e.required||void 0,disabled:r||void 0,onChange:t=>n(e.name,t.target.files?.[0]?.name??``),style:{font:`inherit`,fontSize:14}}):(0,M.jsx)(`input`,{...o,type:{email:`email`,number:`number`,date:`date`,datetime:`datetime-local`,phone:`tel`,link:`url`}[e.type]??`text`}),e.help&&(0,M.jsx)(`span`,{style:{fontSize:12,opacity:.65},children:e.help})]})}function It({style:e,action:t,method:n,name:r,enctype:i,formSlug:a,auto:o,submitLabel:s,nodeRef:c,inert:u,children:d,linked:f,show:p}){let{tenant:m,apiUrl:h}=(0,l.useContext)(Se),[g,_]=(0,l.useState)(`form`),[v,y]=(0,l.useState)(null),[b,x]=(0,l.useState)({}),[C,w]=(0,l.useState)(0),T=u?p||`form`:g;(0,l.useEffect)(()=>{if(!o||!a)return;let e=!0;return fetch(`${h||`/api`}/forms/${encodeURIComponent(a)}`,{headers:m?{"x-tenant":m}:{}}).then(e=>e.json()).then(t=>e&&y(t?.payload&&typeof t.payload==`object`?t.payload:null)).catch(()=>e&&y(null)),()=>{e=!1}},[o,a,m,h]);let E=[{section:null,fields:[]}];for(let e of Array.isArray(v?.fields)?v.fields:[])e.type===`section`?E.push({section:e,fields:[]}):E[E.length-1].fields.push(e);let ee=E.filter(e=>e.section||e.fields.length),D=ee.filter(e=>!e.section||jt(e.section.condition,b)).map(e=>({...e,fields:e.fields.filter(e=>jt(e.condition,b))})),te=ee.length>1,ne=Math.min(C,Math.max(0,D.length-1)),re=te?D[ne]?.fields??[]:D.flatMap(e=>e.fields),ie=re.filter(e=>{let t=b[e.name];return e.required&&(t==null||t===``||t===!1)}),ae=ne>=D.length-1,oe=(e,t)=>x(n=>{let r={...n,[e]:t};for(let t of Array.isArray(v?.fields)?v.fields:[])t?.parentField===e&&delete r[t.name];return r});return(0,M.jsxs)(`div`,{ref:c,style:S(e),children:[(0,M.jsx)(`form`,{action:t||void 0,method:n||`post`,name:r||void 0,encType:i||void 0,onSubmit:async e=>{if(e.preventDefault(),!u){if(a){let t={};if(o)for(let[e,n]of Object.entries(b))n!=null&&n!==``&&(t[e]=n);else for(let[n,r]of new FormData(e.currentTarget).entries())typeof r==`string`&&(t[n]=r===`on`||r);try{let e=await fetch(`${h||`/api`}/forms/${a}/submit`,{method:`post`,headers:{"content-type":`application/json`,...m?{"x-tenant":m}:{}},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);_(e.ok&&n?.success!==!1?`success`:`error`)}catch{_(`error`)}return}if(!t){_(`success`);return}try{let r=await fetch(t,{method:n||`post`,body:new FormData(e.currentTarget)});_(r.ok?`success`:`error`)}catch{_(`error`)}}},style:{...Et,display:T===`success`?`none`:`flex`},children:o&&a?(0,M.jsxs)(M.Fragment,{children:[te&&(0,M.jsx)(dn,{steps:D.map(e=>({label:e.section?.label??`Start`})),active:ne+1,style:{marginBottom:8}}),te&&D[ne]?.section?.help&&(0,M.jsx)(`p`,{style:{margin:0,fontSize:14,opacity:.7},children:D[ne].section.help}),re.map(e=>(0,M.jsx)(Ft,{field:e,value:b[e.name],values:b,onChange:oe,inert:u},e.name)),(0,M.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`,marginTop:4},children:[te&&ne>0&&(0,M.jsx)(`button`,{type:`button`,disabled:u||void 0,onClick:()=>w(ne-1),style:{...Fe,background:`transparent`,color:`inherit`,border:0,padding:`10px 16px`,cursor:`pointer`},children:`Back`}),te&&!ae?(0,M.jsx)(`button`,{type:`button`,disabled:u||ie.length>0,onClick:()=>w(ne+1),style:{...Fe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:ie.length?.5:1},children:`Next`}):(0,M.jsx)(`button`,{type:`submit`,disabled:u||void 0,style:{...Fe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`},children:s||`Submit`})]})]}):d}),(0,M.jsx)(`div`,{style:{display:T===`success`?`block`:`none`},children:f?.success??null}),(0,M.jsx)(`div`,{style:{display:T===`error`?`block`:`none`,marginTop:12},children:f?.error??null})]})}var Lt=null,Rt=null,zt=e=>{let t=typeof e==`string`&&e.trim()?e.trim():``;if(Lt&&Rt===t)return Lt;if(Lt&&typeof window<`u`){for(let e of[`grecaptcha`,`___grecaptcha_cfg`])try{delete window[e]}catch{window[e]=void 0}document.querySelectorAll(`script[src*="recaptcha"]`).forEach(e=>e.remove())}return Rt=t,Lt=new Promise(e=>{if(typeof window>`u`)return;if(window.grecaptcha?.render)return e(window.grecaptcha);window.__webimRecaptchaReady=()=>e(window.grecaptcha);let n=document.createElement(`script`);n.src=`https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t?`&hl=${encodeURIComponent(t)}`:``}`,n.async=!0,document.head.appendChild(n)}),Lt};function Bt({siteKey:e,theme:t,size:n,hl:r,style:i,nodeRef:a,inert:o,onChange:s}){let c=(0,l.useContext)(Se),u=c?.settings&&typeof c.settings==`object`?c.settings[`google.recaptchaKey`]:``,d=typeof e==`string`&&e.trim()||(typeof u==`string`?u.trim():``),f=(0,l.useRef)(null),p=(0,l.useRef)(s);if(p.current=s,(0,l.useEffect)(()=>{if(o||!d||!f.current)return;let e=!0,i=t=>{e&&typeof p.current==`function`&&p.current(t)};return zt(r).then(r=>{if(!(!e||!f.current||!r?.render)){f.current.innerHTML=``,i(``);try{r.render(f.current,{sitekey:d,theme:t===`dark`?`dark`:`light`,size:n===`compact`?`compact`:`normal`,callback:e=>i(typeof e==`string`?e:``),"expired-callback":()=>i(``),"error-callback":()=>i(``)})}catch{}}}),()=>{e=!1}},[o,d,t,n,r]),o){let e=t===`dark`;return(0,M.jsxs)(`div`,{ref:a,style:S(i),children:[(0,M.jsxs)(`div`,{style:{width:n===`compact`?164:302,boxSizing:`border-box`,padding:`12px 14px`,display:`flex`,alignItems:`center`,gap:12,borderRadius:4,border:`1px solid ${e?`#52565b`:`#d3d3d3`}`,background:e?`#222528`:`#f9f9f9`,color:e?`#f1f1f1`:`#282828`,fontSize:14,fontFamily:`Roboto, Arial, sans-serif`},children:[(0,M.jsx)(`span`,{style:{width:24,height:24,flexShrink:0,borderRadius:3,border:`2px solid ${e?`#8a8f94`:`#c1c1c1`}`,background:e?`#2f3337`:`#fff`}}),(0,M.jsx)(`span`,{style:{flexGrow:1},children:`I'm not a robot`}),(0,M.jsx)(`span`,{style:{fontSize:9,opacity:.6,textAlign:`center`,lineHeight:1.3},children:`reCAPTCHA`})]}),!d&&(0,M.jsx)(`div`,{style:{marginTop:6,fontSize:11,color:`#b45309`},children:`Set the google.recaptchaKey tenant setting (or a site key in Settings) to activate it.`})]})}return d?(0,M.jsx)(`div`,{ref:a,style:S(i),children:(0,M.jsx)(`div`,{ref:f})}):null}function Vt({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,M.jsx)(`label`,{ref:r,style:{...Dt,...S(n)},children:Ke(t,e,i)})}function Ht({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...Ot,...S(i)},...At(o)})}function Ut({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...Ot,resize:`vertical`,...S(i)},...At(o)})}function Wt({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,M.jsxs)(`label`,{ref:o,style:{...kt,...S(a)},children:[(0,M.jsx)(`input`,{type:e,name:n||void 0,value:r||void 0,required:!s&&!!i,onClick:s?e=>e.preventDefault():void 0,tabIndex:s?-1:void 0,style:{margin:0,accentColor:`var(--page-accent, #111827)`}}),t]})}function Gt({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsxs)(`select`,{ref:a,name:e||void 0,required:!o&&!!r,defaultValue:``,onMouseDown:o?e=>e.preventDefault():void 0,tabIndex:o?-1:void 0,style:{...Ot,appearance:`auto`,...S(i)},children:[t!==``&&(0,M.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,M.jsx)(`option`,{value:e,children:e},t))]})}function Kt({name:e,accept:t,required:n,text:r=`Choose a file…`,style:i,nodeRef:a,inert:o}){let[s,c]=(0,l.useState)(null);return(0,M.jsxs)(`label`,{ref:a,style:{...Ot,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...S(i)},children:[(0,M.jsx)(`input`,{type:`file`,name:e||void 0,accept:t||void 0,required:!o&&!!n,disabled:!!o,onChange:e=>c(e.target.files?.[0]?.name??null),style:{display:`none`}}),(0,M.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function qt({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,M.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...Fe,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...S(t)},children:e})}function Jt({cols:e=2,rows:t=1,style:n,nodeRef:r,linked:i}){let a=Math.max(1,(Number(e)||1)*(Number(t)||1));return(0,M.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...S(n)},children:Array.from({length:a},(e,t)=>(0,M.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function Yt({collection:e,limit:t=6,layout:n=`grid`,columns:r=3,imageField:i,titleField:a=`name`,textField:o,custom:s,templateId:c,paged:u,filters:d,style:f,nodeRef:p}){let{tenant:m,apiUrl:h,locale:g}=(0,l.useContext)(Se),_=(0,l.useContext)(De),v=(0,l.useContext)(Ce),[,y]=(0,l.useState)(0);(0,l.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>y(e=>e+1);return window.addEventListener(`popstate`,e),window.addEventListener(`webim:urlchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`webim:urlchange`,e)}},[]);let b=Ee(d),x=JSON.stringify(b),C=x!==`{}`&&!e?.startsWith?.(`api:`),w=C?null:v?.[e],T=u?we(v):1,[E,ee]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||w)return;let n=!0,r=new URLSearchParams;if(g&&r.set(`locale`,g),C&&r.set(`data_filter`,x),u&&!e.startsWith(`api:`)){let e=Math.max(1,Number(t)||6);r.set(`offset`,String((T-1)*e)),r.set(`limit`,String(e))}let i=r.toString(),a=e.startsWith(`api:`)?`${h}/data/${encodeURIComponent(e.slice(4))}`:`${h}/dynamic/${encodeURIComponent(e)}${i?`?${i}`:``}`;return fetch(a,{headers:m?{"x-tenant":m}:{}}).then(e=>e.json()).then(e=>{let t=Array.isArray(e?.payload)?e.payload:Array.isArray(e?.payload?.data)?e.payload.data:[];return n&&ee(t.filter(e=>e&&typeof e==`object`))}).catch(()=>n&&ee([])),()=>{n=!1}},[e,m,h,g,w,u,T,t,C,x]),!e)return null;let D=Math.max(1,Number(t)||6),te=u?w||e.startsWith(`api:`)?(w??E??[]).slice((T-1)*D,T*D):(E??[]).slice(0,D):(w??E??[]).slice(0,D),ne=Math.min(Math.max(Number(r)||3,1),6),re=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${ne}, minmax(0, 1fr))`,gap:24};return s&&c&&_?.render?(0,M.jsx)(`div`,{ref:p,style:{width:`100%`,...re,...S(f)},children:te.map(e=>(0,M.jsx)(`div`,{style:{minWidth:0},children:_.render(c,t=>Me(t,e))},e.id??e?.data?.slug))}):(0,M.jsx)(`div`,{ref:p,style:{width:`100%`,...re,...S(f)},children:te.map(e=>{let t=i?ke(e?.data,i):null,r=a?je(ke(e?.data,a)):null,s=o?ke(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:je(s),u=n===`list`;return(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,M.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,M.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,M.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,M.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:Xe(c)})]})]},e.id??e?.data?.slug)})})}function Xt({fields:e=[],buttonLabel:t=`Search`,style:n,nodeRef:r,inert:i}){let a=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&typeof e.name==`string`&&e.name):[],o=i?{}:Te(),s={height:34,padding:`0 12px`,borderRadius:8,border:`1px solid var(--page-border, rgba(100, 116, 139, 0.4))`,background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,fontSize:13,fontFamily:`inherit`,outline:`none`,minWidth:140,flex:`0 1 auto`,boxSizing:`border-box`},c=e=>{let t=e&&typeof e==`object`?e.value:e,n=e&&typeof e==`object`?e.label??e.value:e;return{value:String(t??``),label:String(n??``)}};return(0,M.jsxs)(`form`,{ref:r,method:`get`,onSubmit:e=>{if(i){e.preventDefault();return}if(typeof window>`u`||!window.history?.pushState)return;e.preventDefault();let t=new URLSearchParams(window.location.search);for(let e of[...t.keys()])(e.startsWith(`f_`)||e===`page`)&&t.delete(e);for(let[n,r]of new FormData(e.currentTarget).entries())n.startsWith(`f_`)&&typeof r==`string`&&r.trim()!==``&&t.set(n,r);let n=t.toString();window.history.pushState({},``,`${window.location.pathname}${n?`?${n}`:``}`),window.dispatchEvent(new Event(`webim:urlchange`))},style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,width:`100%`,...S(n)},children:[a.map(e=>Array.isArray(e.options)&&e.options.length>0||e.type===`option`||e.type===`select`?(0,M.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...At(i),children:[(0,M.jsx)(`option`,{value:``,children:e.label||e.name}),(Array.isArray(e.options)?e.options:[]).map(e=>{let t=c(e);return(0,M.jsx)(`option`,{value:t.value,children:t.label},t.value)})]},e.name):e.type===`switch`?(0,M.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...At(i),children:[(0,M.jsx)(`option`,{value:``,children:e.label||e.name}),(0,M.jsx)(`option`,{value:`true`,children:`Yes`}),(0,M.jsx)(`option`,{value:`false`,children:`No`})]},e.name):(0,M.jsx)(`input`,{type:`text`,name:`f_${e.name}`,defaultValue:o[e.name]??``,placeholder:e.label||e.name,style:s,...At(i)},e.name)),(0,M.jsx)(`button`,{type:`submit`,style:{...s,minWidth:0,padding:`0 18px`,border:`none`,background:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`,fontWeight:600,cursor:i?`default`:`pointer`},...At(i),children:t})]})}function Zt({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,M.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...S(n)},children:(0,M.jsx)(`ol`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,listStyle:`none`,margin:0,padding:0,fontSize:14},children:e.map((n,r)=>{let i=r===e.length-1;return(0,M.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,M.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,M.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,M.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function Qt({pages:e=5,current:t=1,prevNext:n=!0,href:r=`#`,source:i,pageSize:a=6,align:o,hideEmpty:s,inert:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(Se),m=(0,l.useContext)(Ce),[h,g]=(0,l.useState)(null),_=i?Number(m?.[`${i}:total`]):NaN;(0,l.useEffect)(()=>{if(!i||Number.isFinite(_))return;let e=!0,t=i.startsWith(`api:`)?`${p}/data/${encodeURIComponent(i.slice(4))}`:`${p}/dynamic/${encodeURIComponent(i)}?limit=1`;return fetch(t,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(t=>{if(!e)return;let n=t?.payload,r=Array.isArray(n)?n.length:Number(n?.total?.filtered??n?.total?.all??(Array.isArray(n?.data)?n.data.length:0));g(Number.isFinite(r)?r:0)}).catch(()=>e&&g(0)),()=>{e=!1}},[i,f,p,_]);let v=Math.max(1,Number(a)||6),y=Number.isFinite(_)?_:h;if(i&&y===null||i&&s&&!(y>0))return null;let b=Math.min(Math.max(i?Math.ceil(y/v):Number(e)||1,1),50),x=Math.min(Math.max(i?we(m):Number(t)||1,1),b),C=e=>{if(i){if(typeof window<`u`){let t=new URLSearchParams(window.location.search);return t.set(`page`,String(e)),`?${t.toString()}`}return`?page=${e}`}return r&&r!==`#`?r.replace(`{page}`,String(e)):`#`},w=o===`center`?`center`:o===`right`?`flex-end`:`flex-start`,T=c?e=>e.preventDefault():void 0,E=e=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:36,height:36,padding:`0 8px`,borderRadius:8,fontSize:14,textDecoration:`none`,color:e?`var(--page-accent-text, #ffffff)`:`inherit`,background:e?`var(--page-accent, #111827)`:`transparent`,border:e?`1px solid transparent`:`1px solid rgba(148, 163, 184, 0.4)`});return(0,M.jsxs)(`nav`,{ref:d,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,justifyContent:w,...S(u)},children:[n&&(0,M.jsx)(`a`,{href:x>1?C(x-1):`#`,onClick:T,"aria-label":`Previous`,style:{...E(!1),opacity:x>1?1:.4},children:`‹`}),Array.from({length:b},(e,t)=>t+1).map(e=>(0,M.jsx)(`a`,{href:C(e),onClick:T,"aria-current":e===x?`page`:void 0,style:E(e===x),children:e},e)),n&&(0,M.jsx)(`a`,{href:x<b?C(x+1):`#`,onClick:T,"aria-label":`Next`,style:{...E(!1),opacity:x<b?1:.4},children:`›`})]})}var $t=`webim.page_mode`,en=()=>{if(typeof window>`u`)return`auto`;try{let e=window.localStorage.getItem($t);return e===`light`||e===`dark`?e:`auto`}catch{return`auto`}},tn=e=>{let t={width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`light`?(0,M.jsxs)(`svg`,{...t,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,M.jsx)(`path`,{d:`M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4`})]}):e===`dark`?(0,M.jsx)(`svg`,{...t,children:(0,M.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})}):(0,M.jsxs)(`svg`,{...t,children:[(0,M.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`}),(0,M.jsx)(`path`,{d:`M8 21h8M12 17v4`})]})},nn={light:`Light theme`,dark:`Dark theme`,auto:`Follow the device theme`};function rn({variant:e,showSystem:t,style:n,nodeRef:r,inert:i}){let[a,o]=(0,l.useState)(i?`auto`:en),s=(0,l.useRef)(null),c=e=>{s.current=e,typeof r==`function`&&r(e)};(0,l.useEffect)(()=>{if(i)return;let e=s.current?.closest?.(`.webim-page`);e&&(a===`light`||a===`dark`?e.setAttribute(`data-webim-mode`,a):e.removeAttribute(`data-webim-mode`));try{a===`auto`?window.localStorage.removeItem($t):window.localStorage.setItem($t,a)}catch{}},[a,i]);let u=t===!1?[`light`,`dark`]:[`light`,`dark`,`auto`],d=u.includes(a)?a:u[0],f={appearance:`none`,border:0,margin:0,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`transparent`,color:`inherit`,font:`inherit`,cursor:i?`default`:`pointer`,borderRadius:999};if(e===`buttons`)return(0,M.jsx)(`div`,{ref:c,role:`group`,"aria-label":`Theme`,style:{display:`inline-flex`,alignItems:`center`,gap:2,padding:3,borderRadius:999,border:`1px solid rgba(148, 163, 184, 0.4)`,...S(n)},children:u.map(e=>(0,M.jsx)(`button`,{type:`button`,title:nn[e],"aria-label":nn[e],"aria-pressed":e===d,onClick:i?void 0:()=>o(e),style:{...f,width:28,height:28,color:e===d?`var(--page-accent-text, #ffffff)`:`inherit`,background:e===d?`var(--page-accent, #111827)`:`transparent`,opacity:e===d?1:.7},children:tn(e)},e))});let p=u[(u.indexOf(d)+1)%u.length];return(0,M.jsx)(`button`,{ref:c,type:`button`,title:nn[d],"aria-label":`Theme: ${nn[d]} — switch to ${nn[p]}`,onClick:i?void 0:()=>o(p),style:{...f,width:36,height:36,border:`1px solid rgba(148, 163, 184, 0.4)`,...S(n)},children:tn(d)})}function an(e){let t=e?.parentElement;for(;t&&t!==document.body;){let e=getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return window}var on=e=>e===window?window.scrollY:e.scrollTop,sn={"bottom-right":e=>({right:e,bottom:e}),"bottom-left":e=>({left:e,bottom:e}),"bottom-center":e=>({left:`50%`,bottom:e,transform:`translateX(-50%)`})};function cn({variant:e,label:t,position:n,offset:r,showAfter:i,smooth:a,bg:o,fg:s,style:c,nodeRef:u,inert:d,frame:f}){let[p,m]=(0,l.useState)(!!d),[h,g]=(0,l.useState)(null),_=e=>{g(e),typeof u==`function`&&u(e)};(0,l.useEffect)(()=>{if(d||!h)return;let e=an(h),t=Number(i)>=0?Number(i):300,n=()=>m(on(e)>t);return n(),e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[d,h,i]);let v=()=>{if(d)return;let e=an(h),t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,n=a===!1||t?`auto`:`smooth`;e===window?window.scrollTo({top:0,behavior:n}):e.scrollTo({top:0,behavior:n})},y=Number(r)>=0?Number(r):24,b=e===`pill`,x=t||`Top`,C=sn[n]?n:`bottom-right`,w=f?{position:`fixed`,zIndex:5,bottom:(f.bottom??0)+y,...C===`bottom-left`?{left:(f.left??0)+y}:null,...C===`bottom-right`?{right:(f.right??0)+y}:null,...C===`bottom-center`?{left:(f.left??0)+(f.width??0)/2,transform:`translateX(-50%)`}:null}:{position:`fixed`,zIndex:2147482e3,...sn[C](y)};return(0,M.jsxs)(`button`,{ref:_,type:`button`,title:x,"aria-label":x,"aria-hidden":!p,tabIndex:p?0:-1,onClick:v,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:b?8:0,appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,width:b?`auto`:44,height:44,padding:b?`0 18px`:0,borderRadius:999,border:`1px solid transparent`,background:o||`var(--page-accent, #111827)`,color:s||`var(--page-accent-text, #ffffff)`,boxShadow:`0 6px 20px rgba(15, 23, 42, 0.25)`,cursor:d?`default`:`pointer`,opacity:+!!p,pointerEvents:p?`auto`:`none`,transition:`opacity 160ms ease, transform 160ms ease`,...w,...S(c),...w.transform?{transform:w.transform}:null},children:[(0,M.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,M.jsx)(`path`,{d:`M12 19V5M12 5l-7 7M12 5l7 7`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),b?(0,M.jsx)(`span`,{children:x}):null]})}var ln={facebook:{label:`Facebook`,color:`#1877f2`,d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`},instagram:{label:`Instagram`,color:`#e4405f`,d:`M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06zm0 5.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z`},x:{label:`X (Twitter)`,color:`#000000`,d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`},linkedin:{label:`LinkedIn`,color:`#0a66c2`,d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`},youtube:{label:`YouTube`,color:`#ff0000`,d:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`},tiktok:{label:`TikTok`,color:`#000000`,d:`M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z`},whatsapp:{label:`WhatsApp`,color:`#25d366`,d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z`},telegram:{label:`Telegram`,color:`#26a5e4`,d:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`},pinterest:{label:`Pinterest`,color:`#bd081c`,d:`M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.03-.655 2.569-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z`},github:{label:`GitHub`,color:`#181717`,d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`},discord:{label:`Discord`,color:`#5865f2`,d:`M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.058a.082.082 0 00.031.056 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.873-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.009c.12.099.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z`},email:{label:`E-mail`,color:`#64748b`,d:`M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z`},website:{label:`Website`,color:`#64748b`,d:`M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z`}};function un({links:e=[],variant:t,color:n,size:r,gap:i,newTab:a,style:o,nodeRef:s,inert:c}){let l=Array.isArray(e)?e.filter(e=>e&&ln[e.network]):[];if(!l.length)return null;let u=Math.min(Math.max(Number(r)||18,10),64),d=Math.round(u*1.9),f=Number.isFinite(Number(i))?Number(i):10,p=e=>n===`accent`?`var(--page-accent, #111827)`:n===`inherit`?`currentColor`:e.color,m=c?e=>e.preventDefault():void 0;return(0,M.jsx)(`div`,{ref:s,style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:f,...S(o)},children:l.map((e,r)=>{let i=ln[e.network],o=t!==`outline`&&t!==`plain`,s=o?n===`accent`?`var(--page-accent-text, #ffffff)`:n===`inherit`?`var(--page-bg, #ffffff)`:`#ffffff`:p(i);return(0,M.jsx)(`a`,{href:e.url||`#`,onClick:m,"aria-label":e.label||i.label,title:e.label||i.label,...a!==!1&&!c?{target:`_blank`,rel:`noopener noreferrer`}:{},style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:t===`plain`?u:d,height:t===`plain`?u:d,borderRadius:`50%`,background:o?p(i):`transparent`,border:t===`outline`?`1px solid ${p(i)}`:`none`,color:`inherit`,textDecoration:`none`},children:(0,M.jsx)(`svg`,{width:u,height:u,viewBox:`0 0 24 24`,fill:s,"aria-hidden":!0,children:(0,M.jsx)(`path`,{d:i.d})})},`${e.network}-${r}`)})})}function dn({steps:e=[],active:t=1,vertical:n=!1,style:r,nodeRef:i}){if(!e.length)return null;let a=Math.min(Math.max(Number(t)||1,1),e.length),o=e=>({width:32,height:32,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:14,fontWeight:600,flexShrink:0,color:e===`todo`?`inherit`:`var(--page-accent-text, #ffffff)`,background:e===`todo`?`transparent`:`var(--page-accent, #111827)`,border:e===`todo`?`1px solid rgba(148, 163, 184, 0.5)`:`1px solid transparent`,opacity:e===`todo`?.6:1,boxShadow:e===`active`?`0 0 0 4px rgba(99, 102, 241, 0.2)`:`none`}),s=e=>({flexGrow:1,alignSelf:`center`,background:e?`var(--page-accent, #111827)`:`rgba(148, 163, 184, 0.4)`,...n?{width:2,minHeight:24,marginLeft:15,alignSelf:`auto`}:{height:2,minWidth:24}});return(0,M.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...S(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,M.jsxs)(l.Fragment,{children:[t>0&&(0,M.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,M.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[(0,M.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,M.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}var fn={small:{w:132,h:46,name:11.5,title:10,avatar:28},medium:{w:168,h:56,name:13,title:11,avatar:36},large:{w:210,h:70,name:15.5,title:12.5,avatar:46}},pn=e=>fn[e]??fn.medium;fn.medium.w,fn.medium.h;function mn(e,{size:t=`medium`,horizontal:n=!1}={}){let r=pn(t),i=n?r.h:r.w,a=n?16:20,o=(n?r.w:r.h)+(n?56:48),s=Array.isArray(e)?e.filter(e=>e&&e.id):[],c=new Set(s.map(e=>e.id)),l=new Map,u=[];for(let e of s)e.parent&&c.has(e.parent)&&e.parent!==e.id?(l.has(e.parent)||l.set(e.parent,[]),l.get(e.parent).push(e)):u.push(e);let d=new Map,f=(e,t)=>{if(t.has(e.id))return 0;t.add(e.id);let n=(l.get(e.id)??[]).reduce((e,n,r)=>e+f(n,t)+(r?a:0),0),r=Math.max(i,n);return d.set(e.id,r),r};u.forEach(e=>f(e,new Set));let p=[],m=[],h=0,g=(e,t,s,c)=>{if(c.has(e.id))return;c.add(e.id);let u=t+((d.get(e.id)??i)-i)/2,f=s*o,_=n?f:u,v=n?u:f;p.push({node:e,x:_,y:v}),h=Math.max(h,f+(n?r.w:r.h));let y=t;for(let t of l.get(e.id)??[]){let e=y+((d.get(t.id)??i)-i)/2+i/2,l=(s+1)*o;m.push(n?{from:{x:f+r.w,y:u+r.h/2},to:{x:l,y:e}}:{from:{x:u+r.w/2,y:f+r.h},to:{x:e,y:l}}),g(t,y,s+1,c),y+=(d.get(t.id)??i)+a}},_=0,v=new Set;for(let e of u)g(e,_,0,v),_+=(d.get(e.id)??i)+a;let y=Math.max(_-a,i);return{boxes:p,links:m,width:n?Math.max(h,r.w):y,height:n?y:Math.max(h,r.h),horizontal:n}}var hn=(e,t)=>{let n=String(e??``);return n.length>t?`${n.slice(0,t-1)}…`:n},gn=e=>{let t=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e??``).trim());if(!t)return`#ffffff`;let n=t[1];n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=parseInt(n,16);return .299*(r>>16&255)+.587*(r>>8&255)+.114*(r&255)>150?`#111827`:`#ffffff`},_n=e=>!!(e?.cv?.trim?.()||e?.photo);function vn(e,t={}){let n=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.id):[],r=e=>Array.isArray(e)?e[0]:e,i=e=>e==null?``:je(e);return n.map(e=>{let n=e.data??{},a=r(n[t.parentField]),o=a&&typeof a==`object`?a.id??null:a||null;return{id:e.id,name:i(n[t.nameField||`name`])||i(n.name)||`Untitled`,title:t.titleField?i(n[t.titleField]):``,photo:t.photoField&&r(n[t.photoField])||``,parent:t.parentField?o:null,cv:t.cvField?i(n[t.cvField]):``,href:t.hrefField?i(n[t.hrefField]):``}})}var yn={size:36,pad:10};function bn({node:e,onClose:t}){return(0,l.useEffect)(()=>{let e=e=>e.key===`Escape`&&t();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),(0,M.jsx)(`div`,{onClick:t,role:`dialog`,"aria-modal":`true`,"aria-label":e.name,style:{position:`fixed`,inset:0,zIndex:1e3,background:`rgba(2, 6, 23, 0.6)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16},children:(0,M.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:{background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.35)`,borderRadius:14,maxWidth:420,width:`100%`,maxHeight:`80vh`,overflowY:`auto`,padding:24,position:`relative`,boxShadow:`0 24px 64px rgba(2, 6, 23, 0.5)`},children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:t,style:{position:`absolute`,top:10,right:10,width:30,height:30,border:0,borderRadius:8,background:`transparent`,color:`inherit`,fontSize:18,lineHeight:1,cursor:`pointer`,opacity:.6},children:`×`}),(0,M.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:e.cv?14:0},children:[e.photo&&(0,M.jsx)(`img`,{src:e.photo,alt:``,style:{width:72,height:72,borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[(0,M.jsx)(`div`,{style:{fontSize:18,fontWeight:700},children:e.name}),e.title&&(0,M.jsx)(`div`,{style:{fontSize:13,opacity:.65},children:e.title})]})]}),e.cv&&String(e.cv).split(/\n+/).map((e,t)=>(0,M.jsx)(`p`,{style:{fontSize:14,lineHeight:1.6,margin:`0 0 10px`},children:e},t)),e.href&&(0,M.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,style:{display:`inline-block`,marginTop:6,padding:`8px 14px`,borderRadius:8,fontSize:13,fontWeight:600,textDecoration:`none`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:`Open profile ↗`})]})})}function xn({nodes:e=[],source:t,nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,size:c=`medium`,horizontal:u=!1,style:d,nodeRef:f,interactive:p=!0}){let m=(0,l.useId)(),[h,g]=(0,l.useState)(null),{tenant:_,apiUrl:v}=(0,l.useContext)(Se),y=(0,l.useContext)(Ce)?.[t],[b,x]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!t||y)return;let e=!0;return fetch(`${v}/dynamic/${encodeURIComponent(t)}`,{headers:_?{"x-tenant":_}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&x(n)}).catch(()=>e&&x([])),()=>{e=!1}},[t,_,v,y]);let C=t?vn(y??b??[],{nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s}):e,w=pn(c),{boxes:T,links:E,width:ee,height:D}=mn(C,{size:c,horizontal:u});if(!T.length)return!p&&t?(0,M.jsxs)(`div`,{ref:f,style:{padding:18,border:`1px dashed rgba(148, 163, 184, 0.6)`,borderRadius:10,fontSize:13,opacity:.7,textAlign:`center`,...S(d)},children:[`Org Chart — no published entries in “`,t,`” yet`]}):null;let te=new Set(T.filter(e=>e.node.parent==null||e.node.parent===``).map(e=>e.node.id));return(0,M.jsxs)(`div`,{ref:f,style:{maxWidth:`100%`,overflowX:`auto`,...S(d)},children:[(0,M.jsxs)(`svg`,{viewBox:`0 0 ${ee} ${D}`,role:`img`,"aria-label":`Organization chart`,style:{display:`block`,width:`100%`,maxWidth:ee,height:`auto`,margin:`0 auto`},children:[E.map((e,t)=>(0,M.jsx)(`path`,{d:u?`M ${e.from.x} ${e.from.y} H ${(e.from.x+e.to.x)/2} V ${e.to.y} H ${e.to.x}`:`M ${e.from.x} ${e.from.y} V ${(e.from.y+e.to.y)/2} H ${e.to.x} V ${e.to.y}`,fill:`none`,stroke:`rgba(148, 163, 184, 0.7)`,strokeWidth:`1.5`},t)),T.map(({node:e,x:t,y:n})=>{let r=te.has(e.id),i=!!e.color2,a=!!e.color||r||i,o=e.color||(r?`var(--page-accent, #4f46e5)`:`var(--page-bg, #ffffff)`),s=e.color?gn(e.color):r?`var(--page-accent-text, #ffffff)`:`var(--page-text, #111827)`,c=i?gn(e.color2):s,l=p&&(_n(e)||e.href),u=()=>_n(e)?g(e):window.open(e.href,`_blank`,`noreferrer`),d=e.photo?t+yn.pad+w.avatar+8:t+w.w/2,f=e.photo?`start`:`middle`,h=e.photo?Math.floor((w.w-w.avatar-26)/7):Math.floor(w.w/7.6),_=w.h/2,v=[e.name,e.title].map(e=>String(e??``).trim()).filter(Boolean);return(0,M.jsxs)(`g`,{onClick:l?u:void 0,style:l?{cursor:`pointer`}:void 0,role:l?`button`:void 0,"aria-label":l?`Open ${e.name||e.title}'s profile`:void 0,children:[i&&e.gradient?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`linearGradient`,{id:`${m}-${e.id}-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,M.jsx)(`stop`,{offset:`0%`,stopColor:e.color||`var(--page-accent, #4f46e5)`}),(0,M.jsx)(`stop`,{offset:`100%`,stopColor:e.color2})]}),(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`,fill:`url(#${m}-${e.id}-grad)`})]}):i?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`clipPath`,{id:`${m}-${e.id}-box`,children:(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`})}),(0,M.jsxs)(`g`,{clipPath:`url(#${m}-${e.id}-box)`,children:[(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:_,fill:o}),(0,M.jsx)(`rect`,{x:t,y:n+_,width:w.w,height:w.h-_,fill:e.color2})]})]}):(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`,fill:o,stroke:a?`none`:`var(--page-accent, #4f46e5)`,strokeWidth:a?0:1.5}),e.photo&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`clipPath`,{id:`${m}-${e.id}`,children:(0,M.jsx)(`circle`,{cx:t+yn.pad+w.avatar/2,cy:n+w.h/2,r:w.avatar/2})}),(0,M.jsx)(`image`,{href:e.photo,x:t+yn.pad,y:n+(w.h-w.avatar)/2,width:w.avatar,height:w.avatar,preserveAspectRatio:`xMidYMid slice`,clipPath:`url(#${m}-${e.id})`})]}),i&&!e.gradient?(0,M.jsxs)(M.Fragment,{children:[e.title&&(0,M.jsx)(`text`,{x:d,y:n+_/2+w.title*.35,textAnchor:f,fontSize:w.title,fontWeight:`600`,fill:s,children:hn(e.title,h+4)}),e.name&&(0,M.jsx)(`text`,{x:d,y:n+_+_/2+w.name*.35,textAnchor:f,fontSize:w.name,fontWeight:`600`,fill:c,children:hn(e.name,h)})]}):(0,M.jsxs)(M.Fragment,{children:[v[0]&&(0,M.jsx)(`text`,{x:d,y:n+(v[1]?w.h*.43:w.h*.57),textAnchor:f,fontSize:w.name,fontWeight:`600`,fill:s,children:hn(v[0],h)}),v[1]&&(0,M.jsx)(`text`,{x:d,y:n+w.h*.73,textAnchor:f,fontSize:w.title,opacity:`0.7`,fill:s,children:hn(v[1],h+4)})]})]},e.id)})]}),h&&(0,M.jsx)(bn,{node:h,onClose:()=>g(null)})]})}function Sn({columns:e=[],rows:t=[],source:n,limit:r=10,striped:i=!0,bordered:a=!1,compact:o=!1,paged:s,emptyText:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(Se),m=(0,l.useContext)(Ce),h=m?.[n],g=s?we(m):1,[_,v]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!n||h)return;let e=!0,t=Math.max(1,Number(r)||10),i=s&&!n.startsWith(`api:`)?`?offset=${(g-1)*t}&limit=${t}`:``,a=n.startsWith(`api:`)?`${p}/data/${encodeURIComponent(n.slice(4))}`:`${p}/dynamic/${encodeURIComponent(n)}${i}`;return fetch(a,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];return e&&v(n)}).catch(()=>e&&v([])),()=>{e=!1}},[n,f,p,h,s,g,r]),!e.length)return null;let y=Math.max(1,Number(r)||10),b=n?s?h||n.startsWith(`api:`)?(h??_??[]).slice((g-1)*y,g*y):(_??[]).slice(0,y):(h??_??[]).slice(0,y):null,x=b?b.map(t=>e.map(e=>je(ke(t?.data,e.field)))):t,C=!!n&&!(n&&!h&&_===null)&&x.length===0,w=o?`6px 10px`:`10px 14px`,T=`1px solid rgba(148, 163, 184, 0.35)`,E=a?{border:T}:{borderBottom:T};return(0,M.jsx)(`div`,{ref:d,style:{width:`100%`,overflowX:`auto`,...S(u)},children:(0,M.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:14,...a?{border:T}:{}},children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e.map((e,t)=>(0,M.jsx)(`th`,{style:{textAlign:`left`,fontWeight:600,padding:w,background:`rgba(148, 163, 184, 0.12)`,...E},children:e.label??e},t))})}),(0,M.jsxs)(`tbody`,{children:[C&&(0,M.jsx)(`tr`,{children:(0,M.jsx)(`td`,{colSpan:e.length,style:{padding:w,textAlign:`center`,opacity:.6,...E},children:c||`No data yet`})}),x.map((t,n)=>(0,M.jsx)(`tr`,{style:i&&n%2==1?{background:`rgba(148, 163, 184, 0.07)`}:void 0,children:e.map((e,n)=>(0,M.jsx)(`td`,{style:{padding:w,...E},children:t?.[n]??``},n))},n))]})]})})}var Cn={PageRoot:Be,Section:Ve,Container:He,Heading:Ue,TextBlock:tt,ButtonBlock:it,ImageBlock:at,Spacer:dt,Divider:ft,SliderBlock:vt,CanvasSlider:yt,TabsBlock:wt,QuickStack:Jt,CollectionList:Yt,CollectionSearch:Xt,BreadcrumbsBlock:Zt,PaginationBlock:Qt,StepperBlock:dn,SocialLinksBlock:un,ThemeModeBlock:rn,ScrollTopBlock:cn,OrgChartBlock:xn,TableBlock:Sn,MasonryBlock:bt,AccordionBlock:Tt,NavbarBlock:Ct,ListBlock:et,TextSpan:qe,QuoteBlock:$e,TextLink:rt,RichTextBlock:Ze,RichContentBlock:Ze,VideoBlock:ot,YouTubeBlock:ct,IframeBlock:lt,EmbedBlock:ut,FormBlock:It,FormLabel:Vt,FormInput:Ht,FormTextarea:Ut,FormCheckbox:e=>(0,M.jsx)(Wt,{kind:`checkbox`,...e}),FormRadio:e=>(0,M.jsx)(Wt,{kind:`radio`,...e}),FormSelect:Gt,FormFile:Kt,FormRecaptcha:Bt,FormSubmit:qt},wn={id:`auth`,label:`Accounts`,category:`Apps`,keys:[`SiteLoginForm`,`SiteAccountMenu`],ssr:`shell`,settings:[`site.authRedirect`]},Tn=(0,l.createContext)({user:null,status:`idle`,ensure:()=>{},refresh:()=>{},signOut:()=>{}}),En=()=>{let e=(0,l.useContext)(Tn);return(0,l.useEffect)(()=>{e.ensure()},[e]),e};function Dn({children:e,initialUser:t,disabled:n,apiUrl:r,tenant:i}){let a=(0,l.useContext)(Se),o=r||a?.apiUrl||`/api`,s=i||a?.tenant||``,[c,u]=(0,l.useState)(t??null),[d,f]=(0,l.useState)(t?`user`:n?`guest`:`idle`),p=(0,l.useRef)(!1),m=(0,l.useCallback)((e,t)=>fetch(`${o}${e}`,{...t,credentials:`include`,headers:{"content-type":`application/json`,...s?{"x-tenant":s}:{},...t?.headers}}),[o,s]),h=(0,l.useCallback)(()=>n?Promise.resolve(null):m(`/site/me`).then(e=>e.ok?e.json():null).then(e=>{let t=e?.payload??null;return u(t),f(t?`user`:`guest`),t}).catch(()=>(u(null),f(`guest`),null)),[m,n]),g=(0,l.useCallback)(()=>m(`/site/logout`,{method:`post`}).catch(()=>{}).then(()=>{u(null),f(`guest`)}),[m]),_=(0,l.useCallback)(()=>{p.current||n||t||(p.current=!0,f(`loading`),h())},[n,t,h]),v=(0,l.useMemo)(()=>({user:c,status:d,ensure:_,refresh:h,signOut:g}),[c,d,_,h,g]);return(0,M.jsx)(Tn.Provider,{value:v,children:e})}function On({when:e,children:t}){let{status:n}=En();return!e||e===`always`?t:n===`idle`||n===`loading`?null:e===`user`==(n===`user`)?t:null}function kn({mode:e=`login`,redirect:t,emailLabel:n=`Email`,passwordLabel:r=`Password`,nameLabel:i=`Name`,submitLabel:a,style:o,nodeRef:s,inert:c,linked:u,show:d}){let{tenant:f,apiUrl:p,settings:m}=(0,l.useContext)(Se),[h,g]=(0,l.useState)(`form`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(!1),x=e===`register`,C=c?d||`form`:h,w=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:``,T=async e=>{if(e.preventDefault(),c)return;let n=new FormData(e.currentTarget);b(!0),v(``);try{let e=await fetch(`${p||`/api`}/site/${x?`register`:`login`}`,{method:`post`,headers:{"content-type":`application/json`,...f?{"x-tenant":f}:{}},credentials:`same-origin`,body:JSON.stringify({email:n.get(`email`),password:n.get(`password`),...x?{name:n.get(`name`)||``}:{}})}),r=await e.json().catch(()=>null);if(!e.ok||r?.success===!1){v(r?.error?.message||`Sign-in failed`),g(`error`),b(!1);return}if(g(`success`),typeof window<`u`){let e=w(t)||w(new URLSearchParams(window.location.search).get(`next`))||w(m?.[`site.authRedirect`])||w(m?.[`apps.auth.redirect`])||`/`;window.location.assign(e)}}catch{v(`Sign-in failed`),g(`error`),b(!1)}};return(0,M.jsxs)(`div`,{ref:s,style:{display:`grid`,gap:12,maxWidth:360,...S(o)},children:[(0,M.jsxs)(`form`,{onSubmit:T,style:{display:C===`form`?`grid`:`none`,gap:10},children:[x?(0,M.jsxs)(`label`,{style:{...Dt,display:`grid`,gap:6},children:[i,(0,M.jsx)(`input`,{name:`name`,type:`text`,style:Ot,...At(c)})]}):null,(0,M.jsxs)(`label`,{style:{...Dt,display:`grid`,gap:6},children:[n,(0,M.jsx)(`input`,{name:`email`,type:`email`,required:!c,style:Ot,...At(c)})]}),(0,M.jsxs)(`label`,{style:{...Dt,display:`grid`,gap:6},children:[r,(0,M.jsx)(`input`,{name:`password`,type:`password`,required:!c,style:Ot,...At(c)})]}),(0,M.jsx)(`button`,{type:c?`button`:`submit`,disabled:y||void 0,style:{...Fe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:y?.6:1},children:a||(x?`Create account`:`Sign in`)}),_?(0,M.jsx)(`p`,{style:{margin:0,fontSize:14,color:`#dc2626`},children:_}):null]}),(0,M.jsx)(`div`,{style:{display:C===`success`?`block`:`none`},children:u?.success??null}),(0,M.jsx)(`div`,{style:{display:C===`error`?`block`:`none`},children:u?.error??null})]})}function An({greeting:e=`Hi`,signOutLabel:t=`Sign out`,showEmail:n=!1,style:r,nodeRef:i,inert:a,linked:o,show:s}){let{user:c,status:l,signOut:u}=En(),d=a?s||`user`:l,f=a?{name:`Ada Lovelace`,email:`ada@example.com`}:c;return d===`loading`?(0,M.jsx)(`div`,{ref:i,style:{minHeight:24,...S(r)}}):d===`user`?(0,M.jsxs)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...S(r)},children:[(0,M.jsxs)(`span`,{style:{...Dt,fontWeight:600},children:[e,` `,f?.name||f?.email||``]}),n&&f?.email?(0,M.jsx)(`span`,{style:{...Dt,opacity:.7},children:f.email}):null,(0,M.jsx)(`button`,{type:`button`,onClick:a?void 0:u,style:{...Fe,border:0,padding:`8px 16px`,borderRadius:8,fontSize:14,cursor:a?`default`:`pointer`},...At(a),children:t})]}):(0,M.jsx)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...S(r)},children:o?.signedOut??null})}var jn={id:`consent`,label:`Cookie consent`,category:`Apps`,keys:[`CookieConsent`],ssr:`shell`,settings:[]},Mn=`webim.cookie_consent`;function Nn(){try{let e=window.localStorage.getItem(Mn),t=e?JSON.parse(e):null;return t?.choice===`accepted`||t?.choice===`declined`?t.choice:``}catch{return``}}function Pn(e){try{document.querySelectorAll(`.webim-page`).forEach(t=>t.setAttribute(`data-webim-consent`,e))}catch{}}function Fn(e){try{window.localStorage.setItem(Mn,JSON.stringify({choice:e,at:new Date().toISOString()}))}catch{}Pn(e);try{window.dispatchEvent(new CustomEvent(`webim:consent`,{detail:{choice:e}}))}catch{}}var In={bottom:{left:0,right:0,bottom:0},top:{left:0,right:0,top:0},"bottom-left":{left:16,bottom:16,maxWidth:400},"bottom-right":{right:16,bottom:16,maxWidth:400}};function Ln({message:e,acceptLabel:t,rejectLabel:n,showReject:r,linkLabel:i,linkHref:a,position:o,linked:s,style:c,nodeRef:u,inert:d}){let[f,p]=(0,l.useState)(!!d),[m,h]=(0,l.useState)(null),g=e=>{h(e),typeof u==`function`&&u(e)};if((0,l.useEffect)(()=>{if(d)return;let e=Nn();if(e){let t=m?.closest?.(`.webim-page`);t&&t.setAttribute(`data-webim-consent`,e)}else p(!0)},[d,m]),!f)return null;let _=e=>()=>{d||(Fn(e,m),p(!1))},v=In[o]??In.bottom,y={appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,padding:`8px 16px`,borderRadius:8,cursor:d?`default`:`pointer`,whiteSpace:`nowrap`};return(0,M.jsxs)(`div`,{ref:g,role:`region`,"aria-label":`Cookie consent`,style:{...d?{position:`relative`}:{position:`fixed`,zIndex:2147483e3,...v},display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:12,padding:16,background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:o===`bottom`||o===`top`?0:12,boxShadow:`0 8px 30px rgba(15, 23, 42, 0.18)`,fontSize:14,lineHeight:1.5,...S(c)},children:[(0,M.jsxs)(`div`,{style:{flex:`1 1 260px`,minWidth:0},children:[s?.content??(e||`We use cookies to run this site and to understand how it is used.`),i&&a?(0,M.jsxs)(M.Fragment,{children:[` `,(0,M.jsx)(`a`,{href:a,onClick:d?e=>e.preventDefault():void 0,style:{color:`var(--page-accent, inherit)`,textDecoration:`underline`},children:i})]}):null]}),(0,M.jsxs)(`div`,{style:{display:`flex`,gap:8,flexShrink:0},children:[r===!1?null:(0,M.jsx)(`button`,{type:`button`,onClick:_(`declined`),style:{...y,background:`transparent`,color:`inherit`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.6))`},children:n||`Decline`}),(0,M.jsx)(`button`,{type:`button`,onClick:_(`accepted`),style:{...y,background:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`,border:`1px solid transparent`},children:t||`Accept`})]})]})}var Rn={id:`language`,label:`Language`,category:`Apps`,keys:[`SiteLanguagePicker`],ssr:`prefetch`,settings:[`locales`]};function zn(e){let t=e?.locales,n=[typeof t?.default==`string`&&t.default.trim()?t.default.trim():``,...Array.isArray(t?.enabled)?t.enabled:[]].filter(e=>typeof e==`string`&&e.trim());return[...new Set(n.map(e=>e.trim()))]}var Bn=e=>e&&e.charAt(0).toUpperCase()+e.slice(1);function Vn(e,t){let n=String(e??``).toUpperCase();if(t===`code`)return n;let r=``;try{r=Bn(new Intl.DisplayNames([e],{type:`language`}).of(e)??``)}catch{}return!r||r.toUpperCase()===n?n:t===`both`?`${n} — ${r}`:r}function Hn(e,t){let n=t?``:`?locale=${encodeURIComponent(e)}`;if(typeof window>`u`)return n||`?`;try{let n=new URL(window.location.href);return t?n.searchParams.delete(`locale`):n.searchParams.set(`locale`,e),n.searchParams.delete(`page`),`${n.pathname}${n.search}${n.hash}`}catch{return n||`/`}}function Un({variant:e,display:t,separator:n,label:r,style:i,nodeRef:a,inert:o}){let s=(0,l.useContext)(Se),c=zn(s?.settings),u=c[0]??``,d=c.includes(s?.locale)?s.locale:u,f={display:`inline-flex`,alignItems:`center`,gap:8,...S(i)};if(c.length<2)return o?(0,M.jsx)(`div`,{ref:a,style:{...f,padding:`8px 12px`,border:`1px dashed rgba(100, 116, 139, 0.45)`,borderRadius:6,color:`rgba(100, 116, 139, 0.8)`,fontSize:12},children:`Add site languages in Settings → Languages`}):null;let p=r?(0,M.jsx)(`span`,{style:{opacity:.7},children:r}):null;return e===`inline`?(0,M.jsxs)(`div`,{ref:a,style:f,children:[p,c.map((e,r)=>(0,M.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[r>0&&(0,M.jsx)(`span`,{style:{opacity:.4},children:n??`·`}),(0,M.jsx)(`a`,{href:Hn(e,e===u),hrefLang:e,"aria-current":e===d?`true`:void 0,onClick:o?e=>e.preventDefault():void 0,style:{color:e===d?`var(--page-accent, inherit)`:`inherit`,fontWeight:e===d?600:400,textDecoration:`none`,cursor:o?`default`:`pointer`},children:Vn(e,t)})]},e))]}):(0,M.jsxs)(`div`,{ref:a,style:f,children:[p,(0,M.jsx)(`select`,{"aria-label":r||`Language`,value:d,onChange:o?void 0:e=>{let t=e.target.value;window.location.assign(Hn(t,t===u))},onKeyDown:o?e=>e.preventDefault():void 0,style:{font:`inherit`,color:`inherit`,background:`var(--page-surface, transparent)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:6,padding:`4px 8px`,cursor:o?`default`:`pointer`},children:c.map(e=>(0,M.jsx)(`option`,{value:e,children:Vn(e,t)},e))})]})}var Wn=[wn,Rn,jn],Gn={SiteLoginForm:kn,SiteAccountMenu:An,SiteLanguagePicker:Un,CookieConsent:Ln};new Set(Wn.filter(e=>e.ssr===`shell`).flatMap(e=>e.keys));var Kn=new Map;function qn(e){if(Kn.has(e))return Kn.get(e);let t=URL.createObjectURL(new Blob([e],{type:`text/javascript`})),n=import(t).finally(()=>URL.revokeObjectURL(t));return Kn.set(e,n),n}function Jn(e){let t=e&&typeof e==`object`?e.builder_plugins:null,n=t&&typeof t==`object`?t.plugins:null;return n&&typeof n==`object`?n:{}}async function Yn(e,t){let n=await qn(e);return(Array.isArray(n?.default?.blocks)?n.default.blocks:[]).find(e=>e?.id===t&&typeof e.mount==`function`)??null}var Xn={padding:`10px 12px`,border:`1px dashed rgba(148, 163, 184, 0.5)`,borderRadius:8,fontSize:12,opacity:.6};function Zn({pluginId:e,blockId:t,props:n,style:r,nodeRef:i}){let a=(0,l.useContext)(Se),o=Jn(a?.settings)[e],s=(0,l.useRef)(null),c=(0,l.useRef)(null),u={tenant:a?.tenant??``,apiUrl:a?.apiUrl??`/api`,locale:a?.locale??``,settings:a?.settings??null},d=(0,l.useRef)(u);d.current=u;let f=JSON.stringify(n??{});return(0,l.useEffect)(()=>{let e=s.current;if(!o?.code||!e)return;let n=!0;return Yn(o.code,t).then(e=>{if(!(!n||!e||!s.current)){c.current=e;try{e.mount(s.current,JSON.parse(f),d.current)}catch{c.current=null}}}).catch(()=>{}),()=>{n=!1;let t=c.current;c.current=null;try{t?.unmount?.(e)}catch{}e&&(e.innerHTML=``)}},[o?.code,t]),(0,l.useEffect)(()=>{let e=c.current,t=s.current;if(!(!e||!t))try{e.update?e.update(t,JSON.parse(f),d.current):(e.unmount?.(t),t.innerHTML=``,e.mount(t,JSON.parse(f),d.current))}catch{}},[f]),o?(0,M.jsx)(`div`,{ref:i,style:S(r),children:(0,M.jsx)(`div`,{ref:s})}):(0,M.jsxs)(`div`,{ref:i,style:{...Xn,...S(r)},children:[`Plugin “`,e,`” is not installed`]})}var Qn={...Cn,...Gn,PluginBlock:Zn};function $n(e,t,n,r=new Set,i=void 0){let a=t[e];if(!a||a.hidden)return null;let o=a.type?.resolvedName,s=i?.mapProps?i.mapProps(a.props??{},o):a.props??{};if(o===`ComponentInstance`){let t=a.props?.componentId,o=n?.[t];if(!o?.template||r.has(t))return null;let s=new Set(r).add(t);return(0,M.jsx)(l.Fragment,{children:$n(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=Qn[o];if(!c)return null;let u=(a.nodes??[]).map(e=>$n(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,i])=>[e,$n(i,t,n,r)])):void 0,p=(0,M.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),E(t,s))},children:u.length?u:void 0},e);return s.when&&s.when!==`always`?(0,M.jsx)(On,{when:s.when,children:p},e):p}var er=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `),tr=e=>`.webim-page[data-webim-mode="light"] { ${Object.entries(A(e.light)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }
|
|
14
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(A(e.dark)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }`;function nr({blocks:e,theme:t,components:n,mode:r=`auto`,style:i,custom:a,tenant:o,apiUrl:s,datasets:c,locale:u,direction:d,settings:f,siteUser:p}){let m=a?.js?.trim();if((0,l.useEffect)(()=>{if(!m)return;let e=document.createElement(`script`);return e.text=m,document.body.appendChild(e),()=>e.remove()},[m]),!e?.ROOT)return null;let g={lang:u||void 0,dir:be(d,u)},_=`.webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }`,y={minHeight:`100%`,display:`flex`,flexDirection:`column`},b=$n(`ROOT`,e,n),x=(0,l.useMemo)(()=>({render:(t,r)=>$n(t,e,n,void 0,{mapProps:r})}),[e,n]),S=oe(e,n),C=ae(e,n),w=a?.css?.trim(),T=de(t),E=[T.font,T.headingFont].filter(e=>typeof e==`string`&&e.trim()&&e!==`inherit`&&!ce[e]),ee=[...new Set([...v(e,n),...E])].map(e=>(0,M.jsx)(`link`,{rel:`stylesheet`,precedence:`default`,href:h(e)},e)),D=tr(T);return r===`auto`?(0,M.jsx)(Se.Provider,{value:{tenant:o||``,apiUrl:s||`/api`,locale:u||``,settings:f??null},children:(0,M.jsx)(Dn,{initialUser:p,children:(0,M.jsx)(Ce.Provider,{value:c??null,children:(0,M.jsx)(De.Provider,{value:x,children:(0,M.jsxs)(`div`,{...g,className:`webim-page`,style:{...y,...j(t),...i},children:[(0,M.jsx)(`style`,{children:`.webim-page { ${er(A(T.light))} }
|
|
15
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${er(A(T.dark))} } }`}),(0,M.jsx)(`style`,{children:D}),ee,(0,M.jsx)(`style`,{children:_}),S&&(0,M.jsx)(`style`,{children:S}),C&&(0,M.jsx)(`style`,{children:C}),w&&(0,M.jsx)(`style`,{children:w}),b]})})})})}):(0,M.jsx)(Se.Provider,{value:{tenant:o||``,apiUrl:s||`/api`,locale:u||``,settings:f??null},children:(0,M.jsx)(Dn,{initialUser:p,children:(0,M.jsx)(Ce.Provider,{value:c??null,children:(0,M.jsx)(De.Provider,{value:x,children:(0,M.jsxs)(`div`,{...g,className:`webim-page`,style:{...y,...fe(t,r),...i},children:[ee,(0,M.jsx)(`style`,{children:D}),(0,M.jsx)(`style`,{children:_}),S&&(0,M.jsx)(`style`,{children:S}),C&&(0,M.jsx)(`style`,{children:C}),w&&(0,M.jsx)(`style`,{children:w}),b]})})})})})}function rr({bundle:e,mode:t=`auto`,style:n}){return e?.blocks?.ROOT?(0,M.jsx)(nr,{blocks:e.blocks,theme:e.theme,components:e.components,custom:e.custom,tenant:e.tenant,apiUrl:e.apiUrl,datasets:e.datasets,locale:e.locale,direction:e.direction,settings:e.settings,mode:me(t,e.scheme),style:n}):null}function ir({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,token:a,mode:o=`auto`,style:s,fallback:c=null,errorFallback:u=null,onLoad:d,onError:f}){let[p,m]=(0,l.useState)({status:`loading`}),h=(0,l.useRef)({onLoad:d,onError:f});return h.current={onLoad:d,onError:f},(0,l.useEffect)(()=>{let o=!0;return m({status:`loading`}),_e({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,token:a}).then(e=>{o&&(m({status:`ready`,bundle:e}),h.current.onLoad?.(e))}).catch(e=>{o&&(m({status:`error`,error:e}),h.current.onError?.(e))}),()=>{o=!1}},[e,t,n,r,i,a]),p.status===`loading`?c:p.status===`error`?typeof u==`function`?u(p.error):u:(0,M.jsx)(rr,{bundle:p.bundle,mode:o,style:s})}function ar(e,t={}){let n=(0,u.createRoot)(e);return n.render((0,M.jsx)(ir,{apiUrl:t.apiUrl||t.api,tenant:t.tenant,slug:t.slug,locale:t.locale||void 0,token:t.token||void 0,mode:t.mode||`auto`,onError:e=>console.error(`[webim-embed]`,t.slug,e)})),n}function or(e=document){for(let t of e.querySelectorAll(`[data-webim-page]:not([data-webim-mounted])`))t.setAttribute(`data-webim-mounted`,``),ar(t,t.dataset)}var sr=document.currentScript,cr=()=>{if(or(),sr?.dataset.slug){let e=document.createElement(`div`);e.setAttribute(`data-webim-mounted`,``),sr.parentElement&&sr.parentElement!==document.head?sr.insertAdjacentElement(`beforebegin`,e):document.body.appendChild(e),ar(e,sr.dataset)}};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,cr,{once:!0}):cr(),window.WebimEmbed={mount:ar,scan:or}})();
|