Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bhikandeshmukh
GitHub Repository: bhikandeshmukh/shark
Path: blob/master/phs/ola-otpbypass/otp_files/sso-login.1fb3f09b.js.download
1461 views
"use strict";Vue.component("sso-login",{_scopeId:"data-v-6f7caecb",owCSS:'.sso[data-v-6f7caecb]{position:relative;padding:25px;text-align:center;margin:8% auto 16px;width:372px;border-radius:4px;background-color:#fff;box-shadow:0 2px 4px 0 rgba(0,0,0,.1)}.sso__title[data-v-6f7caecb]{font-size:18px;font-weight:500;padding-bottom:8px;letter-spacing:-.4px}.sso__sub-title[data-v-6f7caecb]{opacity:.5;font-size:14px;line-height:1.21;letter-spacing:-.2px}.sso__phone__wrapper[data-v-6f7caecb]{position:relative;margin-top:16px;height:48px;border-radius:4px;background-color:#fff;border:1px solid #e5e5e5;display:table;width:100%}.sso__phone__code[data-v-6f7caecb]{border-right:1px solid #ebebeb;padding:0 14px 0 4px;border:none;padding:0 4px}.sso__phone[data-v-6f7caecb],.sso__phone__code[data-v-6f7caecb]{display:inline-block;vertical-align:middle;opacity:.5;font-size:16px;letter-spacing:-.3px}.sso__phone[data-v-6f7caecb]{height:44px;border-radius:4px;background-color:#fff;border:none;width:55%;padding:1px;outline:none}.sso__loader[data-v-6f7caecb]{font-size:10px;margin:30px auto;text-indent:-9999em;width:40px;height:40px;border-radius:50%;background:#e5e985;background:linear-gradient(90deg,#e5e985 10%,hsla(0,0%,100%,0) 42%);position:relative;animation:load3 1.4s infinite linear;transform:translateZ(0)}.sso__loader[data-v-6f7caecb]:before{width:50%;height:50%;background:#fff;border-radius:100% 0 0 0;position:absolute;top:0;left:0;content:""}.sso__loader[data-v-6f7caecb]:after{background:#fff;width:75%;height:75%;border-radius:50%;content:"";margin:auto;position:absolute;top:0;left:0;bottom:0;right:0}.sso__clear-icon[data-v-6f7caecb]{padding:0;border:0;width:24px;height:24px;opacity:1}.sso__cta[data-v-6f7caecb]{margin-top:15px;border-radius:4px;background-color:#e6e6e6;padding:12px;cursor:pointer;color:rgba(0,0,0,.4)}.sso__cta.enabled[data-v-6f7caecb]{background-color:#000;color:#cddc39}.sso__notice a[data-v-6f7caecb]{color:#000}.sso__back[data-v-6f7caecb]{position:absolute;left:20px;top:18px}.sso__back-btn[data-v-6f7caecb]{width:24px;height:24px;opacity:1;cursor:pointer}.sso__clear[data-v-6f7caecb]{position:absolute;width:32px;right:0;top:12px}.sso__new-user__otp-wrapper input[type=number][data-v-6f7caecb]{-webkit-text-security:disc}svg[data-v-6f7caecb]{display:inline-block;vertical-align:middle;opacity:.5}@keyframes load3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.country-code__wrapper[data-v-6f7caecb]{display:inline-block;vertical-align:middle;position:relative;right:5px;width:60px;border-right:1px solid #ebebeb;cursor:pointer}.country-code__wrapper.single[data-v-6f7caecb]{width:42px!important}.country-code[data-v-6f7caecb]{float:left}.country-code img[data-v-6f7caecb]{display:inline-block;height:100%;vertical-align:middle}.country-list__wrapper[data-v-6f7caecb]{background:#fff;border-radius:6px;padding-bottom:10px}.country-list[data-v-6f7caecb]{margin:0;padding:0}.country-list__header[data-v-6f7caecb]{text-align:center;font-size:18px;font-weight:500;letter-spacing:-.4px;padding:15px}.country-list__item[data-v-6f7caecb]{display:table;width:100%;padding:10px 0}.country-list__item .flag[data-v-6f7caecb]{display:table-cell;vertical-align:middle;width:54px;text-align:center}.country-list__item .name[data-v-6f7caecb]{display:table-cell;vertical-align:middle;text-align:left;font-size:16px;line-height:1.12;color:rgba(0,0,0,.87)}.country-list__item .code[data-v-6f7caecb]{display:table-cell;vertical-align:middle;font-size:16px;text-align:right;color:rgba(0,0,0,.56);padding-right:16px}.line[data-v-6f7caecb]{width:95%;border-bottom:.5px solid rgba(0,0,0,.26);margin:0 auto}.ow-modal-container[data-v-6f7caecb]{margin-top:10%;border-radius:6px}.down-arrow[data-v-6f7caecb]{width:14px;height:9px;margin:1px 0 0 6px;position:relative;top:1px;opacity:.3}.country-code img[data-v-6f7caecb]{width:24px;height:24px}@media screen and (max-width:500px){.sso[data-v-6f7caecb]{margin:0;background:none;box-shadow:none;width:100%;padding:12px 0 0}.sso__phone__wrapper[data-v-6f7caecb]{width:94%;margin:25px auto 0;height:46px}.sso__cta[data-v-6f7caecb]{border-radius:4px;z-index:10;margin:20px 8px 8px}}',render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sso__wrapper"},[a("div",{staticClass:"sso"},[e.owRegistry["sso-header"]?a("sso-header",{attrs:{hideback:e.partner},on:{back:e.goback}}):e._e(),e._v(" "),a("div",{staticClass:"sso__content"},[a("div",{staticClass:"sso__title"},[e._v("Enter your mobile number")]),e._v(" "),a("div",{staticClass:"sso__sub-title",on:{click:e.click}},[e._v("A 4-digit OTP will be sent on SMS")]),e._v(" "),a("div",{staticClass:"sso__phone__wrapper"},[a("div",{staticClass:"country-code__wrapper",class:[{single:1===e.countries.length}]},[a("div",{staticClass:"country-code",on:{click:function(){1<e.countries.length&&(e.showCountryListModal=!0)}}},[a("img",{attrs:{src:e.selectedCountry.countryFlag,alt:"Country"}}),e._v(" "),e.owRegistry["ow-icon"]&&1<e.countries.length?a("ow-icon",{staticClass:"down-arrow",attrs:{name:"ANGLE_DOWN",width:"14",height:"9",viewbox:"0 0 14 9"}}):e._e()],1)]),e._v(" "),a("div",{staticClass:"sso__phone__code"},[e._v(e._s(e.selectedCountry.dialingCode))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.phone_number,expression:"phone_number"}],staticClass:"sso__phone",attrs:{type:"tel",autofocus:"",id:"phone-number",autocomplete:"off",disabled:e.disableInput},domProps:{value:e.phone_number},on:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13))return null;e.click(t)},input:function(t){t.target.composing||(e.phone_number=t.target.value)}}}),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:e.phone_number,expression:"phone_number"}],staticClass:"sso__clear",on:{click:function(){e.disableInput||(e.phone_number="")}}},[a("div",{staticClass:"sso__clear-icon"},[e.owRegistry["ow-icon"]?a("ow-icon",{attrs:{name:"CLEAR",width:"24",height:"24",viewbox:"0 0 24 24",opacity:"1"}}):e._e()],1)])]),e._v(" "),e.owRegistry["ow-ajax"]?a("ow-ajax",{attrs:{trigger:e.captcha.fetchStatus,url:"/api/captcha/need",method:"post",body:e.captcha.payload},on:{success:e.getCaptchaStatus}}):e._e(),e._v(" "),e.captcha.triggerLoad?a("ow-recaptcha",{directives:[{name:"show",rawName:"v-show",value:e.captcha.triggerLoad&&e.captcha.loaded&&e.captcha.showCaptcha,expression:"captcha.triggerLoad && captcha.loaded && captcha.showCaptcha"}],attrs:{showCaptcha:e.captcha.showCaptcha,resetCaptcha:e.captcha.reset},on:{render:e.renderCaptcha,verify:e.verifyCaptcha}}):e._e(),e._v(" "),e.captcha.showCaptcha&&!e.captcha.loaded?a("div",{staticClass:"sso__loader"}):e._e()],1),e._v(" "),e.owRegistry["ow-ajax"]&&e.enableCTA?a("ow-ajax",{attrs:{trigger:e.fetch_data,url:e.info.url,method:"post",headers:e.info.data.headers,body:e.info.data},on:{success:e.populateAjaxResponse}}):e._e(),e._v(" "),a("div",{staticClass:"sso__cta",class:{enabled:e.enableCTA},on:{click:e.click}},[e._v("Next")])],1),e._v(" "),e.owRegistry["ow-ajax"]?a("ow-ajax",{attrs:{trigger:e.getCountries,url:e.countryInfoUrl,method:"get"},on:{success:e.getCountryList}}):e._e(),e._v(" "),e.showCountryListModal?a("ow-modal",{attrs:{position:"top","bg-click-close":!0,"trans-bg":!1,width:"288px"},on:{close:function(){e.showCountryListModal=!1}}},[a("div",{staticClass:"country-list__header",slot:"header"},[e._v("\n            Select Country\n        ")]),e._v(" "),a("div",{staticClass:"country-list__wrapper",slot:"body"},[a("div",{staticClass:"country-list__item selected"},[a("div",{staticClass:"flag"},[a("img",{attrs:{src:e.selectedCountry.countryFlag,width:"24",height:"24",alt:"Country"}})]),e._v(" "),a("div",{staticClass:"name"},[e._v(e._s(e.selectedCountry.countryName))]),e._v(" "),a("div",{staticClass:"code"},[e._v(e._s(e.selectedCountry.dialingCode))])]),e._v(" "),a("div",{staticClass:"line"}),e._v(" "),a("ul",{staticClass:"country-list"},e._l(e.countries,function(t){return a("li",{directives:[{name:"show",rawName:"v-show",value:e.selectedCountry.dialingCode!==t.dialingCode,expression:"selectedCountry.dialingCode !== country.dialingCode"}],staticClass:"country-list__item",on:{click:function(){e.selectCountry(t)}}},[a("div",{staticClass:"flag"},[a("img",{attrs:{src:t.countryFlag,width:"24",height:"24",alt:"Country"}})]),e._v(" "),a("div",{staticClass:"name"},[e._v(e._s(t.countryName))]),e._v(" "),a("div",{staticClass:"code"},[e._v(e._s(t.dialingCode))])])}))])]):e._e(),e._v(" "),e.owRegistry["sso-bridge"]?a("sso-bridge",{on:{interaction:e.populateMbl}}):e._e(),e._v(" "),e.owRegistry["ow-top-loader"]?a("ow-top-loader",{attrs:{overlay:!0,show:e.ajaxInProgress}}):e._e()],1)},staticRenderFns:[],name:"ssoLogin",data:function(){return{toast:{show:!1,type:"",content:""},selectedCountry:{countryName:"India",dialingCode:"+91",countryFlag:"https://olawebcdn.com/sso_images/v1/in.svg",countryCode:"IN",maxNumberLength:10,minNumberLength:10,startingDigits:[6,7,8,9]},showCountryListModal:!1,fetch_data:"dormant",getCountries:"dormant",countries:[],phone_number:"",prev_mobile_number:"",ajaxInProgress:!1}},props:{returnurl:String,mbl_number:[String,Number],verificationId:[String,Number],captcha:Object,partner:Boolean,trackingParams:Object,partnerUserActions:Object,platform:String,app_version:String,disableInput:Boolean},watch:{phone_number:function(t){(t=t.replace(/[^\d]/g,"")).length>this.selectedCountry.maxNumberLength&&(t=t.slice(0,this.selectedCountry.maxNumberLength)),this.phone_number=t}},mounted:function(){Vue.nextTick(function(){this.phone_number=this.mbl_number,this.prev_mobile_number=this.mbl_number,this.fetchFingerprint(),this.$el.querySelector(".sso__phone").focus()}.bind(this)),this.trackEvent&&this.trackEvent({eventName:"login_page_load",eventValue:this.trackingParams})},methods:{getCaptchaStatus:function(t){var e=this;this.captcha.fetchStatus="dormant",this.captcha.showCaptcha=t.response&&t.response.success,this.captcha.triggerLoad=!0,this.getCountries="fire",setTimeout(function(){e.loadOWComponent("ow-recaptcha","ow-components/ow-recaptcha.80994be8.js")},2e3)},populateMbl:function(e){var a=this;e["autoread-userinfo"]&&(e["autoread-userinfo"].phone_number&&(a.phone_number=e["autoread-userinfo"].phone_number),e["autoread-userinfo"].phone_number=void 0,a.countries.forEach(function(t){t.dialingCode==e["autoread-userinfo"].dialing_code&&(a.selectedCountry=t)}),e["autoread-userinfo"].app_metadata&&(a.trackingParams.app_metadata=e["autoread-userinfo"].app_metadata),a.phone_number&&!a.captcha.showCaptcha&&a.click())},click:function(){var t=void 0;this.phone_number&&(t=Number(String(this.phone_number).charAt(0))),this.phone_number&&-1<this.selectedCountry.startingDigits.indexOf(t)&&this.phone_number.length>=this.selectedCountry.minNumberLength&&this.phone_number.length<=this.selectedCountry.maxNumberLength?(this.captcha.showCaptcha?this.captcha.gcaptcha?(this.ajaxInProgress=!0,this.fetch_data="fire"):(this.toast={show:!0,type:"warning",content:"Please check - I'm not a robot"},this.$emit("showtoast",this.toast),this.fetch_data="dormant"):(this.ajaxInProgress=!0,this.fetch_data="fire"),this.$emit("setstate",{phone_number:this.phone_number,captcha:this.captcha,selectedCountry:this.selectedCountry})):(this.toast={show:!0,type:"warning",content:"Please enter a valid mobile number"},this.$emit("showtoast",this.toast),this.fetch_data="dormant",this.$emit("setstate",{phone_number:this.phone_number,selectedCountry:this.selectedCountry})),this.trackingParams.phone_number=this.phone_number,this.sendGAEvent&&this.sendGAEvent("SSO","send_otp_clicked"),this.trackEvent&&this.trackEvent({eventName:"send_otp_clicked",eventValue:this.trackingParams})},renderCaptcha:function(){this.captcha.loaded=!0,this.$emit("setstate",{captcha:this.captcha}),this.trackEvent&&this.captcha.showCaptcha&&this.trackEvent({eventName:"recaptcha_challenge_shown",eventValue:this.trackingParams})},verifyCaptcha:function(t){this.captcha.gcaptcha=t,this.trackingParams.phone_number=this.phone_number,this.sendGAEvent&&this.sendGAEvent("SSO","recaptcha_completed_login"),this.trackEvent&&this.trackEvent({eventName:"recaptcha_completed_login",eventValue:this.trackingParams})},setStorageId:function(){var t=(new Date).getTime().toString(),e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=40-t.length,s=void 0;for(s=0;s<a;s++)t+=e.charAt(Math.floor(Math.random()*e.length));this.captcha.storageId=t,localStorage&&t&&localStorage.setItem("storageId",t)},fetchFingerprint:function(){this.captcha.fingerPrint=new Fingerprint({canvas:!0}).get(),this.captcha.storageId=localStorage?localStorage.getItem("storageId"):null,this.captcha.storageId||this.setStorageId(),this.captcha.payload={fingerPrint:this.captcha.fingerPrint,storageId:this.captcha.storageId},this.captcha.fetchStatus="fire"},getCountryList:function(t){t.response&&"SUCCESS"===t.response.status&&(this.countries=t.response.countries),this.getCountries="dormant"},populateAjaxResponse:function(t){this.captcha.showCaptcha=t.response&&t.response.needCaptcha,t.response&&("SUCCESS"===t.response.status?(this.newUser=t.response.newUser,t.response.needCaptcha&&(this.captcha.triggerLoad=!0),this.newUser?this.$emit("screen","signup"):this.$emit("screen","verifyotp"),this.captcha.reset=!1,this.$emit("setstate",{verificationId:t.response.verificationId,newUser:this.newUser,captcha:this.captcha})):"FAILURE"===t.response.status&&(this.toast={show:!0,type:"warning",content:t.response&&t.response.message},this.$emit("showtoast",this.toast),this.captcha.gcaptcha="",this.captcha.reset=!0,this.$emit("setstate",{captcha:this.captcha})),this.$set(this,"fetch_data","dormant")),this.ajaxInProgress=!1},goback:function(){this.returnurl?window.location.href=history.back()||document.referrer:parent.postMessage({status:"CLOSE"},"*"),this.trackingParams.phone_number=this.phone_number,this.sendGAEvent&&this.sendGAEvent("SSO","back_button_mobile_entry_page"),this.trackEvent&&this.trackEvent({eventName:"back_button_mobile_entry_page",eventValue:this.trackingParams})},selectCountry:function(t){this.selectedCountry=t,this.showCountryListModal=!1}},computed:{info:function(){var t={mobileNumber:this.phone_number,dialingCode:this.selectedCountry.dialingCode,platform:this.platform,app_version:this.app_version,countryCode:this.selectedCountry.countryCode,headers:this.partner||this.trackingParams.utm_source!=window.owConfig.FKUtmSource?{}:{utm_source:this.trackingParams.utm_source},verificationId:this.prev_mobile_number===this.phone_number&&this.verificationId||null,captchaInfo:this.captcha.showCaptcha?{gcaptcha:this.captcha.gcaptcha,fingerPrint:this.captcha.fingerPrint,storageId:this.captcha.storageId}:{fingerPrint:this.captcha.fingerPrint,storageId:this.captcha.storageId},liteParams:window.params};return this.partner&&(t.partnerUserActions=this.partnerUserActions),{url:this.partner?"/api/partner/login":"/api/login",data:t}},enableCTA:function(){var t=void 0;return this.phone_number&&(t=Number(String(this.phone_number).charAt(0))),!!(this.phone_number&&-1<this.selectedCountry.startingDigits.indexOf(t)&&this.phone_number.length>=this.selectedCountry.minNumberLength&&this.phone_number.length<=this.selectedCountry.maxNumberLength)&&(!this.captcha.showCaptcha||!!this.captcha.gcaptcha)},countryInfoUrl:function(){return this.partner?"/api/country/info?a="+this.partner:"/api/country/info"}}});
//# sourceMappingURL=../sourcemap/components/sso-login.1fb3f09b.js.map