@descope/tenant-profile-widget 0.7.0 → 0.7.2
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/cjs/index.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* @descope/tenant-profile-widget v0.7.
|
|
3
|
+
* @descope/tenant-profile-widget v0.7.2
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var e=require("tslib"),t=require("@descope/sdk-helpers"),i=require("@descope/sdk-mixins"),s=require("reselect"),a=require("@descope/sdk-component-drivers"),n=require("@reduxjs/toolkit");require("@descope/core-js-sdk");var l=require("@descope/web-js-sdk");require("@descope/web-component");const o=e=>e.tenant.data,r=e=>e.tenantAdminLinkSSO.data.defaultLink,d=s.createSelector(o,(e=>e.customAttributes||{})),c=s.createSelector(o,(e=>e.name||"")),h=s.createSelector(o,(e=>e.selfProvisioningDomains||[])),v=s.createSelector(o,(e=>e.enforceSSOExclusions||[])),u=s.createSelector(o,(e=>e.enforceSSO||!1)),_=s.createSelector(o,r,(e=>e.tenantAdminLinkSSO.data.ssoIdToLink),((e,t,i)=>[...e?[{id:"",name:"Default SSO Configuration",authType:e.authType,isDefault:!0,link:t}]:[],...((null==e?void 0:e.additionalSSOConfigs)||[]).map((({ssoId:e,name:t,authType:s})=>({id:e,name:t,authType:s,link:i[e]||""})))])),f=s.createSelector(o,(e=>((null==e?void 0:e.additionalSSOConfigs)||[]).map((({ssoId:e})=>e)))),m=(e={})=>{const i=t.createTemplate("<descope-wc></descope-wc>");return Object.entries(e).forEach((([e,s])=>{i.content.querySelector("descope-wc").setAttribute(t.kebabCase(e),s)})),i};function g(e){return new URLSearchParams(window.location.search).get(e)}const p=e=>(...t)=>i=>{i.addCase(e.pending,((e,i)=>{t.forEach((({onPending:t})=>{null==t||t(e,i)}))})),i.addCase(e.fulfilled,((e,i)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,i)}))})),i.addCase(e.rejected,((e,i)=>{t.forEach((({onRejected:t})=>{null==t||t(e,i)}))}))},w=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,i)=>{e(t).loading=!1,e(t).error=i.error}}),F=n.createAsyncThunk("users/me",((e,{extra:{api:t}})=>t.user.me())),S=p(F)({onFulfilled:(e,t)=>{e.me.data=t.payload}},w((e=>e.me))),P={action:F,reducer:S},b=n.createAsyncThunk("tenant/details",((e,{extra:{api:t}})=>t.tenant.details())),y=p(b)({onFulfilled:(e,t)=>{e.tenant.data=t.payload}},w((e=>e.tenant))),G={action:b,reducer:y},k=n.createAsyncThunk("tenant/adminLinkSso",(({ssoIds:e},{extra:{api:t}})=>t.tenant.adminLinkSso({ssoIds:e}))),M={action:k,reducer:p(k)({onFulfilled:(e,t)=>{var i;e.tenantAdminLinkSSO.data=null!==(i=t.payload)&&void 0!==i?i:{defaultLink:"",ssoIdToLink:{}}}},w((e=>e.tenantAdminLinkSSO)))},x={me:{loading:!1,error:null,data:{}},tenant:{loading:!1,error:null,data:{}},tenantAdminLinkSSO:{loading:!1,error:null,data:{defaultLink:"",ssoIdToLink:{}}}},C={me:"/v1/auth/me"},I={details:"/v1/mgmt/tenant",adminLinkSso:"/v1/mgmt/tenant/adminlinks/sso/authenticated/batch"},U=t=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield t.text(),i=JSON.parse(e);if(!t.ok){const e=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(e||`${t.status} ${t.statusText}`)}t.json=()=>Promise.resolve(i),t.text=()=>Promise.resolve(e)})),R=()=>e.__awaiter(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({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})}))})),D=()=>e.__awaiter(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({tenantId:"tenant-1",roleNames:["admin"],id:"tenant-1",name:"Test Tenant",selfProvisioningDomains:["example1.com","example2.com"],customAttributes:{},authType:"password",domains:[],createdTime:Date.now(),disabled:!1,enforceSSO:!0})}))})),W=()=>e.__awaiter(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({defaultLink:"_blank",ssoIdToLink:{"okta-prod":"_blank?ssoId=okta-prod","entra-eu":"_blank?ssoId=entra-eu"}})}))})),T=({httpClient:t,tenantId:i,mock:s})=>{const a=encodeURIComponent(i||""),n=`?tenant=${a}&id=${a}`;return{details:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(s)return D();if(!i)throw new Error("tenantId is not defined");const e=`${I.details}${n}`,a=yield t.get(e);yield U(a);return yield a.json()})),adminLinkSso:n=>e.__awaiter(void 0,[n],void 0,(function*({ssoIds:e}){if(s)return W();if(!i)throw new Error("tenantId is not defined");const n=yield t.post(`${I.adminLinkSso}?tenant=${a}`,{tenantId:a,ssoIds:e},{headers:{"Content-Type":"application/json"}});yield U(n);return yield n.json()}))}},O=({httpClient:t,mock:i})=>({me:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(i)return R();const e=yield t.get(C.me);return yield U(e),e.json()}))}),A=t.createSingletonMixin((s=>{var a,n,o,r;const d=t.compose(i.projectIdMixin,i.observeAttributesMixin,i.loggerMixin,i.baseUrlMixin,i.cookieConfigMixin)(s);return r=class extends d{constructor(){super(...arguments),a.add(this),n.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get tenantId(){return this.getAttribute("tenant")}get mock(){return this.getAttribute("mock")}get styleId(){return this.getAttribute("style-id")||i.DEFAULT_STYLE_ID}get api(){return e.__classPrivateFieldGet(this,n,"f")||e.__classPrivateFieldGet(this,a,"m",o).call(this),e.__classPrivateFieldGet(this,n,"f")}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this),this.observeAttributes(["project-id","base-url","tenant","mock"],(()=>{e.__classPrivateFieldGet(this,n,"f")&&e.__classPrivateFieldGet(this,a,"m",o).call(this)}))}))}},n=new WeakMap,a=new WeakSet,o=function(){this.logger.debug("creating an sdk instance"),e.__classPrivateFieldSet(this,n,((e,t,i,s)=>{const a=l(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"tenant-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.7.0"}}));return{user:O({httpClient:a.httpClient,mock:i}),tenant:T({httpClient:a.httpClient,tenantId:t,mock:i})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},r})),E=t.createSingletonMixin((e=>{const s=t.compose(i.createStateManagementMixin({name:"widget",initialState:x,reducers:{},extraReducers:e=>{P.reducer(e),G.reducer(e),M.reducer(e)},asyncActions:{getMe:P.action,getTenant:G.action,getTenantAdminLinkSSO:M.action}}),i.initLifecycleMixin,i.loggerMixin,A)(e);return class extends s{constructor(...e){super(...e),this.state=x,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),j="widget-flow",N=t.createSingletonMixin((s=>{var n,l,o;return o=class extends(t.compose(i.localeMixin,i.initLifecycleMixin,i.modalMixin,E,i.cookieConfigMixin,i.loggerMixin,i.themeMixin)(s)){constructor(){super(...arguments),n.add(this)}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this);const s=g(j);s&&(!function(e){if(window.history.replaceState&&g(e)){const t=new URL(window.location.href),i=new URLSearchParams(t.search);i.delete(e),t.search=i.toString(),window.history.replaceState({},"",t.toString())}}(j),e.__classPrivateFieldGet(this,n,"m",l).call(this,s))}))}},n=new WeakSet,l=function(t){const i=this.createModal({"data-id":"redirect-flow"});i.setContent(m({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId}));new a.FlowDriver((()=>{var e;return null===(e=i.ele)||void 0===e?void 0:e.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>e.__awaiter(this,void 0,void 0,(function*(){i.close(),this.actions.getMe(),yield this.actions.getTenant();const e=f(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:e})})))),i.afterClose=()=>{i.remove()},i.open()},o})),L=t.createSingletonMixin((e=>class extends(t.compose(i.themeMixin,i.observeAttributesMixin)(e)){syncFlowTheme(e){e.theme=this.theme,this.observeAttributes(["theme"],(()=>{e.theme=this.theme}))}}));const q=t.createSingletonMixin((s=>{var a,n,l;return l=class extends(t.compose(i.loggerMixin,i.initLifecycleMixin,i.descopeUiMixin,i.initElementMixin,i.createFetchWidgetPagesMixin("tenant-profile-widget"),E)(s)){constructor(){super(...arguments),a.add(this)}onWidgetRootReady(){return e.__awaiter(this,void 0,void 0,(function*(){}))}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this);try{yield Promise.all([this.actions.getMe(),this.actions.getTenant()]);const e=f(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:e})}catch(e){}const s=this.state.me.error||(e=>e.tenant.error)(this.state)||(e=>e.tenantAdminLinkSSO.error)(this.state);if(s){this.contentRootElement.innerHTML="";const e="object"==typeof s&&null!==s&&"message"in s?s.message:String(s)||"An error occurred";this.contentRootElement.append(function({mainMessage:e="An error occurred"}){const t=document.createElement("div");t.setAttribute("data-id","widget-error"),t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="center",t.style.justifyContent="center",t.style.padding="72px 36px",t.style.background="#fff",t.style.borderRadius="12px",t.style.boxShadow="0 2px 8px rgba(0,0,0,0.03)",t.style.margin="32px auto",t.style.maxWidth="400px";const i=document.createElement("div");i.innerHTML='\n <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="20" cy="20" r="18" stroke="#FF3B3B" stroke-width="3" fill="#fff"/>\n <text x="20" y="27" text-anchor="middle" font-size="24" font-family="Arial, sans-serif" fill="#FF3B3B">!</text>\n </svg>\n ',i.style.marginBottom="12px",t.appendChild(i);const s=document.createElement("div");return s.textContent=e,s.style.fontWeight="bold",s.style.fontSize="20px",s.style.color="#222",s.style.textAlign="center",s.style.marginTop="8px",t.appendChild(s),t}({mainMessage:e}))}else yield e.__classPrivateFieldGet(this,a,"m",n).call(this),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},a=new WeakSet,n=function(){return e.__awaiter(this,void 0,void 0,(function*(){const e=t.createTemplate(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},l})),$=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h,v,u,g,p,w;return w=class extends(t.compose(L,E,i.modalMixin,i.loggerMixin,q)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),r.set(this,void 0),d.set(this,void 0),c.set(this,void 0)}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldSet(this,l,new a.MultiSsoConfigurationsDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("descope-multi-sso")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").isExists&&(e.__classPrivateFieldGet(this,n,"m",p).call(this),e.__classPrivateFieldGet(this,l,"f").data=_(this.state),this.subscribe((t=>{e.__classPrivateFieldGet(this,l,"f").data=t}),_))}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,d=new WeakMap,c=new WeakMap,n=new WeakSet,h=function(){e.__classPrivateFieldSet(this,o,this.createModal({"data-id":"multi-sso-create-modal"}),"f"),e.__classPrivateFieldSet(this,r,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),this.syncFlowTheme(e.__classPrivateFieldGet(this,r,"f"))},v=function(){e.__classPrivateFieldSet(this,d,this.createModal({"data-id":"multi-sso-delete-modal"}),"f"),e.__classPrivateFieldSet(this,c,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f"))},u=function(t){e.__classPrivateFieldGet(this,o,"f").setContent(m({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,tenant:this.tenantId})),e.__classPrivateFieldGet(this,o,"f").open(),e.__classPrivateFieldGet(this,r,"f").onSuccess((()=>e.__awaiter(this,void 0,void 0,(function*(){e.__classPrivateFieldGet(this,o,"f").close(),yield this.actions.getTenant();const t=f(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:t})}))))},g=function(t,i){e.__classPrivateFieldGet(this,d,"f").setContent(m({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,tenant:this.tenantId,form:JSON.stringify({deleteSSOConfigurationId:i})})),e.__classPrivateFieldGet(this,d,"f").open(),e.__classPrivateFieldGet(this,c,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,d,"f").close(),this.actions.getTenant()}))},p=function(){const{createFlowId:t,deleteFlowId:i}=e.__classPrivateFieldGet(this,l,"f");i&&(e.__classPrivateFieldGet(this,n,"m",v).call(this),e.__classPrivateFieldGet(this,l,"f").onDeleteClicked((({id:t})=>e.__classPrivateFieldGet(this,n,"m",g).call(this,i,t)))),t&&(e.__classPrivateFieldGet(this,n,"m",h).call(this),e.__classPrivateFieldGet(this,l,"f").onCreateClicked((()=>e.__classPrivateFieldGet(this,n,"m",u).call(this,t))))},w})),B=t.createSingletonMixin((s=>{var n,l,o,d;return d=class extends(t.compose(L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),o.set(this,t.withMemCache((e=>{this.tenantAdminLinkSSODriver.href=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",l).call(this),e.__classPrivateFieldGet(this,o,"f").call(this,r(this.state)),this.subscribe(e.__classPrivateFieldGet(this,o,"f").bind(this),r)}))}},o=new WeakMap,n=new WeakSet,l=function(){this.tenantAdminLinkSSODriver=new a.LinkDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-link[data-id="tenant-admin-link-sso"]')}),{logger:this.logger})},d}));var J;!function(e){e.TEXT="text",e.NUMBER="number",e.BOOLEAN="boolean",e.SINGLE_SELECT="singleSelect",e.ARRAY="array",e.DATE="date"}(J||(J={}));const H=t.createSingletonMixin((s=>{var n,l,o,r,c,h,v,u,_,f,g;return g=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,{}),o.set(this,{}),r.set(this,{}),c.set(this,{}),u.set(this,t.withMemCache((t=>{var i;const s=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll('descope-user-attribute[data-id^="customAttributes."]');Array.from(s).forEach((i=>{const s=i.getAttribute("data-id").replace("customAttributes.",""),l=i.getAttribute("data-type")||J.TEXT,o=t[s],r=new a.UserAttributeDriver(i,{logger:this.logger});r.value=((e,t)=>e===J.DATE&&t?new Date(t).toLocaleString():e===J.BOOLEAN&&void 0!==t?t?"True":"False":(t||"").toString())(l,o),e.__classPrivateFieldGet(this,n,"m",_).call(this,i,s,r,l,s),e.__classPrivateFieldGet(this,n,"m",f).call(this,i,s,r)}))})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,u,"f").call(this,d(this.state)),this.subscribe(e.__classPrivateFieldGet(this,u,"f").bind(this),d)}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,c=new WeakMap,u=new WeakMap,n=new WeakSet,h=function(t,i,s){var a,n;const r=d(this.state)[s],c=i===J.ARRAY?(r||[]).join(","):r;null===(a=e.__classPrivateFieldGet(this,l,"f")[t])||void 0===a||a.setContent(m({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({customAttributes:{[s]:c}})})),null===(n=e.__classPrivateFieldGet(this,o,"f")[t])||void 0===n||n.onSuccess((()=>{var i;null===(i=e.__classPrivateFieldGet(this,l,"f")[t])||void 0===i||i.close(),this.actions.getTenant()}))},v=function(t){var i,s;null===(i=e.__classPrivateFieldGet(this,r,"f")[t])||void 0===i||i.setContent(m({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),null===(s=e.__classPrivateFieldGet(this,c,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e.__classPrivateFieldGet(this,r,"f")[t])||void 0===i||i.close(),this.actions.getTenant()}))},_=function(t,i,s,r,d){const c=t.getAttribute("edit-flow-id");c&&(e.__classPrivateFieldGet(this,l,"f")[c]||(e.__classPrivateFieldGet(this,l,"f")[c]=this.createModal({"data-id":`edit-${i}`}),e.__classPrivateFieldGet(this,o,"f")[c]=new a.FlowDriver((()=>{var t,i;return null===(i=null===(t=e.__classPrivateFieldGet(this,l,"f")[c])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e.__classPrivateFieldGet(this,l,"f")[c].beforeOpen=e.__classPrivateFieldGet(this,n,"m",h).bind(this,c,r,d),s.onEditClick((()=>{var t,i;null===(i=null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t?void 0:t[c])||void 0===i||i.open()})),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")[c])))},f=function(t,i,s){const l=t.getAttribute("delete-flow-id");l&&(e.__classPrivateFieldGet(this,r,"f")[l]||(e.__classPrivateFieldGet(this,r,"f")[l]=this.createModal({"data-id":`delete-${i}`}),e.__classPrivateFieldGet(this,c,"f")[l]=new a.FlowDriver((()=>{var t,i;return null===(i=null===(t=e.__classPrivateFieldGet(this,r,"f")[l])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e.__classPrivateFieldGet(this,r,"f")[l].beforeOpen=e.__classPrivateFieldGet(this,n,"m",v).bind(this,l),s.onDeleteClick((()=>{var t,i;null===(i=null===(t=e.__classPrivateFieldGet(this,r,"f"))||void 0===t?void 0:t[l])||void 0===i||i.open()})),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f")[l])))},g})),Y=t.createSingletonMixin((s=>{var n,l,o,r,d,c,v,u,_,f,g,p;return p=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),r.set(this,void 0),d.set(this,void 0),g.set(this,t.withMemCache((e=>{this.tenantEmailDomainsDriver.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",f).call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,h(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),h)}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,d=new WeakMap,g=new WeakMap,n=new WeakSet,c=function(){this.tenantEmailDomainsDriver.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-tenant-email-domains"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",v).bind(this),e.__classPrivateFieldGet(this,n,"m",v).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},v=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantEmailDomainsDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({tenantEmailDomains:h(this.state)})})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},u=function(){this.tenantEmailDomainsDriver.deleteFlowId&&(e.__classPrivateFieldSet(this,r,this.createModal({"data-id":"delete-tenant-email-domains"}),"f"),e.__classPrivateFieldSet(this,d,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,r,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",_).bind(this),e.__classPrivateFieldGet(this,n,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},_=function(){e.__classPrivateFieldGet(this,r,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantEmailDomainsDriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,r,"f").close(),this.actions.getTenant()}))},f=function(){this.tenantEmailDomainsDriver=new a.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="tenant-email-domains-edit"]')}),{logger:this.logger}),this.tenantEmailDomainsDriver.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.tenantEmailDomainsDriver.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,r,"f"))||void 0===t||t.open()}))},p})),z=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h,u,_,f,g,p;return p=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),r.set(this,void 0),d.set(this,void 0),g.set(this,t.withMemCache((e=>{this.tenantSSOExclusionsDriver.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",f).call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,v(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),v)}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,d=new WeakMap,g=new WeakMap,n=new WeakSet,c=function(){this.tenantSSOExclusionsDriver.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-tenant-sso-exclusions"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",h).bind(this),e.__classPrivateFieldGet(this,n,"m",h).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},h=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantSSOExclusionsDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({enforceSSOExclusions:v(this.state)})})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},u=function(){this.tenantSSOExclusionsDriver.deleteFlowId&&(e.__classPrivateFieldSet(this,r,this.createModal({"data-id":"delete-tenant-sso-exclusions"}),"f"),e.__classPrivateFieldSet(this,d,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,r,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",_).bind(this),e.__classPrivateFieldGet(this,n,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},_=function(){e.__classPrivateFieldGet(this,r,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantSSOExclusionsDriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,r,"f").close(),this.actions.getTenant()}))},f=function(){this.tenantSSOExclusionsDriver=new a.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="tenant-force-sso-exclusions-edit"]')}),{logger:this.logger}),this.tenantSSOExclusionsDriver.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.tenantSSOExclusionsDriver.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,r,"f"))||void 0===t||t.open()}))},p})),X=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h,v,_,f,g,p;return p=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),r.set(this,void 0),d.set(this,void 0),g.set(this,t.withMemCache((e=>{this.tenantEnforceSSODriver.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",f).call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",v).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,u(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),u)}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,d=new WeakMap,g=new WeakMap,n=new WeakSet,c=function(){this.tenantEnforceSSODriver.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-tenant-enforce-sso"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",h).bind(this),e.__classPrivateFieldGet(this,n,"m",h).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},h=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantEnforceSSODriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({enforceSSO:u(this.state)})})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},v=function(){this.tenantEnforceSSODriver.deleteFlowId&&(e.__classPrivateFieldSet(this,r,this.createModal({"data-id":"delete-tenant-enforce-sso"}),"f"),e.__classPrivateFieldSet(this,d,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,r,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",_).bind(this),e.__classPrivateFieldGet(this,n,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},_=function(){e.__classPrivateFieldGet(this,r,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantEnforceSSODriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,r,"f").close(),this.actions.getTenant()}))},f=function(){this.tenantEnforceSSODriver=new a.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="tenant-enforce-sso-edit"]')}),{logger:this.logger}),this.tenantEnforceSSODriver.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.tenantEnforceSSODriver.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,r,"f"))||void 0===t||t.open()}))},p})),K=t.createSingletonMixin((s=>{var n,l,o,r,d,h,v,u;return u=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),v.set(this,t.withMemCache((e=>{this.tenantNameDriver.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",h).call(this),e.__classPrivateFieldGet(this,n,"m",r).call(this),e.__classPrivateFieldGet(this,v,"f").call(this,c(this.state)),this.subscribe(e.__classPrivateFieldGet(this,v,"f").bind(this),c)}))}},l=new WeakMap,o=new WeakMap,v=new WeakMap,n=new WeakSet,r=function(){this.tenantNameDriver.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"tenant-profile-set-name"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",d).bind(this),e.__classPrivateFieldGet(this,n,"m",d).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},d=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantNameDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({tenantName:c(this.state)})})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},h=function(){this.tenantNameDriver=new a.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="tenant-name-edit"]')}),{logger:this.logger}),this.tenantNameDriver.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},u})),Q=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h;return h=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0)}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",r).call(this)}))}},l=new WeakMap,o=new WeakMap,n=new WeakSet,r=function(){this.TenantPasswordPolicyUserAuthMethodDriver.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"password-policy"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,n,"m",d).bind(this),e.__classPrivateFieldGet(this,n,"m",d).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},d=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.TenantPasswordPolicyUserAuthMethodDriver.flowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},c=function(){this.TenantPasswordPolicyUserAuthMethodDriver=new a.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="password-policy"]')}),{logger:this.logger}),this.TenantPasswordPolicyUserAuthMethodDriver.onUnfulfilledButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},h})),V=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h;return h=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0)}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",r).call(this)}))}},l=new WeakMap,o=new WeakMap,n=new WeakSet,r=function(){this.TenantSessionSettingsUserAuthMethodDriver.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"session-settings"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,n,"m",d).bind(this),e.__classPrivateFieldGet(this,n,"m",d).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},d=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.TenantSessionSettingsUserAuthMethodDriver.flowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},c=function(){this.TenantSessionSettingsUserAuthMethodDriver=new a.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="session-settings"]')}),{logger:this.logger}),this.TenantSessionSettingsUserAuthMethodDriver.onUnfulfilledButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},h})),Z=t.createSingletonMixin((s=>class extends(t.compose(i.debuggerMixin,i.themeMixin,N,q,K,Y,z,X,H,B,Q,V,$)(s)){init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var e;yield null===(e=t.init)||void 0===e?void 0:e.call(this)}))}})),ee=t.compose((t=>class extends(Z(t)){init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var e;yield null===(e=t.init)||void 0===e?void 0:e.call(this);(customElements.get("descope-wc")||(yield import("@descope/web-component").then((e=>e.default)))).sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"tenant-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.7.0"}}}))}}))(HTMLElement);customElements.define("descope-tenant-profile-widget",ee),module.exports=ee;
|
|
5
|
+
"use strict";var e=require("tslib"),t=require("@descope/sdk-helpers"),i=require("@descope/sdk-mixins"),s=require("reselect"),a=require("@descope/sdk-component-drivers"),n=require("@reduxjs/toolkit");require("@descope/core-js-sdk");var l=require("@descope/web-js-sdk");require("@descope/web-component");const o=e=>e.tenant.data,r=e=>e.tenantAdminLinkSSO.data.defaultLink,d=s.createSelector(o,(e=>e.customAttributes||{})),c=s.createSelector(o,(e=>e.name||"")),h=s.createSelector(o,(e=>e.selfProvisioningDomains||[])),v=s.createSelector(o,(e=>e.enforceSSOExclusions||[])),u=s.createSelector(o,(e=>e.enforceSSO||!1)),_=s.createSelector(o,r,(e=>e.tenantAdminLinkSSO.data.ssoIdToLink),((e,t,i)=>[...e?[{id:"",name:"Default SSO Configuration",authType:e.authType,isDefault:!0,link:t}]:[],...((null==e?void 0:e.additionalSSOConfigs)||[]).map((({ssoId:e,name:t,authType:s})=>({id:e,name:t,authType:s,link:i[e]||""})))])),f=s.createSelector(o,(e=>((null==e?void 0:e.additionalSSOConfigs)||[]).map((({ssoId:e})=>e)))),m=(e={})=>{const i=t.createTemplate("<descope-wc></descope-wc>");return Object.entries(e).forEach((([e,s])=>{i.content.querySelector("descope-wc").setAttribute(t.kebabCase(e),s)})),i};function g(e){return new URLSearchParams(window.location.search).get(e)}const p=e=>(...t)=>i=>{i.addCase(e.pending,((e,i)=>{t.forEach((({onPending:t})=>{null==t||t(e,i)}))})),i.addCase(e.fulfilled,((e,i)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,i)}))})),i.addCase(e.rejected,((e,i)=>{t.forEach((({onRejected:t})=>{null==t||t(e,i)}))}))},w=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,i)=>{e(t).loading=!1,e(t).error=i.error}}),F=n.createAsyncThunk("users/me",((e,{extra:{api:t}})=>t.user.me())),S=p(F)({onFulfilled:(e,t)=>{e.me.data=t.payload}},w((e=>e.me))),P={action:F,reducer:S},b=n.createAsyncThunk("tenant/details",((e,{extra:{api:t}})=>t.tenant.details())),y=p(b)({onFulfilled:(e,t)=>{e.tenant.data=t.payload}},w((e=>e.tenant))),G={action:b,reducer:y},k=n.createAsyncThunk("tenant/adminLinkSso",(({ssoIds:e},{extra:{api:t}})=>t.tenant.adminLinkSso({ssoIds:e}))),M={action:k,reducer:p(k)({onFulfilled:(e,t)=>{var i;e.tenantAdminLinkSSO.data=null!==(i=t.payload)&&void 0!==i?i:{defaultLink:"",ssoIdToLink:{}}}},w((e=>e.tenantAdminLinkSSO)))},x={me:{loading:!1,error:null,data:{}},tenant:{loading:!1,error:null,data:{}},tenantAdminLinkSSO:{loading:!1,error:null,data:{defaultLink:"",ssoIdToLink:{}}}},C={me:"/v1/auth/me"},I={details:"/v1/mgmt/tenant",adminLinkSso:"/v1/mgmt/tenant/adminlinks/sso/authenticated/batch"},U=t=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield t.text(),i=JSON.parse(e);if(!t.ok){const e=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(e||`${t.status} ${t.statusText}`)}t.json=()=>Promise.resolve(i),t.text=()=>Promise.resolve(e)})),R=()=>e.__awaiter(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({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})}))})),D=()=>e.__awaiter(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({tenantId:"tenant-1",roleNames:["admin"],id:"tenant-1",name:"Test Tenant",selfProvisioningDomains:["example1.com","example2.com"],customAttributes:{},authType:"password",domains:[],createdTime:Date.now(),disabled:!1,enforceSSO:!0})}))})),W=()=>e.__awaiter(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({defaultLink:"_blank",ssoIdToLink:{"okta-prod":"_blank?ssoId=okta-prod","entra-eu":"_blank?ssoId=entra-eu"}})}))})),T=({httpClient:t,tenantId:i,mock:s})=>{const a=encodeURIComponent(i||""),n=`?tenant=${a}&id=${a}`;return{details:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(s)return D();if(!i)throw new Error("tenantId is not defined");const e=`${I.details}${n}`,a=yield t.get(e);yield U(a);return yield a.json()})),adminLinkSso:n=>e.__awaiter(void 0,[n],void 0,(function*({ssoIds:e}){if(s)return W();if(!i)throw new Error("tenantId is not defined");const n=yield t.post(`${I.adminLinkSso}?tenant=${a}`,{tenantId:a,ssoIds:e},{headers:{"Content-Type":"application/json"}});yield U(n);return yield n.json()}))}},O=({httpClient:t,mock:i})=>({me:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(i)return R();const e=yield t.get(C.me);return yield U(e),e.json()}))}),A=t.createSingletonMixin((s=>{var a,n,o,r;const d=t.compose(i.projectIdMixin,i.observeAttributesMixin,i.loggerMixin,i.baseUrlMixin,i.cookieConfigMixin)(s);return r=class extends d{constructor(){super(...arguments),a.add(this),n.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get tenantId(){return this.getAttribute("tenant")}get mock(){return this.getAttribute("mock")}get styleId(){return this.getAttribute("style-id")||i.DEFAULT_STYLE_ID}get api(){return e.__classPrivateFieldGet(this,n,"f")||e.__classPrivateFieldGet(this,a,"m",o).call(this),e.__classPrivateFieldGet(this,n,"f")}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this),this.observeAttributes(["project-id","base-url","tenant","mock"],(()=>{e.__classPrivateFieldGet(this,n,"f")&&e.__classPrivateFieldGet(this,a,"m",o).call(this)}))}))}},n=new WeakMap,a=new WeakSet,o=function(){this.logger.debug("creating an sdk instance"),e.__classPrivateFieldSet(this,n,((e,t,i,s)=>{const a=l(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"tenant-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.7.2"}}));return{user:O({httpClient:a.httpClient,mock:i}),tenant:T({httpClient:a.httpClient,tenantId:t,mock:i})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},r})),E=t.createSingletonMixin((e=>{const s=t.compose(i.createStateManagementMixin({name:"widget",initialState:x,reducers:{},extraReducers:e=>{P.reducer(e),G.reducer(e),M.reducer(e)},asyncActions:{getMe:P.action,getTenant:G.action,getTenantAdminLinkSSO:M.action}}),i.initLifecycleMixin,i.loggerMixin,A)(e);return class extends s{constructor(...e){super(...e),this.state=x,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),j="widget-flow",N=t.createSingletonMixin((s=>{var n,l,o;return o=class extends(t.compose(i.localeMixin,i.initLifecycleMixin,i.modalMixin,E,i.cookieConfigMixin,i.loggerMixin,i.themeMixin)(s)){constructor(){super(...arguments),n.add(this)}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this);const s=g(j);s&&(!function(e){if(window.history.replaceState&&g(e)){const t=new URL(window.location.href),i=new URLSearchParams(t.search);i.delete(e),t.search=i.toString(),window.history.replaceState({},"",t.toString())}}(j),e.__classPrivateFieldGet(this,n,"m",l).call(this,s))}))}},n=new WeakSet,l=function(t){const i=this.createModal({"data-id":"redirect-flow"});i.setContent(m({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId}));new a.FlowDriver((()=>{var e;return null===(e=i.ele)||void 0===e?void 0:e.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>e.__awaiter(this,void 0,void 0,(function*(){i.close(),this.actions.getMe(),yield this.actions.getTenant();const e=f(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:e})})))),i.afterClose=()=>{i.remove()},i.open()},o})),L=t.createSingletonMixin((e=>class extends(t.compose(i.themeMixin,i.observeAttributesMixin)(e)){syncFlowTheme(e){e.theme=this.theme,this.observeAttributes(["theme"],(()=>{e.theme=this.theme}))}}));const q=t.createSingletonMixin((s=>{var a,n,l;return l=class extends(t.compose(i.loggerMixin,i.initLifecycleMixin,i.descopeUiMixin,i.initElementMixin,i.createFetchWidgetPagesMixin("tenant-profile-widget"),E)(s)){constructor(){super(...arguments),a.add(this)}onWidgetRootReady(){return e.__awaiter(this,void 0,void 0,(function*(){}))}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this);try{yield Promise.all([this.actions.getMe(),this.actions.getTenant()]);const e=f(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:e})}catch(e){}const s=this.state.me.error||(e=>e.tenant.error)(this.state)||(e=>e.tenantAdminLinkSSO.error)(this.state);if(s){this.contentRootElement.innerHTML="";const e="object"==typeof s&&null!==s&&"message"in s?s.message:String(s)||"An error occurred";this.contentRootElement.append(function({mainMessage:e="An error occurred"}){const t=document.createElement("div");t.setAttribute("data-id","widget-error"),t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="center",t.style.justifyContent="center",t.style.padding="72px 36px",t.style.background="#fff",t.style.borderRadius="12px",t.style.boxShadow="0 2px 8px rgba(0,0,0,0.03)",t.style.margin="32px auto",t.style.maxWidth="400px";const i=document.createElement("div");i.innerHTML='\n <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="20" cy="20" r="18" stroke="#FF3B3B" stroke-width="3" fill="#fff"/>\n <text x="20" y="27" text-anchor="middle" font-size="24" font-family="Arial, sans-serif" fill="#FF3B3B">!</text>\n </svg>\n ',i.style.marginBottom="12px",t.appendChild(i);const s=document.createElement("div");return s.textContent=e,s.style.fontWeight="bold",s.style.fontSize="20px",s.style.color="#222",s.style.textAlign="center",s.style.marginTop="8px",t.appendChild(s),t}({mainMessage:e}))}else yield e.__classPrivateFieldGet(this,a,"m",n).call(this),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},a=new WeakSet,n=function(){return e.__awaiter(this,void 0,void 0,(function*(){const e=t.createTemplate(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},l})),$=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h,v,u,g,p,w;return w=class extends(t.compose(L,E,i.modalMixin,i.loggerMixin,q)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),r.set(this,void 0),d.set(this,void 0),c.set(this,void 0)}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldSet(this,l,new a.MultiSsoConfigurationsDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("descope-multi-sso")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").isExists&&(e.__classPrivateFieldGet(this,n,"m",p).call(this),e.__classPrivateFieldGet(this,l,"f").data=_(this.state),this.subscribe((t=>{e.__classPrivateFieldGet(this,l,"f").data=t}),_))}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,d=new WeakMap,c=new WeakMap,n=new WeakSet,h=function(){e.__classPrivateFieldSet(this,o,this.createModal({"data-id":"multi-sso-create-modal"}),"f"),e.__classPrivateFieldSet(this,r,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),this.syncFlowTheme(e.__classPrivateFieldGet(this,r,"f"))},v=function(){e.__classPrivateFieldSet(this,d,this.createModal({"data-id":"multi-sso-delete-modal"}),"f"),e.__classPrivateFieldSet(this,c,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f"))},u=function(t){e.__classPrivateFieldGet(this,o,"f").setContent(m({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,tenant:this.tenantId})),e.__classPrivateFieldGet(this,o,"f").open(),e.__classPrivateFieldGet(this,r,"f").onSuccess((()=>e.__awaiter(this,void 0,void 0,(function*(){e.__classPrivateFieldGet(this,o,"f").close(),yield this.actions.getTenant();const t=f(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:t})}))))},g=function(t,i){e.__classPrivateFieldGet(this,d,"f").setContent(m({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,tenant:this.tenantId,form:JSON.stringify({deleteSSOConfigurationId:i})})),e.__classPrivateFieldGet(this,d,"f").open(),e.__classPrivateFieldGet(this,c,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,d,"f").close(),this.actions.getTenant()}))},p=function(){const{createFlowId:t,deleteFlowId:i}=e.__classPrivateFieldGet(this,l,"f");i&&(e.__classPrivateFieldGet(this,n,"m",v).call(this),e.__classPrivateFieldGet(this,l,"f").onDeleteClicked((({id:t})=>e.__classPrivateFieldGet(this,n,"m",g).call(this,i,t)))),t&&(e.__classPrivateFieldGet(this,n,"m",h).call(this),e.__classPrivateFieldGet(this,l,"f").onCreateClicked((()=>e.__classPrivateFieldGet(this,n,"m",u).call(this,t))))},w})),B=t.createSingletonMixin((s=>{var n,l,o,d;return d=class extends(t.compose(L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),o.set(this,t.withMemCache((e=>{this.tenantAdminLinkSSODriver.href=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",l).call(this),e.__classPrivateFieldGet(this,o,"f").call(this,r(this.state)),this.subscribe(e.__classPrivateFieldGet(this,o,"f").bind(this),r)}))}},o=new WeakMap,n=new WeakSet,l=function(){this.tenantAdminLinkSSODriver=new a.LinkDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-link[data-id="tenant-admin-link-sso"]')}),{logger:this.logger})},d}));var J;!function(e){e.TEXT="text",e.NUMBER="number",e.BOOLEAN="boolean",e.SINGLE_SELECT="singleSelect",e.ARRAY="array",e.DATE="date"}(J||(J={}));const H=t.createSingletonMixin((s=>{var n,l,o,r,c,h,v,u,_,f,g;return g=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,{}),o.set(this,{}),r.set(this,{}),c.set(this,{}),u.set(this,t.withMemCache((t=>{var i;const s=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll('descope-user-attribute[data-id^="customAttributes."]');Array.from(s).forEach((i=>{const s=i.getAttribute("data-id").replace("customAttributes.",""),l=i.getAttribute("data-type")||J.TEXT,o=t[s],r=new a.UserAttributeDriver(i,{logger:this.logger});r.value=((e,t)=>e===J.DATE&&t?new Date(t).toLocaleString():e===J.BOOLEAN&&void 0!==t?t?"True":"False":(t||"").toString())(l,o),e.__classPrivateFieldGet(this,n,"m",_).call(this,i,s,r,l,s),e.__classPrivateFieldGet(this,n,"m",f).call(this,i,s,r)}))})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,u,"f").call(this,d(this.state)),this.subscribe(e.__classPrivateFieldGet(this,u,"f").bind(this),d)}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,c=new WeakMap,u=new WeakMap,n=new WeakSet,h=function(t,i,s){var a,n;const r=d(this.state)[s],c=i===J.ARRAY?(r||[]).join(","):r;null===(a=e.__classPrivateFieldGet(this,l,"f")[t])||void 0===a||a.setContent(m({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({customAttributes:{[s]:c}})})),null===(n=e.__classPrivateFieldGet(this,o,"f")[t])||void 0===n||n.onSuccess((()=>{var i;null===(i=e.__classPrivateFieldGet(this,l,"f")[t])||void 0===i||i.close(),this.actions.getTenant()}))},v=function(t){var i,s;null===(i=e.__classPrivateFieldGet(this,r,"f")[t])||void 0===i||i.setContent(m({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),null===(s=e.__classPrivateFieldGet(this,c,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e.__classPrivateFieldGet(this,r,"f")[t])||void 0===i||i.close(),this.actions.getTenant()}))},_=function(t,i,s,r,d){const c=t.getAttribute("edit-flow-id");c&&(e.__classPrivateFieldGet(this,l,"f")[c]||(e.__classPrivateFieldGet(this,l,"f")[c]=this.createModal({"data-id":`edit-${i}`}),e.__classPrivateFieldGet(this,o,"f")[c]=new a.FlowDriver((()=>{var t,i;return null===(i=null===(t=e.__classPrivateFieldGet(this,l,"f")[c])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e.__classPrivateFieldGet(this,l,"f")[c].beforeOpen=e.__classPrivateFieldGet(this,n,"m",h).bind(this,c,r,d),s.onEditClick((()=>{var t,i;null===(i=null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t?void 0:t[c])||void 0===i||i.open()})),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")[c])))},f=function(t,i,s){const l=t.getAttribute("delete-flow-id");l&&(e.__classPrivateFieldGet(this,r,"f")[l]||(e.__classPrivateFieldGet(this,r,"f")[l]=this.createModal({"data-id":`delete-${i}`}),e.__classPrivateFieldGet(this,c,"f")[l]=new a.FlowDriver((()=>{var t,i;return null===(i=null===(t=e.__classPrivateFieldGet(this,r,"f")[l])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e.__classPrivateFieldGet(this,r,"f")[l].beforeOpen=e.__classPrivateFieldGet(this,n,"m",v).bind(this,l),s.onDeleteClick((()=>{var t,i;null===(i=null===(t=e.__classPrivateFieldGet(this,r,"f"))||void 0===t?void 0:t[l])||void 0===i||i.open()})),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f")[l])))},g})),Y=t.createSingletonMixin((s=>{var n,l,o,r,d,c,v,u,_,f,g,p;return p=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),r.set(this,void 0),d.set(this,void 0),g.set(this,t.withMemCache((e=>{this.tenantEmailDomainsDriver.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",f).call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,h(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),h)}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,d=new WeakMap,g=new WeakMap,n=new WeakSet,c=function(){this.tenantEmailDomainsDriver.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-tenant-email-domains"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",v).bind(this),e.__classPrivateFieldGet(this,n,"m",v).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},v=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantEmailDomainsDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({tenantEmailDomains:h(this.state)})})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},u=function(){this.tenantEmailDomainsDriver.deleteFlowId&&(e.__classPrivateFieldSet(this,r,this.createModal({"data-id":"delete-tenant-email-domains"}),"f"),e.__classPrivateFieldSet(this,d,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,r,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",_).bind(this),e.__classPrivateFieldGet(this,n,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},_=function(){e.__classPrivateFieldGet(this,r,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantEmailDomainsDriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,r,"f").close(),this.actions.getTenant()}))},f=function(){this.tenantEmailDomainsDriver=new a.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="tenant-email-domains-edit"]')}),{logger:this.logger}),this.tenantEmailDomainsDriver.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.tenantEmailDomainsDriver.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,r,"f"))||void 0===t||t.open()}))},p})),z=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h,u,_,f,g,p;return p=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),r.set(this,void 0),d.set(this,void 0),g.set(this,t.withMemCache((e=>{this.tenantSSOExclusionsDriver.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",f).call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,v(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),v)}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,d=new WeakMap,g=new WeakMap,n=new WeakSet,c=function(){this.tenantSSOExclusionsDriver.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-tenant-sso-exclusions"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",h).bind(this),e.__classPrivateFieldGet(this,n,"m",h).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},h=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantSSOExclusionsDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({enforceSSOExclusions:v(this.state)})})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},u=function(){this.tenantSSOExclusionsDriver.deleteFlowId&&(e.__classPrivateFieldSet(this,r,this.createModal({"data-id":"delete-tenant-sso-exclusions"}),"f"),e.__classPrivateFieldSet(this,d,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,r,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",_).bind(this),e.__classPrivateFieldGet(this,n,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},_=function(){e.__classPrivateFieldGet(this,r,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantSSOExclusionsDriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,r,"f").close(),this.actions.getTenant()}))},f=function(){this.tenantSSOExclusionsDriver=new a.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="tenant-force-sso-exclusions-edit"]')}),{logger:this.logger}),this.tenantSSOExclusionsDriver.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.tenantSSOExclusionsDriver.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,r,"f"))||void 0===t||t.open()}))},p})),X=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h,v,_,f,g,p;return p=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),r.set(this,void 0),d.set(this,void 0),g.set(this,t.withMemCache((e=>{this.tenantEnforceSSODriver.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",f).call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",v).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,u(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),u)}))}},l=new WeakMap,o=new WeakMap,r=new WeakMap,d=new WeakMap,g=new WeakMap,n=new WeakSet,c=function(){this.tenantEnforceSSODriver.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-tenant-enforce-sso"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",h).bind(this),e.__classPrivateFieldGet(this,n,"m",h).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},h=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantEnforceSSODriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({enforceSSO:u(this.state)})})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},v=function(){this.tenantEnforceSSODriver.deleteFlowId&&(e.__classPrivateFieldSet(this,r,this.createModal({"data-id":"delete-tenant-enforce-sso"}),"f"),e.__classPrivateFieldSet(this,d,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,r,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",_).bind(this),e.__classPrivateFieldGet(this,n,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},_=function(){e.__classPrivateFieldGet(this,r,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantEnforceSSODriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,r,"f").close(),this.actions.getTenant()}))},f=function(){this.tenantEnforceSSODriver=new a.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="tenant-enforce-sso-edit"]')}),{logger:this.logger}),this.tenantEnforceSSODriver.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.tenantEnforceSSODriver.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,r,"f"))||void 0===t||t.open()}))},p})),K=t.createSingletonMixin((s=>{var n,l,o,r,d,h,v,u;return u=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0),v.set(this,t.withMemCache((e=>{this.tenantNameDriver.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",h).call(this),e.__classPrivateFieldGet(this,n,"m",r).call(this),e.__classPrivateFieldGet(this,v,"f").call(this,c(this.state)),this.subscribe(e.__classPrivateFieldGet(this,v,"f").bind(this),c)}))}},l=new WeakMap,o=new WeakMap,v=new WeakMap,n=new WeakSet,r=function(){this.tenantNameDriver.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"tenant-profile-set-name"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").beforeOpen=e.__classPrivateFieldGet(this,n,"m",d).bind(this),e.__classPrivateFieldGet(this,n,"m",d).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},d=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.tenantNameDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({tenantName:c(this.state)})})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},h=function(){this.tenantNameDriver=new a.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="tenant-name-edit"]')}),{logger:this.logger}),this.tenantNameDriver.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},u})),Q=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h;return h=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0)}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",r).call(this)}))}},l=new WeakMap,o=new WeakMap,n=new WeakSet,r=function(){this.TenantPasswordPolicyUserAuthMethodDriver.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"password-policy"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,n,"m",d).bind(this),e.__classPrivateFieldGet(this,n,"m",d).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},d=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.TenantPasswordPolicyUserAuthMethodDriver.flowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},c=function(){this.TenantPasswordPolicyUserAuthMethodDriver=new a.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="password-policy"]')}),{logger:this.logger}),this.TenantPasswordPolicyUserAuthMethodDriver.onUnfulfilledButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},h})),V=t.createSingletonMixin((s=>{var n,l,o,r,d,c,h;return h=class extends(t.compose(i.localeMixin,L,E,i.loggerMixin,q,i.cookieConfigMixin,i.modalMixin)(s)){constructor(){super(...arguments),n.add(this),l.set(this,void 0),o.set(this,void 0)}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,n,"m",c).call(this),e.__classPrivateFieldGet(this,n,"m",r).call(this)}))}},l=new WeakMap,o=new WeakMap,n=new WeakSet,r=function(){this.TenantSessionSettingsUserAuthMethodDriver.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"session-settings"}),"f"),e.__classPrivateFieldSet(this,o,new a.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,n,"m",d).bind(this),e.__classPrivateFieldGet(this,n,"m",d).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,o,"f")))},d=function(){e.__classPrivateFieldGet(this,l,"f").setContent(m({locale:this.locale,projectId:this.projectId,flowId:this.TenantSessionSettingsUserAuthMethodDriver.flowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,o,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getTenant()}))},c=function(){this.TenantSessionSettingsUserAuthMethodDriver=new a.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="session-settings"]')}),{logger:this.logger}),this.TenantSessionSettingsUserAuthMethodDriver.onUnfulfilledButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},h})),Z=t.createSingletonMixin((s=>class extends(t.compose(i.debuggerMixin,i.themeMixin,N,q,K,Y,z,X,H,B,Q,V,$)(s)){init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var e;yield null===(e=t.init)||void 0===e?void 0:e.call(this)}))}})),ee=t.compose((t=>class extends(Z(t)){init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var e;yield null===(e=t.init)||void 0===e?void 0:e.call(this);(customElements.get("descope-wc")||(yield import("@descope/web-component").then((e=>e.default)))).sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"tenant-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.7.2"}}}))}}))(HTMLElement);customElements.define("descope-tenant-profile-widget",ee),module.exports=ee;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* @descope/tenant-profile-widget v0.7.
|
|
3
|
+
* @descope/tenant-profile-widget v0.7.2
|
|
4
4
|
*/
|
|
5
|
-
import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createTemplate as s,kebabCase as n,createSingletonMixin as o,compose as a,withMemCache as r}from"@descope/sdk-helpers";import{projectIdMixin as l,observeAttributesMixin as d,loggerMixin as h,baseUrlMixin as c,cookieConfigMixin as u,DEFAULT_STYLE_ID as f,createStateManagementMixin as v,initLifecycleMixin as m,localeMixin as g,modalMixin as p,themeMixin as w,descopeUiMixin as b,initElementMixin as y,createFetchWidgetPagesMixin as S,debuggerMixin as k}from"@descope/sdk-mixins";import{createSelector as I}from"reselect";import{FlowDriver as C,MultiSsoConfigurationsDriver as U,LinkDriver as R,UserAttributeDriver as W,UserAuthMethodDriver as O}from"@descope/sdk-component-drivers";import{createAsyncThunk as T}from"@reduxjs/toolkit";import"@descope/core-js-sdk";import x from"@descope/web-js-sdk";import"@descope/web-component";const M=t=>t.tenant.data,D=t=>t.tenantAdminLinkSSO.data.defaultLink,E=I(M,(t=>t.customAttributes||{})),j=I(M,(t=>t.name||"")),A=I(M,(t=>t.selfProvisioningDomains||[])),N=I(M,(t=>t.enforceSSOExclusions||[])),F=I(M,(t=>t.enforceSSO||!1)),L=I(M,D,(t=>t.tenantAdminLinkSSO.data.ssoIdToLink),((t,e,i)=>[...t?[{id:"",name:"Default SSO Configuration",authType:t.authType,isDefault:!0,link:e}]:[],...((null==t?void 0:t.additionalSSOConfigs)||[]).map((({ssoId:t,name:e,authType:s})=>({id:t,name:e,authType:s,link:i[t]||""})))])),q=I(M,(t=>((null==t?void 0:t.additionalSSOConfigs)||[]).map((({ssoId:t})=>t)))),P=(t={})=>{const e=s("<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 B=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)}))}))},J=t=>({onFulfilled:e=>{t(e).loading=!1},onPending:e=>{t(e).loading=!0,t(e).error=null},onRejected:(e,i)=>{t(e).loading=!1,t(e).error=i.error}}),H=T("users/me",((t,{extra:{api:e}})=>e.user.me())),_=B(H)({onFulfilled:(t,e)=>{t.me.data=e.payload}},J((t=>t.me))),z={action:H,reducer:_},X=T("tenant/details",((t,{extra:{api:e}})=>e.tenant.details())),Y=B(X)({onFulfilled:(t,e)=>{t.tenant.data=e.payload}},J((t=>t.tenant))),G={action:X,reducer:Y},K=T("tenant/adminLinkSso",(({ssoIds:t},{extra:{api:e}})=>e.tenant.adminLinkSso({ssoIds:t}))),Q={action:K,reducer:B(K)({onFulfilled:(t,e)=>{var i;t.tenantAdminLinkSSO.data=null!==(i=e.payload)&&void 0!==i?i:{defaultLink:"",ssoIdToLink:{}}}},J((t=>t.tenantAdminLinkSSO)))},V={me:{loading:!1,error:null,data:{}},tenant:{loading:!1,error:null,data:{}},tenantAdminLinkSSO:{loading:!1,error:null,data:{defaultLink:"",ssoIdToLink:{}}}},Z={me:"/v1/auth/me"},tt={details:"/v1/mgmt/tenant",adminLinkSso:"/v1/mgmt/tenant/adminlinks/sso/authenticated/batch"},et=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)})),it=()=>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})}))})),st=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({tenantId:"tenant-1",roleNames:["admin"],id:"tenant-1",name:"Test Tenant",selfProvisioningDomains:["example1.com","example2.com"],customAttributes:{},authType:"password",domains:[],createdTime:Date.now(),disabled:!1,enforceSSO:!0})}))})),nt=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({defaultLink:"_blank",ssoIdToLink:{"okta-prod":"_blank?ssoId=okta-prod","entra-eu":"_blank?ssoId=entra-eu"}})}))})),ot=({httpClient:e,tenantId:i,mock:s})=>{const n=encodeURIComponent(i||""),o=`?tenant=${n}&id=${n}`;return{details:()=>t(void 0,void 0,void 0,(function*(){if(s)return st();if(!i)throw new Error("tenantId is not defined");const t=`${tt.details}${o}`,n=yield e.get(t);yield et(n);return yield n.json()})),adminLinkSso:o=>t(void 0,[o],void 0,(function*({ssoIds:t}){if(s)return nt();if(!i)throw new Error("tenantId is not defined");const o=yield e.post(`${tt.adminLinkSso}?tenant=${n}`,{tenantId:n,ssoIds:t},{headers:{"Content-Type":"application/json"}});yield et(o);return yield o.json()}))}},at=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return it();const t=yield e.get(Z.me);return yield et(t),t.json()}))}),rt=o((s=>{var n,o,r,v;const m=a(l,d,h,c,u)(s);return v=class extends m{constructor(){super(...arguments),n.add(this),o.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get tenantId(){return this.getAttribute("tenant")}get mock(){return this.getAttribute("mock")}get styleId(){return this.getAttribute("style-id")||f}get api(){return e(this,o,"f")||e(this,n,"m",r).call(this),e(this,o,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),this.observeAttributes(["project-id","base-url","tenant","mock"],(()=>{e(this,o,"f")&&e(this,n,"m",r).call(this)}))}))}},o=new WeakMap,n=new WeakSet,r=function(){this.logger.debug("creating an sdk instance"),i(this,o,((t,e,i,s)=>{const n=x(Object.assign(Object.assign({},t),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"tenant-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.7.0"}}));return{user:at({httpClient:n.httpClient,mock:i}),tenant:ot({httpClient:n.httpClient,tenantId:e,mock:i})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},v})),lt=o((t=>{const e=a(v({name:"widget",initialState:V,reducers:{},extraReducers:t=>{z.reducer(t),G.reducer(t),Q.reducer(t)},asyncActions:{getMe:z.action,getTenant:G.action,getTenantAdminLinkSSO:Q.action}}),m,h,rt)(t);return class extends e{constructor(...t){super(...t),this.state=V,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),dt="widget-flow",ht=o((i=>{var s,n,o;return o=class extends(a(g,m,p,lt,u,h,w)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this);const o=$(dt);o&&(!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",n).call(this,o))}))}},s=new WeakSet,n=function(e){const i=this.createModal({"data-id":"redirect-flow"});i.setContent(P({locale:this.locale,projectId:this.projectId,flowId:e,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId}));new C((()=>{var t;return null===(t=i.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>t(this,void 0,void 0,(function*(){i.close(),this.actions.getMe(),yield this.actions.getTenant();const t=q(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:t})})))),i.afterClose=()=>{i.remove()},i.open()},o})),ct=o((t=>class extends(a(w,d)(t)){syncFlowTheme(t){t.theme=this.theme,this.observeAttributes(["theme"],(()=>{t.theme=this.theme}))}}));const ut=o((i=>{var n,o,r;return r=class extends(a(h,m,b,y,S("tenant-profile-widget"),lt)(i)){constructor(){super(...arguments),n.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this);try{yield Promise.all([this.actions.getMe(),this.actions.getTenant()]);const t=q(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:t})}catch(t){}const s=this.state.me.error||(t=>t.tenant.error)(this.state)||(t=>t.tenantAdminLinkSSO.error)(this.state);if(s){this.contentRootElement.innerHTML="";const t="object"==typeof s&&null!==s&&"message"in s?s.message:String(s)||"An error occurred";this.contentRootElement.append(function({mainMessage:t="An error occurred"}){const e=document.createElement("div");e.setAttribute("data-id","widget-error"),e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.justifyContent="center",e.style.padding="72px 36px",e.style.background="#fff",e.style.borderRadius="12px",e.style.boxShadow="0 2px 8px rgba(0,0,0,0.03)",e.style.margin="32px auto",e.style.maxWidth="400px";const i=document.createElement("div");i.innerHTML='\n <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="20" cy="20" r="18" stroke="#FF3B3B" stroke-width="3" fill="#fff"/>\n <text x="20" y="27" text-anchor="middle" font-size="24" font-family="Arial, sans-serif" fill="#FF3B3B">!</text>\n </svg>\n ',i.style.marginBottom="12px",e.appendChild(i);const s=document.createElement("div");return s.textContent=t,s.style.fontWeight="bold",s.style.fontSize="20px",s.style.color="#222",s.style.textAlign="center",s.style.marginTop="8px",e.appendChild(s),e}({mainMessage:t}))}else yield e(this,n,"m",o).call(this),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},n=new WeakSet,o=function(){return t(this,void 0,void 0,(function*(){const t=s(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},r})),ft=o((s=>{var n,o,r,l,d,c,u,f,v,m,g,w;return w=class extends(a(ct,lt,p,h,ut)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),d.set(this,void 0),c.set(this,void 0)}onWidgetRootReady(){const s=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=s.onWidgetRootReady)||void 0===t?void 0:t.call(this),i(this,o,new U((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-multi-sso")}),{logger:this.logger}),"f"),e(this,o,"f").isExists&&(e(this,n,"m",g).call(this),e(this,o,"f").data=L(this.state),this.subscribe((t=>{e(this,o,"f").data=t}),L))}))}},o=new WeakMap,r=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,n=new WeakSet,u=function(){i(this,r,this.createModal({"data-id":"multi-sso-create-modal"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),this.syncFlowTheme(e(this,l,"f"))},f=function(){i(this,d,this.createModal({"data-id":"multi-sso-delete-modal"}),"f"),i(this,c,new C((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),this.syncFlowTheme(e(this,c,"f"))},v=function(i){e(this,r,"f").setContent(P({projectId:this.projectId,flowId:i,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,tenant:this.tenantId})),e(this,r,"f").open(),e(this,l,"f").onSuccess((()=>t(this,void 0,void 0,(function*(){e(this,r,"f").close(),yield this.actions.getTenant();const t=q(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:t})}))))},m=function(t,i){e(this,d,"f").setContent(P({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,tenant:this.tenantId,form:JSON.stringify({deleteSSOConfigurationId:i})})),e(this,d,"f").open(),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getTenant()}))},g=function(){const{createFlowId:t,deleteFlowId:i}=e(this,o,"f");i&&(e(this,n,"m",f).call(this),e(this,o,"f").onDeleteClicked((({id:t})=>e(this,n,"m",m).call(this,i,t)))),t&&(e(this,n,"m",u).call(this),e(this,o,"f").onCreateClicked((()=>e(this,n,"m",v).call(this,t))))},w})),vt=o((i=>{var s,n,o,l;return l=class extends(a(ct,lt,h,ut,u,p)(i)){constructor(){super(...arguments),s.add(this),o.set(this,r((t=>{this.tenantAdminLinkSSODriver.href=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,s,"m",n).call(this),e(this,o,"f").call(this,D(this.state)),this.subscribe(e(this,o,"f").bind(this),D)}))}},o=new WeakMap,s=new WeakSet,n=function(){this.tenantAdminLinkSSODriver=new R((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-link[data-id="tenant-admin-link-sso"]')}),{logger:this.logger})},l}));var mt;!function(t){t.TEXT="text",t.NUMBER="number",t.BOOLEAN="boolean",t.SINGLE_SELECT="singleSelect",t.ARRAY="array",t.DATE="date"}(mt||(mt={}));const gt=o((i=>{var s,n,o,l,d,c,f,v,m,w,b;return b=class extends(a(g,ct,lt,h,ut,u,p)(i)){constructor(){super(...arguments),s.add(this),n.set(this,{}),o.set(this,{}),l.set(this,{}),d.set(this,{}),v.set(this,r((t=>{var i;const n=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll('descope-user-attribute[data-id^="customAttributes."]');Array.from(n).forEach((i=>{const n=i.getAttribute("data-id").replace("customAttributes.",""),o=i.getAttribute("data-type")||mt.TEXT,a=t[n],r=new W(i,{logger:this.logger});r.value=((t,e)=>t===mt.DATE&&e?new Date(e).toLocaleString():t===mt.BOOLEAN&&void 0!==e?e?"True":"False":(e||"").toString())(o,a),e(this,s,"m",m).call(this,i,n,r,o,n),e(this,s,"m",w).call(this,i,n,r)}))})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,v,"f").call(this,E(this.state)),this.subscribe(e(this,v,"f").bind(this),E)}))}},n=new WeakMap,o=new WeakMap,l=new WeakMap,d=new WeakMap,v=new WeakMap,s=new WeakSet,c=function(t,i,s){var a,r;const l=E(this.state)[s],d=i===mt.ARRAY?(l||[]).join(","):l;null===(a=e(this,n,"f")[t])||void 0===a||a.setContent(P({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({customAttributes:{[s]:d}})})),null===(r=e(this,o,"f")[t])||void 0===r||r.onSuccess((()=>{var i;null===(i=e(this,n,"f")[t])||void 0===i||i.close(),this.actions.getTenant()}))},f=function(t){var i,s;null===(i=e(this,l,"f")[t])||void 0===i||i.setContent(P({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),null===(s=e(this,d,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e(this,l,"f")[t])||void 0===i||i.close(),this.actions.getTenant()}))},m=function(t,i,a,r,l){const d=t.getAttribute("edit-flow-id");d&&(e(this,n,"f")[d]||(e(this,n,"f")[d]=this.createModal({"data-id":`edit-${i}`}),e(this,o,"f")[d]=new C((()=>{var t,i;return null===(i=null===(t=e(this,n,"f")[d])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e(this,n,"f")[d].beforeOpen=e(this,s,"m",c).bind(this,d,r,l),a.onEditClick((()=>{var t,i;null===(i=null===(t=e(this,n,"f"))||void 0===t?void 0:t[d])||void 0===i||i.open()})),this.syncFlowTheme(e(this,o,"f")[d])))},w=function(t,i,n){const o=t.getAttribute("delete-flow-id");o&&(e(this,l,"f")[o]||(e(this,l,"f")[o]=this.createModal({"data-id":`delete-${i}`}),e(this,d,"f")[o]=new C((()=>{var t,i;return null===(i=null===(t=e(this,l,"f")[o])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e(this,l,"f")[o].beforeOpen=e(this,s,"m",f).bind(this,o),n.onDeleteClick((()=>{var t,i;null===(i=null===(t=e(this,l,"f"))||void 0===t?void 0:t[o])||void 0===i||i.open()})),this.syncFlowTheme(e(this,d,"f")[o])))},b})),pt=o((s=>{var n,o,l,d,c,f,v,m,w,b,y,S;return S=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),l.set(this,void 0),d.set(this,void 0),c.set(this,void 0),y.set(this,r((t=>{this.tenantEmailDomainsDriver.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",b).call(this),e(this,n,"m",f).call(this),e(this,n,"m",m).call(this),e(this,y,"f").call(this,A(this.state)),this.subscribe(e(this,y,"f").bind(this),A)}))}},o=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,n=new WeakSet,f=function(){this.tenantEmailDomainsDriver.editFlowId&&(i(this,o,this.createModal({"data-id":"edit-tenant-email-domains"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").beforeOpen=e(this,n,"m",v).bind(this),e(this,n,"m",v).call(this),this.syncFlowTheme(e(this,l,"f")))},v=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantEmailDomainsDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({tenantEmailDomains:A(this.state)})})),e(this,l,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},m=function(){this.tenantEmailDomainsDriver.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-tenant-email-domains"}),"f"),i(this,c,new C((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").beforeOpen=e(this,n,"m",w).bind(this),e(this,n,"m",w).call(this),this.syncFlowTheme(e(this,c,"f")))},w=function(){e(this,d,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantEmailDomainsDriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getTenant()}))},b=function(){this.tenantEmailDomainsDriver=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="tenant-email-domains-edit"]')}),{logger:this.logger}),this.tenantEmailDomainsDriver.onEditClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()})),this.tenantEmailDomainsDriver.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},S})),wt=o((s=>{var n,o,l,d,c,f,v,m,w,b,y,S;return S=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),l.set(this,void 0),d.set(this,void 0),c.set(this,void 0),y.set(this,r((t=>{this.tenantSSOExclusionsDriver.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",b).call(this),e(this,n,"m",f).call(this),e(this,n,"m",m).call(this),e(this,y,"f").call(this,N(this.state)),this.subscribe(e(this,y,"f").bind(this),N)}))}},o=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,n=new WeakSet,f=function(){this.tenantSSOExclusionsDriver.editFlowId&&(i(this,o,this.createModal({"data-id":"edit-tenant-sso-exclusions"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").beforeOpen=e(this,n,"m",v).bind(this),e(this,n,"m",v).call(this),this.syncFlowTheme(e(this,l,"f")))},v=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantSSOExclusionsDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({enforceSSOExclusions:N(this.state)})})),e(this,l,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},m=function(){this.tenantSSOExclusionsDriver.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-tenant-sso-exclusions"}),"f"),i(this,c,new C((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").beforeOpen=e(this,n,"m",w).bind(this),e(this,n,"m",w).call(this),this.syncFlowTheme(e(this,c,"f")))},w=function(){e(this,d,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantSSOExclusionsDriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getTenant()}))},b=function(){this.tenantSSOExclusionsDriver=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="tenant-force-sso-exclusions-edit"]')}),{logger:this.logger}),this.tenantSSOExclusionsDriver.onEditClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()})),this.tenantSSOExclusionsDriver.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},S})),bt=o((s=>{var n,o,l,d,c,f,v,m,w,b,y,S;return S=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),l.set(this,void 0),d.set(this,void 0),c.set(this,void 0),y.set(this,r((t=>{this.tenantEnforceSSODriver.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",b).call(this),e(this,n,"m",f).call(this),e(this,n,"m",m).call(this),e(this,y,"f").call(this,F(this.state)),this.subscribe(e(this,y,"f").bind(this),F)}))}},o=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,n=new WeakSet,f=function(){this.tenantEnforceSSODriver.editFlowId&&(i(this,o,this.createModal({"data-id":"edit-tenant-enforce-sso"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").beforeOpen=e(this,n,"m",v).bind(this),e(this,n,"m",v).call(this),this.syncFlowTheme(e(this,l,"f")))},v=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantEnforceSSODriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({enforceSSO:F(this.state)})})),e(this,l,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},m=function(){this.tenantEnforceSSODriver.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-tenant-enforce-sso"}),"f"),i(this,c,new C((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").beforeOpen=e(this,n,"m",w).bind(this),e(this,n,"m",w).call(this),this.syncFlowTheme(e(this,c,"f")))},w=function(){e(this,d,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantEnforceSSODriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getTenant()}))},b=function(){this.tenantEnforceSSODriver=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="tenant-enforce-sso-edit"]')}),{logger:this.logger}),this.tenantEnforceSSODriver.onEditClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()})),this.tenantEnforceSSODriver.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},S})),yt=o((s=>{var n,o,l,d,c,f,v,m;return m=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),l.set(this,void 0),v.set(this,r((t=>{this.tenantNameDriver.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",f).call(this),e(this,n,"m",d).call(this),e(this,v,"f").call(this,j(this.state)),this.subscribe(e(this,v,"f").bind(this),j)}))}},o=new WeakMap,l=new WeakMap,v=new WeakMap,n=new WeakSet,d=function(){this.tenantNameDriver.editFlowId&&(i(this,o,this.createModal({"data-id":"tenant-profile-set-name"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").beforeOpen=e(this,n,"m",c).bind(this),e(this,n,"m",c).call(this),this.syncFlowTheme(e(this,l,"f")))},c=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantNameDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({tenantName:j(this.state)})})),e(this,l,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},f=function(){this.tenantNameDriver=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="tenant-name-edit"]')}),{logger:this.logger}),this.tenantNameDriver.onEditClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()}))},m})),St=o((s=>{var n,o,r,l,d,c,f;return f=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),r.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",c).call(this),e(this,n,"m",l).call(this)}))}},o=new WeakMap,r=new WeakMap,n=new WeakSet,l=function(){this.TenantPasswordPolicyUserAuthMethodDriver.flowId&&(i(this,o,this.createModal({"data-id":"password-policy"}),"f"),i(this,r,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").afterClose=e(this,n,"m",d).bind(this),e(this,n,"m",d).call(this),this.syncFlowTheme(e(this,r,"f")))},d=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.TenantPasswordPolicyUserAuthMethodDriver.flowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,r,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},c=function(){this.TenantPasswordPolicyUserAuthMethodDriver=new O((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password-policy"]')}),{logger:this.logger}),this.TenantPasswordPolicyUserAuthMethodDriver.onUnfulfilledButtonClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()}))},f})),kt=o((s=>{var n,o,r,l,d,c,f;return f=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),r.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",c).call(this),e(this,n,"m",l).call(this)}))}},o=new WeakMap,r=new WeakMap,n=new WeakSet,l=function(){this.TenantSessionSettingsUserAuthMethodDriver.flowId&&(i(this,o,this.createModal({"data-id":"session-settings"}),"f"),i(this,r,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").afterClose=e(this,n,"m",d).bind(this),e(this,n,"m",d).call(this),this.syncFlowTheme(e(this,r,"f")))},d=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.TenantSessionSettingsUserAuthMethodDriver.flowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,r,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},c=function(){this.TenantSessionSettingsUserAuthMethodDriver=new O((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="session-settings"]')}),{logger:this.logger}),this.TenantSessionSettingsUserAuthMethodDriver.onUnfulfilledButtonClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()}))},f})),It=o((e=>class extends(a(k,w,ht,ut,yt,pt,wt,bt,gt,vt,St,kt,ft)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),Ct=a((e=>class extends(It(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this);(customElements.get("descope-wc")||(yield import("@descope/web-component").then((t=>t.default)))).sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"tenant-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.7.0"}}}))}}))(HTMLElement);customElements.define("descope-tenant-profile-widget",Ct);export{Ct as default};
|
|
5
|
+
import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createTemplate as s,kebabCase as n,createSingletonMixin as o,compose as a,withMemCache as r}from"@descope/sdk-helpers";import{projectIdMixin as l,observeAttributesMixin as d,loggerMixin as h,baseUrlMixin as c,cookieConfigMixin as u,DEFAULT_STYLE_ID as f,createStateManagementMixin as v,initLifecycleMixin as m,localeMixin as g,modalMixin as p,themeMixin as w,descopeUiMixin as b,initElementMixin as y,createFetchWidgetPagesMixin as S,debuggerMixin as k}from"@descope/sdk-mixins";import{createSelector as I}from"reselect";import{FlowDriver as C,MultiSsoConfigurationsDriver as U,LinkDriver as R,UserAttributeDriver as W,UserAuthMethodDriver as O}from"@descope/sdk-component-drivers";import{createAsyncThunk as T}from"@reduxjs/toolkit";import"@descope/core-js-sdk";import x from"@descope/web-js-sdk";import"@descope/web-component";const M=t=>t.tenant.data,D=t=>t.tenantAdminLinkSSO.data.defaultLink,E=I(M,(t=>t.customAttributes||{})),j=I(M,(t=>t.name||"")),A=I(M,(t=>t.selfProvisioningDomains||[])),N=I(M,(t=>t.enforceSSOExclusions||[])),F=I(M,(t=>t.enforceSSO||!1)),L=I(M,D,(t=>t.tenantAdminLinkSSO.data.ssoIdToLink),((t,e,i)=>[...t?[{id:"",name:"Default SSO Configuration",authType:t.authType,isDefault:!0,link:e}]:[],...((null==t?void 0:t.additionalSSOConfigs)||[]).map((({ssoId:t,name:e,authType:s})=>({id:t,name:e,authType:s,link:i[t]||""})))])),q=I(M,(t=>((null==t?void 0:t.additionalSSOConfigs)||[]).map((({ssoId:t})=>t)))),P=(t={})=>{const e=s("<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 B=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)}))}))},J=t=>({onFulfilled:e=>{t(e).loading=!1},onPending:e=>{t(e).loading=!0,t(e).error=null},onRejected:(e,i)=>{t(e).loading=!1,t(e).error=i.error}}),H=T("users/me",((t,{extra:{api:e}})=>e.user.me())),_=B(H)({onFulfilled:(t,e)=>{t.me.data=e.payload}},J((t=>t.me))),z={action:H,reducer:_},X=T("tenant/details",((t,{extra:{api:e}})=>e.tenant.details())),Y=B(X)({onFulfilled:(t,e)=>{t.tenant.data=e.payload}},J((t=>t.tenant))),G={action:X,reducer:Y},K=T("tenant/adminLinkSso",(({ssoIds:t},{extra:{api:e}})=>e.tenant.adminLinkSso({ssoIds:t}))),Q={action:K,reducer:B(K)({onFulfilled:(t,e)=>{var i;t.tenantAdminLinkSSO.data=null!==(i=e.payload)&&void 0!==i?i:{defaultLink:"",ssoIdToLink:{}}}},J((t=>t.tenantAdminLinkSSO)))},V={me:{loading:!1,error:null,data:{}},tenant:{loading:!1,error:null,data:{}},tenantAdminLinkSSO:{loading:!1,error:null,data:{defaultLink:"",ssoIdToLink:{}}}},Z={me:"/v1/auth/me"},tt={details:"/v1/mgmt/tenant",adminLinkSso:"/v1/mgmt/tenant/adminlinks/sso/authenticated/batch"},et=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)})),it=()=>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})}))})),st=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({tenantId:"tenant-1",roleNames:["admin"],id:"tenant-1",name:"Test Tenant",selfProvisioningDomains:["example1.com","example2.com"],customAttributes:{},authType:"password",domains:[],createdTime:Date.now(),disabled:!1,enforceSSO:!0})}))})),nt=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({defaultLink:"_blank",ssoIdToLink:{"okta-prod":"_blank?ssoId=okta-prod","entra-eu":"_blank?ssoId=entra-eu"}})}))})),ot=({httpClient:e,tenantId:i,mock:s})=>{const n=encodeURIComponent(i||""),o=`?tenant=${n}&id=${n}`;return{details:()=>t(void 0,void 0,void 0,(function*(){if(s)return st();if(!i)throw new Error("tenantId is not defined");const t=`${tt.details}${o}`,n=yield e.get(t);yield et(n);return yield n.json()})),adminLinkSso:o=>t(void 0,[o],void 0,(function*({ssoIds:t}){if(s)return nt();if(!i)throw new Error("tenantId is not defined");const o=yield e.post(`${tt.adminLinkSso}?tenant=${n}`,{tenantId:n,ssoIds:t},{headers:{"Content-Type":"application/json"}});yield et(o);return yield o.json()}))}},at=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return it();const t=yield e.get(Z.me);return yield et(t),t.json()}))}),rt=o((s=>{var n,o,r,v;const m=a(l,d,h,c,u)(s);return v=class extends m{constructor(){super(...arguments),n.add(this),o.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get tenantId(){return this.getAttribute("tenant")}get mock(){return this.getAttribute("mock")}get styleId(){return this.getAttribute("style-id")||f}get api(){return e(this,o,"f")||e(this,n,"m",r).call(this),e(this,o,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),this.observeAttributes(["project-id","base-url","tenant","mock"],(()=>{e(this,o,"f")&&e(this,n,"m",r).call(this)}))}))}},o=new WeakMap,n=new WeakSet,r=function(){this.logger.debug("creating an sdk instance"),i(this,o,((t,e,i,s)=>{const n=x(Object.assign(Object.assign({},t),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"tenant-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.7.2"}}));return{user:at({httpClient:n.httpClient,mock:i}),tenant:ot({httpClient:n.httpClient,tenantId:e,mock:i})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},this.tenantId,"true"===this.mock,this.widgetId),"f")},v})),lt=o((t=>{const e=a(v({name:"widget",initialState:V,reducers:{},extraReducers:t=>{z.reducer(t),G.reducer(t),Q.reducer(t)},asyncActions:{getMe:z.action,getTenant:G.action,getTenantAdminLinkSSO:Q.action}}),m,h,rt)(t);return class extends e{constructor(...t){super(...t),this.state=V,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),dt="widget-flow",ht=o((i=>{var s,n,o;return o=class extends(a(g,m,p,lt,u,h,w)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this);const o=$(dt);o&&(!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",n).call(this,o))}))}},s=new WeakSet,n=function(e){const i=this.createModal({"data-id":"redirect-flow"});i.setContent(P({locale:this.locale,projectId:this.projectId,flowId:e,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId}));new C((()=>{var t;return null===(t=i.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>t(this,void 0,void 0,(function*(){i.close(),this.actions.getMe(),yield this.actions.getTenant();const t=q(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:t})})))),i.afterClose=()=>{i.remove()},i.open()},o})),ct=o((t=>class extends(a(w,d)(t)){syncFlowTheme(t){t.theme=this.theme,this.observeAttributes(["theme"],(()=>{t.theme=this.theme}))}}));const ut=o((i=>{var n,o,r;return r=class extends(a(h,m,b,y,S("tenant-profile-widget"),lt)(i)){constructor(){super(...arguments),n.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this);try{yield Promise.all([this.actions.getMe(),this.actions.getTenant()]);const t=q(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:t})}catch(t){}const s=this.state.me.error||(t=>t.tenant.error)(this.state)||(t=>t.tenantAdminLinkSSO.error)(this.state);if(s){this.contentRootElement.innerHTML="";const t="object"==typeof s&&null!==s&&"message"in s?s.message:String(s)||"An error occurred";this.contentRootElement.append(function({mainMessage:t="An error occurred"}){const e=document.createElement("div");e.setAttribute("data-id","widget-error"),e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.justifyContent="center",e.style.padding="72px 36px",e.style.background="#fff",e.style.borderRadius="12px",e.style.boxShadow="0 2px 8px rgba(0,0,0,0.03)",e.style.margin="32px auto",e.style.maxWidth="400px";const i=document.createElement("div");i.innerHTML='\n <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="20" cy="20" r="18" stroke="#FF3B3B" stroke-width="3" fill="#fff"/>\n <text x="20" y="27" text-anchor="middle" font-size="24" font-family="Arial, sans-serif" fill="#FF3B3B">!</text>\n </svg>\n ',i.style.marginBottom="12px",e.appendChild(i);const s=document.createElement("div");return s.textContent=t,s.style.fontWeight="bold",s.style.fontSize="20px",s.style.color="#222",s.style.textAlign="center",s.style.marginTop="8px",e.appendChild(s),e}({mainMessage:t}))}else yield e(this,n,"m",o).call(this),yield this.onWidgetRootReady(),this.dispatchEvent(new CustomEvent("ready"))}))}},n=new WeakSet,o=function(){return t(this,void 0,void 0,(function*(){const t=s(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},r})),ft=o((s=>{var n,o,r,l,d,c,u,f,v,m,g,w;return w=class extends(a(ct,lt,p,h,ut)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),d.set(this,void 0),c.set(this,void 0)}onWidgetRootReady(){const s=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=s.onWidgetRootReady)||void 0===t?void 0:t.call(this),i(this,o,new U((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-multi-sso")}),{logger:this.logger}),"f"),e(this,o,"f").isExists&&(e(this,n,"m",g).call(this),e(this,o,"f").data=L(this.state),this.subscribe((t=>{e(this,o,"f").data=t}),L))}))}},o=new WeakMap,r=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,n=new WeakSet,u=function(){i(this,r,this.createModal({"data-id":"multi-sso-create-modal"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),this.syncFlowTheme(e(this,l,"f"))},f=function(){i(this,d,this.createModal({"data-id":"multi-sso-delete-modal"}),"f"),i(this,c,new C((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),this.syncFlowTheme(e(this,c,"f"))},v=function(i){e(this,r,"f").setContent(P({projectId:this.projectId,flowId:i,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,tenant:this.tenantId})),e(this,r,"f").open(),e(this,l,"f").onSuccess((()=>t(this,void 0,void 0,(function*(){e(this,r,"f").close(),yield this.actions.getTenant();const t=q(this.state);yield this.actions.getTenantAdminLinkSSO({ssoIds:t})}))))},m=function(t,i){e(this,d,"f").setContent(P({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,tenant:this.tenantId,form:JSON.stringify({deleteSSOConfigurationId:i})})),e(this,d,"f").open(),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getTenant()}))},g=function(){const{createFlowId:t,deleteFlowId:i}=e(this,o,"f");i&&(e(this,n,"m",f).call(this),e(this,o,"f").onDeleteClicked((({id:t})=>e(this,n,"m",m).call(this,i,t)))),t&&(e(this,n,"m",u).call(this),e(this,o,"f").onCreateClicked((()=>e(this,n,"m",v).call(this,t))))},w})),vt=o((i=>{var s,n,o,l;return l=class extends(a(ct,lt,h,ut,u,p)(i)){constructor(){super(...arguments),s.add(this),o.set(this,r((t=>{this.tenantAdminLinkSSODriver.href=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,s,"m",n).call(this),e(this,o,"f").call(this,D(this.state)),this.subscribe(e(this,o,"f").bind(this),D)}))}},o=new WeakMap,s=new WeakSet,n=function(){this.tenantAdminLinkSSODriver=new R((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-link[data-id="tenant-admin-link-sso"]')}),{logger:this.logger})},l}));var mt;!function(t){t.TEXT="text",t.NUMBER="number",t.BOOLEAN="boolean",t.SINGLE_SELECT="singleSelect",t.ARRAY="array",t.DATE="date"}(mt||(mt={}));const gt=o((i=>{var s,n,o,l,d,c,f,v,m,w,b;return b=class extends(a(g,ct,lt,h,ut,u,p)(i)){constructor(){super(...arguments),s.add(this),n.set(this,{}),o.set(this,{}),l.set(this,{}),d.set(this,{}),v.set(this,r((t=>{var i;const n=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll('descope-user-attribute[data-id^="customAttributes."]');Array.from(n).forEach((i=>{const n=i.getAttribute("data-id").replace("customAttributes.",""),o=i.getAttribute("data-type")||mt.TEXT,a=t[n],r=new W(i,{logger:this.logger});r.value=((t,e)=>t===mt.DATE&&e?new Date(e).toLocaleString():t===mt.BOOLEAN&&void 0!==e?e?"True":"False":(e||"").toString())(o,a),e(this,s,"m",m).call(this,i,n,r,o,n),e(this,s,"m",w).call(this,i,n,r)}))})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,v,"f").call(this,E(this.state)),this.subscribe(e(this,v,"f").bind(this),E)}))}},n=new WeakMap,o=new WeakMap,l=new WeakMap,d=new WeakMap,v=new WeakMap,s=new WeakSet,c=function(t,i,s){var a,r;const l=E(this.state)[s],d=i===mt.ARRAY?(l||[]).join(","):l;null===(a=e(this,n,"f")[t])||void 0===a||a.setContent(P({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({customAttributes:{[s]:d}})})),null===(r=e(this,o,"f")[t])||void 0===r||r.onSuccess((()=>{var i;null===(i=e(this,n,"f")[t])||void 0===i||i.close(),this.actions.getTenant()}))},f=function(t){var i,s;null===(i=e(this,l,"f")[t])||void 0===i||i.setContent(P({locale:this.locale,projectId:this.projectId,flowId:t,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),null===(s=e(this,d,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e(this,l,"f")[t])||void 0===i||i.close(),this.actions.getTenant()}))},m=function(t,i,a,r,l){const d=t.getAttribute("edit-flow-id");d&&(e(this,n,"f")[d]||(e(this,n,"f")[d]=this.createModal({"data-id":`edit-${i}`}),e(this,o,"f")[d]=new C((()=>{var t,i;return null===(i=null===(t=e(this,n,"f")[d])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e(this,n,"f")[d].beforeOpen=e(this,s,"m",c).bind(this,d,r,l),a.onEditClick((()=>{var t,i;null===(i=null===(t=e(this,n,"f"))||void 0===t?void 0:t[d])||void 0===i||i.open()})),this.syncFlowTheme(e(this,o,"f")[d])))},w=function(t,i,n){const o=t.getAttribute("delete-flow-id");o&&(e(this,l,"f")[o]||(e(this,l,"f")[o]=this.createModal({"data-id":`delete-${i}`}),e(this,d,"f")[o]=new C((()=>{var t,i;return null===(i=null===(t=e(this,l,"f")[o])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e(this,l,"f")[o].beforeOpen=e(this,s,"m",f).bind(this,o),n.onDeleteClick((()=>{var t,i;null===(i=null===(t=e(this,l,"f"))||void 0===t?void 0:t[o])||void 0===i||i.open()})),this.syncFlowTheme(e(this,d,"f")[o])))},b})),pt=o((s=>{var n,o,l,d,c,f,v,m,w,b,y,S;return S=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),l.set(this,void 0),d.set(this,void 0),c.set(this,void 0),y.set(this,r((t=>{this.tenantEmailDomainsDriver.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",b).call(this),e(this,n,"m",f).call(this),e(this,n,"m",m).call(this),e(this,y,"f").call(this,A(this.state)),this.subscribe(e(this,y,"f").bind(this),A)}))}},o=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,n=new WeakSet,f=function(){this.tenantEmailDomainsDriver.editFlowId&&(i(this,o,this.createModal({"data-id":"edit-tenant-email-domains"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").beforeOpen=e(this,n,"m",v).bind(this),e(this,n,"m",v).call(this),this.syncFlowTheme(e(this,l,"f")))},v=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantEmailDomainsDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({tenantEmailDomains:A(this.state)})})),e(this,l,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},m=function(){this.tenantEmailDomainsDriver.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-tenant-email-domains"}),"f"),i(this,c,new C((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").beforeOpen=e(this,n,"m",w).bind(this),e(this,n,"m",w).call(this),this.syncFlowTheme(e(this,c,"f")))},w=function(){e(this,d,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantEmailDomainsDriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getTenant()}))},b=function(){this.tenantEmailDomainsDriver=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="tenant-email-domains-edit"]')}),{logger:this.logger}),this.tenantEmailDomainsDriver.onEditClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()})),this.tenantEmailDomainsDriver.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},S})),wt=o((s=>{var n,o,l,d,c,f,v,m,w,b,y,S;return S=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),l.set(this,void 0),d.set(this,void 0),c.set(this,void 0),y.set(this,r((t=>{this.tenantSSOExclusionsDriver.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",b).call(this),e(this,n,"m",f).call(this),e(this,n,"m",m).call(this),e(this,y,"f").call(this,N(this.state)),this.subscribe(e(this,y,"f").bind(this),N)}))}},o=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,n=new WeakSet,f=function(){this.tenantSSOExclusionsDriver.editFlowId&&(i(this,o,this.createModal({"data-id":"edit-tenant-sso-exclusions"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").beforeOpen=e(this,n,"m",v).bind(this),e(this,n,"m",v).call(this),this.syncFlowTheme(e(this,l,"f")))},v=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantSSOExclusionsDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({enforceSSOExclusions:N(this.state)})})),e(this,l,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},m=function(){this.tenantSSOExclusionsDriver.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-tenant-sso-exclusions"}),"f"),i(this,c,new C((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").beforeOpen=e(this,n,"m",w).bind(this),e(this,n,"m",w).call(this),this.syncFlowTheme(e(this,c,"f")))},w=function(){e(this,d,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantSSOExclusionsDriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getTenant()}))},b=function(){this.tenantSSOExclusionsDriver=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="tenant-force-sso-exclusions-edit"]')}),{logger:this.logger}),this.tenantSSOExclusionsDriver.onEditClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()})),this.tenantSSOExclusionsDriver.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},S})),bt=o((s=>{var n,o,l,d,c,f,v,m,w,b,y,S;return S=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),l.set(this,void 0),d.set(this,void 0),c.set(this,void 0),y.set(this,r((t=>{this.tenantEnforceSSODriver.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",b).call(this),e(this,n,"m",f).call(this),e(this,n,"m",m).call(this),e(this,y,"f").call(this,F(this.state)),this.subscribe(e(this,y,"f").bind(this),F)}))}},o=new WeakMap,l=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,n=new WeakSet,f=function(){this.tenantEnforceSSODriver.editFlowId&&(i(this,o,this.createModal({"data-id":"edit-tenant-enforce-sso"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").beforeOpen=e(this,n,"m",v).bind(this),e(this,n,"m",v).call(this),this.syncFlowTheme(e(this,l,"f")))},v=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantEnforceSSODriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({enforceSSO:F(this.state)})})),e(this,l,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},m=function(){this.tenantEnforceSSODriver.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-tenant-enforce-sso"}),"f"),i(this,c,new C((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").beforeOpen=e(this,n,"m",w).bind(this),e(this,n,"m",w).call(this),this.syncFlowTheme(e(this,c,"f")))},w=function(){e(this,d,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantEnforceSSODriver.deleteFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getTenant()}))},b=function(){this.tenantEnforceSSODriver=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="tenant-enforce-sso-edit"]')}),{logger:this.logger}),this.tenantEnforceSSODriver.onEditClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()})),this.tenantEnforceSSODriver.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},S})),yt=o((s=>{var n,o,l,d,c,f,v,m;return m=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),l.set(this,void 0),v.set(this,r((t=>{this.tenantNameDriver.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",f).call(this),e(this,n,"m",d).call(this),e(this,v,"f").call(this,j(this.state)),this.subscribe(e(this,v,"f").bind(this),j)}))}},o=new WeakMap,l=new WeakMap,v=new WeakMap,n=new WeakSet,d=function(){this.tenantNameDriver.editFlowId&&(i(this,o,this.createModal({"data-id":"tenant-profile-set-name"}),"f"),i(this,l,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").beforeOpen=e(this,n,"m",c).bind(this),e(this,n,"m",c).call(this),this.syncFlowTheme(e(this,l,"f")))},c=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.tenantNameDriver.editFlowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme,"style-id":this.styleId,form:JSON.stringify({tenantName:j(this.state)})})),e(this,l,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},f=function(){this.tenantNameDriver=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="tenant-name-edit"]')}),{logger:this.logger}),this.tenantNameDriver.onEditClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()}))},m})),St=o((s=>{var n,o,r,l,d,c,f;return f=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),r.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",c).call(this),e(this,n,"m",l).call(this)}))}},o=new WeakMap,r=new WeakMap,n=new WeakSet,l=function(){this.TenantPasswordPolicyUserAuthMethodDriver.flowId&&(i(this,o,this.createModal({"data-id":"password-policy"}),"f"),i(this,r,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").afterClose=e(this,n,"m",d).bind(this),e(this,n,"m",d).call(this),this.syncFlowTheme(e(this,r,"f")))},d=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.TenantPasswordPolicyUserAuthMethodDriver.flowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,r,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},c=function(){this.TenantPasswordPolicyUserAuthMethodDriver=new O((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password-policy"]')}),{logger:this.logger}),this.TenantPasswordPolicyUserAuthMethodDriver.onUnfulfilledButtonClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()}))},f})),kt=o((s=>{var n,o,r,l,d,c,f;return f=class extends(a(g,ct,lt,h,ut,u,p)(s)){constructor(){super(...arguments),n.add(this),o.set(this,void 0),r.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,n,"m",c).call(this),e(this,n,"m",l).call(this)}))}},o=new WeakMap,r=new WeakMap,n=new WeakSet,l=function(){this.TenantSessionSettingsUserAuthMethodDriver.flowId&&(i(this,o,this.createModal({"data-id":"session-settings"}),"f"),i(this,r,new C((()=>{var t;return null===(t=e(this,o,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,o,"f").afterClose=e(this,n,"m",d).bind(this),e(this,n,"m",d).call(this),this.syncFlowTheme(e(this,r,"f")))},d=function(){e(this,o,"f").setContent(P({locale:this.locale,projectId:this.projectId,flowId:this.TenantSessionSettingsUserAuthMethodDriver.flowId,tenant:this.tenantId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,r,"f").onSuccess((()=>{e(this,o,"f").close(),this.actions.getTenant()}))},c=function(){this.TenantSessionSettingsUserAuthMethodDriver=new O((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="session-settings"]')}),{logger:this.logger}),this.TenantSessionSettingsUserAuthMethodDriver.onUnfulfilledButtonClick((()=>{var t;null===(t=e(this,o,"f"))||void 0===t||t.open()}))},f})),It=o((e=>class extends(a(k,w,ht,ut,yt,pt,wt,bt,gt,vt,St,kt,ft)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),Ct=a((e=>class extends(It(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this);(customElements.get("descope-wc")||(yield import("@descope/web-component").then((t=>t.default)))).sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"tenant-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.7.2"}}}))}}))(HTMLElement);customElements.define("descope-tenant-profile-widget",Ct);export{Ct as default};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|