PageSourceSearch

https://www.letu.ru/assets/old/ReferralModal-ce63770d.js

js letu.ru collected 2026-09-24 09:15:33 UTC 5,810 bytes, 5 lines download raw bytes

1import{b as s}from"./vendor-vue-f1e40b88.js";import{ShortlinkV1Service as i}from"./ShortlinkV1Service-d08dbe94.js";import{L as l,a as o,S as n}from"./index-1013c94c.js";import{s as c}from"./integrations-segmentstream-64db345c.js";import{n as m}from"./vendor-splide-553a92e4.js";import"./vendor-2a7d4d80.js";import"./vendor-pswp-621c5ce1.js";import"./storage-cbd59dc5.js";import"./config-mapping-e946c215.js";import"./vendor-lodash-eca661c5.js";import"./svg-icons-b82f4eb9.js";import"./locales-ru-71ae3989.js";import"./locales-cn-8b47651b.js";import"./vendor-date-fns-48feb8c9.js";const h=4e3,d={name:"ReferralModal",components:{LeButton:l,LeIcon:o},props:{payload:{type:Object,default:()=>({})}},data(){return{shortLinkUrl:"",isShortLinkLoading:!1}},computed:{...s("features",["webCustomStyleParams"]),modalTitle(){return this.webCustomStyleParams.referralStickyBlockTitle},imageBlockTitle(){return this.webCustomStyleParams.referralImageBlockTitle},imageUrl(){return this.webCustomStyleParams.referralImageBlockImageUrl},captionTitle(){return this.webCustomStyleParams.referralImageBlockCaptionTitle},captionText(){return this.webCustomStyleParams.referralImageBlockCaptionText},shareOgTitle(){return this.webCustomStyleParams.referralShareOgTitle},shareOgDescription(){return this.webCustomStyleParams.referralShareOgDescription},steps(){return[{id:1,title:this.webCustomStyleParams.referralStickyItem1Title,text:this.webCustomStyleParams.referralStickyItem1Description,icon:this.webCustomStyleParams.referralStickyItem1IconName},{id:2,title:this.webCustomStyleParams.referralStickyItem2Title,text:this.webCustomStyleParams.referralStickyItem2Description,icon:this.webCustomStyleParams.referralStickyItem2IconName},{id:3,title:this.webCustomStyleParams.referralStickyItem3Title,text:this.webCustomStyleParams.referralStickyItem3Description,icon:this.webCustomStyleParams.referralStickyItem3IconName}]},cssVars(){const e={};return this.webCustomStyleParams.referralStickyBackgroundColor&&(e["--referral-sticky-bg"]=this.webCustomStyleParams.referralStickyBackgroundColor),this.webCustomStyleParams.referralStickyIconColor&&(e["--referral-sticky-icon-color"]=this.webCustomStyleParams.referralStickyIconColor),this.webCustomStyleParams.referralStickyIconBackgroundColor&&(e["--referral-sticky-icon-bg"]=this.webCustomStyleParams.referralStickyIconBackgroundColor),this.webCustomStyleParams.referralImageBlockBackgroundColor&&(e["--referral-image-bg"]=this.webCustomStyleParams.referralImageBlockBackgroundColor),e},relativeUrl(){return this.payload.relativeUrl??""},isShareBlockVisible(){return this.isShortLinkLoading||!!this.shortLinkUrl}},mounted(){this.$emit("modalContentLoaded"),this.generateShortLink()},methods:{async generateShortLink(){if(this.relativeUrl){this.isShortLinkLoading=!0;try{const e=new URL(this.relativeUrl,window.location.origin);e.searchParams.set(n.ReferralShare,"1");const t=`${e.pathname}${e.search}${e.hash}`,{shortLinkUrl:r}=await this.$service(i).shortLink({requestBody:{appDeepLink:this.relativeUrl,webRedirectLink:t}});this.shortLinkUrl=r??""}catch(e){this.$clientError(e)}finally{this.isShortLinkLoading=!1}}},async onShare(){var t;if(!this.shortLinkUrl)return;const e={url:this.shortLinkUrl,title:this.shareOgTitle,text:this.shareOgDescription};try{if(navigator.share&&((t=navigator.canShare)!=null&&t.call(navigator,e))){await navigator.share(e);return}await this.copyToClipboard()}catch(r){if((r==null?void 0:r.name)==="AbortError")return;this.$clientError(r)}},async onCopy(){if(this.shortLinkUrl)try{await this.copyToClipboard()}catch(e){this.$clientError(e)}},async copyToClipboard(){await navigator.clipboard.writeText(this.shortLinkUrl),this.$snackbar.open(this.$t("base:text.linkCopied"),h,c.info,{canClose:!0,icon:"check-light"})},onClose(){this.$modal.close()}}};var _=function(){var t=this,r=t._self._c;return r("div",{staticClass:"referral-modal",style:t.cssVars},[r("div",{staticClass:"referral-modal__header"},[r("h2",{staticClass:"referral-modal__title"},[t._v(t._s(t.modalTitle))]),t._v(" "),r("LeIcon",{staticClass:"referral-modal__close",attrs:{name:"close"},on:{click:t.onClose}})],1),t._v(" "),r("ul",{staticClass:"referral-modal__steps"},t._l(t.steps,function(a){return r("li",{key:a.id,staticClass:"referral-modal__step"},[r("div",{staticClass:"referral-modal__step-body"},[r("h3",{staticClass:"referral-modal__step-title"},[t._v(t._s(a.title))]),t._v(" "),r("p",{staticClass:"referral-modal__step-text"},[t._v(t._s(a.text))])]),t._v(" "),a.icon?r("div",{staticClass:"referral-modal__step-icon"},[r("LeIcon",{attrs:{name:a.icon}})],1):t._e()])}),0),t._v(" "),t.isShareBlockVisible?[r("h3",{staticClass:"referral-modal__link-title"},[t._v(t._s(t.imageBlockTitle))]),t._v(" "),r("div",{staticClass:"referral-modal__link-card"},[t.imageUrl?r("img",{staticClass:"referral-modal__link-image",attrs:{src:t.imageUrl,alt:""}}):t._e(),t._v(" "),r("div",{staticClass:"referral-modal__link-content"},[r("h4",{staticClass:"referral-modal__link-subtitle"},[t._v(`
2          `+t._s(t.captionTitle)+`
3        `)]),t._v(" "),r("p",{staticClass:"referral-modal__link-description"},[t._v(`
4          `+t._s(t.captionText)+`
5        `)]),t._v(" "),r("div",{staticClass:"referral-modal__link-actions"},[r("LeButton",{staticClass:"referral-modal__link-button",attrs:{prependIcon:"share",label:t.$t("base:button.share"),loading:t.isShortLinkLoading,disabled:!t.shortLinkUrl,theme:"primary",size:"sm",isRounded:""},on:{click:t.onShare}}),t._v(" "),r("LeButton",{staticClass:"referral-modal__link-button",attrs:{prependIcon:"link",label:t.$t("base:button.copy"),loading:t.isShortLinkLoading,disabled:!t.shortLinkUrl,theme:"white",size:"sm",isRounded:""},on:{click:t.onCopy}})],1)])])]:t._e()],2)},f=[],u=m(d,_,f,!1,null,null,null,null);const U=u.exports;export{U 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.