1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="776b1459-b3ac-4f02-8046-c0cf54baa102",e._sentryDebugIdIdentifier="sentry-dbid-776b1459-b3ac-4f02-8046-c0cf54baa102")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51492],{861:(e,t,r)=>{"use strict";r.d(t,{Qg:()=>n,bL:()=>o,s6:()=>c});var s=r(12115),a=r(97602),i=r(95155),l=Object.defineProperty,n=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),c=s.forwardRef(l(function(e,t){return(0,i.jsx)(a.sG.span,{...e,ref:t,style:{...n,...e.style}})},"name",{value:"VisuallyHidden",configurable:!0})),o=c},2944:(e,t,r)=>{"use strict";r.d(t,{UISettingsProvider:()=>m,f:()=>h});var s=r(95155),a=r(12115),i=r(8525);let l=["compact","standard","large"],n={discoverCardSize:"compact"},c="ui_settings",o="ui-settings-cache-v1",d=(0,a.createContext)(void 0);function u(e,t){let r={...e};return t&&"object"==typeof t&&"string"==typeof t.discoverCardSize&&l.includes(t.discoverCardSize)&&(r.discoverCardSize=t.discoverCardSize),r}function m(e){let{children:t}=e,[r,l]=(0,a.useState)(n),m=(0,a.useRef)(r),[h,x]=(0,a.useState)(!0),g=(0,a.useMemo)(()=>(0,i.U)(),[]);(0,a.useEffect)(()=>{m.current=r},[r]);let p=(0,a.useCallback)(e=>{m.current=e,l(e);try{localStorage.setItem(o,JSON.stringify(e))}catch(e){console.error("Failed to cache UI settings:",e)}},[]),y=(0,a.useCallback)(async()=>{try{let{data:e,error:t}=await g.from("system_settings").select("value").eq("setting_key",c).maybeSingle();if(t)throw t;(null==e?void 0:e.value)&&p(u(n,e.value))}catch(e){console.error("Failed to load UI settings:",e)}finally{x(!1)}},[p,g]),f=(0,a.useCallback)(async e=>{try{let{error:t}=await g.from("system_settings").upsert({setting_key:c,value:e,updated_at:new Date().toISOString()});if(t)throw t;return!0}catch(e){return console.error("Failed to persist UI settings:",e),!1}},[g]),v=(0,a.useCallback)(async e=>{let t={...m.current,discoverCardSize:e};p(t),await f(t)||await y()},[p,f,y]);(0,a.useEffect)(()=>{try{let e=localStorage.getItem(o);e&&p(u(n,JSON.parse(e)))}catch(e){console.error("Failed to read UI settings cache:",e)}y()},[p,y]),(0,a.useEffect)(()=>{let e="ui_settings-".concat(Math.random().toString(36).slice(2),"-").concat(Date.now()),t=g.channel(e).on("postgres_changes",{event:"*",schema:"public",table:"system_settings",filter:"setting_key=eq.".concat(c)},e=>{e.new&&"object"==typeof e.new&&"value"in e.new&&p(u(n,e.new.value))}).subscribe();return()=>{g.removeChannel(t)}},[p,g]),(0,a.useEffect)(()=>{let e=setInterval(()=>{y()},6e4);return()=>clearInterval(e)},[y]);let b=(0,a.useMemo)(()=>({discoverCardSize:r.discoverCardSize,setDiscoverCardSize:v,isLoading:h}),[r.discoverCardSize,v,h]);return(0,s.jsx)(d.Provider,{value:b,children:t})}function h(){let e=(0,a.useContext)(d);if(!e)throw Error("useUISettings must be used within UISettingsProvider");return e}},5937:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]])},9540:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},9582:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},10489:(e,t,r)=>{"use strict";r.d(t,{b:()=>n});var s=r(12115),a=r(97602),i=r(95155),l=Object.defineProperty,n=s.forwardRef(l(function(e,t){return(0,i.jsx)(a.sG.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},12098:(e,t,r)=>{"use strict";r.d(t,{default:()=>em});var s=r(95155),a=r(12115),i=r(20063),l=r(52619),n=r.n(l),c=r(97003),o=r(83209),d=r(33789),u=r(67812),m=r(90368),h=r(9540),x=r(86651),g=r(65229),p=r(27937),y=r(25563),f=r(6191),v=r(39894),b=r(50447),j=r(82026),N=r(54474),w=r(8525),_=r(55677),k=r(32734),C=r(96834),S=r(78479),A=r(83955),D=r(28171),E=r(20109),R=r(67265),P=r(69007),I=r(54664),L=r(52987),z=r(50859),U=r(919),T=r(91078),O=r(66721),B=r(56154),F=r(39867),M=r(95740),q=r(39347),H=r(38026),G=r(60709),W=r(93499),V=r(2331),J=r(83457),Y=r(39068),Z=r(17910),K=r(25016),$=r(41569);function X(e){let{selectedCountry:t,countryName:r,selectedCategory:i,categoryName:l}=e,[n,m]=(0,a.useState)("main"),[h,g]=(0,a.useState)(""),[p,v]=(0,a.useState)(!1),[b,j]=(0,a.useState)(null),[N,w]=(0,a.useState)(!1),[_,C]=(0,a.useState)(!1),[S,E]=(0,a.useState)(null),[R,P]=(0,a.useState)(null),[X,Q]=(0,a.useState)(0),[ee,et]=(0,a.useState)(!1),[er,es]=(0,a.useState)({name:"",price:"",currency:"USD",image_url:"",category_id:"",description:"",sub_category:"",features:"",product_link:"",brand:"",availability:"In Stock",country:t||"US",additional_images:[]}),[ea,ei]=(0,a.useState)([]),[el,en]=(0,a.useState)(!1),[ec,eo]=(0,a.useState)(!1),[ed,eu]=(0,a.useState)(!1),[em,eh]=(0,a.useState)(""),{user:ex}=(0,k.A)(),{toast:eg}=(0,D.dj)();(0,a.useEffect)(()=>{(async()=>{en(!0);try{let e=await fetch("/api/v1/categories",{headers:{"X-API-Version":"v1"}});if(e.ok){let t=await e.json();ei(t.categories||[])}}catch(e){console.error("Failed to load categories:",e)}finally{en(!1)}})()},[]);let[ep,ey]=(0,a.useState)(!1);(0,a.useEffect)(()=>{ey(!1)},[]);let[ef,ev]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=setInterval(()=>{ev(e=>e+1)},8e3);return()=>clearInterval(e)},[]);let eb=()=>{window.open("https://chrome.google.com/webstore/detail/buyforbaby-registry-helper","_blank")},ej=async()=>
1{if(!h.trim())return void eg({title:"URL Required",description:"Please enter a product URL to parse",variant:"destructive"});try{new URL(h)}catch(e){eg({title:"Invalid URL",description:"Please enter a valid product URL",variant:"destructive"});return}v(!0),E(null),j(null);try{var e;let r=await fetch("/api/v1/products/parse-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:h.trim()})}),s=await r.json();if(!s.success)return void E(s.error||"Failed to parse the product URL. Please try again.");let a=s.data,i=new URL(h).hostname,l={id:a.id,title:a.title,price:a.price,currency:a.currency,image_url:a.image_url,additional_images:a.additional_images||[],description:a.description,features:a.features||[],category:a.category||(e=>{let t=e.toLowerCase();return t.includes("diaper")||t.includes("nappy")||t.includes("bottle")||t.includes("feeding")||t.includes("formula")?"Feeding":t.includes("toy")||t.includes("play")||t.includes("puzzle")?"Toys":t.includes("cloth")||t.includes("dress")||t.includes("shirt")||t.includes("pant")?"Clothing":t.includes("crib")||t.includes("bed")||t.includes("mattress")||t.includes("nursery")?"Nursery":t.includes("bath")||t.includes("soap")||t.includes("shampoo")||t.includes("potty")?"Bath & Potty":t.includes("book")||t.includes("story")||t.includes("read")?"Books":t.includes("safety")||t.includes("monitor")||t.includes("gate")||t.includes("thermometer")?"Health & Safety":"General"})(a.title),brand:a.brand,availability:a.availability||"In Stock",rating:a.rating,review_count:a.review_count,source_url:h.trim(),source_site:i,confidence:a.confidence,method:a.method,country:t,available_countries:[t,"US","CA"]};j(l);let n=[l.image_url,...l.additional_images||[]].filter(Boolean);P({title:l.title,description:l.description||"",price:(null==(e=l.price)?void 0:e.toString())||"",currency:l.currency||"USD",category:l.category||"General",country:l.country||t,images:n.length>0?n:["https://images.unsplash.com/photo-1515488042361-ee00e0ddd4e4?w=400&h=400&fit=crop"],quantity:1,note:"",priority:"medium",brand:l.brand||"",features:l.features||[]}),et(!0)}catch(e){console.error("Error parsing URL:",e),E("Failed to parse the URL. Please try again or check if the URL is correct.")}finally{v(!1)}},eN=e=>{let{children:t,delay:r=0,className:a=""}=e;return(0,s.jsx)("div",{className:(0,K.cn)("absolute opacity-0",a),style:{animation:"bfb-float-icon 8s ease-in-out ".concat(r,"s infinite")},children:t})},ew=async()=>{if(!ex)return void C(!0);if(!er.name.trim())return void eg({title:"Product Name Required",description:"Please enter a product name",variant:"destructive"});if(!er.price||0>=parseFloat(er.price))return void eg({title:"Valid Price Required",description:"Please enter a valid price",variant:"destructive"});if(!er.category_id)return void eg({title:"Category Required",description:"Please select a category",variant:"destructive"});eu(!0);try{let e=er.image_url.trim()||"https://images.unsplash.com/photo-1515488042361-ee00e0ddd4e4?w=400&h=400&fit=crop",r={name:er.name.trim(),description:er.description.trim()||null,price:parseFloat(er.price),currency:er.currency,image_url:e,category_id:er.category_id,sub_category:er.sub_category.trim()||null,features:er.features.trim()||null,product_link:er.product_link.trim()||null,brand:er.brand.trim()||null,availability:er.availability,country:er.country,available_countries:[er.country],added_via:"manual_web"},s=await fetch("/api/v1/products",{method:"POST",headers:{"Content-Type":"application/json","X-API-Version":"v1"},body:JSON.stringify(r)});if(!s.ok){let e=await s.json();throw Error(e.error||"Failed to create product")}let a=await s.json();(await fetch("/api/v1/registry",{method:"POST",headers:{"Content-Type":"application/json","X-API-Version":"v1"},body:JSON.stringify({product_id:a.product.id,quantity:1,priority:"medium"})})).ok||console.warn("Product created but failed to add to registry"),eg({title:"Product Created! \uD83C\uDF89",description:"".concat(er.name," has been added to your registry.")}),es({name:"",price:"",currency:"USD",image_url:"",category_id:"",description:"",sub_category:"",features:"",product_link:"",brand:"",availability:"In Stock",country:t||"US",additional_images:[]}),eo(!1),m("main")}catch(e){console.error("Error creating product:",e),eg({title:"Creation Failed",description:e instanceof Error?e.message:"Failed to create product. Please try again.",variant:"destructive"})}finally{eu(!1)}};return"add-product"===n?(0,s.jsxs)("div",{className:"text-center py-12 px-4 max-w-4xl mx-auto",children:[(0,s.jsxs)("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-5 duration-300 ease-out",children:[(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsxs)(c.Button,{variant:"ghost",onClick:()=>m("main"),className:"mb-4 text-gray-600 hover:text-gray-900",children:[(0,s.jsx)(L.A,{className:"w-4 h-4 mr-2 rotate-180"}),"Back"]}),(0,s.jsx)("div",{className:"w-16 h-16 bg-gradient-to-r from-primary to-pink-600 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(z.A,{className:"w-8 h-8 text-white"})}),(0,s.jsx)("h2",{className:"text-3xl font-bold text-gray-900",children:"Add Product from Any Website"}),(0,s.jsx)("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Paste a product URL from any website and we'll automatically parse the details for you"})]}
1),(0,s.jsxs)(o.Zp,{className:"max-w-2xl mx-auto shadow-lg",children:[(0,s.jsxs)(o.aR,{children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:"Product URL"}),(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Paste any product link from Amazon, Walmart, Target, or other retailers"})]}),(0,s.jsxs)(o.Wu,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.p,{type:"url",placeholder:"https://www.amazon.com/product-name/dp/B123456789",value:h,onChange:e=>g(e.target.value),className:"flex-1",disabled:p}),(0,s.jsxs)(c.Button,{onClick:ej,disabled:p||!h.trim(),className:"px-6",children:[p?(0,s.jsx)(U.A,{className:"w-4 h-4 animate-spin"}):(0,s.jsx)(x.A,{className:"w-4 h-4"}),"Parse"]})]}),S&&(0,s.jsxs)("div",{className:"space-y-4 animate-in fade-in zoom-in-95 duration-300 ease-out",children:[(0,s.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg flex items-start gap-3",children:[(0,s.jsx)(T.A,{className:"w-5 h-5 text-red-500 mt-0.5"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("p",{className:"text-sm text-red-700 font-medium",children:"Unable to parse this URL"}),(0,s.jsx)("p",{className:"text-xs text-red-600 mt-1",children:S})]})]}),(0,s.jsx)(o.Zp,{className:"border-2 border-blue-200 bg-blue-50 shadow-lg",children:(0,s.jsx)(o.Wu,{className:"p-6",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-12 h-12 bg-blue-600 rounded-xl flex items-center justify-center",children:(0,s.jsx)(O.A,{className:"w-6 h-6 text-white"})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h4",{className:"text-lg font-bold text-blue-900",children:"Try Our Chrome Extension Instead!"}),(0,s.jsx)("p",{className:"text-sm text-blue-700",children:"The most reliable way to add products to your registry"})]}),(0,s.jsxs)(u.E,{className:"bg-green-100 text-green-800 border-green-200",children:[(0,s.jsx)(B.A,{className:"w-3 h-3 mr-1"}),"Recommended"]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg p-4 space-y-3",children:[(0,s.jsx)("p",{className:"text-sm text-gray-700 leading-relaxed",children:"Our Chrome Extension bypasses website restrictions and works seamlessly with all major retailers. It's the easiest and most reliable way to add products to your BuyForBaby registry."}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-gray-600",children:[(0,s.jsx)(y.A,{className:"w-4 h-4 text-green-600"}),(0,s.jsx)("span",{children:"Works on any website"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-gray-600",children:[(0,s.jsx)(y.A,{className:"w-4 h-4 text-green-600"}),(0,s.jsx)("span",{children:"One-click addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-gray-600",children:[(0,s.jsx)(y.A,{className:"w-4 h-4 text-green-600"}),(0,s.jsx)("span",{children:"Price tracking"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-gray-600",children:[(0,s.jsx)(y.A,{className:"w-4 h-4 text-green-600"}),(0,s.jsx)("span",{children:"Auto categorization"})]})]})]}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsxs)(c.Button,{onClick:eb,className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white py-4 font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",children:[(0,s.jsx)(F.A,{className:"w-4 h-4 mr-2"}),"Install Chrome Extension"]}),(0,s.jsx)(c.Button,{variant:"outline",onClick:()=>{E(null),g("")},className:"px-6 py-4 border-blue-200 text-blue-700 hover:bg-blue-100",children:"Try Another URL"})]})]})})})]})]})]}),b&&R&&(0,s.jsx)("div",{className:"max-w-4xl mx-auto animate-in fade-in zoom-in-95 duration-300 ease-out",children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(o.Zp,{className:"shadow-lg border-green-200 bg-green-50",children:(0,s.jsxs)(o.aR,{className:"pb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(y.A,{className:"w-5 h-5 text-green-600"}),(0,s.jsx)("h3",{className:"text-lg font-semibold text-green-900",children:"Product Found"}),(0,s.jsxs)(u.E,{variant:"secondary",className:"ml-auto",children:[(0,s.jsx)(M.A,{className:"w-3 h-3 mr-1"}),Math.round(100*(b.confidence||.9)),"% confidence"]})]}),(0,s.jsx)("p",{className:"text-sm text-green-700",children:"Review and edit the auto-detected information below"})]})}),(0,s.jsxs)(o.Zp,{className:"shadow-lg",children:[(0,s.jsx)(o.aR,{children:(0,s.jsxs)("h4",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)(q.A,{className:"w-5 h-5 text-yellow-500"}),"Product Images"]})}),(0,s.jsx)(o.Wu,{children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"flex gap-4 overflow-x-auto pb-2",children:R.images.map((e,t)=>(0,s.jsx)("div",{className:(0,K.cn)("relative w-24 h-24 rounded-lg overflow-hidden border-2 cursor-pointer transition-all",X===t?"border-primary shadow-lg scale-105":"border-gray-200 hover:border-gray-300"),onClick:()=>
1Q(t),children:(0,s.jsx)($.ProductImage,{src:e,alt:"Product ".concat(t+1),fill:!0,sizes:"96px",className:"object-cover"})},t))}),(0,s.jsx)("div",{className:"relative w-full h-64 rounded-lg overflow-hidden border border-gray-200",children:(0,s.jsx)($.ProductImage,{src:R.images[X],alt:"Product preview",fill:!0,sizes:"(max-width: 768px) 100vw, 50vw",className:"object-cover"})}),(0,s.jsxs)("div",{className:"flex items-center gap-4 p-3 bg-gray-50 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:b.source_site})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(q.A,{className:"w-4 h-4 text-yellow-500"}),(0,s.jsxs)("span",{className:"text-sm",children:[b.rating,"/5 (",b.review_count," reviews)"]})]})]})]})})]}),(0,s.jsxs)(o.Zp,{className:"shadow-lg",children:[(0,s.jsx)(o.aR,{children:(0,s.jsxs)("h4",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)(M.A,{className:"w-5 h-5 text-primary"}),"Product Details",(0,s.jsxs)(u.E,{variant:"outline",className:"ml-auto",children:[(0,s.jsx)(H.A,{className:"w-3 h-3 mr-1"}),"Smart Detection"]})]})}),(0,s.jsxs)(o.Wu,{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Product Name"}),(0,s.jsx)(d.p,{value:R.title,onChange:e=>P(t=>t?{...t,title:e.target.value}:null),className:"font-medium",placeholder:"Enter product name"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Description"}),(0,s.jsx)("textarea",{value:R.description,onChange:e=>P(t=>t?{...t,description:e.target.value}:null),className:"w-full p-3 border border-gray-200 rounded-lg resize-none focus:ring-2 focus:ring-primary focus:border-transparent",rows:3,placeholder:"Enter product description"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Price"}),(0,s.jsx)(d.p,{type:"number",step:"0.01",value:R.price,onChange:e=>P(t=>t?{...t,price:e.target.value}:null),placeholder:"0.00"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Currency"}),(0,s.jsxs)("select",{value:R.currency,onChange:e=>P(t=>t?{...t,currency:e.target.value}:null),className:"w-full p-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",children:[(0,s.jsx)("option",{value:"USD",children:"USD"}),(0,s.jsx)("option",{value:"CAD",children:"CAD"}),(0,s.jsx)("option",{value:"EUR",children:"EUR"}),(0,s.jsx)("option",{value:"GBP",children:"GBP"}),(0,s.jsx)("option",{value:"INR",children:"INR"})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Category"}),(0,s.jsxs)("select",{value:R.category,onChange:e=>P(t=>t?{...t,category:e.target.value}:null),className:"w-full p-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",children:[(0,s.jsx)("option",{value:"General",children:"General"}),(0,s.jsx)("option",{value:"Toys",children:"\uD83E\uDDF8 Toys"}),(0,s.jsx)("option",{value:"Clothing",children:"\uD83D\uDC55 Clothing"}),(0,s.jsx)("option",{value:"Health & Safety",children:"\uD83C\uDFE5 Health & Safety"}),(0,s.jsx)("option",{value:"Feeding",children:"\uD83C\uDF7C Feeding"}),(0,s.jsx)("option",{value:"Nursery",children:"\uD83D\uDECFï¸ Nursery"}),(0,s.jsx)("option",{value:"Books",children:"\uD83D\uDCDA Books"}),(0,s.jsx)("option",{value:"Bath & Potty",children:"\uD83D\uDEC1 Bath & Potty"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Brand"}),(0,s.jsx)(d.p,{value:R.brand,onChange:e=>P(t=>t?{...t,brand:e.target.value}:null),placeholder:"Enter brand name"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Available Country"}),(0,s.jsxs)("select",{value:R.country,onChange:e=>P(t=>t?{...t,country:e.target.value}:null),className:"w-full p-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",children:[(0,s.jsx)("option",{value:"US",children:"\uD83C\uDDFA\uD83C\uDDF8 United States"}),(0,s.jsx)("option",{value:"CA",children:"\uD83C\uDDE8\uD83C\uDDE6 Canada"}),(0,s.jsx)("option",{value:"UK",children:"\uD83C\uDDEC\uD83C\uDDE7 United Kingdom"}),(0,s.jsx)("option",{value:"IN",children:"\uD83C\uDDEE\uD83C\uDDF3 India"})]})]})]})]}),(0,s.jsxs)(o.Zp,{className:"shadow-lg",children:[(0,s.jsx)(o.aR,{children:(0,s.jsxs)("h4",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)(G.A,{className:"w-5 h-5 text-pink-500"}),"Registry Options"]})}),(0,s.jsxs)(o.Wu,{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Quantity"}),(0,s.jsx)(d.p,{type:"number",min:"1",value:R.quantity,onChange:e=>P(t=>t?{...t,quantity:parseInt(e.target.value)||1}:null)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Priority"}),(0,s.jsxs)("select",{value:R.priority,onChange:e=>P(t=>t?{...t,priority:e.target.value}:null),className:"w-full p-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",children:[(0,s.jsx)("option",{value:"low",children:"\uD83D\uDCC9 Low"}),(0,s.jsx)("option",{value:"medium",children:"â¡ï¸ Medium"}),(0,s.jsx)("option",{value:"high",children:"\uD83D\uDCC8 High"})]})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:"Personal Note"}),(0,s.jsx)("textarea",{value:R.note,onChange:e=>P(t=>t?{...t,note:e.target.value}:null),className:"w-full p-3 border border-gray-200 rounded-lg resize-none focus:ring-2 focus:ring-primary focus:border-transparent",rows:2,placeholder:"Add a personal note (optional)"})]})]})]}),(0,s.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,s.jsxs)(c.Button,{onClick:()=>
1{if(!ex)return void C(!0);w(!0),setTimeout(()=>{eg({title:"Product Added! \uD83C\uDF89",description:"".concat(R.title," has been added to your registry.")}),m("main"),w(!1)},1500)},disabled:N,className:"flex-1 bg-green-600 hover:bg-green-700 text-white py-6 text-lg font-semibold",children:[N?(0,s.jsx)(U.A,{className:"w-5 h-5 mr-2 animate-spin"}):(0,s.jsx)(f.A,{className:"w-5 h-5 mr-2"}),N?"Adding to Registry...":"Add to Registry"]}),(0,s.jsxs)(c.Button,{variant:"outline",onClick:()=>window.open(b.source_url,"_blank"),className:"px-6 py-6",children:[(0,s.jsx)(W.A,{className:"w-5 h-5 mr-2"}),"View Original"]})]})]})})]}),(0,s.jsx)(A.E,{open:_,onClose:()=>C(!1),onSuccess:()=>{C(!1),eg({title:"Product Added!",description:"The product has been added to your registry."}),m("main")}})]}):"create-manual"===n?(0,s.jsxs)("div",{className:"text-center py-12 px-4 max-w-4xl mx-auto",children:[(0,s.jsxs)("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-5 duration-300 ease-out",children:[(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsxs)(c.Button,{variant:"ghost",onClick:()=>m("main"),className:"mb-4 text-gray-600 hover:text-gray-900",children:[(0,s.jsx)(L.A,{className:"w-4 h-4 mr-2 rotate-180"}),"Back"]}),(0,s.jsx)("div",{className:"w-16 h-16 bg-gradient-to-r from-green-500 to-emerald-600 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(f.A,{className:"w-8 h-8 text-white"})}),(0,s.jsx)("h2",{className:"text-3xl font-bold text-gray-900",children:"Create Product Manually"}),(0,s.jsx)("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Add a product to your registry by entering the details manually"})]}),(0,s.jsxs)(o.Zp,{className:"max-w-2xl mx-auto shadow-lg text-left",children:[(0,s.jsxs)(o.aR,{children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:"Product Information"}),(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Fill out the required fields below. You can add more details in the optional section."})]}),(0,s.jsxs)(o.Wu,{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-red-600",children:"*"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Required Fields"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-semibold text-gray-700",children:["Product Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(d.p,{value:er.name,onChange:e=>es(t=>({...t,name:e.target.value})),placeholder:"Enter product name",className:"w-full",disabled:ed})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-semibold text-gray-700",children:["Price ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(d.p,{type:"number",step:"0.01",min:"0",value:er.price,onChange:e=>es(t=>({...t,price:e.target.value})),placeholder:"0.00",disabled:ed})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-semibold text-gray-700",children:["Currency ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsxs)("select",{value:er.currency,onChange:e=>es(t=>({...t,currency:e.target.value})),className:"w-full p-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",disabled:ed,children:[(0,s.jsx)("option",{value:"USD",children:"USD ($)"}),(0,s.jsx)("option",{value:"CAD",children:"CAD ($)"}),(0,s.jsx)("option",{value:"EUR",children:"EUR (â¬)"}),(0,s.jsx)("option",{value:"GBP",children:"GBP (\xa3)"}),(0,s.jsx)("option",{value:"INR",children:"INR (â¹)"})]})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-semibold text-gray-700",children:["Category ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsxs)("select",{value:er.category_id,onChange:e=>es(t=>({...t,category_id:e.target.value})),className:"w-full p-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",disabled:ed||el,children:[(0,s.jsx)("option",{value:"",children:"Select a category"}),ea.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]}),el&&(0,s.jsx)("p",{className:"text-xs text-gray-500",children:"Loading c
1ategories..."})]})]}),(0,s.jsx)(I.w,{}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)(c.Button,{type:"button",variant:"outline",onClick:()=>eo(!ec),className:"w-full justify-between",disabled:ed,children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(q.A,{className:"w-4 h-4 text-gray-500"}),"Optional Details"]}),(0,s.jsx)(L.A,{className:(0,K.cn)("w-4 h-4 transition-transform",ec&&"rotate-90")})]}),ec&&(0,s.jsxs)("div",{className:"space-y-4 overflow-hidden animate-in fade-in slide-in-from-top-2 duration-300 ease-out",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-medium text-gray-700",children:["Product Image ",(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"(optional - we'll use a placeholder if not provided)"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.p,{value:em,onChange:e=>eh(e.target.value),placeholder:"Paste image URL here",className:"flex-1",disabled:ed}),(0,s.jsx)(c.Button,{type:"button",onClick:()=>{em.trim()&&(es(e=>({...e,image_url:em.trim()})),eh(""))},disabled:!em.trim()||ed,variant:"outline",className:"px-4",children:"Add"})]}),er.image_url&&(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg",children:[(0,s.jsx)($.ProductImage,{src:er.image_url,alt:"Product preview",width:64,height:64,className:"w-16 h-16 object-cover rounded border"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:"Image added"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 truncate",children:er.image_url})]}),(0,s.jsx)(c.Button,{type:"button",onClick:()=>es(e=>({...e,image_url:""})),variant:"ghost",size:"sm",disabled:ed,children:"Remove"})]}),!er.image_url&&(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-blue-50 rounded-lg border border-blue-200",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-gradient-to-br from-blue-100 to-blue-200 rounded border flex items-center justify-center",children:(0,s.jsx)(V.A,{className:"w-8 h-8 text-blue-500"})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-blue-700",children:"Default placeholder will be used"}),(0,s.jsx)("p",{className:"text-xs text-blue-600",children:"You can add a custom image later if needed"})]})]})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Description"}),(0,s.jsx)("textarea",{value:er.description,onChange:e=>es(t=>({...t,description:e.target.value})),placeholder:"Enter product description",className:"w-full p-3 border border-gray-200 rounded-lg resize-none focus:ring-2 focus:ring-primary focus:border-transparent",rows:3,disabled:ed})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Brand"}),(0,s.jsx)(d.p,{value:er.brand,onChange:e=>es(t=>({...t,brand:e.target.value})),placeholder:"Brand name",disabled:ed})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Sub-category"}),(0,s.jsx)(d.p,{value:er.sub_category,onChange:e=>es(t=>({...t,sub_category:e.target.value})),placeholder:"Sub-category",disabled:ed})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Product Link"}),(0,s.jsx)(d.p,{value:er.product_link,onChange:e=>es(t=>({...t,product_link:e.target.value})),placeholder:"https://store.com/product-link",disabled:ed})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Features"}),(0,s.jsx)("textarea",{value:er.features,onChange:e=>es(t=>({...t,features:e.target.value})),placeholder:"List key features (one per line)",className:"w-full p-3 border border-gray-200 rounded-lg resize-none focus:ring-2 focus:ring-primary focus:border-transparent",rows:3,disabled:ed})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Availability"}),(0,s.jsxs)("select",{value:er.availability,onChange:e=>es(t=>({...t,availability:e.target.value})),className:"w-full p-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",disabled:ed,children:[(0,s.jsx)("option",{value:"In Stock",children:"In Stock"}),(0,s.jsx)("option",{value:"Out of Stock",children:"Out of Stock"}),(0,s.jsx)("option",{value:"Pre-order",children:"Pre-order"}),(0,s.jsx)("option",{value:"Discontinued",children:"Discontinued"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Country"}),(0,s.jsxs)("select",{value:er.country,onChange:e=>es(t=>({...t,country:e.target.value})),className:"w-full p-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",disabled:ed,children:[(0,s.jsx)("option",{value:"US",children:"\uD83C\uDDFA\uD83C\uDDF8 United States"}),(0,s.jsx)("option",{value:"CA",children:"\uD83C\uDDE8\uD83C\uDDE6 Canada"}),(0,s.jsx)("option",{value:"UK",children:"\uD83C\uDDEC\uD83C\uDDE7 United Kingdom"}),(0,s.jsx)("option",{value:"IN",children:"\uD83C\uDDEE\uD83C\uDDF3 India"})]})]})]})]})]}),(0,s.jsx)(I.w,{}),(0,s.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,s.jsxs)(c.Button,{onClick:ew,disabled:ed||!er.name.trim()||!er.price||!er.category_id,className:"flex-1 bg-green-600 hover:bg-green-700 text-white py-6 text-lg font-semibold",children:[ed?(0,s.jsx)(U.A,{className:"w-5 h-5 mr-2 animate-spin"}):(0,s.jsx)(f.A,{className:"w-5 h-5 mr-2"}),ed?"Creating Product...":"Create & Add to Registry"]}),(0,s.jsx)(c.Button,{variant:"outline",onClick:()=>m("main"),disabled:ed,className:"px-6 py-6",children:"Cancel"})]})]})]})]}),(0,s.jsx)(A.E,{open:_,onClose:()=>C(!1),onSuccess:()=>{C(!1),ew()}})]}):(0,s.jsxs)("div",{className:"text-center py-12 px-4 max-w-6xl mx-auto relative",children:[(0,s.jsx)("style",{children:"\n @keyframes bfb-float-icon {\n 0% { transform: translateY(100px) rotate(0deg); opacity: 0; }\n 50% { transform: translateY(-20px) rotate(360deg); opacity: 0.2; }\n 100% { transform: translateY(100px) rotate(720deg); opacity: 0; }\n }\n @keyframes bfb-pop-in {\n 0% { transform: scale(0); }\n 70% { transform: scale(1.1); }\n 100% { transform: scale(1); }\n }\n "}),(0,s.jsxs)("div",{className:"absolute inset-0 pointer-events-none",children:[(0,s.jsx)(eN,{delay:0,className:"top-20 left-10 text-pink-300",children:(0,s.jsx)(V.A,{className:"w-8 h-8"})}),(0,s.jsx)(eN,{delay:1,className:"top-32 right-16 text-purple-300",children:(0,s.jsx)(J.A,{className:"w-6 h-6"})}),(0,s.jsx)(eN,{delay:2,className:"bottom-32 left-20 text-blue-300",children:(0,s.jsx)(G.A,{className:"w-7 h-7"})})]}),(0,s.jsxs)("div",{className:"space-y-12 relative animate-in fade-in slide-in-from-bottom-5 duration-300 ease-out",children:[(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{style:{animation:"bfb-pop-in 0.5s ease-out 0.2s both"},className:"w-24 h-24 bg-gradient-to-r from-primary via-purple-600 to-pink-600 rounded-full flex items-center justify-center mx-auto
1shadow-lg",children:(0,s.jsx)(Y.A,{className:"w-12 h-12 text-white"})}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("h2",{className:"text-4xl font-bold text-gray-900",children:["No products found",l&&(0,s.jsxs)("span",{className:"block text-2xl font-medium text-gray-600 mt-2",children:["for ",l]})]}),(0,s.jsx)("p",{className:"text-xl text-gray-600 max-w-3xl mx-auto leading-relaxed",children:"Don't worry! You can add products from any website with our powerful Chrome extension or by pasting URLs directly."})]})]}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 gap-8 items-center",children:[(0,s.jsxs)("div",{className:"text-left space-y-6 animate-in fade-in slide-in-from-left-12 duration-300 ease-out fill-mode-both",style:{animationDelay:"400ms"},children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(O.A,{className:"w-10 h-10 text-blue-500"}),(0,s.jsx)("h3",{className:"text-3xl font-bold text-gray-900",children:"Chrome Extension"}),(0,s.jsxs)(u.E,{className:"bg-green-100 text-green-800 border-green-200",children:[(0,s.jsx)(B.A,{className:"w-3 h-3 mr-1"}),"Recommended"]})]}),(0,s.jsx)("p",{className:"text-lg text-gray-600 leading-relaxed",children:"Shop anywhere on the web and add products to your registry with one click. Works on Amazon, Walmart, Target, and thousands of other sites."})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 text-gray-700",children:[(0,s.jsx)(y.A,{className:"w-5 h-5 text-green-600"}),(0,s.jsx)("span",{children:"One-click product addition from any website"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-gray-700",children:[(0,s.jsx)(y.A,{className:"w-5 h-5 text-green-600"}),(0,s.jsx)("span",{children:"Automatic price tracking and alerts"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-gray-700",children:[(0,s.jsx)(y.A,{className:"w-5 h-5 text-green-600"}),(0,s.jsx)("span",{children:"Smart product categorization"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-gray-700",children:[(0,s.jsx)(y.A,{className:"w-5 h-5 text-green-600"}),(0,s.jsx)("span",{children:"Works with 10,000+ online stores"})]})]}),(0,s.jsxs)(c.Button,{onClick:eb,size:"lg",className:"bg-blue-600 hover:bg-blue-700 text-white px-8 py-6 text-lg font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",children:[(0,s.jsx)(F.A,{className:"w-5 h-5 mr-3"}),"Install Chrome Extension"]})]}),(0,s.jsx)("div",{className:"relative animate-in fade-in slide-in-from-right-12 duration-300 ease-out fill-mode-both",style:{animationDelay:"600ms"},children:(0,s.jsxs)("div",{className:"bg-gradient-to-br from-gray-100 to-gray-200 rounded-2xl p-8 shadow-2xl",children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl p-6 shadow-lg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-gradient-to-r from-primary to-pink-600 rounded-lg flex items-center justify-center",children:(0,s.jsx)(V.A,{className:"w-4 h-4 text-white"})}),(0,s.jsx)("span",{className:"font-semibold text-gray-900",children:"BuyForBaby"})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-12 h-12 bg-gray-200 rounded-lg"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"h-3 bg-gray-200 rounded w-3/4 mb-1"}),(0,s.jsx)("div",{className:"h-2 bg-gray-100 rounded w-1/2"})]})]}),(0,s.jsxs)(c.Button,{className:"w-full bg-green-600 hover:bg-green-700 text-white",children:[(0,s.jsx)(f.A,{className:"w-4 h-4 mr-2"}),"Add to Registry"]})]})]}),(0,s.jsx)("div",{className:"absolute -top-2 -right-2",children:(0,s.jsx)(M.A,{className:"w-8 h-8 text-yellow-500 animate-pulse"})}),(0,s.jsx)("div",{className:"absolute -bottom-2 -left-2",children:(0,s.jsx)(H.A,{className:"w-6 h-6 text-purple-500 animate-bounce"})})]})})]}),(0,s.jsx)(I.w,{className:"my-12"}),(0,s.jsxs)("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-8 duration-300 ease-out fill-mode-both",style:{animationDelay:"800ms"},children:[(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,s.jsx)(z.A,{className:"w-8 h-8 text-primary"}),(0,s.jsx)("h3",{className:"text-2xl font-bold text-gray-900",children:"Add Products to Your Registry"})]}),(0,s.jsx)("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Choose how you'd like to add products to your registry"})]}),(0,s.jsxs)("div",{className:"grid md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:[(0,s.jsx)(o.Zp,{className:"shadow-lg border-dashed border-2 border-gray-300 hover:border-primary transition-colors",children:(0,s.jsxs)(o.Wu,{className:"p-8 text-center space-y-6",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-gradient-to-r from-primary to-pink-600 rounded-full flex items-center justify-center mx-auto",children:(0,s.jsx)(z.A,{className:"w-8 h-8 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Add from URL"}),(0,s.jsx)("p",{className:"text-gray-600",children:"Paste any product URL and we'll automatically extract the details"})]}),(0,s.jsxs)(c.Button,{onClick:()=>m("add-product"),size:"lg",className:"w-full bg-gradient-to-r from-primary to-pink-600 hover:from-primary/90 hover:to-pink-600/90 text-white py-4 text-lg font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",children:[(0,s.jsx)(z.A,{className:"w-5 h-5 mr-3"}),"Get Product Details from URL",(0,s.jsx)(L.A,{className:"w-5 h-5 ml-3"})]})]})}),(0,s.jsx)(o.Zp,{className:"shadow-lg border-dashed border-2 border-green-300 hover:border-green-500 transition-colors",children:(0,s.jsxs)(o.Wu,{className:"p-8 text-center space-y-6",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-gradient-to-r from-green-500 to-emerald-600 rounded-full flex items-center justify-center mx-auto",children:(0,s.jsx)(f.A,{className:"w-8 h-8 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Create Manually"}),(0,s.jsx)("p",{className:"text-gray-600",children:"Add product details manually with our simple form"})]}),(0,s.jsxs)(c.Button,{onClick:()=>m("create-manual"),size:"lg",className:"w-full bg-gradient-to-r from-green-500 to-emerald-600 hover:from-green-500/90 hover:to-emerald-600/90 text-white py-4 text-lg font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",children:[(0,s.jsx)(f.A,{className:"w-5 h-5 mr-3"}),"Create Product",(0,s.jsx)(L.A,{className:"w-5 h-5 ml-3"})]})]})})]}),(0,s.jsxs)("div",{className:"text-xs text-gray-500 text-center",children:[(0,s.jsx)(Z.A,{className:"w-4 h-4 inline mr-1"}),"All methods are secure and privacy-focused"]})]})]})]})}
1var Q=r(13630),ee=r(99190),et=r(41618),er=r(2944),es=r(69323);let ea="\n id, name, description, price, currency, country, available_countries,\n product_link, external_url, external_id, store_name, store_domain, brand,\n features, category_id, checklist_category_id, checklist_subcategory_id,\n created_at, updated_at, duplicate_of,\n category:categories!category_id ( name, slug ),\n images:product_images!product_id (\n id,\n url:image_url,\n sort_order:display_order\n ),\n checklist_category:checklist_categories!checklist_category_id (\n id,\n name,\n slug,\n icon\n ),\n checklist_subcategory:checklist_subcategories!checklist_subcategory_id (\n id,\n name,\n slug\n )\n";async function ei(e,t){let{country:r,categoryId:s=null,subcategoryId:a=null,search:i="",page:l,pageSize:n}=t,c=e.from("products").select(ea,{count:"exact"}).eq("country",r).is("duplicate_of",null);s&&(c=c.eq("checklist_category_id",s)),a&&(c=c.eq("checklist_subcategory_id",a));let o=function(e){let t=e.trim().replace(/[\\"]/g," ").trim();if(!t)return null;let r=t.replace(/[%_]/g,e=>"\\\\".concat(e));return"%".concat(r,"%")}(i);o&&(c=c.or('name.ilike."'.concat(o,'",description.ilike."').concat(o,'"')));let d=l*n,{data:u,error:m,count:h}=await c.order("created_at",{ascending:!1}).order("id",{ascending:!1}).range(d,d+n-1);return{rows:null!=u?u:[],count:null!=h?h:null,error:m}}async function el(e,t){let{data:r,error:s}=await e.from("featured_products").select("\n product_id,\n display_order,\n product:products!product_id (".concat(ea,")\n ")).contains("countries",[t]).order("display_order",{ascending:!0});if(s)throw s;let a=[],i=[];return(null!=r?r:[]).forEach((e,r)=>{var s;if(!e.product_id)return;a.push([e.product_id,null!=(s=e.display_order)?s:r]);let l=Array.isArray(e.product)?e.product[0]:e.product;l&&l.country===t&&!l.duplicate_of&&i.push(l)}),{order:a,rows:i}}var en=r(92291),ec=r(93411),eo=r(96869),ed=r(70929);let eu={compact:{grid:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4 lg:gap-5",imageSizes:"(max-width: 640px) 50vw, (max-width: 1024px) 33vw, (max-width: 1280px) 20vw, 180px",cardBody:"p-2.5",bodySpacing:"space-y-1.5",chipClass:"text-[10px] px-1.5 py-0",titleClass:"text-xs sm:text-sm leading-snug",priceSection:"mt-2 space-y-2",priceText:"text-base",buttonContainer:"flex flex-col gap-1.5",buttonClass:"w-full h-10 sm:h-8 text-xs px-2",buttonIconClass:"w-3.5 h-3.5 mr-1"},standard:{grid:"grid-cols-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 sm:gap-4 lg:gap-5",imageSizes:"(max-width: 768px) 50vw, (max-width: 1024px) 40vw, (max-width: 1280px) 25vw, 230px",cardBody:"p-3",bodySpacing:"space-y-2",chipClass:"text-xs",titleClass:"text-sm leading-snug",priceSection:"mt-3 space-y-2.5",priceText:"text-lg",buttonContainer:"flex gap-2",buttonClass:"flex-1 h-10 sm:h-9 text-sm",buttonIconClass:"w-4 h-4 mr-1.5"},large:{grid:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-4 sm:gap-5 lg:gap-6",imageSizes:"(max-width: 640px) 100vw, (max-width: 768px) 50vw, (max-width: 1280px) 40vw, 310px",cardBody:"p-4",bodySpacing:"space-y-2.5",chipClass:"text-xs",titleClass:"text-base leading-snug",priceSection:"mt-3 space-y-3",priceText:"text-2xl",buttonContainer:"flex gap-2",buttonClass:"flex-1 h-10 text-sm",buttonIconClass:"w-4 h-4 mr-2"}};function em(e){var t,r,l,I;let{initialData:L}=e,z=(0,i.useRouter)(),U=(0,i.usePathname)(),T=(0,i.useSearchParams)(),O=(0,a.useRef)(L).current,[B,F]=(0,a.useState)([]),[M,q]=(0,a.useState)(()=>{var e;return new Map(null!=(e=null==O?void 0:O.featured.order)?e:[])}),[H,G]=(0,a.useState)(()=>{var e;return null!=(e=null==O?void 0:O.featured.rows)?e:[]}),[W,V]=(0,a.useState)(null!=(r=null==O?void 0:O.country)?r:null),J=(0,a.useRef)(!1),Y=(0,a.useRef)(0),[Z,ea]=(0,a.useState)(null),[em,eh]=(0,a.useState)(null),[ex,eg]=(0,a.useState)(new Set),[ep,ey]=(0,a.useState)(!1),[ef,ev]=(0,a.useState)(!1),{getPlaceholderImage:eb}=(0,Q.N)(),[ej,eN]=(0,a.useState)(null),ew=(0,a.useRef)(U),e_=(0,a.useRef)(!1),[ek,eC]=(0,a.useState)(()=>{var e;return null!=(e=T.get("search"))?e:""}),[eS,eA]=(0,a.useState)(()=>{var e;return null!=(e=T.get("search"))?e:""}),eD=(0,a.useRef)(null),eE=(0,a.useRef)(null),eR=(0,a.useRef)(null),{registryItems:eP=[],addItem:eI,removeItem:eL}=(0,_.b)(),{user:ez}=(0,k.A)(),{selectedCountry:eU,isLoading:eT}=(0,C.S)(),{features:eO}=(0,S.E)(),{toast:eB}=(0,D.dj)(),{currency:eF,country:eM,isLoading:eq}=(0,et.Y)(),{discoverCardSize:eH}=(0,er.f)(),eG=eu[eH],eW=(0,j.h)(),eV="checklist"===T.get("from");(0,a.useEffect)(()=>
1{if(U!==ew.current)return;let e=T.get("search"),t=T.get("category"),r=T.get("subcategory"),s=T.toString(),a=s!==eE.current;if(eE.current=s,a&&s!==eD.current&&eC(null!=e?e:""),B.length>0){let e=!1,s=!1;if(r)for(let t of B){let a=t.subcategories.find(e=>e.slug===r||e.name.toLowerCase()===r.toLowerCase());if(a){ea(t),eh(a),eg(new Set([t.id])),s=!0,e=!0;break}}if(!s&&t){let r=B.find(e=>e.slug===t||e.name.toLowerCase()===t.toLowerCase());r&&(ea(r),eh(null),r.subcategories.length>0&&eg(new Set([r.id])),e=!0)}e||(ea(null),eh(null))}},[T,B,U]);let eJ=(0,w.U)();null==eO||null==(t=eO.mobile_compact_product_cards)||t.enabled;let eY=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/v1/checklist/categories");if(e.ok){let t=await e.json();F(t.categories||[])}}catch(e){console.error("Error fetching checklist categories:",e)}},[]);(0,a.useEffect)(()=>{let e=setTimeout(()=>eA(ek),350);return()=>clearTimeout(e)},[ek]);let eZ=O&&eq?O.country:eM||eU||"CA",{rows:eK,totalCount:e$,loading:eX,loadingMore:eQ,hasLoaded:e0,hasMore:e1,loadMore:e2}=function(e){let{country:t,categoryId:r=null,subcategoryId:s=null,search:i="",pageSize:l=24,enabled:n=!0,initialData:c}=e,[o]=(0,a.useState)(()=>c?c.country!==t||c.pageSize!==l||r||s||i.trim()?null:c:null),[d,u]=(0,a.useState)(()=>o?o.rows:[]),[m,h]=(0,a.useState)(o?o.totalCount:0),[x,g]=(0,a.useState)(!o),[p,y]=(0,a.useState)(!1),[f,v]=(0,a.useState)(!!o),[b,j]=(0,a.useState)(!!o&&o.rows.length<o.totalCount),[N,_]=(0,a.useState)(!1),k=(0,a.useRef)(0),C=(0,a.useRef)(0),S=(0,a.useRef)(!1),A=(0,a.useRef)(0),D=(0,a.useRef)(null),E=(0,a.useRef)(!1),R=()=>{null!==D.current&&(clearTimeout(D.current),D.current=null)},P=i.trim(),I=(0,a.useCallback)(async(e,a)=>{let i=(0,w.U)(),n=a?++C.current:C.current;R(),S.current=!0,a?g(!0):y(!0);let c=()=>{if(!a)_(!0),A.current>=2||(D.current=setTimeout(()=>{D.current=null,n!==C.current||S.current||I(e,!1)},1500*++A.current))};try{let{rows:o,error:d,count:m}=await ei(i,{country:t,categoryId:r,subcategoryId:s,search:P,page:e,pageSize:l});if(n!==C.current)return;if(d){console.error("Error fetching products page:",d),a?(u([]),h(0),j(!1)):c();return}let x=e*l+l-1;k.current=e,A.current=0,_(!1),h(null!=m?m:0),u(e=>{if(a)return o;let t=new Set(e.map(e=>e.id));return[...e,...o.filter(e=>!t.has(e.id))]}),j(null!=m?x+1<m:o.length===l)}catch(e){console.error("Error fetching products page:",e),n===C.current&&c()}finally{n===C.current&&(S.current=!1,g(!1),y(!1),v(!0))}},[t,r,s,P,l]);(0,a.useEffect)(()=>{if(n)return(k.current=0,A.current=0,_(!1),E.current||(E.current=!0,!o||o.country!==t||o.pageSize!==l||r||s||P))?(I(0,!0),R):R},[n,I,o,t,r,s,P,l]);let L=(0,a.useCallback)(()=>{n&&!S.current&&b&&(A.current=0,I(k.current+1,!1))},[n,b,I]);return{rows:d,totalCount:m,loading:x,loadingMore:p,hasLoaded:f,hasMore:b,loadMore:L,loadMoreError:N}}({country:eZ,categoryId:null!=(l=null==Z?void 0:Z.id)?l:null,subcategoryId:null!=(I=null==em?void 0:em.id)?I:null,search:eS,pageSize:24,enabled:!eT,initialData:O?{rows:O.products.rows,totalCount:O.products.totalCount,country:O.country,pageSize:O.pageSize}:void 0}),e5=(0,a.useCallback)(async()=>{let e=eM||eU||"CA";if(!J.current&&(J.current=!0,O&&O.country===e))return;let t=++Y.current;try{let{order:r,rows:s}=await el(eJ,e);if(t!==Y.current)return;q(new Map(r)),G(s)}catch(e){console.error("Error fetching featured products:",e)}finally{t===Y.current&&V(e)}},[eM,eU,eJ,O]);(0,a.useEffect)(()=>{eT||(eY(),e5())},[eT,eM,eY,e5]);let e4=(0,a.useCallback)(e=>{var t;return{id:e.id,name:e.name,description:e.description,price:e.price,currency:eF||e.currency||"INR",features:Array.isArray(e.features)?e.features:"string"==typeof e.features?[e.features]:null,product_link:(0,R.lD)(e)||e.product_link,country:e.country,available_countries:e.available_countries||[],image_url:e.image_url||null,product_images:(null==(t=e.images)?void 0:t.map(e=>({id:e.id,image_url:e.url,display_order:e.sort_order})))||[],category:(0,ec.$y)(e),checklist_category:e.checklist_category,checklist_subcategory:e.checklist_subcategory}},[eF]),e3=(0,a.useMemo)(()=>eK.map(e4),[eK,e4]),e6=(0,a.useMemo)(()=>H.map(e4),[H,e4]),e7=(0,a.useMemo)(()=>{let e=eS.trim().toLowerCase(),t=e6.filter(t=>{var r,s,a;return(!e||!!(t.name.toLowerCase().includes(e)||(null!=(a=t.description)?a:"").toLowerCase().includes(e)))&&(!Z||(null==(r=t.checklist_category)?void 0:r.id)===Z.id)&&(!em||(null==(s=t.checklist_subcategory)?void 0:s.id)===em.id)}).sort((e,t)=>
1{var r,s;return(null!=(r=M.get(e.id))?r:0)-(null!=(s=M.get(t.id))?s:0)}),r=new Set(e6.map(e=>e.id));return[...t,...e3.filter(e=>!r.has(e.id))]},[e6,M,e3,eS,Z,em]),e9=Math.max(e$,e7.length),e8=(0,a.useRef)(0);e8.current=e9,(0,a.useEffect)(()=>{if(!ek.trim())return;let e=setTimeout(()=>{es.zS.track(es.f7.SHOP.SEARCH_PERFORMED,{search_query:ek.trim(),result_count:e8.current,location:"discover"})},800);return()=>clearTimeout(e)},[ek]),(0,a.useEffect)(()=>{var e,t,r,s,a,i;if(U!==ew.current||0===B.length&&(T.get("category")||T.get("subcategory")))return;let l=JSON.stringify([eS.trim(),null!=(e=null==Z?void 0:Z.slug)?e:null,null!=(t=null==em?void 0:em.slug)?t:null]);if(l===eR.current)return;eR.current=l;let n=new URLSearchParams(T.toString()),c=(e,t)=>{t?n.set(e,t):n.delete(e)};c("search",eS.trim()||null),c("category",null!=(r=null==Z?void 0:Z.slug)?r:null),c("subcategory",null!=(s=null==em?void 0:em.slug)?s:null);let o=n.toString();if(o===T.toString())return;let d=T.get("category")!==(null!=(a=null==Z?void 0:Z.slug)?a:null)||T.get("subcategory")!==(null!=(i=null==em?void 0:em.slug)?i:null);eD.current=o;let u=o?"".concat(U,"?").concat(o):U;d?window.history.pushState(null,"",u):window.history.replaceState(null,"",u)},[eS,Z,em,B,T,U]);let[te,tt]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!te)return;let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&e2()},{rootMargin:"800px 0px"});return e.observe(te),()=>e.disconnect()},[te,e2,e3.length]);let tr=async(e,t)=>{if(t.stopPropagation(),t.preventDefault(),!ez){eN(e);try{localStorage.setItem("bfb_pending_registry_item",JSON.stringify({id:e.id,name:e.name,price:e.price,description:e.description,product_link:e.product_link,features:e.features,product_images:e.product_images,category:e.category,checklist_subcategory_id:e.checklist_subcategory_id,currency:e.currency,timestamp:Date.now()}))}catch(e){console.error("Failed to save pending product to localStorage:",e)}es.zS.track(es.f7.UI.MODAL_OPENED,{modal_name:"login_dialog",modal_trigger:"add_to_registry",location:"discover",product_id:e.id}),ev(!0);return}if(eP.some(t=>t.id===e.id))try{await eL(e.id,"discover"),eB({title:"Removed from Registry",description:"".concat(e.name," has been removed from your registry.")})}catch(e){console.error("Error removing from registry:",e),eB({title:"Error",description:"Failed to remove from registry. Please try again.",variant:"destructive"})}else await ts(e)},ts=async e=>{try{let t={...e,features:Array.isArray(e.features)?e.features:"string"==typeof e.features?[e.features]:null};await eI(t,!1,void 0,"discover"),eB({title:"Added to Registry! \uD83C\uDF89",description:"".concat(e.name," has been added to your registry.")})}catch(e){console.error("Failed to add to registry:",e),eB({title:"Error",description:e.message||"Failed to add item to registry",variant:"destructive"})}},ta=e=>e.product_images&&e.product_images.length>0?[...e.product_images].sort((e,t)=>e.display_order-t.display_order)[0].image_url:e.image_url?e.image_url:null,ti=e=>eP.some(t=>t.id===e),tl=(0,en.jl)(U),tn=(0,a.useMemo)(()=>{var e,t;return tl&&null!=(t=null!=(e=e6.find(e=>e.id===tl))?e:e3.find(e=>e.id===tl))?t:null},[tl,e6,e3]);(0,a.useEffect)(()=>{U===ew.current&&(e_.current=!1)},[U]);let tc=e=>{if(es.zS.track(es.f7.SHOP.CATEGORY_SELECTED,{category_name:(null==e?void 0:e.name)||"all_products",location:"discover"}),!e){ea(null),eh(null);return}(null==Z?void 0:Z.id)===e.id&&e.subcategories.length>0?eg(t=>{let r=new Set(t);return r.has(e.id)?r.delete(e.id):r.add(e.id),r}):(ea(e),eh(null),e.subcategories.length>0&&eg(t=>{let r=new Set(t);return r.add(e.id),r}))},to=(e,t)=>{es.zS.track(es.f7.SHOP.CATEGORY_SELECTED,{category_name:(null==t?void 0:t.name)||(null==Z?void 0:Z.name),subcategory_name:(null==e?void 0:e.name)||"all",location:"discover"}),eh(e),e&&t&&ea(t)},td=()=>(0,s.jsxs)("div",{className:"bg-white rounded-lg overflow-hidden shadow-sm animate-pulse",children:[(0,s.jsx)("div",{className:"aspect-square bg-gradient-to-br from-gray-200 via-gray-100 to-gray-200"}),(0,s.jsxs)("div",{className:"p-3 sm:p-4 space-y-2.5",children:[(0,s.jsx)("div",{className:"h-4 bg-gray-200 rounded-full w-3/4"}),(0,s.jsx)("div",{className:"h-3 bg-gray-100 rounded-full w-1/2"}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-1",children:[(0,s.jsx)("div",{className:"h-5 bg-gray-200 rounded-full w-20"}),(0,s.jsx)("div",{className:"h-8 w-8 bg-gray-200 rounded-full"})]})]})]});return eT&&!O?(0,s.jsx)("main",{className:"min-h-screen supports-[min-height:100dvh]:min-h-dvh bg-gray-50 pt-14 lg:pt-16",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 pt-4 pb-4 lg:pt-8",children:(0,s.jsxs)("div",{className:"flex gap-8",children:[(0,s.jsx)("div",{className:"hidden md:block w-64 flex-shrink-0",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-4 animate-pulse",children:[(0,s.jsx)("div",{className:"h-5 bg-gray-200 rounded w-24 mb-4"}),Array.from({length:8}).map((e,t)=>(0,s.jsx)("div",{className:"h-9 bg-gray-100 rounded-md mb-1.5"},t))]})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"h-5 bg-gray-200 rounded w-40 mb-6 animate-pulse"}),(0,s.jsx)("div",{className:(0,K.cn)("grid",eG.grid),children:Array.from({length:12}).map((e,t)=>(0,s.jsx)(td,{},t))})]})]})})}):(0,s.jsxs)("main",{className:"min-h-screen supports-[min-height:100dvh]:min-h-dvh bg-gray-50 pt-14 lg:pt-16",children:[(0,s.jsx)("div",{className:"bg-white border-b sticky top-14 lg:top-16 z-20 isolate",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4",children:[eV&&(0,s.jsx)("div",{className:"md:hidden -mx-4 border-b border-gray-100 bg-white",children:(0,s.jsxs)("button",{type:"button",onClick:()=>{window.history.length>1?z.back():z.push("/checklist")},className:"flex items-center gap-2 px-4 py-2.5 text-sm font-medium text-primary hover:bg-gray-50 active:bg-gray-100 w-full min-h-[44px]",children:[(0,s.jsx)(m.A,{className:"h-4 w-4"}),"Back to Checklist"]})}),(0,s.jsx)("div",{className:"py-2 lg:py-4",children:(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)("button",{onClick:()=>ey(!0),className:"md:hidden flex items-center gap-2 px-4 py-2.5 bg-white border border-gray-300 hover:bg-gray-50 active:bg-gray-100 rounded-lg transition-colors shadow-sm",children:[(0,s.jsx)(h.A,{className:"h-4 w-4 text-gray-600"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:Z?Z.name:"Categories"}),Z&&(0,s.jsx)("span",{className:"ml-1 text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded",children:e9})]}),(0,s.jsxs)("div",{className:"relative flex-1 max-w-2xl mx-auto",children:[(0,s.jsx)(x.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,s.jsx)(d.p,{type:"text",placeholder:"Search for baby products...",value:ek,onChange:e=>eC(e.target.value),className:"pl-10 pr-10"}),ek&&(0,s.jsx)("button",{onClick:()=>eC(""),className:"absolute right-3 top-1/2 transform -translate-y-1/2 p-1 hover:bg-gray-100 rounded-full",children:(0,s.jsx)(g.A,{className:"h-4 w-4 text-gray-400"})})]})]})}),Z&&Z.subcategories.length>0&&(0,s.jsx)("div",{className:"pb-2 lg:pb-4",children:(0,s.jsxs)("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide",children:[(0,s.jsxs)(c.Button,{variant:null===em?"default":"outline",onClick:()=>to(null),className:"whitespace-nowrap",size:"sm",children:["All ",Z.name]}),Z.subcategories.map(e=>(0,s.jsx)(c.Button,{variant:(null==em?void 0:em.id)===e.id?"default":"outline",onClick:()=>to(e,Z),className:"whitespace-nowrap",size:"sm",children:e.name},e.id))]})})]})}),(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 pt-4 pb-4 lg:pt-12 lg:pb-8",children:eX&&!e0?(0,s.jsxs)("div",{className:"flex gap-8",children:[(0,s.jsx)("div",{className:"hidden md:block w-64 flex-shrink-0",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-4 animate-pulse",children:[(0,s.jsx)("div",{className:"h-5 bg-gray-200 rounded w-24 mb-4"}),Array.from({length:8}).map((e,t)=>(0,s.jsx)("div",{className:"h-9 bg-gray-100 rounded-md mb-1.5"},t))]})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"h-5 bg-gray-200 rounded w-40 mb-6 animate-pulse"}),(0,s.jsx)("div",{className:(0,K.cn)("grid",eG.grid),children:Array.from({length:12}).map((e,t)=>(0,s.jsx)(td,{},t))})]})]}):(0,s.jsxs)("div",{className:"flex gap-8",children:[(0,s.jsx)("div",{className:"hidden md:block w-64 flex-shrink-0",children:(0,s.jsx)("div",{className:"bg-white rounded-lg shadow-sm sticky top-32 self-start max-h-[calc(100vh-10rem)] supports-[max-height:100dvh]:max-h-[calc(100dvh-10rem)] overflow-y-auto z-10
1isolate",children:(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-900 mb-4",children:"Categories"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("button",{onClick:()=>tc(null),className:(0,K.cn)("w-full text-left px-3 py-2 rounded-md flex items-center gap-3 transition-colors",null===Z?"bg-primary text-primary-foreground":"text-gray-700 hover:bg-gray-100"),children:[(0,s.jsx)("span",{className:"text-lg",children:"\uD83D\uDECDï¸"}),(0,s.jsx)("span",{className:"flex-1",children:"All Products"})]}),B.map(e=>(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{onClick:()=>tc(e),className:(0,K.cn)("w-full text-left px-3 py-2 rounded-md flex items-center gap-3 transition-colors",(null==Z?void 0:Z.id)===e.id?"bg-primary text-primary-foreground":"text-gray-700 hover:bg-gray-100"),children:[(0,s.jsx)("span",{className:"text-lg",children:e.icon}),(0,s.jsx)("span",{className:"flex-1",children:e.name}),e.subcategories.length>0&&(0,s.jsx)(p.A,{className:(0,K.cn)("h-4 w-4 transition-transform",ex.has(e.id)&&"rotate-90")})]}),ex.has(e.id)&&e.subcategories.length>0&&(0,s.jsx)("div",{className:"ml-8 mt-1 space-y-1",children:e.subcategories.map(t=>(0,s.jsx)("button",{onClick:()=>to(t,e),className:(0,K.cn)("w-full text-left px-3 py-1.5 rounded-md text-sm transition-colors",(null==em?void 0:em.id)===t.id?"bg-gray-200 text-gray-900":"text-gray-600 hover:bg-gray-100"),children:t.name},t.id))})]},e.id))]})]})})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"mb-4 lg:mb-6",children:[(0,s.jsx)("h1",{className:"text-2xl lg:text-3xl font-normal text-gray-700",children:em?em.name:Z?Z.name+" Products":"All Products"}),(0,s.jsxs)("p",{className:"text-gray-500 mt-1",children:[e9," products found",ek&&' for "'.concat(ek,'"')]}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(N.i,{variant:"link"})})]}),eX||W!==eZ?(0,s.jsx)("div",{className:(0,K.cn)("grid",eG.grid),children:Array.from({length:12}).map((e,t)=>(0,s.jsx)(td,{},t))}):0===e7.length?ek?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)(x.A,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No products found"}),(0,s.jsxs)("p",{className:"text-gray-600 mb-4",children:["Try adjusting your search query â",ek,"â"]}),(0,s.jsx)(c.Button,{variant:"outline",onClick:()=>{es.zS.track(es.f7.SHOP.FILTER_CLEARED,{filter_type:"search",location:"discover"}),eC("")},children:"Clear search"})]}):(0,s.jsx)(X,{selectedCountry:eU||"US",countryName:eU?(0,P.v2)(eU).name:"United States",selectedCategory:(null==Z?void 0:Z.slug)||null,categoryName:null==Z?void 0:Z.name}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:(0,K.cn)("grid pb-safe pb-4 lg:pb-0 isolate relative z-0",eG.grid),children:e7.map((e,t)=>((e=>{if(!e)return;let t=(0,R.x4)(e);
1return null==t||t.displayName})(e.product_link),(0,s.jsxs)(o.Zp,{className:"relative overflow-hidden hover:shadow-lg transition-all duration-200 cursor-pointer group hover:scale-[1.02] active:scale-[0.99] touch-manipulation lg:h-auto h-full flex flex-col",children:[(0,s.jsx)(n(),{href:"/product/".concat(e.id),prefetch:!1,scroll:!1,"aria-label":"View ".concat(e.name),className:"absolute inset-0 z-20",onClick:t=>{es.zS.track(es.f7.PRODUCT.DETAILS_OPENED,{product_id:e.id,source:"discover_grid"}),!(0,en.MO)(t)&&(t.preventDefault(),window.history.pushState({...en.Fo},"","/product/".concat(e.id)),window.dispatchEvent(new CustomEvent(eo.yz)))}}),(0,s.jsxs)("div",{className:"aspect-square relative overflow-hidden flex-shrink-0 bg-gradient-to-br from-gray-100 via-gray-50 to-gray-100",children:[(0,s.jsx)("div",{className:"absolute inset-0 overflow-hidden",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-[shimmer_1.5s_infinite]",style:{animationName:"shimmer"}})}),!ta(e)&&(0,s.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-300 z-10",children:(0,s.jsx)("svg",{className:"w-10 h-10 mb-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),ta(e)&&(0,s.jsx)($.ProductImage,{src:ta(e),alt:e.name,fill:!0,sizes:eG.imageSizes,priority:t<4,className:"object-cover object-center group-hover:scale-105 transition-all duration-300 z-10 opacity-0",onLoad:e=>{let t=e.target;t.classList.remove("opacity-0"),t.classList.add("opacity-100");let r=t.parentElement;r&&(r.classList.remove("from-gray-100","via-gray-50","to-gray-100"),r.classList.add("bg-white"))}}),ti(e.id)&&(0,s.jsx)("div",{className:"absolute top-2 right-2",children:(0,s.jsxs)(u.E,{className:"bg-green-500 text-white text-[10px] sm:text-xs px-1.5 sm:px-2 py-0.5 sm:py-1",children:[(0,s.jsx)(y.A,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 mr-0.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"In Registry"}),(0,s.jsx)("span",{className:"sm:hidden",children:"Added"})]})})]}),(0,s.jsxs)(o.Wu,{className:(0,K.cn)("flex-1 flex flex-col",eG.cardBody),children:[(0,s.jsxs)("div",{className:(0,K.cn)("flex-1",eG.bodySpacing),children:[(e.checklist_category||e.checklist_subcategory)&&(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.checklist_category&&(0,s.jsx)(u.E,{variant:"secondary",className:eG.chipClass,children:e.checklist_category.name}),e.checklist_subcategory&&(0,s.jsx)(u.E,{variant:"outline",className:eG.chipClass,children:e.checklist_subcategory.name})]}),(0,s.jsx)("h3",{className:(0,K.cn)("font-medium text-gray-900 line-clamp-2",eG.titleClass),children:e.name})]}),(0,s.jsxs)("div",{className:eG.priceSection,children:[(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsxs)("span",{className:(0,K.cn)("font-bold text-gray-900",eG.priceText),children:[(0,ee.Qn)(e.currency||eF),e.price.toFixed(2)]})}),(0,s.jsxs)("div",{className:(0,K.cn)(eG.buttonContainer,"relative z-30"),children:[(0,s.jsx)(c.Button,{type:"button",size:"sm",variant:"outline",className:eG.buttonClass,onClick:t=>{t.stopPropagation(),t.preventDefault(),tr(e,t)},title:ti(e.id)?"Remove from Registry":"Add to Registry",children:ti(e.id)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y.A,{className:eG.buttonIconClass}),"In Registry"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.A,{className:eG.buttonIconClass}),"Registry"]})}),(0,s.jsx)(v.Jb,{url:e.product_link,className:eG.buttonClass,size:"sm",variant:"default",trackingSource:"discover",showIcon:!0,forceShortLabel:!0,productName:e.name,productId:e.id,price:e.price,currency:e.currency,location:"discover",userRegion:eM||eU||void 0})]}),eW&&(0,s.jsx)("div",{className:"relative z-30 mt-1.5",children:(0,s.jsx)(b.m,{productId:e.id,productName:e.name,className:"w-full"})})]})]})]},e.id)))}),eQ&&(0,s.jsx)("div",{className:(0,K.cn)("grid mt-3 sm:mt-4 lg:mt-5",eG.grid),children:Array.from({length:4}).map((e,t)=>(0,s.jsx)(td,{},t))}),e1&&(0,s.jsx)("div",{ref:tt,className:"h-px w-full","aria-hidden":"true"})]})]})]})}),(0,s.jsx)(A.E,{open:ef,onClose:()=>ev(!1),onSuccess:()=>
1{if(ej){ts(ej),eN(null);try{localStorage.removeItem("bfb_pending_registry_item")}catch(e){console.error("Failed to clear pending product from localStorage:",e)}}}}),tn&&(0,s.jsx)(E.ProductDetailsModal,{product:tn,isOpen:!0,onClose:()=>{!e_.current&&(0,en.jl)(window.location.pathname)&&(e_.current=!0,window.history.back())},onLoginRequired:()=>{eN(tn);try{var e;localStorage.setItem("bfb_pending_registry_item",JSON.stringify({id:tn.id,name:tn.name,price:tn.price,description:tn.description,product_link:tn.product_link,features:tn.features,product_images:tn.product_images,category:tn.category,checklist_subcategory_id:null==(e=tn.checklist_subcategory)?void 0:e.id,currency:tn.currency,timestamp:Date.now()}))}catch(e){console.error("Failed to save pending product to localStorage:",e)}ev(!0)}}),ep&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 md:hidden",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 animate-in fade-in duration-200",onClick:()=>ey(!1)}),(0,s.jsxs)("div",{className:"absolute left-0 top-0 bottom-0 w-80 max-w-[85vw] bg-white shadow-xl flex flex-col animate-in slide-in-from-left duration-300",children:[(0,s.jsxs)("div",{className:"bg-white border-b p-4 flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Categories"}),(0,s.jsx)("button",{onClick:()=>ey(!1),className:"p-2 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close categories",children:(0,s.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto pb-safe",children:(0,s.jsxs)("div",{className:"p-4 space-y-1",children:[(0,s.jsxs)("button",{onClick:()=>{tc(null),ey(!1)},className:(0,K.cn)("w-full text-left px-4 py-3.5 rounded-lg flex items-center gap-3 transition-all active:scale-95",null===Z?"bg-primary text-primary-foreground shadow-sm":"text-gray-700 hover:bg-gray-50 active:bg-gray-100"),children:[(0,s.jsx)("span",{className:"text-lg",children:"\uD83D\uDECDï¸"}),(0,s.jsx)("span",{className:"flex-1 font-medium",children:"All Products"}),null===Z&&(0,s.jsx)(y.A,{className:"h-4 w-4"})]}),B.map(e=>(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("button",{onClick:()=>{tc(e),0===e.subcategories.length&&ey(!1)},className:(0,K.cn)("w-full text-left px-4 py-3.5 rounded-lg flex items-center gap-3 transition-all active:scale-95",(null==Z?void 0:Z.id)===e.id?"bg-primary text-primary-foreground shadow-sm":"text-gray-700 hover:bg-gray-50 active:bg-gray-100"),children:[(0,s.jsx)("span",{className:"text-lg",children:e.icon}),(0,s.jsx)("span",{className:"flex-1 font-medium",children:e.name}),e.subcategories.length>0?(0,s.jsx)(p.A,{className:(0,K.cn)("h-4 w-4 transition-transform",ex.has(e.id)&&"rotate-90")}):(null==Z?void 0:Z.id)===e.id&&(0,s.jsx)(y.A,{className:"h-4 w-4"})]}),ex.has(e.id)&&e.subcategories.length>0&&(0,s.jsx)("div",{className:"ml-10 mt-2 space-y-1",children:e.subcategories.map(t=>(0,s.jsx)("button",{onClick:()=>{to(t,e),ey(!1)},className:(0,K.cn)("w-full text-left px-4 py-3 rounded-lg text-sm transition-all active:scale-95",(null==em?void 0:em.id)===t.id?"bg-gray-200 text-gray-900 font-medium":"text-gray-600 hover:bg-gray-50 active:bg-gray-100"),children:(0,s.jsxs)("span",{className:"flex items-center justify-between",children:[t.name,(null==em?void 0:em.id)===t.id&&(0,s.jsx)(y.A,{className:"h-3.5 w-3.5"})]})},t.id))})]},e.id))]})})]})]}),(0,s.jsx)(ed.h,{location:"discover"})]})}},17181:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]])},17910:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]])},23664:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},24033:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},32722:(e,t,r)=>{"use strict";function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/registry";if(!e)return t;let r=e.trim();return!r.startsWith("/")||r.startsWith("//")||r.includes("\\")?t:r}r.d(t,{Hi:()=>l,XV:()=>i,fx:()=>n});let a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","fbclid","gclid"];function i(e,t){let r=t?s(t,""):"";return r?"/".concat(e,"?redirectTo=").concat(encodeURIComponent(r)):"/".concat(e)}function l(e,t,r){let i=t?s(t,""):"",l=new URLSearchParams;if(i&&l.set("redirectTo",i),r)for(let[e,t]of(function(e){let t=new URLSearchParams;try{let r=new URLSearchParams(e.startsWith("?")?e.slice(1):e);for(let e of a){let s=r.get(e);s&&t.set(e,s)}}catch(e){}return t})(r).entries())l.set(e,t);let n=l.toString();return n?"/".concat(e,"?").concat(n):"/".concat(e)}function n(e){let t=e.redirectTo?s(e.redirectTo,""):"";return t||(e.quickFlow?"/registry?starter=1":"/auth/success")}},33789:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var s=r(95155),a=r(12115),i=r(25016);let l=a.forwardRef((e,t)=>
1{let{className:r,type:a,...l}=e;return(0,s.jsx)("input",{type:a,className:(0,i.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background md:text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...l})});l.displayName="Input"},35626:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},38026:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Wand2",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z",key:"1bcowg"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},39867:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},49540:(e,t,r)=>{"use strict";r.d(t,{WV:()=>i,zO:()=>a});let s="bfb_returning";function a(){var e;return"undefined"!=typeof document&&!!(e=document.cookie)&&e.split(";").some(e=>{let[t,...r]=e.trim().split("=");return t===s&&""!==r.join("=")})}function i(){if("undefined"!=typeof document)try{document.cookie="".concat(s,"=1; path=/; max-age=").concat(31536e3,"; samesite=lax").concat("undefined"!=typeof location&&"https:"===location.protocol?"; secure":"")}catch(e){}}},50859:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]])},51479:(e,t,r)=>{"use strict";r.d(t,{ErrorBoundary:()=>u});var s=r(95155),a=r(12115),i=r(27122),l=r(97003),n=r(83209),c=r(9582),o=r(89559),d=r(61712);class u extends a.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("Error caught by boundary:",e,t),i.Cp(e,{contexts:{react:{componentStack:t.componentStack}}}),this.setState({error:e,errorInfo:t})}render(){if(this.state.hasError){if(this.props.fallback){let e=this.props.fallback;return(0,s.jsx)(e,{error:this.state.error,retry:this.handleRetry})}return(0,s.jsx)("div",{className:"min-h-[50vh] flex items-center justify-center p-4",children:(0,s.jsxs)(n.Zp,{className:"w-full max-w-md",children:[(0,s.jsxs)(n.aR,{className:"text-center",children:[(0,s.jsx)("div",{className:"w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(c.A,{className:"w-6 h-6 text-red-600"})}),(0,s.jsx)(n.ZB,{className:"text-xl",children:"Something went wrong"})]}),(0,s.jsxs)(n.Wu,{className:"text-center space-y-4",children:[(0,s.jsx)("p",{className:"text-gray-600",children:"We encountered an unexpected error. This might be a temporary issue."}),!1,(0,s.jsxs)("div",{className:"flex gap-2 justify-center",children:[(0,s.jsxs)(l.Button,{onClick:this.handleRetry,variant:"outline",size:"sm",children:[(0,s.jsx)(o.A,{className:"w-4 h-4 mr-2"}),"Try Again"]}),(0,s.jsxs)(l.Button,{onClick:this.handleGoHome,size:"sm",children:[(0,s.jsx)(d.A,{className:"w-4 h-4 mr-2"}),"Go Home"]})]})]})]})})}return this.props.children}constructor(e){super(e),this.handleRetry=()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})},this.handleGoHome=()=>{window.location.href="/"},this.state={hasError:!1}}}},53560:(e,t,r)=>{"use strict";r.d(t,{B:()=>l});var s=r(95155),a=r(27785),i=r(43559);function l(e){let{isOpen:t,onClose:r,onCloned:l}=e;return(0,s.jsx)(a.RF,{open:t,onOpenChange:r,children:(0,s.jsx)(a.sL,{className:"max-w-6xl h-[85vh] supports-[height:100dvh]:h-[85dvh] p-0 overflow-hidden",children:(0,s.jsxs)("div",{className:"flex flex-col h-full",children:[(0,s.jsxs)(a.Y8,{className:"px-6 pt-6 pb-4 border-b bg-gradient-to-r from-purple-50 to-pink-50",children:[(0,s.jsx)(a.N5,{className:"text-2xl font-bold bg-gradient-to-r from-purple-600 to-pink-600 bg-clip-text text-transparent",children:"Start from a Sample Registry"}),(0,s.jsx)(a.Hq,{className:"mt-2 text-base",children:"Clone a whole curated registry, or pick just the items you want."})]}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:t&&(0,s.jsx)(i.A,{layout:"modal",onCloned:e=>{l(e),r()}})})]})})})}},54474:(e,t,r)=>{"use strict";r.d(t,{i:()=>g});var s=r(95155),a=r(12115),i=r(20063),l=r(95740),n=r(97003),c=r(25016),o=r(28171),d=r(53560),u=r(43329),m=r(59792),h=r(65821);let x=null;function g(e){let{variant:t="banner",className:r}
1=e,g=function(){let{useSampleRegistries:e}=(0,u.h)(),[t,r]=(0,a.useState)(null!=x&&x);return(0,a.useEffect)(()=>{if(!e)return;if(null!==x)return void r(x);let t=!1;return(async()=>{try{let e=await fetch("/api/v1/sample-registries");if(!e.ok)return;let s=await e.json(),a=(0,m.bD)(Array.isArray(s.sampleRegistries)?s.sampleRegistries:[],(0,h.p)()).length>0;x=a,t||r(a)}catch(e){}})(),()=>{t=!0}},[e]),e&&t}(),[p,y]=(0,a.useState)(!1),f=(0,i.useRouter)(),{toast:v}=(0,o.dj)();return g?(0,s.jsxs)(s.Fragment,{children:["banner"===t?(0,s.jsxs)("div",{className:(0,c.cn)("flex flex-col sm:flex-row sm:items-center gap-3 rounded-xl border border-primary/30 bg-primary/5 p-4",r),children:[(0,s.jsx)(l.A,{className:"hidden sm:block w-5 h-5 text-primary shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-semibold",children:"Don't want to build from scratch?"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Start from a curated registry. Copy the whole list or just the items you want."})]}),(0,s.jsxs)(n.Button,{className:"shrink-0 w-full sm:w-auto h-11",onClick:()=>y(!0),children:[(0,s.jsx)(l.A,{className:"w-4 h-4 mr-2 sm:hidden"}),"Browse curated registries"]})]}):(0,s.jsxs)(n.Button,{variant:"outline",size:"sm",className:r,onClick:()=>y(!0),children:[(0,s.jsx)(l.A,{className:"w-4 h-4 mr-2"}),"Browse curated registries"]}),(0,s.jsx)(d.B,{isOpen:p,onClose:()=>y(!1),onCloned:e=>{y(!1),v({title:"Added to your registry",description:"".concat(e.items_added," item").concat(1===e.items_added?"":"s"," added").concat(e.items_skipped?" \xb7 ".concat(e.items_skipped," already in your registry"):"",".")}),f.push("/registry")}})]}):null}},55677:(e,t,r)=>{"use strict";r.d(t,{b:()=>x,x:()=>h});var s=r(95155),a=r(12115),i=r(32734),l=r(8525),n=r(28171),c=r(69323),o=r(93411);let d=(0,a.createContext)(void 0),u="baby-registry-items",m="bfb_pending_registry_item";function h(e){let{children:t}=e,[r,h]=(0,a.useState)([]),[x,g]=(0,a.useState)(!0),{toast:p}=(0,n.dj)(),{user:y}=(0,i.A)(),f=(0,l.U)();(0,a.useEffect)(()=>{!async function(){g(!0);try{if(y){let{data:e,error:t}=await f.from("registry_items").select("\n product_id,\n is_private,\n products (\n id,\n name,\n description,\n price,\n product_link,\n features,\n checklist_subcategory_id,\n product_images (\n image_url,\n display_order\n ),\n category:categories (\n name,\n slug\n ),\n checklist_category:checklist_categories!checklist_category_id ( name, slug ),\n checklist_subcategory:checklist_subcategories!checklist_subcategory_id ( name, slug )\n )\n ").eq("user_id",y.id);if(t)"PGRST116"===t.code||t.message.includes('relation "registry_items" does not exist')||(console.error("Error loading registry:",t),p({title:"Error loading registry",description:"Unable to load your registry items. Please try refreshing the page.",variant:"destructive"})),h([]);else if(e){let t=e.filter(e=>e.products).map(e=>{let t=e.products,r=[];return"string"==typeof t.features?r=t.features.replace(/^{|}$/g,"").split(",").map(e=>e.trim().replace(/^"|"$/g,"")).filter(e=>e):Array.isArray(t.features)&&(r=t.features),{id:t.id,name:t.name,description:t.description,price:t.price,product_link:t.product_link,features:r,product_images:t.product_images||[],category:(0,o.$y)(t),checklist_subcategory:(0,o.hN)(t),checklist_subcategory_id:t.checklist_subcategory_id,is_private:e.is_private}});h(t)}else h([])}else{let e=localStorage.getItem(u);if(e)try{let t=JSON.parse(e);h(Array.isArray(t)?t:[])}catch(e){console.error("Error parsing saved registry items:",e),h([]),localStorage.removeItem(u)}else h([])}}catch(e){console.error("Unexpected error loading registry:",e),h([])}finally{g(!1)}}()},[y,f,p]),(0,a.useEffect)(()=>{if(!x&&!y)try{localStorage.setItem(u,JSON.stringify(r))}catch(e){console.error("Error saving registry items:",e)}},[r,y,x]);let v=async function(e){var t,s;let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"registry_context";if(!(null==e?void 0:e.id))throw console.error("Invalid product:",e),Error("Invalid product");
1if(r.some(t=>t.id===e.id))throw Error("Item already in registry");if(!y){h(t=>[...t,e]),localStorage.setItem(u,JSON.stringify([...r,e])),c.zS.track(c.f7.REGISTRY.ITEM_ADDED,{product_id:e.id,product_name:e.name,price:e.price,currency:e.currency,category:null==(t=e.category)?void 0:t.name,source:l});return}try{let{data:t,error:r}=await f.from("registry_items").insert({user_id:y.id,product_id:e.id,is_private:a,private_notes:i}).select().single();if(r){if("23505"===r.code)throw Error("Item already in registry");if("42501"===r.code)throw Error("Please sign in to add items to your registry");throw r}h(t=>[...t,e]),c.zS.track(c.f7.REGISTRY.ITEM_ADDED,{product_id:e.id,product_name:e.name,price:e.price,currency:e.currency,category:null==(s=e.category)?void 0:s.name,source:l,is_private:a}),a&&await f.from("private_registry_analytics").insert({user_id:y.id,action:"item_added_private",item_id:t.id})}catch(e){throw console.error("Error adding item to registry:",e),e}},b=async function(e){var t;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"registry_context",a=r.find(t=>t.id===e);if(y)try{console.log("\uD83D\uDDD1ï¸ Removing item from registry:",{productId:e,userId:y.id});let{error:t}=await f.from("registry_items").delete().eq("user_id",y.id).eq("product_id",e);if(t)throw console.error("â Database error removing item from registry:",t),Error("Failed to remove item from database: ".concat(t.message));console.log("â
Successfully removed item from database")}catch(e){throw console.error("â Error removing item from registry:",e),e}h(t=>t.filter(t=>t.id!==e)),c.zS.track(c.f7.REGISTRY.ITEM_REMOVED,{product_id:e,product_name:null==a?void 0:a.name,price:null==a?void 0:a.price,currency:null==a?void 0:a.currency,category:null==a||null==(t=a.category)?void 0:t.name,source:s}),console.log("â
Updated local registry state")},j=async()=>{if(y)try{let{error:e}=await f.from("registry_items").delete().eq("user_id",y.id);if(e)return void console.error("Error clearing registry:",e)}catch(e){console.error("Error clearing registry:",e);return}h([]),p({title:"Registry cleared",description:"All items have been removed from your registry"})},N=async()=>{try{let e=localStorage.getItem(m);if(!e)return null;let t=JSON.parse(e);if(Date.now()-t.timestamp>864e5)return localStorage.removeItem(m),null;if(!y)return null;if(r.some(e=>e.id===t.id))return localStorage.removeItem(m),null;return t}catch(e){return console.error("Error checking pending item:",e),localStorage.removeItem(m),null}};return(0,s.jsx)(d.Provider,{value:{items:r,addItem:v,removeItem:b,clearRegistry:j,loading:x,checkAndAddPendingItem:N},children:t})}function x(){let e=(0,a.useContext)(d);if(void 0===e)throw Error("useRegistry must be used within a RegistryProvider");return e}},56154:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]])},57268:(e,t,r)=>{"use strict";r.d(t,{b:()=>m});var s=r(12115),a=r(97602),i=r(95155),l=Object.defineProperty,n=(e,t)=>l(e,"name",{value:t,configurable:!0}),c="horizontal",o=["horizontal","vertical"],d=s.forwardRef(n(function(e,t){let{decorative:r,orientation:s=c,...l}=e,n=u(s)?s:c;return(0,i.jsx)(a.sG.div,{"data-orientation":n,...r?{role:"none"}:{"aria-orientation":"vertical"===n?n:void 0,role:"separator"},...l,ref:t})},"Separator"));function u(e){return o.includes(e)}n(u,"isValidOrientation");var m=d},61588:(e,t,r)=>{"use strict";r.d(t,{u:()=>g});var s=r(95155),a=r(12115),i=r(97003),l=r(33789),n=r(90235),c=r(28171),o=r(8525),d=r(69323),u=r(49540),m=r(73577),h=r(919),x=r(23664);function g(e){let{mode:t,collectName:r=!1,initialEmail:g="",initialName:p="",onboardingFlow:y,redirectTo:f="/registry",onAuthenticated:v,submitLabel:b,onUsePassword:j,usePasswordLabel:N="Use a password instead",source:w,disabled:_=!1}=e,{toast:k}=(0,c.dj)(),C=(0,o.U)(),[S,A]=(0,a.useState)(g),[D,E]=(0,a.useState)(p),[R,P]=(0,a.useState)(!1),[I,L]=(0,a.useState)(!1),[z,U]=(0,a.useState)(""),[T,O]=(0,a.useState)(!1),[B,F]=(0,a.useState)(null),M="signup"===t?d.f7.AUTH.SIGNUP_STARTED:d.f7.AUTH.LOGIN_STARTED;async function q(e){e.preventDefault(),P(!0),F(null),d.zS.track(M,{login_method:"magic_link",signup_method:"magic_link",...w?{source:w}:{}});try{let e=await fetch("/api/v1/auth/magic-link",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:S,...r?{full_name:D}:{},...y?{onboardingFlow:y}:{},redirectTo:f})});if(429===e.status)return void k({title:"Too many requests",description:"Please wait a few minutes before requesting another link.",variant:"destructive"});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||"Could not send the link")}L(!0)}catch(e){k({title:"Couldn't send link",description:e.message||"Please try again.",variant:"destructive"})}finally{P(!1)}}async function H(e){e.preventDefault();let r=z.replace(/\s/g,"");if(r.length<6)return void F("Enter the 6-digit code from your email.");O(!0),F(null);try{var s;let e=await C.auth.verifyOtp({email:S,token:r,type:"magiclink"});
1if(e.error&&(e=await C.auth.verifyOtp({email:S,token:r,type:"email"})),e.error||!(null==(s=e.data)?void 0:s.session)){d.zS.track(d.f7.AUTH.LOGIN_FAILED,{login_method:"magic_link",error_type:"code_invalid",...w?{source:w}:{}}),F("That code is invalid or has expired. Request a new one.");return}if((0,u.WV)(),d.zS.track("signup"===t?d.f7.AUTH.SIGNUP_COMPLETED:d.f7.AUTH.LOGIN_COMPLETED,{login_method:"magic_link",signup_method:"magic_link",step:"code_verified",...w?{source:w}:{}}),v)v({fullName:D,email:S});else{let e=f.startsWith("/")&&!f.startsWith("//")?f:"/registry";window.location.assign(e)}}catch(e){F("Something went wrong verifying the code. Please try again.")}finally{O(!1)}}return I?(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"text-center space-y-2",children:[(0,s.jsx)("div",{className:"mx-auto w-14 h-14 bg-gradient-to-r from-primary to-pink-600 rounded-full flex items-center justify-center",children:(0,s.jsx)(m.A,{className:"w-7 h-7 text-white"})}),(0,s.jsx)("h3",{className:"text-lg font-bold text-gray-800",children:"Check your email"}),(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:["We sent a sign-in link to ",(0,s.jsx)("span",{className:"font-semibold text-gray-800",children:S}),". Tap it, or enter the 6-digit code below â no password needed."]})]}),(0,s.jsxs)("form",{onSubmit:H,className:"space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{htmlFor:"magic-code",className:"text-sm font-medium text-gray-700",children:"6-digit code"}),(0,s.jsx)(l.p,{id:"magic-code",inputMode:"numeric",autoComplete:"one-time-code",pattern:"[0-9]*",maxLength:6,placeholder:"123456",value:z,onChange:e=>U(e.target.value.replace(/[^0-9]/g,"")),className:"h-12 text-center text-lg tracking-[0.4em] rounded-xl border-2 border-gray-200 focus:border-primary",disabled:T}),B&&(0,s.jsx)("p",{className:"text-xs text-red-500",children:B})]}),(0,s.jsx)(i.Button,{type:"submit",disabled:T||z.length<6,className:"w-full h-12 rounded-xl bg-gradient-to-r from-primary to-pink-600 hover:from-primary/90 hover:to-pink-700 text-white",children:T?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.A,{className:"w-4 h-4 mr-2 animate-spin"})," Verifyingâ¦"]}):"Verify & continue"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-4 text-sm",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{L(!1),U(""),F(null)},className:"inline-flex min-h-10 items-center text-primary hover:text-primary/80 font-medium",children:"Use a different email"}),(0,s.jsx)("span",{className:"text-gray-300",children:"â¢"}),(0,s.jsx)("button",{type:"button",onClick:e=>q(e),disabled:R,className:"inline-flex min-h-10 items-center text-primary hover:text-primary/80 font-medium disabled:opacity-50",children:R?"Resendingâ¦":"Resend link"})]}),(0,s.jsx)("p",{className:"text-center text-xs text-gray-400",children:"The link and code expire soon. Check your spam folder if it doesn't arrive within a minute."})]}):(0,s.jsxs)("form",{onSubmit:q,className:"space-y-5",children:[r&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{htmlFor:"magic-name",className:"text-sm font-medium text-gray-700",children:"Full Name"}),(0,s.jsx)(l.p,{id:"magic-name",type:"text",placeholder:"Enter your full name",value:D,onChange:e=>E(e.target.value),className:"h-12 rounded-xl border-2 border-gray-200 focus:border-primary",disabled:_||R})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.J,{htmlFor:"magic-email",className:"text-sm font-medium text-gray-700",children:"Email"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(x.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 h-5 w-5"}),(0,s.jsx)(l.p,{id:"magic-email",type:"email",placeholder:"[email protected]",value:S,onChange:e=>A(e.target.value),required:!0,className:"pl-10 h-12 rounded-xl border-2 border-gray-200 focus:border-primary",disabled:_||R})]})]}),(0,s.jsx)(i.Button,{type:"submit",disabled:_||R||!S||r&&!D,className:"w-full h-12 rounded-xl bg-gradient-to-r from-primary to-pink-600 hover:from-primary/90 hover:to-pink-700 text-white",children:R?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.A,{className:"w-4 h-4 mr-2 animate-spin"})," Sending linkâ¦"]}):b||("signup"===t?"Email me a sign-up link":"Email me a sign-in link")}),j&&(0,s.jsx)("p",{className:"text-center text-sm text-gray-500",children:(0,s.jsx)("button",{type:"button",onClick:j,className:"inline-flex min-h-10 items-center text-primary hover:text-primary/80 font-medium",children:N})})]})}},70929:(e,t,r)=>{"use strict";r.d(t,{h:()=>h});var s=r(95155),a=r(12115),i=r(20063),l=r(97003),n=r(60709),c=r(52987),o=r(32734),d=r(32722),u=r(55630),m=r(69323);function h(e){let{location:t,sampleRegistrySlug:r,onGuestSaveRequired:h}=e,x=(0,i.useRouter)(),g=(0,i.useSearchParams)(),{user:p,loading:y}=(0,o.A)(),[f,v]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{let e=setTimeout(()=>v(!0),500);return()=>clearTimeout(e)},[]),p||y||!f)return null;let b=()=>{if(m.zS.track(m.f7.UI.BUTTON_CLICKED,{button_text:"Create Registry",action:"lander_cta_clicked",location:t,has_sample_slug:!!r}),r&&h)return void h();let e=r?(0,u.iR)(r):"/registry",s=new URL((0,d.XV)("signup",e),window.location.origin);
1for(let[e,t]of new URLSearchParams(g.toString()).entries())(e.startsWith("utm_")||"fbclid"===e||"gclid"===e)&&s.searchParams.set(e,t);x.push(s.pathname+s.search)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed bottom-0 left-0 right-0 z-50 lg:hidden bg-white border-t border-gray-200 shadow-lg p-4 animate-in slide-in-from-bottom-4 duration-300",children:(0,s.jsxs)(l.Button,{onClick:b,className:"w-full h-12 bg-gradient-to-r from-primary to-pink-600 hover:from-primary/90 hover:to-pink-700 text-white font-semibold shadow-lg",children:[(0,s.jsx)(n.A,{className:"mr-2 h-5 w-5"}),"Create Registry",(0,s.jsx)(c.A,{className:"ml-2 h-5 w-5"})]})}),(0,s.jsx)("div",{className:"hidden lg:block fixed top-16 left-0 right-0 z-40 bg-gradient-to-r from-purple-50 to-pink-50 border-b border-purple-100 shadow-sm animate-in slide-in-from-top-4 duration-300",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-6 py-3 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-r from-primary to-pink-600",children:(0,s.jsx)(n.A,{className:"h-5 w-5 text-white"})}),(0,s.jsxs)("p",{className:"text-sm text-gray-700",children:[(0,s.jsx)("span",{className:"font-semibold",children:"Ready to start?"})," Create your free baby registry in 2 minutes."]})]}),(0,s.jsxs)(l.Button,{onClick:b,className:"h-10 bg-gradient-to-r from-primary to-pink-600 hover:from-primary/90 hover:to-pink-700 text-white font-semibold shadow-md",children:["Create Registry",(0,s.jsx)(c.A,{className:"ml-2 h-4 w-4"})]})]})})]})}},71360:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},73577:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("MailCheck",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]])},78423:(e,t,r)=>{Promise.resolve().then(r.bind(r,12098)),Promise.resolve().then(r.bind(r,51479)),Promise.resolve().then(r.bind(r,97055))},83955:(e,t,r)=>{"use strict";r.d(t,{E:()=>f});var s=r(95155),a=r(12115),i=r(20063),l=r(27785),n=r(97003),c=r(33789),o=r(90235),d=r(8525),u=r(28171),m=r(52987),h=r(23664),x=r(99708),g=r(69323),p=r(43329),y=r(61588);function f(e){let{open:t,onClose:r,onSuccess:f,redirectTo:v}=e,b=(0,i.useRouter)(),[j,N]=(0,a.useState)(""),[w,_]=(0,a.useState)(""),[k,C]=(0,a.useState)(!1),{toast:S}=(0,u.dj)(),A=(0,d.U)(),{useMagicLinkAuth:D}=(0,p.h)();async function E(e){e.preventDefault(),C(!0),g.zS.track(g.f7.AUTH.LOGIN_STARTED,{login_method:"email",source:"login_dialog"});try{let{data:e,error:t}=await A.auth.signInWithPassword({email:j,password:w});if(t){let e="Invalid email or password",r="invalid_credentials";t.message.includes("Invalid login credentials")?(e="Invalid email or password",r="invalid_credentials"):t.message.includes("Email not confirmed")?(e="Please confirm your email address before logging in",r="email_not_confirmed"):t.message.includes("rate limit")&&(e="Too many login attempts. Please try again later",r="rate_limited"),g.zS.track(g.f7.AUTH.LOGIN_FAILED,{login_method:"email",source:"login_dialog",error_type:r}),S({title:"Login failed",description:e,variant:"destructive"});return}e.session&&(g.zS.track(g.f7.AUTH.LOGIN_COMPLETED,{login_method:"email",source:"login_dialog"}),S({title:"Success",description:"You have been signed in successfully"}),null==f||f(),r(),await new Promise(e=>setTimeout(e,500)),v?window.location.href=v:window.location.reload())}catch(e){console.error("Login error:",e),g.zS.track(g.f7.AUTH.LOGIN_FAILED,{login_method:"email",source:"login_dialog",error_type:"unexpected_error"}),S({title:"Login failed",description:"An unexpected error occurred. Please try again.",variant:"destructive"})}finally{C(!1)}}return(0,s.jsx)(l.RF,{open:t,onOpenChange:r,children:(0,s.jsxs)(l.sL,{className:"sm:max-w-md",children:[(0,s.jsxs)(l.Y8,{children:[(0,s.jsx)(l.N5,{children:"Save this to your registry"}),(0,s.jsx)(l.Hq,{children:"Create a free registry to save items, or keep browsing and sign up whenever you're ready."})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)(n.Button,{onClick:()=>
1{g.zS.track(g.f7.AUTH.SIGNUP_STARTED,{source:"login_dialog"}),r(),b.push("/onboarding")},className:"w-full bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 text-white",size:"lg",children:["Create my free registry",(0,s.jsx)(m.A,{className:"ml-2 h-4 w-4"})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,s.jsx)("span",{className:"w-full border-t"})}),(0,s.jsx)("div",{className:"relative flex justify-center text-xs uppercase",children:(0,s.jsx)("span",{className:"bg-white px-2 text-gray-500",children:"Or sign in"})})]}),D?(0,s.jsx)(y.u,{mode:"signin",source:"login_dialog",redirectTo:v||"/registry",submitLabel:"Email me a sign-in link",onAuthenticated:()=>{null==f||f(),r(),setTimeout(()=>{v?window.location.href=v:window.location.reload()},300)}}):(0,s.jsxs)("form",{onSubmit:E,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(o.J,{htmlFor:"email",children:"Email"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(h.A,{className:"absolute left-3 top-3 h-4 w-4 text-gray-400"}),(0,s.jsx)(c.p,{id:"email",type:"email",placeholder:"[email protected]",value:j,onChange:e=>N(e.target.value),className:"pl-10",required:!0})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.J,{htmlFor:"password",children:"Password"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(x.A,{className:"absolute left-3 top-3 h-4 w-4 text-gray-400"}),(0,s.jsx)(c.p,{id:"password",type:"password",autoComplete:"current-password",value:w,onChange:e=>_(e.target.value),className:"pl-10",required:!0})]})]}),(0,s.jsx)(n.Button,{type:"submit",variant:"outline",className:"w-full",disabled:k,children:k?"Signing in...":"Sign in"})]}),(0,s.jsx)(n.Button,{type:"button",variant:"ghost",className:"w-full text-gray-500 hover:text-gray-700",onClick:r,children:"Maybe later, keep browsing"})]})]})})}},89559:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90235:(e,t,r)=>{"use strict";r.d(t,{J:()=>o});var s=r(95155),a=r(12115),i=r(10489),l=r(83101),n=r(25016);let c=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(i.b,{ref:t,className:(0,n.cn)(c(),r),...a})});o.displayName=i.b.displayName},91078:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(45105).A)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},92291:(e,t,r)=>{"use strict";r.d(t,{B7:()=>l,Fo:()=>i,MO:()=>n,jl:()=>a});let s=/^\/product\/([^/?#]+)\/?$/;function a(e){if(!e)return null;let t=s.exec(e);return t?decodeURIComponent(t[1]):null}let i={preserveScroll:!0};function l(e){return!!(e&&"object"==typeof e&&!0===e.preserveScroll)}function n(e){return!!e.defaultPrevented||void 0!==e.button&&0!==e.button||!!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)}},93411:(e,t,r)=>{"use strict";r.d(t,{$y:()=>i,X3:()=>n,hN:()=>l});let s={name:"Uncategorized",slug:"uncategorized"};function a(e){var t;let r=Array.isArray(e)?e[0]:e;return r&&r.name?{name:r.name,slug:null!=(t=r.slug)?t:""}:null}function i(e){var t,r;return null!=(r=null!=(t=a(e.checklist_category))?t:a(e.category))?r:s}function l(e){return a(e.checklist_subcategory)}function n(e){return!e||e.slug===s.slug}},93499:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});
1let s=(0,r(45105).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},96869:(e,t,r)=>{"use strict";r.d(t,{Bx:()=>u,D_:()=>a,GX:()=>i,KL:()=>c,RF:()=>d,o1:()=>s,ps:()=>n,yz:()=>l});let s="bfb_lead_capture_done",a="bfb_lead_capture_dismissed_at",i="bfb_products_viewed",l="bfb:product-viewed",n=4e4,c=2,o=["/discover","/product/","/sample-registries","/blog","/category"];function d(e){return!!e&&o.some(t=>e===t.replace(/\/$/,"")||e.startsWith(t))}function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e)return!0;if(!t)return!1;let s=Number(t);return!!Number.isFinite(s)&&r-s<12096e5}}},e=>{e.O(0,[25730,24909,78105,81029,67817,535,78820,94415,49972,55606,79950,35933,70839,10006,15239,33161,69639,32734,69323,93447,78561,97055,20109,43559,29793,28441,55857,77358],()=>e(e.s=78423)),_N_E=e.O()}]);
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.