1import{u as ve,r as o,j as e,b as v,H as Ze,L as Ne}from"./app-DP13319Q.js";import{D as Ke}from"./DraggableMenu-Bk7Spryo.js";import"./model-viewer-BNdxy5m2.js";import{F as f,h as Pe,c as We,aH as Xe,ax as ke,al as Qe,a as Se,k as se}from"./index-CtyZ6W6U.js";import{l as Ge}from"./index.module-D1uRunsO.js";import{M as Je}from"./react-tooltip.min-DW3XhwOj.js";import{E as et,l as tt,u as at,a as st,P as ot}from"./react-stripe.esm-D6Ettci4.js";/* empty css */import"./index-DQkUn08L.js";const rt=tt("pk_live_51IyCo8Dpr0bpQPac24tix9UpShzoMw1uWsW3JvzcMrKVFnvUsXAnvBknJSPYucZCYSLT4Z0UVBeKx49jlYakdjIw00coa3YVdn"),lt=({price:$,email:A,clientSecret:oe,onSuccess:Z,onBack:s,onError:V})=>{const z=at(),I=st(),[g,m]=o.useState(!1),[H,p]=o.useState(""),[U,re]=o.useState(!1),L=async K=>{if(K.preventDefault(),p(""),!z||!I){p("Payment system not ready. Please try again.");return}m(!0);try{const{error:N}=await I.submit();if(N){console.error("Payment form validation failed:",N),p(N.message||"Payment form validation failed");return}console.log("Payment form validated successfully");const{error:S,paymentIntent:_}=await z.confirmPayment({elements:I,confirmParams:{return_url:`${window.location.origin}/payment-success`,receipt_email:A,payment_method_data:{billing_details:{email:A}}},clientSecret:oe,redirect:"if_required"});if(console.log("Payment confirmation result:",{stripeError:S,paymentIntent:_}),S){console.error("Stripe payment error:",S),p(S.message||"Payment failed");return}if(!_){console.error("No payment intent returned"),p("Payment processing failed. No payment intent received.");return}switch(console.log("Payment intent status:",_.status),_.status){case"succeeded":console.log("Payment succeeded!"),Z();break;case"requires_action":console.log("Payment requires additional action"),p("Payment requires additional authentication. Please complete the verification.");break;case"processing":console.log("Payment processing"),p("Payment is processing. Please wait for confirmation.");break;case"requires_payment_method":case"canceled":case"requires_confirmation":default:console.error("Payment failed with status:",_.status),p(`Payment failed. Status: ${_.status}`)}}catch(N){console.error("Unexpected error during payment processing:",N);const S=N instanceof Error?N.message:"Payment processing failed. Please try again.";p(S)}finally{m(!1)}};return e.jsxs("form",{onSubmit:L,children:[H&&e.jsxs("div",{className:"mb-4 p-3 bg-red-500/90 text-white rounded-lg flex items-center gap-2",children:[e.jsx(f,{icon:Se}),H]}),e.jsxs("div",{className:"mt-4 text-sm text-gray-300",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{children:"Email:"}),e.jsx("span",{className:"text-yellow-400",children:A})]}),e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{children:"Amount:"}),e.jsxs("span",{className:"text-yellow-400",children:["US$",$.toFixed(2)]})]})]}),e.jsx("div",{className:"mt-6 space-y-4",children:e.jsx(ot,{options:{layout:"tabs",fields:{billingDetails:{email:"auto"}}},onReady:()=>re(!0)})}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{type:"submit",disabled:g||!z||!U,className:`w-full bg-yellow-400 text-black font-bold py-3 px-4 rounded-full hover:bg-yellow-500 transition-colors ${g||!z||!U?"opacity-70 cursor-not-allowed":""}`,"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Confirm and pay",children:g?e.jsxs(e.Fragment,{children:[e.jsx(f,{icon:se,className:"animate-spin mr-2"}),"Processing..."]}):`Pay US${$.toFixed(2)}`})}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("button",{type:"button",onClick:s,className:"text-sm text-yellow-400 hover:underline","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Go back to the previous step",children:"Back to email"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Payment secured by STRIPE. You'll be redirected after payment."})]})]})};function ft(){var we;const $=ve().props;o.useRef(null);const[A,oe]=o.useState(!0),{auth:Z,template:s,initialFunnels:V,domains:z,tokenInfo:I,promoprice:g}
1=ve().props,m=(I==null?void 0:I.current_price)||1,[H,p]=o.useState([]),[U,re]=o.useState(""),[L,K]=o.useState("fuzzy"),[N,S]=o.useState(1),[_,W]=o.useState(!0),[X,Q]=o.useState(!1),[R,i]=o.useState(""),[ue,q]=o.useState(""),[h,le]=o.useState(null),[b,G]=o.useState(""),[y,B]=o.useState("ez.wiki"),[Ce,J]=o.useState(!1),[me]=Ge(b,500),[F,ie]=o.useState({checking:!1,available:null,message:""}),[E,pe]=o.useState("bee"),[a,w]=o.useState({show:!1,charCount:0,price:0,promoPrice:g||0,handle:"",domain:y,couponCode:"",buyingPrice:g||0,sellingPrice:0}),[he,ze]=o.useState(""),[_e,ne]=o.useState(!1),[Fe,ee]=o.useState(1),[ce,xe]=o.useState(""),[Ee,ge]=o.useState(""),[it,fe]=o.useState(0),[D,$e]=o.useState(((we=Z.user)==null?void 0:we.email)||""),[O,te]=o.useState(!1),be=o.useCallback(t=>{try{return new URL(t),!0}catch{return!1}},[]),Y=o.useCallback(t=>{var c;return(c=t.split("?")[0].split(".").pop())==null?void 0:c.toLowerCase()},[]),de=o.useCallback(t=>t?["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"].includes(t):!1,[]),Ie=o.useMemo(()=>s!=null&&s.image&&de(Y(s.image))?e.jsx("style",{children:` 2 .blur-bg { 3 background: url('${s.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${s.image}') no-repeat center center; 4 background-size: cover; 5 } 6 `}):null,[s,Y,de]);o.useEffect(()=>{if(s!=null&&s.image){const t=new Blob([s.image],{type:"text/html"}),r=URL.createObjectURL(t);return ze(r),()=>{URL.revokeObjectURL(r)}}},[s]),o.useEffect(()=>{if(s!=null&&s.image.includes("facebook.com")||s!=null&&s.image.includes("fb.watch")){const t=document.createElement("script");return t.src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0",t.async=!0,t.defer=!0,t.crossOrigin="anonymous",document.body.appendChild(t),()=>{document.body.removeChild(t)}}},[s]),o.useEffect(()=>{$.initialFunnels&&(p($.initialFunnels.data),W($.initialFunnels.next_page_url!==null))},[$.initialFunnels]),o.useEffect(()=>{V&&(p(V.data),W(V.next_page_url!==null))},[V]),o.useEffect(()=>{if(a.couponCode){const t=setTimeout(()=>{Me()},500);return()=>clearTimeout(t)}},[a.couponCode]),o.useEffect(()=>{me&&h&&ye()},[me,y]);const Me=async()=>{if(!(!a.couponCode||!b))try{const t=await v.post("/couponcodecustom",{couponcode:a.couponCode,domainurl:b,type:"custom"}),r=parseFloat(t.data.offprice);w(c=>({...c,buyingPrice:r,couponValid:t.data.valid,couponMessage:t.data.valid?t.data.title:"Invalid coupon code"}))}catch{w(r=>({...r,couponValid:!1,couponMessage:"Error validating coupon code"}))}},ye=async()=>{var t,r,c,l;if(!(!b||!h))try{ie({checking:!0,available:null,message:"Checking availability..."}),w({...a,show:!1});const n=await v.post("/check-handle-availability",{domain:y,handle:b,current_funnel_id:h.id});if(n.data.available){const u=Number(n.data.price)||0,x=Number(n.data.promoPrice)||0;w({show:!0,charCount:n.data.charCount||0,price:u,promoPrice:x,handle:n.data.handle||"",domain:y,couponCode:"",buyingPrice:x>0?x:u,sellingPrice:0})}ie({checking:!1,available:n.data.available,message:n.data.message})}catch(n){console.error("Availability check error:",n),ie({checking:!1,available:!1,message:((r=(t=n.response)==null?void 0:t.data)==null?void 0:r.message)||"Failed to check availability"}),i(((l=(c=n.response)==null?void 0:c.data)==null?void 0:l.message)||"Failed to check availability")}},He=async()=>{var c,l,n;if(!D){i("Please enter your email address");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(D)){i("Please enter a valid email address");return}i(""),te(!0);let t=a.promoPrice;a.couponCode;const r=a.buyingPrice*m;r>0&&r<1&&(t=1/m);try{const u=await v.post("/initiate-handle-payment",{price:a.price,email:D,custom_handle:b,domain:y,promo_price:t,coupon_code:a.couponCode,selling_price:a.sellingPrice,payment_method:E,funnelId:h==null?void 0:h.id},{headers:{"X-CSRF-TOKEN":((c=document.querySelector('meta[name="csrf-token"]'))==null?void 0:c.getAttribute("content"))||""}});xe(u.data.clientSecret),ge(u.data.payment_intent_id),fe(u.data.handle_purchase_id),ee(2)}catch(u){v.isAxiosError(u)?i(((n=(l=u.response)==null?void 0:l.data)==null?void 0:n.error)||"Failed to initialize payment"):i("Failed to connect to payment service")}finally{te(!1)}},Ue=async()=>{var t,r,c;te(!0),i("");try{const l=await v.post("/handle-success",{payment_intent_id:Ee},{headers:{"X-CSRF-TOKEN":((t=document.querySelector('meta[name="csrf-token"]'))==null?void 0:t.getAttribute("content"))||""}});
6l.data.success?(q(`Handle purchased successfully! Your new URL: https://${y}/${b}`),ne(!1),p(H.map(n=>{if(n.id===(h==null?void 0:h.id)){const u={id:Date.now(),domain:b,domainselected:y};return{...n,custom_domains:[...n.custom_domains||[],u]}}return n})),ee(1),xe(""),ge(""),fe(0),i(""),setTimeout(()=>{q(""),le(null),G(""),J(!1),B("ez.wiki"),w({show:!1,charCount:0,price:0,promoPrice:g||0,handle:"",domain:y,couponCode:"",buyingPrice:g||0,sellingPrice:0})},3e3),await ae()):i(l.data.error||"Payment verification failed")}catch(l){console.error("Payment verification error:",l),v.isAxiosError(l)?i(((c=(r=l.response)==null?void 0:r.data)==null?void 0:c.error)||"Payment verification failed"):i("Failed to verify payment. Please contact support.")}finally{te(!1)}},ae=async()=>{try{const t=await v.get("/search-ez-funnels",{params:{query:U,type:L,page:1}});p(t.data.data),S(1),W(t.data.next_page_url!==null)}catch(t){console.error("Search error:",t),i("Failed to search funnels. Please try again."),setTimeout(()=>i(""),5e3)}},Le=async()=>{var t,r,c;try{Q(!0);const l=((t=document.querySelector('meta[name="csrf-token"]'))==null?void 0:t.getAttribute("content"))||"",n=await v.get("/search-ez-funnels",{params:{query:U,type:L,page:N+1,with:"customDomains"},headers:{"X-CSRF-TOKEN":l,"Content-Type":"application/json"}});n.data&&n.data.data&&(p(u=>{const x=[...u];return n.data.data.forEach(P=>{const k=x.findIndex(d=>d.id===P.id);k>=0?x[k]={...x[k],...P,handle_domains:[...x[k].handle_domains||[],...P.handle_domains||[]],custom_domains:[...x[k].custom_domains||[],...P.custom_domains||[]]}:x.push(P)}),x}),S(N+1),W(n.data.next_page_url!==null))}catch(l){console.error("Load more error:",l),i(((c=(r=l.response)==null?void 0:r.data)==null?void 0:c.message)||"Failed to load more items. Please try again."),setTimeout(()=>i(""),5e3)}finally{Q(!1)}},Re=async t=>{var r,c,l,n,u,x,P,k;if(t.preventDefault(),!(!h||!b)){if(E==="usd"&&(a.promoPrice===0&&!a.couponValid?a.price:a.buyingPrice)*m>0){ne(!0);return}try{Q(!0),i(""),q("");const d={current_funnel_id:h.id,custom_handle:b,domain:y,price:a.price,promo_price:a.promoPrice,coupon_code:a.couponCode,selling_price:a.sellingPrice,payment_method:E},C=await v.post(`/update-ez-funnel-handle/${h.id}`,d);
6C.data.success?(q(`Handle purchased successfully! Your new URL: ${C.data.url}`),p(H.map(T=>{if(T.id===h.id){const M={id:Date.now(),domain:b,domainselected:y};return{...T,custom_domains:[...T.custom_domains||[],M]}}return T})),setTimeout(()=>{q(""),le(null),G(""),J(!1),B("ez.wiki"),w({show:!1,charCount:0,price:0,promoPrice:g||0,handle:"",domain:y,couponCode:"",buyingPrice:g||0,sellingPrice:0})},3e3),E==="bee"&&await v.get("/buy-bee/balance")):i(C.data.error||"Failed to complete the purchase. Please try again.")}catch(d){if(console.error("Handle purchase error:",d),v.isAxiosError(d))if(d.response)switch(d.response.status){case 409:i(((r=d.response.data)==null?void 0:r.error)||"This handle is already taken by another user.");break;case 400:(c=d.response.data)!=null&&c.messages?i(Object.values(d.response.data.messages).join(" ")):i(((l=d.response.data)==null?void 0:l.error)||"Invalid request. Please check your input.");break;case 403:i(((n=d.response.data)==null?void 0:n.error)||"Insufficient balance for this purchase.");break;case 422:const C=(u=d.response.data)==null?void 0:u.errors;i(C?Object.values(C).flat().join(" "):((x=d.response.data)==null?void 0:x.message)||"Validation failed. Please check your input.");break;default:i(((P=d.response.data)==null?void 0:P.message)||((k=d.response.data)==null?void 0:k.error)||"An unexpected error occurred. Please try again.")}else d.request?i("Network error. Please check your connection and try again."):i("Request setup error. Please try again.");else i("An unexpected error occurred. Please try again.")}finally{Q(!1)}}},Te=t=>{le(t),G(t.token),B("ez.wiki"),J(!0),w({show:!1,charCount:0,price:0,promoPrice:g||0,handle:"",domain:"ez.wiki",couponCode:"",buyingPrice:g||0,sellingPrice:0})},Ae=t=>new Date(t).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),Ve=o.useCallback(()=>{if(!s)return null;const t=Y(s.image)||"",c=`${s.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${s.image}`,l=["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"],n=["ppt","pptx","pdf","xls","xlsx","doc","docx","pages","ai","psd","eps","ttf","dxf","xps","rar","zip","ods","odt","odp"],u=/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i,x=/(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:in|posts|company|feed|showcase|embed\/feed\/update\/urn:li:[^/]+:[^"&?/ ]+)/i,P=/^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$/im,k=/^(https?:\/\/)?(www\.)?fb\.watch\/[a-zA-Z0-9(\.\?)?]/,d=/^(https?:\/\/)?(www\.)?facebook\.com\/[a-zA-Z0-9(\.\?)?]/,C=/<iframe.*?src=["'](.*?)["'].*?>.*?<\/iframe>/is,T=/<blockquote/,M=s.image.match(u),qe=s.image.match(x),je=s.image.match(P),Be=s.image.match(k),De=s.image.match(d),Oe=s.image.match(C)||T.test(s.image);if(l.includes(t))return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 7 .blur-overlay { 8 position: fixed; 9 top: 0; 10 left: 0; 11 width: 100%; 12 height: 100%; 13 backdrop-filter: blur(20px); 14 z-index: -1; 15 } 16 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("img",{src:c,alt:"Background",className:"absolute inset-0 max-w-full max-h-full m-auto z-0 rounded-lg",onError:j=>console.error("Image failed to load",j)})]});if(n.includes(t))return e.jsx("iframe",{src:`https://docs.google.com/viewer?url=${c}&embedded=true`,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",loading:"lazy",allow:"autoplay; fullscreen",allowFullScreen:!0,sandbox:"allow-scripts allow-same-origin",title:"Document Viewer",scrolling:"yes"});if(Oe){const j=s.image.replace(/<(iframe|blockquote)([^>]*)\s(height|width|style)=["'][^"']*["']([^>]*)>/gi,'<$1$2$4 class="fixed top-0 left-0 w-full h-full" scrolling="yes">').replace(/class="([^"]*)"/g,'class="$1 absolute inset-0 m-auto"'),Ye=/<(iframe|blockquote)[^>
16]*class="/i.test(j)?j:j.replace(/<(iframe|blockquote)/g,'<$1 scrolling="yes" class="absolute w-full h-full inset-0 m-auto"');return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 17 .blur-overlay { 18 position: fixed; 19 top: 0; 20 left: 0; 21 width: 100%; 22 height: 100%; 23 backdrop-filter: blur(20px); 24 z-index: -2; 25 } 26 .twitter-tweet { 27 position: fixed; 28 top: 0; 29 left: 0; 30 width: 100vw; 31 height: 100vh; 32 object-fit: cover; 33 z-index: 0; 34 border: none; 35 } 36 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full object-cover",dangerouslySetInnerHTML:{__html:Ye}})]})}if(M){const j=s.option==="autoplay"?"autoplay=1":s.option==="mute"?"autoplay=1&mute=1":"mute=1";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 w-full h-full z-[-2]",children:e.jsx("iframe",{loading:"lazy",src:`https://www.youtube.com/embed/${M[1]}?${j}&loop=1&playlist=${M[1]}&controls=0&showinfo=0&modestbranding=1&iv_load_policy=3`,className:"w-full h-full object-cover",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0})}),e.jsx("style",{children:` 37 .blur-overlay { 38 position: fixed; 39 top: 0; 40 left: 0; 41 width: 100%; 42 height: 100%; 43 backdrop-filter: blur(20px); 44 z-index: -1; 45 } 46 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{id:"bgVideo",loading:"lazy",className:"fixed top-0 left-0 w-full h-full object-cover",src:`https://www.youtube.com/embed/${M[1]}?${s.option}=1&mute=1&loop=1&playlist=${M[1]}`,title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0})]})}if(qe){let j=s.image;return j.includes("?compact=1")||(j+=(j.includes("?")?"&":"?")+"compact=1"),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black",children:e.jsx("iframe",{id:"bgVideo",src:j,className:"w-full h-full",frameBorder:"0",allowFullScreen:!0,title:"Embedded LinkedIn Post",scrolling:"yes"})})}return je?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 47 .blur-overlay { 48 position: fixed; 49 top: 0; 50 left: 0; 51 width: 100%; 52 height: 100%; 53 backdrop-filter: blur(20px); 54 z-index: -1; 55 } 56 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:`https://player.vimeo.com/video/${je[3]}?h=33160d1512&color=de0101`,className:"fixed top-0 left-0 w-full h-full object-cover",frameBorder:"0",allowFullScreen:!0})]}):Be||De&&!s.image.includes("groups")?e.jsx("div",{className:"fixed top-0 left-0 w-full h-full",children:e.jsx("div",{className:"fb-post","data-href":s.image,"data-width":"1400","data-show-text":"true"})}):t==="mp4"?e.jsxs(e.Fragment,{children:[e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed top-0 left-0 w-full h-full object-cover z-[-3]",children:[e.jsx("source",{src:c,type:"video/mp4"}),"Your browser does not support the video tag."]}),e.jsx("style",{children:` 57 .blur-overlay { 58 position: fixed; 59 top: 0; 60 left: 0; 61 width: 100%; 62 height: 100%; 63 backdrop-filter: blur(20px); 64 z-index: -2; 65 } 66 `}),e.jsx("div",{className:"blur-overlay"}),e.jsxs("video",{id:"bgVideo",autoPlay:!0,loop:!0,muted:!0,playsInl
66ine:!0,className:"absolute inset-0 max-w-full max-h-full m-auto",controls:!0,children:[e.jsx("source",{src:c,type:"video/mp4"}),"Your browser does not support the video tag."]})]}):t==="glb"?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 67 .blur-overlay { 68 position: fixed; 69 top: 0; 70 left: 0; 71 width: 100%; 72 height: 100%; 73 backdrop-filter: blur(20px); 74 z-index: -1; 75 } 76 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("model-viewer",{src:c,alt:"3D model",className:"fixed top-0 left-0 w-full h-full",ar:!0,"auto-rotate":!0,"camera-controls":!0,"shadow-intensity":"1"})]}):be(s.image)?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 77 .blur-overlay { 78 position: fixed; 79 top: 0; 80 left: 0; 81 width: 100%; 82 height: 100%; 83 backdrop-filter: blur(20px); 84 z-index: -1; 85 } 86 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:s.image,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,scrolling:"yes"})]}):e.jsx("iframe",{src:he,className:"fixed top-0 left-0 w-full h-full border-none",allow:"microphone *; camera *; autoplay *; fullscreen *; display-capture *;",sandbox:`allow-forms allow-modals allow-orientation-lock allow-pointer-lock 87 allow-popups allow-popups-to-escape-sandbox allow-presentation 88 allow-same-origin allow-scripts allow-top-navigation 89 allow-top-navigation-by-user-activation allow-downloads allow-storage-access-by-user-activation`,allowFullScreen:!0,loading:"lazy",name:"binauralMixerFrame",allowTransparency:"true",scrolling:"yes"})},[s,he,Y,be]);return e.jsxs(e.Fragment,{children:[e.jsxs(Ze,{children:[e.jsx("title",{children:"EZ Handle - Custom URLs for Your Funnels"}),Ie,e.jsx("style",{children:` 90 .react-tooltip { 91 z-index: 99999 !important; 92 opacity: 1 !important; 93 font-size: 12px; 94 padding: 4px 8px; 95 } 96 `})]}),e.jsx(Je,{id:"ezhandle-tooltip"}),e.jsx(Ke,{auth:Z}),e.jsxs("main",{className:`relative flex justify-end p-4 min-h-screen overflow-hidden ${s!=null&&s.image&&de(Y(s.image))?"blur-bg":""}`,children:[e.jsx("div",{className:"absolute inset-0 z-0",children:Ve()}),A&&e.jsxs("div",{className:"relative mt-4 mx-auto bottom-4 z-50 backdrop-blur-sm p-4 rounded-xl border border-white-700 overflow-y-auto shadow-2xl",children:[e.jsx("button",{onClick:()=>oe(!1),className:"absolute top-2 right-2 w-8 h-8 bg-black rounded-full flex items-center justify-center z-50 hover:bg-gray-800 transition-colors focus:outline-none focus:ring-2 focus:ring-white","aria-label":"Close panel","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Close Panel",children:e.jsx(f,{icon:Pe,className:"text-white text-lg",style:{textShadow:"0.7px 0.7px 0 rgb(255,0,0), -0.7px -0.7px 0 rgb(0,255,255)"}})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("input",{type:"text",placeholder:"Search by token",className:"flex-grow bg-white text-gray-900 px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-yellow-400 min-w-0",value:U,onChange:t=>re(t.target.value),onKeyPress:t=>t.key==="Enter"&&ae(),"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Enter a search term and press Enter"}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs("button",{className:`font-semibold px-3 py-2 flex items-center gap-1.5 whitespace-nowrap rounded-l-md border-r transition-colors ${L==="fuzzy"?"bg-green-600 text-white border-green-700 hover:bg-green-700":"bg-gray-600 text-gray-300 border-gray-700 hover:bg-gray-700"}`,onClick:()=>{K("fuzzy"),ae()},"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Fuzzy Search: Finds partial matches",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),"Fuzzy"]}),e.jsxs("button",{className:`font-semibold px-3 py-2 flex items-center gap-1.5 whitespace-nowrap rounded-r-md transition-colors ${L==="exact"?"bg-green-600 text-white hover:bg-green-700":"bg-gray-600 text-gray-300 hover:bg-gray-700"}`,onClick:()=>{K("exact"),ae()},"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Exact Search: Finds only exact matches",children:[e.jsx("span",{className:"text-sm",children:"ð"}),"Exact"]})]})]}),e.jsx("div",{className:"max-h-[65vh] overflow-y-auto custom-scrollbar space-y-2",children:H.map(t=>{var r,c;return e.jsxs("div",{className:"flex items-center p-4 gap-1 bg-[#5d0f6e] rounded-lg",children:[e.jsx("span",{className:"text-4xl select-none",children:"ð"}),e.jsx("div",{className:"flex-grow min-w-0",children:e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("a",{href:`https://ez.wiki/${encodeURIComponent(t.token)}`,target:"_blank",className:"text-yellow-400 font-semibold truncate",rel:"noopener noreferrer","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Open this funnel in a new tab",children:["https://ez.wiki/",t.token]}),(r=t.handle_domains)==null?void 0:r.map(l=>e.jsxs("a",{href:`https://${l.domain}.${l.domainselected}`,target:"_blank",className:"text-yellow-400 font-semibold truncate",rel:"noopener noreferrer","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Open this handle domain in a new tab",children:["https://",l.domain,".",l.domainselected]},l.id)),(c=t.custom_domains)==null?void 0:c.map(l=>e.jsxs("a",{href:`https://${l.domainselected}/${l.domain}`,target:"_blank",className:"text-yellow-400 font-semibold truncate",rel:"noopener noreferrer","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Open this custom domain in a new tab",children:["https://",l.domainselected,"/",l.domain]},l.id)),e.jsx("p",{className:"text-purple-300 text-sm whitespace-nowrap",children:Ae(t.created_at)})]})}),e.jsx("button",{className:"bg-yellow-400 text-black font-bold py-1 px-5 rounded-md text-sm hover:bg-yellow-500 transition-colors whitespace-nowrap",onClick:()=>Te(t),"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Add or edit the custom handle for this funnel",children:"Add Custom Handle"})]},t.id)})}),_&&e.jsx("div",{className:"flex justify-center mt-4",children:e.jsx("button",{className:"bg-black text-white border border-white px-8 py-2 rounded-md font-semibold hover:bg-white hover:text-black transition-colors",onClick:Le,disabled:X,"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Load more funnels",children:X?"Loading...":"Load More"})})]}),e.jsx("div",{className:"col-span-1 space-y-4",children:Ce?e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 space-y-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("h2",{className:"text-xl font-bold text-white",children:[e.jsx(f,{icon:We,className:"mr-2"}),"Custom Handle for: ",h==null?void 0:h.token]}),e.jsx("button",{onClick:()=>{J(!1),B("ez.wiki"),w({show:!1,charCount:0,price:0,promoPrice:g||0,handle:"",domain:"ez.wiki",couponCode:"",buyingPrice:g||0,sellingPrice:0})},className:"text-gray-400 hover:text-white transition-colors","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Close",children:e.jsx(f,{icon:Pe})})]}),ue&&e.jsx("div",{className:"mb-4 p-4 bg-green-100 border border-green-400 text-green-700 rounded-lg",children:ue}),R&&e.jsx("div",{className:"mb-4 p-4 bg-red-100 border border-red-400 text-red-700 rounded-lg",children:R}),e.jsxs("form",{onSubmit:Re,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-yellow-400 font-medium",children:"New Custom Handle"}),e.jsxs("div",{className:"flex items-center bg-gray-700 border border-gray-600 rounded-lg overflow-hidden",children:[e.jsx("select",{className:"px-4 py-2 bg-gray-600 text-gray-300 border-r border-gray-500 focus:outline-none",value:y,onChange:t=>{B(t.target.value),w({...a,domain:t.target.value,show:!1})},"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Select the domain for your custom handle",children:z==null?void 0:z.map(t=>e.jsxs("option",{value:t.domain,children:[t.domain,"/"]},t.id))}),e.jsx("input",{type:"text",value:b,onChange:t=>{const r=t.target.value;G(r),w({...a,show:!1})},className:"flex-grow px-4 py-2 bg-gray-700 text-white focus:outline-none focus:ring-2 focus:ring-yellow-400",placeholder:"your-custom-handle",required:!0,title:"Only letters, numbers, and hyphens are allowed","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Enter your desired handle (3-32 characters, letters, numbers, hyphens)"}
96),e.jsx("button",{type:"button",className:`px-4 py-2 ${F.checking?"bg-gray-600 text-gray-300":F.available?"bg-green-600 text-white":"bg-red-600 text-white"}`,onClick:ye,disabled:F.checking,"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Check if this handle is available",children:F.checking?"Checking...":F.available?"Available":"Unavailable"})]}),F.message&&e.jsx("p",{className:`text-sm ${F.available?"text-green-400":"text-red-400"}`,children:F.message})]}),a.show&&e.jsxs("div",{className:"mt-6 bg-gray-900/50 p-4 rounded-lg border border-gray-700",children:[e.jsxs("h3",{className:"text-yellow-400 font-medium mb-2",children:[e.jsx(f,{icon:Xe,className:"mr-2"}),"Handle Purchase"]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("p",{className:"text-white",children:[a.domain,"/",a.handle]}),e.jsxs("p",{className:"text-gray-300 text-sm",children:[a.charCount," letters = EZ$",(Number(a.price)||0).toFixed(2)]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"text-gray-300 text-sm",children:"Payment Method"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx("button",{type:"button",className:`flex-1 py-2 rounded-md border ${E==="bee"?"bg-yellow-400 text-black border-yellow-500":"bg-gray-700 text-gray-300 border-gray-600"}`,onClick:()=>pe("bee"),"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Pay with Bee currency",children:"EZ$"}),e.jsx("button",{type:"button",className:`flex-1 py-2 rounded-md border ${E==="usd"?"bg-green-500 text-white border-green-600":"bg-gray-700 text-gray-300 border-gray-600"}`,onClick:()=>pe("usd"),"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Pay with USD via Stripe",children:"US$"})]})]}),E==="bee"?e.jsxs(e.Fragment,{children:[a.couponValid?e.jsx("div",{className:"bg-purple-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-green-400 font-semibold",children:["Special Offer: Lifetime Ownership for EZ$",a.buyingPrice.toFixed(2)]})}):a.promoPrice>0&&e.jsx("div",{className:"bg-purple-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-green-400 font-semibold",children:["Pre-launch Price: EZ$",a.promoPrice.toFixed(2)]})}),a.couponValid&&a.buyingPrice<a.promoPrice&&a.promoPrice>0&&e.jsx("div",{className:"bg-purple-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-yellow-300 text-sm mt-1",children:["You're saving EZ$",(a.promoPrice-a.buyingPrice).toFixed(2),"!"]})})]}):e.jsxs(e.Fragment,{children:[a.couponValid?e.jsx("div",{className:"bg-blue-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-green-400 font-semibold",children:["Special Offer: Lifetime Ownership for US$",(a.buyingPrice*m).toFixed(2)]})}):a.promoPrice>0&&e.jsx("div",{className:"bg-blue-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-green-400 font-semibold",children:["Pre-launch Price: US$",(a.promoPrice*m).toFixed(2)]})}),a.couponValid&&a.buyingPrice<a.promoPrice&&a.promoPrice>0&&e.jsx("div",{className:"bg-blue-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-yellow-300 text-sm mt-1",children:["You're saving US$",((a.promoPrice-a.buyingPrice)*m).toFixed(2),"!"]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-gray-300 text-sm",children:"Coupon Code"}),e.jsx("input",{type:"text",className:"w-full bg-gray-700 text-white px-3 py-2 rounded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-yellow-400",placeholder:"Enter coupon code",value:a.couponCode,onChange:t=>w({...a,couponCode:t.target.value}),"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Enter a coupon code to get a discount"})]}),a.couponCode&&e.jsx("div",{className:`mt-2 text-sm ${a.couponValid?"text-green-400":"text-red-400"}`,children:a.couponMessage||"Validating coupon..."}),e.jsxs("div",{children:[e.jsx("label",{className:"text-gray-300 text-sm",children:"NYP (optional)"}),e.jsx("input",{type:"number",className:"input-no-spinner w-full bg-gray-700 text-white px-3 py-2 rounded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-yellow-400",value:a.sellingPrice??"",onChange:t=>{const r=t.target.value;w({...a,sellingPrice:r===""?void 0:parseFloat(r)})},min:"0",step:"1",placeholder:"Set price if you want to list in marketplace","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Name Your Price: Set a price to list this handle in the marketplace for others to buy"})]})]}),e.jsx("div",{className:"mt-4 text-xs text-gray-400",children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("input",{type:"checkbox",id:"terms-checkbox",required:!0,className:"mt-1 mr-2"}),e.jsx("label",{htmlFor:"terms-checkbox",children:"By claiming your handle you agree to the current user T&C and future changes of the T&C"})]})}),e.jsx("button",{type:"submit",className:"w-full mt-4 bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-4 roun
96ded-md transition-colors",disabled:X,"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Complete the purchase of this handle",children:X?"Processing...":(()=>{const t=a.promoPrice===0&&!a.couponValid?a.price:a.buyingPrice;if(E==="bee")return`Buy Handle for EZ$${t.toFixed(2)}`;{const r=t*m;return`Buy Handle for US${(r>0&&r<1?1:r).toFixed(2)}`}})()})]})]}),!a.show&&e.jsxs("div",{className:"bg-gray-900/50 p-4 rounded-lg border border-gray-700",children:[e.jsxs("h3",{className:"text-yellow-400 font-medium mb-2",children:[e.jsx(f,{icon:ke,className:"mr-2"}),"About Custom Handles"]}),e.jsxs("ul",{className:"text-gray-300 text-sm space-y-2 list-disc pl-5",children:[e.jsx("li",{children:"Create memorable, branded URLs for your funnels"}),e.jsx("li",{children:"Improve sharing and marketing of your content"}),e.jsx("li",{children:"Handle must be unique across all users"}),e.jsx("li",{children:"Only letters, numbers, and hyphens allowed"}),e.jsx("li",{children:"Minimum 3 characters, maximum 32 characters"})]})]})]}):e.jsx("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 flex flex-col items-center justify-center h-full",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx(f,{icon:Qe,className:"text-6xl text-yellow-400 mb-4"}),e.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Custom Handle Management"}),e.jsx("p",{className:"text-gray-300 mb-6",children:"Select a funnel from the list to assign or update its custom handle. Custom handles make your funnel URLs more memorable and branded."}),e.jsxs("div",{className:"bg-gray-900/50 p-4 rounded-lg border border-gray-700 text-left",children:[e.jsxs("h3",{className:"text-yellow-400 font-medium mb-2",children:[e.jsx(f,{icon:ke,className:"mr-2"}),"Example Handles:"]}),e.jsxs("ul",{className:"text-gray-300 text-sm space-y-1",children:[e.jsxs("li",{children:["⢠ez.wiki/",e.jsx("span",{className:"text-white",children:"yourbrand"})]}),e.jsxs("li",{children:["⢠ez.wiki/",e.jsx("span",{className:"text-white",children:"product-name"})]}),e.jsxs("li",{children:["⢠ez.wiki/",e.jsx("span",{className:"text-white",children:"company-2023"})]})]})]})]})})})]})]}),_e&&e.jsx("div",{className:"fixed inset-0 bg-black/70 min-h-screen flex items-center justify-center z-[100] p-4 overflow-y-auto",children:e.jsxs("div",{className:"bg-[#235A72] border border-[#3a7a94] text-white p-8 rounded-lg shadow-lg max-w-sm w-full relative max-h-[90vh] overflow-y-auto",children:[e.jsx("button",{onClick:()=>{ne(!1),ee(1),i("")},className:"sticky top-0 right-0 ml-auto text-white/70 hover:text-white transition-colors z-10",disabled:O,"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Close Payment",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("div",{className:"space-y-6",children:[R&&e.jsxs("div",{className:"bg-red-500/90 text-white p-3 rounded-lg flex items-center gap-2",children:[e.jsx(f,{icon:Se}),R]}),O&&e.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center rounded-lg",children:e.jsx(f,{icon:se,className:"animate-spin text-4xl text-white"})}),Fe===1?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-full backdrop-blur-md flex items-center justify-center overflow-hidden border border-white/20 bg-gradient-to-br from-white/15 to-transparent shadow-lg mx-auto",children:e.jsx("img",{src:"https://ez.wiki/logo.gif",className:"w-10 h-10 rounded-full object-cover",alt:"ez.wiki Logo"})}),e.jsx("h2",{className:"text-xl font-bold mt-4 text-white",children:"Purchase Handle"}),e.jsxs("p",{className:"text-[#a8d0e6]",children:["You'll be charged US$",(a.buyingPrice*m>0&&a.buyingPrice*m<1?1:a.buyingPrice*m).toFixed(2)]})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"flex items-center bg-white rounded-md",children:[e.jsx("div",{className:"p-3 bg-[#4CAF50] rounded-l-md",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-white",f
96ill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("input",{type:"email",value:D,onChange:t=>$e(t.target.value),className:"w-full p-3 bg-white text-gray-800 outline-none rounded-r-md",placeholder:"Email",required:!0,disabled:O,"data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Enter your email for the receipt"})]}),R&&e.jsx("div",{className:"mt-2 text-[#ff6b6b] text-sm",children:R})]}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{onClick:He,disabled:O,className:"w-full bg-[#FFD700] text-gray-900 font-bold py-3 px-4 rounded-full hover:bg-[#FFC000] transition-colors disabled:opacity-70 disabled:cursor-not-allowed","data-tooltip-id":"ezhandle-tooltip","data-tooltip-content":"Proceed to the payment step",children:O?e.jsxs(e.Fragment,{children:[e.jsx(f,{icon:se,className:"animate-spin mr-2"}),"Processing..."]}):"Continue to Payment"})}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("p",{className:"text-xs text-[#a8d0e6]",children:"Payment secured by STRIPE. You'll be taken to a thank you page after the payment."}),e.jsxs("p",{className:"mt-1 text-xs text-[#a8d0e6]",children:[e.jsx(Ne,{href:"/terms",className:"hover:underline text-white",children:"Terms"})," and"," ",e.jsx(Ne,{href:"/privacy",className:"hover:underline text-white",children:"Privacy"}),"."]})]})]}):e.jsx(et,{stripe:rt,options:{clientSecret:ce,appearance:{theme:"night",variables:{colorPrimary:"#FFD700",colorBackground:"#235A72",colorText:"white",colorDanger:"#ff6b6b",fontFamily:"Inter, system-ui, sans-serif"}}},children:ce?e.jsx(lt,{price:a.buyingPrice*m>0&&a.buyingPrice*m<1?1:a.buyingPrice*m,email:D,clientSecret:ce,onSuccess:Ue,onBack:()=>ee(1),onError:i}):e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(f,{icon:se,className:"animate-spin text-2xl"})})})]})]})})]})]})}export{ft 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.