@aerogel/plugin-solid 0.0.1-next.129b164cda8e791661ba16ad7bf51aaeae6be2eb

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.
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("@inrupt/solid-client-authn-browser");Object.defineProperty(exports,"events",{enumerable:!0,get:function(){return e.events}}),Object.defineProperty(exports,"fetch",{enumerable:!0,get:function(){return e.fetch}}),Object.defineProperty(exports,"handleIncomingRedirect",{enumerable:!0,get:function(){return e.handleIncomingRedirect}}),Object.defineProperty(exports,"login",{enumerable:!0,get:function(){return e.login}}),Object.defineProperty(exports,"logout",{enumerable:!0,get:function(){return e.logout}});
2
+ //# sourceMappingURL=InruptAuthenticator.lazy.hash.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InruptAuthenticator.lazy.hash.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export{events,fetch,handleIncomingRedirect,login,logout}from"@inrupt/solid-client-authn-browser";
2
+ //# sourceMappingURL=InruptAuthenticator.lazy.hash.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InruptAuthenticator.lazy.hash.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@aerogel/core"),t=require("soukai-solid");require("core-js/modules/esnext.async-iterator.find.js"),require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.find.js");var i=require("@noeldemartin/utils"),r=require("@noeldemartin/solid-utils"),o=require("soukai"),n=require("@babel/runtime/helpers/defineProperty");require("core-js/modules/esnext.async-iterator.for-each.js"),require("core-js/modules/esnext.iterator.for-each.js"),require("core-js/modules/esnext.async-iterator.map.js"),require("core-js/modules/esnext.iterator.map.js"),require("core-js/modules/esnext.async-iterator.constructor.js"),require("core-js/modules/esnext.async-iterator.to-array.js"),require("core-js/modules/esnext.iterator.to-array.js");var s=require("virtual:aerogel-solid"),a=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(n),c=l(s);class AuthenticationCancelledError extends i.JSError{}class AuthenticationFailedError extends i.JSError{constructor(e,t,i){super(function(e,t){return t?`${e} (${t})`:e}(e),i),u.default(this,"description",void 0),this.description=t}}class d extends i.JSError{constructor(e,t){super(`Container at ${e.url} is already in use`,t)}}class h{constructor(){u.default(this,"name",void 0),u.default(this,"authenticatedFetch",void 0),u.default(this,"booted",void 0),u.default(this,"listeners",i.arr([])),u.default(this,"_engine",void 0)}get engine(){return this._engine=this._engine??new t.SolidEngine(this.requireAuthenticatedFetch()),this._engine}getAuthenticatedFetch(){return this.authenticatedFetch??null}requireAuthenticatedFetch(){return this.authenticatedFetch??i.fail("Authenticated fetch is not ready")}addListener(e){return this.listeners.includes(e)||this.listeners.push(e),()=>{this.removeListener(e)}}removeListener(e){this.listeners.includes(e)&&this.listeners.remove(e)}async boot(){if(this.booted)return this.booted;this.booted=new i.PromisedValue,await this.restoreSession(),this.booted.resolve()}async initAuthenticatedFetch(e){this.authenticatedFetch=e,await this.notifyListeners("onAuthenticatedFetchReady",e)}async startSession(e){const t={authenticator:this,...e};return await this.notifyListeners("onSessionStarted",t),t}async failSession(e,t){await this.notifyListeners("onSessionFailed",e,t)}async endSession(){await this.notifyListeners("onSessionEnded")}async notifyListeners(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];await Promise.all(this.listeners.toArray().map((async t=>{const r=t[e];await(r?.(...i))})))}}const g="inrupt-authenticator";const f={},p={inrupt:new class extends h{constructor(){super(...arguments),u.default(this,"_events",void 0),u.default(this,"_fetch",void 0),u.default(this,"_login",void 0),u.default(this,"_logout",void 0),u.default(this,"_handleIncomingRedirect",void 0)}async login(e){i.Storage.set(g,e);const t={oidcIssuer:e};return c.default.clientID&&(t.clientId=c.default.clientID.client_id,t.clientName=c.default.clientID.client_name,t.redirectUrl=c.default.clientID.redirect_uris[0]),await this._login(t),await i.after({seconds:60}),i.fail("Browser should have redirected, but it didn't")}async logout(){await this._logout(),await this.endSession()}async restoreSession(){const{events:e,fetch:t,handleIncomingRedirect:i,login:r,logout:o}=await Promise.resolve().then((function(){return require("./InruptAuthenticator.lazy.hash.cjs.js")}));this._fetch=t,this._login=r,this._logout=o,this._events=e,this._handleIncomingRedirect=i,await this.loginFromRedirect()}async loginFromRedirect(){const e=i.Storage.get(g);if(!e)return;this._events().on("error",((t,i)=>{t??="Error using Inrupt Authenticator method","object"==typeof i?this.failSession(e,new AuthenticationFailedError(t,null,{cause:i})):this.failSession(e,new AuthenticationFailedError(t,i))}));const t=await this._handleIncomingRedirect(globalThis.location.href);i.Storage.remove(g),t?.isLoggedIn&&t.webId&&await this.initSession(t.webId)}async initSession(e){await this.initAuthenticatedFetch(this._fetch);try{const{default:t}=await Promise.resolve().then((function(){return I})),i=await t.requireUserProfile(e);await this.startSession({user:i,loginUrl:e})}catch(t){await this.failSession(e,t)}}}};function m(e){f.default=e}function y(e){return f[e]}function S(e){Object.entries(e).forEach((e=>{let[t,i]=e;return v(t,i)}))}function v(e,t){f[e]=t,t.name=t.name??e}const w={autoReconnect:!0};var x=e.defineServiceState({name:"solid",persist:["autoReconnect","dismissed","previousSession","profiles","staleProfiles"],initialState:{autoReconnect:w.autoReconnect,dismissed:!1,ignorePreviousSessionError:!1,loginStartupError:null,loginOngoing:!1,preferredAuthenticator:null,previousSession:null,profiles:{},session:null,loginStale:!1,staleProfiles:[]},serialize:e=>(e.previousSession?.error instanceof Error&&(e.previousSession.error=e.previousSession.error.message),e),computed:{user:e=>e.session?.user??e.previousSession?.profile??null,authenticator:e=>e.session?.authenticator??null,fetch(){return this.authenticator?.getAuthenticatedFetch()??globalThis.fetch.bind(globalThis)},error:e=>e.loginStartupError?e.loginStartupError??null:e.ignorePreviousSessionError?null:e.previousSession?.error??null}});class b extends x{isLoggedIn(){return!!this.session}wasLoggedIn(){return!!this.previousSession}hasLoggedIn(){return!(!this.session&&!this.previousSession)}requireAuthenticator(){return this.authenticator??i.fail("Could not get authenticator")}requireUser(){return this.user??i.fail("Could not get user profile (are you logged in?)")}requireUserProfile(e){return this.getUserProfile(e,!0)}async getUserProfile(t){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;const s=!!this.authenticator?.getAuthenticatedFetch();return this.profiles[t]??i.tap(await r.fetchLoginUserProfile(t,{fetch:this.fetch,required:o,onLoaded(e){n=e}}),(async t=>{t&&(n&&await e.Events.emit("solid:user-profile-loaded",[t,n]),this.rememberProfile(t),s||this.setState({staleProfiles:i.arrayUnique(this.staleProfiles.concat([t.webId]))}))}))}async refreshUserProfile(){if(!this.isLoggedIn())return;this.setState({profiles:i.objectWithout(this.profiles,[this.user.webId])});const e=await this.requireUserProfile(this.user.webId);this.setState({session:{...this.session,user:e}})}async login(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.App.development&&"dev"===t&&(t="http://localhost:3000"),/^https?:\/\//.test(t)||(i.fallbackUrl??=`http://${t}`,t=`https://${t}`),this.isLoggedIn())return!0;if(this.loginOngoing)throw new Error("Authentication already in progress");return i.loading?e.UI.loading(e.translateWithDefault("solid.loggingIn","Logging in..."),(()=>this.attemptLogin(t,i))):this.attemptLogin(t,i)}async reconnect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{force:t,...i}=e;this.isLoggedIn()||!this.previousSession||null!==this.previousSession.error&&!t||await this.login(this.previousSession.loginUrl,{authenticator:this.previousSession.authenticator,...i,loading:i.loading??!1})}async logout(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const i=!e.App.plugin("@aerogel/offline-first")||!!e.App.service("$cloud")?.ready,r=!e.App.plugin("@aerogel/offline-first")||!!e.App.service("$cloud")?.dirty,[o,n]=t?[!0,{wipeLocalData:i}]:await e.UI.confirm(i?e.translateWithDefault("solid.logoutConfirmTitle","Log out from this device?"):e.translateWithDefault("solid.disconnectConfirmTitle","Disconnect account?"),i?r?e.translateWithDefault("solid.logoutConfirmMessageWithLocalChanges","There are some changes that haven't been synchronized and will be lost, but the rest of the data will remain in your Solid POD."):e.translateWithDefault("solid.logoutConfirmMessage","Logging out will remove all the data from this device, but you'll still have it in your Solid POD."):e.translateWithDefault("solid.disconnectConfirmMessage","You'll need to introduce logging details again to connect to your Solid POD."),{acceptText:e.translateWithDefault("solid.logoutConfirmAccept","Log out"),acceptColor:e.Colors.Danger,cancelText:e.translateWithDefault("solid.logoutConfirmCancel",e.translateWithDefault("ui.cancel","Cancel")),checkboxes:i?r?{wipeLocalData:{label:e.translateWithDefault("solid.logoutConfirmWipeNotice","I understand that changes that haven't been synchronized will be lost."),default:!1,required:!0}}:void 0:{wipeLocalData:{label:e.translateWithDefault("solid.logoutConfirmWipe","Also remove all existing data (tasks, lists, etc.)"),default:!1}}});o&&this.previousSession&&await e.UI.loading(e.translateWithDefault("solid.logoutOngoing","Logging out..."),(async()=>{this.setState({dismissed:!1,ignorePreviousSessionError:!1,loginStartupError:null,previousSession:null,...w}),this.isLoggedIn()&&await this.authenticator.logout(),await e.Events.emit("auth:logout",{wipeLocalData:n.wipeLocalData??!0}),await e.Events.emit("auth:after-logout")}))}async whenLoggedIn(t){return this.isLoggedIn()?t(this.session):new Promise((i=>{e.Events.once("auth:login",(e=>i(t(e))))}))}dismiss(){this.setState({dismissed:!0})}async findOrCreatePrivateTypeIndex(){return await this.findPrivateTypeIndex()??await this.createPrivateTypeIndex()}async findPrivateTypeIndex(){const{webId:e,privateTypeIndexUrl:r}=this.requireUser(),o=this.requireAuthenticator().engine;return r?i.asyncMemo(`${e}-privateTypeIndex`,(()=>t.SolidTypeIndex.withEngine(o).find(r))):null}async findOrCreatePublicTypeIndex(){return await this.findPublicTypeIndex()??await this.createPublicTypeIndex()}async findPublicTypeIndex(){const{webId:e,publicTypeIndexUrl:r}=this.requireUser(),o=this.requireAuthenticator().engine;return r?i.asyncMemo(`${e}-publicTypeIndex`,(()=>t.SolidTypeIndex.withEngine(o).find(r))):null}async createPrivateContainer(e){const i=this.requireAuthenticator().engine;return t.SolidContainer.withEngine(i,(async()=>{const i=await t.SolidContainer.find(e.url);if(i&&!e.reuseExisting)throw new d(i);const r=i??new t.SolidContainer({url:e.url,name:e.name});if(await r.save(),e.registerFor){const t=await this.findOrCreatePrivateTypeIndex();await r.register(t,e.registerFor)}return r}))}async boot(){await e.Errors.booted,i.hasLocationQueryParameter("authenticator")&&this.setState({preferredAuthenticator:i.getLocationQueryParameter("authenticator")}),i.hasLocationQueryParameter("refreshProfile")&&this.setState({staleProfiles:i.arrayUnique(this.staleProfiles.concat(i.arrayFilter([this.session?.user.webId,this.previousSession?.loginUrl])))}),await this.restorePreviousSession(),await this.startupReconnect()}async createPrivateTypeIndex(){const e=this.requireUser(),r=this.requireAuthenticator(),o=await t.SolidTypeIndex.withEngine(r.engine).createPrivate(e);return i.tap(o,(()=>{e.privateTypeIndexUrl=o.url,i.setAsyncMemo(`${e.webId}-privateTypeIndex`,o),this.rememberProfile(e)}))}async createPublicTypeIndex(){const e=this.requireUser(),r=this.requireAuthenticator(),o=await t.SolidTypeIndex.withEngine(r.engine).createPublic(e);return i.tap(o,(()=>{e.privateTypeIndexUrl=o.url,i.setAsyncMemo(`${e.webId}-publicTypeIndex`,o),this.rememberProfile(e)}))}async attemptLogin(t,r){const o=r.authenticator??this.preferredAuthenticator??"default",n=r.onError??(t=>e.App.isMounted()?e.Errors.report(t):this.setState({loginStartupError:t})),s=setTimeout((()=>this.loginStale=!0),1e4),a={dismissed:this.dismissed,ignorePreviousSessionError:this.ignorePreviousSessionError,previousSession:this.previousSession};this.loginOngoing=!0;try{const r=await this.getUserProfile(t),n=r?.oidcIssuerUrl??i.urlRoot(r?.webId??t),s=await this.bootAuthenticator(o),{domain:a}=i.requireUrlParse(t);return this.setState({dismissed:!1,ignorePreviousSessionError:!0,previousSession:i.objectWithoutEmpty({profile:r,loginUrl:t,authenticator:o,error:e.translateWithDefault("auth.stuckConnecting",`We didn't hear back from the identity provider at \`${a}\`, maybe try reconnecting?`)})}),await e.Events.emit("auth:before-login"),await s.login(n,r),!0}catch(e){return this.setState(a),e instanceof AuthenticationCancelledError?!1:r.fallbackUrl?i.after().then((()=>this.login(r.fallbackUrl??"",i.objectWithout(r,"fallbackUrl")))):(n(e),!1)}finally{clearTimeout(s),this.setState({loginOngoing:!1,loginStale:!1})}}async restorePreviousSession(){this.previousSession&&await this.bootAuthenticator(this.previousSession.authenticator)}async startupReconnect(){this.reconnectOnStartup()&&await this.reconnect()}reconnectOnStartup(){return i.hasLocationQueryParameter("autoReconnect")?i.parseBoolean(i.getLocationQueryParameter("autoReconnect")):this.autoReconnect}async bootAuthenticator(i){const r=y(i);return r.addListener({onSessionStarted:async i=>{this.setState({session:i,previousSession:{authenticator:r.name,loginUrl:i.loginUrl,profile:i.user,error:null}}),this.staleProfiles.includes(i.user.webId)&&await this.refreshUserProfile(),e.App.plugin("@aerogel/offline-first")||o.setEngine(i.authenticator.engine),t.SolidACLAuthorization.setEngine(i.authenticator.engine),t.SolidTypeIndex.setEngine(i.authenticator.engine),t.SolidDocument.setEngine(i.authenticator.engine),await e.Events.emit("auth:login",i)},onSessionFailed:async(e,t)=>{this.setState({session:null,previousSession:{authenticator:r.name,loginUrl:e,error:t}})},onSessionEnded:()=>this.setState({session:null}),onAuthenticatedFetchReady:t=>e.Events.emit("auth:fetch-ready",t)}),await r.boot(),r}rememberProfile(e){this.setState({profiles:{...this.profiles,[e.webId]:e},staleProfiles:i.arrayWithout(this.staleProfiles,e.webId)})}}var A=i.facade(b),I=Object.freeze({__proto__:null,SolidService:b,default:A});const E=["src"];var P=a.defineComponent({__name:"AGSolidImage",props:{src:e.requiredStringProp()},setup(t){const i=t,r=e.computedAsync((async()=>{const t=await e.Cache.get(i.src)??await async function(t){try{const i=await A.fetch(t);return 200!==i.status?null:(await e.Cache.store(t,i),e.Cache.get(t))}catch(e){return null}}(i.src),r=await(t?.blob());return r&&URL.createObjectURL(r)}));return(e,t)=>(a.openBlock(),a.createElementBlock("img",{src:a.unref(r)},null,8,E))}});P.__file="src/components/AGSolidImage.vue";const L={class:"flex flex-col gap-3"},C={class:"flex flex-col"},U={key:1,class:"mt-1 self-center text-sm text-red-800"};var k=a.defineComponent({__name:"AGSolidStatus",setup(t){const i=e.useForm({url:e.requiredStringInput()});return(t,r)=>(a.openBlock(),a.createElementBlock("div",null,[t.$solid.loginStale?a.renderSlot(t.$slots,"login-stale",{key:0},(()=>[a.createVNode(a.unref(e.AGMarkdown),{text:t.$td("solid.loginStale","This is taking too long...")},null,8,["text"])])):a.createCommentVNode("v-if",!0),t.$solid.loginOngoing?a.renderSlot(t.$slots,"login-ongoing",{key:1},(()=>[a.createVNode(a.unref(e.AGMarkdown),{text:t.$td("ui.loading","Loading...")},null,8,["text"])])):t.$solid.isLoggedIn()?a.renderSlot(t.$slots,"logged-in",{key:2,session:t.$solid.session},(()=>[a.createElementVNode("div",L,[a.createVNode(a.unref(e.AGMarkdown),{text:t.$td("solid.loggedIn","You are logged in as [{userName}]({userWebId})",{userName:t.$solid.user.name??t.$solid.user.webId,userWebId:t.$solid.user.webId})},null,8,["text"]),a.createVNode(a.unref(e.AGButton),{onClick:r[0]||(r[0]=e=>t.$solid.logout())},{default:a.withCtx((()=>[a.createTextVNode(a.toDisplayString(t.$td("solid.logout","Logout")),1)])),_:1})])])):a.renderSlot(t.$slots,"logged-out",{key:3},(()=>[a.createElementVNode("div",C,[a.createVNode(a.unref(e.AGForm),{form:a.unref(i),class:"flex",onSubmit:r[1]||(r[1]=e=>t.$solid.login(a.unref(i).url))},{default:a.withCtx((()=>[a.createVNode(a.unref(e.AGInput),{name:"url","aria-label":t.$td("solid.url","Login url"),placeholder:t.$td("solid.placeholder","https://...")},null,8,["aria-label","placeholder"]),a.createVNode(a.unref(e.AGButton),{submit:""},{default:a.withCtx((()=>[a.createTextVNode(a.toDisplayString(t.$td("solid.login","Login")),1)])),_:1})])),_:1},8,["form"]),t.$solid.wasLoggedIn()?(a.openBlock(),a.createBlock(a.unref(e.AGButton),{key:0,class:"mt-3",onClick:r[2]||(r[2]=e=>t.$solid.reconnect({force:!0}))},{default:a.withCtx((()=>[a.createTextVNode(a.toDisplayString(t.$td("solid.reconnect","Reconnect")),1)])),_:1})):a.createCommentVNode("v-if",!0),t.$solid.previousSession?.error||t.$solid.loginStartupError?(a.openBlock(),a.createElementBlock("p",U,[a.createVNode(a.unref(e.AGMarkdown),{text:t.$td("solid.previousLoginError","Previous login attempt failed"),inline:""},null,8,["text"]),a.createVNode(a.unref(e.AGLink),{onClick:r[3]||(r[3]=e=>t.$errors.inspect(t.$solid.previousSession?.error||t.$solid.loginStartupError))},{default:a.withCtx((()=>[a.createTextVNode(" ("+a.toDisplayString(t.$td("errors.viewDetails","View details"))+") ",1)])),_:1})])):a.createCommentVNode("v-if",!0)])]))]))}});k.__file="src/components/AGSolidStatus.vue";const $={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"},_=[a.createElementVNode("path",{fill:"currentColor",d:"M15 2H5L4 8h12zM0 10s2 1 10 1s10-1 10-1l-4-2H4zm8 4h4v1H8z"},null,-1),a.createElementVNode("circle",{cx:"6",cy:"15",r:"3",fill:"currentColor"},null,-1),a.createElementVNode("circle",{cx:"14",cy:"15",r:"3",fill:"currentColor"},null,-1)];var q={name:"ooui-user-anonymous",render:function(e,t){return a.openBlock(),a.createElementBlock("svg",$,[..._])}};const T={class:"relative flex items-center justify-center rounded-full bg-gray-200"},D={key:1,class:"text-sm font-semibold tracking-wider text-gray-500","aria-hidden":"true"};var j=a.defineComponent({__name:"AGSolidUserAvatar",setup(e){const t=a.computed((()=>(A.user?.name??"").trim().split(" ").map((e=>e[0]?.toUpperCase())).join("").slice(0,3)));return(e,i)=>(a.openBlock(),a.createElementBlock("div",T,[e.$solid.user?.avatarUrl?(a.openBlock(),a.createBlock(P,{key:0,src:e.$solid.user?.avatarUrl,alt:"",class:"absolute inset-0 h-full w-full rounded-full"},null,8,["src"])):t.value?(a.openBlock(),a.createElementBlock("span",D,a.toDisplayString(t.value),1)):(a.openBlock(),a.createBlock(a.unref(q),{key:2,class:"h-6 w-6 text-gray-500"}))]))}});j.__file="src/components/AGSolidUserAvatar.vue";const F={$solid:A};exports.AGSolidImage=P,exports.AGSolidStatus=k,exports.AGSolidUserAvatar=j,exports.AuthenticationCancelledError=AuthenticationCancelledError,exports.AuthenticationFailedError=AuthenticationFailedError,exports.Authenticator=h,exports.ContainerAlreadyInUse=d,exports.Solid=A,exports.SolidService=b,exports.authenticators=p,exports.default=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{async install(r){t.bootSolidModels(),S({...p,...i.authenticators??{}}),e.defineFormValidationRule("container_url",(e=>{if(!e.endsWith("/"))return"containerEndingSlashMissing"})),m(y(i.defaultAuthenticator??"inrupt")),e.registerErrorHandler((e=>{if(e instanceof AuthenticationFailedError)return e.description?`${e.message} (${e.description})`:e.message})),"boolean"==typeof i.autoReconnect&&(w.autoReconnect=i.autoReconnect,A.hasPersistedState()||(A.autoReconnect=i.autoReconnect)),i.onUserProfileLoaded&&e.Events.on("solid:user-profile-loaded",(e=>{let[t,r]=e;i.onUserProfileLoaded?.(t,r)})),await e.bootServices(r,F)}}},exports.getAuthenticator=y,exports.registerAuthenticator=v,exports.registerAuthenticators=S,exports.setDefaultAuthenticator=m;
2
+ //# sourceMappingURL=aerogel-plugin-solid.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aerogel-plugin-solid.cjs.js","sources":["../src/errors/AuthenticationCancelledError.ts","../src/errors/AuthenticationFailedError.ts","../src/errors/ContainerAlreadyInUse.ts","../src/auth/Authenticator.ts","../src/auth/authenticators/InruptAuthenticator.ts","../src/auth/index.ts","../src/services/Solid.state.ts","../src/services/Solid.ts","../src/components/AGSolidImage.vue","../src/components/AGSolidStatus.vue","../src/components/AGSolidUserAvatar.vue","../src/main.ts","../src/forms/validation.ts"],"sourcesContent":["import { JSError } from '@noeldemartin/utils';\n\nexport default class AuthenticationCancelledError extends JSError {}\n","import { JSError } from '@noeldemartin/utils';\nimport type { JSErrorOptions } from '@noeldemartin/utils';\n\nfunction getErrorMessage(message: string, description?: string | null): string {\n if (!description) {\n return message;\n }\n\n return `${message} (${description})`;\n}\n\nexport default class AuthenticationFailedError extends JSError {\n\n public readonly description?: string | null;\n\n constructor(message: string, description?: string | null, options?: JSErrorOptions) {\n super(getErrorMessage(message), options);\n\n this.description = description;\n }\n\n}\n","import { JSError } from '@noeldemartin/utils';\nimport type { JSErrorOptions } from '@noeldemartin/utils';\nimport type { SolidContainer } from 'soukai-solid';\n\nexport default class ContainerAlreadyInUse extends JSError {\n\n constructor(container: SolidContainer, options?: JSErrorOptions) {\n super(`Container at ${container.url} is already in use`, options);\n }\n\n}\n","import { PromisedValue, arr, fail } from '@noeldemartin/utils';\nimport { SolidEngine } from 'soukai-solid';\nimport type { Closure, FluentArray, GetClosureArgs } from '@noeldemartin/utils';\nimport type { Engine } from 'soukai';\nimport type { Fetch } from 'soukai-solid';\nimport type { SolidUserProfile } from '@noeldemartin/solid-utils';\nimport type { ErrorSource } from '@aerogel/core';\n\nimport type { AuthenticatorName } from '@/auth';\n\ntype ListenerEvent = keyof AuthenticatorListener;\ntype ListenerEventPayload<\n Event extends ListenerEvent,\n Callback = AuthenticatorListener[Event]\n> = Callback extends Closure ? GetClosureArgs<Callback> : never;\n\nexport interface AuthSession {\n user: SolidUserProfile;\n loginUrl: string;\n authenticator: Authenticator;\n}\n\nexport interface AuthenticatorListener {\n onSessionStarted?: (session: AuthSession) => Promise<void> | void;\n onSessionFailed?: (loginUrl: string, error: ErrorSource) => Promise<void> | void;\n onSessionEnded?: () => Promise<void> | void;\n onAuthenticatedFetchReady?: (fetch: Fetch) => Promise<void> | void;\n}\n\nexport default abstract class Authenticator {\n\n public name!: AuthenticatorName;\n\n protected authenticatedFetch?: Fetch;\n protected booted?: PromisedValue<void>;\n protected listeners: FluentArray<AuthenticatorListener> = arr<AuthenticatorListener>([]);\n protected _engine?: SolidEngine;\n\n public abstract login(loginUrl: string, user?: SolidUserProfile | null): Promise<AuthSession>;\n\n public abstract logout(): Promise<void>;\n\n public get engine(): Engine {\n this._engine = this._engine ?? new SolidEngine(this.requireAuthenticatedFetch());\n\n return this._engine;\n }\n\n public getAuthenticatedFetch(): Fetch | null {\n return this.authenticatedFetch ?? null;\n }\n\n public requireAuthenticatedFetch(): Fetch {\n return this.authenticatedFetch ?? fail('Authenticated fetch is not ready');\n }\n\n public addListener(listener: AuthenticatorListener): () => void {\n if (!this.listeners.includes(listener)) this.listeners.push(listener);\n\n return () => {\n this.removeListener(listener);\n };\n }\n\n public removeListener(listener: AuthenticatorListener): void {\n if (!this.listeners.includes(listener)) return;\n\n this.listeners.remove(listener);\n }\n\n public async boot(): Promise<void> {\n if (this.booted) {\n return this.booted;\n }\n\n this.booted = new PromisedValue();\n\n await this.restoreSession();\n\n this.booted.resolve();\n }\n\n protected abstract restoreSession(): Promise<void>;\n\n protected async initAuthenticatedFetch(fetch: Fetch): Promise<void> {\n this.authenticatedFetch = fetch;\n\n await this.notifyListeners('onAuthenticatedFetchReady', fetch);\n }\n\n protected async startSession(sessionData: Omit<AuthSession, 'authenticator'>): Promise<AuthSession> {\n const session: AuthSession = {\n authenticator: this,\n ...sessionData,\n };\n\n await this.notifyListeners('onSessionStarted', session);\n\n return session;\n }\n\n protected async failSession(loginUrl: string, error: ErrorSource): Promise<void> {\n await this.notifyListeners('onSessionFailed', loginUrl, error);\n }\n\n protected async endSession(): Promise<void> {\n await this.notifyListeners('onSessionEnded');\n }\n\n protected async notifyListeners<Event extends ListenerEvent>(\n event: Event,\n ...payload: ListenerEventPayload<Event>\n ): Promise<void> {\n await Promise.all(\n this.listeners.toArray().map(async (listener) => {\n const callback = listener[event] as Closure | undefined;\n\n await callback?.(...payload);\n }),\n );\n }\n\n}\n","import { Storage, after, fail } from '@noeldemartin/utils';\nimport type { Fetch } from 'soukai-solid';\nimport type {\n ILoginInputOptions,\n events,\n handleIncomingRedirect,\n login,\n logout,\n} from '@inrupt/solid-client-authn-browser';\n\nimport Authenticator from '@/auth/Authenticator';\nimport AuthenticationFailedError from '@/errors/AuthenticationFailedError';\nimport type { AuthSession } from '@/auth/Authenticator';\n\nimport AerogelSolid from 'virtual:aerogel-solid';\n\nconst STORAGE_KEY = 'inrupt-authenticator';\n\nexport default class InruptAuthenticator extends Authenticator {\n\n private _events!: typeof events;\n private _fetch!: Fetch;\n private _login!: typeof login;\n private _logout!: typeof logout;\n private _handleIncomingRedirect!: typeof handleIncomingRedirect;\n\n public async login(loginUrl: string): Promise<AuthSession> {\n Storage.set<string>(STORAGE_KEY, loginUrl);\n\n const options: ILoginInputOptions = {\n oidcIssuer: loginUrl,\n };\n\n if (AerogelSolid.clientID) {\n options.clientId = AerogelSolid.clientID.client_id;\n options.clientName = AerogelSolid.clientID.client_name;\n options.redirectUrl = AerogelSolid.clientID.redirect_uris[0];\n }\n\n await this._login(options);\n\n // Browser should redirect, so just make it wait for a while.\n await after({ seconds: 60 });\n\n return fail('Browser should have redirected, but it didn\\'t');\n }\n\n public async logout(): Promise<void> {\n await this._logout();\n await this.endSession();\n }\n\n protected async restoreSession(): Promise<void> {\n const { events, fetch, handleIncomingRedirect, login, logout } = await import('./InruptAuthenticator.lazy');\n\n this._fetch = fetch;\n this._login = login;\n this._logout = logout;\n this._events = events;\n this._handleIncomingRedirect = handleIncomingRedirect;\n\n await this.loginFromRedirect();\n }\n\n protected async loginFromRedirect(): Promise<void> {\n const loginUrl = Storage.get<string>(STORAGE_KEY);\n if (!loginUrl) {\n return;\n }\n\n this._events().on('error', (error: string | null, errorDescription?: string | Error | null) => {\n error ??= 'Error using Inrupt Authenticator method';\n\n if (typeof errorDescription === 'object') {\n this.failSession(loginUrl, new AuthenticationFailedError(error, null, { cause: errorDescription }));\n } else {\n this.failSession(loginUrl, new AuthenticationFailedError(error, errorDescription));\n }\n });\n\n const session = await this._handleIncomingRedirect(globalThis.location.href);\n\n Storage.remove(STORAGE_KEY);\n\n if (session?.isLoggedIn && session.webId) {\n await this.initSession(session.webId);\n }\n }\n\n protected async initSession(webId: string): Promise<void> {\n await this.initAuthenticatedFetch(this._fetch);\n\n try {\n const { default: Solid } = await import('@/services/Solid');\n const user = await Solid.requireUserProfile(webId);\n\n await this.startSession({ user, loginUrl: webId });\n } catch (error) {\n await this.failSession(webId, error);\n }\n }\n\n}\n","import InruptAuthenticator from './authenticators/InruptAuthenticator';\nimport type Authenticator from './Authenticator';\n\nconst _authenticators = {} as Authenticators;\n\ntype BaseAuthenticators = typeof authenticators;\n\nexport * from './Authenticator';\nexport { default as Authenticator } from './Authenticator';\n\nexport const authenticators = {\n inrupt: new InruptAuthenticator(),\n};\n\nexport function setDefaultAuthenticator(authenticator: Authenticator): void {\n _authenticators.default = authenticator;\n}\n\nexport function getAuthenticator<T extends AuthenticatorName>(name: T): Authenticators[T] {\n return _authenticators[name];\n}\n\nexport function registerAuthenticators(customAuthenticators: Record<string, Authenticator>): void {\n Object.entries(customAuthenticators).forEach(([name, authenticator]) =>\n registerAuthenticator(name as AuthenticatorName, authenticator));\n}\n\nexport function registerAuthenticator<T extends AuthenticatorName>(name: T, authenticator: Authenticators[T]): void {\n _authenticators[name] = authenticator;\n\n authenticator.name = authenticator.name ?? name;\n}\n\nexport type AuthenticatorName = keyof Authenticators;\n\nexport interface Authenticators extends BaseAuthenticators {\n default: Authenticator;\n}\n","import { defineServiceState } from '@aerogel/core';\nimport type { ErrorSource } from '@aerogel/core';\nimport type { Fetch, SolidUserProfile } from '@noeldemartin/solid-utils';\n\nimport type { AuthSession } from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\n\nexport const DEFAULT_STATE = { autoReconnect: true };\n\nexport default defineServiceState({\n name: 'solid',\n persist: ['autoReconnect', 'dismissed', 'previousSession', 'profiles', 'staleProfiles'],\n initialState: {\n autoReconnect: DEFAULT_STATE.autoReconnect,\n dismissed: false,\n ignorePreviousSessionError: false,\n loginStartupError: null as ErrorSource | null,\n loginOngoing: false,\n preferredAuthenticator: null as AuthenticatorName | null,\n previousSession: null as {\n profile?: SolidUserProfile;\n authenticator: AuthenticatorName;\n loginUrl: string;\n error: ErrorSource | null;\n } | null,\n profiles: {} as Record<string, SolidUserProfile>,\n session: null as AuthSession | null,\n loginStale: false,\n staleProfiles: [] as string[],\n },\n serialize(state) {\n if (state.previousSession?.error instanceof Error) {\n state.previousSession.error = state.previousSession.error.message;\n }\n\n return state;\n },\n computed: {\n user: (state) => state.session?.user ?? state.previousSession?.profile ?? null,\n authenticator: (state) => state.session?.authenticator ?? null,\n fetch(): Fetch {\n return this.authenticator?.getAuthenticatedFetch() ?? globalThis.fetch.bind(globalThis);\n },\n error(state): ErrorSource | null {\n if (state.loginStartupError) {\n return state.loginStartupError ?? null;\n }\n\n if (state.ignorePreviousSessionError) {\n return null;\n }\n\n return state.previousSession?.error ?? null;\n },\n },\n});\n","import {\n after,\n arrayFilter,\n arrayUnique,\n arrayWithout,\n asyncMemo,\n facade,\n fail,\n getLocationQueryParameter,\n hasLocationQueryParameter,\n objectWithout,\n objectWithoutEmpty,\n parseBoolean,\n requireUrlParse,\n setAsyncMemo,\n tap,\n urlRoot,\n} from '@noeldemartin/utils';\nimport { App, Colors, Errors, Events, UI, translateWithDefault } from '@aerogel/core';\nimport { fetchLoginUserProfile } from '@noeldemartin/solid-utils';\nimport { setEngine } from 'soukai';\nimport { SolidACLAuthorization, SolidContainer, SolidDocument, SolidTypeIndex } from 'soukai-solid';\nimport type { ErrorSource } from '@aerogel/core';\nimport type { Fetch, SolidModelConstructor } from 'soukai-solid';\nimport type { SolidStore, SolidUserProfile } from '@noeldemartin/solid-utils';\n\nimport AuthenticationCancelledError from '@/errors/AuthenticationCancelledError';\nimport { ContainerAlreadyInUse } from '@/errors';\nimport { getAuthenticator } from '@/auth';\nimport type Authenticator from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\nimport type { AuthSession } from '@/auth/Authenticator';\n\nimport Service, { DEFAULT_STATE } from './Solid.state';\n\nexport type LoginOptions = {\n authenticator?: AuthenticatorName;\n onError?(error: ErrorSource): unknown;\n fallbackUrl?: string;\n loading?: boolean;\n};\n\nexport type ReconnectOptions = Omit<LoginOptions, 'authenticator'> & {\n force?: boolean;\n};\n\nexport class SolidService extends Service {\n\n public isLoggedIn(): this is { session: AuthSession; user: SolidUserProfile; authenticator: Authenticator } {\n return !!this.session;\n }\n\n public wasLoggedIn(): this is { user: SolidUserProfile } {\n return !!this.previousSession;\n }\n\n public hasLoggedIn(): this is { user: SolidUserProfile } {\n return !!(this.session || this.previousSession);\n }\n\n public requireAuthenticator(): Authenticator {\n return this.authenticator ?? fail('Could not get authenticator');\n }\n\n public requireUser(): SolidUserProfile {\n return this.user ?? fail('Could not get user profile (are you logged in?)');\n }\n\n public requireUserProfile(url: string): Promise<SolidUserProfile> {\n return this.getUserProfile(url, true);\n }\n\n public async getUserProfile(url: string, required: true): Promise<SolidUserProfile>;\n public async getUserProfile(url: string, required?: false): Promise<SolidUserProfile | null>;\n public async getUserProfile(url: string, required: boolean = false): Promise<SolidUserProfile | null> {\n let profileStore: SolidStore | null = null;\n const usingAuthenticatedFetch = !!this.authenticator?.getAuthenticatedFetch();\n\n return (\n this.profiles[url] ??\n tap(\n await fetchLoginUserProfile(url, {\n fetch: this.fetch,\n required,\n onLoaded(store) {\n profileStore = store;\n },\n }),\n async (profile) => {\n if (!profile) {\n return;\n }\n\n if (profileStore) {\n await Events.emit('solid:user-profile-loaded', [profile, profileStore]);\n }\n\n this.rememberProfile(profile);\n\n if (!usingAuthenticatedFetch) {\n this.setState({ staleProfiles: arrayUnique(this.staleProfiles.concat([profile.webId])) });\n }\n },\n )\n );\n }\n\n public async refreshUserProfile(): Promise<void> {\n if (!this.isLoggedIn()) {\n return;\n }\n\n this.setState({ profiles: objectWithout(this.profiles, [this.user.webId]) });\n\n const user = await this.requireUserProfile(this.user.webId);\n\n this.setState({\n session: {\n ...this.session,\n user,\n },\n });\n }\n\n public async login(loginUrl: string, options: LoginOptions = {}): Promise<boolean> {\n if (App.development && loginUrl === 'dev') {\n loginUrl = 'http://localhost:3000';\n }\n\n if (!/^https?:\\/\\//.test(loginUrl)) {\n options.fallbackUrl ??= `http://${loginUrl}`;\n loginUrl = `https://${loginUrl}`;\n }\n\n if (this.isLoggedIn()) {\n return true;\n }\n\n if (this.loginOngoing) {\n throw new Error('Authentication already in progress');\n }\n\n if (!options.loading) {\n return this.attemptLogin(loginUrl, options);\n }\n\n return UI.loading(translateWithDefault('solid.loggingIn', 'Logging in...'), () => {\n return this.attemptLogin(loginUrl, options);\n });\n }\n\n public async reconnect(options: ReconnectOptions = {}): Promise<void> {\n const { force, ...loginOptions } = options;\n if (this.isLoggedIn() || !this.previousSession || (this.previousSession.error !== null && !force)) {\n return;\n }\n\n await this.login(this.previousSession.loginUrl, {\n authenticator: this.previousSession.authenticator,\n ...loginOptions,\n loading: loginOptions.loading ?? false,\n });\n }\n\n public async logout(force: boolean = false): Promise<void> {\n const isCloudReady = !App.plugin('@aerogel/offline-first') || !!App.service('$cloud')?.ready;\n const hasLocalChanges = !App.plugin('@aerogel/offline-first') || !!App.service('$cloud')?.dirty;\n const [confirmLogout, options] = force\n ? [true, { wipeLocalData: isCloudReady }]\n : await UI.confirm(\n isCloudReady\n ? translateWithDefault('solid.logoutConfirmTitle', 'Log out from this device?')\n : translateWithDefault('solid.disconnectConfirmTitle', 'Disconnect account?'),\n isCloudReady\n ? hasLocalChanges\n ? translateWithDefault(\n 'solid.logoutConfirmMessageWithLocalChanges',\n 'There are some changes that haven\\'t been synchronized and will be lost, ' +\n 'but the rest of the data will remain in your Solid POD.',\n )\n : translateWithDefault(\n 'solid.logoutConfirmMessage',\n 'Logging out will remove all the data from this device, ' +\n 'but you\\'ll still have it in your Solid POD.',\n )\n : translateWithDefault(\n 'solid.disconnectConfirmMessage',\n 'You\\'ll need to introduce logging details again to connect to your Solid POD.',\n ),\n {\n acceptText: translateWithDefault('solid.logoutConfirmAccept', 'Log out'),\n acceptColor: Colors.Danger,\n cancelText: translateWithDefault(\n 'solid.logoutConfirmCancel',\n translateWithDefault('ui.cancel', 'Cancel'),\n ),\n checkboxes: isCloudReady\n ? hasLocalChanges\n ? {\n wipeLocalData: {\n label: translateWithDefault(\n 'solid.logoutConfirmWipeNotice',\n 'I understand that changes that haven\\'t been synchronized will be lost.',\n ),\n default: false,\n required: true,\n },\n }\n : undefined\n : {\n wipeLocalData: {\n label: translateWithDefault(\n 'solid.logoutConfirmWipe',\n 'Also remove all existing data (tasks, lists, etc.)',\n ),\n default: false,\n },\n },\n },\n );\n\n if (!confirmLogout) {\n return;\n }\n\n if (!this.previousSession) {\n return;\n }\n\n await UI.loading(translateWithDefault('solid.logoutOngoing', 'Logging out...'), async () => {\n this.setState({\n dismissed: false,\n ignorePreviousSessionError: false,\n loginStartupError: null,\n previousSession: null,\n ...DEFAULT_STATE,\n });\n\n this.isLoggedIn() && (await this.authenticator.logout());\n\n await Events.emit('auth:logout', { wipeLocalData: options.wipeLocalData ?? true });\n await Events.emit('auth:after-logout');\n });\n }\n\n public async whenLoggedIn<T>(callback: (session: AuthSession) => T): Promise<T> {\n if (this.isLoggedIn()) {\n return callback(this.session);\n }\n\n return new Promise((resolve) => {\n const onLogin = (session: AuthSession) => resolve(callback(session));\n\n Events.once('auth:login', onLogin);\n });\n }\n\n public dismiss(): void {\n this.setState({ dismissed: true });\n }\n\n public async findOrCreatePrivateTypeIndex(): Promise<SolidTypeIndex> {\n return (await this.findPrivateTypeIndex()) ?? (await this.createPrivateTypeIndex());\n }\n\n public async findPrivateTypeIndex(): Promise<SolidTypeIndex | null> {\n const { webId, privateTypeIndexUrl } = this.requireUser();\n const engine = this.requireAuthenticator().engine;\n\n if (!privateTypeIndexUrl) {\n return null;\n }\n\n return asyncMemo(`${webId}-privateTypeIndex`, () =>\n SolidTypeIndex.withEngine(engine).find(privateTypeIndexUrl));\n }\n\n public async findOrCreatePublicTypeIndex(): Promise<SolidTypeIndex> {\n return (await this.findPublicTypeIndex()) ?? (await this.createPublicTypeIndex());\n }\n\n public async findPublicTypeIndex(): Promise<SolidTypeIndex | null> {\n const { webId, publicTypeIndexUrl } = this.requireUser();\n const engine = this.requireAuthenticator().engine;\n\n if (!publicTypeIndexUrl) {\n return null;\n }\n\n return asyncMemo(`${webId}-publicTypeIndex`, () => SolidTypeIndex.withEngine(engine).find(publicTypeIndexUrl));\n }\n\n public async createPrivateContainer(options: {\n url: string;\n name?: string;\n registerFor?: SolidModelConstructor;\n reuseExisting?: boolean;\n }): Promise<SolidContainer> {\n const engine = this.requireAuthenticator().engine;\n\n return SolidContainer.withEngine(engine, async () => {\n const existingContainer = await SolidContainer.find(options.url);\n\n if (existingContainer && !options.reuseExisting) {\n throw new ContainerAlreadyInUse(existingContainer);\n }\n\n const container = existingContainer ?? new SolidContainer({ url: options.url, name: options.name });\n\n await container.save();\n\n if (options.registerFor) {\n const typeIndex = await this.findOrCreatePrivateTypeIndex();\n\n await container.register(typeIndex, options.registerFor);\n }\n\n return container;\n });\n }\n\n protected async boot(): Promise<void> {\n await Errors.booted;\n\n if (hasLocationQueryParameter('authenticator')) {\n this.setState({\n preferredAuthenticator: getLocationQueryParameter('authenticator') as AuthenticatorName,\n });\n }\n\n if (hasLocationQueryParameter('refreshProfile')) {\n this.setState({\n staleProfiles: arrayUnique(\n this.staleProfiles.concat(arrayFilter([this.session?.user.webId, this.previousSession?.loginUrl])),\n ),\n });\n }\n\n await this.restorePreviousSession();\n await this.startupReconnect();\n }\n\n protected async createPrivateTypeIndex(): Promise<SolidTypeIndex> {\n const user = this.requireUser();\n const authenticator = this.requireAuthenticator();\n const typeIndex = await SolidTypeIndex.withEngine(authenticator.engine).createPrivate(user);\n\n return tap(typeIndex, () => {\n user.privateTypeIndexUrl = typeIndex.url;\n\n setAsyncMemo(`${user.webId}-privateTypeIndex`, typeIndex);\n\n this.rememberProfile(user);\n });\n }\n\n public async createPublicTypeIndex(): Promise<SolidTypeIndex> {\n const user = this.requireUser();\n const authenticator = this.requireAuthenticator();\n const typeIndex = await SolidTypeIndex.withEngine(authenticator.engine).createPublic(user);\n\n return tap(typeIndex, () => {\n user.privateTypeIndexUrl = typeIndex.url;\n\n setAsyncMemo(`${user.webId}-publicTypeIndex`, typeIndex);\n\n this.rememberProfile(user);\n });\n }\n\n protected async attemptLogin(loginUrl: string, options: LoginOptions): Promise<boolean> {\n const authenticatorName = options.authenticator ?? this.preferredAuthenticator ?? 'default';\n const handleLoginError =\n options.onError ??\n ((error: ErrorSource) =>\n App.isMounted() ? Errors.report(error) : this.setState({ loginStartupError: error }));\n const staleTimeout = setTimeout(() => (this.loginStale = true), 10000);\n const initialState = {\n dismissed: this.dismissed,\n ignorePreviousSessionError: this.ignorePreviousSessionError,\n previousSession: this.previousSession,\n };\n this.loginOngoing = true;\n\n try {\n const profile = await this.getUserProfile(loginUrl);\n const oidcIssuerUrl = profile?.oidcIssuerUrl ?? urlRoot(profile?.webId ?? loginUrl);\n const authenticator = await this.bootAuthenticator(authenticatorName);\n const { domain: loginDomain } = requireUrlParse(loginUrl);\n\n this.setState({\n dismissed: false,\n ignorePreviousSessionError: true,\n previousSession: objectWithoutEmpty({\n profile,\n loginUrl,\n authenticator: authenticatorName,\n error: translateWithDefault(\n 'auth.stuckConnecting',\n `We didn't hear back from the identity provider at \\`${loginDomain}\\`, maybe try reconnecting?`,\n ),\n }),\n });\n\n await Events.emit('auth:before-login');\n\n // This should redirect away from the app, so in most cases\n // the rest of the code won't be reached.\n await authenticator.login(oidcIssuerUrl, profile);\n\n return true;\n } catch (error) {\n this.setState(initialState);\n\n if (error instanceof AuthenticationCancelledError) {\n return false;\n }\n\n if (options.fallbackUrl) {\n return after().then(() => this.login(options.fallbackUrl ?? '', objectWithout(options, 'fallbackUrl')));\n }\n\n handleLoginError(error);\n\n return false;\n } finally {\n clearTimeout(staleTimeout);\n\n this.setState({\n loginOngoing: false,\n loginStale: false,\n });\n }\n }\n\n private async restorePreviousSession(): Promise<void> {\n if (!this.previousSession) {\n return;\n }\n\n await this.bootAuthenticator(this.previousSession.authenticator);\n }\n\n private async startupReconnect(): Promise<void> {\n if (!this.reconnectOnStartup()) {\n return;\n }\n\n await this.reconnect();\n }\n\n private reconnectOnStartup(): boolean {\n if (hasLocationQueryParameter('autoReconnect')) {\n return parseBoolean(getLocationQueryParameter('autoReconnect'));\n }\n\n return this.autoReconnect;\n }\n\n private async bootAuthenticator(name: AuthenticatorName): Promise<Authenticator> {\n const authenticator = getAuthenticator(name);\n\n authenticator.addListener({\n onSessionStarted: async (session) => {\n this.setState({\n session,\n previousSession: {\n authenticator: authenticator.name,\n loginUrl: session.loginUrl,\n profile: session.user,\n error: null,\n },\n });\n\n if (this.staleProfiles.includes(session.user.webId)) {\n await this.refreshUserProfile();\n }\n\n App.plugin('@aerogel/offline-first') || setEngine(session.authenticator.engine);\n\n SolidACLAuthorization.setEngine(session.authenticator.engine);\n SolidTypeIndex.setEngine(session.authenticator.engine);\n SolidDocument.setEngine(session.authenticator.engine);\n\n await Events.emit('auth:login', session);\n },\n onSessionFailed: async (loginUrl, error) => {\n this.setState({\n session: null,\n previousSession: {\n authenticator: authenticator.name,\n loginUrl,\n error,\n },\n });\n },\n onSessionEnded: () => this.setState({ session: null }),\n onAuthenticatedFetchReady: (fetch) => Events.emit('auth:fetch-ready', fetch),\n });\n\n await authenticator.boot();\n\n return authenticator;\n }\n\n private rememberProfile(profile: SolidUserProfile): void {\n this.setState({\n profiles: {\n ...this.profiles,\n [profile.webId]: profile,\n },\n staleProfiles: arrayWithout(this.staleProfiles, profile.webId),\n });\n }\n\n}\n\nexport default facade(SolidService);\n\ndeclare module '@aerogel/core' {\n export interface EventsPayload {\n 'auth:fetch-ready': Fetch;\n 'auth:before-login': void;\n 'auth:login': AuthSession;\n 'auth:logout': { wipeLocalData: boolean };\n 'auth:after-logout': void;\n 'solid:user-profile-loaded': [SolidUserProfile, SolidStore];\n }\n}\n","<template>\n <img :src=\"sourceUrl\">\n</template>\n\n<script setup lang=\"ts\">\nimport { Cache, computedAsync, requiredStringProp } from '@aerogel/core';\n\nimport Solid from '@/services/Solid';\n\nconst props = defineProps({ src: requiredStringProp() });\nconst sourceUrl = computedAsync(async () => {\n const cachedResponse = (await Cache.get(props.src)) ?? (await downloadImage(props.src));\n const blob = await cachedResponse?.blob();\n\n return blob && URL.createObjectURL(blob);\n});\n\nasync function downloadImage(url: string) {\n try {\n const response = await Solid.fetch(url);\n\n if (response.status !== 200) {\n return null;\n }\n\n await Cache.store(url, response);\n\n return Cache.get(url);\n } catch (error) {\n return null;\n }\n}\n</script>\n","<template>\n <div>\n <slot v-if=\"$solid.loginStale\" name=\"login-stale\">\n <AGMarkdown :text=\"$td('solid.loginStale', 'This is taking too long...')\" />\n </slot>\n\n <slot v-if=\"$solid.loginOngoing\" name=\"login-ongoing\">\n <AGMarkdown :text=\"$td('ui.loading', 'Loading...')\" />\n </slot>\n\n <slot v-else-if=\"$solid.isLoggedIn()\" name=\"logged-in\" :session=\"$solid.session\">\n <div class=\"flex flex-col gap-3\">\n <AGMarkdown\n :text=\"\n $td('solid.loggedIn', 'You are logged in as [{userName}]({userWebId})', {\n userName: $solid.user.name ?? $solid.user.webId,\n userWebId: $solid.user.webId,\n })\n \"\n />\n <AGButton @click=\"$solid.logout()\">\n {{ $td('solid.logout', 'Logout') }}\n </AGButton>\n </div>\n </slot>\n\n <slot v-else name=\"logged-out\">\n <div class=\"flex flex-col\">\n <AGForm :form=\"form\" class=\"flex\" @submit=\"$solid.login(form.url)\">\n <AGInput\n name=\"url\"\n :aria-label=\"$td('solid.url', 'Login url')\"\n :placeholder=\"$td('solid.placeholder', 'https://...')\"\n />\n <AGButton submit>\n {{ $td('solid.login', 'Login') }}\n </AGButton>\n </AGForm>\n <AGButton v-if=\"$solid.wasLoggedIn()\" class=\"mt-3\" @click=\"$solid.reconnect({ force: true })\">\n {{ $td('solid.reconnect', 'Reconnect') }}\n </AGButton>\n <p\n v-if=\"$solid.previousSession?.error || $solid.loginStartupError\"\n class=\"mt-1 self-center text-sm text-red-800\"\n >\n <AGMarkdown :text=\"$td('solid.previousLoginError', 'Previous login attempt failed')\" inline />\n <AGLink @click=\"$errors.inspect($solid.previousSession?.error || $solid.loginStartupError)\">\n ({{ $td('errors.viewDetails', 'View details') }})\n </AGLink>\n </p>\n </div>\n </slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { AGButton, AGForm, AGInput, AGLink, AGMarkdown, requiredStringInput, useForm } from '@aerogel/core';\n\nconst form = useForm({ url: requiredStringInput() });\n</script>\n","<template>\n <div class=\"relative flex items-center justify-center rounded-full bg-gray-200\">\n <AGSolidImage\n v-if=\"$solid.user?.avatarUrl\"\n :src=\"$solid.user?.avatarUrl\"\n alt=\"\"\n class=\"absolute inset-0 h-full w-full rounded-full\"\n />\n <span v-else-if=\"userInitials\" class=\"text-sm font-semibold tracking-wider text-gray-500\" aria-hidden=\"true\">\n {{ userInitials }}\n </span>\n <IconAnonymous v-else class=\"h-6 w-6 text-gray-500\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport IconAnonymous from '~icons/ooui/user-anonymous';\n\nimport { computed } from 'vue';\n\nimport Solid from '@/services/Solid';\n\nimport AGSolidImage from './AGSolidImage.vue';\n\nconst userInitials = computed(() => {\n const name = Solid.user?.name ?? '';\n\n return name\n .trim()\n .split(' ')\n .map((part) => part[0]?.toUpperCase())\n .join('')\n .slice(0, 3);\n});\n</script>\n","import { Events, bootServices, registerErrorHandler } from '@aerogel/core';\nimport { bootSolidModels } from 'soukai-solid';\nimport type { Plugin } from '@aerogel/core';\nimport type { SolidStore, SolidUserProfile } from '@noeldemartin/solid-utils';\n\nimport Solid from '@/services/Solid';\nimport { DEFAULT_STATE } from '@/services/Solid.state';\nimport { defineFormValidationRules } from '@/forms/validation';\nimport {\n authenticators as baseAuthenticators,\n getAuthenticator,\n registerAuthenticators,\n setDefaultAuthenticator,\n} from '@/auth';\nimport { AuthenticationFailedError } from '@/errors';\nimport type Authenticator from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\n\nconst services = { $solid: Solid };\n\nexport * from './auth';\nexport * from './components';\nexport * from './errors';\nexport * from './services/Solid';\nexport { Solid };\n\nexport interface Options {\n autoReconnect?: boolean;\n authenticators?: Record<string, Authenticator>;\n defaultAuthenticator?: AuthenticatorName;\n onUserProfileLoaded?(user: SolidUserProfile, store: SolidStore): Promise<unknown> | unknown;\n}\n\nexport type SolidServices = typeof services;\n\nexport default function solid(options: Options = {}): Plugin {\n return {\n async install(app) {\n bootSolidModels();\n registerAuthenticators({ ...baseAuthenticators, ...(options.authenticators ?? {}) });\n defineFormValidationRules();\n setDefaultAuthenticator(getAuthenticator(options.defaultAuthenticator ?? 'inrupt'));\n registerErrorHandler((error) => {\n if (!(error instanceof AuthenticationFailedError)) {\n return;\n }\n\n return error.description ? `${error.message} (${error.description})` : error.message;\n });\n\n if (typeof options.autoReconnect === 'boolean') {\n DEFAULT_STATE.autoReconnect = options.autoReconnect;\n\n Solid.hasPersistedState() || (Solid.autoReconnect = options.autoReconnect);\n }\n\n if (options.onUserProfileLoaded) {\n Events.on('solid:user-profile-loaded', ([user, store]) => {\n options.onUserProfileLoaded?.(user, store);\n });\n }\n\n await bootServices(app, services);\n },\n };\n}\n\ndeclare module '@aerogel/core' {\n interface Services extends SolidServices {}\n}\n","import { defineFormValidationRule } from '@aerogel/core';\n\nexport function defineFormValidationRules(): void {\n defineFormValidationRule<string>('container_url', (value) => {\n if (value.endsWith('/')) {\n return;\n }\n\n return 'containerEndingSlashMissing';\n });\n}\n"],"names":["AuthenticationCancelledError","JSError","AuthenticationFailedError","constructor","message","description","options","super","getErrorMessage","_defineProperty","this","ContainerAlreadyInUse","container","url","Authenticator","arr","engine","_engine","SolidEngine","requireAuthenticatedFetch","getAuthenticatedFetch","authenticatedFetch","fail","addListener","listener","listeners","includes","push","removeListener","remove","boot","booted","PromisedValue","restoreSession","resolve","initAuthenticatedFetch","fetch","notifyListeners","startSession","sessionData","session","authenticator","failSession","loginUrl","error","endSession","event","_len","arguments","length","payload","Array","_key","Promise","all","toArray","map","async","callback","STORAGE_KEY","_authenticators","authenticators","inrupt","login","Storage","set","oidcIssuer","AerogelSolid","clientID","clientId","client_id","clientName","client_name","redirectUrl","redirect_uris","_login","after","seconds","logout","_logout","events","handleIncomingRedirect","then","require","_fetch","_events","_handleIncomingRedirect","loginFromRedirect","get","on","errorDescription","cause","globalThis","location","href","isLoggedIn","webId","initSession","default","Solid","Solid$1","user","requireUserProfile","setDefaultAuthenticator","getAuthenticator","name","registerAuthenticators","customAuthenticators","Object","entries","forEach","_ref","registerAuthenticator","DEFAULT_STATE","autoReconnect","Service","defineServiceState","persist","initialState","dismissed","ignorePreviousSessionError","loginStartupError","loginOngoing","preferredAuthenticator","previousSession","profiles","loginStale","staleProfiles","serialize","state","Error","computed","profile","bind","SolidService","wasLoggedIn","hasLoggedIn","requireAuthenticator","requireUser","getUserProfile","required","profileStore","usingAuthenticatedFetch","tap","fetchLoginUserProfile","onLoaded","store","Events","emit","rememberProfile","setState","arrayUnique","concat","refreshUserProfile","objectWithout","App","development","test","fallbackUrl","loading","UI","translateWithDefault","attemptLogin","reconnect","undefined","force","loginOptions","isCloudReady","plugin","service","ready","hasLocalChanges","dirty","confirmLogout","wipeLocalData","confirm","acceptText","acceptColor","Colors","Danger","cancelText","checkboxes","label","whenLoggedIn","once","dismiss","findOrCreatePrivateTypeIndex","findPrivateTypeIndex","createPrivateTypeIndex","privateTypeIndexUrl","asyncMemo","SolidTypeIndex","withEngine","find","findOrCreatePublicTypeIndex","findPublicTypeIndex","createPublicTypeIndex","publicTypeIndexUrl","createPrivateContainer","SolidContainer","existingContainer","reuseExisting","save","registerFor","typeIndex","register","Errors","hasLocationQueryParameter","getLocationQueryParameter","arrayFilter","restorePreviousSession","startupReconnect","createPrivate","setAsyncMemo","createPublic","authenticatorName","handleLoginError","onError","isMounted","report","staleTimeout","setTimeout","oidcIssuerUrl","urlRoot","bootAuthenticator","domain","loginDomain","requireUrlParse","objectWithoutEmpty","clearTimeout","reconnectOnStartup","parseBoolean","onSessionStarted","setEngine","SolidACLAuthorization","SolidDocument","onSessionFailed","onSessionEnded","onAuthenticatedFetchReady","arrayWithout","facade","props","__props","sourceUrl","computedAsync","cachedResponse","Cache","src","response","status","downloadImage","blob","URL","createObjectURL","form","useForm","requiredStringInput","userInitials","trim","split","part","toUpperCase","join","slice","services","$solid","install","app","bootSolidModels","baseAuthenticators","defineFormValidationRule","value","endsWith","defaultAuthenticator","registerErrorHandler","hasPersistedState","onUserProfileLoaded","bootServices"],"mappings":"09BAEqB,MAAAA,qCAAqCC,EAAAA,SCSrC,MAAAC,kCAAkCD,EAAAA,QAInDE,WAAAA,CAAYC,EAAiBC,EAA6BC,GACtDC,MAbR,SAAyBH,EAAiBC,GACtC,OAAKA,EAIK,GAAAD,MAAYC,KAHXD,CAIf,CAOcI,CAAgBJ,GAAUE,GAASG,EAAAA,QAAAC,KAAA,mBAAA,GAEzCA,KAAKL,YAAcA,CACvB,ECfiB,MAAAM,UAA8BV,EAAAA,QAE/CE,WAAAA,CAAYS,EAA2BN,GACnCC,sBAAsBK,EAAUC,wBAAyBP,EAC7D,ECqBU,MAAgBQ,EAAaX,WAAAA,GAAAM,EAAAA,QAAAC,KAAA,YAAA,GAAAD,EAAAA,QAAAC,KAAA,0BAAA,GAAAD,EAAAA,QAAAC,KAAA,cAAA,GAAAD,EAAAA,QAMmBM,KAAAA,YAAAA,EAAAA,IAA2B,KAAGN,EAAAA,QAAAC,KAAA,eAAA,EAAA,CAOxF,UAAWM,GAGP,OAFAN,KAAKO,QAAUP,KAAKO,SAAW,IAAIC,EAAAA,YAAYR,KAAKS,6BAE7CT,KAAKO,OAChB,CAEOG,qBAAAA,GACH,OAAOV,KAAKW,oBAAsB,IACtC,CAEOF,yBAAAA,GACH,OAAOT,KAAKW,oBAAsBC,EAAIA,KAAC,mCAC3C,CAEOC,WAAAA,CAAYC,GAGf,OAFK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,OAAO0C,EAAMvC,YAAc,GAAGuC,EAAMxC,YAAYwC,EAAMvC,eAAiBuC,EAAMxC,OAAO,IAGnD,kBAA1BE,EAAQ4G,gBACfD,EAAcC,cAAgB5G,EAAQ4G,cAEtCf,EAAMgL,sBAAwBhL,EAAMe,cAAgB5G,EAAQ4G,gBAG5D5G,EAAQ8Q,qBACRjI,SAAO1D,GAAG,6BAA6BsB,IAAkB,IAAhBV,EAAM6C,GAAMnC,EACjDzG,EAAQ8Q,sBAAsB/K,EAAM6C,EAAM,UAI5CmI,EAAYA,aAACV,EAAKH,EAC5B,EAER"}
@@ -0,0 +1,296 @@
1
+ import type { Closure } from '@noeldemartin/utils';
2
+ import { ComponentOptionsMixin } from 'vue';
3
+ import { Constructor } from '@noeldemartin/utils';
4
+ import { DefineComponent } from 'vue';
5
+ import type { Engine } from 'soukai';
6
+ import type { ErrorSource } from '@aerogel/core';
7
+ import { ExtractPropTypes } from 'vue';
8
+ import { Facade } from '@noeldemartin/utils';
9
+ import type { Fetch } from 'soukai-solid';
10
+ import type { Fetch as Fetch_2 } from '@noeldemartin/solid-utils';
11
+ import type { FluentArray } from '@noeldemartin/utils';
12
+ import type { GetClosureArgs } from '@noeldemartin/utils';
13
+ import { JSError } from '@noeldemartin/utils';
14
+ import type { JSErrorOptions } from '@noeldemartin/utils';
15
+ import type { Plugin as Plugin_2 } from '@aerogel/core';
16
+ import { PromisedValue } from '@noeldemartin/utils';
17
+ import { PropType } from 'vue';
18
+ import { PublicProps } from 'vue';
19
+ import { RendererElement } from 'vue';
20
+ import { RendererNode } from 'vue';
21
+ import { Service } from '@aerogel/core';
22
+ import { SolidContainer } from 'soukai-solid';
23
+ import { SolidEngine } from 'soukai-solid';
24
+ import type { SolidModelConstructor } from 'soukai-solid';
25
+ import type { SolidStore } from '@noeldemartin/solid-utils';
26
+ import { SolidTypeIndex } from 'soukai-solid';
27
+ import type { SolidUserProfile } from '@noeldemartin/solid-utils';
28
+ import { UnrefServiceState } from '@aerogel/core';
29
+ import { VNode } from 'vue';
30
+
31
+ export declare const AGSolidImage: DefineComponent< {
32
+ src: {
33
+ type?: PropType<string> | undefined;
34
+ validator?(value: unknown): boolean;
35
+ } & {
36
+ required: true;
37
+ };
38
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
39
+ [key: string]: any;
40
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
41
+ src: {
42
+ type?: PropType<string> | undefined;
43
+ validator?(value: unknown): boolean;
44
+ } & {
45
+ required: true;
46
+ };
47
+ }>>, {}, {}>;
48
+
49
+ export declare const AGSolidStatus: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
50
+ [key: string]: any;
51
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
52
+
53
+ export declare const AGSolidUserAvatar: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
54
+ [key: string]: any;
55
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
56
+
57
+ export declare class AuthenticationCancelledError extends JSError {
58
+ }
59
+
60
+ export declare class AuthenticationFailedError extends JSError {
61
+ readonly description?: string | null;
62
+ constructor(message: string, description?: string | null, options?: JSErrorOptions);
63
+ }
64
+
65
+ export declare abstract class Authenticator {
66
+ name: AuthenticatorName;
67
+ protected authenticatedFetch?: Fetch;
68
+ protected booted?: PromisedValue<void>;
69
+ protected listeners: FluentArray<AuthenticatorListener>;
70
+ protected _engine?: SolidEngine;
71
+ abstract login(loginUrl: string, user?: SolidUserProfile | null): Promise<AuthSession>;
72
+ abstract logout(): Promise<void>;
73
+ get engine(): Engine;
74
+ getAuthenticatedFetch(): Fetch | null;
75
+ requireAuthenticatedFetch(): Fetch;
76
+ addListener(listener: AuthenticatorListener): () => void;
77
+ removeListener(listener: AuthenticatorListener): void;
78
+ boot(): Promise<void>;
79
+ protected abstract restoreSession(): Promise<void>;
80
+ protected initAuthenticatedFetch(fetch: Fetch): Promise<void>;
81
+ protected startSession(sessionData: Omit<AuthSession, 'authenticator'>): Promise<AuthSession>;
82
+ protected failSession(loginUrl: string, error: ErrorSource): Promise<void>;
83
+ protected endSession(): Promise<void>;
84
+ protected notifyListeners<Event extends ListenerEvent>(event: Event, ...payload: ListenerEventPayload<Event>): Promise<void>;
85
+ }
86
+
87
+ export declare interface AuthenticatorListener {
88
+ onSessionStarted?: (session: AuthSession) => Promise<void> | void;
89
+ onSessionFailed?: (loginUrl: string, error: ErrorSource) => Promise<void> | void;
90
+ onSessionEnded?: () => Promise<void> | void;
91
+ onAuthenticatedFetchReady?: (fetch: Fetch) => Promise<void> | void;
92
+ }
93
+
94
+ export declare type AuthenticatorName = keyof Authenticators;
95
+
96
+ export declare interface Authenticators extends BaseAuthenticators {
97
+ default: Authenticator;
98
+ }
99
+
100
+ export declare const authenticators: {
101
+ inrupt: InruptAuthenticator;
102
+ };
103
+
104
+ export declare interface AuthSession {
105
+ user: SolidUserProfile;
106
+ loginUrl: string;
107
+ authenticator: Authenticator;
108
+ }
109
+
110
+ declare type BaseAuthenticators = typeof authenticators;
111
+
112
+ export declare class ContainerAlreadyInUse extends JSError {
113
+ constructor(container: SolidContainer, options?: JSErrorOptions);
114
+ }
115
+
116
+ declare const _default: Constructor<UnrefServiceState< {
117
+ autoReconnect: boolean;
118
+ dismissed: boolean;
119
+ ignorePreviousSessionError: boolean;
120
+ loginStartupError: unknown;
121
+ loginOngoing: boolean;
122
+ preferredAuthenticator: keyof Authenticators | null;
123
+ previousSession: {
124
+ profile?: SolidUserProfile | undefined;
125
+ authenticator: AuthenticatorName;
126
+ loginUrl: string;
127
+ error: ErrorSource | null;
128
+ } | null;
129
+ profiles: Record<string, SolidUserProfile>;
130
+ session: AuthSession | null;
131
+ loginStale: boolean;
132
+ staleProfiles: string[];
133
+ }>> & Constructor< {
134
+ user: SolidUserProfile | null;
135
+ authenticator: Authenticator | null;
136
+ fetch: Fetch_2;
137
+ error: unknown;
138
+ }> & Constructor<Service<UnrefServiceState< {
139
+ autoReconnect: boolean;
140
+ dismissed: boolean;
141
+ ignorePreviousSessionError: boolean;
142
+ loginStartupError: unknown;
143
+ loginOngoing: boolean;
144
+ preferredAuthenticator: keyof Authenticators | null;
145
+ previousSession: {
146
+ profile?: SolidUserProfile | undefined;
147
+ authenticator: AuthenticatorName;
148
+ loginUrl: string;
149
+ error: ErrorSource | null;
150
+ } | null;
151
+ profiles: Record<string, SolidUserProfile>;
152
+ session: AuthSession | null;
153
+ loginStale: boolean;
154
+ staleProfiles: string[];
155
+ }>, {
156
+ user: SolidUserProfile | null;
157
+ authenticator: Authenticator | null;
158
+ fetch: Fetch_2;
159
+ error: unknown;
160
+ }, Partial<UnrefServiceState< {
161
+ autoReconnect: boolean;
162
+ dismissed: boolean;
163
+ ignorePreviousSessionError: boolean;
164
+ loginStartupError: unknown;
165
+ loginOngoing: boolean;
166
+ preferredAuthenticator: keyof Authenticators | null;
167
+ previousSession: {
168
+ profile?: SolidUserProfile | undefined;
169
+ authenticator: AuthenticatorName;
170
+ loginUrl: string;
171
+ error: ErrorSource | null;
172
+ } | null;
173
+ profiles: Record<string, SolidUserProfile>;
174
+ session: AuthSession | null;
175
+ loginStale: boolean;
176
+ staleProfiles: string[];
177
+ }>>>>;
178
+
179
+ export declare function getAuthenticator<T extends AuthenticatorName>(name: T): Authenticators[T];
180
+
181
+ export declare interface IAGSolidStatusLoggedInSlotProps {
182
+ session: AuthSession;
183
+ }
184
+
185
+ declare class InruptAuthenticator extends Authenticator {
186
+ private _events;
187
+ private _fetch;
188
+ private _login;
189
+ private _logout;
190
+ private _handleIncomingRedirect;
191
+ login(loginUrl: string): Promise<AuthSession>;
192
+ logout(): Promise<void>;
193
+ protected restoreSession(): Promise<void>;
194
+ protected loginFromRedirect(): Promise<void>;
195
+ protected initSession(webId: string): Promise<void>;
196
+ }
197
+
198
+ declare type ListenerEvent = keyof AuthenticatorListener;
199
+
200
+ declare type ListenerEventPayload<Event extends ListenerEvent, Callback = AuthenticatorListener[Event]> = Callback extends Closure ? GetClosureArgs<Callback> : never;
201
+
202
+ export declare type LoginOptions = {
203
+ authenticator?: AuthenticatorName;
204
+ onError?(error: ErrorSource): unknown;
205
+ fallbackUrl?: string;
206
+ loading?: boolean;
207
+ };
208
+
209
+ export declare interface Options {
210
+ autoReconnect?: boolean;
211
+ authenticators?: Record<string, Authenticator>;
212
+ defaultAuthenticator?: AuthenticatorName;
213
+ onUserProfileLoaded?(user: SolidUserProfile, store: SolidStore): Promise<unknown> | unknown;
214
+ }
215
+
216
+ export declare type ReconnectOptions = Omit<LoginOptions, 'authenticator'> & {
217
+ force?: boolean;
218
+ };
219
+
220
+ export declare function registerAuthenticator<T extends AuthenticatorName>(name: T, authenticator: Authenticators[T]): void;
221
+
222
+ export declare function registerAuthenticators(customAuthenticators: Record<string, Authenticator>): void;
223
+
224
+ declare const services: {
225
+ $solid: Facade<SolidService, SolidService>;
226
+ };
227
+
228
+ export declare function setDefaultAuthenticator(authenticator: Authenticator): void;
229
+
230
+ export declare const Solid: Facade<SolidService, SolidService>;
231
+
232
+ declare function solid(options?: Options): Plugin_2;
233
+ export default solid;
234
+
235
+ export declare class SolidService extends _default {
236
+ isLoggedIn(): this is {
237
+ session: AuthSession;
238
+ user: SolidUserProfile;
239
+ authenticator: Authenticator;
240
+ };
241
+ wasLoggedIn(): this is {
242
+ user: SolidUserProfile;
243
+ };
244
+ hasLoggedIn(): this is {
245
+ user: SolidUserProfile;
246
+ };
247
+ requireAuthenticator(): Authenticator;
248
+ requireUser(): SolidUserProfile;
249
+ requireUserProfile(url: string): Promise<SolidUserProfile>;
250
+ getUserProfile(url: string, required: true): Promise<SolidUserProfile>;
251
+ getUserProfile(url: string, required?: false): Promise<SolidUserProfile | null>;
252
+ refreshUserProfile(): Promise<void>;
253
+ login(loginUrl: string, options?: LoginOptions): Promise<boolean>;
254
+ reconnect(options?: ReconnectOptions): Promise<void>;
255
+ logout(force?: boolean): Promise<void>;
256
+ whenLoggedIn<T>(callback: (session: AuthSession) => T): Promise<T>;
257
+ dismiss(): void;
258
+ findOrCreatePrivateTypeIndex(): Promise<SolidTypeIndex>;
259
+ findPrivateTypeIndex(): Promise<SolidTypeIndex | null>;
260
+ findOrCreatePublicTypeIndex(): Promise<SolidTypeIndex>;
261
+ findPublicTypeIndex(): Promise<SolidTypeIndex | null>;
262
+ createPrivateContainer(options: {
263
+ url: string;
264
+ name?: string;
265
+ registerFor?: SolidModelConstructor;
266
+ reuseExisting?: boolean;
267
+ }): Promise<SolidContainer>;
268
+ protected boot(): Promise<void>;
269
+ protected createPrivateTypeIndex(): Promise<SolidTypeIndex>;
270
+ createPublicTypeIndex(): Promise<SolidTypeIndex>;
271
+ protected attemptLogin(loginUrl: string, options: LoginOptions): Promise<boolean>;
272
+ private restorePreviousSession;
273
+ private startupReconnect;
274
+ private reconnectOnStartup;
275
+ private bootAuthenticator;
276
+ private rememberProfile;
277
+ }
278
+
279
+ export declare type SolidServices = typeof services;
280
+
281
+ export { }
282
+
283
+ declare module '@aerogel/core' {
284
+ interface Services extends SolidServices {}
285
+ }
286
+
287
+ declare module '@aerogel/core' {
288
+ export interface EventsPayload {
289
+ 'auth:fetch-ready': Fetch;
290
+ 'auth:before-login': void;
291
+ 'auth:login': AuthSession;
292
+ 'auth:logout': { wipeLocalData: boolean };
293
+ 'auth:after-logout': void;
294
+ 'solid:user-profile-loaded': [SolidUserProfile, SolidStore];
295
+ }
296
+ }
@@ -0,0 +1,2 @@
1
+ import{defineServiceState as e,Events as t,App as i,UI as s,translateWithDefault as o,Colors as r,Errors as n,defineFormValidationRule as a,requiredStringProp as l,computedAsync as c,Cache as u,useForm as d,requiredStringInput as h,AGMarkdown as g,AGButton as f,AGForm as p,AGInput as m,AGLink as v,registerErrorHandler as y,bootServices as w}from"@aerogel/core";import{SolidEngine as S,SolidTypeIndex as b,SolidContainer as I,SolidACLAuthorization as x,SolidDocument as P,bootSolidModels as A}from"soukai-solid";import"core-js/modules/esnext.async-iterator.find.js";import"core-js/modules/esnext.iterator.constructor.js";import"core-js/modules/esnext.iterator.find.js";import{JSError as $,arr as L,fail as _,PromisedValue as U,Storage as E,after as C,facade as T,tap as j,arrayUnique as R,objectWithout as k,asyncMemo as F,hasLocationQueryParameter as q,getLocationQueryParameter as O,arrayFilter as D,setAsyncMemo as G,urlRoot as z,requireUrlParse as M,objectWithoutEmpty as W,parseBoolean as N,arrayWithout as H}from"@noeldemartin/utils";import{fetchLoginUserProfile as B}from"@noeldemartin/solid-utils";import{setEngine as Y}from"soukai";import V from"@babel/runtime/helpers/esm/defineProperty";import"core-js/modules/esnext.async-iterator.for-each.js";import"core-js/modules/esnext.iterator.for-each.js";import"core-js/modules/esnext.async-iterator.map.js";import"core-js/modules/esnext.iterator.map.js";import"core-js/modules/esnext.async-iterator.constructor.js";import"core-js/modules/esnext.async-iterator.to-array.js";import"core-js/modules/esnext.iterator.to-array.js";import J from"virtual:aerogel-solid";import{defineComponent as K,openBlock as Q,createElementBlock as X,unref as Z,renderSlot as ee,createVNode as te,createCommentVNode as ie,createElementVNode as se,withCtx as oe,createTextVNode as re,toDisplayString as ne,createBlock as ae,computed as le}from"vue";class AuthenticationCancelledError extends ${}class AuthenticationFailedError extends ${constructor(e,t,i){super(function(e,t){return t?`${e} (${t})`:e}(e),i),V(this,"description",void 0),this.description=t}}class ce extends ${constructor(e,t){super(`Container at ${e.url} is already in use`,t)}}class ue{constructor(){V(this,"name",void 0),V(this,"authenticatedFetch",void 0),V(this,"booted",void 0),V(this,"listeners",L([])),V(this,"_engine",void 0)}get engine(){return this._engine=this._engine??new S(this.requireAuthenticatedFetch()),this._engine}getAuthenticatedFetch(){return this.authenticatedFetch??null}requireAuthenticatedFetch(){return this.authenticatedFetch??_("Authenticated fetch is not ready")}addListener(e){return this.listeners.includes(e)||this.listeners.push(e),()=>{this.removeListener(e)}}removeListener(e){this.listeners.includes(e)&&this.listeners.remove(e)}async boot(){if(this.booted)return this.booted;this.booted=new U,await this.restoreSession(),this.booted.resolve()}async initAuthenticatedFetch(e){this.authenticatedFetch=e,await this.notifyListeners("onAuthenticatedFetchReady",e)}async startSession(e){const t={authenticator:this,...e};return await this.notifyListeners("onSessionStarted",t),t}async failSession(e,t){await this.notifyListeners("onSessionFailed",e,t)}async endSession(){await this.notifyListeners("onSessionEnded")}async notifyListeners(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];await Promise.all(this.listeners.toArray().map((async t=>{const s=t[e];await(s?.(...i))})))}}const de="inrupt-authenticator";const he={},ge={inrupt:new class extends ue{constructor(){super(...arguments),V(this,"_events",void 0),V(this,"_fetch",void 0),V(this,"_login",void 0),V(this,"_logout",void 0),V(this,"_handleIncomingRedirect",void 0)}async login(e){E.set(de,e);const t={oidcIssuer:e};return J.clientID&&(t.clientId=J.clientID.client_id,t.clientName=J.clientID.client_name,t.redirectUrl=J.clientID.redirect_uris[0]),await this._login(t),await C({seconds:60}),_("Browser should have redirected, but it didn't")}async logout(){await this._logout(),await this.endSession()}async restoreSession(){const{events:e,fetch:t,handleIncomingRedirect:i,login:s,logout:o}=await import("./InruptAuthenticator.lazy.hash.esm.js");this._fetch=t,this._login=s,this._logout=o,this._events=e,this._handleIncomingRedirect=i,await this.loginFromRedirect()}async loginFromRedirect(){const e=E.get(de);if(!e)return;this._events().on("error",((t,i)=>{t??="Error using Inrupt Authenticator method","object"==typeof i?this.failSession(e,new AuthenticationFailedError(t,null,{cause:i})):this.failSession(e,new AuthenticationFailedError(t,i))}));const t=await this._handleIncomingRedirect(globalThis.location.href);E.remove(de),t?.isLoggedIn&&t.webId&&await this.initSession(t.webId)}async initSession(e){await this.initAuthenticatedFetch(this._fetch);try{const{default:t}=await Promise.resolve().then((function(){return Ie})),i=await t.requireUserProfile(e);await this.startSession({user:i,loginUrl:e})}catch(t){await this.failSession(e,t)}}}};function fe(e){he.default=e}function pe(e){return he[e]}function me(e){Object.entries(e).forEach((e=>{let[t,i]=e;return ve(t,i)}))}function ve(e,t){he[e]=t,t.name=t.name??e}const ye={autoReconnect:!0};var we=e({name:"solid",persist:["autoReconnect","dismissed","previousSession","profiles","staleProfiles"],initialState:{autoReconnect:ye.autoReconnect,dismissed:!1,ignorePreviousSessionError:!1,loginStartupError:null,loginOngoing:!1,preferredAuthenticator:null,previousSession:null,profiles:{},session:null,loginStale:!1,staleProfiles:[]},serialize:e=>(e.previousSession?.error instanceof Error&&(e.previousSession.error=e.previousSession.error.message),e),computed:{user:e=>e.session?.user??e.previousSession?.profile??null,authenticator:e=>e.session?.authenticator??null,fetch(){return this.authenticator?.getAuthenticatedFetch()??globalThis.fetch.bind(globalThis)},error:e=>e.loginStartupError?e.loginStartupError??null:e.ignorePreviousSessionError?null:e.previousSession?.error??null}});class Se extends we{isLoggedIn(){return!!this.session}wasLoggedIn(){return!!this.previousSession}hasLoggedIn(){return!(!this.session&&!this.previousSession)}requireAuthenticator(){return this.authenticator??_("Could not get authenticator")}requireUser(){return this.user??_("Could not get user profile (are you logged in?)")}requireUserProfile(e){return this.getUserProfile(e,!0)}async getUserProfile(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=null;const o=!!this.authenticator?.getAuthenticatedFetch();return this.profiles[e]??j(await B(e,{fetch:this.fetch,required:i,onLoaded(e){s=e}}),(async e=>{e&&(s&&await t.emit("solid:user-profile-loaded",[e,s]),this.rememberProfile(e),o||this.setState({staleProfiles:R(this.staleProfiles.concat([e.webId]))}))}))}async refreshUserProfile(){if(!this.isLoggedIn())return;this.setState({profiles:k(this.profiles,[this.user.webId])});const e=await this.requireUserProfile(this.user.webId);this.setState({session:{...this.session,user:e}})}async login(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i.development&&"dev"===e&&(e="http://localhost:3000"),/^https?:\/\//.test(e)||(t.fallbackUrl??=`http://${e}`,e=`https://${e}`),this.isLoggedIn())return!0;if(this.loginOngoing)throw new Error("Authentication already in progress");return t.loading?s.loading(o("solid.loggingIn","Logging in..."),(()=>this.attemptLogin(e,t))):this.attemptLogin(e,t)}async reconnect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{force:t,...i}=e;this.isLoggedIn()||!this.previousSession||null!==this.previousSession.error&&!t||await this.login(this.previousSession.loginUrl,{authenticator:this.previousSession.authenticator,...i,loading:i.loading??!1})}async logout(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const n=!i.plugin("@aerogel/offline-first")||!!i.service("$cloud")?.ready,a=!i.plugin("@aerogel/offline-first")||!!i.service("$cloud")?.dirty,[l,c]=e?[!0,{wipeLocalData:n}]:await s.confirm(n?o("solid.logoutConfirmTitle","Log out from this device?"):o("solid.disconnectConfirmTitle","Disconnect account?"),n?a?o("solid.logoutConfirmMessageWithLocalChanges","There are some changes that haven't been synchronized and will be lost, but the rest of the data will remain in your Solid POD."):o("solid.logoutConfirmMessage","Logging out will remove all the data from this device, but you'll still have it in your Solid POD."):o("solid.disconnectConfirmMessage","You'll need to introduce logging details again to connect to your Solid POD."),{acceptText:o("solid.logoutConfirmAccept","Log out"),acceptColor:r.Danger,cancelText:o("solid.logoutConfirmCancel",o("ui.cancel","Cancel")),checkboxes:n?a?{wipeLocalData:{label:o("solid.logoutConfirmWipeNotice","I understand that changes that haven't been synchronized will be lost."),default:!1,required:!0}}:void 0:{wipeLocalData:{label:o("solid.logoutConfirmWipe","Also remove all existing data (tasks, lists, etc.)"),default:!1}}});l&&this.previousSession&&await s.loading(o("solid.logoutOngoing","Logging out..."),(async()=>{this.setState({dismissed:!1,ignorePreviousSessionError:!1,loginStartupError:null,previousSession:null,...ye}),this.isLoggedIn()&&await this.authenticator.logout(),await t.emit("auth:logout",{wipeLocalData:c.wipeLocalData??!0}),await t.emit("auth:after-logout")}))}async whenLoggedIn(e){return this.isLoggedIn()?e(this.session):new Promise((i=>{t.once("auth:login",(t=>i(e(t))))}))}dismiss(){this.setState({dismissed:!0})}async findOrCreatePrivateTypeIndex(){return await this.findPrivateTypeIndex()??await this.createPrivateTypeIndex()}async findPrivateTypeIndex(){const{webId:e,privateTypeIndexUrl:t}=this.requireUser(),i=this.requireAuthenticator().engine;return t?F(`${e}-privateTypeIndex`,(()=>b.withEngine(i).find(t))):null}async findOrCreatePublicTypeIndex(){return await this.findPublicTypeIndex()??await this.createPublicTypeIndex()}async findPublicTypeIndex(){const{webId:e,publicTypeIndexUrl:t}=this.requireUser(),i=this.requireAuthenticator().engine;return t?F(`${e}-publicTypeIndex`,(()=>b.withEngine(i).find(t))):null}async createPrivateContainer(e){const t=this.requireAuthenticator().engine;return I.withEngine(t,(async()=>{const t=await I.find(e.url);if(t&&!e.reuseExisting)throw new ce(t);const i=t??new I({url:e.url,name:e.name});if(await i.save(),e.registerFor){const t=await this.findOrCreatePrivateTypeIndex();await i.register(t,e.registerFor)}return i}))}async boot(){await n.booted,q("authenticator")&&this.setState({preferredAuthenticator:O("authenticator")}),q("refreshProfile")&&this.setState({staleProfiles:R(this.staleProfiles.concat(D([this.session?.user.webId,this.previousSession?.loginUrl])))}),await this.restorePreviousSession(),await this.startupReconnect()}async createPrivateTypeIndex(){const e=this.requireUser(),t=this.requireAuthenticator(),i=await b.withEngine(t.engine).createPrivate(e);return j(i,(()=>{e.privateTypeIndexUrl=i.url,G(`${e.webId}-privateTypeIndex`,i),this.rememberProfile(e)}))}async createPublicTypeIndex(){const e=this.requireUser(),t=this.requireAuthenticator(),i=await b.withEngine(t.engine).createPublic(e);return j(i,(()=>{e.privateTypeIndexUrl=i.url,G(`${e.webId}-publicTypeIndex`,i),this.rememberProfile(e)}))}async attemptLogin(e,s){const r=s.authenticator??this.preferredAuthenticator??"default",a=s.onError??(e=>i.isMounted()?n.report(e):this.setState({loginStartupError:e})),l=setTimeout((()=>this.loginStale=!0),1e4),c={dismissed:this.dismissed,ignorePreviousSessionError:this.ignorePreviousSessionError,previousSession:this.previousSession};this.loginOngoing=!0;try{const i=await this.getUserProfile(e),s=i?.oidcIssuerUrl??z(i?.webId??e),n=await this.bootAuthenticator(r),{domain:a}=M(e);return this.setState({dismissed:!1,ignorePreviousSessionError:!0,previousSession:W({profile:i,loginUrl:e,authenticator:r,error:o("auth.stuckConnecting",`We didn't hear back from the identity provider at \`${a}\`, maybe try reconnecting?`)})}),await t.emit("auth:before-login"),await n.login(s,i),!0}catch(e){return this.setState(c),e instanceof AuthenticationCancelledError?!1:s.fallbackUrl?C().then((()=>this.login(s.fallbackUrl??"",k(s,"fallbackUrl")))):(a(e),!1)}finally{clearTimeout(l),this.setState({loginOngoing:!1,loginStale:!1})}}async restorePreviousSession(){this.previousSession&&await this.bootAuthenticator(this.previousSession.authenticator)}async startupReconnect(){this.reconnectOnStartup()&&await this.reconnect()}reconnectOnStartup(){return q("autoReconnect")?N(O("autoReconnect")):this.autoReconnect}async bootAuthenticator(e){const s=pe(e);return s.addListener({onSessionStarted:async e=>{this.setState({session:e,previousSession:{authenticator:s.name,loginUrl:e.loginUrl,profile:e.user,error:null}}),this.staleProfiles.includes(e.user.webId)&&await this.refreshUserProfile(),i.plugin("@aerogel/offline-first")||Y(e.authenticator.engine),x.setEngine(e.authenticator.engine),b.setEngine(e.authenticator.engine),P.setEngine(e.authenticator.engine),await t.emit("auth:login",e)},onSessionFailed:async(e,t)=>{this.setState({session:null,previousSession:{authenticator:s.name,loginUrl:e,error:t}})},onSessionEnded:()=>this.setState({session:null}),onAuthenticatedFetchReady:e=>t.emit("auth:fetch-ready",e)}),await s.boot(),s}rememberProfile(e){this.setState({profiles:{...this.profiles,[e.webId]:e},staleProfiles:H(this.staleProfiles,e.webId)})}}var be=T(Se),Ie=Object.freeze({__proto__:null,SolidService:Se,default:be});const xe=["src"];var Pe=K({__name:"AGSolidImage",props:{src:l()},setup(e){const t=e,i=c((async()=>{const e=await u.get(t.src)??await async function(e){try{const t=await be.fetch(e);return 200!==t.status?null:(await u.store(e,t),u.get(e))}catch(e){return null}}(t.src),i=await(e?.blob());return i&&URL.createObjectURL(i)}));return(e,t)=>(Q(),X("img",{src:Z(i)},null,8,xe))}});Pe.__file="src/components/AGSolidImage.vue";const Ae={class:"flex flex-col gap-3"},$e={class:"flex flex-col"},Le={key:1,class:"mt-1 self-center text-sm text-red-800"};var _e=K({__name:"AGSolidStatus",setup(e){const t=d({url:h()});return(e,i)=>(Q(),X("div",null,[e.$solid.loginStale?ee(e.$slots,"login-stale",{key:0},(()=>[te(Z(g),{text:e.$td("solid.loginStale","This is taking too long...")},null,8,["text"])])):ie("v-if",!0),e.$solid.loginOngoing?ee(e.$slots,"login-ongoing",{key:1},(()=>[te(Z(g),{text:e.$td("ui.loading","Loading...")},null,8,["text"])])):e.$solid.isLoggedIn()?ee(e.$slots,"logged-in",{key:2,session:e.$solid.session},(()=>[se("div",Ae,[te(Z(g),{text:e.$td("solid.loggedIn","You are logged in as [{userName}]({userWebId})",{userName:e.$solid.user.name??e.$solid.user.webId,userWebId:e.$solid.user.webId})},null,8,["text"]),te(Z(f),{onClick:i[0]||(i[0]=t=>e.$solid.logout())},{default:oe((()=>[re(ne(e.$td("solid.logout","Logout")),1)])),_:1})])])):ee(e.$slots,"logged-out",{key:3},(()=>[se("div",$e,[te(Z(p),{form:Z(t),class:"flex",onSubmit:i[1]||(i[1]=i=>e.$solid.login(Z(t).url))},{default:oe((()=>[te(Z(m),{name:"url","aria-label":e.$td("solid.url","Login url"),placeholder:e.$td("solid.placeholder","https://...")},null,8,["aria-label","placeholder"]),te(Z(f),{submit:""},{default:oe((()=>[re(ne(e.$td("solid.login","Login")),1)])),_:1})])),_:1},8,["form"]),e.$solid.wasLoggedIn()?(Q(),ae(Z(f),{key:0,class:"mt-3",onClick:i[2]||(i[2]=t=>e.$solid.reconnect({force:!0}))},{default:oe((()=>[re(ne(e.$td("solid.reconnect","Reconnect")),1)])),_:1})):ie("v-if",!0),e.$solid.previousSession?.error||e.$solid.loginStartupError?(Q(),X("p",Le,[te(Z(g),{text:e.$td("solid.previousLoginError","Previous login attempt failed"),inline:""},null,8,["text"]),te(Z(v),{onClick:i[3]||(i[3]=t=>e.$errors.inspect(e.$solid.previousSession?.error||e.$solid.loginStartupError))},{default:oe((()=>[re(" ("+ne(e.$td("errors.viewDetails","View details"))+") ",1)])),_:1})])):ie("v-if",!0)])]))]))}});_e.__file="src/components/AGSolidStatus.vue";const Ue={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"},Ee=[se("path",{fill:"currentColor",d:"M15 2H5L4 8h12zM0 10s2 1 10 1s10-1 10-1l-4-2H4zm8 4h4v1H8z"},null,-1),se("circle",{cx:"6",cy:"15",r:"3",fill:"currentColor"},null,-1),se("circle",{cx:"14",cy:"15",r:"3",fill:"currentColor"},null,-1)];var Ce={name:"ooui-user-anonymous",render:function(e,t){return Q(),X("svg",Ue,[...Ee])}};const Te={class:"relative flex items-center justify-center rounded-full bg-gray-200"},je={key:1,class:"text-sm font-semibold tracking-wider text-gray-500","aria-hidden":"true"};var Re=K({__name:"AGSolidUserAvatar",setup(e){const t=le((()=>(be.user?.name??"").trim().split(" ").map((e=>e[0]?.toUpperCase())).join("").slice(0,3)));return(e,i)=>(Q(),X("div",Te,[e.$solid.user?.avatarUrl?(Q(),ae(Pe,{key:0,src:e.$solid.user?.avatarUrl,alt:"",class:"absolute inset-0 h-full w-full rounded-full"},null,8,["src"])):t.value?(Q(),X("span",je,ne(t.value),1)):(Q(),ae(Z(Ce),{key:2,class:"h-6 w-6 text-gray-500"}))]))}});Re.__file="src/components/AGSolidUserAvatar.vue";const ke={$solid:be};function Fe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{async install(i){A(),me({...ge,...e.authenticators??{}}),a("container_url",(e=>{if(!e.endsWith("/"))return"containerEndingSlashMissing"})),fe(pe(e.defaultAuthenticator??"inrupt")),y((e=>{if(e instanceof AuthenticationFailedError)return e.description?`${e.message} (${e.description})`:e.message})),"boolean"==typeof e.autoReconnect&&(ye.autoReconnect=e.autoReconnect,be.hasPersistedState()||(be.autoReconnect=e.autoReconnect)),e.onUserProfileLoaded&&t.on("solid:user-profile-loaded",(t=>{let[i,s]=t;e.onUserProfileLoaded?.(i,s)})),await w(i,ke)}}}export{Pe as AGSolidImage,_e as AGSolidStatus,Re as AGSolidUserAvatar,AuthenticationCancelledError,AuthenticationFailedError,ue as Authenticator,ce as ContainerAlreadyInUse,be as Solid,Se as SolidService,ge as authenticators,Fe as default,pe as getAuthenticator,ve as registerAuthenticator,me as registerAuthenticators,fe as setDefaultAuthenticator};
2
+ //# sourceMappingURL=aerogel-plugin-solid.esm.js.map