@descope/user-profile-widget 0.0.35 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * @descope/user-profile-widget v0.0.35
3
+ * @descope/user-profile-widget v0.0.37
4
4
  */
5
- import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createSingletonMixin as s,compose as o,createTemplate as r,kebabCase as n,withMemCache as d}from"@descope/sdk-helpers";import a from"@descope/web-component";import{projectIdMixin as l,observeAttributesMixin as h,loggerMixin as c,createStateManagementMixin as u,initLifecycleMixin as f,staticResourcesMixin as g,createValidateAttributesMixin as v,descopeUiMixin as p,initElementMixin as w,modalMixin as m,debuggerMixin as b,themeMixin as y}from"@descope/sdk-mixins";import{FlowDriver as R,AvatarDriver as W,UserAttributeDriver as k,UserAuthMethodDriver as M,ButtonDriver as U}from"@descope/sdk-component-drivers";import{createSelector as S}from"reselect";import{createAsyncThunk as j}from"@reduxjs/toolkit";import I from"@descope/web-js-sdk";import"@descope/core-js-sdk";const C=t=>t.me.data,A=S(C,(t=>t.picture)),x=S(C,(t=>t.email)),O=S(C,(t=>t.verifiedEmail)),q=S(C,(t=>t.name)),E=S(C,(t=>t.phone)),P=S(C,(t=>t.verifiedPhone)),F=S(C,(t=>t.webauthn));S(C,(t=>t.password));const T=t=>(...e)=>i=>{i.addCase(t.pending,((t,i)=>{e.forEach((({onPending:e})=>{null==e||e(t,i)}))})),i.addCase(t.fulfilled,((t,i)=>{e.forEach((({onFulfilled:e})=>{null==e||e(t,i)}))})),i.addCase(t.rejected,((t,i)=>{e.forEach((({onRejected:e})=>{null==e||e(t,i)}))}))},L=j("users/me",((t,{extra:{api:e}})=>e.user.me())),N=T(L)({onFulfilled:(t,e)=>{t.me.data=e.payload}},($=t=>t.me,{onFulfilled:t=>{$(t).loading=!1},onPending:t=>{$(t).loading=!0,$(t).error=null},onRejected:(t,e)=>{$(t).loading=!1,$(t).error=e.error}}));var $;const D={action:L,reducer:N},H=j("users/logout",((t,{extra:{api:e}})=>e.user.logout())),B={action:H,reducer:T(H)({})},J={me:{loading:!1,error:null,data:{}}},V={me:"/v1/auth/me"},z=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),G=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return z();const s=yield e.get(V.me);return yield(e=>t(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})))(s),s.json()}))}),K=s((s=>{var r,n,d,a;const u=o(l,h,c)(s);return a=class extends u{constructor(){super(...arguments),r.add(this),n.set(this,void 0)}get baseUrl(){return this.getAttribute("base-url")}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e(this,n,"f")||e(this,r,"m",d).call(this),e(this,n,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.init)||void 0===s?void 0:s.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e(this,n,"f")&&e(this,r,"m",d).call(this)}))}))}},n=new WeakMap,r=new WeakSet,d=function(){this.logger.debug("creating an sdk instance"),i(this,n,((e,i,s)=>{const o=I(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.0.35"}}));return{user:Object.assign(Object.assign({},G({httpClient:o.httpClient,mock:i})),{logout:i?()=>t(void 0,void 0,void 0,(function*(){})):o.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl},"true"===this.mock,this.widgetId),"f")},a})),Q=s((t=>{const e=o(u({name:"widget",initialState:J,reducers:{},extraReducers:t=>{D.reducer(t),B.reducer(t)},asyncActions:{getMe:D.action,logout:B.action}}),f,c,K)(t);return class extends e{constructor(...t){super(...t),this.state=J,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),X=s((e=>{const i=o(g,v({"widget-id":v.missingAttrValidator}))(e);return class extends i{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return t(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${e}`,"text")).body}))}}})),Y=s((i=>{var s,n,d;return d=class extends(o(c,f,p,w,X,Q)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.init)||void 0===o?void 0:o.call(this),yield Promise.all([this.actions.getMe(),e(this,s,"m",n).call(this)]),this.onWidgetRootReady()}))}},s=new WeakSet,n=function(){return t(this,void 0,void 0,(function*(){const t=r(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},d})),Z=(t={})=>{const e=r("<descope-wc></descope-wc>");return Object.entries(t).forEach((([t,i])=>{e.content.querySelector("descope-wc").setAttribute(n(t),i)})),e};function _(t){return new URLSearchParams(window.location.search).get(t)}const tt=s((s=>{var r,n,a,l,h,u,f,g,v;return v=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),f.set(this,d((t=>{this.avatar.image=t}))),g.set(this,d((t=>{this.avatar.displayName=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,A(this.state)),e(this,g,"f").call(this,q(this.state)),this.subscribe(e(this,f,"f").bind(this),A),this.subscribe(e(this,g,"f").bind(this),q)}))}},n=new WeakMap,a=new WeakMap,f=new WeakMap,g=new WeakMap,r=new WeakSet,l=function(){i(this,n,this.createModal({"data-id":"update-pic"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this)},h=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.avatar=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{e(this,n,"f").open()}))},v})),et=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b,y;return y=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.emailUserAttr.value=t}))),b.set(this,d((t=>{this.emailUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,x(this.state)),e(this,b,"f").call(this,O(this.state)),this.subscribe(e(this,w,"f").bind(this),x),this.subscribe(e(this,b,"f").bind(this),O)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,b=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-email"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-email"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.emailUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.emailUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},y})),it=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b;return b=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.nameUserAttr.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,q(this.state)),this.subscribe(e(this,w,"f").bind(this),q)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-name"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-name"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.nameUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.nameUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},b})),st=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b,y;return y=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.phoneUserAttr.value=t}))),b.set(this,d((t=>{this.phoneUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,E(this.state)),e(this,b,"f").call(this,P(this.state)),this.subscribe(e(this,w,"f").bind(this),E),this.subscribe(e(this,b,"f").bind(this),P)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,b=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-phone"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-phone"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.phoneUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.phoneUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},y})),ot=s((s=>{var r,n,a,l,h,u,f,g;return g=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),f.set(this,d((t=>{this.passkeyUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,F(this.state)),this.subscribe(e(this,f,"f").bind(this),F)}))}},n=new WeakMap,a=new WeakMap,f=new WeakMap,r=new WeakSet,l=function(){i(this,n,this.createModal({"data-id":"passkey"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this)},h=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.passkeyUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{e(this,n,"f").open()}))},g})),rt=s((s=>{var r,n,d,a,l,h,u;return u=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",h).call(this),e(this,r,"m",a).call(this)}))}},n=new WeakMap,d=new WeakMap,r=new WeakSet,a=function(){i(this,n,this.createModal({"data-id":"password"}),"f"),i(this,d,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",l).bind(this),e(this,r,"m",l).call(this)},l=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close()}))},h=function(){this.passwordUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{e(this,n,"f").open()}))},u})),nt=s((i=>{var s,r,n;return n=class extends(o(Q,c,Y,m)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.onWidgetRootReady)||void 0===o?void 0:o.call(this),e(this,s,"m",r).call(this)}))}},s=new WeakSet,r=function(){this.logout=new U((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>t(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},n})),dt="widget-flow",at=s((i=>{var s,r,n;return n=class extends(o(f,m,Q,c)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.init)||void 0===o?void 0:o.call(this);const t=_(dt);t&&(!function(t){if(window.history.replaceState&&_(t)){const e=new URL(window.location.href),i=new URLSearchParams(e.search);i.delete(t),e.search=i.toString(),window.history.replaceState({},"",e.toString())}}(dt),e(this,s,"m",r).call(this,t))}))}},s=new WeakSet,r=function(t){const e=this.createModal({"data-id":"redirect-flow"});e.setContent(Z({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl}));const i=new R((()=>{var t;return null===(t=e.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger});i.onSuccess((()=>{e.close(),this.actions.getMe()})),e.afterClose=()=>{e.remove()},e.open()},n})),lt=s((e=>class extends(o(b,y,at,et,tt,it,st,ot,rt,nt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var i;return t(this,void 0,void 0,(function*(){yield null===(i=e.init)||void 0===i?void 0:i.call(this)}))}})),ht=o((e=>class extends(lt(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var i;return t(this,void 0,void 0,(function*(){yield null===(i=e.init)||void 0===i?void 0:i.call(this),a.sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.0.35"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",ht);export{ht as default};
5
+ import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createSingletonMixin as s,compose as o,createTemplate as r,kebabCase as n,withMemCache as d}from"@descope/sdk-helpers";import a from"@descope/web-component";import{projectIdMixin as l,observeAttributesMixin as h,loggerMixin as c,createStateManagementMixin as u,initLifecycleMixin as f,staticResourcesMixin as g,createValidateAttributesMixin as v,descopeUiMixin as p,initElementMixin as w,modalMixin as m,debuggerMixin as b,themeMixin as y}from"@descope/sdk-mixins";import{FlowDriver as R,AvatarDriver as W,UserAttributeDriver as k,UserAuthMethodDriver as M,ButtonDriver as U}from"@descope/sdk-component-drivers";import{createSelector as S}from"reselect";import{createAsyncThunk as j}from"@reduxjs/toolkit";import I from"@descope/web-js-sdk";import"@descope/core-js-sdk";const C=t=>t.me.data,A=S(C,(t=>t.picture)),x=S(C,(t=>t.email)),O=S(C,(t=>t.verifiedEmail)),q=S(C,(t=>t.name)),E=S(C,(t=>t.phone)),P=S(C,(t=>t.verifiedPhone)),F=S(C,(t=>t.webauthn));S(C,(t=>t.password));const T=t=>(...e)=>i=>{i.addCase(t.pending,((t,i)=>{e.forEach((({onPending:e})=>{null==e||e(t,i)}))})),i.addCase(t.fulfilled,((t,i)=>{e.forEach((({onFulfilled:e})=>{null==e||e(t,i)}))})),i.addCase(t.rejected,((t,i)=>{e.forEach((({onRejected:e})=>{null==e||e(t,i)}))}))},L=j("users/me",((t,{extra:{api:e}})=>e.user.me())),N=T(L)({onFulfilled:(t,e)=>{t.me.data=e.payload}},($=t=>t.me,{onFulfilled:t=>{$(t).loading=!1},onPending:t=>{$(t).loading=!0,$(t).error=null},onRejected:(t,e)=>{$(t).loading=!1,$(t).error=e.error}}));var $;const D={action:L,reducer:N},H=j("users/logout",((t,{extra:{api:e}})=>e.user.logout())),B={action:H,reducer:T(H)({})},J={me:{loading:!1,error:null,data:{}}},V={me:"/v1/auth/me"},z=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),G=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return z();const s=yield e.get(V.me);return yield(e=>t(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})))(s),s.json()}))}),K=s((s=>{var r,n,d,a;const u=o(l,h,c)(s);return a=class extends u{constructor(){super(...arguments),r.add(this),n.set(this,void 0)}get baseUrl(){return this.getAttribute("base-url")}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e(this,n,"f")||e(this,r,"m",d).call(this),e(this,n,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.init)||void 0===s?void 0:s.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e(this,n,"f")&&e(this,r,"m",d).call(this)}))}))}},n=new WeakMap,r=new WeakSet,d=function(){this.logger.debug("creating an sdk instance"),i(this,n,((e,i,s)=>{const o=I(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.0.37"}}));return{user:Object.assign(Object.assign({},G({httpClient:o.httpClient,mock:i})),{logout:i?()=>t(void 0,void 0,void 0,(function*(){})):o.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl},"true"===this.mock,this.widgetId),"f")},a})),Q=s((t=>{const e=o(u({name:"widget",initialState:J,reducers:{},extraReducers:t=>{D.reducer(t),B.reducer(t)},asyncActions:{getMe:D.action,logout:B.action}}),f,c,K)(t);return class extends e{constructor(...t){super(...t),this.state=J,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),X=s((e=>{const i=o(g,v({"widget-id":v.missingAttrValidator}))(e);return class extends i{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return t(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${e}`,"text")).body}))}}})),Y=s((i=>{var s,n,d;return d=class extends(o(c,f,p,w,X,Q)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.init)||void 0===o?void 0:o.call(this),yield Promise.all([this.actions.getMe(),e(this,s,"m",n).call(this)]),this.onWidgetRootReady()}))}},s=new WeakSet,n=function(){return t(this,void 0,void 0,(function*(){const t=r(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},d})),Z=(t={})=>{const e=r("<descope-wc></descope-wc>");return Object.entries(t).forEach((([t,i])=>{e.content.querySelector("descope-wc").setAttribute(n(t),i)})),e};function _(t){return new URLSearchParams(window.location.search).get(t)}const tt=s((s=>{var r,n,a,l,h,u,f,g,v;return v=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),f.set(this,d((t=>{this.avatar.image=t}))),g.set(this,d((t=>{this.avatar.displayName=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,A(this.state)),e(this,g,"f").call(this,q(this.state)),this.subscribe(e(this,f,"f").bind(this),A),this.subscribe(e(this,g,"f").bind(this),q)}))}},n=new WeakMap,a=new WeakMap,f=new WeakMap,g=new WeakMap,r=new WeakSet,l=function(){i(this,n,this.createModal({"data-id":"update-pic"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this)},h=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.avatar=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{e(this,n,"f").open()}))},v})),et=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b,y;return y=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.emailUserAttr.value=t}))),b.set(this,d((t=>{this.emailUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,x(this.state)),e(this,b,"f").call(this,O(this.state)),this.subscribe(e(this,w,"f").bind(this),x),this.subscribe(e(this,b,"f").bind(this),O)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,b=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-email"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-email"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.emailUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.emailUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},y})),it=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b;return b=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.nameUserAttr.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,q(this.state)),this.subscribe(e(this,w,"f").bind(this),q)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-name"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-name"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.nameUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.nameUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},b})),st=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b,y;return y=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.phoneUserAttr.value=t}))),b.set(this,d((t=>{this.phoneUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,E(this.state)),e(this,b,"f").call(this,P(this.state)),this.subscribe(e(this,w,"f").bind(this),E),this.subscribe(e(this,b,"f").bind(this),P)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,b=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-phone"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-phone"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.phoneUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.phoneUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},y})),ot=s((s=>{var r,n,a,l,h,u,f,g;return g=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),f.set(this,d((t=>{this.passkeyUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,F(this.state)),this.subscribe(e(this,f,"f").bind(this),F)}))}},n=new WeakMap,a=new WeakMap,f=new WeakMap,r=new WeakSet,l=function(){i(this,n,this.createModal({"data-id":"passkey"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this)},h=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.passkeyUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{e(this,n,"f").open()}))},g})),rt=s((s=>{var r,n,d,a,l,h,u;return u=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",h).call(this),e(this,r,"m",a).call(this)}))}},n=new WeakMap,d=new WeakMap,r=new WeakSet,a=function(){i(this,n,this.createModal({"data-id":"password"}),"f"),i(this,d,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",l).bind(this),e(this,r,"m",l).call(this)},l=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close()}))},h=function(){this.passwordUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{e(this,n,"f").open()}))},u})),nt=s((i=>{var s,r,n;return n=class extends(o(Q,c,Y,m)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.onWidgetRootReady)||void 0===o?void 0:o.call(this),e(this,s,"m",r).call(this)}))}},s=new WeakSet,r=function(){this.logout=new U((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>t(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},n})),dt="widget-flow",at=s((i=>{var s,r,n;return n=class extends(o(f,m,Q,c)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.init)||void 0===o?void 0:o.call(this);const t=_(dt);t&&(!function(t){if(window.history.replaceState&&_(t)){const e=new URL(window.location.href),i=new URLSearchParams(e.search);i.delete(t),e.search=i.toString(),window.history.replaceState({},"",e.toString())}}(dt),e(this,s,"m",r).call(this,t))}))}},s=new WeakSet,r=function(t){const e=this.createModal({"data-id":"redirect-flow"});e.setContent(Z({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl}));const i=new R((()=>{var t;return null===(t=e.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger});i.onSuccess((()=>{e.close(),this.actions.getMe()})),e.afterClose=()=>{e.remove()},e.open()},n})),lt=s((e=>class extends(o(b,y,at,et,tt,it,st,ot,rt,nt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var i;return t(this,void 0,void 0,(function*(){yield null===(i=e.init)||void 0===i?void 0:i.call(this)}))}})),ht=o((e=>class extends(lt(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var i;return t(this,void 0,void 0,(function*(){yield null===(i=e.init)||void 0===i?void 0:i.call(this),a.sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.0.37"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",ht);export{ht as default};
6
6
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ declare const UserProfileWidget: {
18
18
  logout: _descope_sdk_component_drivers.ButtonDriver;
19
19
  "__#16@#initLogout"(): void;
20
20
  onWidgetRootReady: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
21
- "__#12122@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
21
+ "__#12123@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
22
22
  logger: {
23
23
  error(...data: any[]): void;
24
24
  warn(...data: any[]): void;
@@ -27,7 +27,7 @@ declare const UserProfileWidget: {
27
27
  };
28
28
  }) => {
29
29
  setContent(template: HTMLTemplateElement): void;
30
- "__#12121@#private": any;
30
+ "__#12122@#private": any;
31
31
  beforeOpen: () => void | Promise<void>;
32
32
  afterClose: () => void;
33
33
  nodeName: string;
@@ -35,7 +35,7 @@ declare const UserProfileWidget: {
35
35
  open(): Promise<void>;
36
36
  reset(): void;
37
37
  remove(): void;
38
- "__#12119@#private": any;
38
+ "__#12120@#private": any;
39
39
  logger: {
40
40
  error(...data: any[]): void;
41
41
  warn(...data: any[]): void;
@@ -46,21 +46,21 @@ declare const UserProfileWidget: {
46
46
  readonly ele: Element;
47
47
  };
48
48
  createModal(config?: Record<string, string>): _descope_sdk_component_drivers.ModalDriver;
49
- "__#12118@#errorCbsSym": symbol;
50
- "__#12118@#loadCbsSym": symbol;
51
- "__#12118@#getComponentsVersion": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
52
- "__#12118@#exposeAlternateEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
53
- "__#12118@#handleFallbackScript": ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>);
54
- "__#12118@#registerEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
55
- "__#12118@#getDescopeUiLoadingScript": (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>);
56
- "__#12118@#descopeUi": Promise<any>;
49
+ "__#12119@#errorCbsSym": symbol;
50
+ "__#12119@#loadCbsSym": symbol;
51
+ "__#12119@#getComponentsVersion": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
52
+ "__#12119@#exposeAlternateEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
53
+ "__#12119@#handleFallbackScript": ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>);
54
+ "__#12119@#registerEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
55
+ "__#12119@#getDescopeUiLoadingScript": (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>);
56
+ "__#12119@#descopeUi": Promise<any>;
57
57
  readonly descopeUi: Promise<any>;
58
- "__#12118@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
58
+ "__#12119@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
59
59
  loadDescopeUiComponents: ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>);
60
- "__#12118@#getDescopeUi": (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>);
60
+ "__#12119@#getDescopeUi": (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>);
61
61
  readonly config: any;
62
- "__#12115@#_configResource": any;
63
- "__#12115@#fetchConfig": (() => Promise<{
62
+ "__#12116@#_configResource": any;
63
+ "__#12116@#fetchConfig": (() => Promise<{
64
64
  projectConfig: _descope_sdk_mixins.ProjectConfiguration;
65
65
  executionContext: {
66
66
  geo: string;
@@ -100,6 +100,7 @@ declare const UserProfileWidget: {
100
100
  body: F_2 extends "json" ? Record<string, any> : string;
101
101
  headers: Record<string, string>;
102
102
  }>);
103
+ readonly baseStaticUrl: string;
103
104
  readonly baseUrl: string;
104
105
  accessKey: string;
105
106
  readonly accessKeyLabel: string;
@@ -858,18 +859,18 @@ declare const UserProfileWidget: {
858
859
  blur: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
859
860
  focus: ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void);
860
861
  readonly projectId: string;
861
- "__#12114@#handleError": ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
862
- "__#12113@#observeMappings": {};
862
+ "__#12115@#handleError": ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
863
+ "__#12114@#observeMappings": {};
863
864
  observeAttribute: ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any);
864
865
  observeAttributes: ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void);
865
- "__#12112@#isInit": boolean;
866
- "__#12111@#logger": {
866
+ "__#12113@#isInit": boolean;
867
+ "__#12112@#logger": {
867
868
  error(...data: any[]): void;
868
869
  warn(...data: any[]): void;
869
870
  info(...data: any[]): void;
870
871
  debug(...data: any[]): void;
871
872
  };
872
- "__#12111@#wrapLogger": ((logger: Partial<{
873
+ "__#12112@#wrapLogger": ((logger: Partial<{
873
874
  error(...data: any[]): void;
874
875
  warn(...data: any[]): void;
875
876
  info(...data: any[]): void;
@@ -1802,14 +1803,14 @@ declare const UserProfileWidget: {
1802
1803
  "__#11@#onValueBadgeLabelUpdate": (isEmailVerified: any) => void;
1803
1804
  "__#17@#createFlowRedirectModal"(widgetFlow: string): void;
1804
1805
  readonly theme: _descope_sdk_mixins.ThemeOptions;
1805
- "__#12124@#_themeResource": Promise<void | Record<string, any>>;
1806
- "__#12124@#fetchTheme"(): Promise<Record<string, any>>;
1807
- readonly "__#12124@#themeResource": Promise<void | Record<string, any>>;
1808
- "__#12124@#loadGlobalStyle"(): Promise<void>;
1809
- "__#12124@#loadComponentsStyle"(): Promise<void>;
1810
- "__#12124@#loadFonts"(): Promise<void>;
1811
- "__#12124@#applyTheme"(): Promise<void>;
1812
- "__#12117@#debuggerEle": HTMLElement & {
1806
+ "__#12125@#_themeResource": Promise<void | Record<string, any>>;
1807
+ "__#12125@#fetchTheme"(): Promise<Record<string, any>>;
1808
+ readonly "__#12125@#themeResource": Promise<void | Record<string, any>>;
1809
+ "__#12125@#loadGlobalStyle"(): Promise<void>;
1810
+ "__#12125@#loadComponentsStyle"(): Promise<void>;
1811
+ "__#12125@#loadFonts"(): Promise<void>;
1812
+ "__#12125@#applyTheme"(): Promise<void>;
1813
+ "__#12118@#debuggerEle": HTMLElement & {
1813
1814
  updateData: (data: {
1814
1815
  title: string;
1815
1816
  description?: string;
@@ -1818,11 +1819,11 @@ declare const UserProfileWidget: {
1818
1819
  description?: string;
1819
1820
  }[]) => void;
1820
1821
  };
1821
- "__#12117@#disableDebugger"(): void;
1822
- "__#12117@#enableDebugger"(): Promise<void>;
1822
+ "__#12118@#disableDebugger"(): void;
1823
+ "__#12118@#enableDebugger"(): Promise<void>;
1823
1824
  readonly debug: boolean;
1824
- "__#12117@#handleDebugMode"(): void;
1825
- "__#12117@#updateDebuggerMessages"(title: string, description: string): void;
1825
+ "__#12118@#handleDebugMode"(): void;
1826
+ "__#12118@#updateDebuggerMessages"(title: string, description: string): void;
1826
1827
  };
1827
1828
  };
1828
1829