PageSourceSearch

https://edgemxtiming.com/assets/LandingPageBuilderPage-DWaKVQiV.js

js edgemxtiming.com collected 2026-10-02 01:30:11 UTC 18,032 bytes, 1 lines download raw bytes

1import{Z as me,r as p,j as e,_ as pe,B as N,b as Q,u as F,s as R,m as L,o as A,p as T,q as I,n as P,e as ge,i as ue,Y as he,l as xe,bh as fe}from"./index-Ct8eLu1I.js";import{D as be,c as je,S as ye,v as _e,d as ve}from"./sortable.esm-BtzrZVCe.js";import{u as Ne}from"./useContractGate-B-u-IG-p.js";import{S as U}from"./switch-BivgU5Jr.js";import{u as J}from"./useLandingPageFields-DXDks8YY.js";import{S as we,E as Ce,F as Se}from"./ElementPickerDialog-BNONH90Y.js";import{A as ke}from"./arrow-left-xu1INuH2.js";import{E as Fe}from"./eye-BX6Kc3UM.js";import{P as M}from"./plus-Dwixvwn_.js";import{C as Le}from"./CustomPageBuilder-PP6Z43ij.js";import{S as W}from"./skeleton-Bbz92LbC.js";import{T as Pe,a as Ee,b as G,c as Y}from"./tabs-BxjRtXE_.js";import{O as Be}from"./OrganizationBadge-5pjWJhs2.js";import{a as Ae,C as D,S as Te}from"./SetupWizard-IaKRIBAl.js";import{I as Ie}from"./image-B91W3doo.js";import{C as De}from"./calendar-days-DHySvoZM.js";import{S as Me}from"./sparkles-BqYnitDi.js";import{G as $e}from"./globe-Cc4mX4QA.js";import{L as We}from"./layout-dashboard-D8LWXH2Z.js";import{L as Ge}from"./layout-list-bcBh1cNM.js";import{W as Ye}from"./wand-sparkles-DfXyfbHp.js";import{H as qe}from"./house-BVsC_rqc.js";import{F as q}from"./file-text-DHRhOFvY.js";import"./useOrganizationContract-Bo4Bhwq2.js";import"./formImageStyles-B4p3kKKU.js";import"./sanitized-html-D_hDi9wu.js";import"./purify.es-C5KSVp3G.js";import"./checkbox-s2xEAdOA.js";import"./radio-group-C9ucw0LR.js";import"./inline-rich-text-editor-BJwpKsR-.js";import"./index-DvDyV3_k.js";import"./index-CJLyLLo7.js";import"./index-Dh4i1-J3.js";import"./underline-DzSBTR4Z.js";import"./list-ordered-D8sNfrla.js";import"./link-BavsN2MW.js";import"./unlink-Cfws_j2J.js";import"./EnduranceEntryField-xlmy_fFw.js";import"./teams-DBnJNHQ0.js";import"./BikeMakeBadge-CLPRnHpn.js";import"./useBikeMakeLogos-BM39csav.js";import"./bikeMakeStyle-RND07Se0.js";import"./users-YMaWm21U.js";import"./TeamSignupSection-Ca2hmmm0.js";import"./circle-alert-D7I9Hadn.js";import"./send-BmfKE8XA.js";import"./square-pen-CMzwsyoA.js";import"./copy-BLDCcnKG.js";import"./trash-2-LxvlgA12.js";import"./upload-BEA5_Dm0.js";import"./facebook-DyrCiiOy.js";import"./linkedin-DS5j75_D.js";import"./youtube-2shWwjb9.js";import"./textarea-ZX0L5GAv.js";import"./accordion-Bs0Mu6GB.js";import"./index-0rGuXlz0.js";import"./slider-7jwSdK_r.js";import"./ImageStudioDialog-BAMPr83x.js";import"./alert-dialog-C_VGpbHe.js";import"./scroll-area-XBOZYw_N.js";import"./popover-Dz6tNqoF.js";import"./type-BUNMsbJH.js";import"./square-Dj1m7lf5.js";import"./minus-CoO45ah2.js";import"./star-Fld3FsQo.js";import"./eye-off-D8k5J7Ic.js";import"./lock-DoxhL5bS.js";import"./lock-open-DrGa9BlT.js";import"./arrow-up-Di3GSD7x.js";import"./zoom-in-CyOAw4UX.js";import"./maximize-GPXI9VnQ.js";import"./eraser-Cj28LSL_.js";import"./save-BTwFz6YM.js";import"./palette-DPXSCY9R.js";import"./layers-DmHX825Z.js";import"./image-plus-CvAibaJ5.js";import"./external-link-Jsfrs_aE.js";import"./mail-BgXQiqCk.js";import"./phone-CEN_vm4h.js";import"./calendar-CbKSfKX5.js";import"./clock-B75jo-2Q.js";import"./map-pin-DUB0IYFr.js";import"./heart-CxFOlzMB.js";import"./share-DmzxqR6a.js";import"./play-ktVocCtn.js";import"./info-CsKlkfEH.js";import"./circle-help-CwDSlQnd.js";import"./trash-ChBAcH4p.js";import"./video-D_bIpV8P.js";import"./settings-BD4WVUAh.js";import"./search-BsvfnwMH.js";import"./credit-card-COtItE6V.js";import"./shopping-cart-Bqj-YZFe.js";import"./gift-C-KFjWTZ.js";import"./tag-C5ddNuVX.js";import"./trophy-Bwwh5BxN.js";import"./flag-BttTACQc.js";import"./bike-BIqava6h.js";import"./useTicketingEnabled-BHYJhIeX.js";import"./useTimingEnabled-Cvj4NnkE.js";import"./square-check-big-D-Ckz70G.js";import"./hash-BYELCNZI.js";import"./file-pen-line-YwOq1UbA.js";import"./shirt-yZVtQS9T.js";import"./file-check-D7f7QP0i.js";import"./square-plus-Bl_KURzR.js";import"./code-B3uDdoMW.js";import"./timer-BmWXyNuG.js";import"./shopping-bag-CTD0jp3M.js";import"./receipt-3pKGVuPA.js";import"./user-cog-dP_KiGsa.js";import"./shield-DH9kevRQ.js";import"./award-BLsrLjlR.js";import"./log-in-BUn-YFrb.js";import"./calendar-range-oVQrytng.js";import"./monitor-Chxxi-hB.js";import"./chart-column-CyZwS_ZC.js";import"./megaphone-EgNztnZk.js";import"./share-2-B_pwvqGV.js";import"./bell-Xgq8E1Rt.js";import"./useCustomPageFields-CjotJQo4.js";import"./building-2-BSn65gGt.js";import"./progress-CZ_7l-CT.js";import"./chevron-left-m_yK3qef.js";const H=["hero_section","testimonial","stats_counter","cta_banner","social_links","spacer","heading","paragraph","banner","image","image_gallery","video","button_link","facebook_plugins","divider","line_break","schedule","location","speakers"];function He(n){if(!n||!n.startsWith("#"))return .5;const a=n.replace("#",""),u=parseInt(a.substring(0,2),16)/255,m=parseInt(a.substring(2,4),16)/255,c=parseInt(a.substring(4,6),16)/255,l=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),g=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4),r=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return .2126*l+.7152*g+.0722*r}function Oe(n){return He(n)>.5?{fg:"#1a1a1a",muted:"#666666",cardBg:"rgba(255,255,255,0.95)",cardFg:"#1a1a1a"}:{fg:"#fafafa",muted:"#a3a3a3",cardBg:"rgba(255,255,255,0.95)",cardFg:"#1a1a1a"}}function Ke({organization:n,onBack:a,hideBackButton:u}){const m=me(),{fields:c,formFields:l,isLoading:g,addField:r,updateField:j,deleteField:f,reorderFields:i,duplicateField:h}=J(n.id),[d,w]=p.useState(null),[E,_]=p.useState(!1),[C,v]=p.useState(null),[o,x]=p.useState(n.landing_page_enabled??!1),[S,B]=p.useState(!1),{canPublish:V}=Ne(),Z=p.useMemo(()=>{const t=n.secondary_color,s=n.primary_color,b=n.accent_color;if(!t)return{};const y=Oe(t);return{"--org-content-bg":t,"--org-content-fg":y.fg,"--org-content-muted":y.muted,"--org-card-bg":y.cardBg,"--org-card-fg":y.cardFg,"--org-primary":s||"#3b82f6","--org-accent":b||s||"#3b82f6",backgroundColor:t,color:y.fg}},[n.secondary_color,n.primary_color,n.accent_color]),X=async t=>{if(t&&!V){F.error("Please sign the service agreement before enabling the landing page");return}B(!0);try{const{error:s}=await R.from("organizations").update({landing_page_enabled:t}).eq("id",n.id);if(s)throw s;
1x(t),m.invalidateQueries({queryKey:["organization-details"]}),F.success(t?"Landing page enabled":"Landing page disabled")}catch(s){F.error("Failed to update: "+s.message)}finally{B(!1)}},z=(t,s)=>{if(!H.includes(t)){F.error("This field type is not available for landing pages");return}r.mutate({organization_id:n.id,field_type:t,label:s||te(t),width:"full",...C!==null&&{field_order:C}}),_(!1),v(null)},ee=t=>{v(t.field_order+1),_(!0)},$=()=>{v(null),_(!0)},te=t=>({hero_section:"Welcome to Our Event",testimonial:"",stats_counter:"",cta_banner:"",social_links:"",spacer:"",heading:"New Heading",paragraph:"New paragraph text",banner:"",image:"",video:"",button_link:"Click Here",divider:"",line_break:"",image_gallery:"",schedule:"",location:"",speakers:""})[t]||"",se=t=>{w(t)},ae=t=>{if(!d)return;let s=t.options;["hero_section","testimonial","stats_counter","cta_banner","social_links","spacer"].includes(d.field_type)?s=t.options||t.hero_options:d.field_type==="button_link"&&t.button_styles?s=t.button_styles:d.field_type==="video"&&t.placeholder?s={videoUrl:t.placeholder}:d.field_type==="location"&&t.placeholder?s={address:t.placeholder}:d.field_type==="facebook_plugins"&&t.placeholder,j.mutate({id:d.id,updates:{label:t.label,help_text:d.field_type==="facebook_plugins"&&t.placeholder||t.help_text,image_url:t.image_url,image_styles:t.image_styles,options:s,heading_styles:t.heading_styles,divider_styles:t.divider_styles,label_styles:t.label_styles,help_text_styles:t.help_text_styles,text_color:t.text_color,width:t.width}}),w(null)},ie=t=>{f.mutate(t.id)},re=t=>{const s=c.find(b=>b.id===t.id);s&&h.mutate({id:s.id,organization_id:n.id,field_type:s.field_type,field_order:s.field_order,label:s.label,help_text:s.help_text,image_url:s.image_url,image_styles:s.image_styles,options:s.options,heading_styles:s.heading_styles,divider_styles:s.divider_styles,label_styles:s.label_styles,help_text_styles:s.help_text_styles,text_color:s.text_color,width:s.width,created_at:s.created_at,updated_at:s.updated_at})},ne=t=>{const{active:s,over:b}=t;if(!b||s.id===b.id)return;const y=l.findIndex(k=>k.id===s.id),le=l.findIndex(k=>k.id===b.id),de=ve(l,y,le).map((k,ce)=>({id:k.id,field_order:ce}));i.mutate(de)},oe=()=>{window.open(`/org/${n.slug}/main`,"_blank")};return g?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(pe,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-6","data-tour":"page-builder-container",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[!u&&e.jsx(N,{variant:"ghost",size:"icon",onClick:a,children:e.jsx(ke,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex items-center gap-4","data-tour":"page-builder-title",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-2xl text-foreground",children:"Main Page Builder"}),e.jsx("p",{className:"text-muted-foreground",children:n.name})]}),e.jsxs("div",{className:"flex items-center gap-2","data-tour":"page-builder-toggle",children:[e.jsx(U,{id:"landing-enabled",checked:o,onCheckedChange:X,disabled:S}),e.jsx(Q,{htmlFor:"landing-enabled",className:"text-sm",children:o?"Enabled":"Disabled"})]})]})]}),e.jsxs(N,{variant:"outline",onClick:oe,children:[e.jsx(Fe,{className:"h-4 w-4 mr-2"}),"Preview"]})]}),e.jsxs("div",{className:"grid lg:grid-cols-[280px_1fr] gap-6",children:[e.jsx("div",{className:"space-y-4","data-tour":"page-builder-add-element",children:e.jsxs(N,{onClick:$,className:"w-full",children:[e.jsx(M,{className:"h-4 w-4 mr-2"}),"Add Element"]})}),e.jsx("div",{"data-tour":"page-builder-preview",className:`rounded-lg border p-6 ${n.secondary_color?"org-branded-content":"bg-card"}`,style:Z,children:l.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx("p",{className:"mb-4",children:"No elements added yet"}),e.jsxs(N,{variant:"outline",onClick:$,children:[e.jsx(M,{className:"h-4 w-4 mr-2"}),"Add Your First Element"]})]}):e.jsx(be,{collisionDetection:je,onDragEnd:ne,children:e.jsx(ye,{items:l.map(t=>
1t.id),strategy:_e,children:e.jsx("div",{className:"grid grid-cols-12 gap-4",children:l.map((t,s)=>e.jsx(we,{field:t,onEdit:se,onDelete:ie,onDuplicate:re,onAddAfter:ee,isFirst:s===0,isLast:s===l.length-1},t.id))})})})})]}),e.jsx(Ce,{isOpen:E,onClose:()=>{_(!1),v(null)},onSelect:z,allowedTypes:H}),e.jsx(Se,{field:d,allFields:l,isOpen:!!d,onClose:()=>w(null),onSave:ae})]})}const O=[{id:"start",title:"Starting Point"},{id:"sections",title:"Key Sections"},{id:"finish",title:"Finish"}],K=[{id:"hero",label:"Hero Banner",description:"Large banner image at the top of the page",defaultOn:!0},{id:"events",label:"Upcoming Events",description:"Auto-generated list of published events",defaultOn:!0},{id:"cta",label:"Call to Action",description:"A prominent button or banner linking to registration",defaultOn:!0},{id:"about",label:"About Section",description:"Text section describing your organization",defaultOn:!1},{id:"social",label:"Social Links",description:"Facebook, Instagram, YouTube embeds",defaultOn:!1}];function Qe({orgName:n,onComplete:a,onSkip:u}){const[m,c]=p.useState(0),[l,g]=p.useState(null),[r,j]=p.useState(Object.fromEntries(K.map(i=>[i.id,i.defaultOn]))),f=()=>{const i=Object.entries(r).filter(([,h])=>h).map(([h])=>h);a(i)};return e.jsxs(Ae,{steps:O,activeStep:m,onNext:()=>c(i=>Math.min(i+1,O.length-1)),onBack:()=>c(i=>Math.max(i-1,0)),onStepClick:i=>c(i),onFinish:f,finishLabel:"Create Landing Page",children:[m===0&&e.jsxs(L,{children:[e.jsxs(A,{children:[e.jsx(T,{children:"How would you like to start?"}),e.jsxs(I,{children:['Choose a starting layout for your "',n,'" landing page']})]}),e.jsxs(P,{className:"space-y-3",children:[e.jsx(D,{icon:e.jsx(Ie,{className:"h-5 w-5"}),label:"Start with a hero banner",description:"Begin with a large banner image followed by event listings",selected:l==="hero",onClick:()=>{g("hero"),j(i=>({...i,hero:!0}))}}),e.jsx(D,{icon:e.jsx(De,{className:"h-5 w-5"}),label:"Start with event list",description:"Jump straight into showing upcoming events",selected:l==="events",onClick:()=>{g("events"),j(i=>({...i,hero:!1,events:!0}))}}),e.jsx(D,{icon:e.jsx(Te,{className:"h-5 w-5"}),label:"Skip — open blank editor",description:"Go directly to the drag-and-drop editor",selected:!1,onClick:u})]})]}),m===1&&e.jsxs(L,{children:[e.jsxs(A,{children:[e.jsx(T,{children:"Key Sections"}),e.jsx(I,{children:"Select which sections to include on your landing page. You can add more later."})]}),e.jsx(P,{className:"space-y-3",children:K.map(i=>e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-border last:border-0",children:[e.jsxs("div",{children:[e.jsx(Q,{htmlFor:`sec-${i.id}`,className:"cursor-pointer font-medium",children:i.label}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i.description})]}),e.jsx(U,{id:`sec-${i.id}`,checked:r[i.id]||!1,onCheckedChange:h=>j(d=>({...d,[i.id]:h}))})]},i.id))})]}),m===2&&e.jsxs(L,{children:[e.jsxs(A,{children:[e.jsx(T,{children:"Ready to Build"}),e.jsx(I,{children:"Your landing page structure is set up"})]}),e.jsx(P,{children:e.jsxs("div",{className:"bg-muted/50 rounded-lg p-6 text-center space-y-2",children:[e.jsx(Me,{className:"h-8 w-8 mx-auto text-primary"}),e.jsx("p",{className:"font-medium",children:"Landing page ready!"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:'Click "Create Landing Page" to generate your page with the selected sections. You can then customize everything in the drag-and-drop editor.'})]})})]})]})}const ca=()=>{ge();const n=ue(),{currentOrganization:a,isLoading:u}=he(),[m,c]=p.useState("landing-page"),[l,g]=p.useState(null),{data:r,isLoading:j}=xe({queryKey:["organization-details",a==null?void 0:a.id],queryFn:async()=>{if(!(a!=null&&a.id))return null;const{data:o,error:x}=await R.from("organizations").select("*").eq("id",a.id).maybeSingle();if(x)throw x;return o},enabled:!!(a!=null&&a.id)}),{fields:f}=J(a==null?void 0:a.id),{pages:i,isLoading:h,createPage:d}=fe(a==null?void 0:a.id);p.useEffect(()=>{l===null&&f!==void 0&&g(Array.isArray(f)&&f.length===0)},[f,l]);const w=u||j||h,E=(r==null?void 0:r.max_custom_pages)??4,_=(r==null?void 0:r.slug)||"",C=Array.from({length:E},(o,x)=>{const S=i[x];return{index:x+1,page:S||null}}),v=async o=>{if(!(a!=null&&a.id))return;const x=`Custom Page ${o}`,S=`page-${o}`;try{await d.mutateAsync({organization_id:a.id,title:x,slug:S}),c(`custom-page-${o}`)}catch{}};return w?e.jsx(e.Fragment,{children:e.jsx("section",{className:"py-8 bg-background min-h-screen",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx(W,{className:"h-10 w-64 mb-6"}),e.jsx(W,{className:"h-96 w-full"})]})})}):r?e.jsx(e.Fragment,{children:e.jsx("section",{className:"py-8 bg-background min-h-screen",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("div",{className:"flex flex-col gap-4 mb-6",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(We,{className:"h-8 w-8 text-primary flex-shrink-0"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("h1",{className:"font-display text-3xl md:text-4xl text-foreground",children:"WEBSITE PAGES"}),e.jsx(Be,{className:"hidden sm:flex"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your main page and custom pages"})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(N,{variant:"outline",size:"sm",onClick:()=>g(!l),className:"gap-2",children:l?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"h-4 w-4"})," Manual Mode"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ye,{className:"h-4 w-4"})," Guided Setup"]})})})]})}),e.jsxs(Pe,{value:m,onValueChange:c,className:"w-full",children:[e.jsxs(Ee,{className:"mb-6 flex-wrap h-auto gap-1","data-tour":"page-builder
1-page-tabs",children:[e.jsxs(G,{value:"landing-page",className:"gap-2",children:[e.jsx(qe,{className:"h-4 w-4"}),"Main Page"]}),C.map(o=>e.jsxs(G,{value:`custom-page-${o.index}`,className:"gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),o.page?o.page.title:`Page ${o.index}`,!o.page&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"(Empty)"})]},o.index))]}),e.jsx(Y,{value:"landing-page",children:l?e.jsx(Qe,{orgName:r.name,onComplete:()=>g(!1),onSkip:()=>g(!1)}):e.jsx(Ke,{organization:r,onBack:()=>n("/admin"),hideBackButton:!0})}),C.map(o=>e.jsx(Y,{value:`custom-page-${o.index}`,children:o.page?e.jsx(Le,{page:o.page,orgSlug:_,orgBranding:{primary_color:r==null?void 0:r.primary_color,secondary_color:r==null?void 0:r.secondary_color,accent_color:r==null?void 0:r.accent_color},onBack:()=>c("landing-page"),hideBackButton:!0}):e.jsx(L,{className:"border-dashed",children:e.jsxs(P,{className:"flex flex-col items-center justify-center py-16",children:[e.jsx(q,{className:"h-16 w-16 text-muted-foreground/50 mb-4"}),e.jsxs("h3",{className:"text-lg font-medium mb-2",children:["Custom Page ",o.index]}),e.jsx("p",{className:"text-muted-foreground text-center mb-6 max-w-md",children:"This page slot is available. Create a new page to add content that will appear in your site navigation."}),e.jsxs(N,{onClick:()=>v(o.index),disabled:d.isPending,children:[e.jsx(M,{className:"h-4 w-4 mr-2"}),"Create Page ",o.index]})]})})},o.index))]})]})})}):e.jsx(e.Fragment,{children:e.jsx("section",{className:"py-8 bg-background min-h-screen",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx($e,{className:"h-12 w-12 mx-auto mb-4"}),e.jsx("p",{children:"You are not associated with any organization."})]})})})})};export{ca as default};

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.