1import{s as g,E as v,a9 as d,r as h,R as a,dM as I,a7 as C,a as y,b as l,d as m,n as _}from"./index-ChSLynr4.js";import{A}from"./AppBreadcrumbs-B9e6ow05.js";import{A as M}from"./AppSpinner-CYP1qSJY.js";import{v as F,c as O}from"./ValidationUtils-DMWQzUT1.js";import{A as R}from"./AppFormFrame-COS5un4n.js";import{A as E}from"./AppForm-CR-iQKQv.js";import{C as T}from"./ContactSupportMessage-DTGQwSTM.js";import{A as $}from"./AppLoadingTile-CFxg1aa0.js";import{O as N}from"./OfferService-CGwN8qO2.js";import{S as x}from"./SubscriptionService-ubBXr3S0.js";import"./StringUtils-CMeKVQbU.js";import"./FileUtils-CMUAZTTL.js";import"./RequestUtils-BYX7BqyI.js";import"./mdp-ui-kit.common-DBredVY1.js";import"./vue.runtime.esm-CL8Ml0hl.js";import"./AppFormFieldset-olBVvfgg.js";import"./AppFormRow-D7f_4zzY.js";import"./AppSelect-B-pRIMo_.js";var w=Object.defineProperty,L=Object.getOwnPropertyDescriptor,p=(r,t,e,s)=>{for(var o=s>1?void 0:s?L(t,e):t,c=r.length-1,u;c>=0;c--)(u=r[c])&&(o=(s?u(t,e,o):u(o))||o);return s&&o&&w(t,e,o),o};let n=class extends v{async retrieveContactInfo({offerId:r,subscriptionId:t}){this.isLoading=!0;try{const[e,s]=await Promise.all([N.getOfferEssentials(r),x.getSubscriptionById(t)]),{subscriberOrgName:o}=s;this.recipient=o,this.topic=e.title}catch(e){throw d.addError("genericError"),h.push({name:a.ORGANISATION_OFFER_SUBSCRIPTION_DETAILS}),e}finally{this.isLoading=!1}}async sendContactMessage({offerId:r,subscriptionId:t}){if(!I.profile)throw new Error("User should be authenticated");this.isSaving=!0;const e={message:this.message,dataOfferId:r,subscriptionId:t};try{await C.sendMessageToSubscriber(e),d.addSuccess("contactRequestSuccess"),this.message=""}catch(s){throw d.addError("contactRequestError"),s}finally{this.isSaving=!1}}};p([l],n.prototype,"retrieveContactInfo",1);p([l],n.prototype,"sendContactMessage",1);n=p([y({generateMutationSetters:!0})],n);const i=new n({state:{isSaving:!1,isLoading:!1,topic:null,recipient:null,message:""},store:g,name:"contactSubscriber"}),S=m({name:"ContactSubscriberForm",components:{AppFormFrame:R,AppForm:E,ContactSupportMessage:T,AppLoadingTile:$},props:{offerId:{type:String,required:!0},subscriptionId:{type:String,required:!0}},data(){return{contactSubscriberModule:i}},computed:{isFormDisabled(){return this.$v.$error||i.isSaving},validator(){return O(this.$v.contactSubscriberModule)}},validations(){return{contactSubscriberModule:{message:{required:F.required},recipient:{},topic:{}}}},methods:{async sendMessage(){this.$v.$touch(),!this.isFormDisabled&&(await i.sendContactMessage({offerId:this.offerId,subscriptionId:this.subscriptionId}),this.$v.$reset())}}});var f={en:{title:"Contact Subscriber",description:"For contacting the selected subscriber of your data offer please fill in the following formular.",sendMessage:"Send Message"},de:{title:"Kontakt",description:"Um den ausgewählten Abonnenten Ihres Datenangebots zu kontaktieren, füllen Sie bitte das folgende Formular aus.",sendMessage:"Nachricht senden"}};const D=f;f.en;f.de;function b(r){const t=r.options||r;t.__i18n=t.__i18n||[],t.__i18n.push(JSON.stringify(D))}var P=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"contact-subscriber-form"},[e("div",{staticClass:"container"},[e("AppFormFrame",{staticClass:"contact-subscriber-form__frame"},[e("AppForm",{staticClass:"contact-subscriber-form__form",attrs:{novalidate:""},on:{submit:t.sendMessage},scopedSlots:t._u([{key:"title",fn:function(){return[t._v(" "+t._s(t.$t("title"))+" ")]},proxy:!0},{key:"head",fn:function(){return[e("p",{staticClass:"contact-subscriber-form__description"},[t._v(" "+t._s(t.$t("description"))+" ")])]},proxy:!0},{key:"footer",fn:function(){return[e("button",{staticClass:"contact-subscriber-form__send-message button button--primary",attrs:{type:"submit",disabled:t.isFormDisabled}},[t._v(" "+t._s(t.$t("sendMessage"))+" ")])]},proxy:!0}])},[t.contactSubscriberModule.isSaving?e("AppLoadingTile",[t._v(" "+t._s(t.$t("generalFormLoadingText"))+" ")]):t._e(),e("ContactSupportMessage",{attrs:{topic:t.contactSubscriberModule.topic,recipient:t.contactSubscriberModule.recipient,message:t.contactSubscriberModule.message,validator:t.validator}
1,on:{"update:message":function(s){return t.$set(t.contactSubscriberModule,"message",s)}}})],1)],1)],1)])},q=[];typeof b=="function"&&b(S);var B=_(S,P,q,!1,null,"9a647d9f");const U=B.exports,G=m({name:"ContactSubscriber",components:{ContactSubscriberForm:U,AppSpinner:M,AppBreadcrumbs:A},props:{offerId:{type:String,required:!0},subscriptionId:{type:String,required:!0}},data(){return{contactSubscriberModule:i,breadcrumbs:[a.ORGANISATION_OFFERS,a.ORGANISATION_OFFER_DETAILS,a.ORGANISATION_OFFER_SUBSCRIPTION_DETAILS,a.CONTACT_SUBSCRIBER]}},created(){i.retrieveContactInfo({offerId:this.offerId,subscriptionId:this.subscriptionId})},destroyed(){i.resetState()}});var k=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"contact-subscriber"},[e("transition",{attrs:{name:"opacity",mode:"out-in"}},[t.contactSubscriberModule.isLoading?e("div",{key:"spinner",staticClass:"contact-subscriber__spinner"},[e("AppSpinner")],1):e("div",{key:"content",staticClass:"contact-subscriber__content"},[e("AppBreadcrumbs",{staticClass:"contact-subscriber__breadcrumbs",attrs:{items:t.breadcrumbs}}),e("ContactSubscriberForm",{staticClass:"contact-subscriber__form",attrs:{"offer-id":t.offerId,"subscription-id":t.subscriptionId}})],1)])],1)},j=[],z=_(G,k,j,!1,null,"c855e4de");const ut=z.exports;export{ut 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.