@coding-blocks/web-components
Advanced tools
Comparing version 1.8.4 to 1.10.0
@@ -1,1 +0,1 @@ | ||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(t=t||self).cbMobileVerification=o()}(this,(function(){"use strict";function t(){}function o(t){return t()}function n(){return Object.create(null)}function e(t){t.forEach(o)}function i(t){return"function"==typeof t}function c(t,o){return t!=t?o==o:t!==o||t&&"object"==typeof t||"function"==typeof t}function l(t,o){t.appendChild(o)}function r(t,o,n){t.insertBefore(o,n||null)}function s(t){t.parentNode.removeChild(t)}function a(t){return document.createElement(t)}function d(t){return document.createTextNode(t)}function u(){return d(" ")}function p(t,o,n,e){return t.addEventListener(o,n,e),()=>t.removeEventListener(o,n,e)}function f(t,o,n){null==n?t.removeAttribute(o):t.getAttribute(o)!==n&&t.setAttribute(o,n)}function h(t){return""===t?null:+t}function m(t,o){t.value=null==o?"":o}function b(t){const o={};for(const n of t)o[n.name]=n.value;return o}let g;function y(t){g=t}function w(t){(function(){if(!g)throw new Error("Function called outside component initialization");return g})().$$.on_mount.push(t)}const v=[],k=[],$=[],x=[],_=Promise.resolve();let T=!1;function j(t){$.push(t)}const E=new Set;let M=0;function O(){const t=g;do{for(;M<v.length;){const t=v[M];M++,y(t),C(t.$$)}for(y(null),v.length=0,M=0;k.length;)k.pop()();for(let t=0;t<$.length;t+=1){const o=$[t];E.has(o)||(E.add(o),o())}$.length=0}while(v.length);for(;x.length;)x.pop()();T=!1,E.clear(),y(t)}function C(t){if(null!==t.fragment){t.update(),e(t.before_update);const o=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,o),t.after_update.forEach(j)}}const L=new Set;const S="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function z(t,o){-1===t.$$.dirty[0]&&(v.push(t),T||(T=!0,_.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[o/31|0]|=1<<o%31}function A(c,l,r,a,d,u,p,f=[-1]){const h=g;y(c);const m=c.$$={fragment:null,ctx:null,props:u,update:t,not_equal:d,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l.context||(h?h.$$.context:[])),callbacks:n(),dirty:f,skip_bound:!1,root:l.target||h.$$.root};p&&p(m.root);let b=!1;if(m.ctx=r?r(c,l.props||{},(t,o,...n)=>{const e=n.length?n[0]:o;return m.ctx&&d(m.ctx[t],m.ctx[t]=e)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](e),b&&z(c,t)),o}):[],m.update(),b=!0,e(m.before_update),m.fragment=!!a&&a(m.ctx),l.target){if(l.hydrate){const t=function(t){return Array.from(t.childNodes)}(l.target);m.fragment&&m.fragment.l(t),t.forEach(s)}else m.fragment&&m.fragment.c();l.intro&&((w=c.$$.fragment)&&w.i&&(L.delete(w),w.i(v))),function(t,n,c,l){const{fragment:r,on_mount:s,on_destroy:a,after_update:d}=t.$$;r&&r.m(n,c),l||j(()=>{const n=s.map(o).filter(i);a?a.push(...n):e(n),t.$$.on_mount=[]}),d.forEach(j)}(c,l.target,l.anchor,l.customElement),O()}var w,v;y(h)}let N;"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,o,n){this[t]=n}disconnectedCallback(){e(this.$$.on_disconnect)}$destroy(){!function(t,o){const n=t.$$;null!==n.fragment&&(e(n.on_destroy),n.fragment&&n.fragment.d(o),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,o){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(o),()=>{const t=n.indexOf(o);-1!==t&&n.splice(t,1)}}$set(t){var o;this.$$set&&(o=t,0!==Object.keys(o).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const{document:B}=S;function D(t){let o,n;return{c(){o=a("div"),n=d(t[3]),f(o,"class","red")},m(t,e){r(t,o,e),l(o,n)},p(t,o){8&o&&function(t,o){o=""+o,t.wholeText!==o&&(t.data=o)}(n,t[3])},d(t){t&&s(o)}}}function H(t){let o,n,i,c,b,g,y;return{c(){o=a("input"),n=u(),i=a("button"),c=d("Send OTP"),f(o,"type","number"),f(o,"placeholder","Enter 10 digit Mobile Number"),f(o,"class","w-100 mb-4"),f(i,"class","btn btn-primary w-100"),i.disabled=b=!t[0]},m(e,s){r(e,o,s),m(o,t[0]),r(e,n,s),r(e,i,s),l(i,c),g||(y=[p(o,"input",t[10]),p(i,"click",t[7])],g=!0)},p(t,n){1&n&&h(o.value)!==t[0]&&m(o,t[0]),1&n&&b!==(b=!t[0])&&(i.disabled=b)},d(t){t&&s(o),t&&s(n),t&&s(i),g=!1,e(y)}}}function P(t){let o,n,i,c,b,g,y;return{c(){o=a("input"),n=u(),i=a("button"),c=d("Verify OTP"),f(o,"type","number"),f(o,"placeholder","Enter OTP"),f(o,"class","w-100 mb-4"),f(i,"class","btn btn-primary w-100"),i.disabled=b=!t[1]},m(e,s){r(e,o,s),m(o,t[1]),r(e,n,s),r(e,i,s),l(i,c),g||(y=[p(o,"input",t[9]),p(i,"click",t[8])],g=!0)},p(t,n){2&n&&h(o.value)!==t[1]&&m(o,t[1]),2&n&&b!==(b=!t[1])&&(i.disabled=b)},d(t){t&&s(o),t&&s(n),t&&s(i),g=!1,e(y)}}}function F(o){let n,e,i;return{c(){n=a("a"),e=a("button"),e.textContent="Logout",f(e,"class","btn btn-primary w-100 my-3"),f(n,"href",i=o[6].logout[o[5]])},m(t,o){r(t,n,o),l(n,e)},p:t,d(t){t&&s(n)}}}function J(o){let n,e,i,c,d,p,h,m,b,g,y,w,v,k,$,x,_,T=o[3]&&D(o);function j(t,o){return t[2]?P:H}let E=j(o),M=E(o),O=o[4]&&F(o);return{c(){n=a("link"),e=a("link"),i=a("link"),c=u(),d=a("div"),p=u(),h=a("div"),m=a("div"),m.innerHTML="<h2>Verify Your Mobile</h2>",b=u(),T&&T.c(),g=u(),M.c(),y=u(),O&&O.c(),w=u(),v=a("div"),v.innerHTML='<div class="header">Find your dream job</div> \n <div class="sub-header mb-4">Trusted by 100k+ students</div> \n <img src="https://minio.codingblocks.com/public/company-logo-group.png" alt=""/>',k=u(),$=a("div"),$.innerHTML='<a href="https://www.linkedin.com/school/codingblocksindia/" target="_blank"><img class="social-media-logo mr-2" src="https://minio.codingblocks.com/public/linkedin-logo.png" alt=""/></a> \n <a href="https://twitter.com/codingblocksIN" target="_blank"><img class="social-media-logo mr-2" src="https://minio.codingblocks.com/public/twitter-logo.png" alt=""/></a> \n <a href="https://github.com/coding-blocks" target="_blank"><img class="social-media-logo" src="https://minio.codingblocks.com/public/github-logo.png" alt=""/></a> \n <div><a href="https://codingblocks.com/tos.html" class="sub-header" target="_blank">Coding Blocks | Terms of service</a></div>',x=u(),_=a("link"),this.c=t,f(n,"rel","preconnect"),f(n,"href","https://fonts.googleapis.com"),f(e,"rel","preconnect"),f(e,"href","https://fonts.gstatic.com"),f(e,"crossorigin",""),f(i,"href","https://fonts.googleapis.com/css2?family=Mulish:wght@400;600&display=swap"),f(i,"rel","stylesheet"),f(d,"class","blurrer"),f(m,"class","d-flex justify-content-between align-items-center mb-5"),f(v,"class","mb-5 pt-5"),f($,"class","position-absolute"),f(h,"id","cb-mobile-verification"),f(h,"class","cb-mobile-verification-container"),f(_,"rel","stylesheet"),f(_,"href","https://unpkg.com/@coding-blocks/motley@2.8.6/dist/account/app.min.css")},m(t,o){l(B.head,n),l(B.head,e),l(B.head,i),r(t,c,o),r(t,d,o),r(t,p,o),r(t,h,o),l(h,m),l(h,b),T&&T.m(h,null),l(h,g),M.m(h,null),l(h,y),O&&O.m(h,null),l(h,w),l(h,v),l(h,k),l(h,$),r(t,x,o),r(t,_,o)},p(t,[o]){t[3]?T?T.p(t,o):(T=D(t),T.c(),T.m(h,g)):T&&(T.d(1),T=null),E===(E=j(t))&&M?M.p(t,o):(M.d(1),M=E(t),M&&(M.c(),M.m(h,y))),t[4]?O?O.p(t,o):(O=F(t),O.c(),O.m(h,w)):O&&(O.d(1),O=null)},i:t,o:t,d(t){s(n),s(e),s(i),t&&s(c),t&&s(d),t&&s(p),t&&s(h),T&&T.d(),M.d(),O&&O.d(),t&&s(x),t&&s(_)}}}function V(t,o,n){let e=null;const i=window.location.host.split(".")[0],c={sendOtpMobile:{hack:"https://hack-api.codingblocks.com/api/v2/jwt/otp",online:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile",hire:"https://hire-api.codingblocks.com/login/otp/mobile","code-gym":"https://code-gym-api.codingblocks.com/api/jwt/otp"},verifyOtpMobile:{hack:"https://hack-api.codingblocks.com/api/v2/jwt/otp/verify",online:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile/verify",hire:"https://hire-api.codingblocks.com/login/otp/mobile/verify","code-gym":"https://code-gym-api.codingblocks.com/api/jwt/otp/verify"},logout:{hack:"/app/logout",online:"/app/logout",hire:"/logout","code-gym":"/logout"}};let l=null,r=null,s=null,a=null,d=!1;return w(()=>{e=document.cookie.split("; ").filter(t=>"cb_auth"===t.split("=")[0])[0].split("=")[1]}),[l,r,s,a,d,i,c,async function(){const t=await fetch(c.sendOtpMobile[i]+"?flow=mobile-verification"||"http://localhost:3000/api/jwt/otp",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"JWT "+e},body:JSON.stringify({mobile:l})});if(t.ok){let{id:o,Details:e}=await t.json();n(2,s=o||e)}else{const{message:o,Details:e}=await t.json();(o||e)&&(n(3,a=o||e),o.includes("Try logging in with that account.")&&n(4,d=!0))}},async function(){n(3,a=null);const t=await fetch(c.verifyOtpMobile[i]+"?flow=mobile-verification"||"http://localhost:3000/api/jwt/otp/verify",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"JWT "+e},credentials:"include",body:JSON.stringify({mobile:l,otp_id:s,otp:r})});if(t.ok)window.location.reload();else{const{message:o,Details:e}=await t.json();(o||e)&&n(3,a=o||e)}},function(){r=h(this.value),n(1,r)},function(){l=h(this.value),n(0,l)}]}class R extends N{constructor(t){super(),this.shadowRoot.innerHTML="<style>input{border:none;border-bottom:solid 1px #E95547;background:#15171E;padding:10px 0px}.blurrer{position:fixed;z-index:1000;top:0;left:0;width:100vw;height:100vh;background-color:#939393;opacity:0.5}.cb-mobile-verification-container{background:#15171E;color:white;width:100vw;min-height:100vh;position:fixed;z-index:1001;top:0;right:0;padding:5rem 3rem 3rem 3rem;font-family:'Mulish';transition:0.5s}:host(.hide-cb-mobile-verification-prompt) .cb-mobile-verification-container{right:-100vw}:host(.hide-cb-mobile-verification-prompt) .blurrer{display:none}@media screen and (min-width: 768px){.cb-mobile-verification-container{width:35vw}:host(.hide-cb-mobile-verification-prompt) .cb-mobile-verification-container{right:-35vw}}.btn{padding:10px 10px;border-radius:3px}.btn.btn-primary{background:linear-gradient(90deg, #F26A3E 0%, #FB8133 100%)}.btn:disabled{background:#939393}.header{font-size:20px}.sub-header{font-size:12px;color:#BDBDBD}.social-media-logo{width:15px}</style>",A(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},V,J,c,{},null),t&&t.target&&r(t.target,this,t.anchor)}}return customElements.define("cb-mobile-verification",R),R})); | ||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(t=t||self).cbMobileVerification=o()}(this,(function(){"use strict";function t(){}function o(t){return t()}function n(){return Object.create(null)}function e(t){t.forEach(o)}function i(t){return"function"==typeof t}function c(t,o){return t!=t?o==o:t!==o||t&&"object"==typeof t||"function"==typeof t}function l(t,o){t.appendChild(o)}function s(t,o,n){t.insertBefore(o,n||null)}function r(t){t.parentNode.removeChild(t)}function a(t){return document.createElement(t)}function d(t){return document.createTextNode(t)}function u(){return d(" ")}function p(t,o,n,e){return t.addEventListener(o,n,e),()=>t.removeEventListener(o,n,e)}function h(t,o,n){null==n?t.removeAttribute(o):t.getAttribute(o)!==n&&t.setAttribute(o,n)}function f(t){return""===t?null:+t}function m(t,o){t.value=null==o?"":o}function b(t){const o={};for(const n of t)o[n.name]=n.value;return o}let g;function y(t){g=t}function v(t){(function(){if(!g)throw new Error("Function called outside component initialization");return g})().$$.on_mount.push(t)}const w=[],k=[],$=[],x=[],_=Promise.resolve();let T=!1;function j(t){$.push(t)}const E=new Set;let M=0;function O(){const t=g;do{for(;M<w.length;){const t=w[M];M++,y(t),C(t.$$)}for(y(null),w.length=0,M=0;k.length;)k.pop()();for(let t=0;t<$.length;t+=1){const o=$[t];E.has(o)||(E.add(o),o())}$.length=0}while(w.length);for(;x.length;)x.pop()();T=!1,E.clear(),y(t)}function C(t){if(null!==t.fragment){t.update(),e(t.before_update);const o=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,o),t.after_update.forEach(j)}}const L=new Set;const S="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function z(t,o){-1===t.$$.dirty[0]&&(w.push(t),T||(T=!0,_.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[o/31|0]|=1<<o%31}function A(c,l,s,a,d,u,p,h=[-1]){const f=g;y(c);const m=c.$$={fragment:null,ctx:null,props:u,update:t,not_equal:d,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l.context||(f?f.$$.context:[])),callbacks:n(),dirty:h,skip_bound:!1,root:l.target||f.$$.root};p&&p(m.root);let b=!1;if(m.ctx=s?s(c,l.props||{},(t,o,...n)=>{const e=n.length?n[0]:o;return m.ctx&&d(m.ctx[t],m.ctx[t]=e)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](e),b&&z(c,t)),o}):[],m.update(),b=!0,e(m.before_update),m.fragment=!!a&&a(m.ctx),l.target){if(l.hydrate){const t=function(t){return Array.from(t.childNodes)}(l.target);m.fragment&&m.fragment.l(t),t.forEach(r)}else m.fragment&&m.fragment.c();l.intro&&((v=c.$$.fragment)&&v.i&&(L.delete(v),v.i(w))),function(t,n,c,l){const{fragment:s,on_mount:r,on_destroy:a,after_update:d}=t.$$;s&&s.m(n,c),l||j(()=>{const n=r.map(o).filter(i);a?a.push(...n):e(n),t.$$.on_mount=[]}),d.forEach(j)}(c,l.target,l.anchor,l.customElement),O()}var v,w;y(f)}let N;"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,o,n){this[t]=n}disconnectedCallback(){e(this.$$.on_disconnect)}$destroy(){!function(t,o){const n=t.$$;null!==n.fragment&&(e(n.on_destroy),n.fragment&&n.fragment.d(o),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,o){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(o),()=>{const t=n.indexOf(o);-1!==t&&n.splice(t,1)}}$set(t){var o;this.$$set&&(o=t,0!==Object.keys(o).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const{document:B}=S;function D(t){let o,n;return{c(){o=a("div"),n=d(t[3]),h(o,"class","red")},m(t,e){s(t,o,e),l(o,n)},p(t,o){8&o&&function(t,o){o=""+o,t.wholeText!==o&&(t.data=o)}(n,t[3])},d(t){t&&r(o)}}}function H(t){let o,n,i,c,b,g,y;return{c(){o=a("input"),n=u(),i=a("button"),c=d("Send OTP"),h(o,"type","number"),h(o,"placeholder","Enter 10 digit Mobile Number"),h(o,"class","w-100 mb-4"),h(i,"class","btn btn-primary w-100"),i.disabled=b=!t[0]},m(e,r){s(e,o,r),m(o,t[0]),s(e,n,r),s(e,i,r),l(i,c),g||(y=[p(o,"input",t[10]),p(i,"click",t[7])],g=!0)},p(t,n){1&n&&f(o.value)!==t[0]&&m(o,t[0]),1&n&&b!==(b=!t[0])&&(i.disabled=b)},d(t){t&&r(o),t&&r(n),t&&r(i),g=!1,e(y)}}}function P(t){let o,n,i,c,b,g,y;return{c(){o=a("input"),n=u(),i=a("button"),c=d("Verify OTP"),h(o,"type","number"),h(o,"placeholder","Enter OTP"),h(o,"class","w-100 mb-4"),h(i,"class","btn btn-primary w-100"),i.disabled=b=!t[1]},m(e,r){s(e,o,r),m(o,t[1]),s(e,n,r),s(e,i,r),l(i,c),g||(y=[p(o,"input",t[9]),p(i,"click",t[8])],g=!0)},p(t,n){2&n&&f(o.value)!==t[1]&&m(o,t[1]),2&n&&b!==(b=!t[1])&&(i.disabled=b)},d(t){t&&r(o),t&&r(n),t&&r(i),g=!1,e(y)}}}function F(o){let n,e,i;return{c(){n=a("a"),e=a("button"),e.textContent="Logout",h(e,"class","btn btn-primary w-100 my-3"),h(n,"href",i=o[6].logout[o[5]])},m(t,o){s(t,n,o),l(n,e)},p:t,d(t){t&&r(n)}}}function J(o){let n,e,i,c,d,p,f,m,b,g,y,v,w,k,$,x,_,T=o[3]&&D(o);function j(t,o){return t[2]?P:H}let E=j(o),M=E(o),O=o[4]&&F(o);return{c(){n=a("link"),e=a("link"),i=a("link"),c=u(),d=a("div"),p=u(),f=a("div"),m=a("div"),m.innerHTML="<h2>Verify Your Mobile</h2>",b=u(),T&&T.c(),g=u(),M.c(),y=u(),O&&O.c(),v=u(),w=a("div"),w.innerHTML='<div class="header">Find your dream job</div> \n <div class="sub-header mb-4">Trusted by 100k+ students</div> \n <img src="https://minio.codingblocks.com/public/company-logo-group.png" alt=""/>',k=u(),$=a("div"),$.innerHTML='<a href="https://www.linkedin.com/school/codingblocksindia/" target="_blank"><img class="social-media-logo mr-2" src="https://minio.codingblocks.com/public/linkedin-logo.png" alt=""/></a> \n <a href="https://twitter.com/codingblocksIN" target="_blank"><img class="social-media-logo mr-2" src="https://minio.codingblocks.com/public/twitter-logo.png" alt=""/></a> \n <a href="https://github.com/coding-blocks" target="_blank"><img class="social-media-logo" src="https://minio.codingblocks.com/public/github-logo.png" alt=""/></a> \n <div><a href="https://codingblocks.com/tos.html" class="sub-header" target="_blank">Coding Blocks | Terms of service</a></div>',x=u(),_=a("link"),this.c=t,h(n,"rel","preconnect"),h(n,"href","https://fonts.googleapis.com"),h(e,"rel","preconnect"),h(e,"href","https://fonts.gstatic.com"),h(e,"crossorigin",""),h(i,"href","https://fonts.googleapis.com/css2?family=Mulish:wght@400;600&display=swap"),h(i,"rel","stylesheet"),h(d,"class","blurrer"),h(m,"class","d-flex justify-content-between align-items-center mb-5"),h(w,"class","mb-5 pt-5"),h($,"class","position-absolute"),h(f,"id","cb-mobile-verification"),h(f,"class","cb-mobile-verification-container"),h(_,"rel","stylesheet"),h(_,"href","https://unpkg.com/@coding-blocks/motley@2.8.6/dist/account/app.min.css")},m(t,o){l(B.head,n),l(B.head,e),l(B.head,i),s(t,c,o),s(t,d,o),s(t,p,o),s(t,f,o),l(f,m),l(f,b),T&&T.m(f,null),l(f,g),M.m(f,null),l(f,y),O&&O.m(f,null),l(f,v),l(f,w),l(f,k),l(f,$),s(t,x,o),s(t,_,o)},p(t,[o]){t[3]?T?T.p(t,o):(T=D(t),T.c(),T.m(f,g)):T&&(T.d(1),T=null),E===(E=j(t))&&M?M.p(t,o):(M.d(1),M=E(t),M&&(M.c(),M.m(f,y))),t[4]?O?O.p(t,o):(O=F(t),O.c(),O.m(f,v)):O&&(O.d(1),O=null)},i:t,o:t,d(t){r(n),r(e),r(i),t&&r(c),t&&r(d),t&&r(p),t&&r(f),T&&T.d(),M.d(),O&&O.d(),t&&r(x),t&&r(_)}}}function V(t,o,n){let e=null;const i=window.location.host.split(".")[0],c={sendOtpMobile:{hack:"https://hack-api.codingblocks.com/api/v2/jwt/otp",online:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile",subscribe:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile",hire:"https://hire-api.codingblocks.com/login/otp/mobile","code-gym":"https://code-gym-api.codingblocks.com/api/jwt/otp"},verifyOtpMobile:{hack:"https://hack-api.codingblocks.com/api/v2/jwt/otp/verify",online:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile/verify",subscribe:"https://online-api.codingblocks.com/api/v2/jwt/otp/mobile/verify",hire:"https://hire-api.codingblocks.com/login/otp/mobile/verify","code-gym":"https://code-gym-api.codingblocks.com/api/jwt/otp/verify"},logout:{hack:"/app/logout",online:"/app/logout",subscribe:"/app/logout",hire:"/logout","code-gym":"/logout"}};let l=null,s=null,r=null,a=null,d=!1;return v(()=>{e=document.cookie.split("; ").filter(t=>"cb_auth"===t.split("=")[0])[0].split("=")[1]}),[l,s,r,a,d,i,c,async function(){const t=await fetch(c.sendOtpMobile[i]+"?flow=mobile-verification"||"http://localhost:3000/api/jwt/otp",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"JWT "+e},body:JSON.stringify({mobile:l})});if(t.ok){let{id:o,Details:e}=await t.json();n(2,r=o||e)}else{const{message:o,Details:e}=await t.json();(o||e)&&(n(3,a=o||e),o.includes("Try logging in with that account.")&&n(4,d=!0))}},async function(){n(3,a=null);const t=await fetch(c.verifyOtpMobile[i]+"?flow=mobile-verification"||"http://localhost:3000/api/jwt/otp/verify",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"JWT "+e},credentials:"include",body:JSON.stringify({mobile:l,otp_id:r,otp:s})});if(t.ok)window.location.reload();else{const{message:o,Details:e}=await t.json();(o||e)&&n(3,a=o||e)}},function(){s=f(this.value),n(1,s)},function(){l=f(this.value),n(0,l)}]}class R extends N{constructor(t){super(),this.shadowRoot.innerHTML="<style>input{border:none;border-bottom:solid 1px #E95547;background:#15171E;padding:10px 0px}.blurrer{position:fixed;z-index:1000;top:0;left:0;width:100vw;height:100vh;background-color:#939393;opacity:0.5}.cb-mobile-verification-container{background:#15171E;color:white;width:100vw;min-height:100vh;position:fixed;z-index:1001;top:0;right:0;padding:5rem 3rem 3rem 3rem;font-family:'Mulish';transition:0.5s}:host(.hide-cb-mobile-verification-prompt) .cb-mobile-verification-container{right:-100vw}:host(.hide-cb-mobile-verification-prompt) .blurrer{display:none}@media screen and (min-width: 768px){.cb-mobile-verification-container{width:35vw}:host(.hide-cb-mobile-verification-prompt) .cb-mobile-verification-container{right:-35vw}}.btn{padding:10px 10px;border-radius:3px}.btn.btn-primary{background:linear-gradient(90deg, #F26A3E 0%, #FB8133 100%)}.btn:disabled{background:#939393}.header{font-size:20px}.sub-header{font-size:12px;color:#BDBDBD}.social-media-logo{width:15px}</style>",A(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},V,J,c,{},null),t&&t.target&&s(t.target,this,t.anchor)}}return customElements.define("cb-mobile-verification",R),R})); |
@@ -5,3 +5,3 @@ { | ||
"outDir": "dist/", | ||
"version": "1.8.4", | ||
"version": "1.10.0", | ||
"main": "dist/index.js", | ||
@@ -8,0 +8,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
178096
546