PageSourceSearch

https://xn--i1aebefbrdj8j.xn--p1ai/static/resources/SabyGetReferra…?x_module=20719bdf55abba047039773b66300980

js xn--i1aebefbrdj8j.xn--p1ai collected 2026-10-02 02:15:29 UTC 5,322 bytes, 1 lines download raw bytes

1define("SabyGetReferral/buttons/BonusButton",["require","exports","SabyGetReferral/button","SabyGetCore/constants","i18n!SabyGetReferral","Types/function","Types/entity","SabyGetCore/Helpers/BaseHelpers","WasabyLoader/ModulesLoader"],(function(e,o,t,i,s,n,r,a,l){"use strict";async function u(){return await(0,l.loadAsync)("SabyGetCore/Helpers/AuthHelpers")}Object.defineProperty(o,"__esModule",{value:!0});class h extends t.Button{constructor(){super(...arguments),this._clickToBonusProgram=(0,n.throttle)((async()=>{var o,t;if(!this._options.readOnlyButton)if(this._options.hasDiscountCard||this._options.bonusExists===i.BONUS_PROGRAM_STATUS.PARTICIPANT)if(this._options.referralProgramEnabled)new Promise(((o,t)=>{e(["SabyGetReferral/widgets"],o,t)})).then((({openShareLink:e})=>{e(this._options.shopGuid,{siteType:this._options.siteType,product:this._options.product},this)})).catch((function(e){requirejs.onError(e)}));else{new(await new Promise(((o,t)=>{e(["Clipboard/Clipboard"],o,t)})))({successCopyTitle:s("Вы скопировали ссылку на заведение")}).setText(this._options.establishmentLink)}else{if(!this._options.isAuthorized)null===(t=null===(o=window.cnsmrSbis)||void 0===o?void 0:o.setPerson)||void 0===t||t.call(o);await this._openBonusProgram(i.REFERRAL_DETAILS_MODE.preview)}}),1e3)}_beforeMount(){this._checkBonusExistsAfterAuth=this._checkBonusExistsAfterAuth.bind(this)}_afterMount(){if(this._options.referee&&!this._options.hasDiscountCard&&this._options.bonusExists!==i.BONUS_PROGRAM_STATUS.PARTICIPANT)this._clickToBonusProgram()}_beforeUnmount(){this._authOpener=null,this._bonusOpener=null}async _joinToBonusProgram(e){var o,n,l,h,p,d;const _=this._options.shopGuid,c=this._options.hideUserAgreement,f=e?r.Model.fromObject({CustomerId:e},"adapter.sbis"):null,[A,m]=await Promise.all([await(0,t.joinToBonusProgram)({shopGuid:_,refereeGuid:this._options.referee,saleId:this._options.saleId,privateFace:f?void 0:this._options.privateFace,isReferralProgram:this._options.referralProgramEnabled,personInfo:f||this._options.personInfo,customerId:f?void 0:this._options.customerId}),u()]);if(null===(n=null===(o=this._authOpener)||void 0===o?void 0:o.close)||void 0===n||n.call(o),null===(h=null===(l=this._bonusOpener)||void 0===l?void 0:l.close)||void 0===h||h.call(l),!1===(null===(p=A.get)||void 0===p?void 0:p.call(A,"Success")))return void await(0,a.showError)({message:s("Не удалось присоединиться к бонусной программе")});const E=null===(d=A.get)||void 0===d?void 0:d.call(A,"PromoCodeData");if(!c){const{acceptAgreementByCurrentUser:e,PERS_DATA_PROCESSING:o,AGREEMENT_PUBLIC_OFFER:t}=m;Promise.all([e(_,o),e(_,t),e(_,null)])}setTimeout((async()=>{if(!this._unmounted)await this._openBonusProgram(i.REFERRAL_DETAILS_MODE.invite,E).catch((e=>(0,a.showError)(e))),this._notify("updateBonusProgramInfo",[],{bubbling:!0})}),1e3)}async _checkBonusExistsAfterAuth(o,t,s){const{getBonusRecord:n}=await new Promise(((o,t)=>{e(["SabyGetReferral/helpers"],o,t)})),r=await n({filter:{EstUUID:o,ByReferee:!!t}});if(r.get("CombinedID")||r.get("BonusExists")===i.BONUS_PROGRAM_STATUS.PARTICIPANT)null===localStorage||void 0===localStorage||localStorage.setItem(i.LOCAL_STORAGE_BONUS_PROGRAM,o),window.location.reload();else await this._joinToBonusProgram(s)}async _openBonusProgram(o,t){const{shopGuid:s,reloadAfterJoin:n,referee:r}=this._options,{getUserAgreementLink:a,AGREEMENT_PUBLIC_OFFER:l,PERS_DATA_PROCESSING:h}=await u(),[{openBonusDetails:p},d,_]=await Promise.all([new Promise(((o,t)=>{e(["SabyGetReferral/widgets"],o,t)})),i.REFERRAL_DETAILS_MODE.preview?this._options.persDataPolicyLink||a(s,h):null,a(s,l)]);return new Promise((async e=>{this._bonusOpener=await p(s,{templateOptions:{viewMode:o,promocodeData:t,persDataPol
1icyLink:d,publicOfferLink:_,hideUserAgreement:this._options.hideUserAgreement,hideInviteAddInfo:this._options.hideInviteAddInfo,colorScheme:this._options.colorScheme,backgroundStyle:this._options.backgroundStyle,width:this._options.width,personUUID:this._options.customerUUID,isAuth:this._options.isAuthorized,hasSession:this._options.hasSession},eventHandlers:{...o===i.REFERRAL_DETAILS_MODE.preview&&{onResult:async(o,t)=>{var i;if(this._options.externalButtonHandler)await this._options.externalButtonHandler(this._bonusOpener),null===(i=this._bonusOpener)||void 0===i||i.close();else if(this._options.isAuthorized){if(this._options.verifyCustomer&&!await this._options.verifyCustomer(!0))return;await this._joinToBonusProgram()}else{const{showAuthDialog:e}=await u();this._authOpener=await e({opener:t,onSuccess:async e=>{var o;const t=null===(o=null==e?void 0:e.getRecordById("ИдПерсоны"))||void 0===o?void 0:o.get("Значение");await this._checkBonusExistsAfterAuth(s,r,t)},reloadAfterAuth:!1,limitedModeWithUnsupportedCookies:!0,estUUID:s,skipButtonForPhoneConfirmation:!1,dialogWidth:"min(450px, calc(100vw - var(--inline_height_l)))"})}e()}},...o===i.REFERRAL_DETAILS_MODE.invite&&{onClose:()=>{if(n)window.location.reload();else e()}}},siteType:this._options.siteType,popupOptions:this._options.popupOptions},this,this._options.referee)}))}}h.defaultProps={hasDiscountCard:!1,isAuthorized:!1,referralProgramEnabled:!1,reloadAfterJoin:!0,mode:t.BONUS_BUTTON_MODE.full},o.default=h}));

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.