PageSourceSearch

https://datsumou-madoguchi.com/wp-content/plugins/dmtc-site-starter/assets/direct-booking.js?ver=1.0.69

js datsumou-madoguchi.com collected 2026-10-04 14:02:09 UTC 14,600 bytes, 128 lines download raw bytes

1/* Clinic-specific booking links supplied and confirmed by the clinic. No answers or photos are transferred. */
2(()=>{'use strict';
3const base='https://reservation.medical-force.com/b/142c444b-7333-4013-95ef-1b2cb065e374';
4// Order: beauty consultation, beauty consultation+treatment, beauty prepaid treatment,
5// hair consultation, hair consultation+treatment, hair prepaid treatment.
6const clinics={
7 nihonbashi:{id:'bf16ff9be9dd4544b1fe145812897e69',menus:['01383e8e-78ad-49cc-833e-cb6372a51f55','b75fcec3-64c1-4297-9219-889bc1aa7f6f','5cb13fc0-6bd6-42b4-a9ea-40ef690fa23c','6378c120-929d-4683-8a99-c4bfaebdfd57','76e41d90-d866-4795-96e1-a658fec50c79','a62a41b0-4de2-42e3-bcd7-1fed8dcef0ee']},
8 shibuya:{id:'f88775f2f2554778b5c194dc551e1a0e',menus:['2211fca4-3e15-496e-b3e2-0d872f7fd174','4acf68e3-535d-432f-bc5d-12833d3d65d6','c0f8ed20-2086-440c-823f-da74cca5fb4f','049bf8cb-e91c-4b02-b0f6-2c9da313535f','97fd805b-4207-449d-864b-38c15cb5c301','e0cbaf2d-daf9-465f-87f6-d7ceb91c0542']},
9 omiya:{id:'32455de4259d47e0827400a0af89c111',menus:['25337047-a6ad-4ed0-83cb-8abe364d0290','93cd9126-d434-464f-aef1-416d790e877d','5236e2ed-ca38-42bb-a64d-8c3572de07f8','b1dfa338-f1cf-4c1d-9e68-543ca151d240','8110d01f-d043-4a06-b33b-dcda035d1bb6','a930d5a2-bf0c-47e5-a83b-4ef3a19898b4']}
10};
11const copy={
12 ja:{book:'WEB予約',title:'ご予約内容を選んでください',clinic:'クリニック',names:['日本橋院','渋谷院','大宮院'],groups:['美容施術','医療脱毛'],choices:['カウンセリングのみ','カウンセリング+施術','施術のみ(事前決済済み)'],lead:'選ぶと予約画面へ進みます。',close:'閉じる'},
13 en:{book:'Book online (Japanese)',title:'Choose your booking',clinic:'Clinic',names:['Nihonbashi','Shibuya','Omiya'],groups:['Aesthetic treatments','Laser hair removal'],choices:['Consultation only','Consultation + treatment','Treatment only (already prepaid)'],lead:'The booking service opens in Japanese. Select LANGUAGE at the top right to switch to English; you may need to select it again after changing pages. Menu names may remain in Japanese. Chinese and Korean are not supported. Confirmation emails use the clinic’s preset message and do not automatically follow the selected language.',close:'Close'},
14 'zh-hans':{book:'在线预约(日语)',title:'请选择预约内容',clinic:'诊所',names:['日本桥院','涩谷院','大宫院'],groups:['美容治疗','医疗脱毛'],choices:['仅咨询','咨询+治疗','仅治疗(已预付)'],lead:'预约页面以日语打开。可通过右上角 LANGUAGE 切换为英语,跳转页面后可能需要重新选择。项目名称可能仍为日语。目前不支持中文和韩语。确认邮件使用诊所预设内容,不会随所选语言自动切换。',close:'关闭'},
15 ko:{book:'온라인 예약 (일본어)',title:'예약 내용을 선택해 주세요',clinic:'클리닉',names:['니혼바시점','시부야점','오미야점'],groups:['미용 시술','의료 제모'],choices:['상담만','상담+시술','시술만 (사전 결제 완료)'],lead:'예약 화면은 일본어로 열립니다. 오른쪽 위 LANGUAGE에서 영어로 변경할 수 있으며, 페이지 이동 후 다시 선택해야 할 수 있습니다. 메뉴 이름은 일본어로 남을 수 있습니다. 중국어와 한국어는 지원하지 않습니다. 확인 메일은 병원에서 설정한 내용으로 발송되며 선택한 언어가 자동 적용되지 않습니다.',close:'닫기'}
16};
17const notices={
18 ja:['表面麻酔をご希望の方','診療終了90分前までの時間帯をご予約ください。','指名・お問い合わせ','LINEでご連絡ください。','医師指名料:5,500円/山中医師:8,800円','医師の勤務日を見る'],
19 en:['If you would like topical anaesthesia','Please book a time at least 90 minutes before the clinic closes.','Staff requests and enquiries','Please contact us via LINE.','Doctor request fee: ¥5,500 / Dr Yamanaka: ¥8,800','View doctor working days'],
20 'zh-hans':['如需表面麻醉','请选择距诊疗结束至少90分钟的预约时间。','指定医护人员及咨询','请通过LINE联系我们。','医生指定费:5,500日元/山中医生:8,800日元','查看医生出诊日期'],
21 ko:['표면마취를 원하시는 분','진료 종료 최소 90분 전 시간대로 예약해 주세요.','의료진 지정 및 문의','LINE으로 연락해 주세요.','의사 지정료: 5,500엔 / 야마나카 의사: 8,800엔','의사 근무일 보기']
22};
23function route(){return window.dmtcStarter?.route||document.body.dataset.dmtcsRoute||location.pathname;}
24function language(){return (route().match(/(?:^|\/)(en|zh-hans|ko)\//i)?.[1]||document.documentElement.lang||'ja').toLowerCase();}
25function words(){return copy[language()]||copy.ja;}
26function isBookingRoot(a){
27 try { const u=new URL(a.getAttribute('href'),document.baseURI), target=new URL(base);
28 return u.origin===target.origin && u.pathname.replace(/\/+$/,'')===target.pathname;
29 } catch (_) { return false; }
30}
31// DMTC patch 2026-10-03: keep AI Engine links outside site-wide booking enhancements.
32// Do not add LINE buttons, booking classes or dialogs inside AI-generated replies.
33// The optional data attribute can exclude other intentionally plain-link regi
33ons.
34const bookingIgnoreSelector=[
35 '.mwai-chatbot-container','.mwai-chatbot','.mwai-chat','.mwai-window',
36 '.mwai-conversation','[id^="mwai-chatbot-"]','[id^="mwai-chat-"]',
37 '[data-dmtcs-booking-ignore]'
38].join(',');
39function ignoreBooking(a){return !!a?.closest?.(bookingIgnoreSelector);}
40function articleScope(a){return !window.dmtcsArticleBookingOnly||!!a.closest('.dmtcs-article-cta');}
41function update(a){if(ignoreBooking(a)||!articleScope(a)||a.hasAttribute('lang'))return;const href=a.getAttribute('href')||'';
42if(a.matches('[data-book],.dmtc-reservation')||/#reserve$/.test(href)||/(?:^|\/)book\/(?:index\.html)?(?:#.*)?$/.test(href)){a.href=base;a.removeAttribute('data-book');a.textContent=words().book;}
43if(isBookingRoot(a)){a.setAttribute('aria-haspopup','dialog');if(a.textContent.trim()==='WEB予約へ進む')a.textContent=words().book;}
44if(isBookingRoot(a)&&language()==='ja'&&!a.closest('#dmtcs-booking'))a.classList.add('dmtcs-web-booking');
45if(isBookingRoot(a)&&language()==='ja'&&!a.closest('#dmtcs-booking')&&!a.dataset.dmtcsLineAdded){
46 a.dataset.dmtcsLineAdded='true';if(a.nextElementSibling?.classList.contains('dmtcs-line-booking'))return;const line=document.createElement('a');line.href='https://lin.ee/VXqC1Iy';line.className='dmtcs-line-booking';line.textContent='LINE予約';
47 if(a.hasAttribute('data-dmtcs-consultation-only'))line.setAttribute('aria-label','LINEでカウンセリングを予約');
48 a.after(line);
49}
50if(a.textContent.trim()==='クリニック・予約案内')a.textContent='クリニック案内';
51}
52function scan(root){if(root.matches?.('a'))update(root);root.querySelectorAll?.('a').forEach(update);}
53function placement(a){
54 if(a.closest('#dmtcs-booking'))return dialog?.dataset.dmtcsBookingLocation||'other';
55 if(a.closest('.dmtcs-article-cta'))return 'article_bottom';
56 if(a.closest('.sticky,.mobile-bar'))return 'fixed_bar';
57 if(a.closest('.home-hero,.hero'))return 'hero';
58 if(a.closest('.clinic-card'))return 'clinic_card';
59 if(a.closest('#dmtcs-fukuoka-opening'))return 'fukuoka_notice';
60 if(a.closest('#dmtcs-points'))return 'line_benefit';
61 if(a.closest('#reserve'))return 'bottom_cta';
62 if(a.closest('header,.dmtcs-mobile-header'))return 'header';
63 return 'other';
64}
65// GTM custom event only. Never send patient answers, treatment names, URLs or form values.
66// GA4 destination and consent remain controlled by the existing GTM configuration.
67function trackBooking(a){
68 const root=isBookingRoot(a),choice=a.classList.contains('dmtcs-book-choice'),line=a.matches('.dmtcs-line-booking,.dmtcs-line-registration');
69 if(!root&&!choice&&!line)return;
70 const candidate=choice?document.querySelector('#dmtcs-book-clinic')?.value:(a.dataset.dmtcsClinic||a.parentElement?.querySelector('[data-dmtcs-clinic]')?.dataset.dmtcsClinic);
71 const payload={event:a.dataset.dmtcsLinePurpose==='opening'?'dmtc_opening_interest':'dmtc_booking_click',booking_channel:line?'line':'web',booking_location:placement(a),booking_step:root?'open_selector':'outbound',booking_clinic:Object.hasOwn(clinics,candidate)?candidate:'unspecified'};
72 try{window.dataLayer=window.dataLayer||[];window.dataLayer.push(payload);document.dispatchEvent(new CustomEvent('dmtc:booking-click',{detail:payload}));}catch(_){}
73}
74let dialog,opener;
75function openBooking(a){
76 if(typeof HTMLDialogElement==='undefined'||!HTMLDialogElement.prototype.showModal)return false;
77 const t=words();opener=a;
78 const consultationOnly=a.hasAttribute("data-dmtcs-consultation-only");
79 if(!dialog){
80  const style=document.createElement('style');style.textContent=`
81  #dmtcs-booking{box-sizing:border-box;width:calc(100% - 24px);max-width:560px;max-height:85vh;max-height:85dvh;margin:auto;padding:22px;border:1px solid #c6dedd;border-radius:18px;background:#fff;color:#263b3c;overflow-y:auto;overscroll-behavior:contain;font:16px/1.5 sans-serif;}
82  #dmtcs-booking::backdrop{background:rgba(0,0,0,.45)}#dmtcs-booking *{box-sizing:border-box}
83  #dmtcs-booking .dmtcs-book-close{display:block;margin:0 0 12px auto;padding:8px 14px;background:white;color:#087e84;border:1px solid #087e84;border-radius:8px;
83cursor:pointer}
84  #dmtcs-booking h2{font:700 21px/1.5 sans-serif;margin:0 0 8px}#dmtcs-booking p{font-size:14px;margin:0 0 16px}
85  #dmtcs-booking label{display:block;font-weight:700}#dmtcs-booking select{width:100%;max-width:100%;font:inherit;padding:10px;margin:6px 0 18px;border:1px solid #7cbfbc;border-radius:8px;background:white;color:#263b3c}
86  #dmtcs-booking h3{font:700 16px/1.5 sans-serif;margin:16px 0 8px}#dmtcs-booking .dmtcs-book-choice{display:block;width:100%;padding:12px;margin:8px 0;border:1px solid #80c8c3;border-radius:10px;background:#f1faf9;color:#086e74;text-decoration:none;white-space:normal;overflow-wrap:anywhere;font-weight:700}
87  #dmtcs-booking section{margin:0;padding:0;border:0;min-height:0}
88  #dmtcs-booking .dmtcs-book-notice{padding:12px;margin:0 0 14px;background:#f5f9f9;border:1px solid #d2e6e4;border-radius:10px;font-size:14px;line-height:1.6}
89  #dmtcs-booking .dmtcs-book-notice h3{font-size:14px;margin:0 0 4px}#dmtcs-booking .dmtcs-book-notice p{margin:0 0 10px;font-size:14px}#dmtcs-booking .dmtcs-book-notice a{color:#086e74;text-decoration:underline}
90  #dmtcs-booking :focus-visible{outline:3px solid #087e84;outline-offset:2px}`;
91  document.head.append(style);dialog=document.createElement('dialog');dialog.id='dmtcs-booking';dialog.setAttribute('aria-labelledby','dmtcs-book-title');document.body.append(dialog);
92  dialog.addEventListener('close',()=>opener?.focus());
93  dialog.addEventListener('click',e=>{if(e.target===dialog){const r=dialog.getBoundingClientRect();if(e.clientX<r.left||e.clientX>r.right||e.clientY<r.top||e.clientY>r.bottom)dialog.close();}});
94 }
95 dialog.dataset.dmtcsBookingLocation=placement(a);
96 dialog.replaceChildren();
97 const close=document.createElement('button');close.type='button';close.className='dmtcs-book-close';close.textContent=t.close;close.onclick=()=>dialog.close();
98 const title=document.createElement('h2');title.id='dmtcs-book-title';title.textContent=t.title;
99 const lead=document.createElement('p');lead.textContent=t.lead;
100 const label=document.createElement('label');label.htmlFor='dmtcs-book-clinic';label.textContent=t.clinic;
101 const select=document.createElement('select');select.id='dmtcs-book-clinic';
102 const blank=new Option('— '+t.clinic+' —','');select.append(blank);
103 Object.keys(clinics).forEach((key,i)=>select.append(new Option(t.names[i],key)));
104 const requested=a.dataset.dmtcsClinic;
105 const detected=(Object.hasOwn(clinics,requested)?requested:'')||route().match(/clinic-(nihonbashi|shibuya|omiya)\.html/)?.[1];select.value=detected||'';
106 const note=document.createElement('aside');note.className='dmtcs-book-notice';
107 const n=notices[language()]||notices.ja;
108 const anaesthesia=document.createElement('h3');anaesthesia.textContent=n[0];
109 const timing=document.createElement('p');timing.textContent=n[1];
110 const requests=document.createElement('h3');requests.textContent=n[2];
111 const contact=document.createElement('p');contact.append(document.createTextNode(n[3]),document.createElement('br'),document.createTextNode(n[4]));
112 const shift=document.createElement('a');shift.href='https://datsumou-madoguchi.com/doctors-working-days/';shift.textContent=n[5];shift.target='_blank';shift.rel='noopener noreferrer';
113 if(!consultationOnly)note.append(anaesthesia,timing);
114 note.append(requests,contact,shift);
115 const choices=document.createElement('div');choices.setAttribute('aria-live','polite');
116 function render(){choices.replaceChildren();const c=clinics[select.value];if(!c)return;
117 t.groups.forEach((group,g)=>{if(consultationOnly&&g!==0)return;const section=document.createElement('section');const h=document.createElement('h3');h.textContent=group;section.append(h);t.choices.forEach((name,i)=>{if(consultationOnly&&i!==0)return;const link=document.createElement('a');link.className='dmtcs-book-choice';link.textContent=name+' →';link.href=base+'/reservations/new?c='+c.id+'&menu_entrance_id='+c.menus[g*3+i];section.append(link);});choices.append(section);});
118 }
119 select.addEventListener('change',render);render();dialog.append(close,title,lead);
120 if(language()==='ja'){
121  const benefit=document.createElement('p');benefit.className='dmtcs-book-notice';benefit.append(document.createTextNode('WEB予約も、LINE登録でお会計金額の10%ポイント還元。'));
122  const registration=document.createElement('a');registration.href='https://lin.ee/VXqC1Iy';registration.textContent='LINE登録はこちら';registration.target='_blank';registration.rel='noopener';registration.className='dmtcs-line-registration';benefit.append(registration);dialog.append(benefit);
123 }
124 dialog.append(label,select,note,choices);dialog.showModal();title.tabIndex=-1;title.focus({preventScroll:true});dialog.scrollTop=0;return true;
125}
126scan(document);new MutationObserver(rs=>rs.forEach(r=>r.addedNodes.forEach(scan))).observe(document.body,{childList:true,subtree:true});
127window.addEventListener('click',e=>{const a=e.target.closest?.('a');if(!a||ignoreBooking(a)||(!articleScope(a)&&!a.closest('#dmtcs-booking')))return;update(a);trackBooking(a);if(isBookingRoot(a)){e.stopImmediatePropagation();if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&openBooking(a))e.preventDefault();}},true);
128})();

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.