PageSourceSearch

https://doghealthy.netlify.app/_nuxt/zVUIZiUs.js

js doghealthy.netlify.app collected 2026-10-03 10:40:52 UTC 13,363 bytes, 1 lines download raw bytes

1import{f as D,u as L,g as A,r as p,h as M,c as l,a as r,b as x,w as v,A as F,m as o,v as d,I as g,F as y,k as S,n as k,l as G,e as W,Q as R,o as a,d as w,t as b}from"#entry";import{u as U}from"./Dy9pVEbO.js";import{u as I}from"./D5HOP8m2.js";import"./DKLWY9DJ.js";const V={class:"container mx-auto px-4 py-8 max-w-4xl"},E={class:"mb-8"},N={class:"bg-white rounded-lg shadow-sm border border-muted p-6"},_={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},z={class:"mt-6"},H={class:"bg-white rounded-lg shadow-sm border border-muted p-6"},K={class:"grid grid-cols-1 md:grid-cols-3 gap-6"},q=["value"],O={class:"mt-6"},J=["value"],j={class:"bg-white rounded-lg shadow-sm border border-muted p-6"},Y={class:"bg-white rounded-lg shadow-sm border border-muted p-6"},Q={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},X={class:"border border-primary rounded-lg p-4 bg-primary bg-opacity-5"},$={class:"flex items-center mt-2"},Z={class:"mt-6 p-4 bg-accent bg-opacity-10 border border-accent rounded-lg"},ee={class:"flex items-center mt-2"},re={class:"flex justify-end gap-4"},te=["disabled"],ie={key:0},oe={key:1},ue=D({__name:"new",setup(se){const c=L(),f=A(),T=R();U({title:"Create Dog Listing",description:"Create a DogHealthy classifieds listing to find a new home for your dog in the UK.",path:"/classifieds/new",index:!1});const u=p(!1),h=p([]),t=p({title:"",description:"",breed:"",gender:"",age_weeks:null,price_gbp:null,location:"",dog_id:"",is_premium:!1,is_featured:!1,images:[]}),B=["Affenpinscher","Afghan Hound","Airedale Terrier","Akbash","Akita","Alaskan Malamute","American Bulldog","American Bully","American Eskimo Dog","American Foxhound","American Pit Bull Terrier","American Staffordshire Terrier","American Water Spaniel","Anatolian Shepherd Dog","Australian Cattle Dog","Australian Kelpie","Australian Shepherd","Australian Terrier","Basenji","Basset Hound","Beagle","Bearded Collie","Beauceron","Bedlington Terrier","Belgian Malinois","Belgian Sheepdog","Belgian Tervuren","Bernese Mountain Dog","Bichon Frise","Black and Tan Coonhound","Black Russian Terrier","Bloodhound","Bluetick Coonhound","Boerboel","Border Collie","Border Terrier","Borzoi","Boston Terrier","Bouvier des Flandres","Boxer","Boykin Spaniel","Briard","Brittany","Brussels Griffon","Bull Terrier","Bulldog","Bullmastiff","Cairn Terrier","Canaan Dog","Cane Corso","Cardigan Welsh Corgi","Catahoula Leopard Dog","Caucasian Shepherd Dog","Cavalier King Charles Spaniel","Chesapeake Bay Retriever","Chihuahua","Chinese Crested","Chinese Shar-Pei","Chinook","Chow Chow","Clumber Spaniel","Cocker Spaniel","Collie","Curly-Coated Retriever","Dachshund","Dalmatian","Dandie Dinmont Terrier","Doberman Pinscher","Dogue de Bordeaux","English Cocker Spaniel","English Setter","English Springer Spaniel","English Toy Spaniel","English Toy Terrier","Eurasier","Field Spaniel","Finnish Lapphund","Finnish Spitz","Flat-Coated Retriever","French Bulldog","German Pinscher","German Shepherd Dog","German Shorthaired Pointer","German Spitz","German Wirehaired Pointer","Giant Schnauzer","Glen of Imaal Terrier","Golden Retriever","Gordon Setter","Great Dane","Great Pyrenees","Greater Swiss Mountain Dog","Greyhound","Harrier","Havanese","Ibizan Hound","Icelandic Sheepdog","Irish Red and White Setter","Irish Setter","Irish Terrier","Irish Water Spaniel","Irish Wolfhound","Italian Greyhound","Jack Russell Terrier","Japanese Akita","Japanese Chin","Japanese Spitz","Keeshond","Kerry Blue Terrier","Komondor","Kuvasz","Labrador Retriever","Lagotto Romagnolo","Lakeland Terrier","Leonberger","Lhasa Apso","Lowchen","Maltese","Manchester Terrier","Mastiff","Miniature Bull Terrier","Miniature Pinscher","Miniature Schnauzer","Neapolitan Mastiff","Newfoundland","Norfolk Terrier","Norweg
1ian Buhund","Norwegian Elkhound","Norwegian Lundehund","Norwich Terrier","Nova Scotia Duck Tolling Retriever","Old English Sheepdog","Otterhound","Papillon","Parson Russell Terrier","Pekingese","Pembroke Welsh Corgi","Petit Basset Griffon Vendeen","Pharaoh Hound","Plott","Pointer","Polish Lowland Sheepdog","Pomeranian","Poodle (Miniature)","Poodle (Standard)","Poodle (Toy)","Portuguese Water Dog","Pug","Puli","Pumi","Pyrenean Shepherd","Rhodesian Ridgeback","Rottweiler","Russell Terrier","Saint Bernard","Saluki","Samoyed","Schipperke","Scottish Deerhound","Scottish Terrier","Sealyham Terrier","Shetland Sheepdog","Shiba Inu","Shih Tzu","Siberian Husky","Silky Terrier","Skye Terrier","Sloughi","Smooth Fox Terrier","Soft Coated Wheaten Terrier","Spinone Italiano","Staffordshire Bull Terrier","Standard Schnauzer","Sussex Spaniel","Swedish Vallhund","Tibetan Mastiff","Tibetan Spaniel","Tibetan Terrier","Toy Fox Terrier","Treeing Walker Coonhound","Vizsla","Weimaraner","Welsh Springer Spaniel","Welsh Terrier","West Highland White Terrier","Whippet","Wire Fox Terrier","Wirehaired Pointing Griffon","Xoloitzcuintli","Yorkshire Terrier","Other"],C=async()=>{try{const{data:s,error:e}=await c.from("doghealthy_dogs").select("id, name, breed").eq("user_id",f.userId).order("name");if(e)throw e;h.value=s||[]}catch(s){console.error("Error fetching user dogs:",s)}},P=async()=>{try{u.value=!0;const s={user_id:f.userId,dog_id:t.value.dog_id||null,title:t.value.title,description:t.value.description,breed:t.value.breed,gender:t.value.gender||null,age_weeks:t.value.age_weeks||null,price_gbp:t.value.price_gbp,location:t.value.location,images:t.value.images,is_premium:t.value.is_premium,is_featured:t.value.is_featured,status:"active",view_count:0};if(t.value.is_featured){const i=new Date;i.setDate(i.getDate()+30),s.featured_until=i.toISOString()}const{data:e,error:n}=await c.from("doghealthy_listings").insert(s).select().single();if(n)throw n;if(t.value.is_premium||t.value.is_featured){const i=t.value.is_featured?"featured":"premium";try{const{createCheckoutSession:m}=I();await m(e.id,i);return}catch(m){console.error("Error creating checkout session:",m),alert("Listing created but payment failed. You can upgrade later.")}}T.push(`/classifieds/${e.id}`)}catch(s){console.error("Error creating listing:",s),alert("Error creating listing. Please try again.")}finally{u.value=!1}};return M(()=>{C()}),(s,e)=>{const n=W;return a(),l("div",V,[r("div",E,[x(n,{to:"/classifieds",class:"inline-flex items-center text-secondary hover:text-primary mb-4"},{default:v(()=>[...e[10]||(e[10]=[r("i",{class:"bi bi-arrow-left mr-2"},null,-1),w(" Back to Classifieds ",-1)])]),_:1}),e[11]||(e[11]=r("h1",{class:"text-4xl font-bold text-dark mb-4"},"Create New Listing",-1)),e[12]||(e[12]=r("p",{class:"text-secondary text-lg"},"List your dog for sale to find the perfect home",-1))]),r("form",{onSubmit:G(P,["prevent"]),class:"space-y-8"},[r("div",N,[e[16]||(e[16]=r("h2",{class:"text-xl font-semibold text-dark mb-4"},"Basic Information",-1)),r("div",_,[r("div",null,[e[13]||(e[13]=r("label",{class:"block text-sm font-medium text-dark mb-2"},"Title *",-1)),o(r("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>t.value.title=i),type:"text",placeholder:"e.g., Beautiful Golden Retriever Puppies",class:"w-full border border-muted rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary focus:border-primary",required:""},null,512),[[d,t.value.title]])]),r("div",null,[e[14]||(e[14]=r("label",{class:"block text-sm font-medium text-dark mb-2"},"Price (£) *",-1)),o(r("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>t.value.price_gbp=i),type:"number",step:"0.01",min:"0",placeholder:"e.g., 800.00",class:"w-full border border-muted rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary focus:border-primary",required:""},null,512),[[d,t.value.price_gbp]])])]),r("div",z,[e[15]||(e[15]=r("label",{class:"block text-sm font-medium text-dark mb-2"},"Description *",-1)),o(r("textarea",{"onUpdate:modelValue":e[2]||(e[2]=i=>t.value.description=i),rows:"4",placeholder:"Tell potential buyers about your dog, their temperament, health, and any other important details...",class:"w-full border border-muted rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary focus:border-primary",required:""},null,512),[[d,t.value.description]])])]),r("div",H,[e[25]||(e[25]=r("h2",{class:"text-xl font-semibold text-dark mb-4"},"Dog Details",-1)),r("div",K,[r("div",null,[e[18]||(e[18]=r("label",{class:"block text-sm font-medium text-dark mb-2"},"Breed *",-1)),o(r("select",{"onUpdate:modelValue":e[3]||(e[3]=i=>t.value.breed=i),class:"w-full border border-muted rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary focus:border-primary",required:""},[e[17]||(e[17]=r("option",{value:""},"Select Breed",-1)),(a(),l(y,null,S(B,i=>r("option",{key:i,value:i},b(i),9,q)),64))],512),[[g,t.value.breed]])]),r("div",null,[e[20]||(e[20]=r("label",{class:"block text-sm font-medium text-dark mb-2"},"Gender",-1)),o(r("select",{"onUpdate:modelValue":e[4]||(e[4]=i=>t.value.gender=i),class:"w-full border border-muted rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary focus:border-primary"},[...e[19]||(e[19]=[r("option",{value:""},"Select Gender",-1),r("option",{value:"Male"},"Male",-1),r("option",{value:"Female"},"Female",-1)])],512),[[g,t.value.gender]])]),r("div",null,[e[21]||(e[21]=r("label",{class:"block text-sm font-medium text-dark mb-2"},"Age (weeks)",-1)),o(r("input",{"onUpdate:modelValue":e[5]||(e[5]=i=>t.value.age_weeks=i),type:"number",min:"0",placeholder:"e.g., 8",class:"w-full border border-muted rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary focus:border-primary"},null,512),[[d,t.value.age_weeks]])])]),r("div",O,[e[23]||(e[23]=r("label",{class:"block text-sm font-medium text-dark mb-2"},"Link to Existing Dog (Optional)",-1)),o(r("select",{"onUpdate:modelValue":e[6]||(e[6]=i=>t.value.dog_id=i),class:"w-full border border-muted rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary focus:border-primary"}
1,[e[22]||(e[22]=r("option",{value:""},"No existing dog profile",-1)),(a(!0),l(y,null,S(h.value,i=>(a(),l("option",{key:i.id,value:i.id},b(i.name)+" ("+b(i.breed)+")",9,J))),128))],512),[[g,t.value.dog_id]]),e[24]||(e[24]=r("p",{class:"text-sm text-secondary mt-1"},"Link this listing to an existing dog in your profile for easier management",-1))])]),r("div",j,[e[27]||(e[27]=r("h2",{class:"text-xl font-semibold text-dark mb-4"},"Location",-1)),r("div",null,[e[26]||(e[26]=r("label",{class:"block text-sm font-medium text-dark mb-2"},"Location *",-1)),o(r("input",{"onUpdate:modelValue":e[7]||(e[7]=i=>t.value.location=i),type:"text",placeholder:"e.g., London, UK or Worthing, West Sussex",class:"w-full border border-muted rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary focus:border-primary",required:""},null,512),[[d,t.value.location]])])]),e[39]||(e[39]=F('<div class="bg-white rounded-lg shadow-sm border border-muted p-6"><h2 class="text-xl font-semibold text-dark mb-4">Images</h2><div class="border-2 border-dashed border-muted rounded-lg p-8 text-center"><div class="text-4xl text-secondary mb-4">📷</div><p class="text-secondary mb-4">Upload images of your dog (coming soon)</p><p class="text-sm text-secondary">For now, you can add image URLs manually in the description</p></div></div>',1)),r("div",Y,[e[37]||(e[37]=r("h2",{class:"text-xl font-semibold text-dark mb-4"},"Listing Options",-1)),r("div",Q,[e[32]||(e[32]=r("div",{class:"border border-muted rounded-lg p-4"},[r("h3",{class:"font-semibold text-dark mb-2"},"Basic Listing - Free"),r("ul",{class:"text-sm text-secondary space-y-1 mb-4"},[r("li",null,"• Standard listing placement"),r("li",null,"• Contact form"),r("li",null,"• Basic search visibility")]),r("div",{class:"text-2xl font-bold text-primary"},"£0.00")],-1)),r("div",X,[e[29]||(e[29]=r("h3",{class:"font-semibold text-dark mb-2"},"Premium Listing - £9.99",-1)),e[30]||(e[30]=r("ul",{class:"text-sm text-secondary space-y-1 mb-4"},[r("li",null,"• Highlighted listing"),r("li",null,"• Premium badge"),r("li",null,"• Higher search ranking"),r("li",null,"• More views")],-1)),e[31]||(e[31]=r("div",{class:"text-2xl font-bold text-primary"},"£9.99",-1)),r("label",$,[o(r("input",{"onUpdate:modelValue":e[8]||(e[8]=i=>t.value.is_premium=i),type:"checkbox",class:"mr-2"},null,512),[[k,t.value.is_premium]]),e[28]||(e[28]=r("span",{class:"text-sm"},"Upgrade to Premium",-1))])])]),r("div",Z,[e[34]||(e[34]=r("h3",{class:"font-semibold text-dark mb-2"},"Featured Listing - £19.99",-1)),e[35]||(e[35]=r("ul",{class:"text-sm text-secondary space-y-1 mb-4"},[r("li",null,"• Top placement in search results"),r("li",null,"• Featured badge and highlighting"),r("li",null,"• Maximum visibility"),r("li",null,"• 30-day featured period")],-1)),e[36]||(e[36]=r("div",{class:"text-2xl font-bold text-accent"},"£19.99",-1)),r("label",ee,[o(r("input",{"onUpdate:modelValue":e[9]||(e[9]=i=>t.value.is_featured=i),type:"checkbox",class:"mr-2"},null,512),[[k,t.value.is_featured]]),e[33]||(e[33]=r("span",{class:"text-sm"},"Upgrade to Featured",-1))])])]),r("div",re,[x(n,{to:"/classifieds",class:"bg-secondary hover:bg-dark text-white px-6 py-3 rounded-lg font-semibold transition-colors"},{default:v(()=>[...e[38]||(e[38]=[w(" Cancel ",-1)])]),_:1}),r("button",{type:"submit",disabled:u.value,class:"bg-primary hover:bg-accent text-dark px-6 py-3 rounded-lg font-semibold transition-colors disabled:bg-muted disabled:cursor-not-allowed"},[u.value?(a(),l("span",ie,"Creating Listing...")):(a(),l("span",oe,"Create Listing"))],8,te)])],32)])}}});export{ue as default};

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