import{V as d,u as r,ay as E,F as n,p as o,n as m}from"./client-BmVmnFEC.js";import{P as g}from"./PvLogger-Bfc8O67g.js";import{I as C}from"./IconPaypay-WqwB5i8Z.js";import{m as h}from"./makeReservationFormCompletedHead-BZ83L86r.js";import{V as v,g as A}from"./makeGtmScript-B8HLg2s0.js";import{d as f}from"./reservationForm-Dp267T2i.js";import"./loginSession-CK-JZbKZ.js";const P=d.extend({components:{IconPaypay:C},props:{isRequested:{type:Boolean,default:!1},restaurantId:{type:String,default:null},reservationHash:{type:String,default:null},reservationId:{type:Number,default:null},restaurantUrl:{type:String,default:null},unregisteredRettyEmail:{type:Boolean,default:!1},unregisteredPaypay:{type:Boolean,default:!1},paypayAmount:{type:Number,default:0},isLoggedIn:{type:Boolean,default:!1}},computed:{shouldShowPleaseRegisterEmail(){return this.shouldShowPleaseRegisterPaypay?!1:this.isLoggedIn&&this.unregisteredRettyEmail},shouldShowPleaseRegisterPaypay(){return this.paypayAmount===0?!1:this.isLoggedIn&&this.unregisteredPaypay},paypayAmountText(){return this.paypayAmount.toLocaleString()},paypayPageUrl(){return`${`${r()}/auth/paypay-link/?redirect_url=${r()}/link-reservation-to-bonus/`}?hash=${this.reservationHash}`},registRettyEmailUrl(){return`${r()}/mypage/account-setting/`},reserveDetailUrl(){const u="/restaurant/v2/reserve-status/detail",t=`?hash=${this.reservationHash}`;return this.isLoggedIn?`${r()}/my-reservation/list/`:`${E()}${u}${t}`},buttonClasses(){return{email:{"button--priority-in-page":this.unregisteredRettyEmail},paypay:{"button--priority-in-page":this.unregisteredPaypay},toDetail:{"button--priority-in-page":!this.unregisteredRettyEmail&&!this.unregisteredPaypay||this.isRequested||!this.isLoggedIn},toRestaurant:{"button--priority-in-page":!1}}},clickDetailActionType(){return n.CLICK_RESERVATION_LOGIN_EBISU_FORM_PC},clickMailRegistrationActionType(){return n.CLICK_RESERVATION_MAIL_REGISTRATION_PC},clickPayPayLinkActionType(){return n.CLICK_RESERVATION_PAYPAY_LINK_PC},inviewMailRegistrationActionType(){return n.INVIEW_RESERVATION_MAIL_REGISTRATION}},methods:{onEnter(){o({type:"action",actionType:this.inviewMailRegistrationActionType})},onClickToMeailRegister(){o({type:"action",actionType:this.clickMailRegistrationActionType})},onClickToPaypayLink(){o({type:"action",actionType:this.clickPayPayLinkActionType})},onClickToDetail(){o({type:"action",actionType:this.clickDetailActionType})}}});var B=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[t.isRequested?t._e():e("div",[t.shouldShowPleaseRegisterEmail?e("div",{staticClass:"please-resister-email"},[e("p",{staticClass:"please-resister-email__title"},[t._v("Retty用メールアドレスが未登録です")]),e("p",{staticClass:"please-resister-email__description"},[t._v("メールアドレスを登録いただくと、PayPayポイント獲得時にメールでお知らせします。")]),e("div",{staticClass:"please-resister-email__footer"},[e("in-view",{on:{enter:t.onEnter}},[e("anchor-link",{staticClass:"button",class:t.buttonClasses.email,attrs:{to:"/mypage/email-setting/"},nativeOn:{click:function(a){return t.onClickToMeailRegister.apply(null,arguments)}}},[t._v("メールアドレスを登録する")])],1)],1)]):t._e(),t.shouldShowPleaseRegisterPaypay?e("div",{staticClass:"please-resister-paypay"},[e("p",{staticClass:"please-resister-paypay__description"},[t._v("このまま終了するとPayPayポイントは獲得できません")]),e("div",{staticClass:"paypay-information"},[e("icon-paypay",{staticClass:"paypay-information__icon",attrs:{width:36,height:36}}),e("p",{staticClass:"paypay-information__text"},[e("span",{staticClass:"paypay-information__text-head"},[t._v("PayPay連携すると")]),e("span",{staticClass:"paypay-information__text-em"},[t._v("来店で"),e("em",{staticClass:"paypay-information__text-em-number paypay-information__text-point"},[t._v(t._s(t.paypayAmountText))]),e("span",{staticClass:"paypay-information__text-point"},[t._v("円相当")]),t._v("獲得できます")])])],1),e("div",{staticClass:"please-resister-email__footer"},[e("anchor-link",{staticClass:"button",class:t.buttonClasses.paypay,attrs:{to:t.paypayPageUrl},nativeOn:{click:function(a){return t.onClickToPaypayLink.apply(null,arguments)}}},[t._v("PayPay連携する")])],1)]):t._e(),t.shouldShowPleaseRegisterPaypay?e("ul",{staticClass:"attentions"},[e("li",{staticClass:"attentions__item"},[t._v("ご来店から7日前後でPayPayポイントが付与されます")]),e("li",{staticClass:"attentions__item"},[t._v("PayPayポイントの付与額は、ご予約の条件によって変動する場合があります。"),e("anchor-link",{staticClass:"attentions__link",attrs:{to:"/announce/paypay-bonus/",target:"_blank"}},[t._v("詳しくはこちら")]),t._v("をご覧ください")],1),e("li",{staticClass:"attentions__item"},[t._v("PayPayポイントは出金・譲渡はできません。PayPay公式ストアでも利用可能です")])]):t._e()]),e("ul",{staticClass:"link-list"},[e("li",{staticClass:"link-list__item"},[e("anchor-link",{staticClass:"button",class:t.buttonClasses.toDetail,attrs:{to:t.reserveDetailUrl},nativeOn:{click:function(a){return t.onClickToDetail.apply(null,arguments)}}},[t._v("予約内容を確認する")])],1),e("li",{staticClass:"link-list__item"},[e("anchor-link",{staticClass:"button",class:t.buttonClasses.toRestaurant,attrs:{to:t.restaurantUrl}},[t._v("店舗TOPへ")])],1)])])},F=[],D=m(P,B,F,!1,null,"e7171445");const R=D.exports,I=d.extend({name:"ReservationFormCompleted",components:{ReservationCompleted:R},mixins:[g,v],layout:"pc/default",props:{restaurantId:{type:String,default:null},reservationHash:{type:String,default:null},reservationId:{type:Number,default:null},isRequested:{type:Boolean,default:!1},paypayAmount:{type:Number,default:0},errorMessage:{type:String,default:null},reservationDate:{type:Object,default:null},reservationTime:{type:Object,default:null}},async asyncData({app:u,params:t,store:e}){var i;const a=await u.$urql.value.query(f,{restaurantId:Number(t.restaurantId)},{requestPolicy:"network-only"}).toPromise(),{data:s}=a;return e.dispatch("session/setSessionUser",{loginSession:(i=s==null?void 0:s.entity)==null?void 0:i.loginSession}),{pageEntity:s}},data(){return{localErrorMessage:"",pageEntity:{}}},head(){var t,e,a,s,i,l,p,y,c,_;const u={userId:((s=(a=(e=(t=this.pageEntity)==null?void 0:t.entity)==null?void 0:e.loginSession)==null?void 0:a.session)==null?void 0:s.userId)||null,ruid:A(document.cookie,"_ruid")||null};return h(((p=(l=(i=this.pageEntity)==null?void 0:i.entity)==null?void 0:l.restaurant)==null?void 0:p.name)||"",((_=(c=(y=this.pageEntity)==null?void 0:y.entity)==null?void 0:c.restaurant)==null?void 0:_.id)||0,u)},computed:{backUrl(){return{name:"reserve-form",params:{restaurantId:String(this.$route.params.restaurantId),canBack:!0}}},shouldShowContent(){return(!this.errorMessage||!this.localErrorMessage)&&!!this.reservationId},isLoggedIn(){return this.$store.getters["session/isLogin"]},unregisteredPaypay(){var u,t,e;return!((e=(t=(u=this.pageEntity)==null?void 0:u.entity)==null?void 0:t.currentUser)!=null&&e.isLinkPayPay)},unregisteredRettyEmail(){var u,t,e,a;return!((a=(e=(t=(u=this.pageEntity)==null?void 0:u.entity)==null?void 0:t.loginSession)==null?void 0:e.session)!=null&&a.rettyEmail)},restaurantUrl(){var u,t,e;return((e=(t=(u=this.pageEntity)==null?void 0:u.entity)==null?void 0:t.restaurant)==null?void 0:e.url)||""},isPaypayTargetRestaurant(){return this.paypayAmount>0}},created(){!this.errorMessage&&!this.reservationId&&(this.localErrorMessage="セッションが終了しました。予約内容はメールからご確認ください。")},mounted(){window.scrollTo(0,0)}});var k=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"page"},[e("div",{staticClass:"page__inner"},[t.shouldShowContent?e("section",{staticClass:"page-section"},[t.isRequested?e("header",{staticClass:"header"},[e("p",{staticClass:"header__text"},[t._v("お店からの連絡をお待ち下さい")]),e("p",{staticClass:"header__description"},[t._v("リクエストを送ってから1日以内にお店から連絡がない場合はお店へのお電話をお願いいたします。予約内容は、予約管理ページからも確認できます。")])]):e("header",{staticClass:"header"},[e("p",{staticClass:"header__text"},[t._v("ご予約ありがとうございました")]),e("p",{staticClass:"header__description"},[t._v("ご連絡先に予約完了のメールをお送りしました。ご予約内容は、予約管理ページからも確認できます。")])]),e("reservation-completed",{attrs:{"reservation-hash":t.reservationHash,"reservation-id":t.reservationId,"is-requested":t.isRequested,"restaurant-id":t.restaurantId,"restaurant-url":t.restaurantUrl,"unregistered-retty-email":t.unregisteredRettyEmail,"unregistered-paypay":t.unregisteredPaypay,"is-logged-in":t.isLoggedIn,"paypay-amount":t.paypayAmount}})],1):e("div",{staticClass:"empty-section"},[t._m(0),t.localErrorMessage?e("p",{staticClass:"empty-section__description"},[t._v(t._s(t.localErrorMessage))]):t._e(),t.errorMessage?e("p",{staticClass:"empty-section__description"},[t._v(t._s(t.errorMessage))]):t._e(),e("p",[e("anchor-link",{staticClass:"empty-section__button",attrs:{to:t.backUrl}},[t._v("予約TOPへ")])],1)])])])},T=[function(){var u=this,t=u._self._c;return u._self._setupProxy,t("header",{staticClass:"header"},[t("p",{staticClass:"header__text"},[u._v("予約に失敗しました")])])}],S=m(I,k,T,!1,null,"a9523211");const U=S.exports;export{U as default};