PageSourceSearch

https://www.salemstlouis.com/_next/static/chunks/035n7vdmykc3s.js

js salemstlouis.com collected 2026-09-25 03:13:53 UTC 251,988 bytes, 107 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,664690,178246,e=>{"use strict";var t=e.i(843476),l=e.i(271645),a=e.i(920841);let n=(0,l.createContext)({getSelectionId:()=>null,getSelectionRef:()=>null,setSelection:()=>null,unsetSelection:()=>null,subscribersRef:{current:{}},keyMapRef:{current:{}},mounted:!1,get nextFocus(){return null},set nextFocus(_blockId){}}),i=({children:e})=>{let i=(0,l.useRef)(null),s=(0,l.useRef)({}),r=(0,l.useRef)(null),o=(0,l.useRef)(null),d=(0,l.useRef)({}),c=(0,l.useCallback)(e=>{r.current=e},[]),u=(0,l.useCallback)(e=>{o.current=e},[]),m=(0,l.useCallback)((e,...t)=>{for(let l of Object.values(s?.current||{}))l(e,...t)},[]),h=(0,l.useCallback)(()=>{let e=o.current;if(!e||e.isConnected)return;let t=r.current;r.current=null,o.current=null,m("unsetSelection",t,e)},[m]),x=(0,l.useCallback)(()=>(h(),r.current),[h]),p=(0,l.useCallback)(()=>(h(),o.current),[h]),f=(0,l.useCallback)((e,t)=>{p()!==t&&(c(e),u(t),m("setSelection",e,t))},[p,c,u,m]),g=(0,l.useCallback)((e,t)=>{p()===t&&(c(null),u(null),m("unsetSelection",e,t))},[p,c,u,m]),b=(0,l.useMemo)(()=>({getSelectionId:x,getSelectionRef:p,setSelection:f,unsetSelection:g,subscribersRef:s,keyMapRef:d,mounted:!0,set nextFocus(blockId){i.current=blockId},get nextFocus(){return i.current}}),[x,p,f,g]);return(0,t.jsx)(n.Provider,{value:b,children:(0,t.jsx)(a.default,{children:e})})},s=({children:e,isolate:a=!1})=>{let{mounted:s}=(0,l.useContext)(n);return s&&!a?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsx)(i,{children:e})};function r(){return(0,l.useContext)(n)}let o=(e,t)=>{let{mounted:a,subscribersRef:i}=(0,l.useContext)(n);(0,l.useEffect)(()=>{if(a)return i.current={...i.current,[t]:e},()=>{let e={...i.current};delete e[t],i.current=e}},[a,t])};e.s(["EditorContextProvider",0,s,"useEditorContext",0,r,"useEditorListener",0,o,"withEditorContext",0,e=>l=>(0,t.jsx)(s,{value:l,children:(0,t.jsx)(e,{...l})})],664690);var d=e.i(766937),c=e.i(953760),u=e.i(258950),m=e.i(543489),h=e.i(482820);let{Fill:x,Slot:p}=(0,d.createSlotFill)("InlineControls"),f=({children:e,floatingRef:l})=>(0,t.jsx)(x,{children:a=>a.floating.refs.reference.current===l.current?(0,t.jsx)(t.Fragment,{children:e}):null});f.Slot=({shiftBoundary:e})=>{let{mounted:l}=r();l||console.warn("Editor Context is not mounted.");let a=(0,m.useFloating)({whileElementsMounted:c.autoUpdate,placement:"top",middleware:[(0,u.shift)(t=>{let l=e||document.getElementById("websiteeditorcontent")||t?.elements?.reference?.closest("[data-edit-group]")||"clippingAncestors",a=t?.elements?.reference,n={};if(l instanceof HTMLElement&&a instanceof HTMLElement){let e=["auto","scroll"].includes(window.getComputedStyle(l).overflow);l.scrollTop<t.rects.floating.height&&0===a.offsetTop&&e&&(n.padding={top:-(t.rects.floating.height-l.scrollTop-3)})}return{boundary:l,crossAxis:!0,limiter:(0,u.limitShift)({offset:({rects:e})=>({crossAxis:e.floating.height-10})}),...n}}),(0,u.offset)(10),(0,u.hide)()]});o((e,t,l)=>{"setSelection"===e&&a.refs.setReference(l),"unsetSelection"===e&&(0,h.default)(a,"refs.reference.current")===l&&a.refs.setReference(null)},"InlineControls");let n=void 0!==(0,h.default)(a,"middlewareData.hide.referenceHidden")&&((0,h.default)(a,"middlewareData.hide.referenceHidden")||(0,h.default)(a,"middlewareData.hide.referenceHiddenOffsets.top")+(0,h.default)(a,"refs.floating.current.offsetHeight")>0),i={...a?.floatingStyles,visibility:n?"hidden":"visible",zIndex:100};return(0,t.jsx)(p,{fillProps:{floating:a},children:e=>e.length?(0,t.jsx)("div",{ref:a.refs.setFloating,style:i,children:e}):null})},e.s(["default",0,f],178246)},306489,e=>{"use strict";var t=e.i(843476),l=e.i(271645),a=e.i(922240),n=e.i(830699),i=e.i(664690),s=e.i(178246),r=e.i(323954),o=e.i(107225);let d=({anchorName:e,children:a,...n})=>{let i=(0,l.useRef)(null),[s,r]=(0,l.useState)(0);return(0,l.useLayoutEffect)(()=>{i.current&&r((({left:e,right:t},l)=>{let a=Math.round(Math.min(t-(l-8),Math.max(0,e-8)));return a>0?-a:0})(i.current.getBoundingClientRect(),document.documentElement.clientWidth))},[]),(0,t.jsx)("div",{ref:i,...n,style:s?{transform:`translateX(${s}px)`}:void 0,className:`absolute z-50 mt-2 [position-anchor:${e}]`,children:(0,t.jsx)(o.AdminFloatingToolbar,{className:"w-max mt-2 ",children:a})})},c=({api:e,children:l,show:a,anchorName:n})=>{if(!a)return null;let{handleMouseOver:i,handleSubToolbarMouseLeave:s}=e.current;return(0,t.jsx)(d,{anchorName:n,onMouseEnter:i,onMouseLeave:s,children:l})},u=({api:e,children:l,before:n})=>{let{ref:i,hasBlockSelection:r,handleMouseOver:d,handleMouseLeave:c}=e.current;return r?(0,t.jsxs)(a.BlockExtraControls,{children:[n&&(0,t.jsx)(n,{}),l]}):(0,t.jsx)(s.default,{floatingRef:i,children:(0,t.jsx)("div",{"data-editlist-control
1s":!0,className:"mt-2",onMouseEnter:d,onMouseLeave:c,children:(0,t.jsxs)("div",{"data-admin-rich-toolbar":!0,className:"flex gap-2",children:[n&&(0,t.jsx)(o.AdminFloatingToolbar,{children:(0,t.jsx)("div",{className:"relative w-full p-1.5 text-tcc-basetext flex flex-wrap space-y-2",children:(0,t.jsx)("div",{"data-text-options":!0,className:"w-full flex flex-wrap space-x-1 space-y-1 gap-1 justify-between",children:(0,t.jsx)(n,{})})})}),(0,t.jsx)(o.AdminFloatingToolbar,{children:(0,t.jsx)("div",{className:"relative w-full p-1.5 text-tcc-basetext flex flex-wrap space-y-2",children:(0,t.jsx)("div",{"data-text-options":!0,className:"w-full flex flex-wrap space-x-1 space-y-1 gap-1 justify-between",children:l})})})]})})})},m=()=>(0,t.jsx)(t.Fragment,{});e.s(["useFloatingToolbar",0,({id:e})=>{let a=(0,l.useRef)(null),{setSelection:s,unsetSelection:o,getSelectionId:d,getSelectionRef:h,mounted:x}=(0,i.useEditorContext)(),p=(0,n.useHasBlockSelection)(),f=(0,l.useRef)(!1),g=(0,l.useRef)(null),b=(0,l.useRef)({}),[j]=(0,l.useState)(()=>e=>(0,t.jsx)(u,{api:b,...e})),[v]=(0,l.useState)(()=>e=>(0,t.jsx)(c,{api:b,...e})),y=(e=a.current)=>{e.dataset.locked=""},C=(e=a.current)=>e?.dataset?.locked==="true";if(!x)return{containerProps:{},SubToolbar:m,Toolbar:m,forceSetSelection:()=>{}};let w=async t=>{if(g.current&&(clearTimeout(g.current),g.current=null),"rich_toolbar"===d())return;let l=h();if(l===a.current&&C()&&a.current.closest("[data-editlist-controls]"),!(l&&l!==a.current&&a.current.contains(l))||(await (0,r.default)(751),l!==h())){if(l&&C(l))return!1;f.current=!0,s(e,a.current)}},N=t=>{C()&&y(),f.current=!1,g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{f.current||(o(e,a.current),g.current=null)},750)};return(0,i.useEditorListener)((t,l,n)=>{"setSelection"===t&&n!==a.current&&(f.current=!1,o(e,a.current))},e),b.current={ref:a,hasBlockSelection:p,handleMouseOver:w,handleMouseLeave:N,handleSubToolbarMouseLeave:()=>{g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{f.current||o(e,a.current),g.current=null},750)}},{containerProps:{ref:a,...p?{}:{onMouseEnter:w,onMouseLeave:N}},forceSetSelection:()=>{f.current=!0,s(e,a.current),((e=a.current)=>{e.dataset.locked="true"})(),setTimeout(()=>{C()&&y()},3e3)},SubToolbar:v,Toolbar:j}}],306489)},621451,e=>{"use strict";var t=e.i(843476),l=e.i(989895),a=e.i(271645),n=e.i(422233),i=e.i(761978),s=e.i(796440),r=e.i(224370),o=e.i(276369),d=e.i(787255),c=e.i(988842),u=e.i(993675);let m=({item:e,onClick:l,className:a})=>(0,t.jsx)("button",{type:"button",className:(0,c.classNames)("w-1/2 p-1 flex items-center justify-start",a),onClick:l,children:(0,t.jsxs)("div",{className:"flex space-x-2 items-center p-2 pr-4 rounded-md w-full border border-tcc-altdark hover:bg-tcc-alt",children:[(0,t.jsxs)("div",{children:[e?.iconText&&(0,t.jsx)(h,{className:"mr-2",text:e.iconText}),e?.icon&&(0,t.jsx)(x,{icon:e.icon,className:"mr-2"}),e?.metadata?.icon&&("string"==typeof e.metadata.icon?(0,t.jsx)(h,{className:"mr-2",text:e.metadata.icon}):(0,t.jsx)(x,{icon:(0,t.jsx)(e.metadata.icon,{}),className:"mr-2"}))]}),(0,t.jsx)("span",{className:"text-sm text-tcc-basetext/50 ",children:e.name})]})}),h=({text:e,className:l})=>{let a=(0,c.classNames)("rounded-md border border-tcc-altdark bg-tcc-base w-8 h-8 flex items-center justify-center font-semibold",l);return(0,t.jsx)("div",{className:a,children:e})},x=({icon:e,className:l})=>{let a=(0,c.classNames)("rounded-md border border-tcc-altdark w-8 h-8 bg-tcc-base flex items-center justify-center font-semibold px-1.5 [&>svg]:size-5 [&>svg]:shrink-0",l);return(0,t.jsx)("div",{className:a,children:e})};e.s(["AdminNewBlock",0,({modal:e=!1,onSelect:p,options:f,editor:g="designer",showNewButton:b=!1,indexPosition:j=null,anchorPosition:v=null})=>{let[y,C]=(0,a.useState)(!1),[w,N]=(0,a.useState)(null),[k,A]=(0,a.useState)(!1),T=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{T.current&&clearTimeout(T.current)},[]);let S=async()=>{let e=await (0,u.getBlockFromClipboard)();e?N(e):N(null),f?.length>1?C(!0):p(f[0],j)},E=()=>{let e=(0,a.useMemo)(()=>{let e=f.find(e=>e.type===w?.type);return w&&e?.type===w?.type?{...e,id:(0,n.v4)(),name:"Insert Copied Block"}:null},[w]);return(0,t.jsxs)(o.AdminModal,{variant:"success",open:y,setOpen:C,title:"Select an element",description:"This will add a new element to this section.",children:[(0,t.jsx)("div",{className:"mt-4 mb-4",children:(0,t.jsx)("div",{className:"flex flex-wrap justify-start",children:f?.map(e=>(0,t.jsx)(m,{item:e,onClick:()=>{p(e,j),A(!0),C(!1),T.current=setTimeout(()=>{A(!1)},700)}},e.name))})}),e?.id&&(0,t.jsxs)("div",{className:"mt-4 mb-4",children:[(0,t.jsx)(r.AdminDivider,{title:"Paste from clipboard"}),(0,t.jsx)(m,{item:e,onClick:()=>{p(w,j),C(!1)}},e.name)]}),(0,t.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,t.jsx)(i.AdminButtonOutlined,{onClick:()=>{C(!1)},children:"Cancel"}),(0,t.jsx)(i.AdminButtonPrimary,{onClick:()=>{C(!1)},children:"Save"})]})]})};return"simple"===g?(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsx)(r.AdminDivider,{}),(0,t.jsxs)("div",{className:"w-full flex justify-end mt-4",children:[(0,t.jsx)(i.AdminButtonOutlined,{onClick:S,children:"New Element"}),E()]})]}):!0===e?(0,t.jsxs)("div",{"data-editor-affordance":!0,className:(0,
1c.classNames)("w-full absolute flex items-center justify-center transition-opacity duration-300 z-30 editor-add-new-block",b?"opacity-30 pointer-events-auto":"opacity-0 pointer-events-none"),children:[(0,t.jsxs)("div",{style:{positionAnchor:`--${v}`},"data-rich-new-block":!0,className:"absolute left-1/2 -translate-x-1/2 opacity-100 flex items-center justify-center z-20",children:["designer"===g&&(0,t.jsx)(d.AdminToolTip,{delay:250,content:"Add a new element",children:(0,t.jsx)("button",{type:"button","data-new-rich-item-button":!0,disabled:k,onClick:S,"aria-label":"Open rich text selector",className:"relative z-20 h-8 w-8 shadow-md rounded-full bg-blue-500 text-white flex items-center justify-center z-10 transition-all duration-100 ease-in-out",children:(0,t.jsx)(s.TCCPlusIcon,{className:"h-6 w-6 text-white"})})}),E()]}),"designer"===g&&(0,t.jsx)("div",{role:"button",tabIndex:0,onClick:S,"data-rich-new-block-bar":!0,className:(0,c.classNames)("cursor-pointer shadow-md w-full rounded-full bg-blue-500 h-2 z-10 transform-[scale3d(0,1,1)] transition-transform duration-300 ease-in-out",{"transform-[scale3d(1,1,1)]":b}),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),S())},"aria-label":"Add a new element"})]}):(0,t.jsxs)(l.Menu,{as:"div",className:"relative z-50",children:[(0,t.jsx)(l.MenuButton,{className:"-m-1.5 flex items-center p-1.5 border border-basealt-200 rounded-md mt-2 bg-white",children:(0,t.jsx)(s.TCCPlusIcon,{className:"h-6 w-6 text-basealt-600"})}),(0,t.jsx)(l.MenuItems,{transition:!0,className:"absolute left-2 z-50 w-32 origin-top-right rounded-md bg-white py-2 shadow-lg ring-1 ring-gray-900/5 focus:outline-hidden transition ease-out duration-100 data-closed:opacity-0 data-closed:scale-95",children:f?.map(e=>(0,t.jsx)(l.MenuItem,{children:(0,t.jsxs)("button",{type:"button",onClick:()=>p(e,j),className:(0,c.classNames)("data-active:bg-gray-50","cursor-pointer w-full block pl-1 py-1 text-sm leading-6 text-gray-900 flex items-center justify-start"),children:[e?.iconText&&(0,t.jsx)(h,{className:"mr-2",text:e.iconText}),e?.icon&&("string"==typeof e.icon?(0,t.jsx)(h,{className:"mr-2",text:e.icon}):(0,t.jsx)(x,{icon:(0,t.jsx)(e.icon,{}),className:"mr-2"})),e?.metadata?.icon&&("string"==typeof e.metadata.icon?(0,t.jsx)(h,{className:"mr-2",text:e.metadata.icon}):(0,t.jsx)(x,{icon:(0,t.jsx)(e.metadata.icon,{}),className:"mr-2"})),e.name]})},e.name))})]})},"AdminRichIcon",0,x,"AdminRichTextAsIcon",0,h])},467362,983257,373264,599055,687517,642205,281404,863883,e=>{"use strict";var t=e.i(843476);e.i(761978);var l=e.i(796440),a=e.i(787255),n=e.i(271645),i=e.i(830699),s=e.i(998104);let r=(e="u"<typeof navigator?void 0:navigator)=>/Mac|iPhone|iPad|iPod/i.test(e?.userAgentData?.platform||e?.platform||""),o=(e=r())=>e?"⌘":"Ctrl",d=Object.freeze({duplicate:e=>`${o(e)} D`,copy:e=>`${o(e)} C`,delete:e=>e?"⌫":"Del",selectParent:()=>"Esc"});e.s(["BLOCK_SHORTCUTS",0,d],983257);var c=e.i(262680),u=e.i(489853),m=e.i(475254);let h=(0,m.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),x=(0,m.default)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),p=(0,m.default)("component",[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]]);var f=e.i(178583);let g=(0,m.default)("gallery-horizontal",[["path",{d:"M2 3v18",key:"pzttux"}],["rect",{width:"12",height:"18",x:"6",y:"3",rx:"2",key:"btr8bg"}],["path",{d:"M22 3v18",key:"6jf3v"}]]);var b=e.i(611545);let j=(0,m.default)("heading",[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]);var v=e.i(473708),y=e.i(171245),C=e.i(852008);let w=(0,m.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);e.s(["LayoutGrid",0,w],373264);let N=(0,m.default)("layout-panel-top",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]),k=(0,m.default)("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),A=(0,m.default)("list-collapse",[["path",{d:"M10 5h11",key:"1hkqpe"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 19h11",key:"14g2nv"}],["path",{d:"m3 10 3-3-3-3",key:"i7pm08"}],["path",{d:"m3 20 3-3-3-3",key:"20gx1n"}]]);var T=e.i(931091),S=e.i(492161),E=e.i(299023);let M=(0,m.default)("mouse-pointer-click",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.
1074z",key:"s0h3yz"}]]),B=(0,m.default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]),I=(0,m.default)("panel-top",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]);var L=e.i(261942);let R=(0,m.default)("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]),D=(0,m.default)("rectangle-vertical",[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}]]);var P=e.i(5383),O=e.i(983123),F=e.i(555436);let $=(0,m.default)("square-play",[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]]),z=(0,m.default)("square-stack",[["path",{d:"M4 10c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h4c1.1 0 2 .9 2 2",key:"4i38lg"}],["path",{d:"M10 16c-1.1 0-2-.9-2-2v-4c0-1.1.9-2 2-2h4c1.1 0 2 .9 2 2",key:"mlte4a"}],["rect",{width:"8",height:"8",x:"14",y:"14",rx:"2",key:"1fa9i4"}]]),H=(0,m.default)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var W=e.i(761911),_=e.i(278716);let q={section:p,list:x,item:D,field:v.Image,content:N,rich:L.Pilcrow},U={heading:j,paragraph:L.Pilcrow,div:L.Pilcrow,opentext:f.FileText,longtext:P.Rows3,quote:R,html:h,image:v.Image,imageonly:v.Image,imagelist:k,imagerepeater:y.Images,gallery:w,slideshow:g,overlappingimages:y.Images,video:_.Video,videolist:$,videorepeater:$,audio:B,marquee:g,marqueerepeater:g,tabs:c.AppWindow,tab:D,accordion:A,basic:p,hero:I,iconlist:w,iconrepeater:w,icon:z,longtextrepeater:x,buttonrepeater:M,buttons:M,divider:E.Minus,menu:S.Menu,footer:C.Layers,countdowntimer:H,form:f.FileText,search:F.Search,prayer:b.HandHeart,giving:b.HandHeart,events:u.CalendarDays,groups:W.Users,contributors:W.Users,blogs:f.FileText,notes:f.FileText,noteoutline:f.FileText,series:$,episodes:$,episode:$,rss:O.Rss,announcements:T.Megaphone},V=new Set(["item"]),K=({type:e,layer:l}={})=>{let a=(V.has(l)?q[l]:U[e])||U[e]||q[l]||p;return e=>(0,t.jsx)(a,{strokeWidth:2,...e})};e.s(["getBlockParentIcon",0,K],599055);var G=e.i(223691);let J=()=>{let e=(0,i.useBlockSelectionStore)(),{selectParent:l}=(0,i.useBlockSelectionActions)(),r=(0,i.useSelectedBlockId)(),[o,c]=(0,n.useState)(null);if((0,n.useEffect)(()=>{if(!e||!r)return c(null);let[t]=e.getAncestorIds(),l=t?e.getBlockElement(t):null;if(!l)return c(null);c({name:(l.getAttribute("aria-label")||"").replace(/^Block:\s*/,"")||"parent block",type:l.dataset.editorBlockType,layer:l.dataset.editorBlockLayer})},[e,r]),!e?.getAncestorIds()[0])return null;let u=K(o||{}),m=o?`Select parent: ${o.name} (${d.selectParent()})`:`Select parent block (${d.selectParent()})`;return(0,t.jsx)(s.default.Parent,{children:(0,t.jsx)(a.AdminToolTip,{delay:250,content:m,children:(0,t.jsx)("button",{type:"button",className:G.BLOCK_TOOLBAR_BUTTON,"aria-label":"Select parent block",title:m,onClick:l,children:(0,t.jsx)(u,{className:"w-5 h-5"})})})})};e.s(["BlockParentButton",0,J],687517);let X=({provided:e,label:n="Drag to reorder"})=>e?.dragHandleProps?(0,t.jsx)(s.default.Drag,{children:(0,t.jsx)(a.AdminToolTip,{delay:250,content:n,children:(0,t.jsx)("button",{type:"button",className:`${G.BLOCK_TOOLBAR_BUTTON} cursor-grab`,"aria-label":n,children:(0,t.jsx)("span",{...e.dragHandleProps,className:"flex items-center",children:(0,t.jsx)(l.TCCDragIcon,{className:"w-5 h-5"})})})})}):null;e.s(["BlockToolbarDragHandle",0,X],642205);var Y=e.i(989895),Z=e.i(988842);let Q=({onClick:e,icon:l,destructive:a=!1,shortcut:n,children:i,...s})=>(0,t.jsx)(Y.MenuItem,{children:(0,t.jsxs)("button",{type:"button",onClick:e,className:(0,Z.classNames)("w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left cursor-pointer data-active:bg-tcc-alt",a?"text-tcc-error":"text-tcc-basetext"),...s,children:[l&&(0,t.jsx)(l,{className:"w-4 h-4 shrink-0"}),(0,t.jsx)("span",{className:"whitespace-nowrap",children:i}),n&&(0,t.jsx)("kbd",{className:"ml-auto pl-4 text-xs font-sans text-basealt-500 whitespace-nowrap",children:n})]})});e.s(["BlockToolbarMenuItem",0,Q],281404);var ee=e.i(664659),et=e.i(373375),el=e.i(463059),ea=e.i(655900);let en=({onMove:e,disableUp:l=!1,disableDown:a=!1,label:n="block",orientation:i="vertical"})=>{let r="horizontal"===i,o=`flex items-center justify-center rounded-xs hover:bg-tcc-alt disabled:opacity-30 disabled:hover:bg-transparent ${r?"h-9 w-5":"h-[17px] w-6"}`,[d,c]=r?[et.ChevronLeft,el.ChevronRight]:[ea.ChevronUp,ee.ChevronDown],[u,m]=r?["left","right"]:["up","down"];return(0,t.jsx)(s.default.Movers,{children:(0,t.jsxs)("div",{"data-block-toolbar-movers":!0,className:r?"flex items-center gap-px":"flex flex-col justify-center gap-px",children:[(0,t.jsx)("button",{type:"button",className:o,"aria-label":`Move ${n} ${u}`,title:`Move ${n} ${u}`,disabled:l,onClick:()=>e("up"),children:(0,t.jsx)(d,{className:"w-4 h-4",strokeWidth:2})}),(0,t.jsx)("button",{type:"button",className:o,"aria-label":`Move ${n} ${m}`,title:`Move ${n} ${m}`,disabled:a,onClick:()=>e("down"),children:(0,t.jsx)(c,{className:"w-4 h-4",strokeWidth:2})})]})})};e.s(["BlockToolbarMovers",0,en],863883);let ei=({blockId:e,blockName:a,provided:n,onDelete:r,onDuplicate:o,onCopy:c,onMove:u})=>(0,i.useIsBlockSelected)(e)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J,{}),(0,t.jsx)(s.default,{children:(0,t.jsx)("div",{"data-block-controls":!0,className:"flex items-center gap-1.5",children:(0,t.jsx)("p",{className:"text-xs px-1 whitespace-nowrap",children:a})})}),(0,t.jsx)(en,{onMove:u,label:a}),(0,t.jsx)(X,{provided:n,label:`Drag ${a}`}),(0,t.jsxs)(s.default.Options,{children:[(0,t.jsx)(Q,{icon:l.TCCDuplicateIcon,shortcut:d.duplicate(),onClick:o,children:"Duplicate"}),(0,t.jsx)(Q,{icon:l.TCCCopyIcon,shortcut:d.copy(),onClick:c,children:"Copy"}),(0,t.jsx)(Q,{icon:l.TCCCloseIcon,shortcut:d.delete(),destructive:!0,onClick:r,children:"Delete"})]})]}):null,es=({blockName:e,provided:n,onDelete:i,onDuplicate:s,onCopy:r,onMove:o})=>(0,t.jsxs)("div",{"data-block-controls":!0,className:"opacity-0 group-hover/richtext:opacity-100 hidden group-hover/richtext:flex focus-within:opacity-100 space-x-1 items-center fixed z-50 bg-blue-500 rounded-xs text-basealt-600 h-8 px-2 inset-[unset] bottom-[anchor(top)] right-[anchor(right)] [position-try-fallbacks:flip-block]",children:[(0,t.jsx)("p",{className:"text-white text-xs mr-2",children:e}),(0,t.jsx)(a.AdminToolTip,{content:"Duplicate Block",children:(0,t.jsx)("button",{type:"button","aria-label":"Duplicate Block",onClick:s,children:(0,t.jsx)(l.TCCDuplicateIcon,{className:"w-5 h-5 text-white"})})}),(0,t.jsx)(a.AdminToolTip,{content:"Copy Block",children:(0,t.jsx)("button",{type:"button","aria-label":"Copy Block",onClick:r,children:(0,t.jsx)(l.TCCCopyIcon,{className:"w-5 h-5 text-white"})})}),(0,t.jsx)(a.AdminToolTip,{content:"Delete Block",children:(0,t.jsx)("button",{type:"button","aria-label":"Delete Block",onClick:i,children:(0,t.jsx)(l.TCCCloseIcon,{className:"w-5 h-5 text-white"})})}),(0,t.jsx)(a.AdminToolTip,{content:"Move Down",children:(0,t.jsx)("button",{type:"button","aria-label":"Move Down",onClick:()=>o("down"),children:(0,t.jsx)(l.TCCChevronDownIcon,{className:"w-5 h-5 text-white"})})}),(0,t.jsx)(a.AdminToolTip,{content:"Move Up",children:(0,t.jsx)("button",{type:"button","aria-label":"Move Up",onClick:()=>o("up"),children:(0,t.jsx)(l.TCCChevronUpIcon,{className:"w-5 h-5 text-white"})})}),n?(0,t.jsx)(a.AdminToolTip,{content:"Drag to Reorder",children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)("button",{type:"button","aria-label":"Drag to Reorder",...n.dragHandleProps,children:(0,t.jsx)(l.TCCDragIcon,{className:"w-5 h-5 text-white"})})})}):(0,t.jsx)("button",{type:"button",children:(0,t.jsx)(l.TCCDragIcon,{className:"w-5 h-5 text-white"})})]});e.s(["AdminRichBlockControls",0,({blockId:e,blockName:n="Block",provided:s,onDelete:r,onDuplicate:o,onMove:d,onCopy:c,editor:u="designer"})=>{let m=(0,i.useHasBlockSelection)();return"simple"===u?(0,t.jsxs)("div",{className:"transition-all  opacity-0  group-hover/richtext:opacity-100 space-x-1 flex items-center absolute z-50 text-tcc-basetext/50 right-0 bg-tcc-base rounded-xs  h-8",children:[(0,t.jsx)(a.AdminToolTip,{content:"Duplicate Block",children:(0,t.jsx)("button",{type:"button","aria-label":"Duplicate Block",onClick:o,children:(0,t.jsx)(l.TCCDuplicateIcon,{className:"w-4 h-4"})})}),(0,t.jsx)(a.AdminToolTip,{content:"Copy Block",children:(0,t.jsx)("button",{type:"button","aria-label":"Copy Block",onClick:c,children:(0,t.jsx)(l.TCCCopyIcon,{className:"w-4 h-4"})})}),(0,t.jsx)(a.AdminToolTip,{content:"Delete Block",children:(0,t.jsx)("button",{type:"button","aria-label":"Delete Block",onClick:r,children:(0,t.jsx)(l.TCCCloseIcon,{className:"w-4 h-4"})})}),s?(0,t.jsx)("button",{type:"button",...s.dragHandleProps,children:(0,t.jsx)(l.TCCDragIcon,{className:"w-4 h-4"})}):(0,t.jsx)("button",{type:"button",children:(0,t.jsx)(l.TCCDragIcon,{className:"w-4 h-4"})})]}
1):m?(0,t.jsx)(ei,{blockId:e,blockName:n,provided:s,onDelete:r,onDuplicate:o,onCopy:c,onMove:d}):(0,t.jsx)(es,{blockName:n,provided:s,onDelete:r,onDuplicate:o,onCopy:c,onMove:d})}],467362)},757841,e=>{"use strict";var t=e.i(843476),l=e.i(271645),a=e.i(830699),n=e.i(851494),i=e.i(988842);let s="opacity-0 pointer-events-none";e.s(["AdminRichBlockResizable",0,({block:e,onWidthChange:r,enabled:o=!1,children:d})=>{let c=(0,a.useHasBlockSelection)(),u=(0,a.useIsBlockSelected)(e?.id),m=(0,l.useRef)(null),h=(0,l.useRef)(null),[x,p]=(0,l.useState)(null),[f,g]=(0,l.useState)("left");(0,l.useLayoutEffect)(()=>{o&&m.current&&!h.current&&g((0,n.getTextAlignSide)(getComputedStyle(m.current).textAlign))});let b=e=>{e&&(m.current=e.parentElement)},j=()=>{let e=m.current,t=e?.querySelector(":scope > :not([data-block-controls]):not([data-editor-affordance])");return{widthPx:t?.offsetWidth??0,containerPx:e?.clientWidth??0}},v=e=>r?.(e),y=e=>{if(!h.current)return;let{startX:t,startWidthPx:l,containerPx:a,side:i}=h.current,s=(0,n.computeResizedWidthPct)({startWidthPx:l,deltaPx:e.clientX-t,containerPx:a,side:i,align:f});h.current.moved=!0,h.current.pct=s,p(s??100)},C=e=>{if(!h.current)return;e.currentTarget.releasePointerCapture(e.pointerId);let{moved:t,pct:l}=h.current;h.current=null,t&&v(l),p(null)},w=(0,n.getRichBlockRootProps)(null===x?e:(0,n.applyRichBlockWidth)(e,x)),N=x??((0,n.hasRichBlockWidth)(e?.data?.styles)?Number(e.data.styles.width):100),k=e=>(0,t.jsx)("button",{ref:b,type:"button","data-editor-affordance":!0,"data-resize-handle":e,role:"separator","aria-orientation":"vertical","aria-label":`Resize block from the ${e}`,"aria-valuemin":n.RESIZE_MIN_PCT,"aria-valuemax":100,"aria-valuenow":N,className:(0,i.classNames)("fixed inset-[unset] top-[anchor(top)] bottom-[anchor(bottom)] w-3 flex items-center justify-center cursor-col-resize touch-none select-none z-20 focus-visible:opacity-100 focus-visible:pointer-events-auto",c?u?"opacity-100 pointer-events-auto":s:`${s} group-hover/richtext:opacity-100 group-hover/richtext:pointer-events-auto`,"left"===e?"left-[calc(anchor(left)_-_0.375rem)]":"right-[calc(anchor(right)_-_0.375rem)]"),onPointerDown:t=>((e,t)=>{let{widthPx:l,containerPx:a}=j();a>0&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),h.current={startX:e.clientX,startWidthPx:l,containerPx:a,side:t,moved:!1,pct:null})})(t,e),onPointerMove:y,onPointerUp:C,onPointerCancel:C,onKeyDown:t=>((e,t)=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();let{widthPx:l,containerPx:a}=j();if(!(a>0))return;let i=("ArrowRight"===e.key?1:-1)*5*a/100/("center"===f?2:1);v((0,n.computeResizedWidthPct)({startWidthPx:l,deltaPx:i,containerPx:a,side:t,align:f}))})(t,e),children:(0,t.jsx)("span",{className:"block w-1 h-8 max-h-[60%] rounded-full bg-blue-500 shadow-sm"})},e);return(0,t.jsxs)(t.Fragment,{children:[d(w),o&&"left"!==f&&k("left"),o&&"right"!==f&&k("right")]})}])},567432,e=>{"use strict";var t=e.i(961242),l=e.i(993675),a=e.i(482820),n=e.i(536680);let i=e=>{let t=window.getSelection(),l=t.getRangeAt(0),a=document.createRange();a.selectNodeContents(e),a.setEnd(l.startContainer,l.startOffset);let n=0===a.cloneContents().textContent.length,i=document.createRange();return i.selectNodeContents(e),i.setStart(l.endContainer,l.endOffset),{atStart:n,atEnd:0===i.cloneContents().textContent.length,offset:t.extentOffset-t.anchorOffset}},s=e=>`${Math.round(e.top)}:${Math.round(e.bottom)}`,r=()=>{let e=window.getSelection();return e&&0!==e.rangeCount&&e.isCollapsed?e.getRangeAt(0):null},o=e=>{let t=window.getSelection();return!!t&&!!e&&(t.removeAllRanges(),t.addRange(e),!0)},d=(e,t)=>
1{try{let l=document.createRange(),a=window.getSelection();l.setStart(e,t),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}catch(e){console.error(e)}},c=(e,t)=>{let l=e.getRangeAt(0),{firstChild:a,lastChild:n}=t,i=document.createRange();i.setStart(a,0),i.setEnd(l.startContainer,l.startOffset);let s=document.createRange();return s.setStart(l.endContainer,l.endOffset),s.setEnd(n,n.length),{before:i,current:l,after:s}},u=e=>{let t=document.createElement("div");return t.appendChild(e.cloneContents()),t.innerHTML},m=(e,t)=>(e.index=Array.from(t.parentNode.childNodes).indexOf(t),t?.lastChild?(e.tag=t.tagName,e.child=m({},t.lastChild)):e.offset=t.textContent.length,e),h=(e,t)=>{if(e.tagName!==t.tagName)return!1;let l=Array.from(e.attributes),a=Array.from(t.attributes);return l.length===a.length&&l.every((e,t)=>{let{name:l,value:n}=e,{name:i,value:s}=a[t];return l===i&&n===s})},x=e=>{for(let t of Array.from(e.childNodes)){t.nodeType===Node.ELEMENT_NODE&&x(t);let l=t.nodeType===Node.TEXT_NODE&&!t.nodeValue.trim(),a=t.nodeType===Node.ELEMENT_NODE&&!t.innerHTML.trim();(l||a)&&e.removeChild(t)}},p=(e,t)=>t?.child!==void 0?p(e.childNodes[t.index],t.child):{childNode:e?.childNodes?.[t.index],offset:t.offset},f=(e,t)=>{let l=e;for(let a of(Array.isArray(e)||(l=[e]),l)){if(a?.id===t)return l;for(let e in a)if(Object.hasOwn(a,e)){let l=a[e];if(Array.isArray(l)){let e=f(l,t);if(e)return e}if("object"==typeof l&&null!==l){let e=f([l],t);if(e)return e}}}return null},g=e=>{let t=e.closest(".admin-rich-text-root");if(t)for(let l of t.children){if(!l.contains(e))continue;let t=l.nextElementSibling;if(!t)break;let a=t.querySelector("[contenteditable]");if(!a)break;return a}},b=e=>{let t=e.closest(".admin-rich-text-root");if(t)for(let l of t.children){if(!l.contains(e))continue;let t=l.previousElementSibling;if(!t)break;let a=t.querySelector("[contenteditable]");if(!a)break;return a}},j=(e,t,n=!0)=>i=>{let s=(0,l.deepClone)(i),r=y(s),o=f((0,a.default)(s,r),t.id);if(!o||!Array.isArray(o))return i;let c=o.findIndex(({id:e})=>e===t.id);if(n){let t=b(e);if(o[c-1]&&t){t.focus();let e=[...t.childNodes].slice().reverse().find(e=>e.textContent.length>0||e?.tagName==="BR");e&&d(e,e.textContent.length||0)}}return o.splice(c,1),s},v=(e,t,n)=>i=>{let s=(0,l.deepClone)(i),r=y(s),o=f((0,a.default)(s,r),e.id);if(!o||!Array.isArray(o))return i;let c=o.findIndex(({id:t})=>t===e.id),u=o.findIndex(({id:e})=>e===t.id),{html:g,intersection:b}=((e,t)=>{if(""===e)return{html:t,intersection:{index:0,offset:0}};let l=new DOMParser().parseFromString(e,"text/html"),a=m({},l.body?.lastChild);return{html:function(e,t){let l=new DOMParser,a=l.parseFromString(e,"text/html").body,n=l.parseFromString(t,"text/html").body;if(a.lastChild.nodeType===Node.TEXT_NODE||n.firstChild.nodeType===Node.TEXT_NODE||n.firstChild?.tagName==="BR"&&a.lastChild?.tagName==="BR")return e+t;if(a.lastChild.nodeType===Node.ELEMENT_NODE&&n.firstChild.nodeType===Node.ELEMENT_NODE&&h(a.lastChild,n.firstChild)){let[e,t]=((e,t)=>{let l=e,a=t;for(;l.lastChild&&a.firstChild;)if(l.lastChild.nodeType===Node.ELEMENT_NODE&&a.firstChild.nodeType===Node.ELEMENT_NODE)if(h(l.lastChild,a.firstChild))l=l.lastChild,a=a.firstChild;else break;else break;return[l,a]})(a.lastChild,n.firstChild);for(;e!==a.lastChild&&t!==n.firstChild;)e.append(...t.childNodes),e=e.parentElement,t=t.parentElement;return a.lastChild.append(...n.firstChild.childNodes),n.removeChild(n.firstChild),x(a.parentElement),x(n.parentElement),a.innerHTML+n.innerHTML}return e+t}(e,t),intersection:a}})(o[c].data.text,o[u].data.text);return o[c].data.text=g,o.splice(u,1),setTimeout(()=>{let{childNode:e,offset:t}=p(n,b)||{};e&&(e?.tagName==="BR"&&e?.nextSibling?d(e.nextSibling,0):d(e,t))},0),s},y=(e={})=>e?.type==="Form"?"meta.actions":e?.settingType==="launcher"&&e?.meta?.type==="design"?"meta.design":"content",C={b:"bold",i:"italic",u:"underline"};e.s(["findContainerArrayById",0,f,"getContentPath",0,y,"getFormatShortcutCommand",0,e=>!(e.metaKey||e.ctrlKey)||e.altKey||e.shiftKey?null:C[e.key?.toLowerCase()]??null,"handleRichTextBackspace",0,(e,t)=>{if(!e)return;let l=i(e);if(!(l.atStart&&0===l.offset))return null;let a=!1;
1if(e.innerHTML){let l=document.getSelection(),n=l.anchorNode.parentElement.closest("[contenteditable]");if("function"==typeof l?.anchorNode?.getAttribute&&l?.anchorNode?.getAttribute("contenteditable")==="true"&&(n=l.anchorNode),n){if(""===u(c(l,n).before))return l=>{let a=f(l?.content,t.id),n=a[a.findIndex(e=>e.id===t.id)-1],i=b(e),s=l;return n&&n.type===t.type&&(s=v(n,t,i)(l)),s}}else a=!0}else a=!0;return a?j(e,t):null},"handleRichTextDelete",0,(e,t)=>{if(!e)return;let l=g(e);if(!l)return;let n=i(e);return n.atEnd&&0===n.offset?n=>{let i=n,s=y(n),r=f((0,a.default)(n,s),t.id),o=r[r.findIndex(e=>e.id===t.id)+1];if(o){let a;o?.data?.text?o.type===t.type&&(a=v(t,o,e)):a=j(l,o,!1),a&&(i=a(n))}return i}:null},"handleRichTextPaste",0,(e,i=[])=>0===i.length?null:s=>{let r,o=(0,l.deepClone)(s),d=y(o),m=f((0,a.default)(o,d),e.id);if(!m)return s;let h=document.getSelection(),x=h.anchorNode.parentElement.closest("[contenteditable]");"function"==typeof h?.anchorNode?.getAttribute&&h?.anchorNode?.getAttribute("contenteditable")==="true"&&(x=h.anchorNode);let p=[],[g,...b]=i;if(x){let a="",i="";if(null!==x.firstChild){let e=c(h,x);a=u(e.before),i=u(e.after)}"<br>"===i&&(a+=i,i="");let s=(0,l.deepClone)(e),o=t.default;if(!i){let e=o.placeholder;s.type=e.type,s.tagName=e.tagName,(0,n.default)(s,"data.level")}let d=/(\s)(<\/[a-zA-Z]+>)?$/;d.test(a)&&(a=a.replace(d,"&nbsp;$2"));let m=(a||"")+g.text;for(let t of(0===b.length&&i&&(m+=i),r={...e,data:{...e.data,text:m}},b)){let e=t.text;t===b[b.length-1]&&i&&(e+=i),p.push({...o.placeholder,data:{text:e},id:t.id})}}else{let l=t.default;for(let t of(r={...e,data:{...e.data,text:(beforeText||"")+g.text}},b))p.push({...l.placeholder,data:{text:t.text},id:t.id})}let j=m.findIndex(({id:e})=>e===r.id);return m[j]=r,m.splice(j+1,0,...p),o},"handleRichTextReturn",0,(e,i,s)=>{if(e)return e=>{let r,o,d=(0,l.deepClone)(e),m=y(d),h=f((0,a.default)(d,m),i),x=h?.find(e=>e.id===i);if(!h)return e;let p=document.getSelection(),g=p.anchorNode.parentElement.closest("[contenteditable]");if("function"==typeof p?.anchorNode?.getAttribute&&p?.anchorNode?.getAttribute("contenteditable")==="true"&&(g=p.anchorNode),g){let e="",a="";if(null!==g.firstChild){let t=c(p,g);e=u(t.before),a=u(t.after)}"<br>"===a&&(e+=a,a="");let i=(0,l.deepClone)(x);if(!a){let e=t.default.placeholder;i.type=e.type,i.tagName=e.tagName,(0,n.default)(i,"data.level")}let d=/(\s)(<\/[a-zA-Z]+>)?$/;d.test(e)&&(e=e.replace(d,"&nbsp;$2")),r={...x,data:{...x.data,text:e||""}},o={...i,data:{...i.data,text:a||""},id:s}}else{let e=t.default;r=x,o={...x,...e.placeholder,data:{...x.data,text:""},id:s}}let b=h.findIndex(({id:e})=>e===r.id);return h[b]=r,h.splice(b+1,0,o),d}},"handleRichTextVerticalArrowNavigation",0,(e,t)=>{if(!e||!["up","down"].includes(t))return!1;let l=r();if(!l||!e.contains(l.commonAncestorContainer)||!((e,t)=>{let l;if(!e||!["up","down"].includes(t))return!1;let a=r();if(!a||!e.contains(a.commonAncestorContainer))return!1;let n=document.createRange();return n.selectNodeContents(e),"up"===t?n.setEnd(a.startContainer,a.startOffset):n.setStart(a.endContainer,a.endOffset),1>=(0===(l=Array.from(n?.getClientRects?.()||[])).length?0:new Set(l.map(s)).size)})(e,t))return!1;let a="up"===t?b(e):g(e);if(!a)return!1;let n=(e=>{let[t]=Array.from(e?.getClientRects?.()||[]);if(t)return t;let l=e?.getBoundingClientRect?.();return l&&"number"==typeof l.left?l:null})(l);return((e,t,l=null)=>{if(!e||!["up","down"].includes(t))return!1;if(e.focus(),null!==l){let a=e.getBoundingClientRect(),n=a.left+1,i=Math.max(n,a.right-1),s=((e,t)=>{if("function"==typeof document.caretPositionFromPoint){let l=document.caretPositionFromPoint(e,t);if(!l?.offsetNode)return null;let a=document.createRange();return a.setStart(l.offsetNode,l.offset),a.collapse(!0),a}return"function"==typeof document.caretRangeFromPoint?document.caretRangeFromPoint(e,t):null})(Math.min(Math.max(l,n),i),"up"===t?a.bottom-1:a.top+1);if(s&&e.contains(s.startContainer))return o(s)}let a=document.createRange();return a.selectNodeContents(e),a.collapse("down"===t),o(a)})(a,t,n?.left??null)},"removeBlockHandler",0,j,"replaceBlockAndInsertAfterHandler",0,(e,t,n=[])=>i=>{let s=(0,l.deepClone)(i),r=y(s),o=f((0,a.default)(s,r),e.id);if(!o)return i;let d=o.findIndex(({id:t})=>t===e.id);return -1===d?i:(o[d]=t,n.length&&o.splice(d+1,0,...n),s)}
1,"replaceBlockHandler",0,(e,t,n)=>e=>{let i=(0,l.deepClone)(e),s=y(i),r=f((0,a.default)(i,s),t.id);if(!r)return e;let o=r.findIndex(({id:e})=>e===t.id);return r[o]=n,i},"setSelectionPosition",0,d])},774384,e=>{"use strict";var t=e.i(271645);let l=t.forwardRef(function({title:e,titleId:l,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":l},a),e?t.createElement("title",{id:l},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))});e.s(["Cog8ToothIcon",0,l],774384)},320573,583280,730429,406499,e=>{"use strict";var t=e.i(843476),l=e.i(664690),a=e.i(178246),n=e.i(271645);e.s(["useFloatingDropdown",0,({id:e})=>{let i=(0,n.useRef)(),{setSelection:s,unsetSelection:r}=(0,l.useEditorContext)();return(0,l.useEditorListener)((t,l,a)=>{"setSelection"===t&&a!==i.current&&r(e,i.current)},e),(0,n.useEffect)(()=>()=>{r(e,i.current)},[]),{containerProps:{ref:i},setOpen:t=>{e&&i.current&&(t?s(e,i.current):r(e,i.current))},Dropdown:({children:e})=>(0,t.jsx)(a.default,{floatingRef:i,children:(0,t.jsx)("div",{"data-editlist-controls":!0,className:"mt-2 bg-tcc-base border border-tcc-altdark rounded-md shadow-xl text-tcc-basetext",children:(0,t.jsx)("div",{"data-admin-rich-toolbar":!0,children:(0,t.jsx)("div",{className:"relative w-full p-1.5 text-tcc-basetext flex flex-wrap space-y-2",children:(0,t.jsx)("div",{"data-text-options":!0,className:"w-full flex flex-wrap space-x-1 space-y-1 gap-1 justify-between",children:e})})})})})}}],320573);var i=e.i(813903),s=e.i(544821),r=e.i(779574);e.s(["AdminEditableContent",0,({id:e,className:l="",value:a,placeholder:o=null,onChange:d=null,onBlur:c=null,onPaste:u=null,onKeyDown:m=null,tagName:h="div",disabled:x=!1,onHighlight:p=null,broadcastRef:f=null,onFocus:g=null,align:b=null,ref:j})=>{let v=(0,n.useRef)(a);(0,n.useEffect)(()=>{f&&f(j),v?.current&&j?.current&&j.current.innerHTML!==a&&(j.current.innerHTML=a)},[a]);let y={};return b&&(y.textAlign=b),(0,t.jsx)(i.default,{"data-id":e,className:l,"data-placeholder":o,onFocus:()=>{g&&g(v.current)},onPaste:e=>{if(u)return void u(e);e.preventDefault();let t=e.clipboardData.getData("text/plain");if(t.includes("\n")){let e=t.split("\n").map(e=>(0,s.default)(e)).join("<br>");document.execCommand("insertHTML",!1,e)}else document.execCommand("insertText",!1,t)},onKeyDown:e=>{m&&m(e)},innerRef:j,html:a,onBlur:()=>{let e=j?.current?.innerHTML??v.current,t=(0,r.stripFormatAnchors)(e);t!==e&&(v.current=t,j?.current&&(j.current.innerHTML=t),d&&d(t)),c&&c((0,s.default)(t))},onChange:e=>{v.current=e.target.value;let t=v.current;d&&d(t)},tagName:h,disabled:x,style:y})}],583280);let o=e=>{let t={...e};for(let e of Object.keys(t))t[e]=Math.round(t[e]);return t},d={};e.s(["useContentEditable",0,e=>
1{let[t,l]=(0,n.useState)([]),a=(0,n.useCallback)(e=>{if(!e)return;let t=e,a=[t];for(;t.parentElement&&!t.hasAttribute("contenteditable");)t=t.parentElement,a.push(t);l(e=>e.length===a.length&&e.every((e,t)=>e===a[t])?e:a)},[]),i=(0,n.useCallback)(t=>{let l=t?.target;e?.current?.contains(l)&&a(l)},[e,a]);return(0,n.useEffect)(()=>(window.addEventListener("mouseup",i),()=>{window.removeEventListener("mouseup",i)}),[i]),(0,n.useEffect)(()=>{let t=()=>{if(document.activeElement!==e?.current)return;let t=window.getSelection();if(!t?.rangeCount)return;let l=t.getRangeAt(0).commonAncestorContainer;e.current.contains(l)&&a(l.nodeType===Node.TEXT_NODE?l.parentElement:l)};return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,a]),{tree:t,setTree:l}},"useTextSelection",0,(e,t)=>{let[{clientRect:l,isCollapsed:a,textContent:i},s]=(0,n.useState)(d);(0,n.useCallback)(()=>{t&&t(newState),s(d)},[]);let r=(0,n.useCallback)(()=>{let a,n=window.getSelection(),i={};if(null==n||!n.rangeCount){t&&t(i),s(i);return}let r=n.getRangeAt(0);if(null!=e&&!e.contains(r.commonAncestorContainer)||null==r){t&&t(i),s(i);return}let d=r.cloneContents();null!=d.textContent&&(i.textContent=d.textContent);let c=r.getClientRects();if(0===c.length&&null!=r.commonAncestorContainer){let e=r.commonAncestorContainer;e?.getBoundingClientRect&&(a=o(e.getBoundingClientRect().toJSON()))}else{if(c.length<1)return;a=o(c[0].toJSON())}((e,t)=>{if(null!=e&&null!=t){for(let l of Object.keys(t))if(e[l]!=t[l])return!0}else if(e!=t)return!0;return!1})(l,a)&&(i.clientRect=a),i.isCollapsed=r.collapsed,t&&t(i),s(i)},[e,t]);return(0,n.useLayoutEffect)(()=>(document.addEventListener("selectionchange",r),document.addEventListener("keydown",r),document.addEventListener("keyup",r),window.addEventListener("resize",r),()=>{document.removeEventListener("selectionchange",r),document.removeEventListener("keydown",r),document.removeEventListener("keyup",r),window.removeEventListener("resize",r)}),[e]),{clientRect:l,isCollapsed:a,textContent:i}}],730429);var c=e.i(988842),u=e.i(621451);let m=({item:e,isFocused:l,isActive:a,onSelect:i})=>{let s=(0,n.useRef)(null);(0,n.useEffect)(()=>{l&&s.current&&s.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[l]);let r=(0,c.classNames)("flex group rounded-md transition-all",l?"shadow-lg border-primarylight-100 shadow-brandprimarylight/25":"shadow-none border-transparent",{"-translate-y-[2px]":l,"hover:bg-white":l,"bg-primary-600":a},"hover:-translate-y-[2px] hover:shadow-lg shadow-brandprimarylight/25 hover:shadow-brandprimarylight/25 hover:border hover:border-primarylight-100 border","focus-within:-translate-y-[2px] focus-within:shadow-lg focus-within:shadow-brandprimarylight/25 focus-within:bg-white focus-within:border focus-within:border-primarylight-100 ");return(0,t.jsx)("li",{ref:s,className:r,children:(0,t.jsxs)("button",{"data-block-selector-item":!0,type:"button",onClick:i,className:(0,c.classNames)("flex flex-1 peer items-center gap-x-3 p-2 text-sm leading-6 font-medium font-sans",a?"text-white":"text-gray-700"),children:[e?.iconText&&(0,t.jsx)(u.AdminRichTextAsIcon,{className:"mr-2",text:e.iconText}),e?.icon&&(0,t.jsx)(u.AdminRichIcon,{icon:e.icon,className:"mr-2"}),e?.metadata?.icon&&("string"==typeof e.metadata.icon?(0,t.jsx)(u.AdminRichTextAsIcon,{className:"mr-2",text:e.metadata.icon}):(0,t.jsx)(u.AdminRichIcon,{icon:(0,t.jsx)(e.metadata.icon,{}),className:"mr-2"}))," ",(0,t.jsx)("span",{children:e.name})]})})};e.s(["AdminRichBlockSelector",0,({value:e,options:l=[],maxResults:a=100,onSelect:i,ref:s})=>{let[r,o]=(0,n.useState)(null),d=(0,n.useMemo)(()=>{let t,n=e?.replace("/","").trim();return n?(t=n.toLowerCase(),l.filter(e=>e.name.toLowerCase().includes(t)).sort((e,l)=>{let a=e.name.toLowerCase(),n=l.name.toLowerCase(),i=a.startsWith(t),s=n.startsWith(t);if(i&&!s)return -1;if(!i&&s)return 1;let r=a.indexOf(t),o=n.indexOf(t);return r!==o?r-o:a.localeCompare(n)})).slice(0,a):l.slice(0,a)},[e,l,a]),c=d.find(e=>e.id===r)??d[0]??null;return(0,n.useImperativeHandle)(s,()=>({onKeyDown(e){if("ArrowDown"===e.key){e.preventDefault();let t=d.findIndex(e=>e.id===c?.id)+1;return t>=d.length&&(t=0),o(d[t]?.id),{key:e.key,action:!0}}if("ArrowUp"===e.key){e.preventDefault();let t=d.findIndex(e=>e.id===c?.id)-1;return t<0&&(t=d.length-1),o(d[t]?.id),{key:e.key,action:!0}}return"Enter"===e.key||"Tab"===e.key?(e.preventDefault(),{key:e.key,action:!0,payload:c}):"Escape"===e.key&&(e.preventDefault(),{key:e.key,action:!0})}}),[d,c]),(0,t.jsx)("ul",{"data-block-selector":!0,className:"list-none! ml-0! w-72 max-h-72 overflow-auto",children:d?.map(e=>(0,t.jsx)(m,{item:e,isFocused:c?.id===e.id,isActive:!1,onSelect:()=>i(e)},e.name))})}],406499)}
1,250154,683512,e=>{"use strict";var t=e.i(271645);let l=t.forwardRef(function({title:e,titleId:l,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":l},a),e?t.createElement("title",{id:l},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 9.75 16.5 12l-2.25 2.25m-4.5 0L7.5 12l2.25-2.25M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"}))});e.s(["CodeBracketSquareIcon",0,l],250154);let a=t.forwardRef(function({title:e,titleId:l,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":l},a),e?t.createElement("title",{id:l},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))});e.s(["EyeIcon",0,a],683512)},91102,789950,327803,653327,556928,206895,e=>{"use strict";e.s(["AdminRichTextInput",()=>eV],91102);var t=e.i(843476),l=e.i(12447),a=e.i(271645),n=e.i(422233),i=e.i(320573),s=e.i(583280),r=e.i(730429),o=e.i(779574),d=e.i(158457),c=e.i(567432),u=e.i(406499),m=e.i(250154),h=e.i(683512),x=e.i(803884),p=e.i(871822),f=e.i(482820),g=e.i(514556),b=e.i(107225),j=e.i(148797),v=e.i(489578),y=e.i(152480);let C=async(e={},t={})=>{try{let l=await (0,y.APIPost)(`${y.APIBase}/v1/utils/ai/transcribe`,e,null,t?.token);return await l.json()}catch(e){return e}},w=async(e={},t={})=>{try{let l=await (0,y.APIPost)(`${y.APIBase}/v1/utils/ai/rewrite`,e,null,t?.token);return await l.json()}catch(e){return e}};e.s(["createAIRewrite",0,w,"getAITranscribe",0,C],789950);var N=e.i(653458),k=e.i(730059),A=e.i(988842),T=e.i(484875),S=e.i(766937),E=e.i(664690);let{Fill:M,Slot:B}=(0,S.createSlotFill)("AdminRichToolbarExtraControls"),I=({children:e,show:l})=>l?(0,t.jsx)(M,{children:e}):null;I.Slot=()=>{let[e,l]=(0,a.useState)(!1),{mounted:n}=(0,E.useEditorContext)();return(n||console.warn("Editor Context is not mounted."),(0,a.useEffect)(()=>{setTimeout(()=>{l(!0)},0)},[]),e)?(0,t.jsx)(B,{}):(0,t.jsx)(t.Fragment,{})};let L=[{label:"More professional",instruction:"Rewrite this text to be more professional",thinking:"Making it more professional..."},{label:"More casual",instruction:"Rewrite this text to be more casual",thinking:"Making it more casual..."},{label:"Shorter",instruction:"Rewrite this text to be shorter and more concise",thinking:"Shortening..."},{label:"Longer",instruction:"Rewrite this text to be longer and more detailed",thinking:"Lengthening..."},{label:"Simplify",instruction:"Rewrite this text to be simpler and easier to understand",thinking:"Simplifying..."}];[...N.VALID_ULTIMATE_PLANS,...N.VALID_SEO_PLANS,...N.VALID_GOOGLE_ADS_PLANS,...N.VALID_MARKETING_PLANS];let R=({inUseRef:e,onChange:l})=>{let[n,i]=(0,a.useState)(!1),[s,r]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),u=(0,a.useRef)(null),m=(0,a.useRef)(null),{account:h,user:x}=(0,v.useAdminUIContext)(),p=(0,a.useRef)(null),f=x?.me?.networks?.[0]?.role==="superadmin"||x?.me?.networks?.[0]?.role==="networka
1dmin",g=async t=>{if(!e?.current)return;let a=t.instruction,n=window.getSelection();if(!n||0===n.rangeCount)return void c("Please select some text first");let s=n.getRangeAt(0),o=s.cloneContents(),d=document.createElement("div");d.appendChild(o);let u=d.innerHTML;if(!u||""===u.trim())return void c("Please select some text first");r(!0),c(null),p.current=t.thinking;try{let t=(0,k.getSessionCookie)(),n=await w({html:u,instruction:a},t);if(n?.status==="success"&&n?.data?.html){s.deleteContents();let t=s.createContextualFragment(n.data.html);s.insertNode(t),l&&e.current&&l(e.current.innerHTML),i(!1)}else c(n?.message||"Failed to rewrite text")}catch(e){console.error("AI rewrite error:",e),c("An error occurred while rewriting text")}finally{p.current=null,r(!1)}};return((0,a.useEffect)(()=>{function e(e){let t=u.current?.contains(e.target),l=m.current?.contains(e.target);t||l||(i(!1),c(null))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),f)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{ref:m,children:(0,t.jsx)(d.AdminRichToolButton,{active:n,onClick:()=>{i(e=>!e),c(null)},tooltip:f?"AI rewrite":"Upgrade to enable AI rewrite",className:"h-full",children:(0,t.jsx)(T.TCCSilasStarIcon,{className:(0,A.classNames)("h-4",{"text-tcc-ultimate animate-shimmer":n})})})}),(0,t.jsx)(I,{show:n,children:(0,t.jsx)("div",{ref:u,className:"flex justify-end text-left text-tcc-basetext",children:(0,t.jsx)(b.AdminFloatingToolbar,{className:"absolute mt-2",children:(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[(0,t.jsxs)(j.AdminMiniLabel,{as:"label",className:"block text-tcc-basetext",children:["AI Rewrite Options ",(0,t.jsx)("span",{className:"p-1 text-xs text-brandultimate-500",children:"(beta)"})]}),o&&(0,t.jsx)("div",{className:"text-red-600 text-sm",children:o}),(0,t.jsx)("div",{className:"space-y-1 flex flex-col",children:s?(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:(0,A.classNames)("text-xs text-base text-left relative bg-gradient-to-r from-brandultimate-500 via-brandultimate-100 to-brandultimate-500 bg-clip-text text-transparent bg-[length:200%_100%] animate-shimmer motion-reduce:animate-none"),children:p.current?`${p.current}...`:"Processing..."})}):L.map(e=>(0,t.jsx)("button",{type:"button",className:"text-left px-3 py-2 rounded-md hover:bg-tcc-alt disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>g(e),children:e.label},e.instruction))})]})})})})]}):null};var D=e.i(548748),P=e.i(796440),O=e.i(787255),F=e.i(208509),$=e.i(946217),z=e.i(701124);let H=({value:e,onChange:l,onOpen:n})=>{let{brand:i}=(0,F.maybeUseModelContext)()||{},[s,r]=(0,a.useState)(!1),o=(0,a.useRef)(null),c=(0,a.useRef)(null),{setPanelRef:u,flipUp:m}=(0,z.useFlipWhenClipped)(s);if((0,a.useEffect)(()=>{function e(e){let t=o.current?.contains(e.target),l=c.current?.contains(e.target),a=e.target instanceof HTMLElement&&!!e.target.closest('[data-toolbar-owned-control="true"]');t||l||a||r(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[o]),(0,$.default)(i))return null;let h=[{label:"Base",color:i?.meta?.colorBase,value:"base-bg"},{label:"Alt",color:i?.meta?.colorAlt,value:"alt-bg"},{label:"Primary",color:i?.meta?.colorPrimary,value:"primary-bg"},{label:"Primary Text",color:i?.meta?.colorPrimaryText,value:"primary-text"},{label:"Secondary",color:i?.meta?.colorSecondary,value:"secondary-bg"},{label:"Secondary Text",color:i?.meta?.colorSecondaryText,value:"secondary-text"},{label:"Tertiary",color:i?.meta?.colorTertiary,value:"tertiary-bg"}],x="Clear color",p=e=>e.preventDefault(),f=!!e&&"none"!==e&&!h.some(t=>t.value===e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.AdminRichToolButton,{ref:c,tooltip:"Text colour","aria-label":"Text colour",active:s,onClick:()=>{!s&&n&&n(),r(!s)},children:(0,t.jsx)(P.TCCDesignerIcon,{className:"h-4 w-4"})}),(0,t.jsx)(I,{show:s,children:(0,t.jsx)("div",{ref:o,"data-toolbar-owned-control":"true","data-rich-toolbar-color-swatch":!0,className:"flex justify-end text-left text-tcc-basetext",children:(0,t.jsx)(b.AdminFloatingToolbar,{ref:u,className:(0,A.classNames)("absolute",m?"bottom-full mb-2":"mt-2"),children:(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[(0,t.jsx)(j.AdminMiniLabel,{as:"label",className:"block text-tcc-basetext",children:"Color"}),(0,t.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[h.map(a=>(0,t.jsx)(O.AdminToolTip,{content:a.label,children:(0,t.jsx)("div",{children:(0,t.jsx)(D.AdminColorSwatch,{"aria-label":a.label,value:a.color,onMouseDown:p,onClick:()=>l(a.value),selected:"none"!==e&&e===a.value})})},a.value)),(0,t.jsx)(O.AdminToolTip,{content:"Custom color",children:(0,t.jsx)("div",{children:(0,t.jsx)(D.AdminColorPicker,{inlinePanel:!0,icon:(0,t.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:f?e:null,onChange:e=>l(e||"none"),selected:f,buttonClassName:"flex w-8 h-8 items-center justify-center px-2"})})}),(0,t.jsx)(O.AdminToolTip,{content:x,children:(0,t.jsx)("div",{children:(0,t.jsx)(D.AdminColorSwatch,{"aria-label":x,value:"currentcolor",onMouseDown:p,onClick:()=>l("none")})})})]})]})})})})]})};var W=e.i(92023),_=e.i(52762),q=e.i(792032),U=e.i(621036);let V=({className:e,...l})=>{let a=(0,A.classNames)("range accent-primary-500",e),n={};return l?.error&&(n["aria-invalid"]=!0,n["aria-describedby"]="error",a+=" text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500"),(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsx)(U.Input,{...l,type:"range",className:a,...n}),l?.error&&(0,t.jsx)("p",{className:"mt-2 text-sm text-red-600",id:"error",children:l?.error})]})};e.s(["AdminSlider",0,V],327803);let K=e=>{let{id:l,className:a,disableArrows:n,withButtons:i,...s}=e,r=isNaN(s?.value)?0:parseFloat(s?.value);return(0,t.jsxs)("div",{"data-letterspacing":!0,className:(0,A.classNames)("flex items-center w-full",a),children:[(0,t.jsx)(V,{id:l,className:"grow",placeholder:"Letting spacing",...s,min:-1,max:1,step:.
101}),i?(0,t.jsxs)("div",{className:"flex content-between gap-1 align-center",children:[(0,t.jsx)("button",{type:"button",className:"flex opacity-85 hover:opacity:100 place-items-center border rounded-md bg-tcc-base border-tcc-altdark w-5 h-5",onClick:()=>{s?.onChange&&s.onChange(r-.01)},"aria-label":"Decrease letter spacing",children:(0,t.jsx)(P.TCCSubtractIcon,{className:"w-5"})}),(0,t.jsx)("span",{className:"text-sm text-center w-8 block flex align-center justify-center",children:r}),(0,t.jsx)("button",{type:"button",className:"flex opacity-85 hover:opacity:100 place-items-center border rounded-md bg-tcc-base border-tcc-altdark w-5 h-5",onClick:()=>{s?.onChange&&s.onChange(r+.01)},"aria-label":"Increase letter spacing",children:(0,t.jsx)(P.TCCAddIcon,{className:"w-5"})})]}):(0,t.jsx)(q.AdminInput,{type:"number",className:n?"[&::-webkit-inner-spin-button]:appearance-none text-xs! w-[70px]!":"text-xs! w-[70px]!",...s,min:-1,max:1,step:.01})]})};e.s(["AdminLetterSpacing",0,K],653327);let G=e=>{let{id:l,className:a,disableArrows:n,withButtons:i,...s}=e,r=isNaN(s?.value)?0:parseFloat(s?.value);return(0,t.jsxs)("div",{"data-lineheight":!0,className:(0,A.classNames)("flex items-center w-full",a),children:[(0,t.jsx)(V,{className:"grow",placeholder:"Line height",...s,min:0,max:3,step:.1}),i?(0,t.jsxs)("div",{className:"flex content-between gap-1 align-center",children:[(0,t.jsx)("button",{type:"button",className:"flex opacity-85 hover:opacity:100 place-items-center border rounded-md bg-tcc-base border-tcc-altdark w-5 h-5",onClick:()=>{s?.onChange&&s.onChange(r-.01)},"aria-label":"Decrease line height",children:(0,t.jsx)(P.TCCSubtractIcon,{className:"w-5"})}),(0,t.jsx)("span",{className:"text-sm text-center w-8 block flex align-center justify-center",children:r}),(0,t.jsx)("button",{type:"button",className:"flex opacity-85 hover:opacity:100 place-items-center border rounded-md bg-tcc-base border-tcc-altdark w-5 h-5",onClick:()=>{s?.onChange&&s.onChange(r+.01)},"aria-label":"Increase line height",children:(0,t.jsx)(P.TCCAddIcon,{className:"w-5"})})]}):(0,t.jsx)(q.AdminInput,{type:"number",className:n?"[&::-webkit-inner-spin-button]:appearance-none text-xs! w-[70px]!":"text-xs! w-[70px]!",...s,min:-1,max:3,step:.01})]})};e.s(["AdminLineHeight",0,G],556928);let J=e=>{let t=window.getSelection();if(0===t.rangeCount)return"";let l=t.getRangeAt(0).commonAncestorContainer,a=l.nodeType===Node.TEXT_NODE?l.parentElement:l;for(;a&&a?.isContentEditable!==!1;){if(a.tagName===e?.toUpperCase())return e;a=a.parentElement}return""},X=({tree:e,onChange:l,handleElementChange:n,currentTagName:i})=>{let[s,r]=(0,a.useState)(!1),c=(0,a.useRef)(null),u=(0,a.useRef)(null),{setPanelRef:m,flipUp:h,maxHeight:x}=(0,z.useFlipWhenClipped)(s);(0,a.useEffect)(()=>{function e(e){let t=c.current?.contains(e.target),l=u.current?.contains(e.target);t||l||r(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[c]);let p=["h1","h2","h3","h4","h5","h6"],f=p.includes(i),g="p"===i;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{ref:u,children:(0,t.jsx)(d.AdminRichToolButton,{active:s,onClick:()=>{r(!s)},tooltip:"Font options",className:"font-normal h-full",children:"Aa"})}),(0,t.jsx)(I,{show:s,children:(0,t.jsx)("div",{ref:c,className:"flex justify-end text-left text-tcc-basetext",children:(0,t.jsx)(b.AdminFloatingToolbar,{ref:m,style:x?{maxHeight:x}:void 0,className:(0,A.classNames)("absolute overflow-y-auto",h?"bottom-full mb-2":"mt-2"),children:(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[(0,t.jsx)(j.AdminMiniLabel,{as:"label",className:"block  text-tcc-basetext",children:"Font size"}),(0,t.jsxs)(W.AdminSelect,{onChange:e=>l("textsizeclass",e),value:(0,o.getTextSizeClass)(e)||"",className:"w-full cursor-pointer","aria-label":"Change font size",children:[(0,t.jsx)("option",{value:"",children:"Default"}),(0,t.jsx)("option",{value:"hero-title",children:"Hero Title"}),(0,t.jsx)("option",{value:"h1",children:"Title 1"}),(0,t.jsx)("option",{value:"h2",children:"Title 2"}),(0,t.jsx)("option",{value:"h3",children:"Title 3"}),(0,t.jsx)("option",{value:"h4",children:"Title 4"}),(0,t.jsx)("option",{value:"h5",children:"Title 5"}),(0,t.jsx)("option",{value:"h6",children:"Title 6"})]}),(0,t.jsx)(j.AdminMiniLabel,{as:"label",className:"block  text-tcc-basetext",children:"Font weight"}),(0,t.jsx)(_.AdminFontWeight,{options:[100,200,300,400,500,600,700,800,900],className:"mt-1",onChange:e=>l("fontweight",e),value:(0,o.getFontWeight)(e)||"none"}),(0,t.jsx)(j.AdminMiniLabel,{as:"label",className:"block  text-tcc-basetext",children:"Line height"}),(0,t.jsx)(G,{className:"mt-1 ",onChange:e=>l("lineheight",e),value:(0,o.getLineHeight)(e)||"none",disableArrows:!0,withButtons:!0}),(0,t.jsx)(j.AdminMiniLabel,{as:"label",className:"block text-tcc-basetext",children:"Letter spacing"}),(0,t.jsx)(K,{className:"mt-1",onChange:e=>l("letterspacing",e),value:(0,o.getLetterSpacing)(e)||"none",disableArrows:!0,withButtons:!0}),(0,t.jsx)(j.AdminMiniLabel,{as:"label",className:"block text-tcc-basetext",children:"Baseline"}),(0,t.jsxs)(W.AdminSelect,{className:"mt-1",onChange:e=>{"sub"===e?document.execCommand("subscript",!1,null):"sup"===e?document.execCommand("superscript",!1,null):""===e&&document.execCommand("removeFormat",!1,null)},value:J("sub")||J("sup"),children:[(0,t.jsx)("option",{value:"",children:"Default"}),(0,t.jsx)("option",{value:"sub",children:"Subscript"}),(0,t.jsx)("option",{value:"sup",children:"Superscript"})]}),!!n&&!g&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.AdminMiniLabel,{as:"label",className:"block text-tcc-basetext",children:"Semantic Heading Level"}),(0,t.jsx)(W.AdminSelect,{onChange:n,value:f?i:"p",className:"w-full cursor-pointer","aria-label":"Text style",children:p.map(e=>(0,t.jsx)("option",{value:e,children:e.toUpperCase()},e))})]})]})})})})]})};var Y=e.i(3347);let Z=a.forwardRef(function({title:e,titleId:t,...l},n){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},l),e?a.createElement("title",{id:t},e):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5M12 17.25h8.25"}))}),Q=a.forwardRef(function({title:e,titleId:t,...l},n){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},l),e?a.createElement("title",{id:t},e):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}),ee=a.forwardRef(function({title:e,titleId:t,...l},n){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},l),e?a.createElement("title",{id:t},e):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 5.25h16.5m-16.5 4.5h16.5m-16.5 4.5h16.5m-16.5 4.5h16.5"}))}),et={left:{next:"center",icon:Y.Bars3BottomLeftIcon,label:"Align left",tooltip:"Align left"}
1,center:{next:"right",icon:Q,label:"Align center",tooltip:"Align center"},right:{next:"justify",icon:Z,label:"Align right",tooltip:"Align right"},justify:{next:"left",icon:ee,label:"Align justify",tooltip:"Align justify"}},el=(0,a.memo)(({value:e,onChange:l})=>{let{next:n,icon:i,label:s,tooltip:r}=Object.hasOwn(et,e)?et[e]:et.left,o=(0,a.useCallback)(()=>l(n),[l,n]);return(0,t.jsx)("div",{className:"flex space-x-1",children:(0,t.jsx)(O.AdminToolTip,{content:r,children:(0,t.jsx)("button",{type:"button",onClick:o,className:"bg-tcc-base rounded-md hover:bg-tcc-alt px-2 py-1 font-medium w-10","aria-label":s,children:(0,t.jsx)(i,{className:"h-5 w-5"})})})})});var ea=e.i(761978),en=e.i(276369),ei=e.i(830699),es=e.i(998104),er=e.i(865608),eo=e.i(968278),ed=e.i(178246),ec=e.i(488691),eu=e.i(86351);let em=(e,t)=>e?.filter(e=>{if(e?.type==="utility"||e?.type===t)return e});e.s(["CSSSnippetSelector",0,({id:e,label:l="Select Snippet",value:a,onChange:n,type:i="utility",className:s})=>{let{accountSettings:r,account:o}=(0,ec.useGlobalContext)();if(!r?.customcss)return;if(r?.customcss?.meta?.snippets?.length<=0)return(0,t.jsx)("span",{className:"text-xs opacity-50",children:"Add Snippets in the CSS Editor"});let d=em(r.customcss?.meta?.snippets||[],i);return(0,t.jsx)("div",{className:s,children:(0,t.jsx)(eu.AdminMultiSelect,{label:l,value:a,onChange:e=>{n&&n(e)},noResultText:"No result found",options:d,CustomBadge:({item:e,children:l})=>(0,t.jsx)(O.AdminToolTip,{content:`.${e?.selector}`,placement:"top",children:(0,t.jsx)("div",{className:"",children:l})})},e)})},"getCSSSnippets",0,em],206895);var eh=e.i(998307),ex=e.i(664659);let ep=({children:e})=>(0,t.jsxs)(eh.Popover,{className:"relative flex items-center",children:[(0,t.jsx)(O.AdminToolTip,{delay:250,content:"More formatting",children:(0,t.jsx)(eh.PopoverButton,{"data-toolbar-owned-control":"true","aria-label":"More formatting",className:"flex items-center justify-center h-8 w-8 rounded-xs text-tcc-basetext hover:bg-tcc-alt data-open:bg-tcc-alt",children:(0,t.jsx)(ex.ChevronDown,{className:"w-4 h-4",strokeWidth:2})})}),(0,t.jsx)(eh.PopoverPanel,{anchor:"bottom start","data-editor-affordance":!0,"data-toolbar-owned-control":"true","data-rich-toolbar-more":!0,className:"z-[110] mt-1 rounded-md bg-tcc-base text-tcc-basetext p-1.5 shadow-lg ring-1 ring-tcc-altdark focus:outline-hidden",children:(0,t.jsx)("div",{className:"flex items-center gap-1 flex-wrap max-w-72",children:e})})]}),ef={B:"bold",I:"italic",U:"underline"},eg=Object.keys(ef),eb={B:!1,I:!1,U:!1},ej=(e,t,l)=>{let a=t.current;if(!a)return;let n=navigator.userAgent.includes("Firefox");if("DIV"===a.tagName||!n)return void document.execCommand(e,!1,null);let i=window.getSelection(),s=i?.rangeCount?i.getRangeAt(0).cloneRange():null,r=document.createElement("div");if(r.setAttribute("contenteditable","true"),r.innerHTML=a.innerHTML,r.style.position="fixed",r.style.left="-9999px",r.style.opacity="0",document.body.appendChild(r),s){let e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),t=document.createTreeWalker(a,NodeFilter.SHOW_TEXT),l=[],n=[];for(;e.nextNode();)l.push(e.currentNode);for(;t.nextNode();)n.push(t.currentNode);let o=n.indexOf(s.startContainer),d=n.indexOf(s.endContainer);if(o>=0&&d>=0&&l[o]&&l[d]){let e=document.createRange();e.setStart(l[o],s.startOffset),e.setEnd(l[d],s.endOffset),i.removeAllRanges(),i.addRange(e)}else r.focus(),i.selectAllChildren(r)}else r.focus(),i.selectAllChildren(r);document.execCommand(e,!1,null);let o=r.innerHTML;document.body.removeChild(r),a.innerHTML=o,l(o)},ev=({onTagNameChange:e,onAlignmentChange:l,align:n,currentTagName:i,onChange:s,inUseRef:c,tree:u,setTree:j,enableHTML:v=!0,showHTML:y,onShowHTML:C,enableLock:w=!1,locked:N,onLock:k})=>{let{setSelection:T,unsetSelection:S}=(0,E.useEditorContext)(),{accountSettings:M}=(0,ec.useGlobalContext)(),B=(0,a.useRef)(null),L=(0,a.useRef)(null),D=(0,a.useRef)(null),[F,$]=(0,a.useState)(!1),[z,_]=(0,a.useState)({}),{browserRef:q}=(0,er.useBrowserContext)(),[U,V]=(0,a.useState)(!1),K=(0,a.useRef)(0);M?.customcss;let G=em(M?.customcss?.meta?.snippets,"rich"),J=(0,a.useRef)(null),[Y,Z]=(0,a.useState)(!1),[Q,ee]=(0,a.useState)(eb);(0,a.useEffect)(()=>{let e=()=>{let e=window.getSelection();if(!e?.rangeCount)return;let t=e.getRangeAt(0);c.current?.contains(t.commonAncestorContainer)&&(J.current=t.cloneRange(),Z(!t.collapsed),ee(e=>{let t=(()=>{let e={};for(let t of eg)try{e[t]=document.queryCommandState(ef[t])}catch{e[t]=!1}return e})();return eg.every(l=>e[l]===t[l])?e:t}))};return document.addEventListener("selectionchange",e),document.addEventListener(d.RICH_TEXT_COMMAND_EVENT,e),()=>{document.removeEventListener("selectionchange",e),document.removeEventListener(d.RICH_TEXT_COMMAND_EVENT,e)}},[c]);let et=(0,a.useCallback)(()=>{let e=window.getSelection(),t=e?.rangeCount?e.getRangeAt(0):null;t&&c.current?.contains(t.commonAncestorContainer)||J.current&&(e?.removeAllRanges(),e?.addRange(J.current))},[c]),eu=(0,a.useCallback)(()=>
1{let e=c.current;if(!e||e.contains(document.activeElement))return;let t=window.getSelection(),l=t?.rangeCount?t.getRangeAt(0).cloneRange():null;e.focus({preventScroll:!0}),l&&(t.removeAllRanges(),t.addRange(l))},[c]),eh=(0,a.useCallback)(()=>{let e=window.getSelection();if(!e?.rangeCount)return;let t=e.getRangeAt(0);c.current?.contains(t.commonAncestorContainer)&&(D.current={tree:u,selectedTextRange:t.cloneRange()})},[c,u]),ex=(0,a.useCallback)(e=>e instanceof HTMLElement&&(!!B.current?.contains(e)||!!e.closest('[data-toolbar-owned-control="true"]')),[]),ev=(0,a.useCallback)(({clientRect:e,isCollapsed:t})=>{(!t||(0,f.default)(L,"current.clientRect"))&&(e||(0,f.default)(L,"current.clientRect"))?(!t&&e&&eh(),T("rich_toolbar",c.current)):ex(document.activeElement)||S("rich_toolbar",c.current)},[eh,c,ex,T,S]);(0,E.useEditorListener)((e,t,l)=>{"setSelection"===e&&l!==c.current&&S("rich_toolbar",c.current)},"rich_toolbar");let{clientRect:ey}=(0,r.useTextSelection)(c?.current,ev),eC=(0,ei.useHasBlockSelection)(),ew=(0,ei.useIsBlockSelectionInert)(),eN=(0,ei.useSelectedBlockId)(),ek=!!eN&&(0,eo.getBlockIdFromNode)(c?.current)===eN,eA=(0,a.useCallback)((e,t=null)=>{let l=u?.filter(t=>t?.tagName===e);return t?l[0]:l?.length>0||!t&&!!Q[e]},[u,Q]),eT=()=>{let e=G?.map(e=>e?.selector)||[];return[...o.fxs,...e]},eS=(0,a.useCallback)((e,t)=>{if(et(),"color"===e){let e=u?.length?u:(0,f.default)(D,"current.tree",[]),l=(0,f.default)(D,"current.selectedTextRange");if("none"===t){let l=(0,o.getColor)(e,!0),a=[...e].filter(e=>e!==l);(0,o.setColor)(t,e),j(a)}else j([(0,o.setColor)(t,e,l),...e].filter(Boolean))}if("textsizeclass"===e)if(t&&""!==t){let e=(0,o.setTextSizeClass)(t,u);j([e,...u.filter(t=>t!==e)].filter(Boolean))}else{let e=(0,o.getTextSizeClass)(u,!0),l=[...u].filter(t=>t!==e);(0,o.setTextSizeClass)(t,u),j(l)}if("fx"===e)if("none"===t){let e=(0,o.getFX)(u,!0,eT());j([(0,o.setFX)(t,u,eT()),...[...u].filter(t=>t!==e)])}else j([(0,o.setFX)(t,u,eT()),...u]);"fontsize"===e&&j([(0,o.setFontSize)(t,u),...u]),"fontweight"===e&&j([(0,o.setFontWeight)(t,u),...u]),"lineheight"===e&&j([(0,o.setLineHeight)(t,u),...u]),"letterspacing"===e&&j([(0,o.setLetterSpacing)(t,u),...u]),"removetextsettings"===e&&j([(0,o.removeTextSettings)(u),...u]),"anchor"===e&&(j([(0,o.setAnchorLink)(t,(0,f.default)(L,"current.tree"),(0,f.default)(L,"current.selectedTextRange")),...(0,f.default)(L,"current.tree",[])]),_({}),L.current=null,$(!1)),eu(),c.current&&s(c.current.innerHTML)},[u,j,c,s,et,eu]),eE=(0,a.useCallback)(()=>{if(eA("A")){let e=eA("A",!0),t=e.getAttribute("target"),l=e.getAttribute("href"),a={url:l?.replace(/^mailto:/,""),type:l?.startsWith("mailto:")?"email":"url"};"_blank"===t&&(a.newTab=!0),_(a)}let e={...L.current};e.clientRect=ey,e.tree=u,e.selectedTextRange=window.getSelection().getRangeAt(0),L.current=e,$(!0)},[eA,ey,u]),eM=(0,a.useCallback)((e,t)=>{_(l=>({...l,[e]:t}))},[]);(0,a.useEffect)(()=>{!1===F&&(L.current=null,_({}))},[F]);let eB=(0,a.useCallback)(()=>{if(!q?.current||!B?.current)return;let e=B.current.offsetWidth;e>K.current?K.current=e:e=K.current,V(q.current.offsetWidth<e)},[q]);(0,a.useEffect)(()=>(window.addEventListener("resize",eB),()=>window.removeEventListener("resize",eB)),[eB]);let eI=(0,a.useCallback)(()=>{S("rich_toolbar",c.current),C(!y)},[c,C,y,S]),eL=(0,a.useCallback)(()=>k(!N),[k,N]),eR=(0,a.useCallback)(e=>eS("color",e),[eS]),eD=(0,a.useCallback)(e=>eS("fx",e),[eS]),eP=(0,a.useCallback)(()=>eS("removetextsettings",null),[eS]),eO=(0,a.useCallback)(()=>$(!1),[]),eF=(0,a.useCallback)(()=>ej("insertorderedlist",c,s),[c,s]),e$=(0,a.useCallback)(()=>ej("insertunorderedlist",c,s),[c,s]),ez=(0,a.useCallback)(e=>{e.preventDefault();let t={...z};t?.type!=="email"||t.url?.startsWith("mailto:")||(t.url=`mailto:${t.url}`),eS("anchor",t)},[z,eS]),eH=U?"":"max-w-fit";if(eC&&(ew||!ek))return null;let eW=(0,t.jsxs)("div",{"data-admin-rich-toolbar":!0,"data-toolbar-owned-control":"true",children:[(0,t.jsx)("div",{className:(0,A.classNames)("relative w-full text-tcc-basetext flex flex-wrap",eC?"items-center gap-y-1.5":"p-1.5 space-y-2"),children:(0,t.jsx)("div",{"data-text-options":!0,className:"w-full flex flex-wrap space-x-1 space-y-1 gap-1 justify-between",children:(0,t.jsxs)("div",{className:(0,A.classNames)("flex gap-1 flex-wrap",{"flex-wrap":U}),children:[(0,t.jsx)(d.AdminRichToolButton,{cmd:"bold",active:eA("B"),tooltip:"Bold","aria-label":"Bold",children:"B"}),(0,t.jsx)(d.AdminRichToolButton,{cmd:"italic",active:eA("I"),tooltip:"Italic","aria-label":"Italic",children:"I"}),(0,t.jsx)(el,{onChange:l,value:n}),(0,t.jsx)(d.AdminRichToolButton,{active:eA("A"),disabled:!Y&&!eA("A"),preserveCaret:!1,onClick:eE,tooltip:Y||eA("A")?"Insert link":"Select some text to link","aria-label":"Insert link",children:(0,t.jsx)(x.LinkIcon,{className:"h-4 w-4"})}),(0,t.jsxs)(ep,{children:[(0,t.jsx)(d.AdminRichToolButton,{cmd:"underline",active:eA("U"),tooltip:"Underline","aria-label":"Underline",children:"U"}),(0,t.jsx)(d.AdminRichToolButton,{onClick:eF,active:eA("OL"),tooltip:"Numbered list","aria-label":"Numbered list",children:"1"}),(0,t.jsx)(d.AdminRichToolButton,{onClick:e$,active:eA("UL"),tooltip:"Bulleted list","aria-label":"Bulleted list",children:(0,t.jsx)(p.ListBulletIcon,{className:"h-5 w-5"})}),v&&(0,t.jsxs)(d.AdminRichToolButton,{active:y,preserveCaret:!1,onClick:eI,tooltip:"Toggle code view","aria-label":"Toggle code view",children:[y&&(0,t.jsx)(h.EyeIcon,{className:"h-5 w-5"}),!y&&(0,t.jsx)(m.CodeBracketSquareIcon,{className:"h-5 w-5"})]}),w&&(0,t.jsx)(d.AdminRichToolButton,{active:N,onClick:eL,tooltip:N?"Editing enabled":"Editing disabled",children:N?(0,t.jsx)(P.TCCUnlockIcon,{className:"h-4 w-4"}):(0,t.jsx)(P.TCCLockIcon,{className:"h-4 w-4"})}),(0,t.jsx)(O.AdminToolTip,{content:"Highlight colour",children:(0,t.jsx)("span",{children:(0,t.jsxs)(W.AdminSelect,{onChange:eD,value:(0,o.getFX)(u,!1,eT(
1))||"none",className:"w-20 cursor-pointer !border-0 !ring-0 !ring-offset-0 ","aria-label":"Highlight colour",children:[(0,t.jsx)("option",{value:"none",children:"None"}),(0,t.jsx)("option",{value:"fx-outlined",children:"Outline"}),(0,t.jsx)("option",{value:"fx-draw-underline",children:"Draw Underline"}),G?.map(e=>(0,t.jsx)("option",{value:e?.selector,children:e.name},e?.id))]})})}),(0,t.jsx)(d.AdminRichToolButton,{onClick:eP,tooltip:"Clear formatting","aria-label":"Clear formatting",children:(0,t.jsx)(P.TCCRemoveFormatting,{className:"h-4 w-4"})})]}),(0,t.jsx)(H,{value:(0,o.getColor)(u)||"none",onOpen:eh,onChange:eR}),(0,t.jsx)(R,{inUseRef:c,onChange:s}),(0,t.jsx)(X,{tree:u,onChange:eS,handleElementChange:e,currentTagName:i})]})})}),(0,t.jsx)(en.AdminModal,{open:F,setOpen:$,children:(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("form",{action:"#",onSubmit:ez,children:[(0,t.jsx)(g.AdminLinkEditor,{item:z||{},onChange:_,onItemChange:eM}),(0,t.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,t.jsx)(ea.AdminButtonOutlined,{onClick:eO,children:"Cancel"}),(0,t.jsx)(ea.AdminButtonPrimary,{type:"submit",children:"Save"})]})]})})})]});return eC?(0,t.jsxs)(es.default.Format,{children:[(0,t.jsx)("div",{ref:B,className:eH,children:eW}),(0,t.jsx)(I.Slot,{})]}):(0,t.jsxs)(ed.default,{floatingRef:c,children:[(0,t.jsx)(b.AdminFloatingToolbar,{ref:B,className:eH,children:eW}),(0,t.jsx)(I.Slot,{})]})};var ey=e.i(762630),eC=e.i(787906),ew=e.i(687692);let eN=[{key:"old",heading:"Old Testament"},{key:"new",heading:"New Testament"},{key:"other",heading:"Other"}],ek=({books:e=[],value:l,onChange:n,autoFocus:i=!1,placeholder:s="Book"})=>{let[r,o]=(0,a.useState)(""),d=(0,a.useMemo)(()=>{let t=r.trim().toLowerCase(),l=t?e.filter(e=>e.name.toLowerCase().includes(t)).sort((e,l)=>{let a=e.name.toLowerCase().startsWith(t);return a!==l.name.toLowerCase().startsWith(t)?a?-1:1:0}):e;return eN.map(e=>({...e,items:l.filter(t=>t.testament===e.key)})).filter(e=>e.items.length>0)},[e,r]);return(0,t.jsx)(ey.Combobox,{as:"div",value:l,by:"id",onChange:e=>{e&&(n(e),o(""))},immediate:null===l,children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(ey.ComboboxInput,{placeholder:s,autoFocus:i,className:"w-full rounded-md border-0 bg-tcc-base text-tcc-basetext py-1.5 pl-3 pr-10 shadow-xs ring-1 ring-inset ring-tcc-basetext/20 focus:ring-2 focus:ring-inset focus:ring-tcc-basetext sm:text-sm sm:leading-6",onChange:e=>o(e.target.value),displayValue:e=>e?.name??""}),(0,t.jsx)(ey.ComboboxButton,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-hidden",children:(0,t.jsx)(ew.ChevronUpDownIcon,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})}),(0,t.jsx)(ey.ComboboxOptions,{anchor:"bottom start",className:"z-[110] mt-1 max-h-60 w-(--input-width) overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm",children:d.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-3 pt-2 pb-1 text-xs font-semibold uppercase tracking-wide text-gray-400",children:e.heading}),e.items.map(e=>(0,t.jsx)(ey.ComboboxOption,{value:e,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-gray-900 data-active:bg-basealt-100 data-active:text-basealt-900 data-selected:font-semibold",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"block truncate",children:e.name}),(0,t.jsx)(eC.CheckIcon,{className:"hidden h-5 w-5 text-primary-600 group-data-selected:block","aria-hidden":"true"})]})},e.id))]},e.key))})]})})},eA=({label:e,items:l=[],selected:n,onSelect:i,onCommit:s,role:r="radio",autoFocus:o=!1})=>{let d=(0,a.useRef)(null),c=(0,a.useRef)([]),[u,m]=(0,a.useState)(null),h=l.findIndex(e=>n(e)),x=u??(h>=0?h:0);(0,a.useEffect)(()=>{if(!o||0===l.length)return;let e=l.findIndex(e=>n(e)),t=e>=0?e:0;m(t),c.current[t]?.focus()},[l,o]);let p=e=>{let{key:t}=e;if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(t))return;e.preventDefault();let a=Math.max(1,Math.floor((d.current?.clientWidth||352)/44)),n="ArrowRight"===t?1:"ArrowLeft"===t?-1:"ArrowDown"===t?a:"ArrowUp"===t?-a:0,s="Home"===t?0:"End"===t?l.length-1:Math.min(l.length-1,Math.max(0,x+n));
1m(s),c.current[s]?.focus(),"radio"===r&&i(l[s])},f="radio"===r?{role:"radiogroup","aria-label":e}:{role:"group","aria-label":e};return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1 text-sm font-medium text-tcc-basetext",children:e}),(0,t.jsx)("div",{ref:d,className:"flex flex-wrap gap-1",...f,children:l.map((e,l)=>{let a=n(e);return(0,t.jsx)("button",{ref:e=>{c.current[l]=e},type:"button",tabIndex:l===x?0:-1,..."radio"===r?{role:"radio","aria-checked":a}:{"aria-pressed":a},onFocus:()=>m(l),onKeyDown:p,onClick:()=>{i(e),s?.(e)},className:(0,A.classNames)("h-10 w-10 rounded-md text-sm font-medium transition-colors",a?"bg-primary-600 text-white":"bg-tcc-base text-tcc-basetext ring-1 ring-inset ring-tcc-basetext/20 hover:bg-tcc-basetext/5"),children:e},e)})})]})};var eT=e.i(247103);let eS=({steps:e,active:l,onSelect:n})=>(0,t.jsx)("div",{role:"tablist","aria-label":"Passage",className:"flex flex-wrap items-center gap-1",children:e.map((e,i)=>(0,t.jsxs)(a.Fragment,{children:[i>0&&(0,t.jsx)(eT.ChevronRightIcon,{className:"h-4 w-4 shrink-0 text-tcc-basetextlight","aria-hidden":!0}),(0,t.jsx)(ea.AdminButton,{role:"tab",variant:e.id===l?"soft":"default","aria-selected":e.id===l,"aria-label":e.label,onClick:()=>n(e.id),className:e.id===l?"":"text-tcc-basetextlight hover:text-tcc-basetext",children:e.value??e.label})]},e.id))}),eE=a.forwardRef(function({title:e,titleId:t,...l},n){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},l),e?a.createElement("title",{id:t},e):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"}))}),eM={id:"scripture",name:"Scripture",command:"scripture",icon:(0,t.jsx)(eE,{className:"h-4 w-4"})},eB=e=>e?.command==="scripture",eI=e=>String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),eL="/v1/scripture",eR=async e=>{try{let t=await (0,y.APIGet)(`${y.APIBase}${eL}/translations`,null,null,e?.token);return await t.json()}catch(e){(0,y.APIErrorHandler)(e)}},eD=async({reference:e,translation:t},l)=>{try{let a=await (0,y.APIGet)(`${y.APIBase}${eL}/passage?reference=${encodeURIComponent(e)}&translation=${encodeURIComponent(t)}`,null,null,l?.token);return await a.json()}catch(e){(0,y.APIErrorHandler)(e)}},eP=async({translation:e},t)=>{try{let l=await (0,y.APIGet)(`${y.APIBase}${eL}/books?translation=${encodeURIComponent(e)}`,null,null,t?.token);return await l.json()}catch(e){(0,y.APIErrorHandler)(e)}}
1,eO=async({translation:e,book:t},l)=>{try{let a=await (0,y.APIGet)(`${y.APIBase}${eL}/chapters?translation=${encodeURIComponent(e)}&book=${encodeURIComponent(t)}`,null,null,l?.token);return await a.json()}catch(e){(0,y.APIErrorHandler)(e)}},eF=async({translation:e,book:t,chapter:l},a)=>{try{let n=await (0,y.APIGet)(`${y.APIBase}${eL}/chapter?translation=${encodeURIComponent(e)}&book=${encodeURIComponent(t)}&chapter=${encodeURIComponent(l)}`,null,null,a?.token);return await n.json()}catch(e){(0,y.APIErrorHandler)(e)}},e$=(e,t,l)=>{let[n,i]=(0,a.useState)([]),[s,r]=(0,a.useState)(!1),[o,d]=(0,a.useState)(null),c=(0,a.useRef)(0);return(0,a.useEffect)(()=>{if(t.some(e=>null==e||""===e)){c.current++,i([]),d(null),r(!1);return}let a=++c.current;r(!0),(async()=>{try{let t=(0,k.getSessionCookie)(),n=await e(t);if(c.current!==a)return;n&&"error"!==n.status?(i(l(n)??[]),d(null)):(i([]),d(n?.data?.message||n?.message||"Unable to load passage"))}catch{if(c.current!==a)return;i([]),d("Unable to load passage")}finally{c.current===a&&r(!1)}})()},t),[n,s,o]},ez="web",eH=()=>(0,t.jsx)("p",{className:"text-sm text-tcc-basetext/50",children:"Loading…"}),eW=({children:e})=>(0,t.jsx)("p",{className:"text-sm text-red-600",children:e}),e_=({open:e,onClose:l,onInsert:n})=>{let[i,s]=(0,a.useState)(ez),[r,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(null),[u,m]=(0,a.useState)(null),[h,x]=(0,a.useState)(null),[p,f]=(0,a.useState)("book"),{translations:g,loading:b}=(()=>{let[e,t]=(0,a.useState)([]),[l,n]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{let l=(0,k.getSessionCookie)(),a=await eR(l);if(e)return;t(a?.status==="error"?[]:a?.data??[])}catch{e||t([])}finally{e||n(!1)}})(),()=>{e=!0}},[]),{translations:e,loading:l}})(),{books:j,loading:v,error:y}=(e=>{let[t,l,a]=e$(t=>eP({translation:e},t),[e],e=>e?.data?.books);return{books:t,loading:l,error:a}})(i),{chapters:C,loading:w,error:N}=(({translation:e,book:t})=>{let[l,a,n]=e$(l=>eO({translation:e,book:t},l),[e,t],e=>e?.data?.chapters);return{chapters:l,loading:a,error:n}})({translation:i,book:r?.id}),{verses:A,loading:T,error:S}=(({translation:e,book:t,chapter:l})=>{let[a,n,i]=e$(a=>eF({translation:e,book:t,chapter:l},a),[e,t,l],e=>e?.data?.verses);return{verses:a,loading:n,error:i}})({translation:i,book:r?.id,chapter:d}),{passage:E,loading:M,error:B}=(({reference:e,translation:t,enabled:l})=>{let[n,i]=(0,a.useState)(null),[s,r]=(0,a.useState)(!1),[o,d]=(0,a.useState)(null),c=(0,a.useRef)(0);return(0,a.useEffect)(()=>{let a="string"==typeof e?e.trim():"";if(!l||!a){c.current++,i(null),d(null),r(!1);return}let n=++c.current;r(!0);let s=setTimeout(async()=>{try{let e=(0,k.getSessionCookie)(),l=await eD({reference:a,translation:t},e);if(c.current!==n)return;l&&"error"!==l.status?(i(l?.data??null),d(null)):(i(null),d(l?.data?.message||l?.message||"Unable to load passage"))}catch{if(c.current!==n)return;i(null),d("Unable to load passage")}finally{c.current===n&&r(!1)}},400);return()=>clearTimeout(s)},[e,t,l]),{passage:n,loading:s,error:o}})({reference:r&&d&&null!==u?`${r.name} ${d}:${u}${null!==h&&h!==u?`-${h}`:""}`:"",translation:i,enabled:e}),I=!!E&&!M&&!B,L=()=>{let e,t;I&&n((e=` — ${eI(E?.reference??"")} (${eI(E?.translation?.abbreviation??"")})`,(t=E?.verses??[]).length<=1?`${eI(t[0]?.text??"")}${e}`:`${t.map(e=>`<sup>${eI(e?.verse)}</sup> ${eI(e?.text)}`).join(" ")}${e}`))},R=b?[{id:"web",name:"WEB"}]:g,D=g.find(e=>e.id===i)?.abbreviation??i.toUpperCase(),P=A.map(e=>e.verse),O=[{id:"translation",label:"Translation",value:D},{id:"book",label:"Book",value:r?.name??null},{id:"chapter",label:"Chapter",value:null===d?null:String(d)},{id:"verses",label:"Verses",value:null===u?null:h!==u?`${u}–${h}`:String(u)}];return(0,t.jsx)(en.AdminModal,{open:e,setOpen:e=>{e||l()},title:"Insert Scripture",description:"Choose a translation, book, chapter and verse or verse range.",children:(0,t.jsxs)("div",{className:"mt-4 space-y-3",role:"group",tabIndex:-1,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&I&&(e.preventDefault(),L())},children:[(0,t.jsx)(eS,{steps:O.filter(e=>null!==e.value),active:p,onSelect:f}),"translation"===p&&(0,t.jsx)(W.AdminSelect,{autoFocus:!0,value:i,onChange:e=>{ez=e,s(e),f("book")},children:R.map(e=>(0,t.jsx)("option",{value:e.id,children:e.abbreviation?`${e.abbreviation} — ${e.name}`:e.name},e.id))}),"book"===p&&(0,t.jsxs)("div",{children:[v&&(0,t.jsx)(eH,{}),y&&(0,t.jsx)(eW,{children:y}),!v&&!y&&(0,t.jsx)(ek,{books:j,value:r,onChange:e=>{e&&(f("chapter"),e.id!==r?.id&&(o(e),c(null),m(null),x(null)))},autoFocus:!0,placeholder:"Book"})]}
1),"chapter"===p&&r&&(0,t.jsxs)("div",{children:[w&&(0,t.jsx)(eH,{}),N&&(0,t.jsx)(eW,{children:N}),!w&&!N&&(0,t.jsx)(eA,{label:"Chapter",items:C,selected:e=>e===d,onSelect:e=>{c(e),m(null),x(null)},onCommit:()=>f("verses"),role:"radio",autoFocus:!0})]}),"verses"===p&&r&&null!==d&&(0,t.jsxs)("div",{children:[T&&(0,t.jsx)(eH,{}),S&&(0,t.jsx)(eW,{children:S}),!T&&!S&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eA,{label:"Verses",items:P,selected:e=>null!==u&&e>=u&&e<=h,onSelect:e=>{if(null===u||u!==h){m(e),x(e);return}m(Math.min(u,e)),x(Math.max(u,e))},role:"toggle",autoFocus:!0}),(0,t.jsx)("p",{className:"mt-1 text-xs text-tcc-basetext/50",children:"Tap a verse, then another to select a range. ⌘/Ctrl+Enter inserts."}),null!==u&&(0,t.jsx)("button",{type:"button",onClick:()=>{m(null),x(null)},className:"mt-1 text-xs text-tcc-basetext/50 underline hover:text-tcc-basetext",children:"Clear"})]})]}),(0,t.jsxs)("div",{className:"min-h-12",children:[M&&(0,t.jsx)(eH,{}),!M&&B&&(0,t.jsx)(eW,{children:B}),!M&&!B&&E&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-tcc-basetext",children:E.verses.map(e=>(0,t.jsxs)("span",{children:[(0,t.jsx)("sup",{children:e.verse})," ",e.text," "]},`${e.book}-${e.chapter}-${e.verse}`))}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-tcc-basetext/50",children:[E.reference," (",E.translation?.abbreviation,")"]})]})]}),(0,t.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,t.jsx)(ea.AdminButtonOutlined,{onClick:l,children:"Cancel"}),(0,t.jsx)(ea.AdminButtonPrimary,{type:"button",disabled:!I,onClick:L,children:"Insert"})]})]})})};var eq=e.i(279908);let eU=[],eV=({block:e,value:m,className:h,edit:x=!1,disableToolbar:p=!1,placeholder:f=null,tagName:g="div",onChange:b,onTagNameChange:j,onAlignmentChange:v,align:y=null,list:C=null,onListChange:w,onPaste:N=null,allowedBlocks:k=eU,rootProps:T={}})=>{let S=(0,E.useEditorContext)(),{selectBlock:M}=(0,ei.useBlockSelectionActions)(),{mounted:B,keyMapRef:I}=S,{activeItem:L,changes:R,setField:D}=(0,F.useModelContext)(),O=(0,a.useRef)(null),{containerProps:$,Dropdown:z,setOpen:H}=(0,i.useFloatingDropdown)({id:e.id}),W=L?.type!=="NoteOutline",_=L?.type==="NoteOutline"&&R?.meta?.version>=2,q=(0,a.useRef)(null),[U,V]=(0,a.useState)(!1),[K,G]=(0,a.useState)(!1),J=(0,a.useMemo)(()=>[...k,eM],[k]),{tree:X,setTree:Y}=(0,r.useContentEditable)(q),Z=(0,a.useCallback)(e=>{b(e),H("string"==typeof e&&e?.startsWith("/")&&!e?.startsWith("//"))},[b,H]),Q=(0,a.useCallback)(()=>{H(!1),Z(""),G(!0)},[H,Z]),ee=(0,a.useCallback)(e=>{let t=e=>X?.some(t=>t?.tagName===e);if(t("OL")||t("UL")){if("keydown"===e.type&&(I.current[e.keyCode]=!0),"keyup"===e.type&&delete I.current[e.keyCode],I.current[9]&&I.current[16]){e.preventDefault(),(0,o.outdentList)(X);let t=q.current.querySelectorAll("[contenteditable]");t[0]&&Z(t[0].innerHTML)}else if(I.current[9]){e.preventDefault(),(0,o.indentList)(X);let t=q.current.querySelectorAll("[contenteditable]");t[0]&&Z(t[0].innerHTML)}}},[X,I,Z]),et=(0,a.useCallback)(t=>{let a=(0,c.getFormatShortcutCommand)(t);if(a){t.preventDefault(),document.execCommand(a,!1,null),document.dispatchEvent(new CustomEvent(d.RICH_TEXT_COMMAND_EVENT));return}if(B){if(O.current){let{action:a,key:n,payload:i}=O.current.onKeyDown(t);if(a){if((0,l.default)(i)){if(eB(i)){t.preventDefault(),Q();return}let l=i.metadata.placeholder,a=(0,c.replaceBlockHandler)(t.target,e,l);a&&(t.preventDefault(),S.nextFocus=l.id,M(l.id),D(a))}else"Escape"===n&&H(!1);return}}if("Tab"===t.key){t.preventDefault(),document.getSelection().anchorNode.parentElement.closest("[contenteditable] li")&&(t.shiftKey?document.execCommand("outdent",!1,null):document.execCommand("indent",!1,null));return}if(!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey&&("ArrowUp"===t.key||"ArrowDown"===t.key)){let e="ArrowUp"===t.key?"up":"down";if((0,c.handleRichTextVerticalArrowNavigation)(t.currentTarget,e))return void t.preventDefault()}if("Enter"===t.key&&!t.shiftKey&&!["cite","blockquote"].includes(e?.type)){if(document.getSelection().anchorNode.parentElement.closest("[contenteditable] li"))return;let l=(0,n.v4)(),a=(0,c.handleRichTextReturn)(t.target,e.id,l);a&&(t.preventDefault(),S.nextFocus=l,M(l),D(a));return}if("Backspace"===t.key){let l=(0,c.handleRichTextBackspace)(t.target,e);if(l){t.preventDefault(),D(l);return}}if("Delete"===t.key){let l=(0,c.handleRichTextDelete)(t.target,e);if(l){t.preventDefault(),D(l);return}}}},[e,B,S,D,H,Q]),el=(0,a.useCallback)(t=>{if(S.nextFocus===e.id){let e=t?.current;if(!e)return;if(!e?.firstChild){let t=document.createTextNode("");e.appendChild(t)}let l=e.firstChild;l&&(e.focus(),(0,c.setSelectionPosition)(l,0)),S.nextFocus=null}},[e.id,S]),ea=(0,a.useCallback)(t=>{if(eB(t))return Q();
1let l=t.metadata.placeholder,a=(0,c.replaceBlockHandler)(null,e,l);a&&(S.nextFocus=l.id,D(a))},[e,S,D,Q]),en=(0,a.useCallback)(()=>q.current?.focus?.(),[]),es=(0,a.useCallback)(()=>{G(!1),en()},[en]),er=(0,a.useCallback)(e=>{Z(e),G(!1),en()},[Z,en]),eo=(0,a.useCallback)(t=>{e.editable=t,D(e)},[e,D]),ed=(0,a.useCallback)(()=>V(!1),[]);return(0,a.useEffect)(()=>{function e(e){if($.ref.current&&!$.ref.current.contains(e.target)&&!e.target.closest("[data-block-selector]"))return void H(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[$.ref,H]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{ref:$.ref,"data-admin-richtext-input":!0,className:(0,A.classNames)("w-full relative",h,o.tailwindEditableStyles),edit:x?.toString(),onKeyDown:ee,onKeyUp:ee,...T,children:[!U&&(0,t.jsx)(s.AdminEditableContent,{ref:q,className:_&&e?.editable?"p-2 border border-gray-300 rounded-sm bg-gray-50 transition-colors hover:bg-gray-100":"",onKeyDown:et,placeholder:f,value:m,onChange:Z,tagName:g,align:y,broadcastRef:el,autofocus:!0,onPaste:N}),U&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{"data-editlist-controls":!0,className:"space-x-1 flex items-center h-8 justify-end",children:(0,t.jsx)("button",{type:"button",className:"border  border-black px-2 py-1 font-medium w-10  bg-white rounded-sm text-black",onClick:ed,children:(0,t.jsx)(P.TCCCloseIcon,{className:"h-5 w-5"})})}),(0,t.jsx)("div",{children:(0,t.jsx)(eq.AdminTextArea,{className:"w-full h-[200px] !bg-slate-500 !text-white",value:m,onChange:Z})})]}),!p&&(0,t.jsx)(ev,{list:C,onListChange:w,align:y,onAlignmentChange:v,onTagNameChange:j,currentTagName:g,onChange:Z,inUseRef:q,tree:X,setTree:Y,showHTML:U,onShowHTML:V,enableHTML:W,enableLock:_,locked:e?.editable,onLock:eo}),J.length>0&&(0,t.jsx)(z,{children:(0,t.jsx)(u.AdminRichBlockSelector,{ref:O,value:m,options:J,onSelect:ea})})]}),K&&(0,t.jsx)(e_,{open:!0,onClose:es,onInsert:er})]})}},859932,e=>{"use strict";var t=e.i(843476),l=e.i(271645),a=e.i(687517),n=e.i(830699),i=e.i(998104);let s=({name:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.BlockParentButton,{}),(0,t.jsx)(i.default,{children:(0,t.jsx)("div",{"data-block-controls":!0,className:"flex items-center gap-1.5",children:(0,t.jsx)("p",{className:"text-xs px-1 whitespace-nowrap",children:e||"Block"})})})]});e.s(["EditorBlockWrapper",0,({id:e,layer:a,name:i,type:r,innerRef:o,className:d,withToolbar:c=!1,children:u,...m})=>{let h=(0,l.useId)(),x=e||h,p=(0,n.useBlockWrapperProps)(x,{name:i,layer:a,type:r,ref:o,className:d}),f=(0,n.useIsBlockSelected)(x);return(0,t.jsxs)("div",{...m,...p,children:[c&&f&&(0,t.jsx)(s,{name:i}),u]})}])},963320,e=>{"use strict";e.s(["default",()=>E],963320);var t=e.i(843476),l=e.i(774384),a=e.i(482820),n=e.i(348707),i=e.i(271645),s=e.i(997053),r=e.i(548748),o=e.i(792032),d=e.i(148797),c=e.i(158457),u=e.i(91102),m=e.i(92023),h=e.i(761978),x=e.i(947258),p=e.i(276369),f=e.i(125621),g=e.i(598614),b=e.i(922240),j=e.i(223691),v=e.i(859932),y=e.i(988842),C=e.i(993675),w=e.i(801945),N=e.i(779465),k=e.i(635753);let A=(0,i.memo)(({block:e,onChange:a,className:s,brand:r,editor:m="designer",rootProps:h={}})=>{let[p,g]=(0,i.useState)(!1),[N,k]=(0,i.useState)(null),A=(t,l)=>{let i=(0,C.deepClone)(e);(0,n.default)(i,`data[${t}]`,l),a(i)},[S,E]=(0,i.useState)(!1),M=(0,y.classNames)(s,"widget-accordion",{"-open":S}),B=()=>{k(e?.data),g(!1)},I=()=>{a((0,C.deepClone)(N)),g(!1)},L=()=>{k((0,C.deepClone)(e)),g(!0)};return"simple"===m?(0,t.jsx)(f.AdminSurface,{className:"w-full space-y-4",...h,children:(0,t.jsx)(x.AdminCollapse,{title:e?.data?.title,children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d.AdminLabel,{children:"Title"}),(0,t.jsx)(o.AdminInput,{value:e?.data?.title,onChange:e=>A("title",e)})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d.AdminLabel,{children:"Content"}),(0,t.jsx)(c.AdminRichText,{editor:"simple",modal:!0,withEditableStyles:!0,blockScope:"default",value:e?.data,onChange:e=>A("blocks",e),allowedBlocks:w.default.allowedBlocks})]}),(0,t.jsx)("div",{className:"flex items-end justify-end w-full",children:(0,t.jsx)("button",{type:"button",onClick:L,children:"Open Accordion Styles"})}),(0,t.jsx)(T,{value:N,onChange:k,brand:r,open:p,setOpen:g,onSave:I,onCancel:B})]})})}):(0,t.jsxs)("div",{className:`accordion-wrap group/accordion ${M} `,"data-accordion":!0,itemScope:!0,itemProp:"mainEntity",itemType:"https://schema.org/Question",...h,children:[(0,t.jsxs)(v.EditorBlockWrapper,{id:`${e?.id}-label`,layer:"content",type:e?.type,name:"Accordion label",withToolbar:!0,
1className:(0,y.classNames)("accordion-title",e?.data?.align,e?.data?.settings?.status==="unpublished"?"opacity-25":""),children:[(0,t.jsx)(u.AdminRichTextInput,{block:e,onAlignmentChange:t=>{let l=(0,C.deepClone)(e);(0,n.default)(l,"data.align",t),a(l)},align:e?.data?.align,onTagNameChange:t=>{let l=(0,C.deepClone)(e);(0,n.default)(l,"data.titleTagName",t),a(l)},value:e?.data?.title,tagName:e?.data?.titleTagName,onChange:e=>A("title",e)}),(0,t.jsx)("button",{type:"button","aria-label":S?"Close":"Open",className:"trigger",onClick:()=>E(!S)})]}),(0,t.jsx)(v.EditorBlockWrapper,{id:`${e?.id}-content`,layer:"content",type:e?.type,name:"Accordion content",withToolbar:!0,className:"accordion-body",itemScope:!0,itemProp:"acceptedAnswer",itemType:"https://schema.org/Answer",children:(0,t.jsx)(c.AdminRichText,{modal:!0,withEditableStyles:!0,blockScope:"default",value:e?.data,onChange:e=>A("blocks",e),allowedBlocks:w.default.allowedBlocks})}),e?.data?.accordionStyleLock!==!0&&(0,t.jsx)(b.BlockExtraControls,{blockId:e?.id,fallbackClassName:"space-x-1 flex items-center absolute z-50 left-0 -top-8 bg-blue-300 rounded-xs text-basealt-600 h-8 px-2 opacity-0 pointer-events-none group-hover/accordion:opacity-100 group-hover/accordion:pointer-events-auto",children:(0,t.jsx)("button",{type:"button",className:j.BLOCK_TOOLBAR_BUTTON,"aria-label":"Accordion settings",title:"Accordion settings",onClick:L,children:(0,t.jsx)(l.Cog8ToothIcon,{className:"w-5 h-5"})})}),(0,t.jsx)(T,{value:N,onChange:k,brand:r,open:p,setOpen:g,onSave:I,onCancel:B})]},e?.id)},(e,t)=>JSON.stringify((0,a.default)(e,"block"))===JSON.stringify((0,a.default)(t,"block"))&&e?.className===t?.className&&e?.onChange===t?.onChange),T=({value:e,onChange:l,brand:a,open:i,setOpen:s,onSave:o,onCancel:c})=>(0,t.jsxs)(p.AdminModal,{variant:"success",open:i,setOpen:s,title:"Edit Accordion Design",description:"Tweak the design of the accordion",className:"overflow-visible",children:[(0,t.jsxs)(f.AdminSurface,{children:[(0,t.jsx)(d.AdminMiniLabel,{children:"Backgroun
1d Color"}),(0,t.jsx)(g.AdminBrandColorSelector,{value:e?.data?.styles?.bg,brand:a,onChange:t=>{let a;return a=(0,C.deepClone)(e),void((0,n.default)(a,"data.styles.bg",t),l(a))}}),(0,t.jsx)(d.AdminMiniLabel,{className:"mt-2 mb-2",children:"Text Color"}),(0,t.jsx)(r.AdminColorPicker,{icon:(0,t.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:e?.data?.styles?.textColor,onChange:t=>{let a;return a=(0,C.deepClone)(e),void((0,n.default)(a,"data.styles.textColor",t),l(a))}})]}),(0,t.jsx)("div",{className:"mt-4 mb-4",children:(0,t.jsx)(N.ThemedRender,{block:e,styles:e?.data?.styles})}),(0,t.jsx)("div",{className:"mt-4 mb-4",children:(0,t.jsxs)(m.AdminSelect,{value:e?.data?.settings?.status||"published",onChange:t=>{let a=(0,C.deepClone)(e);(0,n.default)(a,"data.settings.status",t),l(a)},children:[(0,t.jsx)("option",{value:"published",children:"Published"}),(0,t.jsx)("option",{value:"unpublished",children:"Unpublished"})]})}),(0,t.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,t.jsx)(h.AdminButtonOutlined,{onClick:c,children:"Cancel"}),(0,t.jsx)(h.AdminButtonPrimary,{onClick:o,children:"Save"})]})]}),S=(0,s.styled)(A).withConfig({displayName:"Edit__ThemedEdit",componentId:"sc-f34e8b41-0"})`
2    ${k.default};
3`,E={id:w.default.id,type:w.default.type,name:w.default.name,edit:S,render:N.ThemedRender,metadata:w.default}},408708,e=>{"use strict";var t=e.i(843476),l=e.i(514556),a=e.i(761978),n=e.i(276369),i=e.i(271645),s=e.i(482820);e.s(["AdminLinkModal",0,({open:e,setOpen:r,value:o,onSave:d,title:c="Edit Link",description:u="",linkEditorProps:m={},children:h})=>{let x=e=>{let t=(0,s.default)(e,"url",""),l=(0,s.default)(e,"type","url");return{...e,url:"email"===l?t.replace(/^mailto:/,""):t,type:"email"===l&&t.startsWith("mailto:")?"email":l}},[p,f]=(0,i.useState)(x(o));return(0,i.useEffect)(()=>{o&&f(x(o))},[o]),(0,t.jsx)(n.AdminModal,{open:e,setOpen:r,title:c,className:"overflow-visible",description:u,children:(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("form",{action:"#",onSubmit:e=>{e.preventDefault(),p?.type!=="email"||p.url?.startsWith("mailto:")?d(p):d({...p,url:`mailto:${p.url}`}),r(!1)},children:[(0,t.jsx)(l.AdminLinkEditor,{item:p,onChange:f,...m}),h?h({value:p,onChange:f}):null,(0,t.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,t.jsx)(a.AdminButtonOutlined,{onClick:()=>r(!1),children:"Cancel"}),(0,t.jsx)(a.AdminButtonPrimary,{type:"submit",children:"Save"})]})]})})})}])},680258,e=>{"use strict";var t=e.i(271645);e.s(["useImageMultiSelect",0,()=>{let[e,l]=(0,t.useState)(()=>new Map),a=(0,t.useCallback)((e,t)=>{l(l=>{let a=new Map(l);return a.has(e)?a.delete(e):a.set(e,t.full),a})},[]),n=(0,t.useCallback)(()=>l(new Map),[]),i={selectedCount:e.size,isSelected:t=>e.has(t),toggleItem:a,clearSelection:n};return{selectedItems:e,mediaSelection:i,clearSelection:n}}])},862625,673302,242114,e=>{"use strict";var t=e.i(475254);let l=(0,t.default)("align-horizontal-justify-center",[["rect",{width:"6",height:"14",x:"2",y:"5",rx:"2",key:"dy24zr"}],["rect",{width:"6",height:"10",x:"16",y:"7",rx:"2",key:"13zkjt"}],["path",{d:"M12 2v20",key:"t6zp3m"}]]);e.s(["AlignHorizontalJustifyCenter",0,l],862625);let a=(0,t.default)("align-horizontal-justify-end",[["rect",{width:"6",height:"14",x:"2",y:"5",rx:"2",key:"dy24zr"}],["rect",{width:"6",height:"10",x:"12",y:"7",rx:"2",key:"1ht384"}],["path",{d:"M22 2v20",key:"40qfg1"}]]);e.s(["AlignHorizontalJustifyEnd",0,a],673302);let n=(0,t.default)("align-horizontal-justify-start",[["rect",{width:"6",height:"14",x:"6",y:"5",rx:"2",key:"hsirpf"}],["rect",{width:"6",height:"10",x:"16",y:"7",rx:"2",key:"13zkjt"}],["path",{d:"M2 2v20",key:"1ivd8o"}]]);e.s(["AlignHorizontalJustifyStart",0,n],242114)},450941,e=>{"use strict";e.s(["MediaFormAlignmentPicker",()=>R,"MediaFormInput",()=>L]);var t=e.i(843476),l=e.i(306489),a=e.i(792032),n=e.i(148797),i=e.i(837763),s=e.i(621451),r=e.i(158457),o=e.i(92023),d=e.i(327803),c=e.i(761978),u=e.i(796440),m=e.i(408708),h=e.i(276369),x=e.i(542936),p=e.i(787255),f=e.i(74694),g=e.i(680258),b=e.i(754158),j=e.i(161901),v=e.i(730059),y=e.i(489578),C=e.i(988842),w=e.i(993675),N=e.i(359161),k=e.i(803884),A=e.i(482820),T=e.i(348707);e.i(536680);var S=e.i(862625),E=e.i(673302),M=e.i(242114),B=e.i(271645),I=e.i(125621);let L=({buttonText:e="Select Media",clearButtonText:i="Clear Media",type:p="all",onChange:L,label:D="Select Media",value:P,network:O=!1,className:F,mediaClassname:$,display:z="preview",previewCrop:H="thumbnail",output:W="id",full:_=null,allowLinking:q=!1,allowWidth:U=!1,allowShadow:V=!1,allowAlign:K=!1,maxFileSize:G=null,linkOverride:J=null,allowAltOverride:X=!1,toolbarButtons:Y,fileTypes:Z,onMultiImageSelect:Q,rootProps:ee={}})=>{let[et,el]=(0,B.useState)(!1),[ea,en]=(0,B.useState)(!1),[ei,es]=(0,B.useState)(!1),[er,eo]=(0,B.useState)(""),[ed,ec]=(0,B.useState)(!1),[eu,em]=(0,B.useState)(),[eh,ex]=(0,B.useState)(!1),[ep,ef]=(0,B.useState)(null),[eg,eb]=(0,B.useState)(!1),ej=(0,B.useRef)(null),{containerProps:ev,Toolbar:ey,SubToolbar:eC}=(0,l.useFloatingToolbar)({id:"mediaFormInput"}),ew="image"===p&&"function"==typeof Q,{selectedItems:eN,mediaSelection:ek,clearSelection:eA}=(0,g.useImageMultiSelect)(),eT=ew?ek:null,[eS,eE]=(0,B.useState)(!1),eM="full"===W&&"preview"===z;(0,y.usePendingTask)(eM&&!!eu&&eS,{label:`Generating ${D?.toLowerCase?.()||"image"}…`});let eB=()=>el(!0),eI=e=>{ew&&eA(),el(e)},eL=(0,B.useCallback)(async e=>{if(!e)return;ex(!0);let t=(0,v.getSessionCookie)();if(!t)return;let l=await (0,j.loadMediaItem)({id:e,network:O},null,t);"success"===l.status&&(em(l.data),ej.current=l.data),ex(!1)},[O]),eR=(0,B.useCallback)(async e=>{if(ej.current?.id===e)return ej.current;let t=(0,v.getSessionCookie)();if(!t)return null;ex(!0);try{let l=await (0,j.loadMediaItem)({id:e,network:O},null,t);if("success"===l.status)return ej.current=l.data,l.data;return null}catch(e){return console.error("Error loading media item:",e),null}finally{ex(!1)}},[O]);(0,B.useEffect)(()=>{_?.id&&(0,A.default)(P,"id")&&_?.id===(0,A.default)(P,"id")||_&&_?.id===P?em(_):eL(P)},[P]);let eD=e=>{let t=(0,w.deepClone)(e);el(!1),eu?.link&&q&&(0,T.default)(t,"full.link",eu.link),em(t.full),"full"===W?L(t.full):L(t.full.
3id)},eP=async()=>{let e=await eR(eu?.id);eu?.meta?.altText!==e?.meta?.altText?eo(eu?.meta.altText??""):eo(""),es(!0)},eO=(e,t)=>{let l={...eu};l?.width||(l.width={}),l.width[e]=t,em(l),L(l)},eF=()=>{em(null),eE(!1),L(null)};eu&&eu?.shadow===!1&&($+=" no-theme-shadow");let e$={};return(eu&&(e$={...ev}),eu?.meta?.status==="pending")?(0,t.jsxs)(I.AdminSurface,{className:"bg-basealt-100 p-4 rounded-md w-full flex gap-3 justify-between",children:[(0,t.jsxs)(x.AdminP,{className:"font-semibold",children:[(0,t.jsx)(u.TCCUploadIcon,{className:"inline-block w-5 h-5 text-basealt-600 mr-2"}),"Media is still importing... Check back in a few minutes."]}),(0,t.jsx)(c.AdminButtonOutlined,{onClick:()=>eF(),children:"Cancel import"})]}):(0,t.jsxs)("div",{"data-media-form-input":!0,className:(0,C.classNames)("relative group/mediaforminput w-full",F),...e$,...ee,children:[D&&(0,t.jsx)(n.AdminLabel,{children:D}),!eu&&(0,t.jsx)(c.AdminButtonOutlined,{className:"mt-2 mb-2",onClick:eB,children:e}),eu&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-editlist-controls":!0,className:(0,C.classNames)("space-x-1 flex items-center absolute z-50 left-0 -top-8 bg-blue-300 rounded-xs text-basealt-600 h-8 px-2 opacity-0"),children:(0,t.jsx)(ey,{before:Y,children:(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,t.jsx)(n.AdminMiniLabel,{children:"Image "}),U&&(0,t.jsx)(r.AdminRichToolButton,{active:ed,onClick:()=>ed?ec(!1):void(ef(ep||{...eu?.width}),ec(!0),eb(!1)),tooltip:"Edit width",children:(0,t.jsx)(u.TCCWidthIcon,{className:"w-5 h-5 text-basealt-600"})}),U&&(0,t.jsxs)("div",{className:(0,C.classNames)("flex gap-1.5 items-center w-60 transition-all overflow-hidden",{"w-0! mx-0!":!ed}),children:[(0,t.jsx)(d.AdminSlider,{className:"w-24",value:eu?.width?.value,onChange:e=>eO("value",e),min:0,max:eu?.width?.unit&&eu?.width?.unit!=="px"?100:1e3,step:1}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.AdminInput,{className:"text-xs! w-[60px] grow-0",type:"number",value:eu?.width?.value,onChange:e=>eO("value",e)}),(0,t.jsxs)(o.AdminSelect,{className:"flex-1 text-xs! min-w-16",value:eu?.width?.unit,onChange:e=>eO("unit",e),children:[(0,t.jsx)("option",{value:"",disabled:!0,children:"--"}),["px","em","rem","%","ch","vw","pt"].map(e=>(0,t.jsx)("option",{value:e,children:e},`font-size-${e}`))]})]})]}),q&&(0,t.jsx)(r.AdminRichToolButton,{className:(0,C.classNames)({"px-0! w-0!":ed,"transition-all overflow-hidden":U}),onClick:()=>en(!0),tooltip:"Open link settings",children:(0,t.jsx)(k.LinkIcon,{className:"w-5 h-5 text-basealt-600"})}),X&&(0,t.jsx)(r.AdminRichToolButton,{className:(0,C.classNames)({"px-0! w-0!":ed,"transition-all overflow-hidden":U}),onClick:eP,tooltip:"Edit alt text",children:(0,t.jsx)(N.DocumentTextIcon,{className:"w-5 h-5 text-basealt-600"})}),V&&(0,t.jsx)(r.AdminRichToolButton,{className:(0,C.classNames)({"px-0! w-0!":ed,"transition-all overflow-hidden":U}),onClick:()=>{let e={...eu};void 0===e?.shadow?e.shadow=!1:e.shadow=!e.shadow,em(e),L(e)},tooltip:eu?.shadow?"Remove Theme Shadow":"Use Theme Shadow",children:eu?.shadow?(0,t.jsx)(u.TCCEyeIcon,{className:"w-5 h-5 text-basealt-600"}):(0,t.jsx)(u.TCCEyeOffIcon,{className:"w-5 h-5 text-basealt-600"})}),(0,t.jsx)(r.AdminRichToolButton,{className:(0,C.classNames)({"px-0! w-0!":ed,"transition-all overflow-hidden":U}),onClick:eB,tooltip:"Replace item",children:(0,t.jsx)(u.TCCReplaceIcon,{className:"w-5 h-5 text-basealt-600"})}),K&&(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)(r.AdminRichToolButton,{active:eg,className:(0,C.classNames)("[anchor-name:--image-alignment-btn]",{"px-0! w-0!":ed,"transition-all overflow-hidden":U}),onClick:()=>eb(!eg),tooltip:"Edit Alignment",children:[(!eu?.align||eu?.align==="start")&&(0,t.jsx)(M.AlignHorizontalJustifyStart,{className:"w-5 h-5 text-basealt-600",strokeWidth:1.5}),eu?.align==="center"&&(0,t.jsx)(S.AlignHorizontalJustifyCenter,{className:"w-5 h-5 text-basealt-600",strokeWidth:1.5}),eu?.align==="end"&&(0,t.jsx)(E.AlignHorizontalJustifyEnd,{className:"w-5 h-5 text-basealt-600",strokeWidth:1.5})]}),(0,t.jsx)(eC,{show:eg,anchorName:"--image-alignment-btn",children:(0,t.jsx)(R,{value:eu?.align,onChange:e=>{let t={...eu};t.align=e,em(t),L(t)},className:"flex flex-col p-1.5 gap-1.5"})})]}),(0,t.jsx)(r.AdminRichToolButton,{className:(0,C.classNames)({"px-0! w-0!":ed,"transition-all overflow-hidden":U}),onClick:()=>
3eF(),tooltip:"Clear item",children:(0,t.jsx)(u.TCCCloseIcon,{className:"w-5 h-5 text-basealt-600"})})]})})}),(0,t.jsx)("div",{className:"bg-white absolute z-20 top-2 right-2 opacity-0 group-hover/mediaforminput:opacity-100 focus-within:opacity-100 group-focus/mediaforminput:opacity-100 flex gap-1",children:(0,t.jsx)("button",{"data-clear-button":!0,type:"button",onClick:()=>eF(),children:(0,t.jsx)(s.AdminRichIcon,{className:"focus:opacity-100",icon:(0,t.jsx)(u.TCCCloseIcon,{className:"h-6 w-6 text-basealt-600"})})})})]}),"preview"===z&&(0,t.jsx)(b.MediaPreview,{isNetwork:eu?.isNetwork,item:eu,crop:H,onChange:e=>{"full"===W&&L(e)},onLoadingChange:eM?eE:void 0,className:$}),"text"===z&&(0,t.jsx)(x.AdminP,{children:eu?.name}),(0,t.jsxs)(h.AdminModal,{wide:!0,variant:"info",open:et,setOpen:eI,icon:(0,t.jsx)(u.TCCPhotoIcon,{className:"h-6 w-6 text-blue-600"}),title:ew?"Select Images":"Select or Upload Media",description:"Browse",children:[(0,t.jsx)(f.MediaLibrary,{network:O,type:p,onChange:ew?void 0:e=>eD(e),onUploadSelect:e=>eD(e),maxFileSize:G,multiSelect:ew,mediaSelection:eT,fileTypes:Z,onConfirmSelection:ew?()=>{let e=Array.from(eN.values());e.length>0&&Q(e),eA(),el(!1)}:void 0,previewCrop:H}),ew&&(0,t.jsx)("div",{className:"flex justify-end mt-4 pt-4 border-t border-tcc-alt",children:(0,t.jsx)(c.AdminButtonOutlined,{onClick:()=>eI(!1),children:"Cancel"})})]}),q&&(0,t.jsx)(m.AdminLinkModal,{open:ea,setOpen:en,value:eu?.link||J||{},onSave:e=>{let t={...eu,link:e};el(!1),em(t),L(t)}}),X&&(0,t.jsx)(h.AdminModal,{open:ei,setOpen:es,title:"Edit alt text",description:"Override the accessibility text for this image.",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"alt-override",children:"Alt text override"}),(0,t.jsx)(a.AdminInput,{disabled:eh,id:"alt-override",value:er,onChange:e=>eo(e),placeholder:ej.current?.meta?.altText}),(0,t.jsx)(n.AdminMiniLabel,{children:"Leave blank to use default alt text (if available)"}),(0,t.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,t.jsx)(c.AdminButtonOutlined,{onClick:()=>es(!1),children:"Cancel"}),(0,t.jsx)(c.AdminButtonPrimary,{disabled:eh,onClick:()=>{let e,t;e=er?.trim()||ej.current?.meta?.altText||void 0,t=eu?(0,w.deepClone)(eu):{},es(!1),(0,T.default)(t,"meta.altText",e),em(t),L(t)},children:"Save"})]})]})})]})},R=({className:e,value:l,onChange:a})=>(0,t.jsx)("div",{"data-alignment":!0,children:(0,t.jsxs)(i.AdminRadioSelect,{value:l||"center",onChange:a,className:e,children:[(0,t.jsx)(p.AdminToolTip,{content:"Left alignment",children:(0,t.jsxs)(i.AdminRadioSelectOption,{value:"start",className:(0,C.classNames)("rounded-md border","start"===l?"bg-white! text-black! border-primaryaccent-600! ":"bg-white! text-black!","px-2 py-1 font-medium w-10"),children:[(0,t.jsx)("span",{className:"sr-only",children:"Left alignment"}),(0,t.jsx)(M.AlignHorizontalJustifyStart,{className:"w-5 h-5",strokeWidth:1.5})]})}),(0,t.jsx)(p.AdminToolTip,{content:"Center alignment",children:(0,t.jsxs)(i.AdminRadioSelectOption,{value:"center",className:(0,C.classNames)("rounded-md border","center"===l?"bg-white! text-black! border-primaryaccent-600!":"bg-white! text-black!","px-2 py-1 font-medium w-10"),children:[(0,t.jsx)("span",{className:"sr-only",children:"Center alignment"}),(0,t.jsx)(S.AlignHorizontalJustifyCenter,{className:"w-5 h-5",strokeWidth:1.5})]})}),(0,t.jsx)(p.AdminToolTip,{content:"Right alignment",children:(0,t.jsxs)(i.AdminRadioSelectOption,{value:"end",className:(0,C.classNames)("rounded-md border","end"===l?"bg-white! text-black! border-primaryaccent-600!":"bg-white! text-black!","px-2 py-1 font-medium w-10"),children:[(0,t.jsx)("span",{className:"sr-only",children:"Right alignment"}),(0,t.jsx)(E.AlignHorizontalJustifyEnd,{className:"w-5 h-5",strokeWidth:1.5})]})})]})})},390416,e=>{"use strict";e.s(["default",()=>r],390416);var t=e.i(843476),l=e.i(450941),a=e.i(993675),n=e.i(148797),i=e.i(690654),s=e.i(783846);let r={id:s.default.id,type:s.default.type,name:s.default.name,edit:({block:e,onChange:i,editor:s="designer",rootProps:r={}})=>{let o=(t,l)=>{let n=(0,a.deepClone)(e);n.data[t]=l,i(n)};return"simple"===s?(0,t.jsxs)("div",{className:"space-y-2 w-full",...r,children:[(0,t.jsx)(n.AdminMiniLabel,{children:"Audio:"}),(0,t.jsx)(l.MediaFormInput,{buttonText:"Select Audio File",output:"full",network:!1,type:"audio",label:"",value:e?.data?.Media?.id,onChange:e=>o("Media",e)})]}):(0,t.jsx)("div",{className:"w-full",...r,children:(0,t.jsx)(l.MediaFormInput,{buttonText:"Select Audio File",output:"full",network:!1,type:"audio",label:"",value:e?.data?.Media?.id,onChange:e=>o("Media",e)})})},render:i.default,metadata:s.default}},451789,119596,213843,990849,997454,167742,e=>{"use strict";var t=e.i(475254);let l=(0,t.default)("align-horizontal-space-around",[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]]);e.s(["AlignHorizontalSpaceAround",0,l],451789);let a=(0,t.default)("align-horizontal-space-between",[["rect",{width:"6",height:"14",x:"3",y:"5",rx:"2",key:"j77dae"}],["rect",{width:"6",height:"10",x:"15",y:"7",rx:"2",key:"bq30hj"}],["path",{d:"M3 2v20",key:"1d2pfg"}],["path",{d:"M21 2v20",key:"p059bm"}]]);e.s(["AlignHorizontalSpaceBetween",0,a],119596);let n=(0,t.default)("move-down",[["path",{d:"M8 18L12 22L16 18",key:"cskvfv"}],["path",{d:"M12 2V22",key:"r89rzk"}]]);e.s(["MoveDown",0,n],213843);var i=e.i(422233),s=e.i(993675);let r=e=>({...(0,s.hydrateUniqueBlockIds)(e||{},!0),id:(0,i.v4)()});e.s(["createEditListItem",0,r],990849),e.s(["EditListControls",()=>$,"WebpageEditList",()=>O],167742);var o=e.i(843476),d=e.i(271645),c=e.i(306489),u=e.i(253100),m=e.i(158457),h=e.i(761978),x=e.i(796440),p=e.i(276369),f=e.i(125621),g=e.i(787255),b=e.i(759540),j=e.i(988842),v=e.i(922240),y=e.i(687517),C=e.i(830699),w=e.i(998104);let N=e=>e.left+e.width,k=e=>e.top+e.height,A=(e,t)=>
3t.left>=N(e)-1&&t.top<k(e),T=(e,t,l)=>{let a=-l.left,n=-l.top,i=e;for(;i&&i!==t;)a+=i.offsetLeft,n+=i.offsetTop,i=i.offsetParent;return{left:a,top:n,width:e.offsetWidth,height:e.offsetHeight}},S="opacity-0 group-hover/inserter:opacity-100 group-has-focus-visible/inserter:opacity-100 transition-opacity",E=({container:e,items:t,orientation:l,layoutKey:a,typeName:n,onInsert:i})=>{let s,r,[c,u]=(0,d.useState)([]),{shift:m,reset:h,getShift:p}=(s=(0,d.useRef)(new Map),r=(e,t,l,a=!1)=>{let n=s.current.get(e);if(!n&&0===t)return;let i=n?.property===l?getComputedStyle(e)[l]:"0px";n?.animation.cancel();let r=window.matchMedia("(prefers-reduced-motion: reduce)").matches,o=[{[l]:i},{[l]:`${t}px`}],d=e.animate(o,{duration:r||a?0:150,easing:"ease-out",fill:"forwards"});s.current.set(e,{animation:d,property:l}),0===t&&(d.onfinish=()=>{d.cancel(),s.current.get(e)?.animation===d&&s.current.delete(e)})},(0,d.useEffect)(()=>()=>{for(let{animation:e}of s.current.values())e.cancel()},[]),{shift:(e,t,l)=>{e.forEach((e,a)=>r(e,6*t[a],"x"===l?"left":"top"))},reset:({instant:e=!1}={})=>{for(let[t,{property:l}]of s.current)r(t,0,l,e)},getShift:e=>{let t=s.current.get(e),l=t&&Number.parseFloat(getComputedStyle(e)[t.property])||0;return{left:t?.property==="left"?l:0,top:t?.property==="top"?l:0}}}),f=e=>t.map(t=>e.querySelector(`[data-editor-block="${CSS.escape(t.id)}"]`));(0,d.useLayoutEffect)(()=>{if(!e)return;let t=()=>{let t=f(e);
3if(!t.every(Boolean))return u(e=>e.length?[]:e);let a=t.map(t=>T(t,e,p(t))),n=((e,t)=>{if("vertical"===t)return"vertical";if(e.length<2)return"horizontal";for(let t=1;t<e.length;t++)if(A(e[t-1],e[t]))return"horizontal";return"vertical"})(a,l),i=Number.parseFloat(getComputedStyle(e)["vertical"===n?"rowGap":"columnGap"])||8,s=((e,t,l)=>{if(!e.length)return[];let a="vertical"===t?"y":"x",n=(e,t)=>"x"===a?{index:t,axis:a,center:e.left-l/2,start:e.top,length:e.height,space:l}:{index:t,axis:a,center:e.top-l/2,start:e.left,length:e.width,space:l},i=(e,t)=>"x"===a?{index:t,axis:a,center:N(e)+l/2,start:e.top,length:e.height,space:l}:{index:t,axis:a,center:k(e)+l/2,start:e.left,length:e.width,space:l},s=[n(e[0],0)];for(let t=1;t<e.length;t++){let l=e[t-1],r=e[t];if("y"===a){let e=Math.min(l.left,r.left);s.push({index:t,axis:a,center:(k(l)+r.top)/2,start:e,length:Math.max(N(l),N(r))-e,space:Math.max(r.top-k(l),0)})}else if(A(l,r)){let e=Math.min(l.top,r.top);s.push({index:t,axis:a,center:(N(l)+r.left)/2,start:e,length:Math.max(k(l),k(r))-e,space:Math.max(r.left-N(l),0)})}else s.push(i(l,t),n(r,t))}return s.push(i(e[e.length-1],e.length)),s})(a,n,i);u(e=>JSON.stringify(e)===JSON.stringify(s)?e:s)};t();let a=new ResizeObserver(t);return a.observe(e),e.addEventListener("pointerenter",t),()=>{a.disconnect(),e.removeEventListener("pointerenter",t)}},[e,a]);let g=t=>{if(!e)return;let l=f(e);if(l.every(Boolean)){let a;m(l,(a=l.map(t=>T(t,e,p(t))),a.map((e,l)=>"x"===t.axis&&(k(e)<=t.start||e.top>=t.start+t.length)?0:l<t.index?-1:1)),t.axis)}},b=t=>{let l=t.relatedTarget instanceof Element?t.relatedTarget.closest("[data-editor-block]"):null;h({instant:!!(l&&e?.contains(l)&&l!==e)})},v=n.toLowerCase();return c.map((e,l)=>{var a;let n;return(0,o.jsxs)("div",{"data-editor-affordance":!0,"data-edit-list-inserter":!0,className:"group/inserter absolute z-30 flex items-center justify-center",style:(n=Math.min(Math.max(e.space,8),24),"x"===e.axis?{left:e.center-n/2,top:e.start,width:n,height:e.length}:{top:e.center-n/2,left:e.start,height:n,width:e.length}),onPointerEnter:()=>g(e),onPointerLeave:b,children:[(0,o.jsx)("span",{className:(0,j.classNames)("absolute rounded-full bg-blue-500 shadow-md pointer-events-none","x"===e.axis?"w-2 h-full":"h-2 w-full",S)}),(0,o.jsx)("button",{type:"button","aria-label":(a=e.index)>=t.length?`Add ${v} at the end`:t[a]?.text?`Add ${v} before "${t[a].text}"`:`Add ${v} before ${v} ${a+1}`,title:`Add ${v}`,onClick:()=>{h(),i(e.index)},onFocus:t=>t.currentTarget.matches(":focus-visible")&&g(e),onBlur:()=>h(),className:(0,j.classNames)("relative flex items-center justify-center h-5 w-5 shrink-0 rounded-full bg-blue-500 text-white shadow-md pointer-events-none group-hover/inserter:pointer-events-auto",S),children:(0,o.jsx)(x.TCCPlusIcon,{className:"h-4 w-4"})})]},l)})};var M=e.i(766937),B=e.i(281404),I=e.i(863883);let L=(0,d.createContext)(null),R=e=>`EditListItemControls:${e}`;e.s(["EditListItemControls",0,({children:e})=>{let t=(0,d.useContext)(L);return t?(0,o.jsx)(M.Fill,{name:t,children:e}):null},"EditListItemControlsContext",0,L,"editListItemControlsSlot",0,R],997454);let D=({item:e,items:t,index:l,typeName:a="Item",listType:n,onChange:i,onDelete:r,orientation:d="vertical",children:c})=>{let u=(0,C.useBlockWrapperProps)(e?.id,{name:a,layer:"item",type:n}),m=(0,C.useIsBlockSelected)(e?.id),h=R(e?.id);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(L.Provider,{value:h,children:c(u)}),m&&(0,o.jsx)(y.BlockParentButton,{}),m&&(0,o.jsx)(w.default,{children:(0,o.jsxs)("div",{"data-block-controls":!0,className:"flex items-center gap-1.5",children:[(0,o.jsx)("p",{className:"text-xs px-1 whitespace-nowrap",children:a}),(0,o.jsx)(M.Slot,{name:h})]})}),m&&(0,o.jsx)(I.BlockToolbarMovers,{onMove:e=>{let a="up"===e?l-1:l+1;if(!i||a<0||a>=t.length)return;let n=[...t],[s]=n.splice(l,1);n.splice(a,0,s),i(n)},label:a,orientation:d,disableUp:0===l,disableDown:l===t.length-1}),m&&(0,o.jsxs)(w.default.Options,{children:[(0,o.jsx)(B.BlockToolbarMenuItem,{icon:x.TCCDuplicateIcon,onClick:()=>{if(!i)return;let a=(0,s.setUniqueIds)((0,s.deepClone)(e)),n=[...t];n.splice(l+1,0,a),i(n)},children:`Duplicate ${a.toLowerCase()}`}),(0,o.jsx)(B.BlockToolbarMenuItem,{icon:x.TCCCloseIcon,destructive:!0,onClick:()=>r?.(e),children:`Delete ${a.toLowerCase()}`})]})]})};var P=e.i(1990);let O=({title:e="List Editor",typeName:t="Item",itemName:l,selectable:a=!0,className:n,groupId:i="editlist",onItemClick:f,items:g,id:N,defaultArgs:k,component:A,onChange:T,listType:S="editlist",passThroughProps:M=null,reorderComponent:B,extraSettings:I,onSettings:L,marquee:R=!1,limit:O=null,editor:$="designer",itemOrientation:z="vertical",inserters:H=!1,onInsert:W})=>{let{containerProps:_,Toolbar:q,forceSetSelection:U}=(0,c.useFloatingToolbar)({id:N||S}),V=(0,d.useId)(),K=N||V,G=(0,C.useHasBlockSelection)(),J=(0,C.useIsBlockSelected)(a?K:null),{selectBlock:X}=(0,C.useBlockSelectionActions)(),[Y,Z]=(0,d.useState)(null),Q=(0,C.useBlockWrapperProps)(a?K:null,{name:e,layer:"list",type:S,ref:G?Z:void 0,className:(0,j.classNames)(n,"relative min-h-[40px] w-full")}),[ee,et]=(0,d.useState)(!1),[el,ea]=(0,d.useState)(g),[en,ei]=(0,d.useState)(!G),es=(e=g?.length??0)=>{if(O>0&&g?.length>=O)return;let t=r(k),l=(0,s.deepClone)(g||[]);T&&T([...l.slice(0,e),t,...l.slice(e)])},er=()=>{ea(g),et(!0)},eo=e=>{f&&f(e)},ed=e=>{let t=g.map(t=>
3t.id!==e.id?t:e);T&&T([...t])},ec=e=>{let t=g.filter(t=>t.id!==e.id);T&&T([...t])},eu=()=>(0,o.jsxs)(o.Fragment,{children:[!0===R&&(0,o.jsx)(m.AdminRichToolButton,{onClick:()=>ei(!en),tooltip:en?"Pause":"Play",children:en?(0,o.jsx)(x.TCCPauseIcon,{className:"w-5 h-5"}):(0,o.jsx)(x.TCCPlayIcon,{className:"w-5 h-5"})}),(0,o.jsx)(m.AdminRichToolButton,{onClick:()=>es(),tooltip:`New ${t}`,children:(0,o.jsx)(x.TCCPlusIcon,{className:"w-5 h-5"})}),L&&(0,o.jsx)(m.AdminRichToolButton,{active:ee,preserveCaret:!1,onClick:L,tooltip:"Open List Design Settings",children:(0,o.jsx)(x.TCCSettingsIcon,{className:"w-5 h-5"})}),(0,o.jsx)(m.AdminRichToolButton,{preserveCaret:!1,onClick:er,tooltip:`Reorder & Remove ${t}s`,children:(0,o.jsx)(x.TCCReorderIcon,{className:"w-5 h-5"})})]});return(0,o.jsxs)("div",{"data-edit-list":!0,...G?{}:_,...Q,children:[ee?null:!0===R?(0,o.jsx)(b.Marquee,{playing:en,...M,children:g?.map((e,t)=>ee?null:(0,o.jsx)(A,{edit:!0,item:e,onClick:e=>eo(e),onChange:ed,onDelete:ec,...M,children:(0,o.jsx)(P.WebpageEditListRemoveButton,{id:e?.id,item:e,onClick:ec})},e?.id||t))}):g?.map((e,a)=>ee?null:(0,o.jsx)(D,{item:e,items:g,index:a,typeName:l||t,listType:S,onChange:T,onDelete:ec,orientation:z,children:t=>(0,o.jsx)(A,{edit:!0,item:e,onClick:e=>eo(e),onChange:ed,onDelete:ec,...M,toolbarControls:G?()=>X(K):U,blockWrapperProps:t,children:(0,o.jsx)(P.WebpageEditListRemoveButton,{id:e?.id,item:e,onClick:ec})})},e?.id||a)),G&&H&&!R&&!ee&&!(O>0&&g?.length>=O)&&(0,o.jsx)(E,{container:Y,items:g||[],orientation:z,layoutKey:JSON.stringify([g?.map(e=>e?.id),z,n]),typeName:t,onInsert:W||es}),G&&a&&J&&(0,o.jsx)(y.BlockParentButton,{}),G&&a&&J&&(0,o.jsx)(w.default,{children:(0,o.jsxs)("div",{"data-block-controls":!0,className:"flex items-center gap-1.5",children:[(0,o.jsx)("span",{className:"text-xs px-1 whitespace-nowrap",children:e}),eu()]})}),G&&!a&&(0,o.jsx)(v.BlockExtraControls,{children:eu()}),!G&&(0,o.jsx)("div",{"data-editlist-controls":!0,className:(0,j.classNames)("space-x-1 flex items-center absolute z-50 left-0 -top-8 bg-blue-300 rounded-xs text-basealt-600 h-8 px-2 opacity-0"),children:(0,o.jsx)(q,{children:(0,o.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,o.jsx)("span",{className:"ml-1 text-xs",children:e}),!0===R&&(0,o.jsx)(m.AdminRichToolButton,{onClick:()=>ei(!en),tooltip:en?"Pause":"Play",children:en?(0,o.jsx)(x.TCCPauseIcon,{className:"w-5 h-5 text-basealt-600"}):(0,o.jsx)(x.TCCPlayIcon,{className:"w-5 h-5 text-basealt-600"})}),(0,o.jsx)(m.AdminRichToolButton,{onClick:()=>es(),tooltip:`New ${t}`,children:(0,o.jsx)(x.TCCPlusIcon,{className:"w-5 h-5 text-basealt-600"})}),L&&(0,o.jsx)(m.AdminRichToolButton,{active:ee,preserveCaret:!1,onClick:L,tooltip:"Open List Design Settings",children:(0,o.jsx)(x.TCCSettingsIcon,{className:"w-5 h-5 text-basealt-600"})}),(0,o.jsx)(m.AdminRichToolButton,{preserveCaret:!1,onClick:er,tooltip:`Reorder & Remove ${t}s`,children:(0,o.jsx)(x.TCCReorderIcon,{className:"w-5 h-5 text-basealt-600"})})]})})}),(0,o.jsxs)(p.AdminModal,{variant:"success",open:ee,setOpen:et,title:"Edit Order",description:"Reorder or remove items",children:[I?I():null,(0,o.jsx)("div",{className:"mt-2",children:(0,o.jsx)(u.AdminRepeater,{noAdd:!0,direction:"vertical",withHandle:!0,onChange:e=>{ea(e)},id:"listitems",datasource:el,component:B||F})}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(h.AdminButtonOutlined,{onClick:()=>{ea(g),et(!1)},children:"Cancel"}),(0,o.jsx)(h.AdminButtonPrimary,{onClick:()=>{T&&T(el),et(!1)},children:"Save"})]})]})]})},F=({item:e,onChange:t})=>(0,o.jsx)(f.AdminSurface,{className:" w-full  ",children:(0,o.jsx)("p",{className:"text-basealt-600 px-2 py-1 text-xs font-semibold",children:e?.title||e?.text})}),$=({onAdd:e,onSettings:t,onReorder:l,label:a="List",typeName:n="Item"})=>(0,o.jsxs)("div",{"data-block-controls":!0,className:"flex items-center space-x-1",children:[a&&(0,o.jsx)("p",{className:"text-xs",children:a}),(0,o.jsx)(g.AdminToolTip,{content:`New ${n}`,children:(0,o.jsx)("button",{type:"button","aria-label":`New ${n}`,onClick:e,children:(0,o.jsx)(x.TCCPlusIcon,{className:"w-5 h-5"})})}),t&&(0,o.jsx)(g.AdminToolTip,{content:"Open List Design Settings",children:(0,o.jsx)("button",{type:"button","aria-label":"List Design Settings",onClick:t,children:(0,o.jsx)(x.TCCSettingsIcon,{className:"w-5 h-5"})})}),(0,o.jsx)(g.AdminToolTip,{content:`Reorder & Remove ${n}s`,children:(0,o.jsx)("button",{type:"button","aria-label":`Reorder ${n}s`,onClick:l,children:(0,o.jsx)(x.TCCReorderIcon,{className:"w-5 h-5"})})})]})},455014,983177,e=>{"use strict";e.s(["AdminButtonLinkEditor",()=>z],455014);var t=e.i(843476),l=e.i(271645),a=e.i(548748),n=e.i(533640),i=e.i(792032),s=e.i(148797),r=e.i(158457),o=e.i(92023),d=e.i(259073),c=e.i(598614),u=e.i(452778),m=e.i(837763),h=e.i(684827),x=e.i(761978),p=e.i(796440),f=e.i(125621),g=e.i(988842),b=e.i(993675),j=e.i(153501),v=e.i(482820),y=e.i(348707),C=e.i(166540
3),w=e.i(107233);let N={day:0,time:"00:00",duration:60,allDay:!0},k={week:1,day:0,time:"00:00",duration:60,allDay:!0},A={type:"recurring",recurring:{type:"weekly",frequency:1,schedules:[{day:0,time:"09:00",duration:60,allDay:!1}]}},T=({value:e,onChange:l,showAllDay:a=!0,disabled:n=!1,className:i,idPrefix:r=""})=>(0,t.jsxs)(f.AdminSurface,{className:i,children:[(0,t.jsx)(s.AdminLabel,{children:"Recurring Schedule"}),(0,t.jsx)(S,{value:e,onChange:l,disabled:n}),(0,t.jsx)(E,{value:e,onChange:l,disabled:n}),(0,t.jsx)(M,{value:e,onChange:l,showAllDay:a,disabled:n,idPrefix:r}),(0,t.jsx)(B,{value:e,onChange:l,showAllDay:a,disabled:n,idPrefix:r}),(0,t.jsx)(I,{value:e,onChange:l,disabled:n,idPrefix:r})]}),S=({value:e,onChange:l,disabled:a=!1})=>{if(e.schedule?.type!=="recurring")return null;let n=e.schedule,i=n?.recurring?.type,r=(0,g.classNames)("flex-1 items-center rounded-md px-3 py-2 text-sm disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none bg-tcc-base text-tcc-basetext shadow-xs ring-1 ring-inset ring-gray-300 hover:bg-gray-50","data-checked:bg-tcc-altdark data-checked:text-tcc-basetext data-checked:shadow-xs data-checked:hover:bg-tcc-alt data-checked:focus-visible:outline-solid data-checked:focus-visible:outline-2 data-checked:focus-visible:outline-offset-2 data-checked:focus-visible:outline-primary-600");return(0,t.jsxs)("div",{className:"w-full mt-2",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Frequency - Select one frequency type for this recurring schedule"}),(0,t.jsxs)(m.AdminRadioSelect,{className:"mt-2",value:i||"",onChange:e=>{let t=(0,b.deepClone)(n);(0,y.default)(t,"recurring.type",e),"weekly"===t.recurring.type?(t.recurring.frequency||(t.recurring.frequency=1),t.recurring.schedules?.length||(t.recurring.schedules=[N])):"monthly"===t.recurring.type&&(t.recurring.frequency||(t.recurring.frequency=1),t.recurring.schedules?.length||(t.recurring.schedules=[k])),l("schedule",t)},disabled:a,children:[(0,t.jsx)(j.Radio,{as:"button",type:"button",className:r,value:"daily",disabled:a,children:(0,t.jsx)("span",{children:"Daily"})}),(0,t.jsx)(j.Radio,{as:"button",type:"button",className:r,value:"weekly",disabled:a,children:(0,t.jsx)("span",{children:"Weekly"})}),(0,t.jsx)(j.Radio,{as:"button",type:"button",className:r,value:"monthly",disabled:a,children:(0,t.jsx)("span",{children:"Monthly"})})]})]})},E=({value:e,onChange:l,disabled:a=!1})=>{if(e.schedule?.type!=="recurring"||e.schedule?.recurring?.type!=="daily")return null;let n=e.schedule.recurring,r=(0,v.default)(n,"time",""),o=(0,v.default)(n,"duration",0);return(0,t.jsxs)("div",{className:"flex gap-3 mt-3 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(s.AdminMiniLabel,{className:"mb-2",children:"Daily Time"}),(0,t.jsx)(i.AdminInput,{type:"time",value:r,onChange:t=>{let a=(0,b.deepClone)(e.schedule);(0,y.default)(a,"recurring.time",t),l("schedule",a)},disabled:a})]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(s.AdminMiniLabel,{className:"mb-2",children:"Duration"}),(0,t.jsx)("div",{className:"flex gap-2 items-center flex-wrap",children:(0,t.jsx)(L,{value:o,onChange:t=>{let a=(0,b.deepClone)(e.schedule);(0,y.default)(a,"recurring.duration",t),l("schedule",a)},disabled:a})})]})]})},M=({value:e,onChange:l,showAllDay:a=!1,disabled:n=!1,idPrefix:r=""})=>{if(e.schedule?.type!=="recurring"||e.schedule?.recurring?.type!=="weekly")return null;let d=e.schedule,c=e.schedule.recurring,m=(0,v.default)(c,"schedules"),h=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}],f=(e,t,a)=>{let n=(0,b.deepClone)(d);"weekly"===n.recurring.type&&(n.recurring.schedules[e]||(n.recurring.schedules[e]=N),n.recurring.schedules[e][t]=a,l("schedule",n))};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex gap-3 justify-between mt-3 items-center",children:[(0,t.jsx)(s.AdminMiniLabel,{className:"mb-2",children:"Weekly Schedules"}),(0,t.jsxs)(x.AdminButton,{onClick:()=>{let e=(0,b.deepClone)(d);"weekly"!==e.recurring.type||(e.recurring.schedules||(e.recurring.schedules=[]),e.recurring.schedules.push(N),l("schedule",e))},className:"flex items-center gap-2 text-xs!",disabled:n,children:[(0,t.jsx)(w.Plus,{strokeWidth:1.25,className:"w-4 h-4"}),"Add day"]})]}),!!m&&m.map((s,c)=>(0,t.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-tcc-base border-tcc-altdark rounded-md border mt-2 flex-wrap",children:[(0,t.jsx)(o.AdminSelect,{value:s.day,onChange:e=>f(c,"day",parseInt(e)),disabled:n,children:h.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,t.jsx)("span",{className:"text-sm text-tcc-basetext",children:"at"}),(0,t.jsx)(i.AdminInput,{type:"time",value:s.time,onChange:e=>f(c,"time",e),disabled:n}),a&&(0,t.jsx)(u.AdminCheckbox,{id:`${r}weekly-allday-${c}`,value:s.allDay,onChange:e=>f(c,"allDay",e),description:"All day",disabled:n}),(!a||!s.allDay)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-sm text-gray-600",children:"for"}),(0,t.jsx)(L,{value:s.duration,onChange:t=>{let a;return a=(0,b.deepClone)(e.schedule),void((0,y.default)(a,`recurring.schedules[${c}].duration`,t),l("schedule",a))},disabled:n})]}),m.length>1&&(0,t.jsx)("button",{type:"button",onClick:()=>{let e;"weekly"===(e=(0,b.deepClone)(d)).recurring.type&&e.recurring.schedules&&e.recurring.schedules.length>c&&(e.recurring.schedules.splice(c,1),l("schedule",e))},className:"ml-auto p-1 hover:text-red-800",disabled:n,children:(0,t.jsx)(p.TCCCloseIcon,{className:"w-5 h-5"})})]},c))]})}
3,B=({value:e,onChange:l,showAllDay:a=!1,disabled:n=!1,idPrefix:r=""})=>{if(e.schedule?.type!=="recurring"||e.schedule?.recurring?.type!=="monthly")return null;let d=e.schedule,c=e.schedule.recurring,m=(0,v.default)(c,"schedules"),h=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}],f=[{value:1,label:"1st"},{value:2,label:"2nd"},{value:3,label:"3rd"},{value:4,label:"4th"},{value:-1,label:"Last"}],g=(e,t,a)=>{let n=(0,b.deepClone)(d);"monthly"===n.recurring.type&&(n.recurring.schedules[e]||(n.recurring.schedules[e]=k),n.recurring.schedules[e][t]=a,l("schedule",n))};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex gap-3 justify-between mt-3 items-center",children:[(0,t.jsx)(s.AdminMiniLabel,{className:"mb-2",children:"Monthly Schedules"}),(0,t.jsxs)(x.AdminButton,{onClick:()=>{let e=(0,b.deepClone)(d);"monthly"!==e.recurring.type||(e.recurring.schedules||(e.recurring.schedules=[]),e.recurring.schedules.push(k),l("schedule",e))},className:"flex items-center gap-2 text-xs!",disabled:n,children:[(0,t.jsx)(w.Plus,{strokeWidth:1.25,className:"w-4 h-4"}),"Add day"]})]}),!!m&&m.map((s,c)=>(0,t.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-tcc-base border-tcc-altdark rounded-md border mt-2 flex-wrap",children:[(0,t.jsx)(o.AdminSelect,{value:s.week,onChange:e=>g(c,"week",parseInt(e)),className:"w-32!",disabled:n,children:f.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,t.jsx)(o.AdminSelect,{value:s.day,onChange:e=>g(c,"day",parseInt(e)),disabled:n,children:h.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,t.jsx)("span",{className:"text-sm text-gray-600",children:"at"}),(0,t.jsx)(i.AdminInput,{type:"time",value:s.time,onChange:e=>g(c,"time",e),disabled:n}),a&&(0,t.jsx)(u.AdminCheckbox,{id:`${r}monthly-allday-${c}`,value:s.allDay,onChange:e=>g(c,"allDay",e),description:"All day",disabled:n}),(!a||!s.allDay)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-sm text-gray-600",children:"for"}),(0,t.jsx)(L,{value:s.duration,onChange:t=>{let a;return a=(0,b.deepClone)(e.schedule),void((0,y.default)(a,`recurring.schedules[${c}].duration`,t),l("schedule",a))},disabled:n})]}),m.length>1&&(0,t.jsx)("button",{type:"button",onClick:()=>{let e;"monthly"===(e=(0,b.deepClone)(d)).recurring.type&&e.recurring.schedules&&e.recurring.schedules.length>c&&(e.recurring.schedules.splice(c,1),l("schedule",e))},className:"ml-auto p-1 hover:text-red-800",disabled:n,children:(0,t.jsx)(p.TCCCloseIcon,{className:"w-5 h-5"})})]},c))]})},I=({value:e,onChange:l,disabled:a=!1,idPrefix:i=""})=>{if(e.schedule?.type!=="recurring")return null;let r=e.schedule?.excludedDates||[];return(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)(s.AdminLabel,{htmlFor:`${i}excludedDate`,children:"Excluded Dates"}),(0,t.jsx)(n.AdminDateTimeInput,{id:`${i}excludedDate`,type:"date",value:"",onChange:t=>{if(!t)return;let a=(0,C.default)(t).format("YYYY-MM-DD");if(r.includes(a))return;let n=(0,b.deepClone)(e.schedule);n.excludedDates=[...r,a],l("schedule",n)},className:"w-full","aria-describedby":`${i}excludedDate-hint`,disabled:a}),r.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-2 mt-2 list-none p-0","aria-label":"Excluded dates",children:r.map(n=>(0,t.jsx)("li",{children:(0,t.jsx)(h.AdminBadge,{item:{name:(0,C.default)(n).format("MMMM D, YYYY"),id:n},onClose:a?void 0:()=>{let t;(t=(0,b.deepClone)(e.schedule)).excludedDates=r.filter(e=>e!==n),l("schedule",t)}})},n))}),(0,t.jsx)(s.AdminMiniLabel,{id:`${i}excludedDate-hint`,children:"Select dates to skip within the recurrence"})]})},L=({value:e,onChange:l,hoursLabel:a="hours",minutesLabel:n="minutes",disabled:s=!1})=>{let r=Math.floor(e/60),o=(t,a)=>{let n=Math.floor(e/60),i=e%60;"hours"===a&&(n=parseInt(t,10)||0),"minutes"===a&&(i=parseInt(t,10)||0),l(60*n+i)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.AdminInput,{name:"hours",type:"number",min:0,max:99,value:r.toString(),onChange:e=>o(e,"hours"),disabled:s}),(0,t.jsx)("span",{className:"text-sm text-gray-600",children:a}),(0,t.jsx)(i.AdminInput,{name:"minutes",type:"number",min:0,max:59,step:5,value:(e%60).toString(),onChange:e=>o(e,"minutes"),disabled:s}),(0,t.jsx)("span",{className:"text-sm text-gray-600",children:n})]})};e.s(["DEFAULT_RECURRING_SCHEDULE",0,A,"RecurringScheduleOptions",0,T,"ScheduleForm",0,({value:e,onCh
3ange:l,account:a,disabled:i=!1,showAllDay:r=!0})=>(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)(s.AdminLabel,{children:"Schedule Type"}),(0,t.jsxs)(o.AdminSelect,{value:e?.schedule?.type||"",onChange:e=>{l("schedule",{type:e})},disabled:i,children:[(0,t.jsx)("option",{value:"",children:"No schedule"}),(0,t.jsx)("option",{value:"absolute",children:"Specific Date & Time"}),(0,t.jsx)("option",{value:"recurring",children:"Recurring Schedule"})]}),e?.schedule?.type==="absolute"&&(0,t.jsxs)(f.AdminSurface,{children:[(0,t.jsx)(s.AdminLabel,{children:"Set specific date and time"}),(0,t.jsxs)("div",{className:"flex gap-3 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Date"}),(0,t.jsx)(n.AdminDateTimeInput,{type:"datetime-local",value:e.schedule.start||"",onChange:t=>{"absolute"===e.schedule.type&&l("schedule",{...e.schedule,start:t})},timezone:a?.timezone,disabled:i})]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Duration"}),(0,t.jsx)("div",{className:"flex gap-2 items-center",children:(0,t.jsx)(L,{value:e.schedule.duration||0,onChange:t=>{"absolute"===e.schedule.type&&l("schedule",{...e.schedule,duration:t})},disabled:i})})]})]})]}),e?.schedule?.type==="recurring"&&(0,t.jsx)(T,{value:e,onChange:l,showAllDay:r,disabled:i})]})],983177);var R=e.i(974868),D=e.i(147629),P=e.i(489578),O=e.i(381084),F=e.i(514556);let $=["core/heading","core/paragraph","core/image","core/video","core/audio","core/buttons","core/form","core/giving","core/countdowntimer","core/divider","core/html"],z=({item:e,onChange:u,brand:m,onItemChange:h,allowLinking:x=!0,allowColors:p=!0,allowIcon:g=!0,popupEnabled:j=!1})=>{let[v,y]=(0,l.useState)("linking"),C=(0,D.useButtonSchedulingEnabled)(),w=e?.schedule?.type==="recurring",N=`button-${e?.id||"new"}-`,{account:k}=(0,P.useAdminUIContext)(),S=(t,l)=>{if(h)return void h(t,l);let a=(0,b.deepClone)(e);a[t]=l,u(a)},E=j&&e?.type==="popup",M=[{name:"Linking",id:"linking"},...E?[{name:"Popup Content",id:"popup"}]:[],{name:"Advanced Settings",id:"settings"},...C?[{name:"Scheduling",id:"scheduling"}]:[]],B="popup"!==v||E?v:"linking";return(0,t.jsx)("div",{"data-admin-button-link-editor":!0,className:"w-full mb-4 space-y-2",children:(0,t.jsxs)(O.AdminTabs,{activeTab:B,setActiveTab:y,tabs:M,children:[(0,t.jsxs)(O.AdminTab,{id:"linking",activeTab:B,children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Text"}),(0,t.jsx)(i.AdminInput,{value:e?.text,onChange:e=>S("text",e)})]}),x&&(0,t.jsx)(F.AdminLinkEditor,{item:e,onChange:u,onItemChange:h,actionsEnabled:!0,popupEnabled:j}),(0,t.jsxs)("div",{className:"flex items-center w-full space-x-2",children:[(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Style"}),(0,t.jsxs)(o.AdminSelect,{value:e?.variant,onChange:e=>S("variant",e),children:[(0,t.jsx)("option",{value:"default",children:"Default"}),(0,t.jsx)("option",{value:"action",children:"Action"}),(0,t.jsx)("option",{value:"outlined",children:"Outlined"})]})]}),(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"CSS Class Name"}),(0,t.jsx)(i.AdminInput,{value:e?.className,onChange:e=>S("className",e)})]})]}),p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Button Color"}),(0,t.jsx)(c.AdminBrandColorSelector,{withCurrentColor:!0,value:e?.color,brand:m,onChange:e=>S("color",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Button Text Color"}
3),(0,t.jsx)(a.AdminColorPicker,{anchor:{to:"top start",gap:"4px"},icon:(0,t.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:e?.textColor,onChange:e=>S("textColor",e)})]})]})]}),(0,t.jsx)(O.AdminTab,{id:"popup",activeTab:B,children:(0,t.jsx)(F.InsidePopupEditorContext.Provider,{value:!0,children:(0,t.jsx)("div",{"data-website":!0,children:(0,t.jsx)(r.AdminRichText,{isolated:!0,id:"linkeditorpopup",modal:!0,withEditableStyles:!0,allowedBlocks:$,brand:m,value:e?.popup,onChange:e=>S("popup",{blocks:e})})})})}),(0,t.jsxs)(O.AdminTab,{id:"settings",activeTab:B,children:[g&&(0,t.jsxs)(f.AdminSurface,{children:[(0,t.jsx)(s.AdminLabel,{children:"Button Icon"}),(0,t.jsxs)("div",{className:"flex items-center w-full space-x-4",children:[(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Choose an icon"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(R.IconFormInput,{value:e?.icon,brand:m,onChange:e=>S("icon",e),withLink:!1,allowColors:!1}),e?.icon&&(0,t.jsx)("p",{className:"text-xs",children:(0,t.jsx)("button",{type:"button",onClick:()=>S("icon",null),children:"Clear Icon"})})]})]}),(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Icon Positioning"}),(0,t.jsxs)(o.AdminSelect,{value:e?.iconPosition||"",onChange:e=>S("iconPosition",e),children:[(0,t.jsx)("option",{disabled:!0,value:"",children:"Select A Position"}),(0,t.jsx)("option",{value:"left",children:"Left"}),(0,t.jsx)("option",{value:"right",children:"Right"})]})]})]})]}),(0,t.jsxs)(f.AdminSurface,{children:[(0,t.jsx)(s.AdminLabel,{children:"Google Click Tracking"}),(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Event Tracking Name"}),(0,t.jsx)(i.AdminInput,{placeholder:"Auto-generated from button text",value:e?.eventTrackingName,onChange:e=>S("eventTrackingName",e)}),(0,t.jsx)("p",{className:"text-xs mt-1 text-tcc-basetext/50",children:"Overrides the automatically generated analytics event name for this button. Leave blank to use the default."})]})]})]}),(0,t.jsx)(O.AdminTab,{id:"scheduling",activeTab:B,children:(0,t.jsxs)(f.AdminSurface,{className:"space-y-2",children:[(0,t.jsx)(s.AdminLabel,{children:"Scheduling"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Publish on"}),(0,t.jsx)(n.AdminDateTimeInput,{value:e?.publishedAt,onChange:e=>S("publishedAt",e),timezone:k?.timezone})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Unpublish on"}),(0,t.jsx)(n.AdminDateTimeInput,{value:e?.unpublishedAt,onChange:e=>S("unpublishedAt",e),timezone:k?.timezone})]}),(0,t.jsx)("p",{className:"text-xs mt-1 text-tcc-basetext/50",children:"The button is only shown on the live site between these dates. Leave blank to always show it."}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsx)(s.AdminMiniLabel,{children:"Enable repeated scheduling"}),(0,t.jsx)(d.AdminToggle,{id:`${N}enable-recurring`,name:`${N}enable-recurring`,value:w,onChange:e=>S("schedule",e?(0,b.deepClone)(A):void 0),label:"Enable repeated scheduling"})]}),w&&(0,t.jsx)(T,{className:"mt-3",idPrefix:N,value:{schedule:e.schedule},onChange:(e,t)=>
3S("schedule",t)})]})})]})})}},583151,813617,635583,e=>{"use strict";e.s(["default",()=>W],583151);var t=e.i(843476);e.s(["ThemedButtonEditor",()=>$],635583);var l=e.i(862625),a=e.i(673302),n=e.i(242114),i=e.i(451789),s=e.i(119596),r=e.i(213843),o=e.i(994376),d=e.i(271645),c=e.i(997053),u=e.i(148797),m=e.i(837763),h=e.i(253100),x=e.i(779574),p=e.i(467080),f=e.i(92023),g=e.i(259073),b=e.i(761978),j=e.i(276369),v=e.i(787255),y=e.i(990849),C=e.i(167742);e.s(["EditableButtonSimple",()=>D,"EditableThemedButton",()=>R],813617);var w=e.i(455014),N=e.i(796440),k=e.i(830699),A=e.i(968278),T=e.i(223691),S=e.i(997454),E=e.i(235984),M=e.i(988842),B=e.i(208509),I=e.i(993675),L=e.i(1990);let R=({item:e,onChange:l,onDelete:a,linkEditorProps:n={},modalProps:i={},defaultOpen:s=!1,blockWrapperProps:r=null,autoEditIdRef:o=null,children:c})=>{let[u,m]=(0,d.useState)(s),[h,x]=(0,d.useState)(e),{brand:p}=(0,B.useModelContext)(),f=(0,k.useHasBlockSelection)()&&!!r,g=(0,k.useIsBlockSelected)(f?e?.id:null),{selectBlock:v}=(0,k.useBlockSelectionActions)(),y=(0,d.useRef)(!0);(0,d.useEffect)(()=>{f&&o&&o.current===e?.id&&(o.current=null,v(e.id),m(!0))},[]),(0,d.useEffect)(()=>{e&&!u&&x(e)},[e]);let{className:C,style:R,...D}=r||{};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(E.ThemedButton,{"data-webpageeditlist-delete-target":!0,editing:!0,...e,...D,className:(0,M.classNames)(e?.className,r?.className),onMouseDownCapture:()=>{y.current=g},onClick:e=>{if(e.preventDefault(),!f)return m(!0);(0,A.isInsideAffordance)(e.target)||e.detail>0&&!y.current&&m(!0)},style:{anchorName:(0,L.generateDeleteAnchorName)(e?.id),...r?.style||{}},children:[e?.text,c]}),g&&(0,t.jsx)(S.EditListItemControls,{children:(0,t.jsx)("button",{type:"button",className:T.BLOCK_TOOLBAR_BUTTON,"aria-label":"Edit button",title:"Edit button",onClick:()=>m(!0),children:(0,t.jsx)(N.TCCSettingsIcon,{className:"w-5 h-5"})})}),(0,t.jsxs)(j.AdminModal,{...i,variant:"success",open:u,setOpen:m,title:"Edit button",description:"You are editing the currently selected button",children:[(0,t.jsx)("div",{className:"flex items-center justify-center mt-4 mb-4",children:(0,t.jsx)(E.ThemedButton,{...h,tag:"button",type:"button",onClick:()=>{},children:h?.text})}),(0,t.jsxs)("form",{action:"#",noValidate:!0,onSubmit:e=>{e.preventDefault();let t=(0,I.deepClone)(h);l&&l(t),m(!1)},children:[(0,t.jsx)(w.AdminButtonLinkEditor,{popupEnabled:!0,...n,item:h,brand:p,onChange:e=>{x(e)}}),(0,t.jsxs)("div",{className:"flex justify-between mt-2 gap-2",children:[a&&(0,t.jsx)(b.AdminButtonOutlined,{onClick:()=>{a&&(a(e),m(!1))},className:"mr-auto text-red-600 border-red-600 hover:bg-red-50",children:"Delete"}),(0,t.jsx)(b.AdminButtonOutlined,{onClick:()=>{x(e),m(!1)},children:"Cancel"}),(0,t.jsx)(b.AdminButtonPrimary,{type:"submit",children:"Save"})]})]})]})]})},D=({item:e,onChange:l})=>{let{brand:a}=(0,B.useModelContext)();return(0,t.jsx)(w.AdminButtonLinkEditor,{popupEnabled:!0,item:e,brand:a,onChange:l})};var P=e.i(211863);let O=c.css`
4   
5    width: 100%;
6    
7    display: flex;
8    flex-wrap: wrap;
9    gap: 0.5em; 
10   
11    a {
12        display: flex;
13        align-items: center;
14        justify-content: center;
15    }
16
17    ${e=>c.css`
18            --buttons-layout: ${e?.value?.justify||"inherit"};
19        `}
20
21    ${e=>{if(e?.value?.orientation!=="vertical"&&e?.value?.justify)return c.css`
22                justify-content: var(--buttons-layout);
23
24                /* :not(#_) adds ID-level specificity so an explicit justify beats container alignment (block align, list layouts) */
25                main [data-block][class*=align-] &:not(#_) {
26                    &[data-edit-list] {
27                        justify-content: var(--buttons-layout);
28                    }
29                }
30            `}}
31
32    &.direction-vertical {
33        flex-direction: column;
34        align-items: var(--buttons-layout);
35    }
36
37    &.direction-horizontal {
38        flex-direction: row;
39        justify-content: var(--buttons-layout);
40        main [data-block][class*=align-] & {
41            &[data-edit-list] {
42                justify-content: var(--buttons-layout);
43            }
44        }
45    }
46
47    /* Set wrap variables */
48    ${e=>{if(e.value.disableWrap)return c.css`
49                flex-wrap: nowrap;
50            `}}
51
52    &.width-fixed {
53        a {
54            width: 200px;
55            text-align: center;
56        }
57    }
58
59`,F=(0,c.styled)(({id:e,value:c,justify:w,className:N,children:k,withEditableStyle:A,editor:T="designer",rootProps:S={},...E})=>{let B=(0,d.useRef)(null),L=(0,p.useRenderRichBlockRegistry)().getBlock("core/buttons"),O=L?.metadata?.placeholder,F=O?.data?.buttons[0],[$,z]=(0,d.useState)(!1),[H,W]=(0,d.useState)(c?.buttonWidths),[_,q]=(0,d.useState)(c?.buttonLayout),[U,V]=(0,d.useState)(c?.justify||""),[K,G]=(0,d.useState)(c?.orientation||""),[J,X]=(0,d.useState)(c?.wrap||!1),Y=c?.buttons?c.buttons:[],Z=e=>{let t=(0,I.deepClone)(c);t?.buttons||(t.buttons=[]),t.buttons=[...e],E?.onChange&&E.onChange(t)}
59;if("simple"===T)return(0,t.jsxs)("div",{className:"w-full space-y-2",...S,children:[(0,t.jsx)(u.AdminMiniLabel,{children:"Buttons:"}),(0,t.jsx)("div",{className:"w-full space-y-2",children:(0,t.jsx)(h.AdminRepeater,{defaultOpen:!1,itemTitle:"Button",itemTitleKey:"text",defaultArgs:F,buttonText:"New Button",direction:"vertical",onChange:Z,id:"buttons",datasource:Y,component:D})})]});let Q=N;return c?.buttonLayout&&(Q+=` layout-${c.buttonLayout}`),c?.buttonWidths&&(Q+=` width-${c.buttonWidths}`),c?.orientation&&(Q+=` direction-${c.orientation}`),c?.justify&&(Q+=` buttons-${c.justify}`),(0,t.jsxs)("div",{className:(0,M.classNames)(N,{[x.tailwindEditableStyles]:A}),"data-button-renderer":!0,...S,children:[(0,t.jsx)(C.WebpageEditList,{title:"Buttons",typeName:"Button",itemName:"Button",selectable:!1,listType:"buttonrepeater",onChange:Z,onSettings:()=>{W(c?.buttonWidths),q(c?.buttonLayout),z(!0)},className:Q,items:Y,id:e,defaultArgs:F,component:R,passThroughProps:{autoEditIdRef:B},itemOrientation:c?.orientation==="vertical"?"vertical":"horizontal",inserters:!0,onInsert:e=>{let t=(0,y.createEditListItem)(F);B.current=t.id,Z([...Y.slice(0,e),t,...Y.slice(e)])}}),k,(0,t.jsxs)(j.AdminModal,{variant:"success",open:$,setOpen:z,title:"Button Group Settings",description:"Advanced Design Options",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(u.AdminMiniLabel,{children:"Button Widths"}),(0,t.jsxs)(f.AdminSelect,{value:H,onChange:W,children:[(0,t.jsx)("option",{value:"",children:"Default"}),(0,t.jsx)("option",{value:"fluid",children:"Fluid (width of the text)"}),(0,t.jsx)("option",{value:"fixed",children:"Fixed (all buttons the same width)"})]})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(u.AdminLabel,{children:"Button Layout"}),(0,t.jsxs)("div",{className:"flex gap-8 justify-between",children:[(0,t.jsxs)("div",{className:"space-y-4 flex-1",children:[(0,t.jsx)(u.AdminMiniLabel,{children:"How should the buttons be justified?"}),(0,t.jsxs)(m.AdminRadioSelect,{value:U,onChange:V,children:[(0,t.jsx)(v.AdminToolTip,{content:"Justify items left",delay:300,children:(0,t.jsx)(m.AdminRadioSelectOption,{value:"start",className:(0,M.classNames)(P.AdminTheme.input,"py-3"),children:(0,t.jsx)(n.AlignHorizontalJustifyStart,{className:"w-4 h-4",strokeWidth:1.5})})}),(0,t.jsx)(v.AdminToolTip,{content:"Justify items center",delay:300,children:(0,t.jsx)(m.AdminRadioSelectOption,{value:"center",className:(0,M.classNames)(P.AdminTheme.input,"py-3"),children:(0,t.jsx)(l.AlignHorizontalJustifyCenter,{className:"w-4 h-4",strokeWidth:1.5})})}),(0,t.jsx)(v.AdminToolTip,{content:"Justify items right",delay:300,children:(0,t.jsx)(m.AdminRadioSelectOption,{value:"end",className:(0,M.classNames)(P.AdminTheme.input,"py-3"),children:(0,t.jsx)(a.AlignHorizontalJustifyEnd,{className:"w-4 h-4",strokeWidth:1.5})})}),"vertical"!==K?(0,t.jsx)(v.AdminToolTip,{content:"Space between items",delay:300,children:(0,t.jsx)(m.AdminRadioSelectOption,{value:"space-between",className:(0,M.classNames)(P.AdminTheme.input,"py-3"),children:(0,t.jsx)(s.AlignHorizontalSpaceBetween,{className:"w-4 h-4",strokeWidth:1.5})})}):(0,t.jsx)(v.AdminToolTip,{content:"Stretch items",delay:300,children:(0,t.jsx)(m.AdminRadioSelectOption,{value:"stretch",className:(0,M.classNames)(P.AdminTheme.input,"py-3"),children:(0,t.jsx)(i.AlignHorizontalSpaceAround,{className:"w-4 h-4",strokeWidth:1.5})})})]})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(u.AdminMiniLabel,{children:"How should items be aligned?"}),(0,t.jsxs)(m.AdminRadioSelect,{value:K,onChange:G,children:[(0,t.jsx)(v.AdminToolTip,{content:"Horizontal",delay:300,children:(0,t.jsx)(m.AdminRadioSelectOption,{value:"horizontal",className:(0,M.classNames)(P.AdminTheme.input,"py-3"),children:(0,t.jsx)(o.MoveRight,{className:"w-4 h-4",strokeWidth:1.5})})}),(0,t.jsx)(v.AdminToolTip,{content:"Vertical",delay:300,children:(0,t.jsx)(m.AdminRadioSelectOption,{value:"vertical",className:(0,M.classNames)(P.AdminTheme.input,"py-3"),children:(0,t.jsx)(r.MoveDown,{className:"w-4 h-4",strokeWidth:1.5})})})]})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex gap-3 items-center",children:[(0,t.jsx)(g.AdminToggle,{label:"Allow buttons to wrap to multiple lines",value:!J,onChange:e=>X(!e)}),(0,t.jsx)(u.AdminMiniLabel,{children:"Allow buttons to wrap to multiple lines"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,t.jsx)(b.AdminButtonOutlined,{onClick:()=>{W(c?.buttonWidths),q(c?.buttonLayout),z(!1)},children:"Cancel"}),(0,t.jsx)(b.AdminButtonPrimary,{onClick:()=>{let e=(0,I.deepClone)(c);e.buttonWidths=H,e.buttonLayout=_,e.justify=U,e.orientation=K,e.disableWrap=J,E?.onChange&&E.onChange(e),z(!1)},children:"Save"})]})]})]})}).withConfig({displayName:"ButtonEditor__ThemedButtonEditorShared",componentId:"sc-4f1d0d22-0"})`
60    ${O}
61`,$=e=>(0,t.jsx)(F,{...e,className:e.className});var z=e.i(558328),H=e.i(634706);let W={id:H.default.id,type:H.default.type,name:H.default.name,edit:({block:e,withEditableStyle:l=!1,edit:a=!0,onChange:n,editor:i="designer",rootProps:s={}})=>(0,t.jsx)($,{withEditableStyle:l,edit:a,"data-buttons":!0,value:e?.data,onChange:t=>{let l;(l=(0,I.deepClone)(e)).data={...t},n(l)},editor:i,rootProps:s}),render:z.default,metadata:H.default}},816055,e=>{"use strict";var t=e.i(843476),l=e.i(452778),a=e.i(533640),n=e.i(792032),i=e.i(148797),s=e.i(92023),r=e.i(684827),o=e.i(761978),d=e.i(224370),c=e.i(542936),u=e.i(482820),m=e.i(946217),h=e.i(166540
61),x=e.i(271645),p=e.i(856406);e.s(["AdminRecurringDateForm",0,({setOpen:e,startTime:f,value:g={},onChange:b})=>{let j=(0,p.getRecurringOptions)(f),v=(0,p.getMonthlyRecurringOptions)(f),y=(0,p.resolveOptionFromValue)(g,j),[C,w]=(0,x.useState)((0,m.default)(g)?j[0].value:y.value),N=(e,t)=>{let l=(0,u.default)(C,"days",[]);w({...C,days:e?[...l,t]:l.filter(e=>e!==t)})};return(0,t.jsxs)("form",{onSubmit:t=>{t.preventDefault(),b((0,p.sanitiseRecurringDateFormValues)(C)),e(!1)},className:"mt-3",children:[(0,t.jsxs)("div",{className:"w-full mb-4 space-y-2",children:[(0,t.jsx)("div",{className:"flex items-center w-full space-x-2",children:(0,t.jsx)("div",{className:"space-y-2 w-full",children:(0,t.jsx)(s.AdminSelect,{value:C?.name,onChange:e=>{let t=j.find(t=>t.value.name===e);(0,m.default)(t?.value)?w(t):("custom"===t.value.name&&(t.value.interval||(t.value.interval="day"),t.value.frequency||(t.value.frequency=1)),w({...t.value,...C.excludedDates?.length&&{excludedDates:C.excludedDates},...C.ends&&{ends:C.ends}}))},children:j.map(e=>(0,t.jsx)("option",{value:e.value.name,children:e.label},e.value?.name||e.label))})})}),C?.name==="custom"&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"space-y-3 w-full flex gap-2 align-center",children:[(0,t.jsx)(c.AdminP,{className:"self-center",children:"Repeat every"}),(0,t.jsx)(n.AdminInput,{type:"number",className:"w-16",min:1,value:C.frequency,onChange:e=>w({...C,frequency:Number.parseInt(e)})}),(0,t.jsxs)(s.AdminSelect,{className:"w-24",value:C.interval,onChange:e=>{w(t=>{if("month"===e){let l=j.find(e=>"month"===e.value.name);return{...(0,u.default)(l,"value",{}),name:"custom",interval:e,frequency:t?.frequency||(0,u.default)(l,"value.frequency",1),...t.excludedDates?.length&&{excludedDates:t.excludedDates},...t.ends&&{ends:t.ends}}}if("week"===e){let l=j.find(e=>"week"===e.value.name);return{...(0,u.default)(l,"value",{}),name:"custom",interval:e,frequency:t?.frequency||(0,u.default)(l,"value.frequency",1),...t.excludedDates?.length&&{excludedDates:t.excludedDates},...t.ends&&{ends:t.ends}}}return{...t,interval:e}})},children:[(0,t.jsx)("option",{value:"day",children:C.frequency>1?"Days":"Day"}),(0,t.jsx)("option",{value:"week",children:C.frequency>1?"Weeks":"Week"}),(0,t.jsx)("option",{value:"month",children:C.frequency>1?"Months":"Month"}),(0,t.jsx)("option",{value:"year",children:C.frequency>1?"Years":"Year"})]})]}),"week"===C.interval&&(0,t.jsxs)("div",{className:"space-y-3 w-full",children:[(0,t.jsx)(i.AdminMiniLabel,{className:"self-center",children:"Repeat on"}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(l.AdminCheckbox,{id:"sunday",title:"Sunday",value:C.days?.includes(0),onChange:e=>N(e,0)}),(0,t.jsx)(l.AdminCheckbox,{id:"monday",title:"Monday",value:C.days?.includes(1),onChange:e=>N(e,1)}),(0,t.jsx)(l.AdminCheckbox,{id:"tuesday",title:"Tuesday",value:C.days?.includes(2),onChange:e=>N(e,2)}),(0,t.jsx)(l.AdminCheckbox,{id:"wednesday",title:"Wednesday",value:C.days?.includes(3),onChange:e=>N(e,3)}),(0,t.jsx)(l.AdminCheckbox,{id:"thursday",title:"Thursday",value:C.days?.includes(4),onChange:e=>N(e,4)}),(0,t.jsx)(l.AdminCheckbox,{id:"friday",title:"Friday",value:C.days?.includes(5),onChange:e=>N(e,5)}),(0,t.jsx)(l.AdminCheckbox,{id:"saturday",title:"Saturday",value:C.days?.includes(6),onChange:e=>N(e,6)})]})]}),"month"===C.interval&&(0,t.jsx)("div",{className:"space-y-3 mt-3 w-full",children:(0,t.jsx)(s.AdminSelect,{value:C?.monthType,onChange:e=>{w({...C,monthType:e})},children:v.map(e=>(0,t.jsx)("option",{value:e.value.monthType,children:e.label},e.value.monthType))})})]}),(0,t.jsx)(d.AdminDivider,{className:"my-6!"}),(0,t.jsx)("div",{className:"flex items-center w-full space-x-2",children:(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)(i.AdminLabel,{htmlFor:"end_date",children:"When does the event stop recurring?"}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(c.AdminP,{children:"On"}),(0,t.jsx)(n.AdminInput,{id:"end_date",type:"date",value:C.ends?.date||"",onChange:e=>w({...C,ends:{...(0,u.default)(C,"ends",{}),date:e}})})]}),(0,t.jsx)(i.AdminMiniLabel,{children:"Leave empty for no end date"})]})})]}),(0,t.jsx)(d.AdminDivider,{className:"my-6!"}),(0,t.jsx)("div",{className:"flex items-center w-full space-x-2",children:(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)(i.AdminLabel,{htmlFor:"excludedDate",children:"Excluded Dates"}),(0,t.jsx)(a.AdminDateTimeInput,{id:"excludedDate",type:"date",value:"",onChange:e=>{if(!e)return;let t=(0,h.default)(e).format("YYYY-MM-DD"),l=C.excludedDates||[];l.includes(t)||w({...C,excludedDates:[...l,t]})},className:"w-full","aria-describedby":"excludedDate-hint"}),C.excludedDates?.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-2 mt-2 list-none p-0","aria-label":"Excluded dates",children:C.excludedDates.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(r.AdminBadge,{item:{name:(0,h.default)(e).format("MMMM D, YYYY"),id:e},onClose:()=>{let t;return t=C.excludedDates||[],void w({...C,excludedDates:t.filter(t=>t!==e)})}})},e))}),(0,t.jsx)(i.AdminMiniLabel,{id:"excludedDate-hint",children:"Select dates to skip within the recurrence"})]})}),(0,t.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,t.jsx)(o.AdminButtonOutlined,{onClick:()=>{w(y.value),e(!1)},children:"Cancel"}),(0,t.jsx)(o.AdminButtonPrimary,{type:"submit",children:"Save"})]})]})}])},453860,921997,78479,e=>{"use strict";e.s(["default",()=>$],453860);var t=e.i(843476),l=e.i(946217),a=e.i(271645),n=e.i(306489),i=e.i(548748),s=e.i(533640),r=e.i(792032),o=e.i(148797),d=e.i(816055),c=e.i(856406),u=e.i(158457),m=e.i(92023),h=e.i(259073),x=e.i(761978),p=e.i(796440),f=e.i(276369),g=e.i(542936),b=e.i(125621),j=e.i(787255),v=e.i(208509),y=e.i(993675),C=e.i(862625),w=e.i(673302),N=e.i(242114),k=e.i(451789),A=e.i(837763),T=e.i(988842);let S="inherit",E={start:N.AlignHorizontalJustifyStart,center:C.AlignHorizontalJustifyCenter,end:w.AlignHorizontalJustifyEnd,[S]:k.AlignHorizontalSpaceAround},M=[{value:S,label:"Match surrounding text"},{value:"start",label:"Left alignment"},{value:"center",label:"Center alignment"},{value:"end",label:"Right alignment"}
61],B=({className:e,value:l,onChange:a})=>{let n=l||S;return(0,t.jsx)("div",{"data-alignment":!0,children:(0,t.jsx)(A.AdminRadioSelect,{value:n,onChange:e=>a(e===S?null:e),className:e,children:M.map(e=>{let l=E[e.value];return(0,t.jsx)(j.AdminToolTip,{content:e.label,children:(0,t.jsx)("span",{className:"inline-flex",children:(0,t.jsxs)(A.AdminRadioSelectOption,{value:e.value,className:(0,T.classNames)("rounded-md border bg-white px-2 py-1 font-medium w-10",n===e.value&&"border-primaryaccent-600"),children:[(0,t.jsx)("span",{className:"sr-only",children:e.label}),(0,t.jsx)(l,{className:"w-5 h-5",strokeWidth:1.5})]})})},e.value)})})})};var I=e.i(923484);let L=["days","hours","minutes","seconds"],R=[["Primary","colorPrimary"],["Primary text","colorPrimaryText"],["Secondary","colorSecondary"],["Secondary text","colorSecondaryText"],["Tertiary","colorTertiary"],["Base","colorBase"],["Alt","colorAlt"]],D=({value:e,onChange:l,open:a,setOpen:n,SubToolbar:s})=>{let{brand:r}=(0,v.maybeUseModelContext)()||{},o=R.map(([e,t])=>({label:e,color:r?.meta?.[t]})).filter(e=>e.color),d=!!e&&!o.some(t=>t.color===e);return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)(u.AdminRichToolButton,{active:a,className:"[anchor-name:--countdown-color-btn]",onClick:()=>n(!a),tooltip:"Text colour",children:[(0,t.jsx)("span",{className:"sr-only",children:"Text colour"}),(0,t.jsx)(p.TCCDesignerIcon,{className:"w-5 h-5 text-basealt-600"})]}),(0,t.jsx)(s,{show:a,anchorName:"--countdown-color-btn",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 p-2 max-w-48",children:[o.map(a=>(0,t.jsx)(j.AdminToolTip,{content:a.label,children:(0,t.jsx)("div",{children:(0,t.jsx)(i.AdminColorSwatch,{"aria-label":a.label,value:a.color,selected:e===a.color,onClick:()=>l(a.color)})})},a.label)),(0,t.jsx)(j.AdminToolTip,{content:"Custom colour",children:(0,t.jsx)("div",{children:(0,t.jsx)(i.AdminColorPicker,{inlinePanel:!0,icon:(0,t.jsx)("p",{className:"text-xs -ml-[3px]",children:"Tt"}),value:d?e:null,onChange:e=>l(e||null),selected:d,buttonClassName:"flex w-8 h-8 items-center justify-center px-2"})})}),(0,t.jsx)(j.AdminToolTip,{content:"Clear colour",children:(0,t.jsx)("div",{children:(0,t.jsx)(i.AdminColorSwatch,{"aria-label":"Clear colour",value:"currentcolor",onClick:()=>l(null)})})})]})})]})},P=({data:e,timezone:a,setData:n,onEditRecurrence:i})=>{let d=!(0,l.default)(e.recurrence);return(0,t.jsxs)("div",{className:"w-full space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.AdminLabel,{htmlFor:"countdown-title",children:"Title (optional)"}),(0,t.jsx)(r.AdminInput,{id:"countdown-title",value:e.title||"",onChange:e=>n({title:e}),placeholder:"e.g. Service starts in"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.AdminLabel,{htmlFor:"countdown-target",children:"Count down to"}),(0,t.jsx)(s.AdminDateTimeInput,{id:"countdown-target",type:"datetime-local",value:e.targetDate,onChange:e=>n({targetDate:e,timezone:a??null}),timezone:a,className:"w-full"}),a?(0,t.jsxs)(o.AdminMiniLabel,{children:["Times are in your church timezone (",a,")"]}):null]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(o.AdminLabel,{htmlFor:"countdown-repeat",children:"Repeat?"}),(0,t.jsx)(h.AdminToggle,{id:"countdown-repeat",value:d,onChange:e=>e?i():n({recurrence:null}),label:"Repeat countdown"})]}),d&&(0,t.jsx)(b.AdminSurface,{className:"w-full",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.AdminMiniLabel,{children:"Repeats"}),(0,t.jsx)(g.AdminP,{children:(0,c.getRecurrenceDescription)(e.recurrence,e.targetDate,a)})]}),(0,t.jsx)(x.AdminButtonOutlined,{onClick:i,children:"Edit"})]})}),d&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(o.AdminLabel,{htmlFor:"countdown-restart",children:"Show finished state for"}),(0,t.jsx)(r.AdminInput,{id:"countdown-restart",type:"number",min:0,className:"w-20",value:e.restartDelayMinutes??60,onChange:e=>n({restartDelayMinutes:Number.parseInt(e)||0})}),(0,t.jsx)(g.AdminP,{children:"minutes before restarting"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.AdminLabel,{htmlFor:"countdown-onfinish",children:"When finished"}),(0,t.jsxs)(m.AdminSelect,{id:"countdown-onfinish",value:e.onFinish,onChange:e=>n({onFinish:e}),children:[(0,t.jsx)("option",{value:"message",children:"Show a message"}),(0,t.jsx)("option",{value:"zeros",children:"Freeze at 00:00:00"}),(0,t.jsx)("option",{value:"hide",children:"Hide the timer"})]}),"message"===e.onFinish&&(0,t.jsx)(r.AdminInput,{value:e.finishedMessage||"",onChange:e=>n({finishedMessage:e}),placeholder:"Message to show when finished"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.AdminLabel,{children:"Units to show"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-4",children:L.map(l=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(h.AdminToggle,{id:`countdown-unit-${l}`,value:e.units?.[l],onChange:t=>n({units:{...e.units,[l]:t}}),label:`Show ${l}`}),(0,t.jsx)(o.AdminMiniLabel,{as:"label",htmlFor:`countdown-unit-${l}`,className:"capitalize",children:l})]},l))})]})]})};var O=e.i(76988),F=e.i(977966);let $={id:O.default.id,type:O.default.type,name:O.default.name,edit:({block:e,editor:l="designer",onChange:i,account:s,rootProps:r={}})=>{let[c,m]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),[b,j]=(0,a.useState)(!1),[v,C]=(0,a.useState)(!1),w=e?.data||{},N=s?.timezone,k=E[w.align||"inherit"],{containerProps:A,Toolbar:T,SubToolbar:S}=(0,n.useFloatingToolbar)({id:e?.id||"richcountdownedit"}),M=t=>{let l=(0,y.deepClone)(e);l.data={...l.data,...t},i(l)},L=e=>{g(e),e||m(!0)},R=(0,t.jsx)(P,{data:w,timezone:N,setData:M,onEditRecurrence:()=>{m(!1),g(!0)}}),O=(0,t.jsx)("button",{type:"button",onClick:()=>m(!0),className:"w-full rounded-md border border-dashed border-tcc-altdark/60 py-6 text-sm text-tcc-basetext/60 hover:bg-tcc-altdark/10",children:"Countdown hidden — click to edit settings"}),F=(0,t.jsx)(f.AdminModal,{open:h,setOpen:L,title:"Countdown recurrence",description:"Set how often this countdown should repeat",children:(0,t.jsx)(d.AdminRecurringDateForm,{setOpen:L,startTime:w.targetDate,value:w.recurrence||{},onChange:e=>M({recurrence:e,timezone:N??null})})});return"simple"===l?(0,t.jsxs)("div",{className:"w-full space-y-4 rounded-lg border border-tcc-altdark/40 p-4",...r,children:[R,(0,t.jsxs)("div",{className:"rounded-md border border-dashed border-tcc-altdark/40 p-4",children:[(0,t.jsx)(o.AdminMiniLabel,{className:"mb-2",children:"Preview"}),(0,t.jsx)(I.CountdownTimerClient,{data:w})]}),F]}):(0,t.jsxs)("div",{"data-rich-countdown-edit":!0,className:"group/countdown w-full",...A,...r,children:[(0,t.jsx)(I.CountdownTimerClient,{data:w,fallback:O}),(0,t.jsx)(T,{children:(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,t.jsx)(D,{value:w.color,onChange:e=>M({color:e}),open:v,setOpen:C,SubToolbar:S}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(u.AdminRichToolButton,{active:b,className:"[anchor-name:--countdown-alignment-btn]",onClick:()=>j(!b),tooltip:"Alignment",children:(0,t.jsx)(k,{className:"w-5 h-5 text-basealt-600",
61strokeWidth:1.5})}),(0,t.jsx)(S,{show:b,anchorName:"--countdown-alignment-btn",children:(0,t.jsx)(B,{value:w.align,onChange:e=>M({align:e}),className:"flex flex-col p-1.5 gap-1.5"})})]}),(0,t.jsxs)(u.AdminRichToolButton,{active:c,onClick:()=>m(!0),tooltip:"Countdown settings",children:[(0,t.jsx)("span",{className:"sr-only",children:"Countdown settings"}),(0,t.jsx)(p.TCCSettingsIcon,{className:"w-5 h-5 text-basealt-600"})]})]})}),(0,t.jsxs)(f.AdminModal,{open:c,setOpen:m,title:"Countdown settings",description:"Configure the target, recurrence and appearance",children:[R,(0,t.jsx)("div",{className:"flex justify-end mt-4",children:(0,t.jsx)(x.AdminButtonOutlined,{onClick:()=>m(!1),children:"Done"})})]}),F]})},render:F.default,metadata:O.default};e.s(["default",()=>q],921997);var z=e.i(91102),H=e.i(279908),W=e.i(626694),_=e.i(988084);let q={id:_.default.id,type:_.default.type,name:_.default.name,edit:({block:e,onChange:l,disableToolbar:a=!1,editor:n="designer",rootProps:i={}})=>{let s=(t,a)=>{let n=(0,y.deepClone)(e);n.data[t]=a,l(n)};return"simple"===n?(0,t.jsxs)("div",{className:"w-full mt-2 mb-2 space-y-2",...i,children:[(0,t.jsx)(o.AdminMiniLabel,{children:"Text:"}),(0,t.jsx)(H.AdminTextArea,{value:e?.data?.text,onChange:e=>s("text",e)})]}):(0,t.jsx)(z.AdminRichTextInput,{block:e,value:e?.data?.text,align:e?.data?.align,disableToolbar:a,tagName:"div",placeholder:"Start typing...",onAlignmentChange:t=>{let a=(0,y.deepClone)(e);a.data.align=t,l(a)},onTagNameChange:t=>{let a=(0,y.deepClone)(e);"p"===t?(a.type="paragraph",a.tagName="p"):(a.type="heading",a.tagName=t,a.data.level=Number.parseInt(t.match(/\d+/)[0])),l(a)},onChange:e=>s("text",e),rootProps:i},e.id)},render:W.default,metadata:_.default};var U=e.i(61007),V=e.i(76138);let K={id:V.default.id,type:V.default.type,name:V.default.name,edit:({editor:e="designer",rootProps:l={}})=>"simple"===e?(0,t.jsxs)("div",{className:"space-y-2 w-full",...l,children:[(0,t.jsx)(o.AdminMiniLabel,{children:"Divider"}),(0,t.jsx)("hr",{})]}):(0,t.jsx)("hr",{...l}),render:U.default,metadata:V.default};e.s(["default",0,K],78479)},830846,e=>{"use strict";var t=e.i(843476),l=e.i(271645),a=e.i(92023),n=e.i(297392);e.s(["FormSelect",0,({value:e,onChange:i})=>{let{runSearch:s,data:r}
61=(0,n.useSearchForms)(),o=async()=>{await s({page:0,limit:999})};(0,l.useEffect)(()=>{o()},[]);let d=r?.sort((e,t)=>"published"===e.status&&"published"!==t.status?-1:+("published"!==e.status&&"published"===t.status));return(0,t.jsxs)(a.AdminSelect,{value:e||"none",onChange:i,children:[(0,t.jsx)("option",{value:"none",children:"No Form"}),d?.map(e=>"published"!==e.status?(0,t.jsxs)("option",{disabled:!0,value:e?.id,children:[e?.name," (Not published)"]},e?.id):(0,t.jsx)("option",{value:e?.id,children:e?.name},e?.id))]})}])},54415,e=>{"use strict";var t=e.i(843476),l=e.i(774384),a=e.i(271645),n=e.i(148797),i=e.i(761978),s=e.i(276369),r=e.i(830846),o=e.i(922240),d=e.i(92739),c=e.i(208509),u=e.i(993675),m=e.i(812801),h=e.i(256070);let x={id:h.default.id,type:h.default.type,name:h.default.name,edit:({block:e,onChange:m,editor:h="designer",rootProps:x={}})=>{let[p,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(e?.data?.form),{account:j}=(0,c.useModelContext)(),v=(t,l)=>{let a=(0,u.deepClone)(e);a.data[t]=l,m(a)};return"simple"===h?(0,t.jsxs)("div",{className:"w-full space-y-2",...x,children:[(0,t.jsx)(n.AdminMiniLabel,{children:"Form:"}),(0,t.jsx)(r.FormSelect,{value:e?.data?.form,onChange:e=>v("form",e)})]}):(0,t.jsxs)("div",{"data-rich-form-edit":!0,className:"group/form w-full",...x,children:[(!e?.data?.form||e?.data?.form==="none")&&(0,t.jsx)("div",{className:"bg-basealt-200 flex items-center justify-center h-72",children:(0,t.jsx)(i.AdminButtonOutlined,{onClick:()=>f(!0),children:"Select Form"})}),e?.data?.form&&e?.data?.form!=="none"&&(0,t.jsx)(d.ThemedFormRenderer,{id:e?.data?.form,account:j}),(0,t.jsx)(o.BlockExtraControls,{fallbackClassName:"items-center absolute z-50 right-12 -top-7 h-6 px-1 space-x-1 bg-white rounded-md text-basealt-600 border border-basealt-300 flex opacity-0 group-hover/form:opacity-100",children:(0,t.jsx)("div",{className:"flex items-center space-x-1",children:(0,t.jsx)("button",{type:"button",onClick:()=>f(!0),children:(0,t.jsx)(l.Cog8ToothIcon,{className:"w-4 h-4 text-basealt-600"})})})}),(0,t.jsxs)(s.AdminModal,{variant:"success",open:p,setOpen:f,title:"Edit Form",description:"Select the form to display",children:[(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(r.FormSelect,{value:g,onChange:e=>b(e)})}),(0,t.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,t.jsx)(i.AdminButtonOutlined,{onClick:()=>{b(e?.data?.form),f(!1)},children:"Cancel"}),(0,t.jsx)(i.AdminButtonPrimary,{onClick:()=>{m&&v("form",g),f(!1)},children:"Save"})]})]})]})},render:m.default,metadata:h.default};e.s(["default",0,x],54415)},939766,309164,512032,402518,129008,123087,648724,816105,184404,970417,176970,332487,318105,e=>{"use strict";e.s(["richBlockRegistry",()=>tH,"useRichBlockRegistry",()=>tW],939766);var t=e.i(963320),l=e.i(390416),a=e.i(583151),n=e.i(453860),i=e.i(921997),s=e.i(78479),r=e.i(54415);e.s(["default",()=>E],309164);var o=e.i(843476),d=e.i(761978),c=e.i(276369),u=e.i(450941),m=e.i(74694),h=e.i(399168),x=e.i(680258),p=e.i(993675),f=e.i(271645),g=e.i(422233),b=e.i(792032),j=e.i(253100),v=e.i(836106),y=e.i(306489),C=e.i(158457),w=e.i(796440),N=e.i(475254);let k=(0,N.default)("fullscreen",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]]);var A=e.i(398361);let T=(0,N.default)("picture-in-picture-2",[["path",{d:"M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4",key:"daa4of"}],["rect",{width:"10",height:"7",x:"12",y:"13",rx:"2",key:"1nb8gs"}]]);var S=e.i(373264);let E=({block:e,editor:t="designer",onChange:l,rootProps:a={}})=>{let[n,i]=(0,f.useState)(!1),[s,r]=(0,f.useState)(!1),[u,h]=(0,f.useState)(e?.data),[b,j]=(0,f.useState)(!1),[N,E]=(0,f.useState)(!1),{selectedItems:B,mediaSelection:I,clearSelection:L}=(0,x.useImageMultiSelect)(),R=e=>{L(),r(e)},{containerProps:D,Toolbar:P,SubToolbar:O}=(0,y.useFloatingToolbar)({id:e?.id||"richgalleryedit"}),F="designer"===t?u:e?.data,$=(e,t)=>{let l=(0,p.deepClone)(u);l[e]=t,h(l)},z=(t,a)=>{let n=(0,p.deepClone)(e);n.data[t]=a,l(n)},H=s&&(0,o.jsxs)(c.AdminModal,{wide:!0,open:s,setOpen:R,variant:"info",icon:(0,o.jsx)(w.TCCPhotoIcon,{className:"h-6 w-6 text-blue-600"}),title:"Select Images",description:"Select one or more images to add",children:[(0,o.jsx)(m.MediaLibrary,{network:!1,type:"image",multiSelect:!0,mediaSelection:I,onConfirmSelection:()=>{let a=Array.from(B.values());a.length>0&&(a=>{let n=a.map(e=>({id:(0,g.v4)(),Media:e,url:""})),i=[...F?.gallery||[],...n];if(("designer"===t?$:z)("gallery",i),"designer"===t&&l){let t=(0,p.deepClone)(e),a=t.data||{};t.data={layout:"default",...a,gallery:i},l(t)}})(a),L(),r(!1)}}),(0,o.jsx)("div",{className:"flex justify-end mt-4 pt-4 border-t border-basealt-200 dark:border-darkbase-600",children:(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>R(!1),children:"Cancel"})})]});if("simple"===t)return(0,o.jsxs)("div",{...a,children:[(0,o.jsx)(M,{value:F,onChange:z,setAddImagesOpen:r}),H]});let W=e?.data?.enableLightbox!==!1,_=e?.data?.lightboxMode||"fullscreen",q=e?.data?.layout||"default",U="grid"===q?S.LayoutGrid:"masonry"===q?w.TCCRowsIcon:w.TCCPhotoIcon;return(0,o.jsxs)("div",{"data-rich-gallery-edit":!0,className:"group/gallery w-full",...D,...a,children:[!e?.data?.gallery?.length&&(0,o.jsx)("div",{className:"bg-basealt-200 flex items-center justify-center h-72",children:(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>r(!0),children:"Add Images"})}),e?.data?.gallery?.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v.default,{block:e}),(0,o.jsx)(P,{children:(0,o.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(C.AdminRichToolButton,{active:N,onClick:()=>E(!N),tooltip:"Layout",className:"[anchor-name:--gallery-layout-button]",children:(0,o.jsx)(U,{className:"w-5 h-5 text-basealt-600"})}),(0,o.jsx)(O,{show:N,anchorName:"--gallery-layout-button",children:(0,o.jsxs)("div",{className:"flex flex-col p-1.5 gap-1.5",children:[(0,o.jsxs)(C.AdminRichToolButton,{className:"flex gap-2 w-full! font-normal whitespace-nowrap items-center justify-start",active:"default"===q,onClick:()=>z("layout","default"),children:[(0,o.jsx)(w.TCCPhotoIcon,{className:"w-5 h-5 text-basealt-600"}),"Default"]}),(0,o.jsxs)(C.AdminRichToolButton,{className:"flex gap-2 w-full! font-normal whitespace-nowrap items-center justify-start",active:"grid"===q,onClick:()=>z("layout","grid"),children:[(0,o.jsx)(S.LayoutGrid,{className:"w-5 h-5 text-basealt-600"}),"Grid"]}),(0,o.jsxs)(C.AdminRichToolButton,{className:"flex gap-2 w-full! font-normal whitespace-nowrap items-center justify-start",active:"masonry"===q,onClick:()=>z("layout","masonry"),children:[(0,o.jsx)(w.TCCRowsIcon,{className:"w-5 h-5 text-basealt-600"}),"Masonry"]})]})})]}),(0,o.jsx)("div",{className:"w-px h-6 bg-basealt-300 mx-1"}),(0,o.jsxs)(C.AdminRichToolButton,{active:W,onClick:()=>z("enableLightbox",!W),tooltip:W?"Disable Lightbox":"Enable Lightbox",children:[(0,o.jsxs)("span",{className:"sr-only",children:[W?"Disable":"Enable"," Lightbox"]}),(0,o.jsx)(k,{className:"w-5 h-5 text-basealt-600"})]}),W&&(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(C.AdminRichToolButton,{active:b,onClick:()=>j(!b),tooltip:"Lightbox Mode",className:"[anchor-name:--gallery-lightbox-mode-button]",children:(0,o.jsx)(w.TCCControls,{className:"w-5 h-5 text-basealt-600"})}),(0,o.jsx)(O,{show:b,anchorName:"--gallery-lightbox-mode-button",children:(0,o.jsxs)("div",{className:"flex flex-col p-1.5 gap-1.5",children:[(0,o.jsxs)(C.AdminRichToolButton,{className:"flex gap-2 w-full! font-normal whitespace-nowrap items-center justify-start",active:"fullscreen"===_,onClick:()=>z("lightboxMode","fullscreen"),children:[(0,o.jsx)(A.Maximize2,{className:"w-5 h-5 text-basealt-600"}),"Full Screen"]}),(0,o.jsxs)(C.AdminRichToolButton,{className:"flex gap-2 w-full! font-normal whitespace-nowrap items-center justify-start",active:"modal"===_,onClick:()=>z("lightboxMode","modal"),children:[(0,o.jsx)(T,{className:"w-5 h-5 text-basealt-600"}),"Modal"]})]})})]}),(0,o.jsx)("div",{className:"w-px h-6 bg-basealt-300 mx-1"}),(0,o.jsxs)(C.AdminRichToolButton,{active:n,onClick:()=>i(!0),tooltip:"Edit Gallery",children:[(0,o.jsx)("span",{className:"sr-only",children:"Edit Gallery"}),(0,o.jsx)(w.TCCSettingsIcon,{className:"w-5 h-5 text-basealt-600"})]}),(0,o.jsxs)(C.AdminRichToolButton,{onClick:()=>i(!0),tooltip:"Reorder & Remove Items",children:[(0,o.jsx)("span",{className:"sr-only",children:"Reorder & Remove Items"}),(0,o.jsx)(w.TCCReorderIcon,{className:"w-5 h-5 text-basealt-600"})]})]})})]}),(0,o.jsxs)(c.AdminModal,{variant:"success",open:n,setOpen:i,title:"Edit Gallery",description:"Reorder, remove and edit the gallery",children:[(0,o.jsx)(M,{value:F,onChange:$,setAddImagesOpen:e=>{e&&i(!1),r(e)}}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>{h(e?.data),i(!1)},children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:()=>
61{if(l){let t=(0,p.deepClone)(e);t.data=u,l(t)}i(!1)},children:"Save"})]})]}),H]})},M=({value:e,onChange:t,setAddImagesOpen:l})=>(0,o.jsx)("div",{className:"w-full",children:(0,o.jsxs)("div",{className:"mt-4",children:[(0,o.jsx)(j.AdminRepeater,{itemTitle:"Image",defaultOpen:!0,noAdd:!0,direction:"vertical",withHandle:!0,onChange:e=>t("gallery",e),id:"listitemsgallery",datasource:e?.gallery,component:B}),(0,o.jsx)("div",{className:"flex justify-end mt-4",children:(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>l(!0),children:"Add Images"})})]})}),B=e=>{let t=(t,l)=>{let a=(0,p.deepClone)(e?.item);a[t]=l,e.onChange(a)};return(0,o.jsxs)("div",{className:"border border-basealt-300 rounded-md flex items-center w-full space-x-2 p-2 mb-2",children:[(0,o.jsx)("div",{className:"w-32",children:(0,o.jsx)(u.MediaFormInput,{output:"full",previewCrop:h.ImageCroppingPresets.largepreview,network:!1,type:"image",label:"",value:e?.item?.Media?.id,onChange:e=>t("Media",e)})}),(0,o.jsx)(b.AdminInput,{placeholder:"https://",value:e?.item?.url,onChange:e=>t("url",e)})]})};var I=e.i(633170);let L={id:I.default.id,type:I.default.type,name:I.default.name,edit:E,render:v.default,metadata:I.default};var R=e.i(482820),D=e.i(548748),P=e.i(148797),O=e.i(779574),F=e.i(92023),$=e.i(224370),z=e.i(598614),H=e.i(291378),W=e.i(125621),_=e.i(163858),q=e.i(609983),U=e.i(522016);let V=({complete:e})=>e?(0,o.jsx)(_.CheckCircleIcon,{className:"w-4 h-4 text-success-500"}):(0,o.jsx)(q.XCircleIcon,{className:"w-4 h-4 text-error-500"}),K=({settings:e})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(W.AdminSurface,{className:"mb-3 p-3! py-2",children:(0,o.jsxs)(H.AdminTable,{className:"text-xs text-xs leading-5 text-tcc-basetext/50 divide-none",children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{className:"even:bg-gray-50 font-light",children:[(0,o.jsx)("th",{className:"text-xs leading-5 text-tcc-basetext/50 font-light",children:"Charges Enabled"}),(0,o.jsx)("th",{className:"text-xs leading-5 text-tcc-basetext/50 font-light",children:"Payouts Enabled"}),(0,o.jsx)("th",{className:"text-xs leading-5 text-tcc-basetext/50 font-light",children:"Onboarding Complete"})]})}),(0,o.jsx)("tbody",{children:(0,o.jsxs)("tr",{className:"even:bg-gray-50",children:[(0,o.jsx)("td",{className:"text-xs leading-5 text-tcc-basetext/50 font-medium",children:(0,o.jsx)(V,{complete:(0,R.default)(e,"content.chargesEnabled",!1)})}),(0,o.jsx)("td",{className:"text-xs leading-5 text-tcc-basetext/50 font-medium",children:(0,o.jsx)(V,{complete:(0,R.default)(e,"content.chargesEnabled",!1)})}),(0,o.jsx)("td",{className:"text-xs leading-5 text-tcc-basetext/50 font-medium",children:(0,o.jsx)(V,{complete:(0,R.default)(e,"content.detailsSubmitted",!1)})})]})})]})}),(0,o.jsx)("div",{className:"flex justify-center my-3",children:(0,o.jsx)(U.default,{prefetch:!1,href:"/admin/giving/settings",target:"_blank",className:"text-center text-xs leading-5 text-gray-500 underline cursor-pointer hover:text-gray-900",children:"Configure your Giving settings"})})]});var G=e.i(407860),J=e.i(784329),X=e.i(99293),Y=e.i(998783),Z=e.i(537980),Q=e.i(922240),ee=e.i(235984),et=e.i(208509);let el=({block:e,onChange:t,onSettingsClick:l,editor:a="designer",isRich:n=!0,rootProps:i={}})=>{let[s,r]=(0,f.useState)(!1),[u,m]=(0,f.useState)(e?.data?.display),[h,x]=(0,f.useState)(e?.data?.defaultAmount),[g,j]=(0,f.useState)(e?.data?.defaultFrequency),[v,y]=(0,f.useState)(e?.data?.defaultFund),[C,N]=(0,f.useState)(e?.data?.buttonText),[k,A]=(0,f.useState)(e?.data?.buttonVariant),[T,S]=(0,f.useState)(e?.data?.buttonColor),[E,M]=(0,f.useState)(e?.data?.buttonTextColor),[B,I]=(0,f.useState)(!1),{runLoadStripeConnectSettings:L,result:H}=(0,Y.useLoadStripeConnectSettings)(),W=async()=>{L(),B||I(!0)},{brand:_}=(0,et.useModelContext)(),q=()=>{W(),r(!0)},U=()=>{N(e?.data?.buttonText),A(e?.data?.buttonVariant),S(e?.data?.buttonColor),M(e?.data?.buttonTextColor),x(e?.data?.defaultAmount),j(e?.data?.defaultFrequency),y(e?.data?.defaultFund),m(e?.data?.display),r(!1)},V=()=>{if(t){let l=(0,p.deepClone)(e);l.data.buttonText=C,l.data.buttonColor=T,l.data.buttonVariant=k,l.data.buttonTextColor=E,l.data.display=u,l.data.defaultAmount=h,l.data.defaultFrequency=g,l.data.defaultFund=v,t(l)}r(!1)},el={variant:k,color:T,textColor:E},ea=["chargesEnabled","payoutsEnabled","detailsSubmitted"].every(e=>!0===(0,R.default)(H,`StripeAccountSetting.content.[${e}]`)),en=()=>(0,o.jsxs)(c.AdminModal,{variant:"success",open:s,setOpen:r,title:"Edit Giving block",description:"Edit the settings of the giving block",children:[B&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"flex justify-center",children:(0,o.jsx)(Z.ItemConfigStatus,{status:ea,children:ea?"The Church Co Giving is enabled":"The Church Co Giving is not yet correctly enabled"})}),!ea&&(0,o.jsx)(K,{settings:H?.StripeAccountSetting})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Default Amount"}),(0,o.jsx)(b.AdminInput,{placeholder:"Enter a default amount",type:"number",min:1,value:h,onChange:x})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Default Fund"}
61),(0,o.jsx)(X.MemberFundSelect,{withClear:!0,value:v,onChange:y})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Default Frequency"}),(0,o.jsx)(J.MembersFrequencySelect,{withClear:!0,value:g,onChange:j})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Display"}),(0,o.jsxs)(F.AdminSelect,{value:u||"",onChange:m,children:[(0,o.jsx)("option",{disabled:!0,value:"",children:"Select Display"}),(0,o.jsx)("option",{value:"popup",children:"Popup"}),(0,o.jsx)("option",{value:"inline",children:"Inline"})]})]}),"inline"!==u&&(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)($.AdminDivider,{title:"Button Style"}),(0,o.jsx)("div",{className:"flex items-center justify-center mt-4 mb-4",children:(0,o.jsx)(ee.ThemedButton,{...el,children:C})}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Button Text"}),(0,o.jsx)(b.AdminInput,{value:C,onChange:N})]}),(0,o.jsxs)("div",{className:"space-y-2 w-full",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Style"}),(0,o.jsxs)(F.AdminSelect,{value:k||"",onChange:A,children:[(0,o.jsx)("option",{value:"default",children:"Default"}),(0,o.jsx)("option",{value:"action",children:"Action"}),(0,o.jsx)("option",{value:"outlined",children:"Outlined"})]})]}),(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Button Color"}),(0,o.jsx)(z.AdminBrandColorSelector,{value:T,brand:_,onChange:S})]}),T?.type==="custom"&&(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Button Text Color"}),(0,o.jsx)(D.AdminColorPicker,{icon:(0,o.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:E,onChange:M})]})]}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:U,children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:V,children:"Save"})]})]});return"simple"===a?(0,o.jsxs)("div",{className:"w-full space-y-2",...i,children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Giving Setting"}),(0,o.jsx)(d.AdminButtonOutlined,{onClick:q,children:"Edit Giving Settings"}),en()]}):(0,o.jsxs)("div",{"data-rich-giving-edit":!0,className:"group/prayer w-full",...i,children:[(0,o.jsx)("div",{className:O.tailwindEditableStyles,"data-giving-widget":!0,children:e?.data?.display==="inline"?(0,o.jsx)("div",{"data-giving-widget":!0,className:"w-full inline-giving",children:(0,o.jsxs)("div",{"data-screen-amount":!0,children:[(0,o.jsx)("form",{disabled:!0,children:(0,o.jsx)(G.MembersFormAmountSample,{data:{},onChange:()=>{}})}),(0,o.jsx)("div",{className:"flex items-center justify-end mt-4",children:(0,o.jsx)(d.AdminButtonPrimary,{disabled:!0,children:"Next"})})]})}):(0,o.jsx)("div",{"data-giving-widget":!0,className:"w-full mt-2",children:(0,o.jsx)(ee.ThemedButton,{tag:"button",type:"button",variant:e?.data?.buttonVariant,color:e?.data?.buttonColor,textColor:e?.data?.buttonTextColor,onClick:q,children:e?.data?.buttonText})})}),(0,o.jsx)(Q.BlockExtraControls,{fallbackClassName:"space-x-1 flex items-center absolute z-50 -top-8 left-0 bg-blue-500 rounded-xs text-white h-8 px-2 opacity-0 group-hover/prayer:opacity-100",children:(0,o.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,o.jsx)("button",{type:"button",onClick:q,children:(0,o.jsx)(w.TCCPencilIcon,{className:"w-4 h-4"})}),!0!==n&&(0,o.jsx)("button",{type:"button",onClick:()=>{l&&l()},children:(0,o.jsx)(w.TCCSettingsIcon,{className:"w-4 h-4"})})]})}),en()]})};e.s(["default",0,el],512032);var ea=e.i(404869),en=e.i(601268);let ei={id:en.default.id,type:en.default.type,name:en.default.name,edit:el,render:ea.default,metadata:en.default};e.s(["default",()=>eu],402518);var es=e.i(91102),er=e.i(567432),eo=e.i(664690),ed=e.i(800273),ec=e.i(234330);let eu={id:ec.default.id,type:ec.default.type,name:ec.default.name,edit:({block:e,onChange:t,editor:l="designer",allowedBlocks:a=[],rootProps:n={}})=>{let i=(0,eo.useEditorContext)(),{setField:s}=(0,et.useModelContext)(),r=(l,a)=>{let n=(0,p.deepClone)(e);n.data[l]=a,t(n)},d="h6";return(e?.data?.level===1?d="h1":e?.data?.level===2?d="h2":e?.data?.level===3?d="h3":e?.data?.level===4?d="h4":e?.data?.level===5?d="h5":e?.data?.level===6&&(
61d="h6"),"simple"===l)?(0,o.jsxs)("div",{className:"w-full mt-2 mb-2 space-y-2",...n,children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Heading:"}),(0,o.jsx)(b.AdminInput,{value:e?.data?.text,onChange:e=>r("text",e)})]}):(0,o.jsx)(es.AdminRichTextInput,{block:e,value:e?.data?.text,tagName:d,align:e?.data?.align,onAlignmentChange:l=>{let a=(0,p.deepClone)(e);a.data.align=l,t(a)},onTagNameChange:l=>{let a=(0,p.deepClone)(e);"p"===l?(a.type="paragraph",a.tagName="p"):(a.type="heading",a.tagName=l,a.data.level=Number.parseInt(l.match(/\d+/)[0])),t(a)},placeholder:"Start typing...",onChange:e=>r("text",e),onPaste:t=>{let l=document.getSelection(),n=l?.anchorNode;if(n?.nodeType===Node.TEXT_NODE?n.parentElement?.closest?.("li"):n?.closest?.("li"))return;t.preventDefault();let r=(0,p.getClipboardBlock)(t),o=!!r&&a?.find(e=>e.type===r?.type),d=t.clipboardData.getData("text/plain"),c=r&&o?[{text:r?.data?.text||"",id:(0,g.v4)()}]:d.split(/\n\s?\n/).map(e=>({text:e.replace(/^\s|\s$/gm,"&nbsp;").replace(/\n/g,"<br>"),id:(0,g.v4)()})),u=(0,er.handleRichTextPaste)(e,c);r?.data&&!e.data?.text&&o&&(u=(0,er.replaceBlockHandler)(null,e,{...r,id:(0,g.v4)()})),u&&(i.nextFocus=c.at(-1).id,s(u))},allowedBlocks:a,rootProps:n},e.id)},render:ed.default,metadata:ec.default};e.s(["default",()=>ey],123087),e.s(["SettingsForm",()=>eb,"default",()=>ej],129008);var em=e.i(452778),eh=e.i(279908),ex=e.i(527473),ep=e.i(348707),ef=e.i(41614);let eg=(0,f.memo)(({block:e,contentEditable:t=!1,onChange:l,tag:a="div",attrs:n={}})=>{let i=(0,R.default)(e,"data.html",""),s=(0,R.default)(e,"data.renderType","default"),r=(0,f.useRef)(null),d=(0,f.useRef)(null),[c,u]=(0,f.useState)(!1),m=/(<script[\s\S]*?>[\s\S]*?<\/script>)/gi.test(i),h=/<iframe\s([^>]*)\/>/gi.test(i),x=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/|vimeo\.com\/)([a-zA-Z0-9_-]+)/gi.test(i),p=/(youtube\.com\/embed|vimeo\.com\/video)/gi.test(i);h&&(i=(()=>{if(h)return i.replace(/<iframe\s([^>]*)\/>/gi,"<iframe $1></iframe>")})()),x&&(i=(()=>{if(x)return i.replace(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]+)/gi,'<div class="responsive-video"><iframe width="100%" height="315" src="https://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe></div>').replace(/(?:https?:\/\/)?(?:www\.)?vimeo\.com\/([0-9]+)/gi,'<div class="responsive-video"><iframe src="https://player.vimeo.com/video/$1" width="100%" height="360" frameborder="0" allowfullscreen></iframe></div>')})()),p&&(i=(()=>{if(p)return i.replace(/(<iframe[^>]*src=["'](https?:\/\/(www\.)?(youtube\.com\/embed|player\.vimeo\.com\/video)[^"']*)["'][^>]*><\/iframe>)/g,'<div class="responsive-video">$1</div>')})()),i=i.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/gi,(e,t,l,a)=>t+l.replace(/@media\b/g,"@container")+a),m&&i.includes("document.write(")&&(s="iframe"),(0,f.useEffect)(()=>{if(c||!m||!r.current)return;let e=document.createRange().createContextualFragment(i);return r.current.appendChild(e),u(!0),()=>{r.current&&(r.current.innerHTML="")}},[]),(0,f.useEffect)(()=>{t&&d.current&&(d.current.innerHTML=i)},[]);let g=e=>{if(!t||!l)return;let a=e?.currentTarget?.innerHTML;a&&l(a)};return"iframe"===s?(0,o.jsx)(ex.IframeRender,{id:e?.id,tag:a,attrs:n,htmlCode:i}):m?(0,o.jsx)(a,{ref:r,"data-html":!0,...n,contentEditable:t,onInput:g}):t?(0,o.jsx)(a,{ref:d,"data-html":!0,contentEditable:!0,onInput:g,...n}):(0,o.jsx)(a,{"data-html":!0,dangerouslySetInnerHTML:{__html:i},...n})},(e,t)=>{if(e.contentEditable&&t.contentEditable){let{block:l,...a}=e,{block:n,...i}=t,{data:s,...r}=l||{},{data:o,...d}=n||{},{html:c,...u}=s||{},{html:m,...h}=o||{};return JSON.stringify({...a,block:{...r,data:u}})===JSON.stringify({...i,block:{...d,data:h}})}return JSON.stringify(e)===JSON.stringify(t)}),eb=({value:e,onChange:t})=>{let{renderType:l,blockTakeover:a}=e,n=[{label:"Default",value:"default",description:"This option ensures your content loads smoothly while adding any necessary scripts after the page has fully loaded. Ideal for most situations."},{label:"Static",value:"static",description:"This option will display your content exactly as it is, without dynamic elements or scripts running in the background. Best for simple c
61ontent that doesn't need interaction."},{label:"Iframe",value:"iframe",description:"This option places your content inside a separate window within the page, keeping it isolated from the rest of the website. Useful for embedding external content or avoiding conflicts."},{label:"Force Page Reload",value:"force-page-reload",description:"Your website is highly optimised however sometimes external scripts might require a page reload to work properly. Choose this option if you are experiencing issues with the content."}],i=(n.find(e=>e.value===l)||n[0]).description;return(0,o.jsxs)("div",{className:"w-full space-y-2 mt-3",children:[(0,o.jsx)(P.AdminLabel,{htmlFor:"renderType",children:"Choose how to display your content"}),(0,o.jsxs)(F.AdminSelect,{id:"renderType",value:l||"",onChange:e=>t("renderType",e),children:[(0,o.jsx)("option",{value:"",disabled:!0,children:"Select an option"}),n.map(e=>(0,o.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,o.jsx)(P.AdminMiniLabel,{children:i}),(0,o.jsx)(em.AdminCheckbox,{id:"blockTakeover",title:"Block Takeover",description:"Removes the intro section and makes the HTML content span the full width of the block.",value:!0===a,onChange:e=>t("blockTakeover",e)})]})},ej=({block:e,onChange:t,contentEditable:l=!1,editor:a="designer",rootProps:n={}})=>{let i=(0,eo.useEditorContext)(),[s,r]=(0,f.useState)(!!e?.data?.html),[u,m]=(0,f.useState)(!1),h=(0,f.useRef)(null),{containerProps:x,Toolbar:g}=(0,y.useFloatingToolbar)({id:ef.default.id}),[b,j]=(0,f.useState)(e?.data),v=(l,a)=>{let n=(0,p.deepClone)(e);n.data[l]=a,t(n)};return((0,f.useEffect)(()=>{if(i.mounted&&i.nextFocus===e.id&&h.current){let e=h?.current;e&&e.focus(),i.nextFocus=null}},[]),"simple"===a)?(0,o.jsxs)("div",{className:"w-full space-y-2",...n,children:[(0,o.jsx)(P.AdminMiniLabel,{children:"HTML:"}),(0,o.jsx)(eh.AdminTextArea,{className:"w-full",value:e?.data?.html,onChange:e=>v("html",e)},e?.id)]}):(0,o.jsxs)("div",{className:`w-full relative group/richhtml ${O.tailwindEditableStyles}`,...x,...n,children:[!s&&(0,o.jsx)(eh.AdminTextArea,{"data-html-editor":!0,ref:h,placeholder:"Start typing...",className:"w-full h-[200px] bg-slate-600! text-basealt-300!",value:e?.data?.html,onChange:e=>v("html",e)},e?.id),s&&(0,o.jsx)(eg,{block:e,contentEditable:l,onChange:e=>v("html",e)}),(0,o.jsx)(g,{children:(0,o.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,o.jsxs)(C.AdminRichToolButton,{active:s,onClick:()=>r(!s),tooltip:"Edit settings",children:[s&&(0,o.jsx)(w.TCCPencilIcon,{className:"w-5 h-5 text-basealt-600"}),!s&&(0,o.jsx)(w.TCCEyeIcon,{className:"w-5 h-5 text-basealt-600"})]}),(0,o.jsx)(C.AdminRichToolButton,{active:u,onClick:()=>{m(!0)},tooltip:"Open block settings",children:(0,o.jsx)(w.TCCSettingsIcon,{className:"w-5 h-5 text-basealt-600"})})]})}),(0,o.jsxs)(c.AdminModal,{className:"overflow-visible",variant:"success",open:u,setOpen:m,title:"HTML settings",description:"Add your custom options to the block",children:[(0,o.jsx)(eb,{value:b,onChange:(e,t)=>
61{let l=(0,p.deepClone)(b);(0,ep.default)(l,e,t),j(l)}}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>{j(e?.data),m(!1)},children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:()=>{let l=(0,p.deepClone)(e);l.data.renderType=b.renderType,l.data.blockTakeover=b.blockTakeover,t(l),m(!1)},children:"Save"})]})]})]})};var ev=e.i(967362);let ey={id:ef.default.id,type:ef.default.type,name:ef.default.name,edit:ej,render:ev.default,metadata:ef.default};e.s(["default",()=>eN],648724);var eC=e.i(860576),ew=e.i(910005);let eN={id:ew.default.id,type:ew.default.type,name:ew.default.name,edit:({block:e,onChange:t,crop:l=null,rootProps:a={},...n})=>{let{setField:i}=(0,et.useModelContext)(),s="largepreview";n?.shape==="landscape"?s="postcard":n?.shape==="nocrop"?s="trust":n?.shape==="overlay"&&(s="largepreview");let r=l||h.ImageCroppingPresets[s];return(0,o.jsx)(u.MediaFormInput,{full:(0,R.default)(e,"data.Media"),output:"full",previewCrop:r,network:!1,allowAlign:!0,type:"image",label:"",value:(0,R.default)(e,"data.Media.id",(0,R.default)(e,"data.MediaId",null)),onChange:l=>{let a=(0,p.deepClone)(e);a.data.Media=l,t(a)},onMultiImageSelect:l=>{if(!l?.length)return;let[a,...n]=l,s=(0,p.deepClone)(e);if(s.data.Media=a,n.length>0){let t=n.map(e=>({id:(0,g.v4)(),type:"image",tagName:"div",data:{Media:e}}));i((0,er.replaceBlockAndInsertAfterHandler)(e,s,t));return}t(s)},allowLinking:!0,allowWidth:!0,allowShadow:!0,rootProps:a})},render:eC.default,metadata:ew.default};e.s(["default",()=>eM],816105);let ek=(0,N.default)("panel-top-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"m15 14-3 3-3-3",key:"g215vf"}]]);var eA=e.i(110031),eT=e.i(984196),eS=e.i(988842),eE=e.i(14200);let eM={id:eE.default.id,type:eE.default.type,name:eE.default.name,edit:({block:e,onChange:t,editor:l="designer"})=>{let[a,n]=(0,f.useState)(!1),[i,s]=(0,f.useState)(!1),{containerProps:r,Toolbar:d,SubToolbar:c}=(0,y.useFloatingToolbar)({id:"opentext"}),{rows:u}=e,m=u||1,h=l=>{let a=(0,p.deepClone)(e);a.rows=l,t(a)},x=(0,f.useMemo)(()=>{let t={transition:"all 200ms cubic-bezier(0.33, 0, 0.19, 1)"};if(!e?.data?.collapse||i){let e=28*m;return{...t,minHeight:`${e}px`,background:"linear-gradient(transparent, transparent 27px, #e3e3e3 27px, #e3e3e3 28px)",backgroundSize:"100% 28px",lineHeight:"28px",padding:"0 8px",opacity:1}}return{...t,minHeight:"0px",opacity:.5}},[e?.data?.collapse,m,i]);return"simple"===l?(0,o.jsx)("div",{className:"w-full mt-2 mb-2 space-y-2",children:(0,o.jsx)(P.AdminMiniLabel,{children:"Open Text:"})}):(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"mb-4 relative w-full",...r,children:[(0,o.jsx)(d,{children:(0,o.jsxs)("div",{className:"flex items-center space-x-1 ",children:[(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(C.AdminRichToolButton,{active:a,onClick:()=>n(!a),tooltip:"Edit rows number",className:"[anchor-name:--open-text-size-settings-button]",children:(0,o.jsx)(w.TCCRowsIcon,{className:"w-5 h-5 text-basealt-600"})}),(0,o.jsx)(c,{show:a,anchorName:"--open-text-size-settings-button",children:(0,o.jsxs)("div",{className:"p-2",children:[(0,o.jsx)(P.AdminMiniLabel,{as:"label",className:"block mt-2",children:"Rows"}),(0,o.jsx)("div",{className:"flex items-center w-full",children:(0,o.jsxs)("div",{className:"flex content-between gap-1 align-center mt-2",children:[(0,o.jsx)("button",{type:"button",className:"flex opacity-85 hover:opacity:100 place-items-center border rounded-md bg-white w-5 h-5",onClick:()=>h(m-1),"aria-label":"Decrease line height",children:(0,o.jsx)(w.TCCSubtractIcon,{className:"w-5"})}),(0,o.jsx)("span",{className:"text-sm text-center w-8 flex align-center justify-center",children:m}),(0,o.jsx)("button",{type:"button",className:"flex opacity-85 hover:opacity:100 place-items-center border rounded-md bg-white w-5 h-5",onClick:()=>h(m+1),"aria-label":"Increase line height",children:(0,o.jsx)(w.TCCAddIcon,{className:"w-5"})})]})})]})})]}),(0,o.jsx)(C.AdminRichToolButton,{active:e?.data?.collapse,onClick:()=>((l=!1)=>{let a=(0,p.deepClone)(e);(0,ep.default)(a,"data.collapse",l),t(a)})(!e?.data?.collapse),tooltip:e?.data?.collapse?"Switch to open text mode":"Switch to add note mode",className:"ml-1",children:e?.data?.collapse?(0,o.jsx)(ek,{className:"w-5 h-5",strokeWidth:1.25}):(0,o.jsx)(eA.SquarePen,{className:"w-5 h-5",strokeWidth:1.25})})]})}),e?.data?.collapse&&(0,o.jsxs)(eT.ThemedAddUserNoteButton,{open:i,onClick:()=>s(!i),children:[(0,o.jsx)(w.TCCAddIcon,{className:(0,eS.classNames)("transition",i?"rotate-45":"rotate-0")})," Add a Note"]}),(0,o.jsx)("div",{style:x})]},e?.id)})},metadata:eE.default};var eB=e.i(259073),eI=e.i(872202);let eL=e=>(0,o.jsx)("div",{className:"mb-2 mt-2",children:(0,o.jsx)("div",{className:"w-32",children:(0,o.jsx)(u.MediaFormInput,{output:"full",previewCrop:h.ImageCroppingPresets.largepreview,network:!1,type:"image",label:"",value:e?.item?.Media?.id,onChange:t=>{let l;(l=(0,p.deepClone)(e?.item)).Media=t,e.onChange(l)},allowShadow:!0}
61)})});var eR=e.i(269664);let eD={id:eR.default.id,type:eR.default.type,name:eR.default.name,edit:({block:e,onChange:t,editor:l="designer",rootProps:a={}})=>{let[n,i]=(0,f.useState)(!1),[s,r]=(0,f.useState)(e?.data?.images),u=(l,a)=>{let n=(0,p.deepClone)(e);n.data[l]=a,t(n)};return"simple"===l?(0,o.jsx)("div",{...a,children:(0,o.jsx)(j.AdminRepeater,{limit:2,itemTitle:"Slide",defaultOpen:!0,buttonText:"Add New Image",direction:"vertical",withHandle:!0,onChange:e=>u("images",e),id:"listitemsslideshow",datasource:e?.data?.images,component:eL})}):(0,o.jsxs)("div",{"data-rich-overlappingimages-edit":!0,className:"group/overlappingimages w-full",...a,children:[e?.data?.images?.length<=0&&(0,o.jsx)("div",{className:"bg-basealt-200 flex items-center justify-center h-72",children:(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>i(!0),children:"Add Images"})}),e?.data?.images?.length>0&&(0,o.jsx)(eI.default,{block:e}),(0,o.jsx)(Q.BlockExtraControls,{fallbackClassName:"space-x-1 flex items-center absolute z-50 left-0 -top-8 bg-blue-300 rounded-xs text-white h-8 px-2 opacity-0 group-hover/overlappingimages:opacity-100",children:(0,o.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,o.jsx)("button",{type:"button",onClick:()=>i(!0),children:(0,o.jsx)(w.TCCReorderIcon,{className:"w-4 h-4"})}),(0,o.jsx)("button",{type:"button",onClick:()=>i(!0),children:(0,o.jsx)(w.TCCSettingsIcon,{className:"w-4 h-4"})})]})}),(0,o.jsxs)(c.AdminModal,{variant:"success",open:n,setOpen:i,title:"Edit Overlapping Images",description:"Reorder, remove and edit the overlapping images",children:[(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Image Type"}),(0,o.jsxs)(F.AdminSelect,{className:"mt-1",value:e?.data?.shape,onChange:e=>u("shape",e),children:[(0,o.jsx)("option",{value:"default",children:"Default"}),(0,o.jsx)("option",{value:"circle",children:"Circle"}),(0,o.jsx)("option",{value:"square",children:"Square"}),(0,o.jsx)("option",{value:"landscape",children:"Landscape"}),(0,o.jsx)("option",{value:"nocrop",children:"No Crop"})]})]}),(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Overlapping Image Position"}),(0,o.jsxs)(F.AdminSelect,{className:"mt-1",value:e?.data?.position,onChange:e=>u("position",e),children:[(0,o.jsx)("option",{value:"default",children:"Default"}),(0,o.jsx)("option",{value:"br",children:"Bottom Right"}),(0,o.jsx)("option",{value:"bl",children:"Bottom Left"}),(0,o.jsx)("option",{value:"tr",children:"Top Right"}),(0,o.jsx)("option",{value:"tl",children:"Top Left"})]})]}),(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Overlapping Image Theme Shadow"}),(0,o.jsx)(eB.AdminToggle,{value:e?.data?.shadow,onChange:e=>u("shadow-xs",e)})]}),(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Images"}),(0,o.jsx)(j.AdminRepeater,{limit:2,defaultOpen:!0,itemTitle:"Image",buttonText:"Add New Image",direction:"vertical",withHandle:!0,onChange:e=>{r(e)},id:"listitemsslideshow",datasource:s,component:eL})]}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>{r(e?.data?.images),i(!1)},children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:()=>{t&&u("images",s),i(!1)},children:"Save"})]})]})]})},render:eI.default,metadata:eR.default};e.s(["default",()=>eV],184404);let eP=["b","strong","i","em","u","a","br","ul","ol","li","span","p","div"],eO={strong:"b",em:"i"},eF=[],e$=["http:","https:","mailto:","tel:","ftp:","ftps:"],ez=e=>{if(!e||"string"!=typeof e)return"";let t=eH(new DOMParser().parseFromString(e,"text/html").body);return t&&t.nodeType===Node.ELEMENT_NODE?t.innerHTML:""},eH=e=>{if(e.nodeType===Node.TEXT_NODE)return e;if(e.nodeType===Node.ELEMENT_NODE){let t=e.tagName.toLowerCase();if(["script","style","meta","link","object","embed","iframe"].includes(t))return null;let l=eO[t]||t,a=eP.includes(l),{styles:n,wrappers:i}=eW(e);if("span"===l&&0===Object.keys(n).length&&0===i.length&&!e.hasAttribute("href")){let t=document.createDocumentFragment();for(let l of Array.from(e.childNodes)){let e=eH(l);e&&t.appendChild(e)}let l=document.createElement("span");return l.appendChild(t),l}let s=document.createElement(a?l:"span");if("a"===l&&e.hasAttribute("href")){let t=(e=>{if(!e||"string"!=typeof e)return null;let t=e.trim();if(t.startsWith("#")||t.startsWith("/")&&!t.startsWith("//")||t.startsWith("./")||t.startsWith("../"))return t;let l=t.match(/^([a-z][a-z0-9+.-]*):/i);if(l){let e=l[0].toLowerCase();return e$.includes(e)?t:null}try{let e=new URL(t,"http://dummy.com").protocol.toLowerCase();if(e$.includes(e))return t;return null}catch(e){return t}})(e.getAttribute("href"));t&&(s.setAttribute("href",t),"_blank"===e.getAttribute("target")&&(s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer")))}if(Object.keys(n).length>0){let e=Object.entries(n).map(([e,t])=>`${e}: ${t}`).join("; ");s.setAttribute("style",e)}for(let t of Array.from(e.childNodes)){let e=eH(t);e&&s.appendChild(e)}if(i.length>0&&s.childNodes.length>0){let e=t=>
61{let l=document.createDocumentFragment();for(let a of Array.from(t.childNodes))if(a.nodeType===Node.TEXT_NODE)l.appendChild(a.cloneNode(!0));else if(a.nodeType===Node.ELEMENT_NODE){let t=a.tagName.toLowerCase();["b","i","u","a","br"].includes(t)?l.appendChild(a.cloneNode(!0)):"span"===t||"div"===t?l.appendChild(e(a)):l.appendChild(a.cloneNode(!0))}return l},t=e(s);for(;s.firstChild;)s.removeChild(s.firstChild);for(let e of i){let l=document.createElement(e);l.appendChild(t),(t=document.createDocumentFragment()).appendChild(l)}s.appendChild(t)}return s.textContent?.trim()||"br"===l?s:null}return null},eW=e=>{let t={},l=[],a=e.style,n=a.getPropertyValue("font-weight");n&&(Number.parseInt(n,10)>=700||"bold"===n)&&l.push("b"),"italic"===a.getPropertyValue("font-style")&&l.push("i");let i=a.getPropertyValue("text-decoration");for(let e of(i?.includes("underline")&&l.push("u"),eF)){if(["font-weight","font-style","text-decoration"].includes(e))continue;let l=a.getPropertyValue(e);l&&(t[e]=l)}return{styles:t,wrappers:l}},e_=(0,f.memo)(({block:e,onChange:t,disableToolbar:l=!1,editor:a="designer",allowedBlocks:n=[],rootProps:i={}})=>{let s=(0,eo.useEditorContext)(),{setField:r}=(0,et.useModelContext)(),d=(0,f.useCallback)((l,a)=>{let n=(0,p.deepClone)(e);n.data[l]=a,t(n)},[e,t]),c=(0,f.useCallback)(e=>d("text",e),[d]),u=(0,f.useCallback)(l=>{let a=(0,p.deepClone)(e);"p"===l?(a.type="paragraph",a.tagName="p"):(a.type="heading",a.tagName=l,a.data.level=Number.parseInt(l.match(/\d+/)[0])),t(a)},[e,t]),m=(0,f.useCallback)(l=>{let a=(0,p.deepClone)(e);a.data.align=l,t(a)},[e,t]),h=(0,f.useCallback)(t=>{let l=document.getSelection(),a=l?.anchorNode;if(a?.nodeType===Node.TEXT_NODE?a.parentElement?.closest?.("li"):a?.closest?.("li"))return;t.preventDefault();let i=(0,p.getClipboardBlock)(t),o=!!i&&n?.find(e=>e.type===i?.type);if(i&&o){let t=[{text:i?.data?.text||"",id:(0,g.v4)()}],l=(0,er.handleRichTextPaste)(e,t);i?.data&&!e.data?.text&&(l=(0,er.replaceBlockHandler)(null,e,{...i,id:(0,g.v4)()})),l&&(s.nextFocus=t.at(-1).id,r(l));return}let{parts:d}=(e=>{let t=e.clipboardData,l=t.getData("text/html"),a=t.getData("text/plain");if(!l){let e=(a||"").split(/\n\s?\n/).map(e=>({text:e.replace(/^\s|\s$/gm,"&nbsp;").replace(/\n/g,"<br>"),id:(0,g.v4)()}));return{html:"",text:a,parts:e}}let n=ez(l),i=(e=>{if(!e)return[];let t=ez(e),l=new DOMParser().parseFromString(t,"text/html");(e=>{let t=Array.from(e.childNodes),l=0;for(;l<t.length;){let a=t[l];if(a.nodeType===Node.ELEMENT_NODE&&"div"===a.tagName.toLowerCase()){let n=Array.from(a.children).find(e=>["ul","ol"].includes(e.tagName.toLowerCase()));if(n){let i=n.tagName.toLowerCase(),s=[n],r=[],o=l+1;for(;o<t.length;){let e=t[o];if(e.nodeType===Node.TEXT_NODE){o++;continue}if(e.nodeType===Node.ELEMENT_NODE&&"div"===e.tagName.toLowerCase()){let t=Array.from(e.children).find(e=>e.tagName.toLowerCase()===i);if(t){s.push(t),r.push(o),o++;continue}}break}if(s.length>1){let n=document.createElement(i);for(let e of s)for(let t of Array.from(e.querySelectorAll(":scope > li")))n.appendChild(t.cloneNode(!0));for(let l of(a.innerHTML="",a.appendChild(n),r.reverse()))e.removeChild(t[l]);l+=r.length}}}l++}})(l.body),(e=>{let t=["p","div","ul","ol","h1","h2","h3","h4","h5","h6","blockquote","pre"],l=[],a=e=>Array.from(e.children).some(e=>t.includes(e.tagName.toLowerCase())),n=()=>{if(l.length>0){let t=document.createElement("p");for(let e of l)t.appendChild(e.cloneNode(!0));for(let a of(e.insertBefore(t,l[0]),l))e.removeChild(a);l=[]}},i=0;for(;i<e.childNodes.length;){let s=e.childNodes[i];if(s.nodeType===Node.TEXT_NODE)s.textContent?.trim()&&l.push(s),i++;else if(s.nodeType===Node.ELEMENT_NODE){let e=s.tagName.toLowerCase();t.includes(e)||a(s)?n():l.push(s),i++}else i++}n()})(l.body);let a=[],n=e=>{let t,l=e.tagName.toLowerCase();if(["b","i","u","span","strong","em"].includes(l)&&(t=["p","div","ul","ol","h1","h2","h3","h4","h5","h6"],Array.from(e.children).some(e=>t.includes(e.tagName.toLowerCase()))))return void(e=>{for(let t of Array.from(e.childNodes))if(t.nodeType===Node.TEXT_NODE){let e=t.textContent?.trim();e&&a.push(e)}else t.nodeType===Node.ELEMENT_NODE&&n(t)})(e);if(["p","h1","h2","h3","h4","h5","h6","li"].includes(l)){let t=e.innerHTML;t.trim()&&a.push(t)}else if("div"===l){let t=e.querySelector(":scope > ul, :scope > ol");if(t)a.push(t.outerHTML);else{let t=e.innerHTML;t.trim()&&a.push(t)}}else if(["ul","ol"].includes(l)){let t=e.outerHTML;t.trim()&&a.push(t)}else{let t=e.innerHTML||e.textContent;t?.trim()&&a.push(t)}};for(let e of Array.from(l.body.childNodes))if(e.nodeType===Node.TEXT_NODE){let t=e.textContent?.trim();t&&a.push(t)}else e.nodeType===Node.ELEMENT_NODE&&n(e);return 0===a.length&&t.trim()&&a.push(t),a.map(e=>({text:e.trim().replace(/^\s|\s$/gm,"&nbsp;").replace(/\n/g,"<br>"),id:(0,g.v4)()}))})(n);return{html:n,text:a,parts:i}})(t),c=(0,er.handleRichTextPaste)(e,d);c&&(s.nextFocus=d.at(-1).id,r(c))},[e,n,s,r]);return"simple"===a?(0,o.jsxs)("div",{className:"w-full mt-2 mb-2 space-y-2",...i,children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Paragraph:"}),(0,o.jsx)(eh.AdminTextArea,{value:e?.data?.text,onChange:c})]}):(0,o.jsx)(es.AdminRichTextInput,{block:e,value:e?.data?.text,tagName:"p",align:e?.data?.align,disableToolbar:l,placeholder:"Start typing...",onAlignmentChange:m,onTagNameChange:u,onChange:c,onPaste:h,allowedBlocks:n,rootProps:i},e.id)});var eq=e.i(340357),eU=e.i(961242);let eV={id:eU.default.id,type:eU.default.type,name:eU.default.name,edit:e_,render:eq.default,metadata:eU.default};e.s(["default",()=>e0],970417);var eK=e.i(606830),eG=e.i(830699),eJ=e.i(178246),eX=e.i(105110),eY=e.i(267423),eZ=e.i(668079),eQ=e.i(10935);let e0=({block:e,onChange:t,onSettingsClick:l,isRich:a=!0,editor:n="designer",rootProps:i={}})=>{let s=(0,eG.useHasBlockSelection)(),r=(0,f.useRef)(null),[u,m]=(0,f.useState)(!1),[h,x]=(0,f.useState)(e?.data?.limit),[g,j]=(0,f.useState)(e?.data?.buttonText),[v,y]=(0,f.useState)(e?.data?.buttonVariant),[N,k]=(0,f.useState)(e?.data?.buttonColor),[A,T]=(0,f.useState)(e?.data?.buttonTextColor),[S,E]=(0,f.useState)(e?.data?.prayerType),[M,B]=(0,f.useState)(e?.data?.notifyEmail),[I,L]=(0,f.useState)(e?.data?.categories),[R,H]=(0,f.useState)(e?.data?.campuses),[W,_]=(0,f.useState)(e?.data?.cardBg),[q,U]=(0,f.useState)(e?.data?.cardTextColor),{loading:V,runCreate:K,error:G,message:J}=(0,eQ.useCreatePrayerCategory)(),{loading:X,runCreate:Y,error:Z,message:el}=(0,eZ.useCreateCampus)(),{brand:ea}=(0,et.useModelContext)(),{setSelection:en,unsetSelection:ei}=(0,eo.useEditorContext)(),es=(0,f.useRef)(!1),er=()=>{l&&l()},ed=()=>{x(e?.data?.limit),j(e?.data?.buttonText),E(e?.data?.prayerType),B(e?.data?.notifyEmail),L(e?.data?.categories),H(e?.data?.campuses),y(e?.data?.buttonVariant),k(e?.data?.buttonColor),T(e?.data?.buttonTextColor),_(e?.data?.cardBg),U(e?.data?.cardTextColor),m(!1)},ec=()=>
61{if(t){let l=(0,p.deepClone)(e);l.data.limit=h,l.data.buttonText=g,l.data.buttonColor=N,l.data.buttonVariant=v,l.data.buttonTextColor=A,l.data.prayerType=S,l.data.notifyEmail=M,l.data.categories=I,l.data.campuses=R,l.data.cardBg=W,l.data.cardTextColor=q,t(l)}m(!1)},eu=async e=>{let t=e.map(async e=>{if(e?.id)return e;let t=await K(e);if(t&&t?.status==="success")return t.data});L(await Promise.all(t))},em=async e=>{let t=e.map(async e=>{if(e?.id)return e;let t=await Y(e);if(t&&t?.status==="success")return t.data});H(await Promise.all(t))},eh={variant:v,color:N,textColor:A},ex=()=>{es.current=!0,en("rich_prayer_toolbar",r.current)},ep=()=>{es.current=!1,setTimeout(()=>{es.current||ei("rich_prayer_toolbar",r.current)},750)};(0,eo.useEditorListener)((e,t,l)=>{"setSelection"===e&&l!==r.current&&(es.current=!1,ei("rich_prayer_toolbar",r.current))},"rich_prayer_toolbar");let ef=()=>(0,o.jsxs)(c.AdminModal,{variant:"success",open:u,setOpen:m,title:"Edit Prayer Widget",description:"Edit the settings of the prayer block",children:[(0,o.jsx)("div",{className:"flex items-center justify-center mt-4 mb-4",children:(0,o.jsx)(ee.ThemedButton,{...eh,children:g})}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Limit"}),(0,o.jsx)(b.AdminInput,{type:"number",value:h?.toString(),onChange:e=>x(e?parseInt(e):null)})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Button Text"}),(0,o.jsx)(b.AdminInput,{value:g,onChange:j})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Prayer Type"}),(0,o.jsxs)(F.AdminSelect,{value:S,onChange:E,children:[(0,o.jsx)("option",{value:"all",children:"All"},"all"),(0,o.jsx)("option",{value:"prayer-request",children:"Prayer Requests"},"prayer-request"),(0,o.jsx)("option",{value:"praise-report",children:"Praise Reports"},"praise-report")]})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Notify Email"}),(0,o.jsx)(b.AdminInput,{type:"email",value:M,onChange:B})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Category"}),(0,o.jsx)(eK.ModelTagging,{label:"Categories",value:I,selector:eQ.useSearchPrayerCategories,onChange:eu})]}),(0,o.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Campuses"}),(0,o.jsx)(eK.ModelTagging,{label:"Campuses",value:R,selector:eZ.useSearchCampuses,onChange:em})]}),(0,o.jsx)($.AdminDivider,{title:"Button Style"}),(0,o.jsxs)("div",{className:"space-y-2 w-full",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Style"}),(0,o.jsxs)(F.AdminSelect,{value:v,onChange:y,children:[(0,o.jsx)("option",{value:"default",children:"Default"}),(0,o.jsx)("option",{value:"action",children:"Action"}),(0,o.jsx)("option",{value:"outlined",children:"Outlined"})]})]}),(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Button Color"}),(0,o.jsx)(z.AdminBrandColorSelector,{value:N,brand:ea,onChange:k})]}),N?.type==="custom"&&(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Button Text Color"}),(0,o.jsx)(D.AdminColorPicker,{icon:(0,o.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:A,onChange:T})]}),!0===a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)($.AdminDivider,{title:"Card Style"}),(0,o.jsxs)("div",{className:"space-y-2 w-full",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Backgroun
61d Color"}),(0,o.jsx)(z.AdminBrandColorSelector,{brand:ea,value:W,onChange:_}),(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>_(null),children:"Clear Background"}),(0,o.jsx)(P.AdminMiniLabel,{className:"mt-2 mb-2",children:"Text Color"}),(0,o.jsx)(D.AdminColorPicker,{icon:(0,o.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:q,onChange:U})]})]}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:ed,children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:ec,children:"Save"})]})]});return"simple"===n?(0,o.jsxs)("div",{className:"w-full",...i,children:[(0,o.jsxs)("div",{className:"w-full space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Prayer Settings"}),(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>m(!0),children:"Edit Prayer Settings"})]}),ef()]}):(0,o.jsxs)("div",{ref:r,"data-rich-slideshow-edit":!0,className:"group/prayer w-full",onMouseEnter:ex,onMouseLeave:ep,...i,children:[(0,o.jsxs)("div",{className:O.tailwindEditableStyles,"data-prayer-widget":!0,children:[(0,o.jsx)("div",{className:"prayer-form",children:(0,o.jsx)(eX.ThemedPrayerForm,{...e?.data})}),(0,o.jsx)(eY.ThemedPrayerWall,{...e?.data,isRich:a,editable:!0})]}),s?(0,o.jsxs)(Q.BlockExtraControls,{children:[(0,o.jsx)(C.AdminRichToolButton,{onClick:()=>m(!0),tooltip:"Edit block",children:(0,o.jsx)(w.TCCPencilIcon,{className:"h-5 w-5"})}),!0!==a&&(0,o.jsx)(C.AdminRichToolButton,{onClick:er,tooltip:"Open settings",children:(0,o.jsx)(w.TCCSettingsIcon,{className:"h-5 w-5"})})]}):(0,o.jsx)(eJ.default,{floatingRef:r,children:(0,o.jsx)("div",{"data-editlist-controls":!0,className:"mt-2 bg-primarylight-200 border border-primarylight-400 rounded-md shadow-brandprimarylight/25 shadow-xl",onMouseEnter:ex,onMouseLeave:ep,children:(0,o.jsx)("div",{"data-admin-rich-toolbar":!0,children:(0,o.jsx)("div",{className:"relative w-full p-1.5 text-black flex flex-wrap space-y-2",children:(0,o.jsx)("div",{"data-text-options":!0,className:"w-full flex flex-wrap space-x-1 space-y-1 gap-1 justify-between",children:(0,o.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[(0,o.jsx)(C.AdminRichToolButton,{onClick:()=>m(!0),tooltip:"Edit block",children:(0,o.jsx)(w.TCCPencilIcon,{className:"h-5 w-5"})}),!0!==a&&(0,o.jsx)(C.AdminRichToolButton,{onClick:er,tooltip:"Open settings",children:(0,o.jsx)(w.TCCSettingsIcon,{className:"h-5 w-5"})})]})})})})})}),ef()]})};var e1=e.i(645585),e2=e.i(303212);let e5={id:e2.default.id,type:e2.default.type,name:e2.default.name,edit:e0,render:e1.default,metadata:e2.default};var e4=e.i(518824),e3=e.i(93117);let e6={id:e3.default.id,type:e3.default.type,name:e3.default.name,edit:({block:e,onChange:t,editor:l="designer",allowedBlocks:a=[],rootProps:n={}})=>{let i=(l,a)=>{let n=(0,p.deepClone)(e);n.data[l]=a,t(n)};return"simple"===l?(0,o.jsxs)("div",{className:"space-y-2 w-full",...n,children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Quote"}),(0,o.jsx)(eh.AdminTextArea,{value:e?.data?.text,onChange:e=>i("text",e)})]}):(0,o.jsx)(es.AdminRichTextInput,{block:e,value:e?.data?.text,align:e?.data?.align,onAlignmentChange:l=>{let a=(0,p.deepClone)(e);a.data.align=l,t(a)},placeholder:"Start typing...",tagName:"blockquote",onChange:e=>i("text",e),allowedBlocks:a,rootProps:n},e.id)},render:e4.default,metadata:e3.default};e.s(["default",()=>te],176970);let e7=({value:e,onChange:t})=>(0,o.jsx)("div",{className:"w-full",children:(0,o.jsxs)("div",{className:"mt-2",children:[(0,o.jsx)(P.AdminMiniLabel,{as:"label",htmlFor:"slideshow-speed",children:"Speed"}),(0,o.jsx)(b.AdminInput,{id:"slideshow-speed",type:"number",min:1,max:20,step:1,value:e?.speed?.toString(),onChange:e=>t("speed",""!==e?parseInt(e,10):void 0)}),(0,o.jsx)(P.AdminMiniLabel,{children:"Seconds between transitions (Defaults to 5 seconds)"})]})});var e8=e.i(584555);let e9=e=>{let t=(t,l)=>{let a=(0,p.deepClone)(e?.item);a[t]=l||"",e.onChange(a)};return(0,o.jsxs)("div",{className:"border border-basealt-300 bg-white rounded-md flex items-center w-full space-x-2 p-2 mb-2",children:[(0,o.jsx)("div",{className:"w-32",children:(0,o.jsx)(u.MediaFormInput,{output:"full",previewCrop:h.ImageCroppingPresets.largepreview,network:!1,type:"image",label:"",value:e?.item?.Media?.id,onChange:e=>t("Media",e)})}),(0,o.jsx)(b.AdminInput,{placeholder:"https://",value:e?.item?.url,onChange:e=>t("url",e)})]})},te=({block:e,onChange:t,editor:l="designer",rootProps:a={}})=>{let[n,i]=(0,f.useState)(!1),[s,r]=(0,f.useState)(!1),[u,m]=(0,f.useState)(e?.data),{containerProps:h,Toolbar:x}=(0,y.useFloatingToolbar)({id:e?.id||"richslideshowedit"}),g=(e,t)=>{if("function"==typeof e)return void m(e((0,p.deepClone)(u)));let l=(0,p.deepClone)(u);(0,ep.default)(l,e,t),m(l)},b=(l,a)=>{let n=(0,p.deepClone)(e);n.data[l]=a,t(n)},v=()=>{m(e?.data),i(!1),r(!1)},N=()=>
61{if(t){let l=(0,p.deepClone)(e);(0,ep.default)(l,"data",u),t(l)}i(!1),r(!1)};return"simple"===l?(0,o.jsxs)("div",{...a,children:[(0,o.jsx)(j.AdminRepeater,{itemTitle:"Slide",defaultOpen:!0,buttonText:"Add New Image",direction:"vertical",withHandle:!0,onChange:e=>b("slides",e),id:"listitemsslideshow",datasource:e?.data?.slides,component:e9}),(0,o.jsxs)("div",{className:"mb-3",children:[(0,o.jsx)(P.AdminLabel,{children:"Transition Settings"}),(0,o.jsx)(e7,{value:e?.data,onChange:b})]})]}):(0,o.jsxs)("div",{"data-rich-slideshow-edit":!0,className:"group/slideshow w-full",...h,...a,children:[e?.data?.slides?.length<=0&&(0,o.jsx)("div",{className:"bg-basealt-200 flex items-center justify-center h-72",children:(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>i(!0),children:"Add Images"})}),e?.data?.slides?.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e8.default,{block:e}),(0,o.jsx)(x,{children:(0,o.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,o.jsxs)(C.AdminRichToolButton,{active:s,onClick:()=>r(!s),tooltip:"Open block settings",children:[(0,o.jsx)("span",{className:"sr-only",children:"Edit SlideShow Settings"}),(0,o.jsx)(w.TCCSettingsIcon,{className:"w-5 h-5 text-basealt-600"})]}),(0,o.jsxs)(C.AdminRichToolButton,{active:n,onClick:()=>i(!n),tooltip:"Reorder & Remove Items",children:[(0,o.jsx)("span",{className:"sr-only",children:"Reorder & Remove Items"}),(0,o.jsx)(w.TCCReorderIcon,{className:"w-5 h-5 text-basealt-600"})]})]})})]}),(0,o.jsxs)(c.AdminModal,{variant:"success",open:n,setOpen:i,title:"Edit SlideShow",description:"Reorder, remove and edit the slideshow",children:[(0,o.jsx)("div",{className:"mt-2",children:(0,o.jsx)(j.AdminRepeater,{defaultOpen:!0,itemTitle:"Slide",buttonText:"Add New Image",direction:"vertical",withHandle:!0,onChange:e=>{g("slides",e)},id:"listitemsslideshow",datasource:u?.slides,component:e9})}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:v,children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:N,children:"Save"})]})]}),(0,o.jsxs)(c.AdminModal,{variant:"success",open:s,setOpen:r,title:"SlideShow Settings",description:"Adjust the slideshow settings",children:[(0,o.jsx)(e7,{value:u,onChange:g}),(0,o.jsxs)("div",{className:"flex justify-end mt-4 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:v,children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:N,children:"Save"})]})]})]})};var tt=e.i(349705);let tl={id:tt.default.id,type:tt.default.type,name:tt.default.name,edit:te,render:e8.default,metadata:tt.default};var ta=e.i(997053),tn=e.i(947258),ti=e.i(167742),ts=e.i(405810);let tr=["core/paragraph","core/heading","core/buttons","core/image"],to=({item:e,onChange:t,...l})=>{let a=(0,f.useCallback)(l=>{let a=(0,p.deepClone)(e);a.blocks=l,t(a)},[e,t]);return(0,o.jsx)(ts.Panel,{className:"h-full p-3",children:(0,o.jsx)(C.AdminRichText,{...l,id:"editablepanelblocks",modal:!0,withEditableStyles:!0,allowedBlocks:tr,value:e,onChange:a})})};var td=e.i(274273),tc=e.i(970554);let tu=f.forwardRef(function({title:e,titleId:t,...l},a){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},l),e?f.createElement("title",{id:t},e):null,f.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}))});var tm=e.i(621451);e.i(787255);var th=e.i(818609),tx=e.i(687517),tp=e.i(998104),tf=e.i(642205),tg=e.i(281404),tb=e.i(353037);let tj=(0,f.memo)(({item:e,orientation:t,onRemove:l,onEdit:a,dragHandleProps:n,ref:i,style:s})=>{let r=(0,f.useCallback)(()=>l(e),[l,e]),d=(0,f.useCallback)(()=>a(e),[a,e]),c=(0,eG.useHasBlockSelection)(),u=(0,eG.useIsBlockSelected)(e?.id),m=(0,eG.useBlockWrapperProps)(e?.id,{name:"Tab",layer:"item",type:"tab",ref:i}),h=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{type:"button","aria-label":"Edit Item",onClick:d,children:(0,o.jsx)(tm.AdminRichIcon,{icon:(0,o.jsx)(w.TCCPencilIcon,{className:"h-4 w-4 text-basealt-600"})})}),(0,o.jsx)("button",{type:"button",...n,"aria-label":"Reorder item",children:(0,o.jsx)(tm.AdminRichIcon,{icon:(0,o.jsx)(tu,{className:"h-6 w-6 text-basealt-600"})})}),(0,o.jsx)("button",{type:"button","aria-label":"Remove item",onClick:r,children:(0,o.jsx)(tm.AdminRichIcon,{icon:(0,o.jsx)(w.TCCTrashIcon,{className:"h-4 w-4 text-error-600"})})})]}),x=(0,o.jsx)("button",{type:"button","aria-label":"Edit Item",onClick:d,children:(0,o.jsx)(tm.AdminRichIcon,{icon:(0,o.jsx)(w.TCCPencilIcon,{className:"h-4 w-4 text-basealt-600"})})});return(0,o.jsx)("div",{style:s,...m,children:(0,o.jsxs)("div",{className:(0,eS.classNames)("relative group/tabs",{"flex-1":"horizontal"!==t}),children:[c?u&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tx.BlockParentButton,{}),(0,o.jsx)(tp.default,{children:(0,o.jsxs)("div",{"data-block-controls":!0,className:"flex items-center gap-1.5",children:[(0,o.jsx)("p",{className:"text-xs px-1 whitespace-nowrap",children:"Tab"}),x]})}),(0,o.jsx)(tf.BlockToolbarDragHandle,{provided:{dragHandleProps:n},label:"Reorder item"}),(0,o.jsx)(tp.default.Options,{children:(0,o.jsx)(tg.BlockToolbarMenuItem,{icon:w.TCCTrashIcon,destructive:!0,onClick:r,children:"Delete tab"})})]}):(0,o.jsx)("div",{className:(0,eS.classNames)("absolute flex h-full","horizontal"===t?"-translate-x-full":"translate-y-full z-50"),children:(0,o.jsx)("div",{"data-repeater-control
61s":!0,className:"flex items-center opacity-0 group-hover/tabs:opacity-100",children:h})}),(0,o.jsx)(tc.Tab,{as:tb.StyledTab,type:"button",className:(0,eS.classNames)("peer tabs-title data-[selected]:button-primary button-secondary",{"w-full flex justify-start!":"horizontal"!==t}),children:e.title})]})})});tj.displayName="TabItemContent";let tv=({children:e,items:t=[],orientation:l,onChange:a,...n})=>{let[i,s]=(0,f.useState)(!1),[r,d]=(0,f.useState)(null),[c,u]=(0,f.useState)(!1),[m,h]=(0,f.useState)(null),x=(0,f.useMemo)(()=>({vertical:"vertical"===l}),[l]),p=(0,f.useCallback)(e=>{if(e.operation.canceled)return;let l=(0,td.move)(t,e);l!==t&&a(l)},[t,a]),g=(0,f.useCallback)(e=>{h(e),u(!0)},[]),b=(0,f.useCallback)(e=>{s(!0),d(e)},[]),v=(0,f.useCallback)(()=>{s(!1),d(null)},[]),y=(0,f.useCallback)(()=>{r&&(s(!1),a(t.filter(e=>e.id!==r.id)),d(null))},[r,t,a]),C=(0,f.useCallback)(e=>{a(t.map(t=>e.id===t.id?e:t)),h(null)},[t,a]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(tc.TabGroup,{as:tb.StyledTabsGroup,...x,$orientation:l,...n,children:[(0,o.jsx)(tb.StyledTabList,{$orientation:l,children:(0,o.jsx)(th.Sortable,{onDragEnd:p,items:t,wrapClassName:"horizontal"!==l?"flex":"",orientation:"horizontal"===l?"vertical":"horizontal",children:!!t?.length&&t.map((e,t)=>(0,o.jsx)(th.SortableItem,{item:e,index:t,children:({ref:t,dragHandleProps:a},n)=>(0,o.jsx)(tj,{item:e,orientation:l,onRemove:b,onEdit:g,dragHandleProps:a,ref:t,style:n})},e.id))})}),(0,o.jsx)(tc.TabPanels,{as:"div",className:"min-h-full flex-3",children:e})]}),(0,o.jsx)(j.AdminRemoveItemModal,{open:i,setOpen:v,title:"Are you sure?",description:"Remove this item?",onRemoveItem:y}),(0,o.jsx)(ty,{open:c,setOpen:u,item:m,onSave:C})]})},ty=(0,f.memo)(({open:e,setOpen:t,item:l={},onSave:a})=>{let[n,i]=(0,f.useState)(l?.title||"");return(0,f.useEffect)(()=>{i(l?.title||"")},[l?.title]),(0,o.jsx)(c.AdminModal,{variant:"success",open:e,setOpen:t,title:"Edit tab text",children:(0,o.jsxs)("form",{action:"#",onSubmit:e=>{e.preventDefault(),a({...l,title:n}),t(!1)},children:[(0,o.jsx)("div",{className:"w-full mb-4 space-y-2",children:(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Tab Text"}),(0,o.jsx)(b.AdminInput,{value:n,onChange:i})]})}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>{i(l?.title||""),t(!1)},children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{type:"submit",children:"Save"})]})]})})});ty.displayName="EditTabTextModal";let tC=({tabsNum:e=3,orientation:t})=>{let l={};return"vertical"===t?l.gridTemplateRows="auto 1fr":l.gridTemplateColumns="1fr 3fr",(0,o.jsxs)("div",{className:"grid min-h-40 mt-3 gap-1.5",style:l,children:[(0,o.jsx)("div",{className:`flex-1 flex gap-1.5 ${"vertical"!==t?"flex-col":"flex-row"}`,children:Array.from({length:e}).map((e,t)=>(0,o.jsx)("div",{className:"h-6 flex-1 rounded-xs bg-slate-200"},t))}),(0,o.jsx)("div",{className:"flex-3",children:(0,o.jsx)("div",{className:"h-full rounded-xs bg-slate-200"})})]})};var tw=e.i(622278),tN=e.i(420793);let tk=({brand:e,block:t,onCancel:l,onSave:a})=>{let[n,i]=(0,f.useState)(t),s=e=>t=>{let l=(0,p.deepClone)(n);(0,ep.default)(l,e,t),i(l)},r=s("data.styles.bg"),c=s("data.styles.textColor"),u=s("data.styles.activeBg"),m=s("data.styles.activeTextColor"),h=s("data.layout");return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(W.AdminSurface,{className:"bg-white",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Tab Background Color"}),(0,o.jsx)(z.AdminBrandColorSelector,{value:n?.data?.styles?.bg,brand:e,onChange:r}),(0,o.jsx)(P.AdminMiniLabel,{className:"mt-2 mb-2",children:"Tab Text Color"}),(0,o.jsx)(D.AdminColorPicker,{icon:(0,o.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:n?.data?.styles?.textColor,onChange:c}),(0,o.jsx)(P.AdminMiniLabel,{className:"mt-2 mb-2",children:"Active Tab Background Color"}),(0,o.jsx)(z.AdminBrandColorSelector,{value:n?.data?.styles?.activeBg,brand:e,onChange:u}),(0,o.jsx)(P.AdminMiniLabel,{className:"mt-2 mb-2",children:"Active Tab Text Color"}),(0,o.jsx)(D.AdminColorPicker,{icon:(0,o.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:n?.data?.styles?.activeTextColor,onChange:m}),(0,o.jsx)(P.AdminMiniLabel,{className:"mt-2 mb-2",children:"Tabs Orientation"}),(0,o.jsxs)(F.AdminSelect,{value:n?.data?.layout||"horizontal",onChange:h,children:[(0,o.jsx)("option",{value:"horizontal",children:"Horizontal"}),(0,o.jsx)("option",{value:"vertical",children:"Vertical"})]}),(0,o.jsx)(tC,{tabsNum:n?.data?.items?.length||3,orientation:n?.data?.layout||"horizontal"})]}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>{i(t?.data),l()},children:"Cancel"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:()=>{a((0,p.deepClone)(n))},children:"Save"})]})]})},tA=(0,ta.default)(ee.ThemedButton).attrs({as:"div"}).withConfig({displayName:"TabsOrderSettings__OrderableButton",componentId:"sc-d13f29ba-0"})`
62    border-radius: var(--theme-border-radius-md);
63    box-shadow: var(--theme-shadow);
64    width: 95%;
65    padding: 1rem 1.5rem;
66    margin: 5px;
67    /* background-color: var(--primary-color-bg); */
68    /* color: var(--primary-color-text); */
69`,tT=(0,ta.default)(b.AdminInputTransparent).withConfig({displayName:"TabsOrderSettings__OrderableButtonInput",componentId:"sc-d13f29ba-1"})`
70    background: transparent;
71    color: inherit;
72`,tS=({block:e,onSave:t,onCancel:l})=>{let[a,n]=(0,f.useState)(!1),[i,s]=(0,f.useState)(null),[r,c]=(0,f.useState)(e);if(!e)return;let u=e=>t=>{let l=(0,p.deepClone)(r);(0,ep.default)(l,e,t),c(l)},m=u("data.items"),h=e=>{n(!0),s(e)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(W.AdminSurface,{children:(0,o.jsxs)("div",{"data-repeater":!0,children:[(0,o.jsx)(th.Sortable,{onDragEnd:function(e){if(e.operation.canceled)return;let t=r?.data?.items,l=(0,td.move)(t,e);l!==t&&m(l)},items:r?.data?.items,children:r?.data?.items.map((e,t)=>(0,o.jsx)(th.SortableItem,{item:e,index:t,children:({ref:t,dragHandleProps:l},a)=>(0,o.jsx)("div",{"data-repeated-item":!0,style:a,ref:t,children:(0,o.jsxs)("div",{className:"flex justify-between items-center group",children:[(0,o.jsx)(tA,{className:"tabs-title",children:(0,o.jsx)(tT,{value:e.title,onChange:t=>{var l;let a,n;return l=e.id,a=(0,p.deepClone)(r?.data?.items),void(-1!==(n=a?.findIndex(({id:e})=>e===l))&&((0,ep.default)(a[n],"title",t),u("data.items")(a)))}})}),(0,o.jsx)(j.AdminRepeatedItemControls,{item:e,onRemove:h,provided:{dragHandleProps:l}})]})})},e.id))}),(0,o.jsx)(j.AdminRemoveItemModal,{open:a,setOpen:()=>{n(!1),s(null)},title:"Are you sure?",description:"Remove this item?",onRemoveItem:()=>
72{i&&(n(!1),m(r?.data?.items.filter(e=>e.id!==i.id)),s(!1))}})]})}),(0,o.jsxs)("div",{className:"flex justify-end mt-2 space-x-2",children:[(0,o.jsx)(d.AdminButtonPrimary,{onClick:()=>{m([...(0,R.default)(r,"data.items",[]),tE()])},children:"Add"}),(0,o.jsx)(d.AdminButtonPrimary,{onClick:()=>{t((0,p.deepClone)(r))},children:"Save"}),(0,o.jsx)(d.AdminButtonOutlined,{onClick:()=>{c(e?.data),l()},children:"Cancel"})]})]})},tE=()=>({id:(0,p.uniqueId)(),title:"New tab",blocks:[{id:(0,p.uniqueId)(),type:"paragraph",data:{text:"Click to edit your text"}}]}),tM=({item:e,onChange:t})=>(0,o.jsxs)("div",{className:"w-full",children:[(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Tab Title"}),(0,o.jsx)(b.AdminInput,{value:e?.title,onChange:l=>t(e,"title",l)})]}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Content"}),(0,o.jsx)(C.AdminRichText,{editor:"simple",id:"editablepanelblocks",modal:!0,withEditableStyles:!0,allowedBlocks:tw.default.allowedBlocks,value:e,onChange:l=>t(e,"blocks",l)})]})]}),tB=(0,ta.styled)(({block:e,onChange:t,className:l,brand:a,editor:n="designer",rootProps:i={}})=>{let[s,r]=(0,f.useState)(""),d=(0,f.useCallback)(()=>r(""),[]),u=(0,f.useCallback)((l,a)=>{let n=(0,p.deepClone)(e);n.data[l]=a,t(n)},[e,t]),m=(0,f.useCallback)(e=>{t((0,p.deepClone)(e)),d()},[t,d]),h=(0,f.useCallback)(t=>{let l=(0,p.deepClone)(e?.data?.items),a=l?.findIndex(({id:e})=>e===t.id);-1!==a&&(l[a]=t,u("items",l))},[e,u]),x=(0,f.useCallback)(e=>u("items",e),[u]),g=(0,f.useCallback)(()=>{u("items",[...e.data.items,tE()])},[e.data.items,u]),b=(0,f.useMemo)(()=>tE(),[]);return"simple"===n?(0,o.jsxs)("div",{className:"space-y-4 w-full bg-white p-1",...i,children:[(0,o.jsx)(P.AdminMiniLabel,{children:"Tabs:"}),(0,o.jsx)(W.AdminSurface,{className:"bg-basealt-50 w-full",children:(0,o.jsx)(tn.AdminCollapse,{title:"Layout Settings",children:(0,o.jsx)(tk,{block:e,brand:a,onCancel:d,onSave:m})})}),(0,o.jsx)(P.AdminLabel,{children:"Tabs"}),(0,o.jsx)(j.AdminRepeater,{itemTitle:"Tab",defaultOpen:!1,defaultArgs:b,buttonText:"New Tab",direction:"vertical",onChange:x,id:"buttons",datasource:e?.data?.items,component:tM})]}):(0,o.jsxs)("div",{className:(0,eS.classNames)("tabs-wrap group/editlist widget-tabs",l),"data-tabs":!0,itemScope:!0,itemProp:"mainEntity",itemType:"https://schema.org/Question",...i,children:[(0,o.jsx)(tv,{className:"w-full",items:e?.data?.items,orientation:e?.data?.layout,onChange:x,children:e?.data?.items.map((e,t)=>(0,o.jsx)(to,{item:e,onChange:h},`panel-${e?.id||t}`))},e?.id),(0,o.jsx)(Q.BlockExtraControls,{blockId:e?.id,fallbackClassName:"space-x-1 flex items-center absolute z-50 left-0 -top-8 bg-blue-300 rounded-xs text-basealt-600 h-8 px-2 opacity-0 group-hover/editlist:opacity-100",children:(0,o.jsx)(ti.EditListControls,{label:null,typeName:"Tab",onAdd:g,onReorder:()=>r("order"),onSettings:()=>r("general")})}),(0,o.jsx)(c.AdminModal,{variant:"success",open:"general"===s,setOpen:d,title:"Edit Tabs Design",description:"Tweak the design of the tabs",children:(0,o.jsx)(tk,{block:e,brand:a,onCancel:d,onSave:m})}),(0,o.jsx)(c.AdminModal,{open:"order"===s,setOpen:d,title:"Edit Tab order",description:"Drag the tabs below to change the order",children:(0,o.jsx)(tS,{block:e,onSave:m,onCancel:d})})]},e?.id)}).withConfig({displayName:"Edit__ThemedEdit",componentId:"sc-7f5ad009-0"})`
73    ${tN.default};
74    [data-edit-controls] {
75        opacity: 0;
76        transition: all 50ms;
77    }
78    &:hover {
79        [data-edit-controls] {
80            opacity: 1;
81        }
82    }
83`;var tI=e.i(518889);let tL={id:tw.default.id,type:tw.default.type,name:tw.default.name,edit:tB,render:tI.ThemedTabs,metadata:tw.default};var tR=e.i(496345);let tD=({id:e,className:t,value:l,...a})=>(0,o.jsxs)("div",{"data-video-input":!0,className:"w-full group/videoinput",children:[(0,o.jsx)(b.AdminInput,{id:e,value:l,placeholder:a?.placeholder,onChange:e=>{a?.onChange&&a.onChange(e)},className:"mb-2"}),l&&(0,o.jsx)(tR.UniversalVideoPlayer,{src:l})]});e.s(["AdminVideoInput",0,tD],332487);var tP=e.i(997773);let tO=({block:e,onChange:t,rootProps:l={}})=>{let[a,n]=(0,f.useState)(!1),i=(e?.data?.url||"").includes("control.resi.io/webplayer");return(0,o.jsxs)("div",{className:`w-full relative group/richvideo ${O.tailwindEditableStyles}`,...l,children:[!a&&(0,o.jsx)(tD,{value:e?.data?.url,onChange:l=>{let a;(a=(0,p.deepClone)(e)).data.url=l,t(a)}}),a&&(i?(0,o.jsx)(tP.ResiVideoPlayer,{src:e?.data?.url}):(0,o.jsx)(tR.UniversalVideoPlayer,{src:e?.data?.url,controls:!0})),(0,o.jsx)("div",{className:"absolute top-10 right-0  items-center justify-end flex opacity-0 group-hover/richvideo:opacity-100",children:(0,o.jsx)("div",{className:"flex items-center ",children:(0,o.jsxs)("button",{type:"button",onClick:()=>n(!a),children:[a&&(0,o.jsx)(tm.AdminRichIcon,{icon:(0,o.jsx)(w.TCCPencilIcon,{className:"h-4 w-4 text-basealt-600"})}),!a&&(0,o.jsx)(tm.AdminRichIcon,{icon:(0,o.jsx)(w.TCCEyeIcon,{className:"h-4 w-4 text-basealt-600"})})]})})})]})};e.s(["default",0,tO],318105);var tF=e.i(370013),t$=e.i(570823);let tz={id:t$.default.id,type:t$.default.type,name:t$.default.name,edit:tO,render:tF.default,metadata:t$.default},tH=[eu,eV,a.default,eN,ey,tz,tl,e6,t.default,tL,e5,l.default,r.default,s.default,ei,L,i.default,eM,eD,n.default],tW=(e=null)=>{let t=tH;return e&&(t=t.filter(t=>t.metadata.scopes.includes(e))),{blocks:t,map:t.reduce((e,t)=>
83(e[t.type]=t,e),{}),getBlock:e=>t.find(t=>t.key===e||t.name.toLowerCase()===e.toLowerCase()||t.id===e)}}},30904,42562,e=>{"use strict";e.s(["DroppableContainerHighlight",()=>u],30904);var t=e.i(843476),l=e.i(877751);e.s(["RichBlockProvider",()=>o,"useCreateRichBlockContext",()=>r,"useRichBlockContext",()=>d],42562);var a=e.i(939766),n=e.i(271645),i=e.i(174080);let s=(0,n.createContext)(null),r=()=>{let e,t,l=(0,n.useRef)(null);l.current||(e=new Map,l.current={registerContainer:(t,l)=>{e.set(t,l)},unregisterContainer:t=>{e.delete(t)},isDropAllowed:t=(t,l)=>{let n=e.get(t);if(!n)return!1;if(!n.allowedBlocks?.length)return!0;let i=a.richBlockRegistry.find(e=>e.type===l);return!!i&&n.allowedBlocks.includes(i.id)},moveBlock:(l,a,n,s)=>{let r=e.get(l),o=e.get(a);if(!r||!o)return;let d=r.blocks.find(e=>e.id===n);if(!d||!t(a,d.type))return;let c=r.blocks.filter(e=>e.id!==n),u=[...o.blocks];u.splice(s,0,d),(0,i.flushSync)(()=>{r.onChange(c)});let m=e.get(a);m&&(0,i.flushSync)(()=>m.onChange(u))},registry:e});let[s,r]=(0,n.useState)(null);return(0,n.useMemo)(()=>({...l.current,indicator:s,setIndicator:r}),[s])},o=s.Provider,d=()=>(0,n.useContext)(s);var c=e.i(988842);let u=({containerId:e,innerRef:a,children:n})=>{let i=d(),{source:s}=(0,l.useDragOperation)(),r=null!=s&&"item"===s.type&&s.data?.containerId!==e&&(i?.isDropAllowed(e,s.data?.blockType)??!1);return(0,t.jsx)("div",{ref:a,"data-admin-rich-blocks":!0,"data-rich-container":e??void 0,className:(0,c.classNames)("relative",{"outline outline-2 outline-dashed outline-blue-500 bg-black/10 p-4 rounded transition-all":r}),children:n})}},18907,171806,82527,e=>{"use strict";var t=e.i(843476),l=e.i(271645),a=e.i(830699),n=e.i(968278);e.s(["BlockCanvas",0,({children:e,onDeleteBlock:i,onDuplicateBlock:s,onCopyBlock:r,...o})=>{let d=(0,a.useBlockSelectionStore)(),[c,u]=(0,l.useState)(null);return(0,l.useEffect)(()=>{if(!c||!d)return;let e=e=>{if(0!==e.button||(0,n.isInsideAffordance)(e.target))return;let t=(0,n.getBlockIdFromNode)(e.target);if(!t){(0,n.isInsideAffordance)(e.target)||d.clearSelection();return}d.getSelectedBlockId()!==t&&d.selectBlock(t,{mode:(0,n.isEditableTarget)(e.target)?"edit":"navigation"})},t=e=>{if((0,n.isInsideAffordance)(e.target))return;let t=(0,n.getBlockIdFromNode)(e.target);if(!t)return;let l=(0,n.isEditableTarget)(e.target);d.getSelectedBlockId()===t?d.setMode(l?"edit":"navigation"):d.selectBlock(t,{mode:l?"edit":"navigation"})},l=e=>{let t=e.relatedTarget;!t||c.contains(t)||(0,n.isInsideAffordance)(t)||t instanceof Element&&t.closest('[role="dialog"]')||d.clearSelection()};return c.addEventListener("mousedown",e),c.addEventListener("focusin",t),c.addEventListener("focusout",l),()=>{c.removeEventListener("mousedown",e),c.removeEventListener("focusin",t),c.removeEventListener("focusout",l)}},[c,d]),((e,t,a={})=>{let{onDelete:i,onDuplicate:s,onCopy:r}=a;(0,l.useEffect)(()=>{if(!e||!t)return;let l=e=>{let l=t.getBlockElement(e);l&&l.focus({preventScroll:!1})},a=a=>{if("navigation"!==t.getMode()){if("Escape"===a.key){let e=t.getSelectedBlockId();t.setMode("navigation"),e&&l(e),a.preventDefault()}return}if((0,n.isEditableTarget)(a.target)||(0,n.isInsideAffordance)(a.target))return;let o=t.getSelectedBlockId();if(!o)return;let d=t.getBlockElement(o);if(!d||a.target!==d&&(0,n.getBlockIdFromNode)(a.target)!==o)return;let c=e=>{e&&(t.selectBlock(e),l(e),a.preventDefault())};switch(a.key){case"ArrowUp":case"ArrowDown":{var u;let t,l=(t=(u=d.parentElement?.closest("[data-editor-block]")??e)!==e,[...u.querySelectorAll("[data-editor-block]")].filter(e=>e.parentElement?.closest("[data-editor-block]")===(t?u:null))),n=l.indexOf(d),i=l[n+("ArrowDown"===a.key?1:-1)];i&&c(i.dataset.editorBlock);break}case"ArrowLeft":{let[e]=t.getAncestorIds();e&&c(e);break}case"ArrowRight":{let e=d.querySelector("[data-editor-block]");e&&c(e.dataset.editorBlock);break}case"Enter":{t.setMode("edit");let e=d.querySelector("[contenteditable]");e instanceof HTMLElement&&e.focus(),a.preventDefault();break}case"Escape":{let[e]=t.getAncestorIds();e?c(e):(t.clearSelection(),a.preventDefault());break}case"Backspace":case"Delete":if(!i)break;t.willRemove(o),i(o),a.preventDefault();break;case"d":case"D":if(!(a.metaKey||a.ctrlKey)||!s)break;s(o),a.preventDefault();break;case"c":case"C":if(!(a.metaKey||a.ctrlKey)||!r)break;r(o),a.preventDefault()}};return e.addEventListener("keydown",a),()=>e.removeEventListener("keydown",a)},[e,t,i,s,r])})(c,d,{onDelete:i,onDuplicate:s,onCopy:r}),(0,t.jsx)("div",{ref:u,"data-block-canvas":!0,...o,children:e})}],18907);var i=e.i(482820),s=e.i(567432),r=e.i(993675);let o=(e,t)=>{if(!e||!t)return null;let l=(0,s.findContainerArrayById)((0,i.default)(e,(0,s.getContentPath)(e)),t);
83if(!Array.isArray(l))return null;let a=l.findIndex(e=>e?.id===t);return a<0?null:{array:l,index:a,block:l[a]}};e.s(["deleteBlockById",0,e=>t=>{let l=o(t,e);return l&&l.array.splice(l.index,1),t},"duplicateBlockById",0,e=>t=>{let l=o(t,e);if(!l)return t;let a=(0,r.setUniqueIds)((0,r.deepClone)(l.block));return l.array.splice(l.index+1,0,a),t},"getBlockPath",0,o],171806);var d=e.i(997053);let c=d.default.div.withConfig({displayName:"DropIndicator__Indicator",componentId:"sc-3d5ae956-0"})`
84    pointer-events: none;
85    z-index: 50;
86    height: 0.25rem;
87    border-radius: 9999px;
88    background-color: rgb(59 130 246);
89
90    position: absolute;
91    position-anchor: var(--drop-anchor, --drop-target);
92    left: anchor(left);
93    width: anchor-size(width);
94
95    &[data-drop-indicator='before'] { bottom: anchor(top); }
96    &[data-drop-indicator='after'] { top: anchor(bottom); }
97`;e.s(["DropIndicator",0,({active:e,position:l,anchor:a})=>e&&l?(0,t.jsx)(c,{"data-drop-indicator":l,style:a?{"--drop-anchor":a}:void 0}):null],82527)},158457,272931,e=>{"use strict";e.s(["AdminRichText",()=>P,"AdminRichToolButton",()=>z,"EXAMPLE_RICH_DATA",()=>D,"RICH_TEXT_COMMAND_EVENT",()=>$],158457);var t=e.i(843476),l=e.i(726367),a=e.i(274273),n=e.i(877751),i=e.i(635307),s=e.i(482820),r=e.i(271645),o=e.i(174080),d=e.i(422233),c=e.i(621451),u=e.i(467362),m=e.i(757841),h=e.i(567432),x=e.i(30904),p=e.i(939766),f=e.i(787255),g=e.i(399168),b=e.i(818609),j=e.i(18907),v=e.i(830699),y=e.i(998104),C=e.i(171806),w=e.i(82527),N=e.i(859932),k=e.i(664690),A=e.i(178246),T=e.i(42562),S=e.i(851494),E=e.i(988842),M=e.i(208509),B=e.i(488691),I=e.i(993675),L=e.i(997053);let R=L.styled.div.withConfig({displayName:"RichTextWrapper",componentId:"sc-ea04b346-0"})`
98    --block-anchor: ${e=>`--${e?.$block?.id}`};
99    >[data-block-controls],
100    >[data-editor-affordance] {
101        position-anchor: var(--block-anchor);
102    }
103
104    >:not([data-block-controls]):not([data-editor-affordance]) {
105        anchor-name: var(--block-anchor);
106    }
107`;e.s(["RichTextWrapper",0,R],272931);let D={get template(){return{blocks:[{id:(0,d.v4)(),type:"paragraph",data:{text:"My First paragraph with <b>bold</b> text."}}]}}},P=e=>{let{mounted:l}=(0,k.useEditorContext)(),a=(0,v.useHasBlockSelection)();return e.isolated?(0,t.jsx)(k.EditorContextProvider,{isolate:!0,children:(0,t.jsx)(T.RichBlockProvider,{value:null,children:(0,t.jsxs)(v.BlockSelectionProvider,{isolate:!0,children:[(0,t.jsx)(j.BlockCanvas,{children:(0,t.jsx)(F,{...e})}),(0,t.jsxs)(i.Portal,{children:[(0,t.jsx)(y.default.Slot,{}),(0,t.jsx)(A.default.Slot,{})]})]})})}):a||"simple"===e.editor?(0,t.jsxs)(k.EditorContextProvider,{children:[(0,t.jsx)(F,{...e}),!l&&(0,t.jsx)(A.default.Slot,{})]}):(0,t.jsx)(k.EditorContextProvider,{children:(0,t.jsxs)(v.BlockSelectionProvider,{children:[(0,t.jsx)(j.BlockCanvas,{children:(0,t.jsx)(F,{...e})}),(0,t.jsx)(O,{mounted:l})]})})},O=({mounted:e})=>{let[l,a]=(0,r.useState)(null);return((0,r.useEffect)(()=>a(document.body),[]),l)?(0,o.createPortal)((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.default.Slot,{}),!e&&(0,t.jsx)(A.default.Slot,{})]}),l):null},F=({mode:e="admin",editor:i="designer",id:o="adminrichtext",modal:f=!1,withEditableStyles:j=!1,isolated:y=!1,value:A,onChange:E,options:L,allowedBlocks:D,blockScope:P,brand:O,...F})=>{let{setField:$}=(0,M.useModelContext)(),z=(0,k.useEditorContext)(),H=(0,p.useRichBlockRegistry)(),W=(0,T.useRichBlockContext)(),_=(0,v.useHasBlockSelection)(),{willRemove:q}=(0,v.useBlockSelectionActions)(),{account:U}=(0,B.useGlobalContext)(),V=W?.indicator,K=(0,r.useId)(),G=W?`richblock-container-${K}`:null,J=!!V&&V.containerId===G,{ref:X}=(0,n.useDroppable)({id:G??`disabled-droppable-${K}`,disabled:!G,data:{type:"rich-block-container",containerId:G},collisionPriority:l.CollisionPriority.Low,accept:e=>"item"===e.type&&(W?.isDropAllowed(G,e.data?.blockType)??!0)}),Y=A?.blocks||[],Z=null;if(L)Z=L.map(e=>e.id);else if(P||D?.length){let e=H.blocks.filter(e=>!(P&&!e.metadata.scopes.includes(P)||D?.length&&!D.includes(e.id)));L=e,Z=e.map(e=>e.id)}W&&G&&W.registerContainer(G,{blocks:Y,onChange:e=>{E&&E(e)},allowedBlocks:Z}),(0,r.useEffect)(()=>()=>{W&&G&&W.unregisterContainer(G)},[G]);let Q=(e,t)=>{let l=(0,s.default)(e,"metadata.placeholder");l||(l={id:(0,d.v4)(),type:e.type,tagName:e.tagName,data:{...e.data}}),z.mounted&&(z.nextFocus=l.id);let a=[...A?.blocks?(0,I.deepClone)(A?.blocks):[]];null!==t?a.splice(t+1,0,l):a.push(l),E&&E(a)},ee=(e,t)=>
107{let l=(0,I.deepClone)(A?.blocks).map(l=>l.id!==e.id?l:t);E&&E([...l])},et=(0,I.useCopyToClipboard)(),el=(0,I.useCopyBlockToClipboard)(),ea=async(e,t)=>{e.preventDefault(),t&&(et(t),el(t,H.map[t.type]?.render||(()=>null)))},en=!!W&&"admin"===e&&"designer"===i;return(0,t.jsx)("div",{"data-admin-rich-text":!0,"data-rich-text":!0,"data-is-editor":!0,children:(0,t.jsx)(x.DroppableContainerHighlight,{innerRef:X,containerId:G,children:(0,t.jsx)(b.Sortable,{onDragEnd:e=>{if(e.operation.canceled)return;let t=(0,s.default)(A,"blocks",[]),l=(0,a.move)(t,e);l!==t&&E&&E(l)},items:Y,externalContext:!!W,children:(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:"rich-wrap admin-rich-text-root",children:[Y.map((l,a)=>{let n=J&&V.blockId===l.id;return(0,t.jsx)(b.SortableItem,{item:l,index:a,group:G,type:"item",accept:e=>"item"===e.type&&(W?.isDropAllowed(G,e.data?.blockType)??!0),data:{type:"rich-block",blockType:l.type,containerId:G},children:({ref:r,dragHandleProps:o,isDragging:x},p)=>(0,t.jsxs)(N.EditorBlockWrapper,{id:l.id,layer:"rich",name:H.map[l.type]?.metadata?.name||l.type,type:l.type,innerRef:r,"data-rich-block-anchor":l.id,style:{anchorName:n?"--rich-drop-target":`--${l.id}`,...p},...n?{"data-drop-target":V.position}:{},className:`group/richtextwrap editor-richtextwrapper relative ${x?"rounded ring-1 ring-inset":""}`,children:[(0,t.jsxs)(R,{$block:l,className:"flex w-full group/richtext relative",children:[(0,t.jsx)(u.AdminRichBlockControls,{blockId:l.id,blockName:H.map[l.type]?.metadata?.name||"Block",provided:{dragHandleProps:o},onDuplicate:e=>(e=>{if(!e)return;let t=(0,I.deepClone)(A?.blocks),l=(0,I.deepClone)(e),a=(0,I.hydrateUniqueBlockIds)(l,!0);a.id=(0,d.v4)();let n=t.findIndex(t=>t.id===e.id);t.splice(n+1,0,a),E&&E(t)})(l),onDelete:e=>{if(y){q(l.id),E&&E(Y.filter(e=>e.id!==l.id));return}if(_){q(l.id),$((0,C.deleteBlockById)(l.id));return}$((0,h.removeBlockHandler)(e.target,l))},onMove:e=>((e,t)=>{let l;if(!e)return;let a=[...(0,s.default)(A,"blocks",[])];if(0===t&&"up"===e||t===A?.blocks?.length-1&&"down"===e)return;"up"===e?l=t-1:"down"===e&&(l=t+1);let n=a.splice(t,1)[0];a.splice(l,0,n),E&&E(a)})(e,a),onCopy:e=>ea(e,l),editor:i}),(0,t.jsx)(m.AdminRichBlockResizable,{block:l,enabled:en,onWidthChange:e=>ee(l,(0,S.applyRichBlockWidth)(l,e)),children:a=>((l,a={})=>{if(!l?.type)return null;let n=(0,s.default)(H,`map.${l.type}.edit`),r=(0,s.default)(H,`map.${l.type}.render`),o=(0,I.deepClone)(l);"accordion"===l.type&&A?.accordionStyleLock===!0&&(o?.data?.styles||(o.data.styles={}),o.data.styles={...A?.accordionStyles},o.data.accordionStyleLock=!0),"accordion"===l.type&&A?.accordionAutoClose===!0&&(o.data.accordionAutoClose=!0);let d={editor:i,withEditableStyle:j,block:o,onChange:e=>ee(l,e),rootProps:a},c={paragraph:{component:n,extraProps:{allowedBlocks:L}},heading:{component:n,extraProps:{allowedBlocks:L}},div:n,buttons:n,html:n,video:n,countdowntimer:{component:n,extraProps:{account:U}},slideshow:n,quote:n,accordion:{component:n,extraProps:{brand:O,allowedBlocks:L}},tabs:{component:n,extraProps:{brand:O}},prayer:{component:n,extraProps:{brand:O}},audio:{component:n,extraProps:{brand:O}},form:{component:n,extraProps:{brand:O}},divider:{component:n,extraProps:{brand:O}},giving:{component:n,extraProps:{brand:O}},opentext:n,gallery:n,overlappingimages:{component:n,extraProps:{shape:F?.shape}},image:{component:"admin"===e?n:"member"===e?r:null,extraProps:{shape:F?.shape,crop:"email"===P?g.ImageCroppingPresets.email:void 0}}}[l.type];if(!c)return null;if("object"==typeof c){if(!c.component)return null;let e=c.component;return(0,t.jsx)(e,{...d,...c.extraProps})}return(0,t.jsx)(c,{...d})})(l,a)})]}),!x&&("designer"===i||a===Y.length-1)&&(0,t.jsx)(c.AdminNewBlock,{anchorPosition:l.id,modal:f,options:L,onSelect:Q,editor:i,showNewButton:F?.showNewButton,indexPosition:a})]})},l.id)}),0===Y.length&&(0,t.jsx)("div",{className:"group/richtextwrap editor-richtextwrapper relative min-h-[40px] flex items-center justify-center",children:(0,t.jsx)(c.AdminNewBlock,{modal:f,options:L,onSelect:Q,editor:i,showNewButton:!0})}),(0,t.jsx)(w.DropIndicator,{active:J&&!!V?.blockId,position:V?.position,anchor:"--rich-drop-target"})]})})})})})},$="tcc:richtext-command",z=({cmd:e,arg:l,children:a,onClick:n,active:i=!1,styles:s={},tooltip:r=null,className:o="",disabled:d=!1,preserveCaret:c=!0,ref:u,"aria-label":m})=>{let h={type:"button",ref:u,"aria-label":m||("string"==typeof r?r:void 0),className:(0,E.classNames)("relative rounded ",i?"bg-tcc-base border border-primaryaccent-600":"bg-tcc-base","px-2 py-1 font-medium w-10 hover:bg-tcc-alt flex items-center justify-center",o,{"bg-tcc-altdark opacity-50":d}),style:s,onClick:t=>{(t.preventDefault(),n)?n(t):e&&(document.execCommand(e,!1,l),document.dispatchEvent(new CustomEvent($)))},onMouseDown:c?e=>e.preventDefault():void 0,disabled:d};return r?(0,t.jsx)(f.AdminToolTip,{content:r,children:(0,t.jsx)("button",{...h,children:a})}):(0,t.jsx)("button",{...h,children:a})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.