@apollosproject/canvas-embeds 2.1.1349 → 2.1.1350

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/widget/index.js CHANGED
@@ -442,7 +442,7 @@ Valid keys: `+JSON.stringify(Object.keys(Y),null," "));var q=C0(r0,b0,_0,u0,W0+
442
442
  ...FeatureActionButtonFragment
443
443
  }
444
444
  }
445
- `);const Ld=({text:a="Open the app",url:t=""})=>{const n=t.startsWith("http://")||t.startsWith("https://");return P.jsx(Q2,{...n?{href:t}:{to:t},surface:"solid",children:a})},Fq0=({src:a,srcDark:t,alt:n})=>P.jsx("div",{className:"flex space-x-2 items-center",children:a?P.jsxs(P.Fragment,{children:[P.jsx("img",{src:a,alt:n,className:"h-6 w-auto dark:hidden"}),P.jsx("img",{src:t,alt:n,className:"h-6 w-auto hidden dark:block"})]}):P.jsx(n2,{as:"h3",children:n})}),Sq0=({church:a,url:t=""})=>P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(Fq0,{src:a.wordmarkLightUrl,srcDark:a.wordmarkDarkUrl}),P.jsx("div",{children:"Continue this experience in the app"}),P.jsx(Ld,{url:t})]}),P.jsx("div",{className:"flex shrink"})]}),Lq0=({hasComments:a=!1,url:t=""})=>P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(im0,{size:40,className:"text-action"}),a?P.jsx("div",{children:"Join the conversation in the app"}):P.jsx("div",{children:"Be the first to comment"}),P.jsx(Ld,{url:t})]}),P.jsx("div",{className:"flex shrink"})]}),kq0=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),dS=e.forwardRef((a,t)=>e.createElement(V,{ref:t,...a,weights:kq0}));dS.displayName="QuestionIcon";const uS=dS,_q0=Object.freeze(Object.defineProperty({__proto__:null,Question:uS,QuestionIcon:dS},Symbol.toStringTag,{value:"Module"})),wq0=({url:a=""})=>P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(uS,{size:40,className:"text-action"}),P.jsx("div",{children:"Answer this question in the app"}),P.jsx(Ld,{url:a})]}),P.jsx("div",{className:"flex shrink"})]});var Ht=(a=>(a[a.Comment=0]="Comment",a[a.Default=1]="Default",a[a.Like=2]="Like",a[a.Question=3]="Question",a[a.Success=4]="Success",a))(Ht||{});const Cq0=({hasLikes:a=!1,url:t=""})=>P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(bv,{size:40,className:"text-action"}),a?P.jsx("div",{children:"Like this in the app"}):P.jsx("div",{children:"Be the first to like"}),P.jsx(Ld,{url:t})]}),P.jsx("div",{className:"flex shrink"})]}),Nq0=a=>/^https?:\/\/(localhost)(:\d+)?|(localhost)(:\d+)?|^https?:\/\/(192.\d.\d.\d)(:\d+)?|(192.\d.\d.\d)(:\d+)?/.test(a);function Tq0(a){return a.replace(/-/g,"_")}const Pq0=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),pS=e.forwardRef((a,t)=>e.createElement(V,{ref:t,...a,weights:Pq0}));pS.displayName="CheckCircleIcon";const hS=pS,Oq0=Object.freeze(Object.defineProperty({__proto__:null,CheckCircle:hS,CheckCircleIcon:pS},Symbol.toStringTag,{value:"Module"})),Iq0=(a,t=!0,n)=>{const r=e.useRef(a);e.useEffect(()=>{r.current=a},[a]),e.useEffect(()=>{if(!t)return;const l=i=>{i.key==="Enter"&&r.current()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,n])},$q0=({onClose:a,message:t,showAppButtons:n=!1,appUrl:r=""})=>(Iq0(a),P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(hS,{size:40,className:"text-action"}),P.jsx("div",{className:"text-center",children:P.jsx(n2,{as:"h1",className:"text-2xl font-semibold mb-2",children:"Success!"})}),P.jsx("div",{className:"text-center max-w-sm",children:P.jsx(n2,{className:"text-fg-secondary dark:text-fg-secondary-dark",children:t})}),n&&r&&P.jsx("div",{className:"flex flex-col gap-3 w-full max-w-xs",children:P.jsx(Ld,{text:"Open the App",url:r})})]}),P.jsx("div",{className:"flex shrink"})]})),jq0=({church:a,currentPageParams:t,url:n,isInteractionEnabled:r})=>{if(!ml(n))return n;if(r===!1||!r&&(!a||!a.universalLinkHost))return"";if(a?.universalLinkHost){let l=a.universalLinkHost;l.startsWith("http")||(l=Nq0(l)?`http://${l}`:`https://${l}`);const i=t.handle?Tq0(t.handle):null,o=i?`?church=${encodeURIComponent(i)}`:"";if(!ml(t.contentId))return`${l}/app-link/content/${t.contentId.replace("Item-","Item:")}${o}`;if(!ml(t.eventId))return`${l}/app-link/e/${t.eventId.replace("Event-","Event:")}${o}`;if(!ml(t.feedId))return`${l}/app-link/f/${t.feedId.replace("Feed-","Feed:")}${o}`}return""},fS=({church:a,currentPageParams:t,hasComments:n=!1,hasLikes:r=!1,isOpen:l=!1,setIsOpen:i=Zd,type:o=Ht.Default,url:c="",message:m,isInteractionEnabled:u,theme:h})=>{let f=null;const v=jq0({church:a,currentPageParams:t,url:c,isInteractionEnabled:u});switch(o){case Ht.Comment:f=P.jsx(Lq0,{hasComments:n,url:v});break;case Ht.Like:f=P.jsx(Cq0,{hasLikes:r,url:v});break;case Ht.Question:f=P.jsx(wq0,{url:v});break;case Ht.Success:f=P.jsx($q0,{onClose:()=>i(!1),message:m,showAppButtons:v.length>0,appUrl:v});break;case Ht.Default:default:f=P.jsx(Sq0,{church:a,url:v});break}return P.jsx(QB0,{isOpen:l,setIsOpen:i,theme:h,children:f})};function AS(a){const t=a.split("/").filter(Boolean);return t.length>0?t[0]:null}function Gm0(a,t,n){const r=new URL(t,window.location.origin);return r.searchParams.set("pendingAction",n.type),n.type==="pollVote"?(r.searchParams.set("pollId",n.pollId),r.searchParams.set("optionIds",btoa(JSON.stringify(n.optionIds)))):n.type==="connect"&&(r.searchParams.set("featureId",n.featureId),r.searchParams.set("tagIds",btoa(JSON.stringify(n.tagIds)))),`/${a}/auth/login?redirectTo=${encodeURIComponent(r.pathname+r.search)}`}const xq0=({feature:a,currentChurch:t,userProfile:n,showSuccessModal:r=!1})=>{const l=kU0(),[i,o]=e.useState(!1);e.useEffect(()=>{r&&o(!0)},[r]);try{if(!a)return console.error("ConnectButtonFeature: No feature data provided"),P.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:P.jsx("div",{className:"text-red-500",children:"Error: No feature data"})});const c=a.title||"Register",m=a.confirmationMessage||"",u=Array.isArray(a.tags)?a.tags.filter(f=>f!=null):[],h=()=>{if(ml(n?.id)){const f=window.location.pathname,v=AS(f);if(!v){console.error("ConnectButtonFeature: No handle found in path");return}const Z=Gm0(v,f,{type:"connect",tagIds:u,featureId:a.id});window.location.href=Z}else{const f=new FormData;if(f.append("_action","connectButton"),fetch(window.location.pathname,{method:"POST",body:f}).catch(Z=>{console.error("ConnectButtonFeature: connect button action failed",Z)}),o(!0),!ml(u))try{const Z=l?.({personId:n.id,tagIds:u});Promise.resolve(Z).catch(H=>{console.error("ConnectButtonFeature: addPersonTagAssociation failed",H)})}catch(Z){console.error("ConnectButtonFeature: addPersonTagAssociation threw",Z)}}};return P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:P.jsx("div",{className:"max-w-md mx-auto",children:P.jsx(Q2,{surface:"solid",className:"w-full",onClick:h,children:c})})}),P.jsx(fS,{type:Ht.Success,currentPageParams:{},isOpen:i,setIsOpen:o,church:t,message:m})]})}catch(c){return console.error("Error rendering ConnectButtonFeature:",c),P.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:P.jsx("div",{className:"text-red-500",children:"Error rendering Connect Button"})})}};Xe(`
445
+ `);const Ld=({text:a="Open the app",url:t=""})=>{const n=t.startsWith("http://")||t.startsWith("https://");return P.jsx(Q2,{...n?{href:t}:{to:t},surface:"solid",children:a})},Fq0=({src:a,srcDark:t,alt:n})=>P.jsx("div",{className:"flex space-x-2 items-center",children:a?P.jsxs(P.Fragment,{children:[P.jsx("img",{src:a,alt:n,className:"h-6 w-auto object-contain shrink-0 dark:hidden"}),P.jsx("img",{src:t,alt:n,className:"h-6 w-auto object-contain shrink-0 hidden dark:block"})]}):P.jsx(n2,{as:"h3",children:n})}),Sq0=({church:a,url:t=""})=>P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(Fq0,{src:a.wordmarkLightUrl,srcDark:a.wordmarkDarkUrl}),P.jsx("div",{children:"Continue this experience in the app"}),P.jsx(Ld,{url:t})]}),P.jsx("div",{className:"flex shrink"})]}),Lq0=({hasComments:a=!1,url:t=""})=>P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(im0,{size:40,className:"text-action"}),a?P.jsx("div",{children:"Join the conversation in the app"}):P.jsx("div",{children:"Be the first to comment"}),P.jsx(Ld,{url:t})]}),P.jsx("div",{className:"flex shrink"})]}),kq0=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),dS=e.forwardRef((a,t)=>e.createElement(V,{ref:t,...a,weights:kq0}));dS.displayName="QuestionIcon";const uS=dS,_q0=Object.freeze(Object.defineProperty({__proto__:null,Question:uS,QuestionIcon:dS},Symbol.toStringTag,{value:"Module"})),wq0=({url:a=""})=>P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(uS,{size:40,className:"text-action"}),P.jsx("div",{children:"Answer this question in the app"}),P.jsx(Ld,{url:a})]}),P.jsx("div",{className:"flex shrink"})]});var Ht=(a=>(a[a.Comment=0]="Comment",a[a.Default=1]="Default",a[a.Like=2]="Like",a[a.Question=3]="Question",a[a.Success=4]="Success",a))(Ht||{});const Cq0=({hasLikes:a=!1,url:t=""})=>P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(bv,{size:40,className:"text-action"}),a?P.jsx("div",{children:"Like this in the app"}):P.jsx("div",{children:"Be the first to like"}),P.jsx(Ld,{url:t})]}),P.jsx("div",{className:"flex shrink"})]}),Nq0=a=>/^https?:\/\/(localhost)(:\d+)?|(localhost)(:\d+)?|^https?:\/\/(192.\d.\d.\d)(:\d+)?|(192.\d.\d.\d)(:\d+)?/.test(a);function Tq0(a){return a.replace(/-/g,"_")}const Pq0=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),pS=e.forwardRef((a,t)=>e.createElement(V,{ref:t,...a,weights:Pq0}));pS.displayName="CheckCircleIcon";const hS=pS,Oq0=Object.freeze(Object.defineProperty({__proto__:null,CheckCircle:hS,CheckCircleIcon:pS},Symbol.toStringTag,{value:"Module"})),Iq0=(a,t=!0,n)=>{const r=e.useRef(a);e.useEffect(()=>{r.current=a},[a]),e.useEffect(()=>{if(!t)return;const l=i=>{i.key==="Enter"&&r.current()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,n])},$q0=({onClose:a,message:t,showAppButtons:n=!1,appUrl:r=""})=>(Iq0(a),P.jsxs("div",{className:"flex flex-col justify-between h-full items-center -mt-8",children:[P.jsx("div",{className:"flex shrink"}),P.jsxs("div",{className:"flex flex-col justify-between items-center gap-y-8",children:[P.jsx(hS,{size:40,className:"text-action"}),P.jsx("div",{className:"text-center",children:P.jsx(n2,{as:"h1",className:"text-2xl font-semibold mb-2",children:"Success!"})}),P.jsx("div",{className:"text-center max-w-sm",children:P.jsx(n2,{className:"text-fg-secondary dark:text-fg-secondary-dark",children:t})}),n&&r&&P.jsx("div",{className:"flex flex-col gap-3 w-full max-w-xs",children:P.jsx(Ld,{text:"Open the App",url:r})})]}),P.jsx("div",{className:"flex shrink"})]})),jq0=({church:a,currentPageParams:t,url:n,isInteractionEnabled:r})=>{if(!ml(n))return n;if(r===!1||!r&&(!a||!a.universalLinkHost))return"";if(a?.universalLinkHost){let l=a.universalLinkHost;l.startsWith("http")||(l=Nq0(l)?`http://${l}`:`https://${l}`);const i=t.handle?Tq0(t.handle):null,o=i?`?church=${encodeURIComponent(i)}`:"";if(!ml(t.contentId))return`${l}/app-link/content/${t.contentId.replace("Item-","Item:")}${o}`;if(!ml(t.eventId))return`${l}/app-link/e/${t.eventId.replace("Event-","Event:")}${o}`;if(!ml(t.feedId))return`${l}/app-link/f/${t.feedId.replace("Feed-","Feed:")}${o}`}return""},fS=({church:a,currentPageParams:t,hasComments:n=!1,hasLikes:r=!1,isOpen:l=!1,setIsOpen:i=Zd,type:o=Ht.Default,url:c="",message:m,isInteractionEnabled:u,theme:h})=>{let f=null;const v=jq0({church:a,currentPageParams:t,url:c,isInteractionEnabled:u});switch(o){case Ht.Comment:f=P.jsx(Lq0,{hasComments:n,url:v});break;case Ht.Like:f=P.jsx(Cq0,{hasLikes:r,url:v});break;case Ht.Question:f=P.jsx(wq0,{url:v});break;case Ht.Success:f=P.jsx($q0,{onClose:()=>i(!1),message:m,showAppButtons:v.length>0,appUrl:v});break;case Ht.Default:default:f=P.jsx(Sq0,{church:a,url:v});break}return P.jsx(QB0,{isOpen:l,setIsOpen:i,theme:h,children:f})};function AS(a){const t=a.split("/").filter(Boolean);return t.length>0?t[0]:null}function Gm0(a,t,n){const r=new URL(t,window.location.origin);return r.searchParams.set("pendingAction",n.type),n.type==="pollVote"?(r.searchParams.set("pollId",n.pollId),r.searchParams.set("optionIds",btoa(JSON.stringify(n.optionIds)))):n.type==="connect"&&(r.searchParams.set("featureId",n.featureId),r.searchParams.set("tagIds",btoa(JSON.stringify(n.tagIds)))),`/${a}/auth/login?redirectTo=${encodeURIComponent(r.pathname+r.search)}`}const xq0=({feature:a,currentChurch:t,userProfile:n,showSuccessModal:r=!1})=>{const l=kU0(),[i,o]=e.useState(!1);e.useEffect(()=>{r&&o(!0)},[r]);try{if(!a)return console.error("ConnectButtonFeature: No feature data provided"),P.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:P.jsx("div",{className:"text-red-500",children:"Error: No feature data"})});const c=a.title||"Register",m=a.confirmationMessage||"",u=Array.isArray(a.tags)?a.tags.filter(f=>f!=null):[],h=()=>{if(ml(n?.id)){const f=window.location.pathname,v=AS(f);if(!v){console.error("ConnectButtonFeature: No handle found in path");return}const Z=Gm0(v,f,{type:"connect",tagIds:u,featureId:a.id});window.location.href=Z}else{const f=new FormData;if(f.append("_action","connectButton"),fetch(window.location.pathname,{method:"POST",body:f}).catch(Z=>{console.error("ConnectButtonFeature: connect button action failed",Z)}),o(!0),!ml(u))try{const Z=l?.({personId:n.id,tagIds:u});Promise.resolve(Z).catch(H=>{console.error("ConnectButtonFeature: addPersonTagAssociation failed",H)})}catch(Z){console.error("ConnectButtonFeature: addPersonTagAssociation threw",Z)}}};return P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:P.jsx("div",{className:"max-w-md mx-auto",children:P.jsx(Q2,{surface:"solid",className:"w-full",onClick:h,children:c})})}),P.jsx(fS,{type:Ht.Success,currentPageParams:{},isOpen:i,setIsOpen:o,church:t,message:m})]})}catch(c){return console.error("Error rendering ConnectButtonFeature:",c),P.jsx("div",{className:"connect-button-container text-center mt-8 mb-10",children:P.jsx("div",{className:"text-red-500",children:"Error rendering Connect Button"})})}};Xe(`
446
446
  fragment ConnectButtonFeatureFragment on ConnectButtonFeature {
447
447
  id
448
448
  title