webim-adapter 1.1.2 → 1.1.3

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.
@@ -12,7 +12,7 @@ Error generating stack: `+e.message+`
12
12
  `)}var oe=[{key:`tablet`,max:991},{key:`mobileLandscape`,max:767},{key:`mobile`,max:478}],se=e=>Object.entries(k(e)).map(([e,t])=>`${ae(e)}: ${t} !important;`).join(` `);function ce(e,t){return oe.map(({key:n,max:r})=>{let i=t?.[n]?se(t[n]):``;return i?`@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }`:``}).filter(Boolean).join(`
13
13
  `)}function le(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=ce(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
14
14
  `)}function ue(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=L(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
15
- `)}var de=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,fe={fontFamily:de,fontStyle:`normal`,fontWeight:400,letterSpacing:`normal`,textTransform:`none`,lineHeight:1.4,textShadow:`none`},pe={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`}}},me={font:`system`,headingFont:`inherit`,light:pe.light,dark:pe.dark},he={system:{label:`System`,value:de},inter:{label:`Inter`,value:`"Inter", ${de}`},outfit:{label:`Outfit`,value:`"Outfit", ${de}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},ge=(e,t)=>he[e]?.value??_(e)??(typeof e==`string`&&e.trim()?`"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`:t),_e=(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 ve(e){let{light:t,dark:n,font:r,headingFont:i,...a}=e??{};return{font:r??me.font,headingFont:i??me.headingFont,light:_e(pe.light,a,t),dark:_e(pe.dark,n)}}function ye(e){return{"--page-bg":e.background,"--page-surface":e.surface??e.background,"--page-border":e.border??pe.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 be(e){let t=ve(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:ge(t.font,de),"--page-heading-font":t.headingFont===`inherit`?`inherit`:ge(t.headingFont,`inherit`)}}function xe(e,t=`light`){let n=ve(e);return{...be(e),...ye(n[t]??n.light)}}function Se(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function Ce(e,t){return e===`light`||e===`dark`?e:t===`light`||t===`dark`?t:`auto`}function we({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:Se(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,animations:o.animations,seo:o.seo,direction:o.direction,scheme:o.scheme,locale:i||a.locales?.default,locales:a.locales,tenant:n??``,apiUrl:r??``,settings:a}}var Te=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 R({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(Te),c(`${l}/settings/public`,{headers:u}).then(Te)]),p=we({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:[`TableBlock`,`OrgChartBlock`,`NavbarBlock`,`CalendarBlock`,`MasonryBlock`,`LogoCarousel`].includes(e?.type?.resolvedName)?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(Te).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 z=new Set([`ar`,`he`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`]),Ee=e=>z.has(String(e||``).toLowerCase().split(/[-_]/)[0])?`rtl`:`ltr`,De=(e,t)=>e===`ltr`||e===`rtl`?e:t?Ee(t):void 0,Oe=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})),B=e(((e,t)=>{t.exports=Oe()}))(),ke=(0,l.createContext)({tenant:``,apiUrl:`/api`,locale:``,settings:null}),Ae=(0,l.createContext)(null),je=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},Me=()=>{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},Ne=e=>{let t={...e&&typeof e==`object`&&!Array.isArray(e)?e:{},...Me()};return Object.fromEntries(Object.entries(t).filter(([,e])=>typeof e==`string`&&e.trim()!==``))},Pe=(0,l.createContext)(null),Fe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Ie(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Le=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 Re(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 ze(e,t){let n=t?.data??{},r=Le(n);if(!r.length)return e;let i=RegExp(`:(${r.map(Fe).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>Re(Ie(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 Be={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},Ve={margin:0},He={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},Ue={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},We={display:`flex`,flexDirection:`column`};function Ge({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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,B.jsx)(`div`,{style:{...n,background:r}})]})}var Ke=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...k(e)}:{...t,...k(e)};function qe({style:e,nodeRef:t,children:n}){return(0,B.jsxs)(`div`,{ref:t,style:{...Ue,...k(e)},children:[(0,B.jsx)(Ge,{style:e}),n]})}function Je({style:e,nodeRef:t,children:n}){return(0,B.jsxs)(`section`,{ref:t,style:Ke(e,We),children:[(0,B.jsx)(Ge,{style:e}),n]})}function Ye({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,B.jsxs)(`div`,{ref:n,style:i?{...i,...Ke(e)}:Ke(e),children:[(0,B.jsx)(Ge,{style:e}),r]})}function Xe({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,B.jsx)(n,{ref:a,style:{...Be,...k(r)},children:$e(t,e,i)})}var Ze={fontFamily:he.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function Qe(e,t=[],n,r){let i=e;return t.includes(`sup`)?i=(0,B.jsx)(`sup`,{children:i}):t.includes(`sub`)&&(i=(0,B.jsx)(`sub`,{children:i})),t.includes(`code`)&&(i=(0,B.jsx)(`code`,{style:Ze,children:i})),t.includes(`strike`)&&(i=(0,B.jsx)(`s`,{children:i})),t.includes(`underline`)&&(i=(0,B.jsx)(`u`,{children:i})),t.includes(`italic`)&&(i=(0,B.jsx)(`em`,{children:i})),t.includes(`bold`)&&(i=(0,B.jsx)(`strong`,{children:i})),n?i=(0,B.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{color:`inherit`,...t.includes(`nounderline`)&&{textDecoration:`none`}},children:i}):t.includes(`nounderline`)&&(i=(0,B.jsx)(`span`,{style:{textDecoration:`none`},children:i})),i}function $e(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,B.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,B.jsx)(l.Fragment,{children:$e(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,B.jsx)(`sup`,{children:r}):e.sub&&(r=(0,B.jsx)(`sub`,{children:r})),e.code&&(r=(0,B.jsx)(`code`,{style:Ze,children:r})),e.strike&&(r=(0,B.jsx)(`s`,{children:r})),e.underline&&(r=(0,B.jsx)(`u`,{children:r})),e.italic&&(r=(0,B.jsx)(`em`,{children:r})),e.bold&&(r=(0,B.jsx)(`strong`,{children:r})),(e.color||e.background)&&(r=(0,B.jsx)(`span`,{style:{...e.color&&{color:e.color},...e.background&&{backgroundColor:e.background}},children:r})),e.href?r=(0,B.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{color:e.color??`inherit`,...e.nounderline&&{textDecoration:`none`}},children:r}):e.nounderline&&(r=(0,B.jsx)(`span`,{style:{textDecoration:`none`},children:r})),(0,B.jsx)(l.Fragment,{children:r},t)}):t}function et({parts:e,text:t,marks:n,href:r,target:i,style:a}){return(0,B.jsx)(`span`,{style:k(a),children:e?.length?$e(e,t):Qe(t,n,r,i)})}var tt={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16};function nt({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 rt(e=[],t,n){let r=n??((e,n)=>$e(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,B.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,B.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...nt(t)},children:[t.href?(0,B.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,B.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return mt(t.url)?(0,B.jsx)(`div`,{style:{...i,...nt({align:t.align,wrap:t.wrap,width:t.width??100})},children:(0,B.jsx)(ht,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`button`){if(!(typeof t.label==`string`&&t.label.trim()))return null;let e=Number.isFinite(Number(t.radius))?Number(t.radius):8,r=[`center`,`right`].includes(t.align)?t.align:`left`;return(0,B.jsx)(`div`,{style:{...i,textAlign:r},children:(0,B.jsx)(`table`,{role:`presentation`,cellPadding:0,cellSpacing:0,style:{borderCollapse:`separate`,display:`inline-table`},children:(0,B.jsx)(`tbody`,{children:(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{style:{backgroundColor:t.bg||`var(--page-accent, #4f46e5)`,borderRadius:e},children:(0,B.jsx)(`a`,{href:t.href||`#`,target:t.target||void 0,rel:t.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`inline-block`,padding:`13px 24px`,color:t.color||`#ffffff`,fontSize:15,fontWeight:600,lineHeight:1.2,textDecoration:`none`,borderRadius:e},children:t.label})})})})})},n)}if(t.type===`divider`)return(0,B.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,B.jsxs)(`table`,{style:{...i,borderCollapse:`collapse`,width:`100%`,fontSize:`inherit`,tableLayout:s?`fixed`:void 0},children:[s&&(0,B.jsx)(`colgroup`,{children:s.map((e,t)=>(0,B.jsx)(`col`,{style:{width:`${e}%`}},t))}),r&&(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:e[0].map((e,t)=>(0,B.jsx)(`th`,{style:{...a,fontWeight:700},children:e},t))})}),(0,B.jsx)(`tbody`,{children:o.map((e,t)=>(0,B.jsx)(`tr`,{children:e.map((e,t)=>(0,B.jsx)(`td`,{style:a,children:e},t))},t))})]},n)}if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,B.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,B.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,B.jsx)(`blockquote`,{style:{...at,...i},children:r(t.parts,t.text)},n);if(tt[t.type]){let e=t.type;return(0,B.jsx)(e,{style:{...Be,fontSize:tt[t.type],...i},children:r(t.parts,t.text)},n)}return(0,B.jsx)(`p`,{style:{...Ve,...i},children:r(t.parts,t.text)},n)})}function it({content:e,style:t,linked:n,nodeRef:r}){return(0,B.jsx)(`div`,{ref:r,style:{display:`flow-root`,...k(t)},children:rt(e,n)})}var at={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function ot({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,B.jsx)(`blockquote`,{ref:i,style:{...at,...k(n)},children:$e(t,e,r)})}function st({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,B.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...k(n)},children:t.map((e,t)=>(0,B.jsx)(`li`,{style:{marginBottom:4},children:$e(e.parts,e.text)},t))})}function ct({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,B.jsx)(`p`,{ref:i,style:{...Ve,...k(n)},children:$e(t,e,r)})}var lt={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function ut({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,B.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...lt,...k(i)},children:$e(t,e,a)})}function dt({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,B.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...He,...k(i)},children:$e(t,e,a)})}function ft({src:e,alt:t,style:n,nodeRef:r}){return e?(0,B.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...k(n)}}):null}function pt({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,B.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%`,...k(o)}}):null}var mt=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function ht({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=mt(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,B.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...k(o)},children:(0,B.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 gt({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,B.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...k(r)}}):null}function _t({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,B.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:k(n)})}function vt({height:e,nodeRef:t}){return(0,B.jsx)(`div`,{ref:t,style:{height:e||32,flexShrink:0,alignSelf:`stretch`}})}function yt({style:e,nodeRef:t}){return(0,B.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...k(e)}})}var bt={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},xt={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)`}},St=48;function Ct({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>St&&g(h-1)};return(0,B.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,...k(o)},children:[(0,B.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,B.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...bt,left:12},onClick:()=>g(h-1),children:`‹`}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...bt,right:12},onClick:()=>g(h+1),children:`›`}),(0,B.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,B.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 wt=(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 Tt({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,B.jsx)(Ct,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:wt(i.image)}),(i.title||i.text)&&(0,B.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...xt[t]??xt.bottom},children:[i.title&&(0,B.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,B.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function Et({slides:e=[],linked:t,...n}){return e.length?(0,B.jsx)(Ct,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:wt(r.image,r.color)}),(0,B.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}var Dt=256,Ot=e=>Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,e))*Math.PI/360)),kt=(e,t,n)=>{let r=Dt*2**n;return{x:(Number(t)+180)/360*r,y:(.5-Ot(Number(e))/(2*Math.PI))*r}},At=(e,t)=>{if(e===``||e==null)return null;let n=Number(e);return Number.isFinite(n)&&Math.abs(n)<=t?n:null},jt=e=>!!e&&At(e.lat,90)!==null&&At(e.lng,180)!==null;function Mt(e,t,n=`directions`,r=``){let i=`${e},${t}`;return n===`place`?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r?`&query_place_id=`:``}`:`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`}var Nt=(e,t,n=13)=>`https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n)||13)}/${e}/${t}`;function Pt({markers:e,lat:t,lng:n,zoom:r=``,height:i=320,pinSize:a=22,pinLink:o=`directions`,link:s=!1,label:c=``,style:u,nodeRef:d,inert:f}){let p=(0,l.useRef)(null),[m,h]=(0,l.useState)(1200);(0,l.useEffect)(()=>{let e=p.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>h(t=>e.clientWidth&&e.clientWidth!==t?e.clientWidth:t);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let g=(Array.isArray(e)?e:[]).filter(jt),_=jt({lat:t,lng:n})?{lat:At(t,90),lng:At(n,180)}:g.length?{lat:g.reduce((e,t)=>e+At(t.lat,90),0)/g.length,lng:g.reduce((e,t)=>e+At(t.lng,180),0)/g.length}:null,v=Math.max(80,Number(i)||320),y=At(r,19)?Math.min(Math.max(Math.round(Number(r)),1),19):(()=>{if(g.length<2)return 13;for(let e=19;e>=1;e--){let t=g.map(t=>kt(At(t.lat,90),At(t.lng,180),e)),n=Math.max(...t.map(e=>e.x))-Math.min(...t.map(e=>e.x)),r=Math.max(...t.map(e=>e.y))-Math.min(...t.map(e=>e.y));if(n<=m*.8&&r<=v*.7)return e}return 1})(),b={width:`100%`,...k(u)};if(!_)return(0,B.jsx)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:{...b,minHeight:80,display:`grid`,placeItems:`center`,fontSize:13,opacity:.6,border:`1px dashed var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:8},children:`Set the coordinates in Settings`});let x=kt(_.lat,_.lng,y),S={x:x.x-m/2,y:x.y-v/2},C=[],w=[];for(let e=Math.floor(S.x/Dt);e<=Math.floor((S.x+m)/Dt);e++)C.push(e);for(let e=Math.floor(S.y/Dt);e<=Math.floor((S.y+v)/Dt);e++)w.push(e);let T=2**y;return(0,B.jsxs)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:b,children:[(0,B.jsxs)(`div`,{role:`img`,"aria-label":c||`Map`,style:{position:`relative`,height:v,overflow:`hidden`,borderRadius:`inherit`,background:`var(--page-surface, #e5e7eb)`},children:[w.map(e=>C.map(t=>{let n=(t%T+T)%T;return e<0||e>=T?null:(0,B.jsx)(`img`,{src:`https://tile.openstreetmap.org/${y}/${n}/${e}.png`,alt:``,width:Dt,height:Dt,loading:`lazy`,style:{position:`absolute`,left:Math.round(t*Dt-S.x),top:Math.round(e*Dt-S.y),width:Dt,height:Dt,userSelect:`none`,pointerEvents:`none`}},`${t}-${e}`)})),g.map((e,t)=>{let n=kt(At(e.lat,90),At(e.lng,180),y),r=n.x-S.x,i=n.y-S.y,s=e.color||`var(--page-accent, #dc2626)`,c=o===`none`||f?null:Mt(At(e.lat,90),At(e.lng,180),o,e.title);return(0,B.jsxs)(c?`a`:`span`,{href:c||void 0,target:c?`_blank`:void 0,rel:c?`noopener noreferrer`:void 0,title:c&&e.title||void 0,style:{position:`absolute`,left:r,top:i,transform:`translate(-50%, -100%)`,cursor:c?`pointer`:`default`,textDecoration:`none`,color:`inherit`},children:[e.title?(0,B.jsx)(`span`,{style:{position:`absolute`,left:`50%`,bottom:`100%`,transform:`translateX(-50%)`,marginBottom:4,padding:`3px 7px`,borderRadius:6,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.5))`,boxShadow:`0 2px 8px rgba(15, 23, 42, 0.25)`,fontSize:12,lineHeight:1.35,whiteSpace:`nowrap`},children:e.title}):null,(0,B.jsxs)(`svg`,{width:Math.max(10,Number(a)||22),height:Math.max(10,Number(a)||22),viewBox:`0 0 24 24`,fill:s,style:{display:`block`},children:[(0,B.jsx)(`path`,{d:`M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z`}),Ft[e.icon]?(0,B.jsx)(`path`,{d:Ft[e.icon],transform:`translate(12 10.5) scale(0.46) translate(-12 -12)`,fill:`none`,stroke:`#fff`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`}):(0,B.jsx)(`circle`,{cx:`12`,cy:`10.5`,r:`2.6`,fill:`#fff`})]})]},t)}),(0,B.jsx)(`a`,{href:`https://www.openstreetmap.org/copyright`,target:`_blank`,rel:`noopener noreferrer`,onClick:f?e=>e.preventDefault():void 0,style:{position:`absolute`,right:4,bottom:3,padding:`1px 5px`,borderRadius:4,background:`rgba(255, 255, 255, 0.75)`,color:`#334155`,fontSize:10,textDecoration:`none`},children:`© OpenStreetMap`})]}),s?(0,B.jsx)(`a`,{href:Nt(_.lat,_.lng,y),target:`_blank`,rel:`noopener noreferrer`,onClick:f?e=>e.preventDefault():void 0,style:{display:`inline-block`,marginTop:6,fontSize:12,color:`var(--page-accent, inherit)`},children:`View larger map`}):null]})}var Ft={check:`M4 12l5 5L20 6`,close:`M6 6l12 12M18 6L6 18`,plus:`M12 5v14M5 12h14`,minus:`M5 12h14`,"arrow-right":`M4 12h16M13 5l7 7-7 7`,"arrow-left":`M20 12H4M11 5l-7 7 7 7`,"arrow-up":`M12 20V4M5 11l7-7 7 7`,"arrow-down":`M12 4v16M5 13l7 7 7-7`,"chevron-right":`M9 5l7 7-7 7`,"chevron-left":`M15 5l-7 7 7 7`,"chevron-down":`M5 9l7 7 7-7`,"chevron-up":`M5 15l7-7 7 7`,menu:`M4 7h16M4 12h16M4 17h16`,star:`M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z`,heart:`M12 20s-7-4.4-7-9a4 4 0 0 1 7-2.6A4 4 0 0 1 19 11c0 4.6-7 9-7 9z`,home:`M4 11l8-7 8 7M6 10v9h12v-9`,user:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20c0-3.3 3.6-5 8-5s8 1.7 8 5`,mail:`M3 6h18v12H3zM3 6l9 7 9-7`,phone:`M6 3h4l2 5-3 2a12 12 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2z`,search:`M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM20 20l-4.2-4.2`,clock:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2`,calendar:`M4 6h16v14H4zM4 10h16M8 3v4M16 3v4`,download:`M12 4v10M8 11l4 4 4-4M4 19h16`,upload:`M12 20V10M8 13l4-4 4 4M4 5h16`,play:`M8 5l11 7-11 7z`,pause:`M9 5v14M15 5v14`,info:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 11v5M12 8h.01`,alert:`M12 4l9 16H3zM12 10v4M12 17h.01`,lock:`M6 11h12v9H6zM9 11V8a3 3 0 0 1 6 0v3`,chat:`M4 5h16v11H9l-5 4z`,"map-pin":`M12 21s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11zM12 12a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z`,camera:`M4 8h4l2-2h4l2 2h4v12H4zM12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z`,image:`M4 5h16v14H4zM8 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM6 17l5-5 4 4 2-2 3 3`,file:`M7 3h7l4 4v14H7zM14 3v5h4`,link:`M10 14a4 4 0 0 0 6 .5l2-2a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6-.5l-2 2a4 4 0 0 0 6 6l1-1`,external:`M14 4h6v6M20 4l-9 9M18 14v5H5V6h5`,trash:`M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13`,edit:`M4 20h4L19 9l-4-4L4 16z`,filter:`M3 5h18l-7 8v6l-4-2v-4z`,refresh:`M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5`,globe:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18`,bell:`M6 16V11a6 6 0 1 1 12 0v5l2 3H4zM10 22h4`,tag:`M4 4h7l9 9-7 7-9-9zM8.5 8.5h.01`,cart:`M4 5h2l2 10h10l2-7H7M9 20h.01M18 20h.01`,card:`M3 6h18v12H3zM3 10h18`,shield:`M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6z`,sun:`M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 2v2M12 20v2M4 12H2M22 12h-2M5 5l1.5 1.5M17.5 17.5L19 19M19 5l-1.5 1.5M6.5 17.5L5 19`,moon:`M20 14a8 8 0 1 1-10-10 7 7 0 0 0 10 10z`,settings:`M12 9.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM12 2l1 2.6 2.7-.6 1 2.5 2.6 1-.6 2.7L21 12l-2.3 1.8.6 2.7-2.6 1-1 2.5-2.7-.6L12 22l-1-2.6-2.7.6-1-2.5-2.6-1 .6-2.7L3 12l2.3-1.8-.6-2.7 2.6-1 1-2.5 2.7.6z`,eye:`M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,"eye-off":`M4 4l16 16M9.5 9.6A3 3 0 0 0 12 15c.8 0 1.5-.3 2.1-.8M6.6 6.7C3.9 8.3 2 12 2 12s4 7 10 7c1.9 0 3.5-.5 4.9-1.2M14.1 5.4C13.4 5.1 12.7 5 12 5`,share:`M8 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 6a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM7.8 10.8l8.4-3.6M7.8 13.2l8.4 3.6`,send:`M21 3L3 10l7 3 3 7z`,paperclip:`M20 11l-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L15 6`,video:`M3 7h11v10H3zM14 11l6-3v8l-6-3`,music:`M9 18V6l10-2v12M9 18a2.5 2.5 0 1 1-2.5-2.5H9M19 16a2.5 2.5 0 1 1-2.5-2.5H19`,mic:`M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3zM5 11a7 7 0 0 0 14 0M12 18v3`,headphones:`M4 15v-3a8 8 0 1 1 16 0v3M4 15h3v5H5a1 1 0 0 1-1-1zM20 15h-3v5h2a1 1 0 0 0 1-1z`,book:`M5 4h14v16H7a2 2 0 0 1-2-2zM7 4v14h12`,bookmark:`M7 4h10v16l-5-4-5 4z`,folder:`M4 6h5l2 2h9v10H4z`,cloud:`M7 18a4 4 0 0 1 .5-8 5.5 5.5 0 0 1 10.4 1.5A3.5 3.5 0 0 1 17.5 18z`,database:`M12 3c4.4 0 8 1.3 8 3s-3.6 3-8 3-8-1.3-8-3 3.6-3 8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3`,server:`M4 4h16v6H4zM4 14h16v6H4zM8 7h.01M8 17h.01`,code:`M9 8l-5 4 5 4M15 8l5 4-5 4`,terminal:`M4 5h16v14H4zM8 10l3 2-3 2M13 14h4`,wifi:`M5 12a10 10 0 0 1 14 0M8 15a6 6 0 0 1 8 0M12 19h.01`,battery:`M3 8h15v8H3zM21 11v2`,printer:`M7 8V4h10v4M7 16H4V8h16v8h-3M7 13h10v7H7z`,gift:`M4 10h16v10H4zM3 6h18v4H3zM12 6v14M12 6c-2 0-4-1-4-2.5S9 2 10 3s2 3 2 3zM12 6c2 0 4-1 4-2.5S15 2 14 3s-2 3-2 3z`,key:`M15 4a5 5 0 1 0-4.6 7L9 12.4V15H6.5L4 17.5V20h4l7-7A5 5 0 0 0 15 4z`,compass:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM15 9l-2 5-5 2 2-5z`,flag:`M5 21V4h13l-2 4 2 4H5`,award:`M12 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM9 13l-1 7 4-2 4 2-1-7`,chart:`M4 20V4M4 20h16M8 16v-5M12 16V8M16 16v-8`,pie:`M12 3a9 9 0 1 0 9 9h-9z`,trending:`M3 17l6-6 4 4 8-8M15 7h6v6`,dollar:`M12 3v18M16 7.5C16 6 14.2 5 12 5S8 6 8 7.5 9.5 10 12 10.5s4 1.5 4 3-1.8 2.5-4 2.5-4-1-4-2.5`,percent:`M5 19L19 5M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM16.5 14a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z`,truck:`M3 6h11v9H3zM14 9h4l3 3v3h-7zM7.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM17.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z`,package:`M12 3l8 4v10l-8 4-8-4V7zM4 7l8 4 8-4M12 11v10`,store:`M4 9h16v11H4zM4 9l1.5-5h13L20 9M9 20v-6h6v6`,building:`M5 21V4h9v17M14 9h5v12M8 8h3M8 12h3M8 16h3M17 12h.01M17 16h.01`,users:`M9 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 20c0-3.3 3.1-5 7-5s7 1.7 7 5M17 5a4 4 0 0 1 0 7.9M22 20c0-2.6-1.6-4.2-4-4.8`,"thumbs-up":`M7 21V10h3l3-6a2 2 0 0 1 2 2v4h4l-2 11z`,smile:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9 10h.01M15 10h.01M8.5 14.5a5 5 0 0 0 7 0`,help:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.7M12 17h.01`,checkbox:`M4 4h16v16H4zM8 12l3 3 5-5`,list:`M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01`,grid:`M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z`,layers:`M12 3l9 5-9 5-9-5zM3 13l9 5 9-5`,zap:`M13 3L5 14h6l-1 7 8-11h-6z`,flame:`M12 21a6 6 0 0 0 6-6c0-4-4-6-4-10 0 0-3 1.5-3 5 0 1.5-1 2-1.5 1.5C8 10 7.5 9 7.5 9A7.5 7.5 0 0 0 6 15a6 6 0 0 0 6 6z`,droplet:`M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z`,leaf:`M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7`};function It({name:e=`star`,paths:t,fill:n=!1,size:r=24,stroke:i=2,color:a=``,href:o=``,target:s=``,label:c=``,style:l,nodeRef:u,inert:d}){let f=Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim()):[],p=n&&f.length>0,m=f.length?f:[Ft[e]??Ft.star],h=Math.min(Math.max(Number(r)||24,8),240),g=a===`accent`?`var(--page-accent, currentColor)`:a||`currentColor`,_=(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,width:h,height:h,fill:p?g:`none`,stroke:p?`none`:g,strokeWidth:p?void 0:Math.min(Math.max(Number(i)||2,.5),4),strokeLinecap:p?void 0:`round`,strokeLinejoin:p?void 0:`round`,role:c?`img`:void 0,"aria-label":c||void 0,"aria-hidden":c?void 0:`true`,style:{display:`block`},children:m.map((e,t)=>(0,B.jsx)(`path`,{d:e},t))}),v={display:`inline-flex`,lineHeight:0,...k(l)};return o?(0,B.jsx)(`a`,{ref:u,href:o,onClick:d?e=>e.preventDefault():void 0,target:s||void 0,rel:s===`_blank`?`noopener noreferrer`:void 0,style:{...v,color:`inherit`},children:_}):(0,B.jsx)(`span`,{ref:u,style:v,children:_})}function Lt(e,t={},n=0){let r=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`):[],i=e=>e==null?``:Re(e),a=Math.max(0,Number(n)||0),o=[];for(let e of r){let n=e.data??e,r=Ie(n,t.imageField),s=(Array.isArray(r)?r:[r]).map(e=>e&&typeof e==`object`?e.url??e.src??``:e).filter(e=>typeof e==`string`&&e.trim()),c=t.nameField?i(Ie(n,t.nameField)):i(n.name),l=t.hrefField?i(Ie(n,t.hrefField)):``;for(let e of s)if(o.push({src:e,name:c,alt:c,href:l}),a&&o.length>=a)return o}return o}function Rt({images:e=[],source:t=``,entry:n=``,imageField:r=``,nameField:i=``,hrefField:a=``,limit:o=0,emptyText:s=``,columns:c=3,gap:u=8,showNames:d=!1,lightbox:f=!0,style:p,nodeRef:m,inert:h}){let{tenant:g,apiUrl:_}=(0,l.useContext)(ke),v=(0,l.useContext)(Ae)?.[t],[y,b]=(0,l.useState)(null),[x,S]=(0,l.useState)(()=>new Set);(0,l.useEffect)(()=>{if(!t||v)return;let e=!0;return fetch(`${_}/dynamic/${encodeURIComponent(t)}`,{headers:g?{"x-tenant":g}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&b(n)}).catch(()=>e&&b([])),()=>{e=!1}},[t,g,_,v]);let C=v??y??[],w=n?C.filter(e=>e?.id===n||e?.data?.slug===n||e?.slug===n):C,T=Math.max(0,Number(o)||0),E=t?(()=>{let e=Lt(w,{imageField:r,nameField:i,hrefField:a},0).filter(e=>!x.has(e.src));return T?e.slice(0,T):e})():null,D=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],O=E??D,A=!!t&&!v&&y===null,j=Math.max(0,Number(u)||0),ee=h?e=>e.preventDefault():void 0,[M,N]=(0,l.useState)(null),te=f&&!h&&M!==null&&O[M];(0,l.useEffect)(()=>{if(!te)return;let e=e=>{e.key===`Escape`&&N(null),e.key===`ArrowRight`&&N(e=>(e+1)%O.length),e.key===`ArrowLeft`&&N(e=>(e-1+O.length)%O.length)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[te,O.length]);let P=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,B.jsxs)(`div`,{ref:m,style:{columnCount:Math.min(Math.max(Number(c)||3,1),8),columnGap:j,width:`100%`,...k(p)},children:[O.map((e,n)=>{let r=(0,B.jsxs)(`span`,{style:{position:`relative`,display:`block`,borderRadius:`inherit`,overflow:`hidden`},children:[(0,B.jsx)(`img`,{src:e.src,alt:e.alt??``,onError:t?()=>S(t=>new Set(t).add(e.src)):void 0,style:{width:`100%`,display:`block`,borderRadius:`inherit`}}),d&&P(e)&&(0,B.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:P(e)})]}),i=e.href?(0,B.jsx)(`a`,{href:e.href,onClick:ee,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`,borderRadius:`inherit`},children:r}):f&&!h?(0,B.jsx)(`span`,{role:`button`,tabIndex:0,onClick:()=>N(n),onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&N(n),style:{display:`block`,borderRadius:`inherit`,cursor:`zoom-in`},children:r}):r;return(0,B.jsx)(`div`,{style:{breakInside:`avoid`,marginBottom:j,borderRadius:`inherit`,overflow:`hidden`},children:i},n)}),!O.length&&!A&&(0,B.jsx)(`div`,{style:{padding:`24px 12px`,fontSize:13,opacity:.55,textAlign:`center`,columnSpan:`all`},children:t?s||`No images yet`:`Pick images in Settings to fill the gallery`}),te&&(0,B.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:()=>N(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,B.jsx)(`img`,{src:O[M].src,alt:O[M].alt??``,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,maxHeight:`84vh`,borderRadius:8,boxShadow:`0 12px 48px rgba(0,0,0,0.5)`}}),P(O[M])&&(0,B.jsx)(`div`,{style:{color:`#fff`,fontSize:14,marginTop:12,opacity:.85},children:P(O[M])}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>N(null),style:{position:`absolute`,top:16,right:20,background:`transparent`,border:0,color:`#fff`,fontSize:28,lineHeight:1,cursor:`pointer`},children:`×`}),O.length>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),N(e=>(e-1+O.length)%O.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,B.jsx)(`button`,{type:`button`,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),N(e=>(e+1)%O.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 zt={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},Bt={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 Vt(e,t={},n=`dropdown`){let r=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.id):[],i=e=>Array.isArray(e)?e[0]:e,a=e=>e==null?``:Re(e),o=r.map(e=>{let n=e.data??{},r=t.parentField?i(n[t.parentField]):null;return{key:e.id,parent:(r&&typeof r==`object`?r.id:r)||null,label:a(n[t.labelField||`name`])||a(n.name)||`Untitled`,href:t.hrefField?a(n[t.hrefField]):``,image:t.imageField&&i(n[t.imageField])||``,desc:t.descField?a(n[t.descField]):``}}),s=new Map(o.map(e=>[e.key,e])),c=e=>{let t=new Set,n=e;for(;n.parent&&s.has(n.parent)&&!t.has(n.key);)t.add(n.key),n=s.get(n.parent);return n},l=[],u=new Map;for(let e of o){if(c(e)!==e)continue;let t={key:e.key,label:e.label,href:e.href,image:e.image,children:[]};u.set(e.key,t),l.push(t)}for(let e of o){let t=c(e);t!==e&&u.get(t.key)?.children.push({key:e.key,label:e.label,href:e.href,image:e.image,desc:e.desc})}return l.map(e=>({...e,type:e.children.length?n:`link`}))}function Ht({brand:e,logo:t,brandHref:n,brandTarget:r,links:i=[],style:a,nodeRef:o,menu:s=`auto`,breakpoint:c=768,source:u=``,labelField:d=``,hrefField:f=``,imageField:p=``,descField:m=``,parentField:h=``,submenu:g=`dropdown`}){let[_,v]=(0,l.useState)(null),[y,b]=(0,l.useState)(!1),[x,S]=(0,l.useState)(!1),[C,w]=(0,l.useState)(null),{tenant:T,apiUrl:E}=(0,l.useContext)(ke),D=(0,l.useContext)(Ae)?.[u],[O,A]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!u||D)return;let e=!0;return fetch(`${E}/dynamic/${encodeURIComponent(u)}`,{headers:T?{"x-tenant":T}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&A(n)}).catch(()=>e&&A([])),()=>{e=!1}},[u,T,E,D]),(0,l.useEffect)(()=>{if(!_)return;let e=new ResizeObserver(()=>b(_.offsetWidth<c));return e.observe(_),()=>e.disconnect()},[_,c]);let j=u?Vt(D??O??[],{labelField:d,hrefField:f,imageField:p,descField:m,parentField:h},g):i,ee=s===`hamburger`||s===`auto`&&y,M=(e,t,n=!1)=>{let r=e.image?(0,B.jsx)(`img`,{src:e.image,alt:``,style:n?{width:`100%`,aspectRatio:`16 / 9`,objectFit:`cover`,borderRadius:6,display:`block`,marginBottom:8}:{width:22,height:22,objectFit:`cover`,borderRadius:4,display:`block`,flexShrink:0}}):null;return(0,B.jsxs)(`a`,{href:e.href||`#`,style:{...zt,display:n?`block`:`flex`,alignItems:n?void 0:`center`,gap:n?void 0:10,...t},children:[r,(0,B.jsxs)(`span`,{style:{display:`block`,minWidth:0},children:[e.label,e.desc&&(0,B.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]})]},e.key)};return(0,B.jsxs)(`nav`,{ref:e=>{v(e),o&&o(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...k(a)},children:[(t||e)&&(()=>{let i=(0,B.jsxs)(B.Fragment,{children:[t&&(0,B.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,B.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,B.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:a,children:i}):(0,B.jsx)(`div`,{style:a,children:i})})(),(0,B.jsx)(`div`,{style:{flexGrow:1}}),ee?(0,B.jsx)(`button`,{type:`button`,"aria-label":x?`Close menu`:`Open menu`,onClick:()=>S(!x),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:x?`✕`:`☰`}):(0,B.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:j.map(e=>{let t=e.children??[];if(!t.length)return(0,B.jsx)(`a`,{href:e.href||`#`,style:zt,children:e.label},e.key);let n=e.type===`mega`;return(0,B.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>w(e.key),onMouseLeave:()=>w(null),children:[(0,B.jsxs)(`a`,{href:e.href||`#`,style:{...zt,cursor:`pointer`},children:[e.label,` `,(0,B.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),C===e.key&&(n?(0,B.jsx)(`div`,{style:{...Bt,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=>M(e,{padding:8,borderRadius:8},!0))}):(0,B.jsx)(`div`,{style:{...Bt,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>M(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),ee&&x&&(0,B.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:j.map(e=>(0,B.jsxs)(l.Fragment,{children:[(0,B.jsx)(`a`,{href:e.href||`#`,style:{...zt,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>M(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function Ut({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,B.jsxs)(`div`,{ref:r,style:{width:`100%`,...k(n)},children:[(0,B.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,B.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,B.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function Wt({items:e=[],linked:t,multiple:n=!1,icon:r=``,padX:i,padY:a,headerBg:o,headerColor:s,openBg:c,openColor:u,borderColor:d,style:f,nodeRef:p}){let[m,h]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let g=(e,t)=>typeof e==`string`&&e?e:t,_=(e,t)=>{let n=Number(e);return e===``||e==null||!Number.isFinite(n)?t:n},v=Ft[r],y=e=>h(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...k(f)},children:e.map((n,r)=>{let l=m.has(n.key);return(0,B.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid ${g(d,`rgba(148, 163, 184, 0.35)`)}`:`none`},children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>y(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:l?g(c,g(o,`transparent`)):g(o,`transparent`),border:0,padding:`${_(a,14)}px ${_(i,4)}px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:l?g(u,g(s,`inherit`)):g(s,`inherit`),textAlign:`left`,cursor:`pointer`,transition:`background 180ms, color 180ms`},children:[(0,B.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:10,minWidth:0},children:[v?(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,width:16,height:16,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0},children:(0,B.jsx)(`path`,{d:v})}):null,n.title||`Item ${r+1}`]}),(0,B.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:l?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,B.jsx)(`div`,{style:{display:l?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var Gt={display:`flex`,flexDirection:`column`,gap:`12px`},Kt={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},qt={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)`},Jt={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},Yt=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function Xt(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 Zt={display:`flex`,flexDirection:`column`,gap:6},Qt={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 $t(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):[]}var en=`g-recaptcha-response`,tn=e=>e?.type===`recaptcha`?en:e?.name;function nn({field:e,value:t,onChange:n,inert:r,values:i}){let a=(0,B.jsxs)(`span`,{style:{...Kt,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:Qt,value:t??``,onChange:t=>n(e.name,t.target.value)};return e.type===`display`?(0,B.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,B.jsx)(`img`,{src:e.src,alt:e.label??``,style:{width:`100%`,borderRadius:8,display:`block`}}):null:e.type===`recaptcha`?(0,B.jsx)(cn,{theme:e.captchaTheme,size:e.captchaSize,inert:r,onChange:e=>n(en,e)}):e.type===`video`?e.src?/youtube\.com|youtu\.be|vimeo\.com/i.test(e.src)?(0,B.jsx)(ht,{url:e.src,style:{width:`100%`}}):(0,B.jsx)(`video`,{src:e.src,controls:!0,style:{width:`100%`,borderRadius:8,display:`block`}}):null:(0,B.jsxs)(`label`,{style:Zt,children:[a,e.type===`textarea`||e.multiline?(0,B.jsx)(`textarea`,{...o,rows:4,style:{...Qt,resize:`vertical`}}):e.type===`select`?(0,B.jsxs)(`select`,{...o,disabled:o.disabled||!!e.parentField&&!i?.[e.parentField],children:[(0,B.jsx)(`option`,{value:``,children:e.placeholder||`—`}),$t(e,i).map((e,t)=>(0,B.jsx)(`option`,{value:typeof e==`string`?e:e.value,children:typeof e==`string`?e:e.label??e.value},t))]}):e.type===`checkbox`?(0,B.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,B.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,B.jsx)(`input`,{...o,type:{email:`email`,number:`number`,date:`date`,datetime:`datetime-local`,phone:`tel`,link:`url`}[e.type]??`text`}),e.help&&(0,B.jsx)(`span`,{style:{fontSize:12,opacity:.65},children:e.help})]})}function rn({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)(ke),[g,_]=(0,l.useState)(`form`),[v,y]=(0,l.useState)(null),[b,x]=(0,l.useState)({}),[S,C]=(0,l.useState)(0),w=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 T=[{section:null,fields:[]}];for(let e of Array.isArray(v?.fields)?v.fields:[])e.type===`section`?T.push({section:e,fields:[]}):T[T.length-1].fields.push(e);let E=T.filter(e=>e.section||e.fields.length),D=E.filter(e=>!e.section||Xt(e.section.condition,b)).map(e=>({...e,fields:e.fields.filter(e=>Xt(e.condition,b))})),O=E.length>1,A=Math.min(S,Math.max(0,D.length-1)),j=O?D[A]?.fields??[]:D.flatMap(e=>e.fields),ee=j.filter(e=>{let t=b[tn(e)];return e.required&&(t==null||t===``||t===!1)}),M=A>=D.length-1,N=(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,B.jsxs)(`div`,{ref:c,style:k(e),children:[(0,B.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:{...Gt,display:w===`success`?`none`:`flex`},children:o&&a?(0,B.jsxs)(B.Fragment,{children:[O&&(0,B.jsx)(Mn,{steps:D.map(e=>({label:e.section?.label??`Start`})),active:A+1,style:{marginBottom:8}}),O&&D[A]?.section?.help&&(0,B.jsx)(`p`,{style:{margin:0,fontSize:14,opacity:.7},children:D[A].section.help}),j.map(e=>(0,B.jsx)(nn,{field:e,value:b[tn(e)],values:b,onChange:N,inert:u},e.name)),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`,marginTop:4},children:[O&&A>0&&(0,B.jsx)(`button`,{type:`button`,disabled:u||void 0,onClick:()=>C(A-1),style:{...He,background:`transparent`,color:`inherit`,border:0,padding:`10px 16px`,cursor:`pointer`},children:`Back`}),O&&!M?(0,B.jsx)(`button`,{type:`button`,disabled:u||ee.length>0,onClick:()=>C(A+1),style:{...He,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:ee.length?.5:1},children:`Next`}):(0,B.jsx)(`button`,{type:`submit`,disabled:u||void 0,style:{...He,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`},children:s||`Submit`})]})]}):d}),(0,B.jsx)(`div`,{style:{display:w===`success`?`block`:`none`},children:f?.success??null}),(0,B.jsx)(`div`,{style:{display:w===`error`?`block`:`none`,marginTop:12},children:f?.error??null})]})}var an=null,on=null,sn=e=>{let t=typeof e==`string`&&e.trim()?e.trim():``;if(an&&on===t)return an;if(an&&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 on=t,an=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)}),an};function cn({siteKey:e,theme:t,size:n,hl:r,style:i,nodeRef:a,inert:o,onChange:s}){let c=(0,l.useContext)(ke),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 sn(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,B.jsxs)(`div`,{ref:a,style:k(i),children:[(0,B.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,B.jsx)(`span`,{style:{width:24,height:24,flexShrink:0,borderRadius:3,border:`2px solid ${e?`#8a8f94`:`#c1c1c1`}`,background:e?`#2f3337`:`#fff`}}),(0,B.jsx)(`span`,{style:{flexGrow:1},children:`I'm not a robot`}),(0,B.jsx)(`span`,{style:{fontSize:9,opacity:.6,textAlign:`center`,lineHeight:1.3},children:`reCAPTCHA`})]}),!d&&(0,B.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,B.jsx)(`div`,{ref:a,style:k(i),children:(0,B.jsx)(`div`,{ref:f})}):null}function ln({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,B.jsx)(`label`,{ref:r,style:{...Kt,...k(n)},children:$e(t,e,i)})}function un({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,B.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...qt,...k(i)},...Yt(o)})}function dn({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,B.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...qt,resize:`vertical`,...k(i)},...Yt(o)})}function fn({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,B.jsxs)(`label`,{ref:o,style:{...Jt,...k(a)},children:[(0,B.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 pn({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,B.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:{...qt,appearance:`auto`,...k(i)},children:[t!==``&&(0,B.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,B.jsx)(`option`,{value:e,children:e},t))]})}function mn({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,B.jsxs)(`label`,{ref:a,style:{...qt,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...k(i)},children:[(0,B.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,B.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function hn({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,B.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...He,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...k(t)},children:e})}function gn({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,B.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...k(n)},children:Array.from({length:a},(e,t)=>(0,B.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function _n({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)(ke),_=(0,l.useContext)(Pe),v=(0,l.useContext)(Ae),[,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=Ne(d),x=JSON.stringify(b),S=x!==`{}`&&!e?.startsWith?.(`api:`),C=S?null:v?.[e],w=u?je(v):1,[T,E]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||C)return;let n=!0,r=new URLSearchParams;if(g&&r.set(`locale`,g),S&&r.set(`data_filter`,x),u&&!e.startsWith(`api:`)){let e=Math.max(1,Number(t)||6);r.set(`offset`,String((w-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&&E(t.filter(e=>e&&typeof e==`object`))}).catch(()=>n&&E([])),()=>{n=!1}},[e,m,h,g,C,u,w,t,S,x]),!e)return null;let D=Math.max(1,Number(t)||6),O=u?C||e.startsWith(`api:`)?(C??T??[]).slice((w-1)*D,w*D):(T??[]).slice(0,D):(C??T??[]).slice(0,D),A=Math.min(Math.max(Number(r)||3,1),6),j=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${A}, minmax(0, 1fr))`,gap:24};return s&&c&&_?.render?(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...j,...k(f)},children:O.map(e=>(0,B.jsx)(`div`,{style:{minWidth:0},children:_.render(c,t=>ze(t,e))},e.id??e?.data?.slug))}):(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...j,...k(f)},children:O.map(e=>{let t=i?Ie(e?.data,i):null,r=a?Re(Ie(e?.data,a)):null,s=o?Ie(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:Re(s),u=n===`list`;return(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,B.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,B.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,B.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,B.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:rt(c)})]})]},e.id??e?.data?.slug)})})}function vn({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?{}:Me(),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,B.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%`,...k(n)},children:[a.map(e=>Array.isArray(e.options)&&e.options.length>0||e.type===`option`||e.type===`select`?(0,B.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...Yt(i),children:[(0,B.jsx)(`option`,{value:``,children:e.label||e.name}),(Array.isArray(e.options)?e.options:[]).map(e=>{let t=c(e);return(0,B.jsx)(`option`,{value:t.value,children:t.label},t.value)})]},e.name):e.type===`switch`?(0,B.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...Yt(i),children:[(0,B.jsx)(`option`,{value:``,children:e.label||e.name}),(0,B.jsx)(`option`,{value:`true`,children:`Yes`}),(0,B.jsx)(`option`,{value:`false`,children:`No`})]},e.name):(0,B.jsx)(`input`,{type:`text`,name:`f_${e.name}`,defaultValue:o[e.name]??``,placeholder:e.label||e.name,style:s,...Yt(i)},e.name)),(0,B.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`},...Yt(i),children:t})]})}function yn({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,B.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...k(n)},children:(0,B.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,B.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,B.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,B.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,B.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function bn({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)(ke),m=(0,l.useContext)(Ae),[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?je(m):Number(t)||1,1),b),S=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)):`#`},C=o===`center`?`center`:o===`right`?`flex-end`:`flex-start`,w=c?e=>e.preventDefault():void 0,T=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,B.jsxs)(`nav`,{ref:d,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,justifyContent:C,...k(u)},children:[n&&(0,B.jsx)(`a`,{href:x>1?S(x-1):`#`,onClick:w,"aria-label":`Previous`,style:{...T(!1),opacity:x>1?1:.4},children:`‹`}),Array.from({length:b},(e,t)=>t+1).map(e=>(0,B.jsx)(`a`,{href:S(e),onClick:w,"aria-current":e===x?`page`:void 0,style:T(e===x),children:e},e)),n&&(0,B.jsx)(`a`,{href:x<b?S(x+1):`#`,onClick:w,"aria-label":`Next`,style:{...T(!1),opacity:x<b?1:.4},children:`›`})]})}var xn=`webim.page_mode`,Sn=()=>{if(typeof window>`u`)return`auto`;try{let e=window.localStorage.getItem(xn);return e===`light`||e===`dark`?e:`auto`}catch{return`auto`}},Cn=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,B.jsxs)(`svg`,{...t,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,B.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,B.jsx)(`svg`,{...t,children:(0,B.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})}):(0,B.jsxs)(`svg`,{...t,children:[(0,B.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`}),(0,B.jsx)(`path`,{d:`M8 21h8M12 17v4`})]})},wn={light:`Light theme`,dark:`Dark theme`,auto:`Follow the device theme`};function Tn({variant:e,showSystem:t,style:n,nodeRef:r,inert:i}){let[a,o]=(0,l.useState)(i?`auto`:Sn),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(xn):window.localStorage.setItem(xn,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,B.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)`,...k(n)},children:u.map(e=>(0,B.jsx)(`button`,{type:`button`,title:wn[e],"aria-label":wn[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:Cn(e)},e))});let p=u[(u.indexOf(d)+1)%u.length];return(0,B.jsx)(`button`,{ref:c,type:`button`,title:wn[d],"aria-label":`Theme: ${wn[d]} — switch to ${wn[p]}`,onClick:i?void 0:()=>o(p),style:{...f,width:36,height:36,border:`1px solid rgba(148, 163, 184, 0.4)`,...k(n)},children:Cn(d)})}function En(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 Dn=e=>e===window?window.scrollY:e.scrollTop,On={"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 kn({variant:e,label:t,position:n,offset:r,showAfter:i,smooth:a,bg:o,fg:s,style:c,nodeRef:u,inert:d,frame:f,builder:p}){let[m,h]=(0,l.useState)(!!d),[g,_]=(0,l.useState)(null),v=e=>{_(e),typeof u==`function`&&u(e)};(0,l.useEffect)(()=>{if(d){h(!0);return}if(!g)return;let e=Number(i)>=0?Number(i):300,t=()=>{let t=En(g),n=p&&!(t===window?document.documentElement.scrollHeight>window.innerHeight:t.scrollHeight>t.clientHeight);h(n||Dn(t)>e)};return t(),document.addEventListener(`scroll`,t,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,t,{capture:!0})},[d,g,i,p]);let y=()=>{if(d)return;let e=En(g),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})},b=Number(r)>=0?Number(r):24,x=e===`pill`,S=t||`Top`,C=On[n]?n:`bottom-right`,w=f?{position:`fixed`,zIndex:5,bottom:(f.bottom??0)+b,...C===`bottom-left`?{left:(f.left??0)+b}:null,...C===`bottom-right`?{right:(f.right??0)+b}:null,...C===`bottom-center`?{left:(f.left??0)+(f.width??0)/2,transform:`translateX(-50%)`}:null}:{position:`fixed`,zIndex:2147482e3,...On[C](b)};return(0,B.jsxs)(`button`,{ref:v,type:`button`,title:S,"aria-label":S,"aria-hidden":!m,tabIndex:m?0:-1,onClick:y,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:x?8:0,appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,width:x?`auto`:44,height:44,padding:x?`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:+!!m,pointerEvents:m?`auto`:`none`,transition:`opacity 160ms ease, transform 160ms ease`,...w,...k(c),...w.transform?{transform:w.transform}:null},children:[(0,B.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M12 19V5M12 5l-7 7M12 5l7 7`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),x?(0,B.jsx)(`span`,{children:S}):null]})}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 jn({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,B.jsx)(`div`,{ref:s,style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:f,...k(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,B.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,B.jsx)(`svg`,{width:u,height:u,viewBox:`0 0 24 24`,fill:s,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:i.d})})},`${e.network}-${r}`)})})}function Mn({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,B.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...k(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,B.jsxs)(l.Fragment,{children:[t>0&&(0,B.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,B.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[(0,B.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,B.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}var Nn={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=>Nn[e]??Nn.medium;Nn.medium.w,Nn.medium.h;var Fn=e=>String(e?.group??``).trim(),In=e=>{let t=[],n=new Map;return e.forEach((e,r)=>{let i=Fn(e)||`#${r}`;n.has(i)||(n.set(i,[]),t.push(i)),n.get(i).push(e)}),t.flatMap(e=>n.get(e))};function Ln(e,{size:t=`medium`,horizontal:n=!1,groupTitles:r=`top`}={}){let i=Pn(t),a=n?i.h:i.w,o=n?16:20,s=(n?i.w:i.h)+(n?56:48),c=Array.isArray(e)?e.filter(e=>e&&e.id):[],l=new Set(c.map(e=>e.id)),u=new Map,d=[];for(let e of c)e.parent&&l.has(e.parent)&&e.parent!==e.id?(u.has(e.parent)||u.set(e.parent,[]),u.get(e.parent).push(e)):d.push(e);d=In(d);for(let[e,t]of u)u.set(e,In(t));let f=(e,t)=>o+(Fn(e)!==Fn(t)&&(Fn(e)||Fn(t))?24:0),p=new Map,m=(e,t)=>{if(t.has(e.id))return 0;t.add(e.id);let n=u.get(e.id)??[],r=n.reduce((e,r,i)=>e+m(r,t)+(i?f(n[i-1],r):0),0),i=Math.max(a,r);return p.set(e.id,i),i};d.forEach(e=>m(e,new Set));let h=[],g=[],_=new Map,v=0,y=(e,t,r,o)=>{if(o.has(e.id))return;o.add(e.id);let c=t+((p.get(e.id)??a)-a)/2,d=r*s,m=n?d:c,b=n?c:d;h.push({node:e,x:m,y:b});let x=Fn(e);if(x){let t=`${e.parent&&l.has(e.parent)&&e.parent!==e.id?e.parent:``}|${x}`;_.has(t)||_.set(t,{title:x,color:``,members:[]});let n=_.get(t);!n.color&&e.groupColor&&(n.color=e.groupColor),n.members.push({x:m,y:b})}v=Math.max(v,d+(n?i.w:i.h));let S=t,C=u.get(e.id)??[];C.forEach((e,t)=>{t&&(S+=f(C[t-1],e));let l=S+((p.get(e.id)??a)-a)/2+a/2,u=(r+1)*s;g.push(n?{from:{x:d+i.w,y:c+i.h/2},to:{x:u,y:l}}:{from:{x:c+i.w/2,y:d+i.h},to:{x:l,y:u}}),y(e,S,r+1,o),S+=p.get(e.id)??a})},b=0,x=new Set;d.forEach((e,t)=>{t&&(b+=f(d[t-1],e)),y(e,b,0,x),b+=p.get(e.id)??a});let S=Math.max(b,a),C=r===`hidden`?0:22,w=[..._.values()].map(e=>{let t=Math.min(...e.members.map(e=>e.x))-12,n=Math.max(...e.members.map(e=>e.x))+i.w+12,a=Math.min(...e.members.map(e=>e.y))-12-(r===`bottom`?0:C),o=Math.max(...e.members.map(e=>e.y))+i.h+12+(r===`bottom`?C:0);return{x:t,y:a,width:n-t,height:o-a,title:e.title,color:e.color}}),T=n?Math.max(v,i.w):S,E=n?S:Math.max(v,i.h),D=Math.max(0,...w.map(e=>-e.x)),O=Math.max(0,...w.map(e=>-e.y));if(w.length&&(T=Math.max(T,...w.map(e=>e.x+e.width))+D,E=Math.max(E,...w.map(e=>e.y+e.height))+O,D||O)){for(let e of h)e.x+=D,e.y+=O;for(let e of g)e.from={x:e.from.x+D,y:e.from.y+O},e.to={x:e.to.x+D,y:e.to.y+O};for(let e of w)e.x+=D,e.y+=O}return{boxes:h,links:g,groups:w,width:T,height:E,horizontal:n}}var Rn=(e,t)=>{let n=String(e??``);return n.length>t?`${n.slice(0,t-1)}…`:n},zn=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`},Bn=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?``:Re(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]):``,group:t.groupField?i(n[t.groupField]):``}})}var Hn={size:36,pad:10};function Un({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,B.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,B.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,B.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,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:e.cv?14:0},children:[e.photo&&(0,B.jsx)(`img`,{src:e.photo,alt:``,style:{width:72,height:72,borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[(0,B.jsx)(`div`,{style:{fontSize:18,fontWeight:700},children:e.name}),e.title&&(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.65},children:e.title})]})]}),e.cv&&String(e.cv).split(/\n+/).map((e,t)=>(0,B.jsx)(`p`,{style:{fontSize:14,lineHeight:1.6,margin:`0 0 10px`},children:e},t)),e.href&&(0,B.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 Wn({nodes:e=[],source:t,nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,groupField:c,groupTitles:u=`top`,groupBg:d=``,size:f=`medium`,horizontal:p=!1,style:m,nodeRef:h,interactive:g=!0}){let _=(0,l.useId)(),[v,y]=(0,l.useState)(null),{tenant:b,apiUrl:x}=(0,l.useContext)(ke),S=(0,l.useContext)(Ae)?.[t],[C,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!t||S)return;let e=!0;return fetch(`${x}/dynamic/${encodeURIComponent(t)}`,{headers:b?{"x-tenant":b}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&w(n)}).catch(()=>e&&w([])),()=>{e=!1}},[t,b,x,S]);let T=t?Vn(S??C??[],{nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,groupField:c}):e,E=Pn(f),{boxes:D,links:O,groups:A,width:j,height:ee}=Ln(T,{size:f,horizontal:p,groupTitles:u});if(!D.length)return!g&&t?(0,B.jsxs)(`div`,{ref:h,style:{padding:18,border:`1px dashed rgba(148, 163, 184, 0.6)`,borderRadius:10,fontSize:13,opacity:.7,textAlign:`center`,...k(m)},children:[`Org Chart — no published entries in “`,t,`” yet`]}):null;let M=new Set(D.filter(e=>e.node.parent==null||e.node.parent===``).map(e=>e.node.id));return(0,B.jsxs)(`div`,{ref:h,style:{maxWidth:`100%`,overflowX:`auto`,...k(m)},children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 ${j} ${ee}`,role:`img`,"aria-label":`Organization chart`,style:{display:`block`,width:`100%`,maxWidth:j,height:`auto`,margin:`0 auto`},children:[A.map((e,t)=>{let n=e.color||d||`rgba(148, 163, 184, 0.16)`,r=!!(e.color||d);return(0,B.jsxs)(`g`,{children:[(0,B.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:`16`,fill:n}),u!==`hidden`&&e.title&&(0,B.jsx)(`text`,{x:e.x+e.width/2,y:u===`bottom`?e.y+e.height-22*.42:e.y+22*.78,textAnchor:`middle`,fontSize:E.title+1,fontWeight:`600`,opacity:`0.55`,fill:r?zn(e.color||d):`var(--page-text, #111827)`,children:Rn(e.title,Math.floor(e.width/7))})]},`group-${t}`)}),O.map((e,t)=>(0,B.jsx)(`path`,{d:p?`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)),D.map(({node:e,x:t,y:n})=>{let r=M.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?zn(e.color):r?`var(--page-accent-text, #ffffff)`:`var(--page-text, #111827)`,c=i?zn(e.color2):s,l=g&&(Bn(e)||e.href),u=()=>Bn(e)?y(e):window.open(e.href,`_blank`,`noreferrer`),d=e.photo?t+Hn.pad+E.avatar+8:t+E.w/2,f=e.photo?`start`:`middle`,p=e.photo?Math.floor((E.w-E.avatar-26)/7):Math.floor(E.w/7.6),m=E.h/2,h=[e.name,e.title].map(e=>String(e??``).trim()).filter(Boolean);return(0,B.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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`linearGradient`,{id:`${_}-${e.id}-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,B.jsx)(`stop`,{offset:`0%`,stopColor:e.color||`var(--page-accent, #4f46e5)`}),(0,B.jsx)(`stop`,{offset:`100%`,stopColor:e.color2})]}),(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`,fill:`url(#${_}-${e.id}-grad)`})]}):i?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`clipPath`,{id:`${_}-${e.id}-box`,children:(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`})}),(0,B.jsxs)(`g`,{clipPath:`url(#${_}-${e.id}-box)`,children:[(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:m,fill:o}),(0,B.jsx)(`rect`,{x:t,y:n+m,width:E.w,height:E.h-m,fill:e.color2})]})]}):(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`,fill:o,stroke:a?`none`:`var(--page-accent, #4f46e5)`,strokeWidth:a?0:1.5}),e.photo&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`clipPath`,{id:`${_}-${e.id}`,children:(0,B.jsx)(`circle`,{cx:t+Hn.pad+E.avatar/2,cy:n+E.h/2,r:E.avatar/2})}),(0,B.jsx)(`image`,{href:e.photo,x:t+Hn.pad,y:n+(E.h-E.avatar)/2,width:E.avatar,height:E.avatar,preserveAspectRatio:`xMidYMid slice`,clipPath:`url(#${_}-${e.id})`})]}),i&&!e.gradient?(0,B.jsxs)(B.Fragment,{children:[e.title&&(0,B.jsx)(`text`,{x:d,y:n+m/2+E.title*.35,textAnchor:f,fontSize:E.title,fontWeight:`600`,fill:s,children:Rn(e.title,p+4)}),e.name&&(0,B.jsx)(`text`,{x:d,y:n+m+m/2+E.name*.35,textAnchor:f,fontSize:E.name,fontWeight:`600`,fill:c,children:Rn(e.name,p)})]}):(0,B.jsxs)(B.Fragment,{children:[h[0]&&(0,B.jsx)(`text`,{x:d,y:n+(h[1]?E.h*.43:E.h*.57),textAnchor:f,fontSize:E.name,fontWeight:`600`,fill:s,children:Rn(h[0],p)}),h[1]&&(0,B.jsx)(`text`,{x:d,y:n+E.h*.73,textAnchor:f,fontSize:E.title,opacity:`0.7`,fill:s,children:Rn(h[1],p+4)})]})]},e.id)})]}),v&&(0,B.jsx)(Un,{node:v,onClose:()=>y(null)})]})}function Gn({value:e,onCommit:t,style:n,hint:r}){let[i,a]=(0,l.useState)(!1),o=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!i||!o.current)return;let e=o.current,t=document.createRange();e.focus(),t.selectNodeContents(e),t.collapse(!1);let n=window.getSelection();n.removeAllRanges(),n.addRange(t)},[i]),(0,B.jsx)(`span`,{ref:o,contentEditable:i,suppressContentEditableWarning:!0,title:i?void 0:r||`Double-click to edit`,onDoubleClick:()=>a(!0),onBlur:i?e=>{a(!1),t(e.currentTarget.textContent)}:void 0,onKeyDown:i?t=>{t.stopPropagation(),t.key===`Escape`&&(t.currentTarget.textContent=e??``,t.currentTarget.blur()),t.key===`Enter`&&(t.preventDefault(),t.currentTarget.blur())}:void 0,style:{display:`block`,minHeight:`1em`,outline:`none`,cursor:i?`text`:`inherit`,...n},children:e??``})}var Kn=360,qn=`
15
+ `)}var de=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,fe={fontFamily:de,fontStyle:`normal`,fontWeight:400,letterSpacing:`normal`,textTransform:`none`,lineHeight:1.4,textShadow:`none`},pe={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`}}},me={font:`system`,headingFont:`inherit`,light:pe.light,dark:pe.dark},he={system:{label:`System`,value:de},inter:{label:`Inter`,value:`"Inter", ${de}`},outfit:{label:`Outfit`,value:`"Outfit", ${de}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},ge=(e,t)=>he[e]?.value??_(e)??(typeof e==`string`&&e.trim()?`"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`:t),_e=(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 ve(e){let{light:t,dark:n,font:r,headingFont:i,...a}=e??{};return{font:r??me.font,headingFont:i??me.headingFont,light:_e(pe.light,a,t),dark:_e(pe.dark,n)}}function ye(e){return{"--page-bg":e.background,"--page-surface":e.surface??e.background,"--page-border":e.border??pe.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 be(e){let t=ve(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:ge(t.font,de),"--page-heading-font":t.headingFont===`inherit`?`inherit`:ge(t.headingFont,`inherit`)}}function xe(e,t=`light`){let n=ve(e);return{...be(e),...ye(n[t]??n.light)}}function Se(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function Ce(e,t){return e===`light`||e===`dark`?e:t===`light`||t===`dark`?t:`auto`}function we({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:Se(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,animations:o.animations,seo:o.seo,direction:o.direction,scheme:o.scheme,locale:i||a.locales?.default,locales:a.locales,tenant:n??``,apiUrl:r??``,settings:a}}var Te=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 R({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(Te),c(`${l}/settings/public`,{headers:u}).then(Te)]),p=we({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:[`TableBlock`,`OrgChartBlock`,`NavbarBlock`,`CalendarBlock`,`MasonryBlock`,`LogoCarousel`].includes(e?.type?.resolvedName)?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(Te).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 z=new Set([`ar`,`he`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`]),Ee=e=>z.has(String(e||``).toLowerCase().split(/[-_]/)[0])?`rtl`:`ltr`,De=(e,t)=>e===`ltr`||e===`rtl`?e:t?Ee(t):void 0,Oe=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})),B=e(((e,t)=>{t.exports=Oe()}))(),ke=(0,l.createContext)({tenant:``,apiUrl:`/api`,locale:``,settings:null}),Ae=(0,l.createContext)(null),je=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},Me=()=>{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},Ne=e=>{let t={...e&&typeof e==`object`&&!Array.isArray(e)?e:{},...Me()};return Object.fromEntries(Object.entries(t).filter(([,e])=>typeof e==`string`&&e.trim()!==``))},Pe=(0,l.createContext)(null),Fe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Ie(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Le=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 Re(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 ze(e,t){let n=t?.data??{},r=Le(n);if(!r.length)return e;let i=RegExp(`:(${r.map(Fe).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>Re(Ie(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 Be={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},Ve={margin:0},He={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},Ue={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},We={display:`flex`,flexDirection:`column`};function Ge({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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,B.jsx)(`div`,{style:{...n,background:r}})]})}var Ke=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...k(e)}:{...t,...k(e)};function qe({style:e,nodeRef:t,children:n}){return(0,B.jsxs)(`div`,{ref:t,style:{...Ue,...k(e)},children:[(0,B.jsx)(Ge,{style:e}),n]})}function Je({style:e,nodeRef:t,children:n}){return(0,B.jsxs)(`section`,{ref:t,style:Ke(e,We),children:[(0,B.jsx)(Ge,{style:e}),n]})}function Ye({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,B.jsxs)(`div`,{ref:n,style:i?{...i,...Ke(e)}:Ke(e),children:[(0,B.jsx)(Ge,{style:e}),r]})}function Xe({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,B.jsx)(n,{ref:a,style:{...Be,...k(r)},children:$e(t,e,i)})}var Ze={fontFamily:he.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function Qe(e,t=[],n,r){let i=e;return t.includes(`sup`)?i=(0,B.jsx)(`sup`,{children:i}):t.includes(`sub`)&&(i=(0,B.jsx)(`sub`,{children:i})),t.includes(`code`)&&(i=(0,B.jsx)(`code`,{style:Ze,children:i})),t.includes(`strike`)&&(i=(0,B.jsx)(`s`,{children:i})),t.includes(`underline`)&&(i=(0,B.jsx)(`u`,{children:i})),t.includes(`italic`)&&(i=(0,B.jsx)(`em`,{children:i})),t.includes(`bold`)&&(i=(0,B.jsx)(`strong`,{children:i})),n?i=(0,B.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{color:`inherit`,...t.includes(`nounderline`)&&{textDecoration:`none`}},children:i}):t.includes(`nounderline`)&&(i=(0,B.jsx)(`span`,{style:{textDecoration:`none`},children:i})),i}function $e(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,B.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,B.jsx)(l.Fragment,{children:$e(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,B.jsx)(`sup`,{children:r}):e.sub&&(r=(0,B.jsx)(`sub`,{children:r})),e.code&&(r=(0,B.jsx)(`code`,{style:Ze,children:r})),e.strike&&(r=(0,B.jsx)(`s`,{children:r})),e.underline&&(r=(0,B.jsx)(`u`,{children:r})),e.italic&&(r=(0,B.jsx)(`em`,{children:r})),e.bold&&(r=(0,B.jsx)(`strong`,{children:r})),(e.color||e.background)&&(r=(0,B.jsx)(`span`,{style:{...e.color&&{color:e.color},...e.background&&{backgroundColor:e.background}},children:r})),e.href?r=(0,B.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{color:e.color??`inherit`,...e.nounderline&&{textDecoration:`none`}},children:r}):e.nounderline&&(r=(0,B.jsx)(`span`,{style:{textDecoration:`none`},children:r})),(0,B.jsx)(l.Fragment,{children:r},t)}):t}function et({parts:e,text:t,marks:n,href:r,target:i,style:a}){return(0,B.jsx)(`span`,{style:k(a),children:e?.length?$e(e,t):Qe(t,n,r,i)})}var tt={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16},nt=[`left`,`center`,`right`,`justify`];function rt(e,t,n){let r=e&&e.cellStyles;if(!r||typeof r!=`object`||Array.isArray(r))return{};let i=r[`${t}:${n}`];return i&&typeof i==`object`&&!Array.isArray(i)?i:{}}function it(e,t){let n=e||{},r=typeof n.bold==`boolean`?n.bold:!!t;return{textAlign:nt.includes(n.align)?n.align:`left`,fontWeight:r?700:400,fontStyle:n.italic?`italic`:void 0,color:typeof n.color==`string`&&n.color?n.color:void 0,backgroundColor:typeof n.bg==`string`&&n.bg?n.bg:void 0}}function at({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 ot(e=[],t,n){let r=n??((e,n)=>$e(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,B.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,B.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...at(t)},children:[t.href?(0,B.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,B.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return _t(t.url)?(0,B.jsx)(`div`,{style:{...i,...at({align:t.align,wrap:t.wrap,width:t.width??100})},children:(0,B.jsx)(vt,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`button`){if(!(typeof t.label==`string`&&t.label.trim()))return null;let e=Number.isFinite(Number(t.radius))?Number(t.radius):8,r=[`center`,`right`].includes(t.align)?t.align:`left`;return(0,B.jsx)(`div`,{style:{...i,textAlign:r},children:(0,B.jsx)(`table`,{role:`presentation`,cellPadding:0,cellSpacing:0,style:{borderCollapse:`separate`,display:`inline-table`},children:(0,B.jsx)(`tbody`,{children:(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{style:{backgroundColor:t.bg||`var(--page-accent, #4f46e5)`,borderRadius:e},children:(0,B.jsx)(`a`,{href:t.href||`#`,target:t.target||void 0,rel:t.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`inline-block`,padding:`13px 24px`,color:t.color||`#ffffff`,fontSize:15,fontWeight:600,lineHeight:1.2,textDecoration:`none`,borderRadius:e},children:t.label})})})})})},n)}if(t.type===`divider`)return(0,B.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`,verticalAlign:`top`},o=r?e.slice(1):e,s=Array.isArray(t.widths)?t.widths:null,c=(e,n,r)=>({...a,...it(rt(t,e,n),r)});return(0,B.jsxs)(`table`,{style:{...i,borderCollapse:`collapse`,width:`100%`,fontSize:`inherit`,tableLayout:s?`fixed`:void 0},children:[s&&(0,B.jsx)(`colgroup`,{children:s.map((e,t)=>(0,B.jsx)(`col`,{style:{width:`${e}%`}},t))}),r&&(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:e[0].map((e,t)=>(0,B.jsx)(`th`,{style:c(0,t,!0),children:e},t))})}),(0,B.jsx)(`tbody`,{children:o.map((e,t)=>(0,B.jsx)(`tr`,{children:e.map((e,n)=>(0,B.jsx)(`td`,{style:c(r?t+1:t,n,!1),children:e},n))},t))})]},n)}if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,B.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,B.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,B.jsx)(`blockquote`,{style:{...ct,...i},children:r(t.parts,t.text)},n);if(tt[t.type]){let e=t.type;return(0,B.jsx)(e,{style:{...Be,fontSize:tt[t.type],...i},children:r(t.parts,t.text)},n)}return(0,B.jsx)(`p`,{style:{...Ve,...i},children:r(t.parts,t.text)},n)})}function st({content:e,style:t,linked:n,nodeRef:r}){return(0,B.jsx)(`div`,{ref:r,style:{display:`flow-root`,...k(t)},children:ot(e,n)})}var ct={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function lt({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,B.jsx)(`blockquote`,{ref:i,style:{...ct,...k(n)},children:$e(t,e,r)})}function ut({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,B.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...k(n)},children:t.map((e,t)=>(0,B.jsx)(`li`,{style:{marginBottom:4},children:$e(e.parts,e.text)},t))})}function dt({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,B.jsx)(`p`,{ref:i,style:{...Ve,...k(n)},children:$e(t,e,r)})}var ft={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function pt({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,B.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...ft,...k(i)},children:$e(t,e,a)})}function mt({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,B.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...He,...k(i)},children:$e(t,e,a)})}function ht({src:e,alt:t,style:n,nodeRef:r}){return e?(0,B.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...k(n)}}):null}function gt({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,B.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%`,...k(o)}}):null}var _t=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function vt({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=_t(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,B.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...k(o)},children:(0,B.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 yt({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,B.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...k(r)}}):null}function bt({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,B.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:k(n)})}function xt({height:e,nodeRef:t}){return(0,B.jsx)(`div`,{ref:t,style:{height:e||32,flexShrink:0,alignSelf:`stretch`}})}function St({style:e,nodeRef:t}){return(0,B.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...k(e)}})}var Ct={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},wt={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)`}},Tt=48;function Et({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>Tt&&g(h-1)};return(0,B.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,...k(o)},children:[(0,B.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,B.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...Ct,left:12},onClick:()=>g(h-1),children:`‹`}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...Ct,right:12},onClick:()=>g(h+1),children:`›`}),(0,B.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,B.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 Dt=(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 Ot({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,B.jsx)(Et,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:Dt(i.image)}),(i.title||i.text)&&(0,B.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...wt[t]??wt.bottom},children:[i.title&&(0,B.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,B.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function kt({slides:e=[],linked:t,...n}){return e.length?(0,B.jsx)(Et,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:Dt(r.image,r.color)}),(0,B.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}var At=256,jt=e=>Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,e))*Math.PI/360)),Mt=(e,t,n)=>{let r=At*2**n;return{x:(Number(t)+180)/360*r,y:(.5-jt(Number(e))/(2*Math.PI))*r}},Nt=(e,t)=>{if(e===``||e==null)return null;let n=Number(e);return Number.isFinite(n)&&Math.abs(n)<=t?n:null},Pt=e=>!!e&&Nt(e.lat,90)!==null&&Nt(e.lng,180)!==null;function Ft(e,t,n=`directions`,r=``){let i=`${e},${t}`;return n===`place`?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r?`&query_place_id=`:``}`:`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`}var It=(e,t,n=13)=>`https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n)||13)}/${e}/${t}`;function Lt({markers:e,lat:t,lng:n,zoom:r=``,height:i=320,pinSize:a=22,pinLink:o=`directions`,link:s=!1,label:c=``,style:u,nodeRef:d,inert:f}){let p=(0,l.useRef)(null),[m,h]=(0,l.useState)(1200);(0,l.useEffect)(()=>{let e=p.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>h(t=>e.clientWidth&&e.clientWidth!==t?e.clientWidth:t);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let g=(Array.isArray(e)?e:[]).filter(Pt),_=Pt({lat:t,lng:n})?{lat:Nt(t,90),lng:Nt(n,180)}:g.length?{lat:g.reduce((e,t)=>e+Nt(t.lat,90),0)/g.length,lng:g.reduce((e,t)=>e+Nt(t.lng,180),0)/g.length}:null,v=Math.max(80,Number(i)||320),y=Nt(r,19)?Math.min(Math.max(Math.round(Number(r)),1),19):(()=>{if(g.length<2)return 13;for(let e=19;e>=1;e--){let t=g.map(t=>Mt(Nt(t.lat,90),Nt(t.lng,180),e)),n=Math.max(...t.map(e=>e.x))-Math.min(...t.map(e=>e.x)),r=Math.max(...t.map(e=>e.y))-Math.min(...t.map(e=>e.y));if(n<=m*.8&&r<=v*.7)return e}return 1})(),b={width:`100%`,...k(u)};if(!_)return(0,B.jsx)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:{...b,minHeight:80,display:`grid`,placeItems:`center`,fontSize:13,opacity:.6,border:`1px dashed var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:8},children:`Set the coordinates in Settings`});let x=Mt(_.lat,_.lng,y),S={x:x.x-m/2,y:x.y-v/2},C=[],w=[];for(let e=Math.floor(S.x/At);e<=Math.floor((S.x+m)/At);e++)C.push(e);for(let e=Math.floor(S.y/At);e<=Math.floor((S.y+v)/At);e++)w.push(e);let T=2**y;return(0,B.jsxs)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:b,children:[(0,B.jsxs)(`div`,{role:`img`,"aria-label":c||`Map`,style:{position:`relative`,height:v,overflow:`hidden`,borderRadius:`inherit`,background:`var(--page-surface, #e5e7eb)`},children:[w.map(e=>C.map(t=>{let n=(t%T+T)%T;return e<0||e>=T?null:(0,B.jsx)(`img`,{src:`https://tile.openstreetmap.org/${y}/${n}/${e}.png`,alt:``,width:At,height:At,loading:`lazy`,style:{position:`absolute`,left:Math.round(t*At-S.x),top:Math.round(e*At-S.y),width:At,height:At,userSelect:`none`,pointerEvents:`none`}},`${t}-${e}`)})),g.map((e,t)=>{let n=Mt(Nt(e.lat,90),Nt(e.lng,180),y),r=n.x-S.x,i=n.y-S.y,s=e.color||`var(--page-accent, #dc2626)`,c=o===`none`||f?null:Ft(Nt(e.lat,90),Nt(e.lng,180),o,e.title);return(0,B.jsxs)(c?`a`:`span`,{href:c||void 0,target:c?`_blank`:void 0,rel:c?`noopener noreferrer`:void 0,title:c&&e.title||void 0,style:{position:`absolute`,left:r,top:i,transform:`translate(-50%, -100%)`,cursor:c?`pointer`:`default`,textDecoration:`none`,color:`inherit`},children:[e.title?(0,B.jsx)(`span`,{style:{position:`absolute`,left:`50%`,bottom:`100%`,transform:`translateX(-50%)`,marginBottom:4,padding:`3px 7px`,borderRadius:6,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.5))`,boxShadow:`0 2px 8px rgba(15, 23, 42, 0.25)`,fontSize:12,lineHeight:1.35,whiteSpace:`nowrap`},children:e.title}):null,(0,B.jsxs)(`svg`,{width:Math.max(10,Number(a)||22),height:Math.max(10,Number(a)||22),viewBox:`0 0 24 24`,fill:s,style:{display:`block`},children:[(0,B.jsx)(`path`,{d:`M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z`}),Rt[e.icon]?(0,B.jsx)(`path`,{d:Rt[e.icon],transform:`translate(12 10.5) scale(0.46) translate(-12 -12)`,fill:`none`,stroke:`#fff`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`}):(0,B.jsx)(`circle`,{cx:`12`,cy:`10.5`,r:`2.6`,fill:`#fff`})]})]},t)}),(0,B.jsx)(`a`,{href:`https://www.openstreetmap.org/copyright`,target:`_blank`,rel:`noopener noreferrer`,onClick:f?e=>e.preventDefault():void 0,style:{position:`absolute`,right:4,bottom:3,padding:`1px 5px`,borderRadius:4,background:`rgba(255, 255, 255, 0.75)`,color:`#334155`,fontSize:10,textDecoration:`none`},children:`© OpenStreetMap`})]}),s?(0,B.jsx)(`a`,{href:It(_.lat,_.lng,y),target:`_blank`,rel:`noopener noreferrer`,onClick:f?e=>e.preventDefault():void 0,style:{display:`inline-block`,marginTop:6,fontSize:12,color:`var(--page-accent, inherit)`},children:`View larger map`}):null]})}var Rt={check:`M4 12l5 5L20 6`,close:`M6 6l12 12M18 6L6 18`,plus:`M12 5v14M5 12h14`,minus:`M5 12h14`,"arrow-right":`M4 12h16M13 5l7 7-7 7`,"arrow-left":`M20 12H4M11 5l-7 7 7 7`,"arrow-up":`M12 20V4M5 11l7-7 7 7`,"arrow-down":`M12 4v16M5 13l7 7 7-7`,"chevron-right":`M9 5l7 7-7 7`,"chevron-left":`M15 5l-7 7 7 7`,"chevron-down":`M5 9l7 7 7-7`,"chevron-up":`M5 15l7-7 7 7`,menu:`M4 7h16M4 12h16M4 17h16`,star:`M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z`,heart:`M12 20s-7-4.4-7-9a4 4 0 0 1 7-2.6A4 4 0 0 1 19 11c0 4.6-7 9-7 9z`,home:`M4 11l8-7 8 7M6 10v9h12v-9`,user:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20c0-3.3 3.6-5 8-5s8 1.7 8 5`,mail:`M3 6h18v12H3zM3 6l9 7 9-7`,phone:`M6 3h4l2 5-3 2a12 12 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2z`,search:`M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM20 20l-4.2-4.2`,clock:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2`,calendar:`M4 6h16v14H4zM4 10h16M8 3v4M16 3v4`,download:`M12 4v10M8 11l4 4 4-4M4 19h16`,upload:`M12 20V10M8 13l4-4 4 4M4 5h16`,play:`M8 5l11 7-11 7z`,pause:`M9 5v14M15 5v14`,info:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 11v5M12 8h.01`,alert:`M12 4l9 16H3zM12 10v4M12 17h.01`,lock:`M6 11h12v9H6zM9 11V8a3 3 0 0 1 6 0v3`,chat:`M4 5h16v11H9l-5 4z`,"map-pin":`M12 21s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11zM12 12a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z`,camera:`M4 8h4l2-2h4l2 2h4v12H4zM12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z`,image:`M4 5h16v14H4zM8 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM6 17l5-5 4 4 2-2 3 3`,file:`M7 3h7l4 4v14H7zM14 3v5h4`,link:`M10 14a4 4 0 0 0 6 .5l2-2a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6-.5l-2 2a4 4 0 0 0 6 6l1-1`,external:`M14 4h6v6M20 4l-9 9M18 14v5H5V6h5`,trash:`M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13`,edit:`M4 20h4L19 9l-4-4L4 16z`,filter:`M3 5h18l-7 8v6l-4-2v-4z`,refresh:`M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5`,globe:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18`,bell:`M6 16V11a6 6 0 1 1 12 0v5l2 3H4zM10 22h4`,tag:`M4 4h7l9 9-7 7-9-9zM8.5 8.5h.01`,cart:`M4 5h2l2 10h10l2-7H7M9 20h.01M18 20h.01`,card:`M3 6h18v12H3zM3 10h18`,shield:`M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6z`,sun:`M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 2v2M12 20v2M4 12H2M22 12h-2M5 5l1.5 1.5M17.5 17.5L19 19M19 5l-1.5 1.5M6.5 17.5L5 19`,moon:`M20 14a8 8 0 1 1-10-10 7 7 0 0 0 10 10z`,settings:`M12 9.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM12 2l1 2.6 2.7-.6 1 2.5 2.6 1-.6 2.7L21 12l-2.3 1.8.6 2.7-2.6 1-1 2.5-2.7-.6L12 22l-1-2.6-2.7.6-1-2.5-2.6-1 .6-2.7L3 12l2.3-1.8-.6-2.7 2.6-1 1-2.5 2.7.6z`,eye:`M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,"eye-off":`M4 4l16 16M9.5 9.6A3 3 0 0 0 12 15c.8 0 1.5-.3 2.1-.8M6.6 6.7C3.9 8.3 2 12 2 12s4 7 10 7c1.9 0 3.5-.5 4.9-1.2M14.1 5.4C13.4 5.1 12.7 5 12 5`,share:`M8 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 6a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM7.8 10.8l8.4-3.6M7.8 13.2l8.4 3.6`,send:`M21 3L3 10l7 3 3 7z`,paperclip:`M20 11l-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L15 6`,video:`M3 7h11v10H3zM14 11l6-3v8l-6-3`,music:`M9 18V6l10-2v12M9 18a2.5 2.5 0 1 1-2.5-2.5H9M19 16a2.5 2.5 0 1 1-2.5-2.5H19`,mic:`M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3zM5 11a7 7 0 0 0 14 0M12 18v3`,headphones:`M4 15v-3a8 8 0 1 1 16 0v3M4 15h3v5H5a1 1 0 0 1-1-1zM20 15h-3v5h2a1 1 0 0 0 1-1z`,book:`M5 4h14v16H7a2 2 0 0 1-2-2zM7 4v14h12`,bookmark:`M7 4h10v16l-5-4-5 4z`,folder:`M4 6h5l2 2h9v10H4z`,cloud:`M7 18a4 4 0 0 1 .5-8 5.5 5.5 0 0 1 10.4 1.5A3.5 3.5 0 0 1 17.5 18z`,database:`M12 3c4.4 0 8 1.3 8 3s-3.6 3-8 3-8-1.3-8-3 3.6-3 8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3`,server:`M4 4h16v6H4zM4 14h16v6H4zM8 7h.01M8 17h.01`,code:`M9 8l-5 4 5 4M15 8l5 4-5 4`,terminal:`M4 5h16v14H4zM8 10l3 2-3 2M13 14h4`,wifi:`M5 12a10 10 0 0 1 14 0M8 15a6 6 0 0 1 8 0M12 19h.01`,battery:`M3 8h15v8H3zM21 11v2`,printer:`M7 8V4h10v4M7 16H4V8h16v8h-3M7 13h10v7H7z`,gift:`M4 10h16v10H4zM3 6h18v4H3zM12 6v14M12 6c-2 0-4-1-4-2.5S9 2 10 3s2 3 2 3zM12 6c2 0 4-1 4-2.5S15 2 14 3s-2 3-2 3z`,key:`M15 4a5 5 0 1 0-4.6 7L9 12.4V15H6.5L4 17.5V20h4l7-7A5 5 0 0 0 15 4z`,compass:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM15 9l-2 5-5 2 2-5z`,flag:`M5 21V4h13l-2 4 2 4H5`,award:`M12 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM9 13l-1 7 4-2 4 2-1-7`,chart:`M4 20V4M4 20h16M8 16v-5M12 16V8M16 16v-8`,pie:`M12 3a9 9 0 1 0 9 9h-9z`,trending:`M3 17l6-6 4 4 8-8M15 7h6v6`,dollar:`M12 3v18M16 7.5C16 6 14.2 5 12 5S8 6 8 7.5 9.5 10 12 10.5s4 1.5 4 3-1.8 2.5-4 2.5-4-1-4-2.5`,percent:`M5 19L19 5M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM16.5 14a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z`,truck:`M3 6h11v9H3zM14 9h4l3 3v3h-7zM7.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM17.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z`,package:`M12 3l8 4v10l-8 4-8-4V7zM4 7l8 4 8-4M12 11v10`,store:`M4 9h16v11H4zM4 9l1.5-5h13L20 9M9 20v-6h6v6`,building:`M5 21V4h9v17M14 9h5v12M8 8h3M8 12h3M8 16h3M17 12h.01M17 16h.01`,users:`M9 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 20c0-3.3 3.1-5 7-5s7 1.7 7 5M17 5a4 4 0 0 1 0 7.9M22 20c0-2.6-1.6-4.2-4-4.8`,"thumbs-up":`M7 21V10h3l3-6a2 2 0 0 1 2 2v4h4l-2 11z`,smile:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9 10h.01M15 10h.01M8.5 14.5a5 5 0 0 0 7 0`,help:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.7M12 17h.01`,checkbox:`M4 4h16v16H4zM8 12l3 3 5-5`,list:`M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01`,grid:`M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z`,layers:`M12 3l9 5-9 5-9-5zM3 13l9 5 9-5`,zap:`M13 3L5 14h6l-1 7 8-11h-6z`,flame:`M12 21a6 6 0 0 0 6-6c0-4-4-6-4-10 0 0-3 1.5-3 5 0 1.5-1 2-1.5 1.5C8 10 7.5 9 7.5 9A7.5 7.5 0 0 0 6 15a6 6 0 0 0 6 6z`,droplet:`M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z`,leaf:`M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7`};function zt({name:e=`star`,paths:t,fill:n=!1,size:r=24,stroke:i=2,color:a=``,href:o=``,target:s=``,label:c=``,style:l,nodeRef:u,inert:d}){let f=Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim()):[],p=n&&f.length>0,m=f.length?f:[Rt[e]??Rt.star],h=Math.min(Math.max(Number(r)||24,8),240),g=a===`accent`?`var(--page-accent, currentColor)`:a||`currentColor`,_=(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,width:h,height:h,fill:p?g:`none`,stroke:p?`none`:g,strokeWidth:p?void 0:Math.min(Math.max(Number(i)||2,.5),4),strokeLinecap:p?void 0:`round`,strokeLinejoin:p?void 0:`round`,role:c?`img`:void 0,"aria-label":c||void 0,"aria-hidden":c?void 0:`true`,style:{display:`block`},children:m.map((e,t)=>(0,B.jsx)(`path`,{d:e},t))}),v={display:`inline-flex`,lineHeight:0,...k(l)};return o?(0,B.jsx)(`a`,{ref:u,href:o,onClick:d?e=>e.preventDefault():void 0,target:s||void 0,rel:s===`_blank`?`noopener noreferrer`:void 0,style:{...v,color:`inherit`},children:_}):(0,B.jsx)(`span`,{ref:u,style:v,children:_})}function Bt(e,t={},n=0){let r=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`):[],i=e=>e==null?``:Re(e),a=Math.max(0,Number(n)||0),o=[];for(let e of r){let n=e.data??e,r=Ie(n,t.imageField),s=(Array.isArray(r)?r:[r]).map(e=>e&&typeof e==`object`?e.url??e.src??``:e).filter(e=>typeof e==`string`&&e.trim()),c=t.nameField?i(Ie(n,t.nameField)):i(n.name),l=t.hrefField?i(Ie(n,t.hrefField)):``;for(let e of s)if(o.push({src:e,name:c,alt:c,href:l}),a&&o.length>=a)return o}return o}function Vt({images:e=[],source:t=``,entry:n=``,imageField:r=``,nameField:i=``,hrefField:a=``,limit:o=0,emptyText:s=``,columns:c=3,gap:u=8,showNames:d=!1,lightbox:f=!0,style:p,nodeRef:m,inert:h}){let{tenant:g,apiUrl:_}=(0,l.useContext)(ke),v=(0,l.useContext)(Ae)?.[t],[y,b]=(0,l.useState)(null),[x,S]=(0,l.useState)(()=>new Set);(0,l.useEffect)(()=>{if(!t||v)return;let e=!0;return fetch(`${_}/dynamic/${encodeURIComponent(t)}`,{headers:g?{"x-tenant":g}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&b(n)}).catch(()=>e&&b([])),()=>{e=!1}},[t,g,_,v]);let C=v??y??[],w=n?C.filter(e=>e?.id===n||e?.data?.slug===n||e?.slug===n):C,T=Math.max(0,Number(o)||0),E=t?(()=>{let e=Bt(w,{imageField:r,nameField:i,hrefField:a},0).filter(e=>!x.has(e.src));return T?e.slice(0,T):e})():null,D=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],O=E??D,A=!!t&&!v&&y===null,j=Math.max(0,Number(u)||0),ee=h?e=>e.preventDefault():void 0,[M,N]=(0,l.useState)(null),te=f&&!h&&M!==null&&O[M];(0,l.useEffect)(()=>{if(!te)return;let e=e=>{e.key===`Escape`&&N(null),e.key===`ArrowRight`&&N(e=>(e+1)%O.length),e.key===`ArrowLeft`&&N(e=>(e-1+O.length)%O.length)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[te,O.length]);let P=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,B.jsxs)(`div`,{ref:m,style:{columnCount:Math.min(Math.max(Number(c)||3,1),8),columnGap:j,width:`100%`,...k(p)},children:[O.map((e,n)=>{let r=(0,B.jsxs)(`span`,{style:{position:`relative`,display:`block`,borderRadius:`inherit`,overflow:`hidden`},children:[(0,B.jsx)(`img`,{src:e.src,alt:e.alt??``,onError:t?()=>S(t=>new Set(t).add(e.src)):void 0,style:{width:`100%`,display:`block`,borderRadius:`inherit`}}),d&&P(e)&&(0,B.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:P(e)})]}),i=e.href?(0,B.jsx)(`a`,{href:e.href,onClick:ee,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`,borderRadius:`inherit`},children:r}):f&&!h?(0,B.jsx)(`span`,{role:`button`,tabIndex:0,onClick:()=>N(n),onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&N(n),style:{display:`block`,borderRadius:`inherit`,cursor:`zoom-in`},children:r}):r;return(0,B.jsx)(`div`,{style:{breakInside:`avoid`,marginBottom:j,borderRadius:`inherit`,overflow:`hidden`},children:i},n)}),!O.length&&!A&&(0,B.jsx)(`div`,{style:{padding:`24px 12px`,fontSize:13,opacity:.55,textAlign:`center`,columnSpan:`all`},children:t?s||`No images yet`:`Pick images in Settings to fill the gallery`}),te&&(0,B.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:()=>N(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,B.jsx)(`img`,{src:O[M].src,alt:O[M].alt??``,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,maxHeight:`84vh`,borderRadius:8,boxShadow:`0 12px 48px rgba(0,0,0,0.5)`}}),P(O[M])&&(0,B.jsx)(`div`,{style:{color:`#fff`,fontSize:14,marginTop:12,opacity:.85},children:P(O[M])}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>N(null),style:{position:`absolute`,top:16,right:20,background:`transparent`,border:0,color:`#fff`,fontSize:28,lineHeight:1,cursor:`pointer`},children:`×`}),O.length>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),N(e=>(e-1+O.length)%O.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,B.jsx)(`button`,{type:`button`,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),N(e=>(e+1)%O.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 Ht={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},Ut={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 Wt(e,t={},n=`dropdown`){let r=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.id):[],i=e=>Array.isArray(e)?e[0]:e,a=e=>e==null?``:Re(e),o=r.map(e=>{let n=e.data??{},r=t.parentField?i(n[t.parentField]):null;return{key:e.id,parent:(r&&typeof r==`object`?r.id:r)||null,label:a(n[t.labelField||`name`])||a(n.name)||`Untitled`,href:t.hrefField?a(n[t.hrefField]):``,image:t.imageField&&i(n[t.imageField])||``,desc:t.descField?a(n[t.descField]):``}}),s=new Map(o.map(e=>[e.key,e])),c=e=>{let t=new Set,n=e;for(;n.parent&&s.has(n.parent)&&!t.has(n.key);)t.add(n.key),n=s.get(n.parent);return n},l=[],u=new Map;for(let e of o){if(c(e)!==e)continue;let t={key:e.key,label:e.label,href:e.href,image:e.image,children:[]};u.set(e.key,t),l.push(t)}for(let e of o){let t=c(e);t!==e&&u.get(t.key)?.children.push({key:e.key,label:e.label,href:e.href,image:e.image,desc:e.desc})}return l.map(e=>({...e,type:e.children.length?n:`link`}))}function Gt({brand:e,logo:t,brandHref:n,brandTarget:r,links:i=[],style:a,nodeRef:o,menu:s=`auto`,breakpoint:c=768,source:u=``,labelField:d=``,hrefField:f=``,imageField:p=``,descField:m=``,parentField:h=``,submenu:g=`dropdown`}){let[_,v]=(0,l.useState)(null),[y,b]=(0,l.useState)(!1),[x,S]=(0,l.useState)(!1),[C,w]=(0,l.useState)(null),{tenant:T,apiUrl:E}=(0,l.useContext)(ke),D=(0,l.useContext)(Ae)?.[u],[O,A]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!u||D)return;let e=!0;return fetch(`${E}/dynamic/${encodeURIComponent(u)}`,{headers:T?{"x-tenant":T}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&A(n)}).catch(()=>e&&A([])),()=>{e=!1}},[u,T,E,D]),(0,l.useEffect)(()=>{if(!_)return;let e=new ResizeObserver(()=>b(_.offsetWidth<c));return e.observe(_),()=>e.disconnect()},[_,c]);let j=u?Wt(D??O??[],{labelField:d,hrefField:f,imageField:p,descField:m,parentField:h},g):i,ee=s===`hamburger`||s===`auto`&&y,M=(e,t,n=!1)=>{let r=e.image?(0,B.jsx)(`img`,{src:e.image,alt:``,style:n?{width:`100%`,aspectRatio:`16 / 9`,objectFit:`cover`,borderRadius:6,display:`block`,marginBottom:8}:{width:22,height:22,objectFit:`cover`,borderRadius:4,display:`block`,flexShrink:0}}):null;return(0,B.jsxs)(`a`,{href:e.href||`#`,style:{...Ht,display:n?`block`:`flex`,alignItems:n?void 0:`center`,gap:n?void 0:10,...t},children:[r,(0,B.jsxs)(`span`,{style:{display:`block`,minWidth:0},children:[e.label,e.desc&&(0,B.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]})]},e.key)};return(0,B.jsxs)(`nav`,{ref:e=>{v(e),o&&o(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...k(a)},children:[(t||e)&&(()=>{let i=(0,B.jsxs)(B.Fragment,{children:[t&&(0,B.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,B.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,B.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:a,children:i}):(0,B.jsx)(`div`,{style:a,children:i})})(),(0,B.jsx)(`div`,{style:{flexGrow:1}}),ee?(0,B.jsx)(`button`,{type:`button`,"aria-label":x?`Close menu`:`Open menu`,onClick:()=>S(!x),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:x?`✕`:`☰`}):(0,B.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:j.map(e=>{let t=e.children??[];if(!t.length)return(0,B.jsx)(`a`,{href:e.href||`#`,style:Ht,children:e.label},e.key);let n=e.type===`mega`;return(0,B.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>w(e.key),onMouseLeave:()=>w(null),children:[(0,B.jsxs)(`a`,{href:e.href||`#`,style:{...Ht,cursor:`pointer`},children:[e.label,` `,(0,B.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),C===e.key&&(n?(0,B.jsx)(`div`,{style:{...Ut,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=>M(e,{padding:8,borderRadius:8},!0))}):(0,B.jsx)(`div`,{style:{...Ut,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>M(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),ee&&x&&(0,B.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:j.map(e=>(0,B.jsxs)(l.Fragment,{children:[(0,B.jsx)(`a`,{href:e.href||`#`,style:{...Ht,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>M(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function Kt({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,B.jsxs)(`div`,{ref:r,style:{width:`100%`,...k(n)},children:[(0,B.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,B.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,B.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function qt({items:e=[],linked:t,multiple:n=!1,icon:r=``,padX:i,padY:a,headerBg:o,headerColor:s,openBg:c,openColor:u,borderColor:d,style:f,nodeRef:p}){let[m,h]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let g=(e,t)=>typeof e==`string`&&e?e:t,_=(e,t)=>{let n=Number(e);return e===``||e==null||!Number.isFinite(n)?t:n},v=Rt[r],y=e=>h(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...k(f)},children:e.map((n,r)=>{let l=m.has(n.key);return(0,B.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid ${g(d,`rgba(148, 163, 184, 0.35)`)}`:`none`},children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>y(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:l?g(c,g(o,`transparent`)):g(o,`transparent`),border:0,padding:`${_(a,14)}px ${_(i,4)}px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:l?g(u,g(s,`inherit`)):g(s,`inherit`),textAlign:`left`,cursor:`pointer`,transition:`background 180ms, color 180ms`},children:[(0,B.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:10,minWidth:0},children:[v?(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,width:16,height:16,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0},children:(0,B.jsx)(`path`,{d:v})}):null,n.title||`Item ${r+1}`]}),(0,B.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:l?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,B.jsx)(`div`,{style:{display:l?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var Jt={display:`flex`,flexDirection:`column`,gap:`12px`},Yt={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},Xt={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)`},Zt={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},Qt=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function $t(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 en={display:`flex`,flexDirection:`column`,gap:6},tn={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 nn(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):[]}var rn=`g-recaptcha-response`,an=e=>e?.type===`recaptcha`?rn:e?.name;function on({field:e,value:t,onChange:n,inert:r,values:i}){let a=(0,B.jsxs)(`span`,{style:{...Yt,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:tn,value:t??``,onChange:t=>n(e.name,t.target.value)};return e.type===`display`?(0,B.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,B.jsx)(`img`,{src:e.src,alt:e.label??``,style:{width:`100%`,borderRadius:8,display:`block`}}):null:e.type===`recaptcha`?(0,B.jsx)(dn,{theme:e.captchaTheme,size:e.captchaSize,inert:r,onChange:e=>n(rn,e)}):e.type===`video`?e.src?/youtube\.com|youtu\.be|vimeo\.com/i.test(e.src)?(0,B.jsx)(vt,{url:e.src,style:{width:`100%`}}):(0,B.jsx)(`video`,{src:e.src,controls:!0,style:{width:`100%`,borderRadius:8,display:`block`}}):null:(0,B.jsxs)(`label`,{style:en,children:[a,e.type===`textarea`||e.multiline?(0,B.jsx)(`textarea`,{...o,rows:4,style:{...tn,resize:`vertical`}}):e.type===`select`?(0,B.jsxs)(`select`,{...o,disabled:o.disabled||!!e.parentField&&!i?.[e.parentField],children:[(0,B.jsx)(`option`,{value:``,children:e.placeholder||`—`}),nn(e,i).map((e,t)=>(0,B.jsx)(`option`,{value:typeof e==`string`?e:e.value,children:typeof e==`string`?e:e.label??e.value},t))]}):e.type===`checkbox`?(0,B.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,B.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,B.jsx)(`input`,{...o,type:{email:`email`,number:`number`,date:`date`,datetime:`datetime-local`,phone:`tel`,link:`url`}[e.type]??`text`}),e.help&&(0,B.jsx)(`span`,{style:{fontSize:12,opacity:.65},children:e.help})]})}function sn({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)(ke),[g,_]=(0,l.useState)(`form`),[v,y]=(0,l.useState)(null),[b,x]=(0,l.useState)({}),[S,C]=(0,l.useState)(0),w=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 T=[{section:null,fields:[]}];for(let e of Array.isArray(v?.fields)?v.fields:[])e.type===`section`?T.push({section:e,fields:[]}):T[T.length-1].fields.push(e);let E=T.filter(e=>e.section||e.fields.length),D=E.filter(e=>!e.section||$t(e.section.condition,b)).map(e=>({...e,fields:e.fields.filter(e=>$t(e.condition,b))})),O=E.length>1,A=Math.min(S,Math.max(0,D.length-1)),j=O?D[A]?.fields??[]:D.flatMap(e=>e.fields),ee=j.filter(e=>{let t=b[an(e)];return e.required&&(t==null||t===``||t===!1)}),M=A>=D.length-1,N=(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,B.jsxs)(`div`,{ref:c,style:k(e),children:[(0,B.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:{...Jt,display:w===`success`?`none`:`flex`},children:o&&a?(0,B.jsxs)(B.Fragment,{children:[O&&(0,B.jsx)(Fn,{steps:D.map(e=>({label:e.section?.label??`Start`})),active:A+1,style:{marginBottom:8}}),O&&D[A]?.section?.help&&(0,B.jsx)(`p`,{style:{margin:0,fontSize:14,opacity:.7},children:D[A].section.help}),j.map(e=>(0,B.jsx)(on,{field:e,value:b[an(e)],values:b,onChange:N,inert:u},e.name)),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`,marginTop:4},children:[O&&A>0&&(0,B.jsx)(`button`,{type:`button`,disabled:u||void 0,onClick:()=>C(A-1),style:{...He,background:`transparent`,color:`inherit`,border:0,padding:`10px 16px`,cursor:`pointer`},children:`Back`}),O&&!M?(0,B.jsx)(`button`,{type:`button`,disabled:u||ee.length>0,onClick:()=>C(A+1),style:{...He,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:ee.length?.5:1},children:`Next`}):(0,B.jsx)(`button`,{type:`submit`,disabled:u||void 0,style:{...He,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`},children:s||`Submit`})]})]}):d}),(0,B.jsx)(`div`,{style:{display:w===`success`?`block`:`none`},children:f?.success??null}),(0,B.jsx)(`div`,{style:{display:w===`error`?`block`:`none`,marginTop:12},children:f?.error??null})]})}var cn=null,ln=null,un=e=>{let t=typeof e==`string`&&e.trim()?e.trim():``;if(cn&&ln===t)return cn;if(cn&&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 ln=t,cn=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)}),cn};function dn({siteKey:e,theme:t,size:n,hl:r,style:i,nodeRef:a,inert:o,onChange:s}){let c=(0,l.useContext)(ke),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 un(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,B.jsxs)(`div`,{ref:a,style:k(i),children:[(0,B.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,B.jsx)(`span`,{style:{width:24,height:24,flexShrink:0,borderRadius:3,border:`2px solid ${e?`#8a8f94`:`#c1c1c1`}`,background:e?`#2f3337`:`#fff`}}),(0,B.jsx)(`span`,{style:{flexGrow:1},children:`I'm not a robot`}),(0,B.jsx)(`span`,{style:{fontSize:9,opacity:.6,textAlign:`center`,lineHeight:1.3},children:`reCAPTCHA`})]}),!d&&(0,B.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,B.jsx)(`div`,{ref:a,style:k(i),children:(0,B.jsx)(`div`,{ref:f})}):null}function fn({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,B.jsx)(`label`,{ref:r,style:{...Yt,...k(n)},children:$e(t,e,i)})}function pn({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,B.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...Xt,...k(i)},...Qt(o)})}function mn({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,B.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...Xt,resize:`vertical`,...k(i)},...Qt(o)})}function hn({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,B.jsxs)(`label`,{ref:o,style:{...Zt,...k(a)},children:[(0,B.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 gn({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,B.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:{...Xt,appearance:`auto`,...k(i)},children:[t!==``&&(0,B.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,B.jsx)(`option`,{value:e,children:e},t))]})}function _n({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,B.jsxs)(`label`,{ref:a,style:{...Xt,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...k(i)},children:[(0,B.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,B.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function vn({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,B.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...He,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...k(t)},children:e})}function yn({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,B.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...k(n)},children:Array.from({length:a},(e,t)=>(0,B.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function bn({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)(ke),_=(0,l.useContext)(Pe),v=(0,l.useContext)(Ae),[,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=Ne(d),x=JSON.stringify(b),S=x!==`{}`&&!e?.startsWith?.(`api:`),C=S?null:v?.[e],w=u?je(v):1,[T,E]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||C)return;let n=!0,r=new URLSearchParams;if(g&&r.set(`locale`,g),S&&r.set(`data_filter`,x),u&&!e.startsWith(`api:`)){let e=Math.max(1,Number(t)||6);r.set(`offset`,String((w-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&&E(t.filter(e=>e&&typeof e==`object`))}).catch(()=>n&&E([])),()=>{n=!1}},[e,m,h,g,C,u,w,t,S,x]),!e)return null;let D=Math.max(1,Number(t)||6),O=u?C||e.startsWith(`api:`)?(C??T??[]).slice((w-1)*D,w*D):(T??[]).slice(0,D):(C??T??[]).slice(0,D),A=Math.min(Math.max(Number(r)||3,1),6),j=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${A}, minmax(0, 1fr))`,gap:24};return s&&c&&_?.render?(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...j,...k(f)},children:O.map(e=>(0,B.jsx)(`div`,{style:{minWidth:0},children:_.render(c,t=>ze(t,e))},e.id??e?.data?.slug))}):(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...j,...k(f)},children:O.map(e=>{let t=i?Ie(e?.data,i):null,r=a?Re(Ie(e?.data,a)):null,s=o?Ie(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:Re(s),u=n===`list`;return(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,B.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,B.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,B.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,B.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:ot(c)})]})]},e.id??e?.data?.slug)})})}function xn({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?{}:Me(),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,B.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%`,...k(n)},children:[a.map(e=>Array.isArray(e.options)&&e.options.length>0||e.type===`option`||e.type===`select`?(0,B.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...Qt(i),children:[(0,B.jsx)(`option`,{value:``,children:e.label||e.name}),(Array.isArray(e.options)?e.options:[]).map(e=>{let t=c(e);return(0,B.jsx)(`option`,{value:t.value,children:t.label},t.value)})]},e.name):e.type===`switch`?(0,B.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...Qt(i),children:[(0,B.jsx)(`option`,{value:``,children:e.label||e.name}),(0,B.jsx)(`option`,{value:`true`,children:`Yes`}),(0,B.jsx)(`option`,{value:`false`,children:`No`})]},e.name):(0,B.jsx)(`input`,{type:`text`,name:`f_${e.name}`,defaultValue:o[e.name]??``,placeholder:e.label||e.name,style:s,...Qt(i)},e.name)),(0,B.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`},...Qt(i),children:t})]})}function Sn({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,B.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...k(n)},children:(0,B.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,B.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,B.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,B.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,B.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function Cn({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)(ke),m=(0,l.useContext)(Ae),[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?je(m):Number(t)||1,1),b),S=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)):`#`},C=o===`center`?`center`:o===`right`?`flex-end`:`flex-start`,w=c?e=>e.preventDefault():void 0,T=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,B.jsxs)(`nav`,{ref:d,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,justifyContent:C,...k(u)},children:[n&&(0,B.jsx)(`a`,{href:x>1?S(x-1):`#`,onClick:w,"aria-label":`Previous`,style:{...T(!1),opacity:x>1?1:.4},children:`‹`}),Array.from({length:b},(e,t)=>t+1).map(e=>(0,B.jsx)(`a`,{href:S(e),onClick:w,"aria-current":e===x?`page`:void 0,style:T(e===x),children:e},e)),n&&(0,B.jsx)(`a`,{href:x<b?S(x+1):`#`,onClick:w,"aria-label":`Next`,style:{...T(!1),opacity:x<b?1:.4},children:`›`})]})}var wn=`webim.page_mode`,Tn=()=>{if(typeof window>`u`)return`auto`;try{let e=window.localStorage.getItem(wn);return e===`light`||e===`dark`?e:`auto`}catch{return`auto`}},En=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,B.jsxs)(`svg`,{...t,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,B.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,B.jsx)(`svg`,{...t,children:(0,B.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})}):(0,B.jsxs)(`svg`,{...t,children:[(0,B.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`}),(0,B.jsx)(`path`,{d:`M8 21h8M12 17v4`})]})},Dn={light:`Light theme`,dark:`Dark theme`,auto:`Follow the device theme`};function On({variant:e,showSystem:t,style:n,nodeRef:r,inert:i}){let[a,o]=(0,l.useState)(i?`auto`:Tn),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(wn):window.localStorage.setItem(wn,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,B.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)`,...k(n)},children:u.map(e=>(0,B.jsx)(`button`,{type:`button`,title:Dn[e],"aria-label":Dn[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:En(e)},e))});let p=u[(u.indexOf(d)+1)%u.length];return(0,B.jsx)(`button`,{ref:c,type:`button`,title:Dn[d],"aria-label":`Theme: ${Dn[d]} — switch to ${Dn[p]}`,onClick:i?void 0:()=>o(p),style:{...f,width:36,height:36,border:`1px solid rgba(148, 163, 184, 0.4)`,...k(n)},children:En(d)})}function kn(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 An=e=>e===window?window.scrollY:e.scrollTop,jn={"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 Mn({variant:e,label:t,position:n,offset:r,showAfter:i,smooth:a,bg:o,fg:s,style:c,nodeRef:u,inert:d,frame:f,builder:p}){let[m,h]=(0,l.useState)(!!d),[g,_]=(0,l.useState)(null),v=e=>{_(e),typeof u==`function`&&u(e)};(0,l.useEffect)(()=>{if(d){h(!0);return}if(!g)return;let e=Number(i)>=0?Number(i):300,t=()=>{let t=kn(g),n=p&&!(t===window?document.documentElement.scrollHeight>window.innerHeight:t.scrollHeight>t.clientHeight);h(n||An(t)>e)};return t(),document.addEventListener(`scroll`,t,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,t,{capture:!0})},[d,g,i,p]);let y=()=>{if(d)return;let e=kn(g),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})},b=Number(r)>=0?Number(r):24,x=e===`pill`,S=t||`Top`,C=jn[n]?n:`bottom-right`,w=f?{position:`fixed`,zIndex:5,bottom:(f.bottom??0)+b,...C===`bottom-left`?{left:(f.left??0)+b}:null,...C===`bottom-right`?{right:(f.right??0)+b}:null,...C===`bottom-center`?{left:(f.left??0)+(f.width??0)/2,transform:`translateX(-50%)`}:null}:{position:`fixed`,zIndex:2147482e3,...jn[C](b)};return(0,B.jsxs)(`button`,{ref:v,type:`button`,title:S,"aria-label":S,"aria-hidden":!m,tabIndex:m?0:-1,onClick:y,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:x?8:0,appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,width:x?`auto`:44,height:44,padding:x?`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:+!!m,pointerEvents:m?`auto`:`none`,transition:`opacity 160ms ease, transform 160ms ease`,...w,...k(c),...w.transform?{transform:w.transform}:null},children:[(0,B.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M12 19V5M12 5l-7 7M12 5l7 7`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),x?(0,B.jsx)(`span`,{children:S}):null]})}var Nn={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 Pn({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&&Nn[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,B.jsx)(`div`,{ref:s,style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:f,...k(o)},children:l.map((e,r)=>{let i=Nn[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,B.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,B.jsx)(`svg`,{width:u,height:u,viewBox:`0 0 24 24`,fill:s,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:i.d})})},`${e.network}-${r}`)})})}function Fn({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,B.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...k(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,B.jsxs)(l.Fragment,{children:[t>0&&(0,B.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,B.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[(0,B.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,B.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}var In={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=>In[e]??In.medium;In.medium.w,In.medium.h;var Rn=e=>String(e?.group??``).trim(),zn=e=>{let t=[],n=new Map;return e.forEach((e,r)=>{let i=Rn(e)||`#${r}`;n.has(i)||(n.set(i,[]),t.push(i)),n.get(i).push(e)}),t.flatMap(e=>n.get(e))};function Bn(e,{size:t=`medium`,horizontal:n=!1,groupTitles:r=`top`}={}){let i=Ln(t),a=n?i.h:i.w,o=n?16:20,s=(n?i.w:i.h)+(n?56:48),c=Array.isArray(e)?e.filter(e=>e&&e.id):[],l=new Set(c.map(e=>e.id)),u=new Map,d=[];for(let e of c)e.parent&&l.has(e.parent)&&e.parent!==e.id?(u.has(e.parent)||u.set(e.parent,[]),u.get(e.parent).push(e)):d.push(e);d=zn(d);for(let[e,t]of u)u.set(e,zn(t));let f=(e,t)=>o+(Rn(e)!==Rn(t)&&(Rn(e)||Rn(t))?24:0),p=new Map,m=(e,t)=>{if(t.has(e.id))return 0;t.add(e.id);let n=u.get(e.id)??[],r=n.reduce((e,r,i)=>e+m(r,t)+(i?f(n[i-1],r):0),0),i=Math.max(a,r);return p.set(e.id,i),i};d.forEach(e=>m(e,new Set));let h=[],g=[],_=new Map,v=0,y=(e,t,r,o)=>{if(o.has(e.id))return;o.add(e.id);let c=t+((p.get(e.id)??a)-a)/2,d=r*s,m=n?d:c,b=n?c:d;h.push({node:e,x:m,y:b});let x=Rn(e);if(x){let t=`${e.parent&&l.has(e.parent)&&e.parent!==e.id?e.parent:``}|${x}`;_.has(t)||_.set(t,{title:x,color:``,members:[]});let n=_.get(t);!n.color&&e.groupColor&&(n.color=e.groupColor),n.members.push({x:m,y:b})}v=Math.max(v,d+(n?i.w:i.h));let S=t,C=u.get(e.id)??[];C.forEach((e,t)=>{t&&(S+=f(C[t-1],e));let l=S+((p.get(e.id)??a)-a)/2+a/2,u=(r+1)*s;g.push(n?{from:{x:d+i.w,y:c+i.h/2},to:{x:u,y:l}}:{from:{x:c+i.w/2,y:d+i.h},to:{x:l,y:u}}),y(e,S,r+1,o),S+=p.get(e.id)??a})},b=0,x=new Set;d.forEach((e,t)=>{t&&(b+=f(d[t-1],e)),y(e,b,0,x),b+=p.get(e.id)??a});let S=Math.max(b,a),C=r===`hidden`?0:22,w=[..._.values()].map(e=>{let t=Math.min(...e.members.map(e=>e.x))-12,n=Math.max(...e.members.map(e=>e.x))+i.w+12,a=Math.min(...e.members.map(e=>e.y))-12-(r===`bottom`?0:C),o=Math.max(...e.members.map(e=>e.y))+i.h+12+(r===`bottom`?C:0);return{x:t,y:a,width:n-t,height:o-a,title:e.title,color:e.color}}),T=n?Math.max(v,i.w):S,E=n?S:Math.max(v,i.h),D=Math.max(0,...w.map(e=>-e.x)),O=Math.max(0,...w.map(e=>-e.y));if(w.length&&(T=Math.max(T,...w.map(e=>e.x+e.width))+D,E=Math.max(E,...w.map(e=>e.y+e.height))+O,D||O)){for(let e of h)e.x+=D,e.y+=O;for(let e of g)e.from={x:e.from.x+D,y:e.from.y+O},e.to={x:e.to.x+D,y:e.to.y+O};for(let e of w)e.x+=D,e.y+=O}return{boxes:h,links:g,groups:w,width:T,height:E,horizontal:n}}var Vn=(e,t)=>{let n=String(e??``);return n.length>t?`${n.slice(0,t-1)}…`:n},Hn=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`},Un=e=>!!(e?.cv?.trim?.()||e?.photo);function Wn(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?``:Re(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]):``,group:t.groupField?i(n[t.groupField]):``}})}var Gn={size:36,pad:10};function Kn({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,B.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,B.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,B.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,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:e.cv?14:0},children:[e.photo&&(0,B.jsx)(`img`,{src:e.photo,alt:``,style:{width:72,height:72,borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[(0,B.jsx)(`div`,{style:{fontSize:18,fontWeight:700},children:e.name}),e.title&&(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.65},children:e.title})]})]}),e.cv&&String(e.cv).split(/\n+/).map((e,t)=>(0,B.jsx)(`p`,{style:{fontSize:14,lineHeight:1.6,margin:`0 0 10px`},children:e},t)),e.href&&(0,B.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 qn({nodes:e=[],source:t,nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,groupField:c,groupTitles:u=`top`,groupBg:d=``,size:f=`medium`,horizontal:p=!1,style:m,nodeRef:h,interactive:g=!0}){let _=(0,l.useId)(),[v,y]=(0,l.useState)(null),{tenant:b,apiUrl:x}=(0,l.useContext)(ke),S=(0,l.useContext)(Ae)?.[t],[C,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!t||S)return;let e=!0;return fetch(`${x}/dynamic/${encodeURIComponent(t)}`,{headers:b?{"x-tenant":b}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&w(n)}).catch(()=>e&&w([])),()=>{e=!1}},[t,b,x,S]);let T=t?Wn(S??C??[],{nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,groupField:c}):e,E=Ln(f),{boxes:D,links:O,groups:A,width:j,height:ee}=Bn(T,{size:f,horizontal:p,groupTitles:u});if(!D.length)return!g&&t?(0,B.jsxs)(`div`,{ref:h,style:{padding:18,border:`1px dashed rgba(148, 163, 184, 0.6)`,borderRadius:10,fontSize:13,opacity:.7,textAlign:`center`,...k(m)},children:[`Org Chart — no published entries in “`,t,`” yet`]}):null;let M=new Set(D.filter(e=>e.node.parent==null||e.node.parent===``).map(e=>e.node.id));return(0,B.jsxs)(`div`,{ref:h,style:{maxWidth:`100%`,overflowX:`auto`,...k(m)},children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 ${j} ${ee}`,role:`img`,"aria-label":`Organization chart`,style:{display:`block`,width:`100%`,maxWidth:j,height:`auto`,margin:`0 auto`},children:[A.map((e,t)=>{let n=e.color||d||`rgba(148, 163, 184, 0.16)`,r=!!(e.color||d);return(0,B.jsxs)(`g`,{children:[(0,B.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:`16`,fill:n}),u!==`hidden`&&e.title&&(0,B.jsx)(`text`,{x:e.x+e.width/2,y:u===`bottom`?e.y+e.height-22*.42:e.y+22*.78,textAnchor:`middle`,fontSize:E.title+1,fontWeight:`600`,opacity:`0.55`,fill:r?Hn(e.color||d):`var(--page-text, #111827)`,children:Vn(e.title,Math.floor(e.width/7))})]},`group-${t}`)}),O.map((e,t)=>(0,B.jsx)(`path`,{d:p?`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)),D.map(({node:e,x:t,y:n})=>{let r=M.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?Hn(e.color):r?`var(--page-accent-text, #ffffff)`:`var(--page-text, #111827)`,c=i?Hn(e.color2):s,l=g&&(Un(e)||e.href),u=()=>Un(e)?y(e):window.open(e.href,`_blank`,`noreferrer`),d=e.photo?t+Gn.pad+E.avatar+8:t+E.w/2,f=e.photo?`start`:`middle`,p=e.photo?Math.floor((E.w-E.avatar-26)/7):Math.floor(E.w/7.6),m=E.h/2,h=[e.name,e.title].map(e=>String(e??``).trim()).filter(Boolean);return(0,B.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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`linearGradient`,{id:`${_}-${e.id}-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,B.jsx)(`stop`,{offset:`0%`,stopColor:e.color||`var(--page-accent, #4f46e5)`}),(0,B.jsx)(`stop`,{offset:`100%`,stopColor:e.color2})]}),(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`,fill:`url(#${_}-${e.id}-grad)`})]}):i?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`clipPath`,{id:`${_}-${e.id}-box`,children:(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`})}),(0,B.jsxs)(`g`,{clipPath:`url(#${_}-${e.id}-box)`,children:[(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:m,fill:o}),(0,B.jsx)(`rect`,{x:t,y:n+m,width:E.w,height:E.h-m,fill:e.color2})]})]}):(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`,fill:o,stroke:a?`none`:`var(--page-accent, #4f46e5)`,strokeWidth:a?0:1.5}),e.photo&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`clipPath`,{id:`${_}-${e.id}`,children:(0,B.jsx)(`circle`,{cx:t+Gn.pad+E.avatar/2,cy:n+E.h/2,r:E.avatar/2})}),(0,B.jsx)(`image`,{href:e.photo,x:t+Gn.pad,y:n+(E.h-E.avatar)/2,width:E.avatar,height:E.avatar,preserveAspectRatio:`xMidYMid slice`,clipPath:`url(#${_}-${e.id})`})]}),i&&!e.gradient?(0,B.jsxs)(B.Fragment,{children:[e.title&&(0,B.jsx)(`text`,{x:d,y:n+m/2+E.title*.35,textAnchor:f,fontSize:E.title,fontWeight:`600`,fill:s,children:Vn(e.title,p+4)}),e.name&&(0,B.jsx)(`text`,{x:d,y:n+m+m/2+E.name*.35,textAnchor:f,fontSize:E.name,fontWeight:`600`,fill:c,children:Vn(e.name,p)})]}):(0,B.jsxs)(B.Fragment,{children:[h[0]&&(0,B.jsx)(`text`,{x:d,y:n+(h[1]?E.h*.43:E.h*.57),textAnchor:f,fontSize:E.name,fontWeight:`600`,fill:s,children:Vn(h[0],p)}),h[1]&&(0,B.jsx)(`text`,{x:d,y:n+E.h*.73,textAnchor:f,fontSize:E.title,opacity:`0.7`,fill:s,children:Vn(h[1],p+4)})]})]},e.id)})]}),v&&(0,B.jsx)(Kn,{node:v,onClose:()=>y(null)})]})}function Jn({value:e,onCommit:t,style:n,hint:r}){let[i,a]=(0,l.useState)(!1),o=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!i||!o.current)return;let e=o.current,t=document.createRange();e.focus(),t.selectNodeContents(e),t.collapse(!1);let n=window.getSelection();n.removeAllRanges(),n.addRange(t)},[i]),(0,B.jsx)(`span`,{ref:o,contentEditable:i,suppressContentEditableWarning:!0,title:i?void 0:r||`Double-click to edit`,onDoubleClick:()=>a(!0),onBlur:i?e=>{a(!1),t(e.currentTarget.textContent)}:void 0,onKeyDown:i?t=>{t.stopPropagation(),t.key===`Escape`&&(t.currentTarget.textContent=e??``,t.currentTarget.blur()),t.key===`Enter`&&(t.preventDefault(),t.currentTarget.blur())}:void 0,style:{display:`block`,minHeight:`1em`,outline:`none`,cursor:i?`text`:`inherit`,...n},children:e??``})}var Yn=360,Xn=`
16
16
  .wb-tedit-btn {
17
17
  cursor: pointer;
18
18
  border-radius: 4px;
@@ -64,7 +64,7 @@ Error generating stack: `+e.message+`
64
64
  }
65
65
  .wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }
66
66
  .wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }
67
- `,Jn=(e,t)=>e&&t?`cell-${e}-${t}`:``,Yn=e=>{if(!e||typeof e!=`object`)return e??``;let t=String(e.text??``);return typeof e.href==`string`&&e.href?(0,B.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,style:{color:`var(--page-accent, #4f46e5)`},children:t}):t};function Xn({columns:e=[],rows:t=[],widths:n=[],rowKeys:r=[],colKeys:i=[],heights:a=[],spans:o,linked:s,source:c,limit:u=10,header:d=!0,striped:f=!0,bordered:p=!1,compact:m=!1,padX:h,padY:g,paged:_,emptyText:v,stickyHeader:y,headerBg:b,headerColor:x,headerAlign:S,borderColor:C,maxHeight:w,style:T,nodeRef:E,edit:D}){let O=(0,l.useRef)(null),A=(0,l.useRef)(null),[j,ee]=(0,l.useState)(null),[M,N]=(0,l.useState)(null),te=(e,t)=>()=>ee({r:e,c:t});(0,l.useEffect)(()=>{if(!D)return;let e=A.current,t=j&&e?.querySelector(`[data-cell="${j.r}-${j.c}"]`);if(!t){M&&N(null);return}let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={top:r.bottom-n.top+4,left:Math.max(0,Math.min(r.left-n.left,n.width-Kn))};(M?.top!==i.top||M?.left!==i.left)&&N(i)}),(0,l.useEffect)(()=>{if(!D||!j)return;let e=e=>{A.current?.contains(e.target)||ee(null)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[D,j]);let{tenant:P,apiUrl:F}=(0,l.useContext)(ke),ne=(0,l.useContext)(Ae),re=ne?.[c],ie=_?je(ne):1,[ae,I]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!c||re)return;let e=!0,t=Math.max(1,Number(u)||10),n=_&&!c.startsWith(`api:`)?`?offset=${(ie-1)*t}&limit=${t}`:``,r=c.startsWith(`api:`)?`${F}/data/${encodeURIComponent(c.slice(4))}`:`${F}/dynamic/${encodeURIComponent(c)}${n}`;return fetch(r,{headers:P?{"x-tenant":P}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];return e&&I(n)}).catch(()=>e&&I([])),()=>{e=!1}},[c,P,F,re,_,ie,u]),!e.length)return null;let L=Math.max(1,Number(u)||10),oe=c?_?re||c.startsWith(`api:`)?(re??ae??[]).slice((ie-1)*L,ie*L):(ae??[]).slice(0,L):(re??ae??[]).slice(0,L):null,se=oe?oe.map(t=>e.map(e=>Re(Ie(t?.data,e.field)))):t,ce=!!c&&!(c&&!re&&ae===null)&&se.length===0,le=m?{y:6,x:10}:{y:10,x:14},ue=`${Number.isFinite(Number(g))&&g!==``?Number(g):le.y}px ${Number.isFinite(Number(h))&&h!==``?Number(h):le.x}px`,de=`1px solid ${typeof C==`string`&&C?C:`rgba(148, 163, 184, 0.35)`}`,fe=p?{border:de}:{borderBottom:de},pe=Array.isArray(n)&&n.length===e.length&&n.every(e=>Number.isFinite(e)&&e>0),me=[`left`,`center`,`right`],he=t=>me.includes(e[t]?.align)?e[t].align:``,ge=e=>he(e)||(me.includes(S)?S:`left`),_e=Number.isFinite(Number(w))&&Number(w)>0?Number(w):0,ve=k(T),ye=!_e&&ve&&ve.maxHeight!==void 0?ve.maxHeight:0,be=_e||ye,xe=ye?{...ve,maxHeight:void 0}:ve,Se=!!D&&D.rows!==!1,Ce=t=>r=>{if(!D?.resize||t>=e.length-1)return;r.preventDefault(),r.stopPropagation();let i=O.current,a=i?i.clientWidth:0;if(!a)return;let o=pe?[...n]:e.map(()=>100/e.length),s=r.clientX,c=o[t]+o[t+1],l=e=>{let n=(e.clientX-s)/a*100,r=Math.min(c-5,Math.max(5,o[t]+n)),i=[...o];i[t]=Math.round(r*10)/10,i[t+1]=Math.round((c-r)*10)/10,D.resize(i)},u=()=>{window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u)},we=new Set;o&&se.forEach((t,n)=>e.forEach((e,t)=>{let a=o[Jn(r[n],i[t])];if(!a)return;let s=Math.max(1,Number(a.c)||1),c=Math.max(1,Number(a.r)||1);for(let e=0;e<c;e++)for(let r=0;r<s;r++)(e||r)&&we.add(`${n+e},${t+r}`)}));let Te=e=>t=>{if(!D?.resizeRow)return;t.preventDefault(),t.stopPropagation();let n=t.currentTarget.closest(`tr`);if(!n)return;let r=t.clientY,i=n.offsetHeight,a=t=>D.resizeRow(e,Math.max(20,Math.round(i+(t.clientY-r)))),o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o)};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)},R=(e,t,n,r)=>r?null:(0,B.jsx)(`span`,{className:`wb-tedit-btn`,role:`button`,"data-hint":t,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:n,children:e},t),z=j&&j.r<se.length&&j.c<e.length?j:null,Ee=(e,t)=>D?.labels?.[e]??t,De=z?o?.[Jn(r[z.r],i[z.c])]:null,Oe=Math.max(1,Number(De?.c)||1),Me=Math.max(1,Number(De?.r)||1);return(0,B.jsxs)(`div`,{ref:e=>{A.current=e,typeof E==`function`&&E(e)},style:{width:`100%`,...D?{position:`relative`}:null,...xe},children:[D&&(0,B.jsx)(`style`,{children:qn}),D&&z&&M&&(0,B.jsxs)(`div`,{className:`wb-tedit-bar`,style:{top:M.top,left:M.left},onMouseDown:e=>e.stopPropagation(),children:[(0,B.jsx)(`span`,{className:`wb-tedit-at`,children:`R${z.r+1}·C${z.c+1}`}),R(`+↑`,Ee(`rowAbove`,`Insert row above`),()=>D.addRow(z.r-1)),R(`+↓`,Ee(`rowBelow`,`Insert row below`),()=>D.addRow(z.r)),R(`↑`,Ee(`rowUp`,`Move row up`),()=>D.moveRow(z.r,-1),z.r===0),R(`↓`,Ee(`rowDown`,`Move row down`),()=>D.moveRow(z.r,1),z.r>=se.length-1),R(`✕ row`,Ee(`rowDelete`,`Delete row`),()=>D.dropRow(z.r),se.length<=1),(0,B.jsx)(`span`,{className:`wb-tedit-sep`}),R(`+←`,Ee(`colLeft`,`Insert column left`),()=>D.addColumn(z.c-1)),R(`+→`,Ee(`colRight`,`Insert column right`),()=>D.addColumn(z.c)),R(`←`,Ee(`colMoveLeft`,`Move column left`),()=>D.moveColumn(z.c,-1),z.c===0),R(`→`,Ee(`colMoveRight`,`Move column right`),()=>D.moveColumn(z.c,1),z.c>=e.length-1),R(`✕ col`,Ee(`colDelete`,`Delete column`),()=>D.dropColumn(z.c),e.length<=1),(0,B.jsx)(`span`,{className:`wb-tedit-sep`}),R(`↔`,Ee(`mergeRight`,`Merge with the cell on the right`),()=>D.merge(z.r,z.c,`right`),z.c+Oe>=e.length),R(`↕`,Ee(`mergeDown`,`Merge with the cell below`),()=>D.merge(z.r,z.c,`down`),z.r+Me>=se.length),R(`⤫`,Ee(`split`,`Split this cell`),()=>D.split(z.r,z.c),Oe===1&&Me===1)]}),(0,B.jsx)(`div`,{style:{width:`100%`,overflowX:`auto`,...be?{maxHeight:be,overflowY:`auto`}:null},children:(0,B.jsxs)(`table`,{ref:O,style:{width:`100%`,borderCollapse:y&&d!==!1?`separate`:`collapse`,borderSpacing:0,fontSize:14,...pe?{tableLayout:`fixed`}:null,...p?{border:de}:{}},children:[pe&&(0,B.jsx)(`colgroup`,{children:n.map((e,t)=>(0,B.jsx)(`col`,{style:{width:`${e}%`}},t))}),d===!1?null:(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:e.map((t,n)=>(0,B.jsx)(`th`,{className:D?`wb-tedit-head`:void 0,style:{textAlign:ge(n),fontWeight:600,padding:ue,...typeof x==`string`&&x?{color:x}:null,background:typeof b==`string`&&b?b:y?`var(--page-surface, #f2f2f2)`:`rgba(148, 163, 184, 0.12)`,...y?{position:`sticky`,top:0,zIndex:2}:D?{position:`relative`}:null,...fe},children:D?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Gn,{value:t.label??t,onCommit:e=>D.header(n,e),hint:Ee(`editCell`,`Double-click to edit`),style:{paddingRight:6}}),n<e.length-1&&(0,B.jsx)(`span`,{className:`wb-tedit-grip`,title:Ee(`colWidth`,`Drag to resize the column`),onPointerDown:Ce(n)})]}):t.label??t},n))})}),(0,B.jsxs)(`tbody`,{children:[ce&&(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:e.length,style:{padding:ue,textAlign:`center`,opacity:.6,...fe},children:v||`No data yet`})}),se.map((t,n)=>(0,B.jsx)(`tr`,{className:D?`wb-tedit-row`:void 0,style:{...f&&n%2==1?{background:`rgba(148, 163, 184, 0.07)`}:null,...Number.isFinite(Number(a?.[n]))&&a[n]>0?{height:a[n]}:null},children:e.map((e,a)=>{if(we.has(`${n},${a}`))return null;let c=Jn(r[n],i[a]),l=s?.[c],u=o?.[c],d=Math.max(1,Number(u?.c)||1),f=Math.max(1,Number(u?.r)||1);return(0,B.jsxs)(`td`,{className:D?`wb-tedit-cell${j?.r===n&&j?.c===a?` wb-tedit-cellon`:``}`:void 0,onMouseDownCapture:Se?te(n,a):void 0,"data-cell":D?`${n}-${a}`:void 0,colSpan:d>1?d:void 0,rowSpan:f>1?f:void 0,style:{padding:ue,...he(a)?{textAlign:he(a)}:null,...D?{position:`relative`}:null,...fe},children:[l??Yn(t?.[a]),D&&Se&&(0,B.jsx)(`span`,{className:`wb-tedit-rowgrip`,title:Ee(`rowHeight`,`Drag to set the row height — double-click to fit the content`),onPointerDown:Te(n),onDoubleClick:()=>D.resizeRow(n,0)})]},a)})},r[n]??n))]})]})})]})}var Zn={small:{cell:62,font:10.5,head:11,title:15,pad:4,gap:2},medium:{cell:92,font:12,head:12,title:18,pad:6,gap:3},large:{cell:124,font:13,head:13,title:22,pad:8,gap:4}},Qn=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,$n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),er=366;function tr(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?``:Re(e),a=e=>{let t=i(r(e)),n=t?new Date(t):null;return n&&!Number.isNaN(n.getTime())?n:null};return n.map(e=>{let n=e.data??{},o=a(n[t.startField]);return o?{key:e.id,title:i(n[t.titleField||`name`])||i(n.name)||`Untitled`,start:o,end:a(n[t.endField]),href:t.hrefField?i(n[t.hrefField]):``,color:t.colorField?i(r(n[t.colorField])):``}:null}).filter(Boolean)}function nr(e){return(Array.isArray(e)?e:[]).map((e,t)=>{let n=e?.start?new Date(e.start):null;if(!n||Number.isNaN(n.getTime()))return null;let r=e?.end?new Date(e.end):null;return{key:e.key??`event-${t}`,title:e.title??``,start:n,end:r&&!Number.isNaN(r.getTime())?r:null,href:e.href??``,color:e.color??``}}).filter(Boolean)}function rr(e){let t=new Map;for(let n of e){let e=$n(n.start),r=n.end?$n(n.end):e,i=Math.min(Math.max(0,Math.round((r-e)/864e5)),er);for(let r=0;r<=i;r+=1){let i=Qn(new Date(e.getFullYear(),e.getMonth(),e.getDate()+r));t.has(i)||t.set(i,[]),t.get(i).push(n)}}for(let e of t.values())e.sort((e,t)=>e.start-t.start);return t}function ir({events:e=[],source:t=``,titleField:n=``,startField:r=``,endField:i=``,hrefField:a=``,colorField:o=``,variant:s=`month`,size:c=`medium`,accent:u=``,eventBg:d=``,eventText:f=``,borderColor:p=``,weekStart:m=`monday`,max:h=3,emptyText:g=`No events`,style:_,nodeRef:v,interactive:y=!0}){let{tenant:b,apiUrl:x,locale:S}=(0,l.useContext)(ke),C=(0,l.useContext)(Ae)?.[t],[w,T]=(0,l.useState)(null),[E,D]=(0,l.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}});(0,l.useEffect)(()=>{if(!t||C)return;let e=!0;return fetch(`${x}/dynamic/${encodeURIComponent(t)}`,{headers:b?{"x-tenant":b}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&T(n)}).catch(()=>e&&T([])),()=>{e=!1}},[t,b,x,C]);let O=Zn[c]??Zn.medium,A=u||`var(--page-accent, #4f46e5)`,j=p||`var(--page-border, rgba(148, 163, 184, 0.35))`,ee=d||A,M=f||`var(--page-accent-text, #ffffff)`,N=t?tr(C??w??[],{titleField:n,startField:r,endField:i,hrefField:a,colorField:o}):nr(e),te=rr(N),P=S||void 0,F=(e,t)=>{let n=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:e.color||M,flexShrink:0,opacity:e.color?1:.85}}),(0,B.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.title})]}),r={display:`flex`,alignItems:`center`,gap:5,background:e.color?`color-mix(in srgb, ${e.color} 18%, transparent)`:ee,color:e.color?`inherit`:M,borderRadius:4,padding:`2px 5px`,fontSize:O.font,lineHeight:1.35,textDecoration:`none`,...t};return e.href&&y?(0,B.jsx)(`a`,{href:e.href,style:r,title:e.title,children:n},e.key):(0,B.jsx)(`div`,{style:r,title:e.title,children:n},e.key)},ne=new Intl.DateTimeFormat(P,{month:`long`,year:`numeric`}).format(new Date(E.year,E.month,1)),re=e=>D(t=>{let n=new Date(t.year,t.month+e,1);return{year:n.getFullYear(),month:n.getMonth()}}),ie=(e,t)=>(0,B.jsx)(`button`,{type:`button`,"aria-label":e,onClick:()=>re(t),style:{background:`transparent`,border:`1px solid ${j}`,borderRadius:6,color:`inherit`,cursor:`pointer`,fontSize:O.head,lineHeight:1,padding:`4px 8px`},children:t<0?`‹`:`›`}),ae=(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:O.pad+2},children:[(0,B.jsx)(`div`,{style:{fontSize:O.title,fontWeight:700,flexGrow:1,fontFamily:`var(--page-heading-font, inherit)`},children:ne}),ie(`Previous month`,-1),ie(`Next month`,1)]});if(s===`list`){let e=N.filter(e=>e.start.getFullYear()===E.year&&e.start.getMonth()===E.month).sort((e,t)=>e.start-t.start),t=new Intl.DateTimeFormat(P,{day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`});return(0,B.jsxs)(`div`,{ref:v,style:{width:`100%`,...k(_)},children:[ae,e.length?(0,B.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:O.gap+2},children:e.map(e=>(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid ${j}`,paddingBottom:O.gap+2},children:[(0,B.jsx)(`span`,{style:{fontSize:O.font,opacity:.7,minWidth:96},children:t.format(e.start)}),F(e,{flexGrow:1,minWidth:0})]},e.key))}):(0,B.jsx)(`div`,{style:{fontSize:O.font,opacity:.6,padding:O.pad*2},children:g})]})}let I=new Date(E.year,E.month,1),L=m===`sunday`?0:1,oe=(I.getDay()-L+7)%7,se=new Date(E.year,E.month+1,0).getDate(),ce=Math.ceil((oe+se)/7),le=Qn(new Date),ue=new Intl.DateTimeFormat(P,{weekday:`short`}),de=[];for(let e=0;e<ce*7;e+=1){let t=e-oe+1,n=t>=1&&t<=se,r=Qn(new Date(E.year,E.month,t)),i=n?te.get(r)??[]:[],a=i.slice(0,Math.max(1,h)),o=n&&r===le;de.push((0,B.jsxs)(`div`,{style:{minHeight:O.cell,borderTop:`1px solid ${j}`,borderLeft:`1px solid ${j}`,padding:O.pad,display:`flex`,flexDirection:`column`,gap:O.gap,opacity:n?1:.35,minWidth:0},children:[(0,B.jsx)(`span`,{style:{fontSize:O.font,fontWeight:o?700:400,alignSelf:`flex-start`,borderRadius:`999px`,padding:o?`1px 6px`:0,background:o?A:`transparent`,color:o?M:`inherit`},children:n?t:new Date(E.year,E.month,t).getDate()}),a.map(e=>F(e)),i.length>a.length&&(0,B.jsx)(`span`,{style:{fontSize:O.font,opacity:.6},children:`+${i.length-a.length}`})]},e))}return(0,B.jsxs)(`div`,{ref:v,style:{width:`100%`,...k(_)},children:[ae,(0,B.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(7, minmax(0, 1fr))`},children:[Array.from({length:7},(e,t)=>(0,B.jsx)(`div`,{style:{fontSize:O.head,fontWeight:600,opacity:.7,textAlign:`center`,padding:`0 0 ${O.pad}px`},children:ue.format(new Date(2024,0,7+L+t))},`head-${t}`)),de]}),(0,B.jsx)(`div`,{style:{borderTop:`1px solid ${j}`}})]})}var ar={small:36,medium:56,large:88};function or(e,t={}){let n=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`):[],r=e=>e==null?``:Re(e);return n.map(e=>{let n=e.data??e,i=Ie(n,t.imageField),a=Array.isArray(i)?i[0]:i,o=a&&typeof a==`object`?a.url??a.src??``:a,s=t.nameField?r(Ie(n,t.nameField)):r(n.name);return{src:typeof o==`string`?o.trim():``,alt:s,href:t.hrefField?r(Ie(n,t.hrefField)):``}}).filter(e=>e.src)}function sr({logos:e=[],source:t=``,imageField:n=``,nameField:r=``,hrefField:i=``,variant:a=`step`,size:o=`medium`,perView:s=5,gap:c=48,hold:u=3,slideMs:d=500,direction:f=`left`,arrows:p=`show`,pauseOnHover:m=!0,grayscale:h=!0,newTab:g=!0,emptyText:_=``,style:v,nodeRef:y,inert:b}){let{tenant:x,apiUrl:S}=(0,l.useContext)(ke),C=(0,l.useContext)(Ae)?.[t],[w,T]=(0,l.useState)(null),E=(0,l.useRef)(null),D=(0,l.useRef)(null),[O,A]=(0,l.useState)(0),[j,ee]=(0,l.useState)(0),[M,N]=(0,l.useState)(0),[te,P]=(0,l.useState)(!0),[F,ne]=(0,l.useState)(!1),[re,ie]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!t||C)return;let e=!0;return fetch(`${S}/dynamic/${encodeURIComponent(t)}`,{headers:x?{"x-tenant":x}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&T(n)}).catch(()=>e&&T([])),()=>{e=!1}},[t,x,S,C]),(0,l.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>ie(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),(0,l.useEffect)(()=>{let e=D.current;if(!e)return;let t=()=>A(e.clientWidth);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,l.useEffect)(()=>{let e=E.current;if(!e)return;let t=!0,n=()=>{let n=[...e.querySelectorAll(`img`)].filter(e=>e.complete&&e.naturalHeight).map(e=>e.naturalWidth/e.naturalHeight*L);t&&n.length&&ee(Math.ceil(Math.max(...n)))};n();let r=[...e.querySelectorAll(`img`)].filter(e=>!e.complete);return r.forEach(e=>e.addEventListener(`load`,n)),()=>{t=!1,r.forEach(e=>e.removeEventListener(`load`,n))}});let ae=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],I=t?or(C??w??[],{imageField:n,nameField:r,hrefField:i}):ae,L=ar[o]??ar.medium,oe=Number.isFinite(Number(c))?Math.max(0,Number(c)):48,se=a===`marquee`?`step`:a,ce=Math.min(3e4,Math.max(300,(Number(u)||3)*1e3)),le=Math.min(3e3,Math.max(100,Number(d)||500)),ue=Math.min(12,Math.max(1,Math.round(Number(s)||5))),de=(j||L*3)+oe,pe=O?Math.max(1,Math.floor(O/de)):ue,me=Math.min(ue,pe),he=O?Math.min(de,O/me):de;if(!I.length)return(0,B.jsx)(`div`,{ref:y,style:{width:`100%`,...k(v)},children:b?(0,B.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexWrap:`wrap`,gap:oe},children:[0,1,2,3,4].map(e=>(0,B.jsx)(`div`,{style:{height:L,width:L*3,border:`1px dashed var(--page-border, rgba(148, 163, 184, 0.5))`,borderRadius:6,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:Math.max(10,Math.round(L/4)),opacity:.45,...fe},children:`LOGO`},e))}):_?(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.6,textAlign:`center`,padding:16},children:_}):null});let ge=I.length,_e=se===`step`&&ge>me,ve=se===`slider`,ye=_e&&!b&&!F&&!re,be=f===`right`,xe=be?ge:0,Se=_e?[...I,...I]:I,Ce=_e?M*he:0,we=(e,t,n)=>{let r=(0,B.jsx)(`img`,{src:e.src,alt:e.alt??``,style:{height:L,width:`auto`,maxWidth:`100%`,objectFit:`contain`,display:`block`}}),i=_e?{width:he,flex:`0 0 auto`,padding:`0 ${oe/2}px`,justifyContent:`center`}:{};return e.href&&!b?(0,B.jsx)(`a`,{href:e.href,className:`wb-logo`,title:e.alt||void 0,style:i,...g===!1?{}:{target:`_blank`,rel:`noopener noreferrer`},...n?{"aria-hidden":`true`,tabIndex:-1}:{},children:r},`${n?`c`:`o`}-${t}`):(0,B.jsx)(`div`,{className:`wb-logo`,style:i,...n?{"aria-hidden":`true`}:{},children:r},`${n?`c`:`o`}-${t}`)},Te=(0,B.jsx)(`div`,{ref:E,className:`wb-logos-track`,style:{display:`flex`,alignItems:`center`,..._e?{width:Se.length*he,transform:`translateX(-${Ce}px)`,transition:te?`transform ${le}ms ease`:`none`}:ve?{gap:oe,overflowX:`auto`,scrollBehavior:`smooth`,scrollSnapType:`x proximity`}:{gap:oe,flexWrap:`wrap`,justifyContent:`center`}},children:Se.map((e,t)=>we(e,t,_e&&t>=ge))}),R=e=>{if(ve){let t=E.current;t&&t.scrollBy({left:e*Math.max(120,t.clientWidth*.8),behavior:`smooth`});return}let t=M+e;if(t>=0&&t<=ge){P(!0),N(t);return}let n=t<0?ge:0;P(!1),N(n),requestAnimationFrame(()=>requestAnimationFrame(()=>{P(!0),N(n+e)}))},z=p===!1||p===`off`?`off`:p===`hover`?`hover`:`show`,Ee=z!==`off`&&(ve?O>0:_e),De=e=>(0,B.jsx)(`button`,{type:`button`,"aria-label":e<0?`Previous logos`:`Next logos`,onClick:()=>R(e),className:`wb-logos-arrow${z===`hover`?` wb-logos-arrow-shy`:``}`,style:{[e<0?`left`:`right`]:0},children:e<0?`‹`:`›`});return(0,B.jsxs)(`div`,{ref:e=>{D.current=e,y&&y(e)},className:`wb-logos`,style:{width:`100%`,position:`relative`,overflow:`hidden`,...k(v)},onMouseEnter:m===!1?void 0:()=>ne(!0),onMouseLeave:m===!1?void 0:()=>ne(!1),children:[(0,B.jsx)(`style`,{children:`
67
+ `,Zn=(e,t)=>e&&t?`cell-${e}-${t}`:``,Qn=e=>{if(!e||typeof e!=`object`)return e??``;let t=String(e.text??``);return typeof e.href==`string`&&e.href?(0,B.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,style:{color:`var(--page-accent, #4f46e5)`},children:t}):t};function $n({columns:e=[],rows:t=[],widths:n=[],rowKeys:r=[],colKeys:i=[],heights:a=[],spans:o,linked:s,source:c,limit:u=10,header:d=!0,striped:f=!0,bordered:p=!1,compact:m=!1,padX:h,padY:g,paged:_,emptyText:v,stickyHeader:y,headerBg:b,headerColor:x,headerAlign:S,borderColor:C,maxHeight:w,style:T,nodeRef:E,edit:D}){let O=(0,l.useRef)(null),A=(0,l.useRef)(null),[j,ee]=(0,l.useState)(null),[M,N]=(0,l.useState)(null),te=(e,t)=>()=>ee({r:e,c:t});(0,l.useEffect)(()=>{if(!D)return;let e=A.current,t=j&&e?.querySelector(`[data-cell="${j.r}-${j.c}"]`);if(!t){M&&N(null);return}let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={top:r.bottom-n.top+4,left:Math.max(0,Math.min(r.left-n.left,n.width-Yn))};(M?.top!==i.top||M?.left!==i.left)&&N(i)}),(0,l.useEffect)(()=>{if(!D||!j)return;let e=e=>{A.current?.contains(e.target)||ee(null)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[D,j]);let{tenant:P,apiUrl:F}=(0,l.useContext)(ke),ne=(0,l.useContext)(Ae),re=ne?.[c],ie=_?je(ne):1,[ae,I]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!c||re)return;let e=!0,t=Math.max(1,Number(u)||10),n=_&&!c.startsWith(`api:`)?`?offset=${(ie-1)*t}&limit=${t}`:``,r=c.startsWith(`api:`)?`${F}/data/${encodeURIComponent(c.slice(4))}`:`${F}/dynamic/${encodeURIComponent(c)}${n}`;return fetch(r,{headers:P?{"x-tenant":P}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];return e&&I(n)}).catch(()=>e&&I([])),()=>{e=!1}},[c,P,F,re,_,ie,u]),!e.length)return null;let L=Math.max(1,Number(u)||10),oe=c?_?re||c.startsWith(`api:`)?(re??ae??[]).slice((ie-1)*L,ie*L):(ae??[]).slice(0,L):(re??ae??[]).slice(0,L):null,se=oe?oe.map(t=>e.map(e=>Re(Ie(t?.data,e.field)))):t,ce=!!c&&!(c&&!re&&ae===null)&&se.length===0,le=m?{y:6,x:10}:{y:10,x:14},ue=`${Number.isFinite(Number(g))&&g!==``?Number(g):le.y}px ${Number.isFinite(Number(h))&&h!==``?Number(h):le.x}px`,de=`1px solid ${typeof C==`string`&&C?C:`rgba(148, 163, 184, 0.35)`}`,fe=p?{border:de}:{borderBottom:de},pe=Array.isArray(n)&&n.length===e.length&&n.every(e=>Number.isFinite(e)&&e>0),me=[`left`,`center`,`right`],he=t=>me.includes(e[t]?.align)?e[t].align:``,ge=e=>he(e)||(me.includes(S)?S:`left`),_e=Number.isFinite(Number(w))&&Number(w)>0?Number(w):0,ve=k(T),ye=!_e&&ve&&ve.maxHeight!==void 0?ve.maxHeight:0,be=_e||ye,xe=ye?{...ve,maxHeight:void 0}:ve,Se=!!D&&D.rows!==!1,Ce=t=>r=>{if(!D?.resize||t>=e.length-1)return;r.preventDefault(),r.stopPropagation();let i=O.current,a=i?i.clientWidth:0;if(!a)return;let o=pe?[...n]:e.map(()=>100/e.length),s=r.clientX,c=o[t]+o[t+1],l=e=>{let n=(e.clientX-s)/a*100,r=Math.min(c-5,Math.max(5,o[t]+n)),i=[...o];i[t]=Math.round(r*10)/10,i[t+1]=Math.round((c-r)*10)/10,D.resize(i)},u=()=>{window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u)},we=new Set;o&&se.forEach((t,n)=>e.forEach((e,t)=>{let a=o[Zn(r[n],i[t])];if(!a)return;let s=Math.max(1,Number(a.c)||1),c=Math.max(1,Number(a.r)||1);for(let e=0;e<c;e++)for(let r=0;r<s;r++)(e||r)&&we.add(`${n+e},${t+r}`)}));let Te=e=>t=>{if(!D?.resizeRow)return;t.preventDefault(),t.stopPropagation();let n=t.currentTarget.closest(`tr`);if(!n)return;let r=t.clientY,i=n.offsetHeight,a=t=>D.resizeRow(e,Math.max(20,Math.round(i+(t.clientY-r)))),o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o)};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)},R=(e,t,n,r)=>r?null:(0,B.jsx)(`span`,{className:`wb-tedit-btn`,role:`button`,"data-hint":t,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:n,children:e},t),z=j&&j.r<se.length&&j.c<e.length?j:null,Ee=(e,t)=>D?.labels?.[e]??t,De=z?o?.[Zn(r[z.r],i[z.c])]:null,Oe=Math.max(1,Number(De?.c)||1),Me=Math.max(1,Number(De?.r)||1);return(0,B.jsxs)(`div`,{ref:e=>{A.current=e,typeof E==`function`&&E(e)},style:{width:`100%`,...D?{position:`relative`}:null,...xe},children:[D&&(0,B.jsx)(`style`,{children:Xn}),D&&z&&M&&(0,B.jsxs)(`div`,{className:`wb-tedit-bar`,style:{top:M.top,left:M.left},onMouseDown:e=>e.stopPropagation(),children:[(0,B.jsx)(`span`,{className:`wb-tedit-at`,children:`R${z.r+1}·C${z.c+1}`}),R(`+↑`,Ee(`rowAbove`,`Insert row above`),()=>D.addRow(z.r-1)),R(`+↓`,Ee(`rowBelow`,`Insert row below`),()=>D.addRow(z.r)),R(`↑`,Ee(`rowUp`,`Move row up`),()=>D.moveRow(z.r,-1),z.r===0),R(`↓`,Ee(`rowDown`,`Move row down`),()=>D.moveRow(z.r,1),z.r>=se.length-1),R(`✕ row`,Ee(`rowDelete`,`Delete row`),()=>D.dropRow(z.r),se.length<=1),(0,B.jsx)(`span`,{className:`wb-tedit-sep`}),R(`+←`,Ee(`colLeft`,`Insert column left`),()=>D.addColumn(z.c-1)),R(`+→`,Ee(`colRight`,`Insert column right`),()=>D.addColumn(z.c)),R(`←`,Ee(`colMoveLeft`,`Move column left`),()=>D.moveColumn(z.c,-1),z.c===0),R(`→`,Ee(`colMoveRight`,`Move column right`),()=>D.moveColumn(z.c,1),z.c>=e.length-1),R(`✕ col`,Ee(`colDelete`,`Delete column`),()=>D.dropColumn(z.c),e.length<=1),(0,B.jsx)(`span`,{className:`wb-tedit-sep`}),R(`↔`,Ee(`mergeRight`,`Merge with the cell on the right`),()=>D.merge(z.r,z.c,`right`),z.c+Oe>=e.length),R(`↕`,Ee(`mergeDown`,`Merge with the cell below`),()=>D.merge(z.r,z.c,`down`),z.r+Me>=se.length),R(`⤫`,Ee(`split`,`Split this cell`),()=>D.split(z.r,z.c),Oe===1&&Me===1)]}),(0,B.jsx)(`div`,{style:{width:`100%`,overflowX:`auto`,...be?{maxHeight:be,overflowY:`auto`}:null},children:(0,B.jsxs)(`table`,{ref:O,style:{width:`100%`,borderCollapse:y&&d!==!1?`separate`:`collapse`,borderSpacing:0,fontSize:14,...pe?{tableLayout:`fixed`}:null,...p?{border:de}:{}},children:[pe&&(0,B.jsx)(`colgroup`,{children:n.map((e,t)=>(0,B.jsx)(`col`,{style:{width:`${e}%`}},t))}),d===!1?null:(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:e.map((t,n)=>(0,B.jsx)(`th`,{className:D?`wb-tedit-head`:void 0,style:{textAlign:ge(n),fontWeight:600,padding:ue,...typeof x==`string`&&x?{color:x}:null,background:typeof b==`string`&&b?b:y?`var(--page-surface, #f2f2f2)`:`rgba(148, 163, 184, 0.12)`,...y?{position:`sticky`,top:0,zIndex:2}:D?{position:`relative`}:null,...fe},children:D?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Jn,{value:t.label??t,onCommit:e=>D.header(n,e),hint:Ee(`editCell`,`Double-click to edit`),style:{paddingRight:6}}),n<e.length-1&&(0,B.jsx)(`span`,{className:`wb-tedit-grip`,title:Ee(`colWidth`,`Drag to resize the column`),onPointerDown:Ce(n)})]}):t.label??t},n))})}),(0,B.jsxs)(`tbody`,{children:[ce&&(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{colSpan:e.length,style:{padding:ue,textAlign:`center`,opacity:.6,...fe},children:v||`No data yet`})}),se.map((t,n)=>(0,B.jsx)(`tr`,{className:D?`wb-tedit-row`:void 0,style:{...f&&n%2==1?{background:`rgba(148, 163, 184, 0.07)`}:null,...Number.isFinite(Number(a?.[n]))&&a[n]>0?{height:a[n]}:null},children:e.map((e,a)=>{if(we.has(`${n},${a}`))return null;let c=Zn(r[n],i[a]),l=s?.[c],u=o?.[c],d=Math.max(1,Number(u?.c)||1),f=Math.max(1,Number(u?.r)||1);return(0,B.jsxs)(`td`,{className:D?`wb-tedit-cell${j?.r===n&&j?.c===a?` wb-tedit-cellon`:``}`:void 0,onMouseDownCapture:Se?te(n,a):void 0,"data-cell":D?`${n}-${a}`:void 0,colSpan:d>1?d:void 0,rowSpan:f>1?f:void 0,style:{padding:ue,...he(a)?{textAlign:he(a)}:null,...D?{position:`relative`}:null,...fe},children:[l??Qn(t?.[a]),D&&Se&&(0,B.jsx)(`span`,{className:`wb-tedit-rowgrip`,title:Ee(`rowHeight`,`Drag to set the row height — double-click to fit the content`),onPointerDown:Te(n),onDoubleClick:()=>D.resizeRow(n,0)})]},a)})},r[n]??n))]})]})})]})}var er={small:{cell:62,font:10.5,head:11,title:15,pad:4,gap:2},medium:{cell:92,font:12,head:12,title:18,pad:6,gap:3},large:{cell:124,font:13,head:13,title:22,pad:8,gap:4}},tr=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,nr=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),rr=366;function ir(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?``:Re(e),a=e=>{let t=i(r(e)),n=t?new Date(t):null;return n&&!Number.isNaN(n.getTime())?n:null};return n.map(e=>{let n=e.data??{},o=a(n[t.startField]);return o?{key:e.id,title:i(n[t.titleField||`name`])||i(n.name)||`Untitled`,start:o,end:a(n[t.endField]),href:t.hrefField?i(n[t.hrefField]):``,color:t.colorField?i(r(n[t.colorField])):``}:null}).filter(Boolean)}function ar(e){return(Array.isArray(e)?e:[]).map((e,t)=>{let n=e?.start?new Date(e.start):null;if(!n||Number.isNaN(n.getTime()))return null;let r=e?.end?new Date(e.end):null;return{key:e.key??`event-${t}`,title:e.title??``,start:n,end:r&&!Number.isNaN(r.getTime())?r:null,href:e.href??``,color:e.color??``}}).filter(Boolean)}function or(e){let t=new Map;for(let n of e){let e=nr(n.start),r=n.end?nr(n.end):e,i=Math.min(Math.max(0,Math.round((r-e)/864e5)),rr);for(let r=0;r<=i;r+=1){let i=tr(new Date(e.getFullYear(),e.getMonth(),e.getDate()+r));t.has(i)||t.set(i,[]),t.get(i).push(n)}}for(let e of t.values())e.sort((e,t)=>e.start-t.start);return t}function sr({events:e=[],source:t=``,titleField:n=``,startField:r=``,endField:i=``,hrefField:a=``,colorField:o=``,variant:s=`month`,size:c=`medium`,accent:u=``,eventBg:d=``,eventText:f=``,borderColor:p=``,weekStart:m=`monday`,max:h=3,emptyText:g=`No events`,style:_,nodeRef:v,interactive:y=!0}){let{tenant:b,apiUrl:x,locale:S}=(0,l.useContext)(ke),C=(0,l.useContext)(Ae)?.[t],[w,T]=(0,l.useState)(null),[E,D]=(0,l.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}});(0,l.useEffect)(()=>{if(!t||C)return;let e=!0;return fetch(`${x}/dynamic/${encodeURIComponent(t)}`,{headers:b?{"x-tenant":b}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&T(n)}).catch(()=>e&&T([])),()=>{e=!1}},[t,b,x,C]);let O=er[c]??er.medium,A=u||`var(--page-accent, #4f46e5)`,j=p||`var(--page-border, rgba(148, 163, 184, 0.35))`,ee=d||A,M=f||`var(--page-accent-text, #ffffff)`,N=t?ir(C??w??[],{titleField:n,startField:r,endField:i,hrefField:a,colorField:o}):ar(e),te=or(N),P=S||void 0,F=(e,t)=>{let n=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:e.color||M,flexShrink:0,opacity:e.color?1:.85}}),(0,B.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.title})]}),r={display:`flex`,alignItems:`center`,gap:5,background:e.color?`color-mix(in srgb, ${e.color} 18%, transparent)`:ee,color:e.color?`inherit`:M,borderRadius:4,padding:`2px 5px`,fontSize:O.font,lineHeight:1.35,textDecoration:`none`,...t};return e.href&&y?(0,B.jsx)(`a`,{href:e.href,style:r,title:e.title,children:n},e.key):(0,B.jsx)(`div`,{style:r,title:e.title,children:n},e.key)},ne=new Intl.DateTimeFormat(P,{month:`long`,year:`numeric`}).format(new Date(E.year,E.month,1)),re=e=>D(t=>{let n=new Date(t.year,t.month+e,1);return{year:n.getFullYear(),month:n.getMonth()}}),ie=(e,t)=>(0,B.jsx)(`button`,{type:`button`,"aria-label":e,onClick:()=>re(t),style:{background:`transparent`,border:`1px solid ${j}`,borderRadius:6,color:`inherit`,cursor:`pointer`,fontSize:O.head,lineHeight:1,padding:`4px 8px`},children:t<0?`‹`:`›`}),ae=(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:O.pad+2},children:[(0,B.jsx)(`div`,{style:{fontSize:O.title,fontWeight:700,flexGrow:1,fontFamily:`var(--page-heading-font, inherit)`},children:ne}),ie(`Previous month`,-1),ie(`Next month`,1)]});if(s===`list`){let e=N.filter(e=>e.start.getFullYear()===E.year&&e.start.getMonth()===E.month).sort((e,t)=>e.start-t.start),t=new Intl.DateTimeFormat(P,{day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`});return(0,B.jsxs)(`div`,{ref:v,style:{width:`100%`,...k(_)},children:[ae,e.length?(0,B.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:O.gap+2},children:e.map(e=>(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid ${j}`,paddingBottom:O.gap+2},children:[(0,B.jsx)(`span`,{style:{fontSize:O.font,opacity:.7,minWidth:96},children:t.format(e.start)}),F(e,{flexGrow:1,minWidth:0})]},e.key))}):(0,B.jsx)(`div`,{style:{fontSize:O.font,opacity:.6,padding:O.pad*2},children:g})]})}let I=new Date(E.year,E.month,1),L=m===`sunday`?0:1,oe=(I.getDay()-L+7)%7,se=new Date(E.year,E.month+1,0).getDate(),ce=Math.ceil((oe+se)/7),le=tr(new Date),ue=new Intl.DateTimeFormat(P,{weekday:`short`}),de=[];for(let e=0;e<ce*7;e+=1){let t=e-oe+1,n=t>=1&&t<=se,r=tr(new Date(E.year,E.month,t)),i=n?te.get(r)??[]:[],a=i.slice(0,Math.max(1,h)),o=n&&r===le;de.push((0,B.jsxs)(`div`,{style:{minHeight:O.cell,borderTop:`1px solid ${j}`,borderLeft:`1px solid ${j}`,padding:O.pad,display:`flex`,flexDirection:`column`,gap:O.gap,opacity:n?1:.35,minWidth:0},children:[(0,B.jsx)(`span`,{style:{fontSize:O.font,fontWeight:o?700:400,alignSelf:`flex-start`,borderRadius:`999px`,padding:o?`1px 6px`:0,background:o?A:`transparent`,color:o?M:`inherit`},children:n?t:new Date(E.year,E.month,t).getDate()}),a.map(e=>F(e)),i.length>a.length&&(0,B.jsx)(`span`,{style:{fontSize:O.font,opacity:.6},children:`+${i.length-a.length}`})]},e))}return(0,B.jsxs)(`div`,{ref:v,style:{width:`100%`,...k(_)},children:[ae,(0,B.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(7, minmax(0, 1fr))`},children:[Array.from({length:7},(e,t)=>(0,B.jsx)(`div`,{style:{fontSize:O.head,fontWeight:600,opacity:.7,textAlign:`center`,padding:`0 0 ${O.pad}px`},children:ue.format(new Date(2024,0,7+L+t))},`head-${t}`)),de]}),(0,B.jsx)(`div`,{style:{borderTop:`1px solid ${j}`}})]})}var cr={small:36,medium:56,large:88};function lr(e,t={}){let n=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`):[],r=e=>e==null?``:Re(e);return n.map(e=>{let n=e.data??e,i=Ie(n,t.imageField),a=Array.isArray(i)?i[0]:i,o=a&&typeof a==`object`?a.url??a.src??``:a,s=t.nameField?r(Ie(n,t.nameField)):r(n.name);return{src:typeof o==`string`?o.trim():``,alt:s,href:t.hrefField?r(Ie(n,t.hrefField)):``}}).filter(e=>e.src)}function ur({logos:e=[],source:t=``,imageField:n=``,nameField:r=``,hrefField:i=``,variant:a=`step`,size:o=`medium`,perView:s=5,gap:c=48,hold:u=3,slideMs:d=500,direction:f=`left`,arrows:p=`show`,pauseOnHover:m=!0,grayscale:h=!0,newTab:g=!0,emptyText:_=``,style:v,nodeRef:y,inert:b}){let{tenant:x,apiUrl:S}=(0,l.useContext)(ke),C=(0,l.useContext)(Ae)?.[t],[w,T]=(0,l.useState)(null),E=(0,l.useRef)(null),D=(0,l.useRef)(null),[O,A]=(0,l.useState)(0),[j,ee]=(0,l.useState)(0),[M,N]=(0,l.useState)(0),[te,P]=(0,l.useState)(!0),[F,ne]=(0,l.useState)(!1),[re,ie]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!t||C)return;let e=!0;return fetch(`${S}/dynamic/${encodeURIComponent(t)}`,{headers:x?{"x-tenant":x}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&T(n)}).catch(()=>e&&T([])),()=>{e=!1}},[t,x,S,C]),(0,l.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>ie(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),(0,l.useEffect)(()=>{let e=D.current;if(!e)return;let t=()=>A(e.clientWidth);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,l.useEffect)(()=>{let e=E.current;if(!e)return;let t=!0,n=()=>{let n=[...e.querySelectorAll(`img`)].filter(e=>e.complete&&e.naturalHeight).map(e=>e.naturalWidth/e.naturalHeight*L);t&&n.length&&ee(Math.ceil(Math.max(...n)))};n();let r=[...e.querySelectorAll(`img`)].filter(e=>!e.complete);return r.forEach(e=>e.addEventListener(`load`,n)),()=>{t=!1,r.forEach(e=>e.removeEventListener(`load`,n))}});let ae=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],I=t?lr(C??w??[],{imageField:n,nameField:r,hrefField:i}):ae,L=cr[o]??cr.medium,oe=Number.isFinite(Number(c))?Math.max(0,Number(c)):48,se=a===`marquee`?`step`:a,ce=Math.min(3e4,Math.max(300,(Number(u)||3)*1e3)),le=Math.min(3e3,Math.max(100,Number(d)||500)),ue=Math.min(12,Math.max(1,Math.round(Number(s)||5))),de=(j||L*3)+oe,pe=O?Math.max(1,Math.floor(O/de)):ue,me=Math.min(ue,pe),he=O?Math.min(de,O/me):de;if(!I.length)return(0,B.jsx)(`div`,{ref:y,style:{width:`100%`,...k(v)},children:b?(0,B.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexWrap:`wrap`,gap:oe},children:[0,1,2,3,4].map(e=>(0,B.jsx)(`div`,{style:{height:L,width:L*3,border:`1px dashed var(--page-border, rgba(148, 163, 184, 0.5))`,borderRadius:6,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:Math.max(10,Math.round(L/4)),opacity:.45,...fe},children:`LOGO`},e))}):_?(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.6,textAlign:`center`,padding:16},children:_}):null});let ge=I.length,_e=se===`step`&&ge>me,ve=se===`slider`,ye=_e&&!b&&!F&&!re,be=f===`right`,xe=be?ge:0,Se=_e?[...I,...I]:I,Ce=_e?M*he:0,we=(e,t,n)=>{let r=(0,B.jsx)(`img`,{src:e.src,alt:e.alt??``,style:{height:L,width:`auto`,maxWidth:`100%`,objectFit:`contain`,display:`block`}}),i=_e?{width:he,flex:`0 0 auto`,padding:`0 ${oe/2}px`,justifyContent:`center`}:{};return e.href&&!b?(0,B.jsx)(`a`,{href:e.href,className:`wb-logo`,title:e.alt||void 0,style:i,...g===!1?{}:{target:`_blank`,rel:`noopener noreferrer`},...n?{"aria-hidden":`true`,tabIndex:-1}:{},children:r},`${n?`c`:`o`}-${t}`):(0,B.jsx)(`div`,{className:`wb-logo`,style:i,...n?{"aria-hidden":`true`}:{},children:r},`${n?`c`:`o`}-${t}`)},Te=(0,B.jsx)(`div`,{ref:E,className:`wb-logos-track`,style:{display:`flex`,alignItems:`center`,..._e?{width:Se.length*he,transform:`translateX(-${Ce}px)`,transition:te?`transform ${le}ms ease`:`none`}:ve?{gap:oe,overflowX:`auto`,scrollBehavior:`smooth`,scrollSnapType:`x proximity`}:{gap:oe,flexWrap:`wrap`,justifyContent:`center`}},children:Se.map((e,t)=>we(e,t,_e&&t>=ge))}),R=e=>{if(ve){let t=E.current;t&&t.scrollBy({left:e*Math.max(120,t.clientWidth*.8),behavior:`smooth`});return}let t=M+e;if(t>=0&&t<=ge){P(!0),N(t);return}let n=t<0?ge:0;P(!1),N(n),requestAnimationFrame(()=>requestAnimationFrame(()=>{P(!0),N(n+e)}))},z=p===!1||p===`off`?`off`:p===`hover`?`hover`:`show`,Ee=z!==`off`&&(ve?O>0:_e),De=e=>(0,B.jsx)(`button`,{type:`button`,"aria-label":e<0?`Previous logos`:`Next logos`,onClick:()=>R(e),className:`wb-logos-arrow${z===`hover`?` wb-logos-arrow-shy`:``}`,style:{[e<0?`left`:`right`]:0},children:e<0?`‹`:`›`});return(0,B.jsxs)(`div`,{ref:e=>{D.current=e,y&&y(e)},className:`wb-logos`,style:{width:`100%`,position:`relative`,overflow:`hidden`,...k(v)},onMouseEnter:m===!1?void 0:()=>ne(!0),onMouseLeave:m===!1?void 0:()=>ne(!1),children:[(0,B.jsx)(`style`,{children:`
68
68
  .wb-logos .wb-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; box-sizing: border-box; }
69
69
  .wb-logos .wb-logo img { filter: ${h===!1?`none`:`grayscale(1)`}; opacity: ${h===!1?1:.7}; transition: filter .2s ease, opacity .2s ease; }
70
70
  .wb-logos .wb-logo:hover img { filter: none; opacity: 1; }
@@ -83,6 +83,6 @@ Error generating stack: `+e.message+`
83
83
  color: inherit; background: var(--page-surface, #f2f2f2);
84
84
  border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
85
85
  }
86
- `}),_e?(0,B.jsxs)(`div`,{style:{position:`relative`,width:me*he,maxWidth:`100%`,margin:`0 auto`},children:[Ee?De(-1):null,(0,B.jsx)(`div`,{style:{overflow:`hidden`},children:Te}),Ee?De(1):null]}):(0,B.jsxs)(B.Fragment,{children:[Ee?De(-1):null,Te,Ee?De(1):null]}),(0,B.jsx)(cr,{running:ye,every:ce+le,slide:le,step:be?-1:1,index:M,total:ge,home:xe,setIndex:N,setAnimate:P})]})}function cr({running:e,every:t,slide:n,step:r,index:i,total:a,home:o,setIndex:s,setAnimate:c}){(0,l.useEffect)(()=>{if(!e)return;let n=setInterval(()=>{c(!0),s(e=>e+r)},t);return()=>clearInterval(n)},[e,t,r,s,c]),(0,l.useEffect)(()=>{c(!1),s(o)},[o,s,c]);let u=r>0?i>=a:i<=0;return(0,l.useEffect)(()=>{if(!u||i===o)return;let e=setTimeout(()=>{c(!1),s(o)},n);return()=>clearTimeout(e)},[u,i,n,o,s,c]),null}var lr={small:380,medium:560,large:820,full:`100%`};function ur({dialogId:e=``,trigger:t=`button`,triggerLabel:n=`Open`,openOn:r=`trigger`,delay:i=0,size:a=`medium`,title:o=``,showClose:s=!0,backdropClose:c=!0,position:u=`center`,actions:d=[],showCloseAction:f=!1,closeLabel:p=`Close`,actionsAlign:m=`right`,linked:h,style:g,nodeRef:_,inert:v=!1}){let[y,b]=(0,l.useState)(!1),x=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(v||!e)return;let t=t=>{t.target.closest?.(`a[href="#${e}"], [data-webim-open="${e}"]`)&&(t.preventDefault(),b(!0))};return document.addEventListener(`click`,t),()=>document.removeEventListener(`click`,t)},[v,e]),(0,l.useEffect)(()=>{if(v||r!==`load`)return;let e=setTimeout(()=>b(!0),Math.max(0,Number(i)||0)*1e3);return()=>clearTimeout(e)},[v,r,i]),(0,l.useEffect)(()=>{if(v||!y)return;let e=e=>e.key===`Escape`&&b(!1);document.addEventListener(`keydown`,e);let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,x.current?.focus?.(),()=>{document.removeEventListener(`keydown`,e),document.body.style.overflow=t}},[v,y]);let S=lr[a]??lr.medium,C=e=>{let t={padding:`9px 16px`,borderRadius:6,cursor:`pointer`,fontSize:14,fontFamily:`inherit`,textDecoration:`none`,display:`inline-block`,...{primary:{background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`,border:`1px solid transparent`},outline:{background:`transparent`,color:`inherit`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},text:{background:`transparent`,color:`inherit`,border:`1px solid transparent`},danger:{background:`#dc2626`,color:`#ffffff`,border:`1px solid transparent`}}[e.variant??`primary`]??{}};return e.href&&!v?(0,B.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:t,children:e.label},e.key):(0,B.jsx)(`button`,{type:`button`,onClick:()=>!v&&b(!1),style:t,children:e.label},e.key)},w=Array.isArray(d)?d:[],T=w.filter(e=>e.side===`left`),E=w.filter(e=>e.side!==`left`),D=f===!0?C({key:`__close`,label:p||`Close`,variant:`outline`}):null,O=T.length||E.length||D?(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`14px 20px`,borderTop:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,justifyContent:T.length?`space-between`:m===`left`?`flex-start`:m===`center`?`center`:`flex-end`},children:[T.length>0&&(0,B.jsx)(`div`,{style:{display:`flex`,gap:8},children:T.map(C)}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[D,E.map(C)]})]}):null,A=(0,B.jsxs)(`div`,{ref:x,role:`dialog`,"aria-modal":v?void 0:`true`,"aria-label":o||void 0,tabIndex:-1,onClick:e=>e.stopPropagation(),style:{width:typeof S==`number`?`min(${S}px, 100%)`:S,maxHeight:v?void 0:`85vh`,overflowY:v?void 0:`auto`,borderRadius:12,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,boxShadow:v?`none`:`0 24px 64px rgba(15, 23, 42, 0.35)`,outline:`none`,...k(g)},children:[(o||s!==!1)&&(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`16px 20px`,borderBottom:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},children:[(0,B.jsx)(`span`,{style:{fontWeight:700,fontSize:17,flexGrow:1,fontFamily:`var(--page-heading-font, inherit)`},children:o}),s!==!1&&(0,B.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>!v&&b(!1),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:2,opacity:.7},children:`✕`})]}),(0,B.jsx)(`div`,{style:{padding:20},children:h?.content}),O]});return(0,B.jsxs)(`div`,{ref:_,id:e||void 0,style:v?void 0:{display:`contents`},children:[t===`button`&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>!v&&b(!0),style:{padding:`10px 18px`,border:0,borderRadius:6,cursor:`pointer`,fontSize:15,fontFamily:`inherit`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:n}),v?(0,B.jsx)(`div`,{style:{marginTop:t===`button`?12:0},children:A}):y&&(0,B.jsx)(`div`,{onClick:c===!1?void 0:()=>b(!1),style:{position:`fixed`,inset:0,zIndex:2147483e3,display:`flex`,alignItems:u===`top`?`flex-start`:`center`,justifyContent:`center`,padding:20,paddingTop:u===`top`?`8vh`:20,background:`rgba(15, 23, 42, 0.55)`,backdropFilter:`blur(2px)`},children:A})]})}var dr={PageRoot:qe,CalendarBlock:ir,LogoCarousel:sr,DialogBlock:ur,Section:Je,Container:Ye,Heading:Xe,TextBlock:ct,ButtonBlock:dt,ImageBlock:ft,Spacer:vt,Divider:yt,SliderBlock:Tt,CanvasSlider:Et,TabsBlock:Ut,QuickStack:gn,CollectionList:_n,CollectionSearch:vn,BreadcrumbsBlock:yn,PaginationBlock:bn,StepperBlock:Mn,SocialLinksBlock:jn,ThemeModeBlock:Tn,ScrollTopBlock:kn,OrgChartBlock:Wn,TableBlock:Xn,IconBlock:It,MapBlock:Pt,MasonryBlock:Rt,AccordionBlock:Wt,NavbarBlock:Ht,ListBlock:st,TextSpan:et,QuoteBlock:ot,TextLink:ut,RichTextBlock:it,RichContentBlock:it,VideoBlock:pt,YouTubeBlock:ht,IframeBlock:gt,EmbedBlock:_t,FormBlock:rn,FormLabel:ln,FormInput:un,FormTextarea:dn,FormCheckbox:e=>(0,B.jsx)(fn,{kind:`checkbox`,...e}),FormRadio:e=>(0,B.jsx)(fn,{kind:`radio`,...e}),FormSelect:pn,FormFile:mn,FormRecaptcha:cn,FormSubmit:hn},fr={id:`auth`,label:`Accounts`,category:`Apps`,keys:[`SiteLoginForm`,`SiteAccountMenu`],ssr:`shell`,settings:[`site.authRedirect`]},pr=(0,l.createContext)({user:null,status:`idle`,ensure:()=>{},refresh:()=>{},signOut:()=>{}});function mr(e,t){return t?/^https?:\/\//i.test(t)?t:`${e.replace(/\/+$/,``)}${t.startsWith(`/`)?t:`/${t}`}`:``}function hr(e){let t=e&&typeof e==`object`?e[`site.session`]:null,n=t&&typeof t==`object`&&!Array.isArray(t)?t:{},r=e=>typeof e==`string`?e.trim():``,i=r(n.url),a=r(n.mePath),o=r(n.logoutPath);return{mode:n.mode===`custom`||n.mode===`off`?n.mode:`system`,url:i,mePath:a,logoutPath:o,meUrl:mr(i,a),logoutUrl:mr(i,o),loginPage:r(n.loginPage),userPath:r(n.userPath),auth:n.auth===`bearer`?`bearer`:`cookies`,tokenKey:r(n.tokenKey)||`webim_session_token`}}function gr(e,t){if(!t)return e??null;let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`)return null;n=n[e]}return n??null}function _r(e){try{return window.localStorage.getItem(e)||``}catch{return``}}function vr(e){try{window.localStorage.removeItem(e)}catch{}}var yr=()=>{let e=(0,l.useContext)(pr);return(0,l.useEffect)(()=>{e.ensure()},[e]),e};function br({children:e,initialUser:t,disabled:n,apiUrl:r,tenant:i}){let a=(0,l.useContext)(ke),o=r||a?.apiUrl||`/api`,s=i||a?.tenant||``,c=(0,l.useMemo)(()=>hr(a?.settings),[a?.settings]),[u,d]=(0,l.useState)(t??null),[f,p]=(0,l.useState)(t?`user`:n?`guest`:`idle`),m=(0,l.useRef)(!1),h=(0,l.useCallback)((e,t)=>fetch(`${o}${e}`,{...t,credentials:`include`,headers:{"content-type":`application/json`,...s?{"x-tenant":s}:{},...t?.headers}}),[o,s]),g=(0,l.useCallback)(e=>(d(e),p(e?`user`:`guest`),e),[]),_=(0,l.useCallback)(()=>{if(n)return Promise.resolve(null);if(c.mode===`off`)return Promise.resolve(g(null));if(c.mode===`custom`){let e=c.auth===`bearer`?_r(c.tokenKey):``;return!c.meUrl||c.auth===`bearer`&&!e?Promise.resolve(g(null)):fetch(c.meUrl,{...c.auth===`bearer`?{headers:{authorization:`Bearer ${e}`}}:{credentials:`include`}}).then(e=>e.ok?e.json():null).then(e=>{let t=gr(e,c.userPath);return g(t&&typeof t==`object`?t:null)}).catch(()=>g(null))}return h(`/site/me`).then(e=>e.ok?e.json():null).then(e=>g(e?.payload??null)).catch(()=>g(null))},[h,c,n,g]),v=(0,l.useCallback)(()=>{if(c.mode===`off`)return g(null),Promise.resolve();if(c.mode===`custom`){let e=c.auth===`bearer`?_r(c.tokenKey):``;return(c.logoutUrl?fetch(c.logoutUrl,{method:`post`,...c.auth===`bearer`?{headers:e?{authorization:`Bearer ${e}`}:{}}:{credentials:`include`}}).catch(()=>{}):Promise.resolve()).then(()=>{c.auth===`bearer`&&vr(c.tokenKey),g(null)})}return h(`/site/logout`,{method:`post`}).catch(()=>{}).then(()=>{g(null)})},[h,c,g]),y=(0,l.useCallback)(()=>{m.current||n||t||(m.current=!0,p(`loading`),_())},[n,t,_]),b=(0,l.useMemo)(()=>({user:u,status:f,ensure:y,refresh:_,signOut:v}),[u,f,y,_,v]);return(0,l.useEffect)(()=>{n||typeof window>`u`||(window.webim={...window.webim,user:u,status:f,loginUrl:c.loginPage||null,requireUser:()=>m.current||t?Promise.resolve(u):_(),refresh:_,signOut:v},window.dispatchEvent(new CustomEvent(`webim:session`,{detail:{user:u,status:f}})))},[n,u,f,t,c.loginPage,_,v]),(0,B.jsx)(pr.Provider,{value:b,children:e})}function xr({when:e,children:t}){let{status:n}=yr();return!e||e===`always`?t:n===`idle`||n===`loading`?null:e===`user`==(n===`user`)?t:null}function Sr({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)(ke),[h,g]=(0,l.useState)(`form`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(!1),x=e===`register`,S=c?d||`form`:h,C=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:``,w=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=C(t)||C(new URLSearchParams(window.location.search).get(`next`))||C(m?.[`site.authRedirect`])||C(m?.[`apps.auth.redirect`])||`/`;window.location.assign(e)}}catch{v(`Sign-in failed`),g(`error`),b(!1)}};return(0,B.jsxs)(`div`,{ref:s,style:{display:`grid`,gap:12,maxWidth:360,...k(o)},children:[(0,B.jsxs)(`form`,{onSubmit:w,style:{display:S===`form`?`grid`:`none`,gap:10},children:[x?(0,B.jsxs)(`label`,{style:{...Kt,display:`grid`,gap:6},children:[i,(0,B.jsx)(`input`,{name:`name`,type:`text`,style:qt,...Yt(c)})]}):null,(0,B.jsxs)(`label`,{style:{...Kt,display:`grid`,gap:6},children:[n,(0,B.jsx)(`input`,{name:`email`,type:`email`,required:!c,style:qt,...Yt(c)})]}),(0,B.jsxs)(`label`,{style:{...Kt,display:`grid`,gap:6},children:[r,(0,B.jsx)(`input`,{name:`password`,type:`password`,required:!c,style:qt,...Yt(c)})]}),(0,B.jsx)(`button`,{type:c?`button`:`submit`,disabled:y||void 0,style:{...He,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,B.jsx)(`p`,{style:{margin:0,fontSize:14,color:`#dc2626`},children:_}):null]}),(0,B.jsx)(`div`,{style:{display:S===`success`?`block`:`none`},children:u?.success??null}),(0,B.jsx)(`div`,{style:{display:S===`error`?`block`:`none`},children:u?.error??null})]})}function Cr({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}=yr(),d=a?s||`user`:l,f=a?{name:`Ada Lovelace`,email:`ada@example.com`}:c;return d===`loading`?(0,B.jsx)(`div`,{ref:i,style:{minHeight:24,...k(r)}}):d===`user`?(0,B.jsxs)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...k(r)},children:[(0,B.jsxs)(`span`,{style:{...Kt,fontWeight:600},children:[e,` `,f?.name||f?.email||``]}),n&&f?.email?(0,B.jsx)(`span`,{style:{...Kt,opacity:.7},children:f.email}):null,(0,B.jsx)(`button`,{type:`button`,onClick:a?void 0:u,style:{...He,border:0,padding:`8px 16px`,borderRadius:8,fontSize:14,cursor:a?`default`:`pointer`},...Yt(a),children:t})]}):(0,B.jsx)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...k(r)},children:o?.signedOut??null})}var wr={id:`consent`,label:`Cookie consent`,category:`Apps`,keys:[`CookieConsent`],ssr:`shell`,settings:[]},Tr=`webim.cookie_consent`;function Er(){try{let e=window.localStorage.getItem(Tr),t=e?JSON.parse(e):null;return t?.choice===`accepted`||t?.choice===`declined`?t.choice:``}catch{return``}}function Dr(e){try{document.querySelectorAll(`.webim-page`).forEach(t=>t.setAttribute(`data-webim-consent`,e))}catch{}}function Or(e){try{window.localStorage.setItem(Tr,JSON.stringify({choice:e,at:new Date().toISOString()}))}catch{}Dr(e);try{window.dispatchEvent(new CustomEvent(`webim:consent`,{detail:{choice:e}}))}catch{}}var kr={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 Ar({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=Er();e?Dr(e):p(!0)},[d,m]),!f)return null;let _=e=>()=>{d||(Or(e),p(!1))},v=kr[o]??kr.bottom,y={appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,padding:`8px 16px`,borderRadius:8,cursor:d?`default`:`pointer`,whiteSpace:`nowrap`};return(0,B.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,...k(c)},children:[(0,B.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,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`a`,{href:a,onClick:d?e=>e.preventDefault():void 0,style:{color:`var(--page-accent, inherit)`,textDecoration:`underline`},children:i})]}):null]}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8,flexShrink:0},children:[r===!1?null:(0,B.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,B.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 jr={id:`language`,label:`Language`,category:`Apps`,keys:[`SiteLanguagePicker`],ssr:`prefetch`,settings:[`locales`]},Mr={id:`search`,label:`Search`,category:`Apps`,keys:[`SiteSearch`],ssr:`prefetch`,settings:[]},Nr=50,Pr=2e3;function Fr(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`q`)??``}function Ir(e,t){let n=e?.data??{},r=[];for(let e of Object.values(n)){let t=e==null?``:Re(e);if(t&&r.push(t),r.join(` `).length>Pr)break}return r.join(` `).slice(0,Pr).toLocaleLowerCase(t||void 0)}function Lr({placeholder:e=`Search…`,buttonLabel:t=`Search`,showButton:n=!0,live:r=!1,layout:i=`inline`,includePages:a=!0,collections:o=[],limit:s=10,emptyText:c=`Nothing found`,hint:u=``,style:d,nodeRef:f,inert:p=!1,sample:m=!1}){let{tenant:h,apiUrl:g,locale:_}=(0,l.useContext)(ke),[v,y]=(0,l.useState)(()=>Fr()),[b,x]=(0,l.useState)(()=>Fr()),[S,C]=(0,l.useState)(null),[w,T]=(0,l.useState)(!1),E=(0,l.useRef)(null),D=i===`popup`;(0,l.useEffect)(()=>{let e=()=>{let e=Fr();y(e),x(e)};return window.addEventListener(`popstate`,e),window.addEventListener(`webim:urlchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`webim:urlchange`,e)}},[]),(0,l.useEffect)(()=>{if(!r)return;let e=setTimeout(()=>{y(b),b.trim()&&T(!0)},200);return()=>clearTimeout(e)},[r,b]),(0,l.useEffect)(()=>{if(!D)return;let e=e=>{E.current&&!E.current.contains(e.target)&&T(!1)},t=e=>e.key===`Escape`&&T(!1);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[D]),(0,l.useEffect)(()=>{let e=!0,t=h?{"x-tenant":h}:{},n=e=>fetch(`${g}${e}`,{headers:t}).then(e=>e.json()).then(e=>e?.payload).catch(()=>null),r=[a?n(`/site/pages`).then(e=>({kind:`page`,rows:Array.isArray(e)?e:[]})):null,...(Array.isArray(o)?o:[]).filter(Boolean).map(e=>n(`/dynamic/${encodeURIComponent(e)}?all=1${_?`&locale=${encodeURIComponent(_)}`:``}`).then(t=>({kind:`entry`,slug:e,rows:Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[]})))].filter(Boolean);return Promise.all(r).then(t=>e&&C(t)),()=>{e=!1}},[g,h,_,a,JSON.stringify(o)]);let O=v.trim().toLocaleLowerCase(_||void 0),A=[];if(O&&S)for(let e of S)if(e.kind===`page`)for(let t of e.rows){if(t?.access&&t.access!==`public`)continue;let e=String(t?.title??``);`${e} ${t?.slug??``}`.toLocaleLowerCase(_||void 0).includes(O)&&A.push({key:`page:${t.slug}`,title:e||t.slug,url:`/${t.slug}`,kind:`page`})}else for(let t of e.rows){if(!Ir(t,_).includes(O))continue;let n=t?.data??{},r=Re(n.name)||`Untitled`,i=Re(n.slug);A.push({key:`entry:${t.id}`,title:r,url:i?`/${e.slug}/${i}`:`/${e.slug}`,kind:`entry`})}let j=A.slice(0,Math.min(Math.max(1,s),Nr)),ee=e=>{if(p){e.preventDefault(),y(b),T(!0);return}if(typeof window>`u`||!window.history?.pushState)return;e.preventDefault();let t=new URLSearchParams(window.location.search);b.trim()?t.set(`q`,b.trim()):t.delete(`q`),t.delete(`page`);let n=t.toString();window.history.pushState({},``,`${window.location.pathname}${n?`?${n}`:``}`),window.dispatchEvent(new Event(`webim:urlchange`)),T(!0)},M=m&&!O?[{key:`sample-1`,title:`About us`,url:`/about`,kind:`page`},{key:`sample-2`,title:`Spring collection`,url:`/blog/spring`,kind:`entry`}]:null,N=M??j,te=!M&&O&&S&&!j.length,P=!D||w&&(N.length>0||te),F=N.length>0&&(0,B.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:2},children:N.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`a`,{href:p?void 0:e.url,style:{display:`block`,padding:`10px 12px`,borderRadius:6,color:`inherit`,textDecoration:`none`,border:D?0:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},children:[(0,B.jsx)(`span`,{style:{display:`block`,fontWeight:600},children:e.title}),(0,B.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6},children:e.url})]})},e.key))});return(0,B.jsx)(`div`,{ref:f,style:{width:`100%`,...k(d)},children:(0,B.jsxs)(`div`,{ref:E,style:{position:`relative`},children:[(0,B.jsxs)(`form`,{method:`get`,onSubmit:ee,style:{display:`flex`,gap:8,alignItems:`center`},children:[(0,B.jsx)(`input`,{type:`search`,name:`q`,value:b,placeholder:e,onChange:e=>x(e.target.value),onFocus:()=>O&&T(!0),style:{...qt,flexGrow:1,minWidth:0}}),n!==!1&&(0,B.jsx)(`button`,{type:`submit`,style:{padding:`10px 16px`,border:0,borderRadius:6,cursor:`pointer`,fontSize:14,fontFamily:`inherit`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:t})]}),u&&(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.65,marginTop:6},children:u}),P&&(0,B.jsxs)(`div`,{style:D?{position:`absolute`,top:`100%`,left:0,right:0,zIndex:30,marginTop:6,padding:6,maxHeight:320,overflowY:`auto`,borderRadius:8,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,background:`var(--page-surface, #f2f2f2)`,boxShadow:`0 12px 32px rgba(15, 23, 42, 0.18)`}:{marginTop:14},children:[F,te&&(0,B.jsx)(`div`,{style:{fontSize:14,opacity:.65,padding:D?`10px 12px`:0},children:c})]})]})})}function Rr(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 zr=e=>e&&e.charAt(0).toUpperCase()+e.slice(1);function Br(e,t){let n=String(e??``).toUpperCase();if(t===`code`)return n;let r=``;try{r=zr(new Intl.DisplayNames([e],{type:`language`}).of(e)??``)}catch{}return!r||r.toUpperCase()===n?n:t===`both`?`${n} — ${r}`:r}function Vr(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 Hr({variant:e,display:t,separator:n,label:r,style:i,nodeRef:a,inert:o}){let s=(0,l.useContext)(ke),c=Rr(s?.settings),u=c[0]??``,d=c.includes(s?.locale)?s.locale:u,f={display:`inline-flex`,alignItems:`center`,gap:8,...k(i)};if(c.length<2)return o?(0,B.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,B.jsx)(`span`,{style:{opacity:.7},children:r}):null;return e===`inline`?(0,B.jsxs)(`div`,{ref:a,style:f,children:[p,c.map((e,r)=>(0,B.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[r>0&&(0,B.jsx)(`span`,{style:{opacity:.4},children:n??`·`}),(0,B.jsx)(`a`,{href:Vr(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:Br(e,t)})]},e))]}):(0,B.jsxs)(`div`,{ref:a,style:f,children:[p,(0,B.jsx)(`select`,{"aria-label":r||`Language`,value:d,onChange:o?void 0:e=>{let t=e.target.value;window.location.assign(Vr(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,B.jsx)(`option`,{value:e,children:Br(e,t)},e))})]})}var Ur=[fr,jr,wr,Mr],Wr={SiteLoginForm:Sr,SiteAccountMenu:Cr,SiteLanguagePicker:Hr,CookieConsent:Ar,SiteSearch:Lr};new Set(Ur.filter(e=>e.ssr===`shell`).flatMap(e=>e.keys));var Gr=new Map;function Kr(e){if(Gr.has(e))return Gr.get(e);let t=URL.createObjectURL(new Blob([e],{type:`text/javascript`})),n=import(t).finally(()=>URL.revokeObjectURL(t));return Gr.set(e,n),n}function qr(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 Jr(e,t){let n=await Kr(e);return(Array.isArray(n?.default?.blocks)?n.default.blocks:[]).find(e=>e?.id===t&&typeof e.mount==`function`)??null}var Yr={padding:`10px 12px`,border:`1px dashed rgba(148, 163, 184, 0.5)`,borderRadius:8,fontSize:12,opacity:.6};function Xr({pluginId:e,blockId:t,props:n,style:r,nodeRef:i}){let a=(0,l.useContext)(ke),o=qr(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 Jr(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,B.jsx)(`div`,{ref:i,style:k(r),children:(0,B.jsx)(`div`,{ref:s})}):(0,B.jsxs)(`div`,{ref:i,style:{...Yr,...k(r)},children:[`Plugin “`,e,`” is not installed`]})}var Zr={...dr,...Wr,PluginBlock:Xr};function Qr(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,B.jsx)(l.Fragment,{children:Qr(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=Zr[o];if(!c)return null;let u=(a.nodes??[]).map(e=>Qr(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,a])=>[e,Qr(a,t,n,r,i)])):void 0,p=(0,B.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),ie(t,s),re(t,i?.events===!1?[]:s.events))},children:u.length?u:void 0},e);return s.when&&s.when!==`always`?(0,B.jsx)(xr,{when:s.when,children:p},e):p}var $r=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `),ei=e=>`.webim-page[data-webim-mode="light"] { ${Object.entries(ye(e.light)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }
87
- .webim-page[data-webim-mode="dark"] { ${Object.entries(ye(e.dark)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }`;function ti({blocks:e,theme:t,components:n,mode:r=`auto`,style:i,custom:a,animations:o,tenant:s,apiUrl:c,datasets:u,locale:d,direction:f,settings:p,siteUser:m}){let g=a?.js?.trim();if((0,l.useEffect)(()=>{if(!g)return;let e=document.createElement(`script`);return e.text=g,document.body.appendChild(e),()=>e.remove()},[g]),!e?.ROOT)return null;let _={lang:d||void 0,dir:De(f,d)},y=`.webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }`,b={minHeight:`100%`,display:`flex`,flexDirection:`column`},x=Qr(`ROOT`,e,n),S=(0,l.useMemo)(()=>({render:(t,r)=>Qr(t,e,n,void 0,{mapProps:r})}),[e,n]),C=ue(e,n),w=le(e,n),E=a?.css?.trim(),D=T(o),O=ve(t),k=[O.font,O.headingFont].filter(e=>typeof e==`string`&&e.trim()&&e!==`inherit`&&!he[e]),A=[...new Set([...v(e,n),...k])].map(e=>(0,B.jsx)(`link`,{rel:`stylesheet`,precedence:`default`,href:h(e)},e)),j=ei(O);return r===`auto`?(0,B.jsx)(ke.Provider,{value:{tenant:s||``,apiUrl:c||`/api`,locale:d||``,settings:p??null},children:(0,B.jsx)(br,{initialUser:m,children:(0,B.jsx)(Ae.Provider,{value:u??null,children:(0,B.jsx)(Pe.Provider,{value:S,children:(0,B.jsxs)(`div`,{..._,className:`webim-page`,style:{...b,...be(t),...i},children:[(0,B.jsx)(`style`,{children:`.webim-page { ${$r(ye(O.light))} }
88
- @media (prefers-color-scheme: dark) { .webim-page { ${$r(ye(O.dark))} } }`}),(0,B.jsx)(`style`,{children:j}),A,(0,B.jsx)(`style`,{children:y}),C&&(0,B.jsx)(`style`,{children:C}),w&&(0,B.jsx)(`style`,{children:w}),E&&(0,B.jsx)(`style`,{children:E}),x]})})})})}):(0,B.jsx)(ke.Provider,{value:{tenant:s||``,apiUrl:c||`/api`,locale:d||``,settings:p??null},children:(0,B.jsx)(br,{initialUser:m,children:(0,B.jsx)(Ae.Provider,{value:u??null,children:(0,B.jsx)(Pe.Provider,{value:S,children:(0,B.jsxs)(`div`,{..._,className:`webim-page`,style:{...b,...xe(t,r),...i},children:[A,(0,B.jsx)(`style`,{children:j}),(0,B.jsx)(`style`,{children:y}),C&&(0,B.jsx)(`style`,{children:C}),w&&(0,B.jsx)(`style`,{children:w}),D&&(0,B.jsx)(`style`,{children:D}),D&&(0,B.jsx)(`style`,{children:D}),E&&(0,B.jsx)(`style`,{children:E}),x]})})})})})}function ni({bundle:e,mode:t=`auto`,style:n}){return e?.blocks?.ROOT?(0,B.jsx)(ti,{blocks:e.blocks,theme:e.theme,components:e.components,custom:e.custom,animations:e.animations,tenant:e.tenant,apiUrl:e.apiUrl,datasets:e.datasets,locale:e.locale,direction:e.direction,settings:e.settings,mode:Ce(t,e.scheme),style:n}):null}function ri({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`}),R({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,B.jsx)(ni,{bundle:p.bundle,mode:o,style:s})}function ii(e,t={}){let n=(0,u.createRoot)(e);return n.render((0,B.jsx)(ri,{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 ai(e=document){for(let t of e.querySelectorAll(`[data-webim-page]:not([data-webim-mounted])`))t.setAttribute(`data-webim-mounted`,``),ii(t,t.dataset)}var oi=document.currentScript,si=()=>{if(ai(),oi?.dataset.slug){let e=document.createElement(`div`);e.setAttribute(`data-webim-mounted`,``),oi.parentElement&&oi.parentElement!==document.head?oi.insertAdjacentElement(`beforebegin`,e):document.body.appendChild(e),ii(e,oi.dataset)}};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,si,{once:!0}):si(),window.WebimEmbed={mount:ii,scan:ai}})();
86
+ `}),_e?(0,B.jsxs)(`div`,{style:{position:`relative`,width:me*he,maxWidth:`100%`,margin:`0 auto`},children:[Ee?De(-1):null,(0,B.jsx)(`div`,{style:{overflow:`hidden`},children:Te}),Ee?De(1):null]}):(0,B.jsxs)(B.Fragment,{children:[Ee?De(-1):null,Te,Ee?De(1):null]}),(0,B.jsx)(dr,{running:ye,every:ce+le,slide:le,step:be?-1:1,index:M,total:ge,home:xe,setIndex:N,setAnimate:P})]})}function dr({running:e,every:t,slide:n,step:r,index:i,total:a,home:o,setIndex:s,setAnimate:c}){(0,l.useEffect)(()=>{if(!e)return;let n=setInterval(()=>{c(!0),s(e=>e+r)},t);return()=>clearInterval(n)},[e,t,r,s,c]),(0,l.useEffect)(()=>{c(!1),s(o)},[o,s,c]);let u=r>0?i>=a:i<=0;return(0,l.useEffect)(()=>{if(!u||i===o)return;let e=setTimeout(()=>{c(!1),s(o)},n);return()=>clearTimeout(e)},[u,i,n,o,s,c]),null}var fr={small:380,medium:560,large:820,full:`100%`};function pr({dialogId:e=``,trigger:t=`button`,triggerLabel:n=`Open`,openOn:r=`trigger`,delay:i=0,size:a=`medium`,title:o=``,showClose:s=!0,backdropClose:c=!0,position:u=`center`,actions:d=[],showCloseAction:f=!1,closeLabel:p=`Close`,actionsAlign:m=`right`,linked:h,style:g,nodeRef:_,inert:v=!1}){let[y,b]=(0,l.useState)(!1),x=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(v||!e)return;let t=t=>{t.target.closest?.(`a[href="#${e}"], [data-webim-open="${e}"]`)&&(t.preventDefault(),b(!0))};return document.addEventListener(`click`,t),()=>document.removeEventListener(`click`,t)},[v,e]),(0,l.useEffect)(()=>{if(v||r!==`load`)return;let e=setTimeout(()=>b(!0),Math.max(0,Number(i)||0)*1e3);return()=>clearTimeout(e)},[v,r,i]),(0,l.useEffect)(()=>{if(v||!y)return;let e=e=>e.key===`Escape`&&b(!1);document.addEventListener(`keydown`,e);let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,x.current?.focus?.(),()=>{document.removeEventListener(`keydown`,e),document.body.style.overflow=t}},[v,y]);let S=fr[a]??fr.medium,C=e=>{let t={padding:`9px 16px`,borderRadius:6,cursor:`pointer`,fontSize:14,fontFamily:`inherit`,textDecoration:`none`,display:`inline-block`,...{primary:{background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`,border:`1px solid transparent`},outline:{background:`transparent`,color:`inherit`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},text:{background:`transparent`,color:`inherit`,border:`1px solid transparent`},danger:{background:`#dc2626`,color:`#ffffff`,border:`1px solid transparent`}}[e.variant??`primary`]??{}};return e.href&&!v?(0,B.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:t,children:e.label},e.key):(0,B.jsx)(`button`,{type:`button`,onClick:()=>!v&&b(!1),style:t,children:e.label},e.key)},w=Array.isArray(d)?d:[],T=w.filter(e=>e.side===`left`),E=w.filter(e=>e.side!==`left`),D=f===!0?C({key:`__close`,label:p||`Close`,variant:`outline`}):null,O=T.length||E.length||D?(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`14px 20px`,borderTop:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,justifyContent:T.length?`space-between`:m===`left`?`flex-start`:m===`center`?`center`:`flex-end`},children:[T.length>0&&(0,B.jsx)(`div`,{style:{display:`flex`,gap:8},children:T.map(C)}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[D,E.map(C)]})]}):null,A=(0,B.jsxs)(`div`,{ref:x,role:`dialog`,"aria-modal":v?void 0:`true`,"aria-label":o||void 0,tabIndex:-1,onClick:e=>e.stopPropagation(),style:{width:typeof S==`number`?`min(${S}px, 100%)`:S,maxHeight:v?void 0:`85vh`,overflowY:v?void 0:`auto`,borderRadius:12,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,boxShadow:v?`none`:`0 24px 64px rgba(15, 23, 42, 0.35)`,outline:`none`,...k(g)},children:[(o||s!==!1)&&(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`16px 20px`,borderBottom:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},children:[(0,B.jsx)(`span`,{style:{fontWeight:700,fontSize:17,flexGrow:1,fontFamily:`var(--page-heading-font, inherit)`},children:o}),s!==!1&&(0,B.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>!v&&b(!1),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:2,opacity:.7},children:`✕`})]}),(0,B.jsx)(`div`,{style:{padding:20},children:h?.content}),O]});return(0,B.jsxs)(`div`,{ref:_,id:e||void 0,style:v?void 0:{display:`contents`},children:[t===`button`&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>!v&&b(!0),style:{padding:`10px 18px`,border:0,borderRadius:6,cursor:`pointer`,fontSize:15,fontFamily:`inherit`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:n}),v?(0,B.jsx)(`div`,{style:{marginTop:t===`button`?12:0},children:A}):y&&(0,B.jsx)(`div`,{onClick:c===!1?void 0:()=>b(!1),style:{position:`fixed`,inset:0,zIndex:2147483e3,display:`flex`,alignItems:u===`top`?`flex-start`:`center`,justifyContent:`center`,padding:20,paddingTop:u===`top`?`8vh`:20,background:`rgba(15, 23, 42, 0.55)`,backdropFilter:`blur(2px)`},children:A})]})}var mr={PageRoot:qe,CalendarBlock:sr,LogoCarousel:ur,DialogBlock:pr,Section:Je,Container:Ye,Heading:Xe,TextBlock:dt,ButtonBlock:mt,ImageBlock:ht,Spacer:xt,Divider:St,SliderBlock:Ot,CanvasSlider:kt,TabsBlock:Kt,QuickStack:yn,CollectionList:bn,CollectionSearch:xn,BreadcrumbsBlock:Sn,PaginationBlock:Cn,StepperBlock:Fn,SocialLinksBlock:Pn,ThemeModeBlock:On,ScrollTopBlock:Mn,OrgChartBlock:qn,TableBlock:$n,IconBlock:zt,MapBlock:Lt,MasonryBlock:Vt,AccordionBlock:qt,NavbarBlock:Gt,ListBlock:ut,TextSpan:et,QuoteBlock:lt,TextLink:pt,RichTextBlock:st,RichContentBlock:st,VideoBlock:gt,YouTubeBlock:vt,IframeBlock:yt,EmbedBlock:bt,FormBlock:sn,FormLabel:fn,FormInput:pn,FormTextarea:mn,FormCheckbox:e=>(0,B.jsx)(hn,{kind:`checkbox`,...e}),FormRadio:e=>(0,B.jsx)(hn,{kind:`radio`,...e}),FormSelect:gn,FormFile:_n,FormRecaptcha:dn,FormSubmit:vn},hr={id:`auth`,label:`Accounts`,category:`Apps`,keys:[`SiteLoginForm`,`SiteAccountMenu`],ssr:`shell`,settings:[`site.authRedirect`]},gr=(0,l.createContext)({user:null,status:`idle`,ensure:()=>{},refresh:()=>{},signOut:()=>{}});function _r(e,t){return t?/^https?:\/\//i.test(t)?t:`${e.replace(/\/+$/,``)}${t.startsWith(`/`)?t:`/${t}`}`:``}function vr(e){let t=e&&typeof e==`object`?e[`site.session`]:null,n=t&&typeof t==`object`&&!Array.isArray(t)?t:{},r=e=>typeof e==`string`?e.trim():``,i=r(n.url),a=r(n.mePath),o=r(n.logoutPath);return{mode:n.mode===`custom`||n.mode===`off`?n.mode:`system`,url:i,mePath:a,logoutPath:o,meUrl:_r(i,a),logoutUrl:_r(i,o),loginPage:r(n.loginPage),userPath:r(n.userPath),auth:n.auth===`bearer`?`bearer`:`cookies`,tokenKey:r(n.tokenKey)||`webim_session_token`}}function yr(e,t){if(!t)return e??null;let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`)return null;n=n[e]}return n??null}function br(e){try{return window.localStorage.getItem(e)||``}catch{return``}}function xr(e){try{window.localStorage.removeItem(e)}catch{}}var Sr=()=>{let e=(0,l.useContext)(gr);return(0,l.useEffect)(()=>{e.ensure()},[e]),e};function Cr({children:e,initialUser:t,disabled:n,apiUrl:r,tenant:i}){let a=(0,l.useContext)(ke),o=r||a?.apiUrl||`/api`,s=i||a?.tenant||``,c=(0,l.useMemo)(()=>vr(a?.settings),[a?.settings]),[u,d]=(0,l.useState)(t??null),[f,p]=(0,l.useState)(t?`user`:n?`guest`:`idle`),m=(0,l.useRef)(!1),h=(0,l.useCallback)((e,t)=>fetch(`${o}${e}`,{...t,credentials:`include`,headers:{"content-type":`application/json`,...s?{"x-tenant":s}:{},...t?.headers}}),[o,s]),g=(0,l.useCallback)(e=>(d(e),p(e?`user`:`guest`),e),[]),_=(0,l.useCallback)(()=>{if(n)return Promise.resolve(null);if(c.mode===`off`)return Promise.resolve(g(null));if(c.mode===`custom`){let e=c.auth===`bearer`?br(c.tokenKey):``;return!c.meUrl||c.auth===`bearer`&&!e?Promise.resolve(g(null)):fetch(c.meUrl,{...c.auth===`bearer`?{headers:{authorization:`Bearer ${e}`}}:{credentials:`include`}}).then(e=>e.ok?e.json():null).then(e=>{let t=yr(e,c.userPath);return g(t&&typeof t==`object`?t:null)}).catch(()=>g(null))}return h(`/site/me`).then(e=>e.ok?e.json():null).then(e=>g(e?.payload??null)).catch(()=>g(null))},[h,c,n,g]),v=(0,l.useCallback)(()=>{if(c.mode===`off`)return g(null),Promise.resolve();if(c.mode===`custom`){let e=c.auth===`bearer`?br(c.tokenKey):``;return(c.logoutUrl?fetch(c.logoutUrl,{method:`post`,...c.auth===`bearer`?{headers:e?{authorization:`Bearer ${e}`}:{}}:{credentials:`include`}}).catch(()=>{}):Promise.resolve()).then(()=>{c.auth===`bearer`&&xr(c.tokenKey),g(null)})}return h(`/site/logout`,{method:`post`}).catch(()=>{}).then(()=>{g(null)})},[h,c,g]),y=(0,l.useCallback)(()=>{m.current||n||t||(m.current=!0,p(`loading`),_())},[n,t,_]),b=(0,l.useMemo)(()=>({user:u,status:f,ensure:y,refresh:_,signOut:v}),[u,f,y,_,v]);return(0,l.useEffect)(()=>{n||typeof window>`u`||(window.webim={...window.webim,user:u,status:f,loginUrl:c.loginPage||null,requireUser:()=>m.current||t?Promise.resolve(u):_(),refresh:_,signOut:v},window.dispatchEvent(new CustomEvent(`webim:session`,{detail:{user:u,status:f}})))},[n,u,f,t,c.loginPage,_,v]),(0,B.jsx)(gr.Provider,{value:b,children:e})}function wr({when:e,children:t}){let{status:n}=Sr();return!e||e===`always`?t:n===`idle`||n===`loading`?null:e===`user`==(n===`user`)?t:null}function Tr({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)(ke),[h,g]=(0,l.useState)(`form`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(!1),x=e===`register`,S=c?d||`form`:h,C=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:``,w=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=C(t)||C(new URLSearchParams(window.location.search).get(`next`))||C(m?.[`site.authRedirect`])||C(m?.[`apps.auth.redirect`])||`/`;window.location.assign(e)}}catch{v(`Sign-in failed`),g(`error`),b(!1)}};return(0,B.jsxs)(`div`,{ref:s,style:{display:`grid`,gap:12,maxWidth:360,...k(o)},children:[(0,B.jsxs)(`form`,{onSubmit:w,style:{display:S===`form`?`grid`:`none`,gap:10},children:[x?(0,B.jsxs)(`label`,{style:{...Yt,display:`grid`,gap:6},children:[i,(0,B.jsx)(`input`,{name:`name`,type:`text`,style:Xt,...Qt(c)})]}):null,(0,B.jsxs)(`label`,{style:{...Yt,display:`grid`,gap:6},children:[n,(0,B.jsx)(`input`,{name:`email`,type:`email`,required:!c,style:Xt,...Qt(c)})]}),(0,B.jsxs)(`label`,{style:{...Yt,display:`grid`,gap:6},children:[r,(0,B.jsx)(`input`,{name:`password`,type:`password`,required:!c,style:Xt,...Qt(c)})]}),(0,B.jsx)(`button`,{type:c?`button`:`submit`,disabled:y||void 0,style:{...He,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,B.jsx)(`p`,{style:{margin:0,fontSize:14,color:`#dc2626`},children:_}):null]}),(0,B.jsx)(`div`,{style:{display:S===`success`?`block`:`none`},children:u?.success??null}),(0,B.jsx)(`div`,{style:{display:S===`error`?`block`:`none`},children:u?.error??null})]})}function Er({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}=Sr(),d=a?s||`user`:l,f=a?{name:`Ada Lovelace`,email:`ada@example.com`}:c;return d===`loading`?(0,B.jsx)(`div`,{ref:i,style:{minHeight:24,...k(r)}}):d===`user`?(0,B.jsxs)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...k(r)},children:[(0,B.jsxs)(`span`,{style:{...Yt,fontWeight:600},children:[e,` `,f?.name||f?.email||``]}),n&&f?.email?(0,B.jsx)(`span`,{style:{...Yt,opacity:.7},children:f.email}):null,(0,B.jsx)(`button`,{type:`button`,onClick:a?void 0:u,style:{...He,border:0,padding:`8px 16px`,borderRadius:8,fontSize:14,cursor:a?`default`:`pointer`},...Qt(a),children:t})]}):(0,B.jsx)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...k(r)},children:o?.signedOut??null})}var Dr={id:`consent`,label:`Cookie consent`,category:`Apps`,keys:[`CookieConsent`],ssr:`shell`,settings:[]},Or=`webim.cookie_consent`;function kr(){try{let e=window.localStorage.getItem(Or),t=e?JSON.parse(e):null;return t?.choice===`accepted`||t?.choice===`declined`?t.choice:``}catch{return``}}function Ar(e){try{document.querySelectorAll(`.webim-page`).forEach(t=>t.setAttribute(`data-webim-consent`,e))}catch{}}function jr(e){try{window.localStorage.setItem(Or,JSON.stringify({choice:e,at:new Date().toISOString()}))}catch{}Ar(e);try{window.dispatchEvent(new CustomEvent(`webim:consent`,{detail:{choice:e}}))}catch{}}var Mr={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 Nr({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=kr();e?Ar(e):p(!0)},[d,m]),!f)return null;let _=e=>()=>{d||(jr(e),p(!1))},v=Mr[o]??Mr.bottom,y={appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,padding:`8px 16px`,borderRadius:8,cursor:d?`default`:`pointer`,whiteSpace:`nowrap`};return(0,B.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,...k(c)},children:[(0,B.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,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`a`,{href:a,onClick:d?e=>e.preventDefault():void 0,style:{color:`var(--page-accent, inherit)`,textDecoration:`underline`},children:i})]}):null]}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8,flexShrink:0},children:[r===!1?null:(0,B.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,B.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 Pr={id:`language`,label:`Language`,category:`Apps`,keys:[`SiteLanguagePicker`],ssr:`prefetch`,settings:[`locales`]},Fr={id:`search`,label:`Search`,category:`Apps`,keys:[`SiteSearch`],ssr:`prefetch`,settings:[]},Ir=50,Lr=2e3;function Rr(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`q`)??``}function zr(e,t){let n=e?.data??{},r=[];for(let e of Object.values(n)){let t=e==null?``:Re(e);if(t&&r.push(t),r.join(` `).length>Lr)break}return r.join(` `).slice(0,Lr).toLocaleLowerCase(t||void 0)}function Br({placeholder:e=`Search…`,buttonLabel:t=`Search`,showButton:n=!0,live:r=!1,layout:i=`inline`,includePages:a=!0,collections:o=[],limit:s=10,emptyText:c=`Nothing found`,hint:u=``,style:d,nodeRef:f,inert:p=!1,sample:m=!1}){let{tenant:h,apiUrl:g,locale:_}=(0,l.useContext)(ke),[v,y]=(0,l.useState)(()=>Rr()),[b,x]=(0,l.useState)(()=>Rr()),[S,C]=(0,l.useState)(null),[w,T]=(0,l.useState)(!1),E=(0,l.useRef)(null),D=i===`popup`;(0,l.useEffect)(()=>{let e=()=>{let e=Rr();y(e),x(e)};return window.addEventListener(`popstate`,e),window.addEventListener(`webim:urlchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`webim:urlchange`,e)}},[]),(0,l.useEffect)(()=>{if(!r)return;let e=setTimeout(()=>{y(b),b.trim()&&T(!0)},200);return()=>clearTimeout(e)},[r,b]),(0,l.useEffect)(()=>{if(!D)return;let e=e=>{E.current&&!E.current.contains(e.target)&&T(!1)},t=e=>e.key===`Escape`&&T(!1);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[D]),(0,l.useEffect)(()=>{let e=!0,t=h?{"x-tenant":h}:{},n=e=>fetch(`${g}${e}`,{headers:t}).then(e=>e.json()).then(e=>e?.payload).catch(()=>null),r=[a?n(`/site/pages`).then(e=>({kind:`page`,rows:Array.isArray(e)?e:[]})):null,...(Array.isArray(o)?o:[]).filter(Boolean).map(e=>n(`/dynamic/${encodeURIComponent(e)}?all=1${_?`&locale=${encodeURIComponent(_)}`:``}`).then(t=>({kind:`entry`,slug:e,rows:Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[]})))].filter(Boolean);return Promise.all(r).then(t=>e&&C(t)),()=>{e=!1}},[g,h,_,a,JSON.stringify(o)]);let O=v.trim().toLocaleLowerCase(_||void 0),A=[];if(O&&S)for(let e of S)if(e.kind===`page`)for(let t of e.rows){if(t?.access&&t.access!==`public`)continue;let e=String(t?.title??``);`${e} ${t?.slug??``}`.toLocaleLowerCase(_||void 0).includes(O)&&A.push({key:`page:${t.slug}`,title:e||t.slug,url:`/${t.slug}`,kind:`page`})}else for(let t of e.rows){if(!zr(t,_).includes(O))continue;let n=t?.data??{},r=Re(n.name)||`Untitled`,i=Re(n.slug);A.push({key:`entry:${t.id}`,title:r,url:i?`/${e.slug}/${i}`:`/${e.slug}`,kind:`entry`})}let j=A.slice(0,Math.min(Math.max(1,s),Ir)),ee=e=>{if(p){e.preventDefault(),y(b),T(!0);return}if(typeof window>`u`||!window.history?.pushState)return;e.preventDefault();let t=new URLSearchParams(window.location.search);b.trim()?t.set(`q`,b.trim()):t.delete(`q`),t.delete(`page`);let n=t.toString();window.history.pushState({},``,`${window.location.pathname}${n?`?${n}`:``}`),window.dispatchEvent(new Event(`webim:urlchange`)),T(!0)},M=m&&!O?[{key:`sample-1`,title:`About us`,url:`/about`,kind:`page`},{key:`sample-2`,title:`Spring collection`,url:`/blog/spring`,kind:`entry`}]:null,N=M??j,te=!M&&O&&S&&!j.length,P=!D||w&&(N.length>0||te),F=N.length>0&&(0,B.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:2},children:N.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`a`,{href:p?void 0:e.url,style:{display:`block`,padding:`10px 12px`,borderRadius:6,color:`inherit`,textDecoration:`none`,border:D?0:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},children:[(0,B.jsx)(`span`,{style:{display:`block`,fontWeight:600},children:e.title}),(0,B.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6},children:e.url})]})},e.key))});return(0,B.jsx)(`div`,{ref:f,style:{width:`100%`,...k(d)},children:(0,B.jsxs)(`div`,{ref:E,style:{position:`relative`},children:[(0,B.jsxs)(`form`,{method:`get`,onSubmit:ee,style:{display:`flex`,gap:8,alignItems:`center`},children:[(0,B.jsx)(`input`,{type:`search`,name:`q`,value:b,placeholder:e,onChange:e=>x(e.target.value),onFocus:()=>O&&T(!0),style:{...Xt,flexGrow:1,minWidth:0}}),n!==!1&&(0,B.jsx)(`button`,{type:`submit`,style:{padding:`10px 16px`,border:0,borderRadius:6,cursor:`pointer`,fontSize:14,fontFamily:`inherit`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:t})]}),u&&(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.65,marginTop:6},children:u}),P&&(0,B.jsxs)(`div`,{style:D?{position:`absolute`,top:`100%`,left:0,right:0,zIndex:30,marginTop:6,padding:6,maxHeight:320,overflowY:`auto`,borderRadius:8,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,background:`var(--page-surface, #f2f2f2)`,boxShadow:`0 12px 32px rgba(15, 23, 42, 0.18)`}:{marginTop:14},children:[F,te&&(0,B.jsx)(`div`,{style:{fontSize:14,opacity:.65,padding:D?`10px 12px`:0},children:c})]})]})})}function Vr(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 Hr=e=>e&&e.charAt(0).toUpperCase()+e.slice(1);function Ur(e,t){let n=String(e??``).toUpperCase();if(t===`code`)return n;let r=``;try{r=Hr(new Intl.DisplayNames([e],{type:`language`}).of(e)??``)}catch{}return!r||r.toUpperCase()===n?n:t===`both`?`${n} — ${r}`:r}function Wr(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 Gr({variant:e,display:t,separator:n,label:r,style:i,nodeRef:a,inert:o}){let s=(0,l.useContext)(ke),c=Vr(s?.settings),u=c[0]??``,d=c.includes(s?.locale)?s.locale:u,f={display:`inline-flex`,alignItems:`center`,gap:8,...k(i)};if(c.length<2)return o?(0,B.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,B.jsx)(`span`,{style:{opacity:.7},children:r}):null;return e===`inline`?(0,B.jsxs)(`div`,{ref:a,style:f,children:[p,c.map((e,r)=>(0,B.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[r>0&&(0,B.jsx)(`span`,{style:{opacity:.4},children:n??`·`}),(0,B.jsx)(`a`,{href:Wr(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:Ur(e,t)})]},e))]}):(0,B.jsxs)(`div`,{ref:a,style:f,children:[p,(0,B.jsx)(`select`,{"aria-label":r||`Language`,value:d,onChange:o?void 0:e=>{let t=e.target.value;window.location.assign(Wr(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,B.jsx)(`option`,{value:e,children:Ur(e,t)},e))})]})}var Kr=[hr,Pr,Dr,Fr],qr={SiteLoginForm:Tr,SiteAccountMenu:Er,SiteLanguagePicker:Gr,CookieConsent:Nr,SiteSearch:Br};new Set(Kr.filter(e=>e.ssr===`shell`).flatMap(e=>e.keys));var Jr=new Map;function Yr(e){if(Jr.has(e))return Jr.get(e);let t=URL.createObjectURL(new Blob([e],{type:`text/javascript`})),n=import(t).finally(()=>URL.revokeObjectURL(t));return Jr.set(e,n),n}function Xr(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 Zr(e,t){let n=await Yr(e);return(Array.isArray(n?.default?.blocks)?n.default.blocks:[]).find(e=>e?.id===t&&typeof e.mount==`function`)??null}var Qr={padding:`10px 12px`,border:`1px dashed rgba(148, 163, 184, 0.5)`,borderRadius:8,fontSize:12,opacity:.6};function $r({pluginId:e,blockId:t,props:n,style:r,nodeRef:i}){let a=(0,l.useContext)(ke),o=Xr(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 Zr(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,B.jsx)(`div`,{ref:i,style:k(r),children:(0,B.jsx)(`div`,{ref:s})}):(0,B.jsxs)(`div`,{ref:i,style:{...Qr,...k(r)},children:[`Plugin “`,e,`” is not installed`]})}var ei={...mr,...qr,PluginBlock:$r};function ti(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,B.jsx)(l.Fragment,{children:ti(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=ei[o];if(!c)return null;let u=(a.nodes??[]).map(e=>ti(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,a])=>[e,ti(a,t,n,r,i)])):void 0,p=(0,B.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),ie(t,s),re(t,i?.events===!1?[]:s.events))},children:u.length?u:void 0},e);return s.when&&s.when!==`always`?(0,B.jsx)(wr,{when:s.when,children:p},e):p}var ni=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `),ri=e=>`.webim-page[data-webim-mode="light"] { ${Object.entries(ye(e.light)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }
87
+ .webim-page[data-webim-mode="dark"] { ${Object.entries(ye(e.dark)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }`;function ii({blocks:e,theme:t,components:n,mode:r=`auto`,style:i,custom:a,animations:o,tenant:s,apiUrl:c,datasets:u,locale:d,direction:f,settings:p,siteUser:m}){let g=a?.js?.trim();if((0,l.useEffect)(()=>{if(!g)return;let e=document.createElement(`script`);return e.text=g,document.body.appendChild(e),()=>e.remove()},[g]),!e?.ROOT)return null;let _={lang:d||void 0,dir:De(f,d)},y=`.webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }`,b={minHeight:`100%`,display:`flex`,flexDirection:`column`},x=ti(`ROOT`,e,n),S=(0,l.useMemo)(()=>({render:(t,r)=>ti(t,e,n,void 0,{mapProps:r})}),[e,n]),C=ue(e,n),w=le(e,n),E=a?.css?.trim(),D=T(o),O=ve(t),k=[O.font,O.headingFont].filter(e=>typeof e==`string`&&e.trim()&&e!==`inherit`&&!he[e]),A=[...new Set([...v(e,n),...k])].map(e=>(0,B.jsx)(`link`,{rel:`stylesheet`,precedence:`default`,href:h(e)},e)),j=ri(O);return r===`auto`?(0,B.jsx)(ke.Provider,{value:{tenant:s||``,apiUrl:c||`/api`,locale:d||``,settings:p??null},children:(0,B.jsx)(Cr,{initialUser:m,children:(0,B.jsx)(Ae.Provider,{value:u??null,children:(0,B.jsx)(Pe.Provider,{value:S,children:(0,B.jsxs)(`div`,{..._,className:`webim-page`,style:{...b,...be(t),...i},children:[(0,B.jsx)(`style`,{children:`.webim-page { ${ni(ye(O.light))} }
88
+ @media (prefers-color-scheme: dark) { .webim-page { ${ni(ye(O.dark))} } }`}),(0,B.jsx)(`style`,{children:j}),A,(0,B.jsx)(`style`,{children:y}),C&&(0,B.jsx)(`style`,{children:C}),w&&(0,B.jsx)(`style`,{children:w}),E&&(0,B.jsx)(`style`,{children:E}),x]})})})})}):(0,B.jsx)(ke.Provider,{value:{tenant:s||``,apiUrl:c||`/api`,locale:d||``,settings:p??null},children:(0,B.jsx)(Cr,{initialUser:m,children:(0,B.jsx)(Ae.Provider,{value:u??null,children:(0,B.jsx)(Pe.Provider,{value:S,children:(0,B.jsxs)(`div`,{..._,className:`webim-page`,style:{...b,...xe(t,r),...i},children:[A,(0,B.jsx)(`style`,{children:j}),(0,B.jsx)(`style`,{children:y}),C&&(0,B.jsx)(`style`,{children:C}),w&&(0,B.jsx)(`style`,{children:w}),D&&(0,B.jsx)(`style`,{children:D}),D&&(0,B.jsx)(`style`,{children:D}),E&&(0,B.jsx)(`style`,{children:E}),x]})})})})})}function ai({bundle:e,mode:t=`auto`,style:n}){return e?.blocks?.ROOT?(0,B.jsx)(ii,{blocks:e.blocks,theme:e.theme,components:e.components,custom:e.custom,animations:e.animations,tenant:e.tenant,apiUrl:e.apiUrl,datasets:e.datasets,locale:e.locale,direction:e.direction,settings:e.settings,mode:Ce(t,e.scheme),style:n}):null}function oi({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`}),R({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,B.jsx)(ai,{bundle:p.bundle,mode:o,style:s})}function si(e,t={}){let n=(0,u.createRoot)(e);return n.render((0,B.jsx)(oi,{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 ci(e=document){for(let t of e.querySelectorAll(`[data-webim-page]:not([data-webim-mounted])`))t.setAttribute(`data-webim-mounted`,``),si(t,t.dataset)}var li=document.currentScript,ui=()=>{if(ci(),li?.dataset.slug){let e=document.createElement(`div`);e.setAttribute(`data-webim-mounted`,``),li.parentElement&&li.parentElement!==document.head?li.insertAdjacentElement(`beforebegin`,e):document.body.appendChild(e),si(e,li.dataset)}};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,ui,{once:!0}):ui(),window.WebimEmbed={mount:si,scan:ci}})();