PageSourceSearch

https://buddicarsv.lovable.app/assets/sakai.request-Nlme2coU.js

js buddicarsv.lovable.app collected 2026-10-03 03:24:52 UTC 13,152 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visits.functions-BsFZ1OZG.js","assets/sonner-D-yLv_Jo.js","assets/index-jOKgC_H_.js"])))=>i.map(i=>d[i]);
2import{r as s,_ as X,j as e}from"./index-jOKgC_H_.js";import{u as Z,T as w,t as u}from"./sonner-D-yLv_Jo.js";import{i as ee,l as D}from"./liff-Y5tXGdX_.js";import{c as re,P as te,D as se,T as ae,R as le,a as de}from"./sakai-request.functions-C_Ve5GsR.js";const M=["日","月","火","水","木","金","土"],E="2026-08";function $(p){const m=new Date(`${p}T00:00:00+09:00`);return`${m.getMonth()+1}月${m.getDate()}日(${M[m.getDay()]})`}const ne=["大変恐れ入りますが、お問い合わせが集中しているため、まずは下記フォームよりご希望日(第3希望まで)をご入力ください。","内容を確認のうえ、担当よりこのチャットで順次ご連絡し、日時を確定させていただきます。"];function xe(){const p=Z(re),[m,L]=s.useState(null),[a,I]=s.useState(null),[b,R]=s.useState(""),[g,U]=s.useState(""),[h,_]=s.useState(""),[f,P]=s.useState(""),[j,q]=s.useState(""),[y,F]=s.useState(""),[N,A]=s.useState(""),[v,O]=s.useState(""),[T,Y]=s.useState(""),[S,V]=s.useState(""),[d,B]=s.useState([]),[i,Q]=s.useState(""),[x,G]=s.useState(""),[k,C]=s.useState(!1),[H,W]=s.useState(!1);s.useEffect(()=>{ee().then(r=>{L(r),r?.idToken&&X(async()=>{const{recordVisit:t}=await import("./visits.functions-BsFZ1OZG.js");return{recordVisit:t}},__vite__mapDeps([0,1,2])).then(({recordVisit:t})=>{t({data:{lineIdToken:r.idToken,path:"/sakai/request"}}).catch(()=>{})})})},[]);const z=s.useMemo(()=>{const[r,t]=E.split("-").map(Number),l=new Date(Date.UTC(r,t-1,1)),n=new Date(Date.UTC(r,t,0)).getUTCDate(),c=Array.from({length:l.getUTCDay()},()=>null);for(let o=1;o<=n;o++)c.push(`${E}-${String(o).padStart(2,"0")}`);return c},[]);function J(r){B(t=>t.includes(r)?t.filter(l=>l!==r):t.length>=3?(u.error("ご希望日は第3希望までです"),t):[...t,r])}async function K(r){if(r.preventDefault(),!!a){if(d.length===0){u.error("ご希望日を1つ以上お選びください");return}C(!0);try{const t=await p({data:{requestType:a,name:b.trim(),phone:g.trim(),deliveryTiming:a==="sales"&&h||null,desiredModel:a==="sales"&&f.trim()||null,stockUrl:a==="sales"&&j.trim()||null,tradein:a==="sales"&&y||null,maker:a==="purchase"&&N.trim()||null,carModel:a==="purchase"&&v.trim()||null,carYear:a==="purchase"&&T.trim()||null,mileage:a==="purchase"&&S.trim()||null,preferredDate1:d[0],preferredDate2:d[1]??null,preferredDate3:d[2]??null,preferredTime:i||null,notes:x.trim()||null,lineIdToken:m?.idToken??null}});if(!t.ok){u.error(t.error??"送信に失敗しました");return}try{if(D.isInClient?.()&&typeof D.sendMessages=="function"){const l=["【BUDDICA 堺 ご希望日フォーム 送信完了】",`ご相談内容:${a==="sales"?"購入相談":"買取相談"}`,`お名前:${b.trim()}`,`電話番号:${g.trim()}`,...a==="sales"?[`納車ご希望時期:${h||"—"}`,`ご希望車種:${f.trim()||"—"}`,`在庫車URL:${j.trim()||"—"}`,`下取り査定:${y||"—"}`]:[`メーカー:${N.trim()}`,`車種:${v.trim()}`,`年式:${T.trim()}`,`走行距離:${S.trim()}`],...d.map((n,c)=>`第${c+1}希望:${$(n)}`),...i?[`ご希望時間:${i}`]:[],...x.trim()?[`ご相談内容:${x.trim()}`]:[],"","※この時点ではご予約確定ではございません。","内容を確認のうえ、担当より順次ご連絡いたします。"];await D.sendMessages([{type:"text",text:l.join(`
3`)}])}}catch(l){console.warn("[LIFF] sendMessages failed",l)}W(!0)}catch{u.error("通信エラーが発生しました")}finally{C(!1)}}}return H?e.jsxs("div",{className:"min-h-screen bg-background p-6 flex items-center justify-center",children:[e.jsx(w,{}),e.jsxs("div",{className:"w-full max-w-md overflow-hidden rounded-2xl border-2 border-primary bg-card",children:[e.jsxs("div",{className:"bg-primary px-5 py-7 text-center text-primary-foreground",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-primary-foreground
3/20 text-4xl",children:"✓"}),e.jsx("h1",{className:"mt-3 text-xl font-extrabold",children:"ご希望日を送信しました"}),e.jsx("p",{className:"mt-1 text-xs opacity-90",children:"※ この時点ではご予約確定ではございません"})]}),e.jsxs("div",{className:"space-y-3 p-5 text-sm",children:[e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"ご相談内容"}),e.jsx("p",{className:"font-bold",children:a==="sales"?"購入相談":"買取相談"}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"ご希望日"}),d.map((r,t)=>e.jsxs("p",{className:"font-bold",children:["第",t+1,"希望:",$(r)]},r)),i&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"ご希望時間"}),e.jsx("p",{className:"font-bold",children:i})]})]}),e.jsx("p",{className:"font-bold",children:"担当より順次ご連絡します。"})]})]})]}):e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(w,{}),e.jsxs("header",{className:"bg-primary px-5 py-6 text-primary-foreground",children:[e.jsx("h1",{className:"text-lg font-extrabold",children:"BUDDICA 堺 来店ご希望日フォーム"}),e.jsx("p",{className:"mt-1 text-xs opacity-90",children:"オープン前後の追加枠について、ご希望日をお伺いします"})]}
3),e.jsxs("main",{className:"mx-auto w-full max-w-md space-y-5 p-4 pb-16",children:[e.jsx("section",{className:"rounded-xl border border-border bg-card p-4 text-xs leading-relaxed",children:ne.map(r=>e.jsx("p",{className:"mb-2 last:mb-0",children:r},r))}),e.jsxs("section",{className:"rounded-xl border border-border bg-card p-4 text-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"お急ぎの場合はお電話ください"}),e.jsx("a",{href:"tel:0722002700",className:"text-lg font-extrabold text-primary underline",children:"TEL:072-200-2700"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"(9:00-18:00 / 水曜定休)"})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-bold text-primary",children:"STEP 1. ご相談内容"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{v:"sales",label:"購入相談"},{v:"purchase",label:"買取相談"}].map(r=>e.jsx("button",{type:"button",onClick:()=>I(r.v),className:`rounded-lg border-2 px-3 py-4 text-sm font-bold ${a===r.v?"border-primary bg-primary text-primary-foreground":"border-border bg-card text-foreground"}`,children:r.label},r.v))})]}),a&&e.jsxs("form",{onSubmit:K,className:"space-y-5",children:[e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-bold text-primary",children:"STEP 2. ご希望日(第3希望まで)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"「◯」の日付をタップした順に第1〜第3希望となります。8月8日・9日は満枠、水曜は定休日のため選択できません。"}),e.jsxs("div",{className:"mt-2 rounded-lg border border-primary/30 bg-primary/5 p-2 text-xs leading-relaxed text-foreground",children:[e.jsx("p",{className:"font-bold text-primary",children:"※ 8月8日(土)・9日(日)のオープン当日について"}),e.jsx("p",{className:"mt-0.5",children:"商談(予約)枠は満枠となっておりますが、商談以外のご来場は可能です。オープンイベントにお気軽にお越しください。"})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-3",children:[e.jsx("p",{className:"mb-2 text-center text-sm font-bold",children:"2026年8月"}),e.jsxs("div",{className:"mb-3 flex justify-center gap-2 text-[11px] font-bold",children:[e.jsx("span",{className:"rounded-full border border-primary/40 bg-primary/10 px-2 py-1 text-primary",children:"◯ 相談可"}),e.jsx("span",{className:"rounded-full border border-border bg-muted px-2 py-1 text-muted-foreground",children:"満枠"}),e.jsx("span",{className:"rounded-full border border-border bg-muted px-2 py-1 text-muted-foreground",children:"定休"})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 text-[10px] text-muted-foreground",children:M.map(r=>e.jsx("div",{className:"text-center",children:r},r))}),e.jsx("div",{className:"mt-1 grid grid-cols-7 gap-1",children:z.map((r,t)=>{if(!r)return e.jsx("div",{},`e${t}`);const l=le.includes(r),n=de.includes(r),c=!n&&!l,o=d.indexOf(r);return e.jsxs("button",{type:"button",disabled:!n,onClick:()=>J(r),className:`min-h-12 rounded-md border py-1.5 text-center ${o>=0?"bg-primary text-primary-foreground":n?"border-primary/40 bg-primary/10 text-foreground":"border-border bg-muted text-muted-foreground opacity-60"}`,children:[e.jsx("span",{className:"block text-xs font-semibold leading-tight",children:Number(r.slice(8))}),e.jsx("span",{className:"block text-[10px] font-bold leading-tight",children:o>=0?`第${o+1}`:l?"満枠":c?"定休":"◯"})]},r)})})]}),d.length>0&&e.jsx("ul",{className:"space-y-1 text-xs",children:d.map((r,t)=>e.jsxs("li",{children:["第",t+1,"希望:",e.jsx("span",{className:"font-bold",children:$(r)})]},r))}),e.jsxs("div",{className:"pt-2",children:[e.jsx("p",{className:"mb-1 text-xs font-bold",children:"ご希望時間(任意)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:te.map(r=>e.jsx("button",{type:"button",onClick:()=>Q(t=>t===r?"":r),className:`rounded-lg border-2 px-2 py-3 text-xs font-bold ${i===r?"border-primary bg-primary text-primary-foreground":"border-border bg-card"}`,children:r},r))})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm font-bold text-primary",children:"STEP 3. お客様情報"}),e.jsx("input",{value:b,onChange:r=>R(r.target.value),placeholder:"お名前(本名)例:山田 太
3郎",autoComplete:"off",required:!0,maxLength:100,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"}),e.jsx("input",{value:g,onChange:r=>U(r.target.value),placeholder:"電話番号",inputMode:"tel",required:!0,maxLength:20,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"}),a==="sales"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-xs font-bold",children:"納車ご希望時期"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:se.map(r=>e.jsx("button",{type:"button",onClick:()=>_(r),className:`rounded-lg border-2 px-2 py-2 text-xs font-bold ${h===r?"border-primary bg-primary text-primary-foreground":"border-border bg-card"}`,children:r},r))})]}),e.jsx("input",{value:f,onChange:r=>P(r.target.value),placeholder:"ご希望車種(任意)",maxLength:120,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"}),e.jsx("input",{value:j,onChange:r=>q(r.target.value),placeholder:"気になっている在庫車URL(任意)",inputMode:"url",maxLength:500,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-xs font-bold",children:"下取り査定(任意)"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:ae.map(r=>e.jsx("button",{type:"button",onClick:()=>F(t=>t===r?"":r),className:`rounded-lg border-2 px-2 py-2 text-xs font-bold ${y===r?"border-primary bg-primary text-primary-foreground":"border-border bg-card"}`,children:r},r))})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{value:N,onChange:r=>A(r.target.value),placeholder:"メーカー(例:トヨタ)",required:!0,maxLength:60,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"}),e.jsx("input",{value:v,onChange:r=>O(r.target.value),placeholder:"車種(例:アルファード)",required:!0,maxLength:80,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"}),e.jsx("input",{value:T,onChange:r=>Y(r.target.value),placeholder:"年式(例:2019年)",required:!0,maxLength:20,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"}),e.jsx("input",{value:S,onChange:r=>V(r.target.value),placeholder:"走行距離(例:45,000km)",required:!0,maxLength:30,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"})]}),e.jsx("textarea",{value:x,onChange:r=>G(r.target.value),placeholder:"ご相談内容・ご要望(任意)",rows:3,maxLength:1e3,className:"w-full rounded-lg border border-border bg-card px-3 py-3 text-sm"})]}),e.jsxs("section",{className:"space-y-2 rounded-xl border border-border bg-muted/50 p-4 text-xs leading-relaxed",children:[e.jsx("p",{children:"※ フォーム送信の時点ではご予約確定ではございません"}),e.jsx("p",{children:"※ 枠に限りがあるため、ご希望に添えない場合がございます"})]}),e.jsx("button",{type:"submit",disabled:k,className:"w-full rounded-lg bg-primary py-4 text-sm font-extrabold text-primary-foreground disabled:opacity-50",children:k?"送信中...":"この内容で送信する"})]})]})]})}export{xe as component};

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.