{"version":"1","settings":{"appTitle":"BackendX","appVersion":"v.261109.1","modules":{"LoginScreen":{"title":null,"showForgotPassword":true,"followEndedSession":true},"Dashboard":{"assistant":true,"applyTheme":true,"assistantPrompts":{"buildPrompt":"You help a person build a dashboard over their records. The dashboard configuration reference follows — what each part of a configuration does, what a value is computed over, the rules that make a dashboard draw nothing, and worked examples — and then the JSON Schema of a configuration, which is its exact format. After them comes this dashboard: the records' fields (path and type), the number of records, a sample of records spread over the whole set, and the dashboard's current configuration.\n\nAnswer with two things. \"message\": what you did, or what you need to know before you can, in plain words and short. \"config\": the whole dashboard configuration as JSON text — every view, the layout and the reference tables, exactly in the schema's format — or an empty string when you propose no change. Change the current configuration rather than starting over, unless the person asks for a new dashboard: keep everything they did not ask to change exactly as it is — every page with its id, title, rows, cols and tiles, every view, the reference tables and their rows. Put a new view where the person says; when they do not say, on the page the dashboard opens on, in a row added below its grid. A rows list sorts only by one of its columns: defaultSort.field is a column's as. Use only fields that exist in the records, and open a datagroup before reading its fields. Leave out the \"assistant\" key. A value written as VALUE_ and a number stands for a value hidden from you: use it exactly as written. A value written as HIDDEN is one never sent to you: the field exists and you may build with it, but never write HIDDEN into the configuration as a value.","readPrompt":"You read a dashboard for a person and answer their questions about it: summaries, what stands out, comparisons, recommendations. The dashboard configuration reference follows, and then the JSON Schema of a configuration; together they say what each setting of a view means and what each value is computed over. After them comes the dashboard: the number of records, and every view on the page — its configuration and the rows it draws. The rows of charts, summary lists and cards are given in full. A rows list's rows are not given, only how many it shows: draw no conclusion about its contents, and say so when asked about them.\n\nAnswer with \"message\": your answer written in Markdown for a narrow chat panel — first the answer itself, in a sentence or two; then, when there is more to say, a ### heading per topic, a bullet per finding, a table when comparing several items on the same figures, and the figures that matter in **bold**; no links or images. A short question gets a short answer, without headings. And \"config\": always an empty string. A value written as VALUE_ and a number stands for a value hidden from you: use it exactly as written. A value written as HIDDEN is one never sent to you: say so when asked about it, and draw no conclusion from it.","replySchema":{"type":"object","properties":{"message":{"type":"string"},"config":{"type":"string"}},"required":["message","config"],"additionalProperties":false}},"defaultCardMarkup":"<div class=\"dash-card\">\n  <div class=\"dash-card-value\">{{ numberComma(row.records) }}</div>\n  <div class=\"dash-card-label\">Records</div>\n</div>","starters":[{"id":"top10","title":"Top 10 by category","description":"A bar chart of the 10 biggest groups, by how many records each has.","needsText":"a category field","needs":[{"question":"Which field are the categories?"}],"sketch":"<svg viewBox='0 0 120 64' width='120' height='64' aria-hidden='true'><rect x='4' y='4' width='9' height='56' rx='1' fill='currentColor' opacity='1.00'/><rect x='16' y='12' width='9' height='48' rx='1' fill='currentColor' opacity='0.95'/><rect x='28' y='19' width='9' height='41' rx='1' fill='currentColor' opacity='0.90'/><rect x='40' y='25' width='9' height='35' rx='1' fill='currentColor' opacity='0.85'/><rect x='52' y='31' width='9' height='29' rx='1' fill='currentColor' opacity='0.80'/><rect x='64' y='36' width='9' height='24' rx='1' fill='currentColor' opacity='0.75'/><rect x='76' y='41' width='9' height='19' rx='1' fill='currentColor' opacity='0.70'/><rect x='88' y='45' width='9' height='15' rx='1' fill='currentColor' opacity='0.65'/><rect x='100' y='49' width='9' height='11' rx='1' fill='currentColor' opacity='0.60'/><rect x='112' y='52' width='9' height='8' rx='1' fill='currentColor' opacity='0.55'/></svg>","view":{"id":"@id","type":"chart","title":"Top 10 by @l1","source":{"select":"rows","path":[]},"chart":{"type":"bar","orientation":"vertical"},"processing":[{"id":"g","ord":1,"type":"group","levels":[{"path":"@f1","as":"category","label":"@l1"}],"values":[{"as":"records","label":"Records","align":"right"}]},{"id":"o","ord":2,"type":"order","field":"records","dir":"desc"},{"id":"k","ord":3,"type":"keep","upTo":10}]}},{"id":"countper","title":"Count per category","description":"A list with one line per value and how many records have it, largest first.","needsText":"a category field","needs":[{"question":"Which field are the categories?"}],"sketch":"<svg viewBox='0 0 120 64' width='120' height='64' aria-hidden='true'><rect x='4' y='6' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='6' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='4' y='18' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='18' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='4' y='30' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='30' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='4' y='42' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='42' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='4' y='54' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='54' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/></svg>","view":{"id":"@id","type":"list","listType":"summary","title":"Records by @l1","source":{"select":"rows","path":[]},"options":{"pageSize":20},"processing":[{"id":"g","ord":1,"type":"group","levels":[{"path":"@f1","as":"category","label":"@l1"}],"values":[{"as":"records","label":"Records","align":"right"}]},{"id":"o","ord":2,"type":"order","field":"records","dir":"desc"}]}},{"id":"totalper","title":"Total per category","description":"A bar chart adding up a number for each group.","needsText":"a category field · a number field","needs":[{"question":"Which field are the categories?"},{"question":"Which field holds the number to add up?"}],"sketch":"<svg viewBox='0 0 120 64' width='120' height='64' aria-hidden='true'><rect x='4' y='30' width='14' height='30' rx='1' fill='currentColor' opacity='1.00'/><rect x='23' y='8' width='14' height='52' rx='1' fill='currentColor' opacity='0.95'/><rect x='42' y='38' width='14' height='22' rx='1' fill='currentColor' opacity='0.90'/><rect x='61' y='16' width='14' height='44' rx='1' fill='currentColor' opacity='0.85'/><rect x='80' y='24' width='14' height='36' rx='1' fill='currentColor' opacity='0.80'/><rect x='99' y='46' width='14' height='14' rx='1' fill='currentColor' opacity='0.75'/></svg>","view":{"id":"@id","type":"chart","title":"@l2 by @l1","source":{"select":"rows","path":[]},"chart":{"type":"bar","orientation":"vertical"},"processing":[{"id":"g","ord":1,"type":"group","levels":[{"path":"@f1","as":"category","label":"@l1"}],"values":[{"op":"sum","valueField":"@f2","as":"total","label":"@l2","align":"right"}]},{"id":"o","ord":2,"type":"order","field":"total","dir":"desc"}]}},{"id":"overtime","title":"Over time","description":"A line chart of how many records there are each month.","needsText":"a date field","needs":[{"question":"Which field holds the date?"}],"sketch":"<svg viewBox='0 0 120 64' width='120' height='64' aria-hidden='true'><polyline points='4,50 22,40 40,44 58,26 76,32 94,14 116,20' fill='none' stroke='currentColor' stroke-width='3' stroke-linejoin='round'/><line x1='4' y1='60' x2='116' y2='60' stroke='currentColor' opacity='0.3'/></svg>","view":{"id":"@id","type":"chart","title":"Records per month","source":{"select":"rows","path":[]},"chart":{"type":"line","orientation":"vertical"},"processing":[{"id":"g","ord":1,"type":"group","levels":[{"path":"@f1","as":"month","bucket":"month","label":"Month"}],"values":[{"as":"records","label":"Records","align":"right"}]},{"id":"o","ord":2,"type":"order","field":"month"}]}},{"id":"breakdown","title":"Breakdown table","description":"A list of each group and the details inside it with their counts, each group’s lines shaded together.","needsText":"a group field · a detail field","needs":[{"question":"Which field are the groups?"},{"question":"Which field are the details inside each group?"}],"sketch":"<svg viewBox='0 0 120 64' width='120' height='64' aria-hidden='true'><rect x='0' y='2' width='120' height='12' fill='currentColor' opacity='0.12'/><rect x='4' y='6' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='6' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='0' y='12' width='120' height='12' fill='currentColor' opacity='0.12'/><rect x='4' y='16' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='16' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='4' y='26' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='26' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='4' y='36' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='36' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='0' y='42' width='120' height='12' fill='currentColor' opacity='0.12'/><rect x='4' y='46' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='46' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/><rect x='0' y='52' width='120' height='12' fill='currentColor' opacity='0.12'/><rect x='4' y='56' width='62' height='4' rx='2' fill='currentColor' opacity='0.45'/><rect x='92' y='56' width='24' height='4' rx='2' fill='currentColor' opacity='0.8'/></svg>","view":{"id":"@id","type":"list","listType":"summary","title":"@l1 and @l2","source":{"select":"rows","path":[]},"options":{"pageSize":20},"bandBy":"grp","processing":[{"id":"g","ord":1,"type":"group","levels":[{"path":"@f1","as":"grp","label":"@l1"},{"path":"@f2","as":"detail","label":"@l2"}],"values":[{"as":"records","label":"Records","align":"right"}]},{"id":"o","ord":2,"type":"order","field":"grp"}]}},{"id":"count","title":"Record count","description":"A card showing how many records there are.","needsText":"nothing","needs":[],"sketch":"<svg viewBox='0 0 120 64' width='120' height='64' aria-hidden='true'><text x='60' y='38' text-anchor='middle' font-size='26' font-weight='700' fill='currentColor'>1,284</text><rect x='38' y='48' width='44' height='4' rx='2' fill='currentColor' opacity='0.45'/></svg>","view":{"id":"@id","type":"card","title":"Records","source":{"select":"rows","path":[]},"card":{"markup":"<div class=\"dash-card\">\n  <div class=\"dash-card-value\">{{ numberComma(row.records) }}</div>\n  <div class=\"dash-card-label\">Records</div>\n</div>"},"processing":[{"id":"m","ord":1,"type":"measures","values":[{"as":"records","label":"Records","align":"right"}]}]}}],"rowActionDefault":"[{\"type\":\"open-url\",\"url\":{\"expr\":\"row.url\"},\"params\":{\"target\":\"_blank\"}}]"}},"page":"signIn"},"state":{"auth.currentUser":{"immediate":true},"auth.isAuthenticated":{"immediate":true},"auth.wasSignedIn":{"immediate":true},"login.email":{"immediate":true},"login.password":{"immediate":true},"login.draft":{"immediate":true},"login.passAck":{"immediate":true},"login.ack":{"immediate":true},"login.view":{"immediate":true},"routing.launchPath":{"immediate":true},"routing.launchQuery":{"immediate":true},"forgotPassword.email":{"immediate":true},"forgotPassword.draft":{"immediate":true},"forgotPassword.sent":{"immediate":true},"forgotPassword.error":{"immediate":true},"resetPassword.password":{"immediate":true},"resetPassword.confirm":{"immediate":true},"resetPassword.draft":{"immediate":true},"resetPassword.error":{"immediate":true},"resetPassword.done":{"immediate":true},"auth.sessionLoading":{"immediate":true},"auth.sessionError":{"immediate":true},"auth.flagError":{"immediate":true},"login.error":{"immediate":true},"login.reply":{"immediate":true},"tenantSelect.draft":{},"tenantSelect.error":{},"auth.requiresTenantSelection":{},"tenantSelect.options":{},"login.embedSignal":{},"login.hidden":{"immediate":true},"auth.pendingStep":{"immediate":true},"session.refused":{"immediate":true},"factor.code":{"immediate":true},"factor.draft":{"immediate":true},"factor.error":{"immediate":true},"*.providerKey":{"immediate":true},"*.providerLabel":{"immediate":true},"changePassword.password":{"immediate":true},"changePassword.confirm":{"immediate":true},"changePassword.draft":{"immediate":true},"changePassword.error":{"immediate":true},"resetPassword.rules":{"immediate":true},"signUp.email":{"immediate":true},"signUp.draft":{"immediate":true},"signUp.error":{"immediate":true},"signUp.sent":{"immediate":true},"signUp.readFilters":{"immediate":true},"signUp.finish":{"immediate":true},"signUp.finishRefused":{"immediate":true},"signUp.tenantName":{"immediate":true},"signUp.password":{"immediate":true},"signUp.confirm":{"immediate":true},"signUp.finishDraft":{"immediate":true},"signUp.finishError":{"immediate":true},"factorSetup.choice":{"immediate":true},"factorSetup.setupAck":{"immediate":true},"factorSetup.setup":{"immediate":true},"factorSetup.code":{"immediate":true},"factorSetup.draft":{"immediate":true},"factorSetup.ack":{"immediate":true},"factorSetup.error":{"immediate":true},"factorSetup.recovery":{"immediate":true}},"blocks":[{"id":"ls-session","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/session","reads":{"method":"GET"}},"bindings":{"outputs":[{"data":"auth.currentUser","error":"auth.sessionError","loading":"auth.sessionLoading"}]}},{"id":"ls-auth-flag","type":"branch-block","config":{"branches":[{"when":"auth.currentUser.userId != null && auth.currentUser.pending == null && !auth.currentUser.requiresTenantSelection && (routing.launchQuery.via == null || (auth.currentUser.signIn.source == routing.launchQuery.via && auth.currentUser.signIn.account == routing.launchQuery.account))","then":{"isAuthenticated":true}}],"else":{"isAuthenticated":false}},"bindings":{"inputs":["auth.currentUser","routing.launchQuery"],"outputs":[{"error":"auth.flagError","isAuthenticated":"auth.isAuthenticated"}]}},{"id":"ls-tenant-gate","type":"branch-block","config":{"branches":[{"when":"auth.currentUser.requiresTenantSelection","then":{"requiresTenantSelection":true,"options":{"expr":"auth.currentUser.tenants"}}}],"else":{"requiresTenantSelection":false,"options":[]}},"bindings":{"inputs":["auth.currentUser"],"outputs":[{"requiresTenantSelection":"auth.requiresTenantSelection"},{"options":"tenantSelect.options"}]}},{"_note":"A request answered 'not signed in': the session is read again, and if it has gone ls-session-ended takes the page to the card.","id":"ls-session-recheck","type":"execute-block","config":{"when":"session.refused != null && auth.isAuthenticated && settings.modules.LoginScreen.followEndedSession != false","actions":[{"type":"output","to":"session.refused","data":null},{"type":"call","target":"ls-session","method":"refresh"}]},"bindings":{"inputs":["session.refused","auth.isAuthenticated","settings.modules"],"outputs":["session.refused"]}},{"_note":"The step a session must finish before it goes in; a session waiting on one is not signed in.","id":"ls-step-gate","type":"branch-block","config":{"branches":[{"when":"auth.currentUser.pending != null","then":{"pendingStep":{"expr":"auth.currentUser.pending"}}}],"else":{"pendingStep":null}},"bindings":{"inputs":["auth.currentUser"],"outputs":[{"pendingStep":"auth.pendingStep"}]}},{"id":"ls-clear-at-step","type":"execute-block","config":{"when":"auth.pendingStep != null","actions":[{"type":"output","to":"login.email","data":""},{"type":"output","to":"login.password","data":""},{"type":"output","to":"login.draft","data":{}},{"type":"output","to":"login.error","data":null},{"type":"output","to":"login.reply","data":null},{"type":"output","to":"login.ack","data":null}]},"bindings":{"inputs":["auth.pendingStep"],"outputs":["login.ack","login.draft","login.email","login.error","login.password","login.reply"]}},{"id":"ls-password-rules","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/password-rules","reads":{"method":"GET"}},"bindings":{"inputs":[{"fetchWhen":"routing.launchPath == '/reset-password'"}],"outputs":[{"data":"resetPassword.rules"}]}},{"id":"ls-factor-verify-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/second-factor/verify","writes":{}},"bindings":{"inputs":[{"writeFrom":"factor.draft"}]}},{"id":"ls-factor-send-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/second-factor/send","writes":{}}},{"id":"ls-factor-setup-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/second-factor/setup","writes":{}},"bindings":{"inputs":[{"writeFrom":"factorSetup.choice"}]}},{"id":"ls-factor-confirm-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/second-factor/confirm","writes":{}},"bindings":{"inputs":[{"writeFrom":"factorSetup.draft"}]}},{"id":"ls-factor-setup","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"children":[{"id":"ls-factor-choose-app","type":"render-block","config":{"widget":"button","label":"Use an authenticator app","variant":"primary","visibleWhen":"factorSetup.setup == null && factorSetup.recovery == null && includes(auth.currentUser.secondFactorMethods, 'app')","disabledWhen":"!(true)","onClick":[{"type":"output","to":"factorSetup.choice","data":{"method":"app","currentPassword":{"expr":"null"}}},{"type":"call","target":"ls-factor-setup-ds","method":"create","out":"factorSetup.setupAck","errorInto":"factorSetup.error"},{"when":"factorSetup.error == null","type":"output","to":"factorSetup.setup","data":{"expr":"factorSetup.setupAck[0].data"}}]},"bindings":{"inputs":["factorSetup.error","factorSetup.setup","factorSetup.recovery","factorSetup.setupAck","auth.currentUser"],"outputs":["factorSetup.choice","factorSetup.error","factorSetup.setup","factorSetup.setupAck"]}},{"id":"ls-factor-choose-email","type":"render-block","config":{"widget":"button","label":"Use a code by email","variant":"secondary","visibleWhen":"factorSetup.setup == null && factorSetup.recovery == null && includes(auth.currentUser.secondFactorMethods, 'email')","disabledWhen":"!(true)","onClick":[{"type":"output","to":"factorSetup.choice","data":{"method":"email","currentPassword":{"expr":"null"}}},{"type":"call","target":"ls-factor-setup-ds","method":"create","out":"factorSetup.setupAck","errorInto":"factorSetup.error"},{"when":"factorSetup.error == null","type":"output","to":"factorSetup.setup","data":{"expr":"factorSetup.setupAck[0].data"}}]},"bindings":{"inputs":["factorSetup.error","factorSetup.setup","factorSetup.recovery","factorSetup.setupAck","auth.currentUser"],"outputs":["factorSetup.choice","factorSetup.error","factorSetup.setup","factorSetup.setupAck"]}},{"id":"ls-factor-qr","type":"render-block","config":{"widget":"html","cssClass":"ls-factor-qr","visibleWhen":"factorSetup.setup.method == 'app' && factorSetup.recovery == null","template":"<p>Scan this with your authenticator app, then type the code it shows.</p><img src=\"{{ factorSetup.setup.qrCode }}\" alt=\"QR code for your authenticator app\" /><p>Or enter this key: <code>{{ factorSetup.setup.secret }}</code></p>"},"bindings":{"inputs":["factorSetup.setup","factorSetup.recovery"]}},{"id":"ls-factor-sent","type":"render-block","config":{"widget":"html","visibleWhen":"factorSetup.setup.method == 'email' && factorSetup.recovery == null","template":"<p>We sent a code to your email. Type it here.</p>"},"bindings":{"inputs":["factorSetup.setup","factorSetup.recovery"]}},{"id":"ls-factor-setup-code","type":"render-block","config":{"widget":"field","label":"Code","visibleWhen":"factorSetup.setup != null && factorSetup.recovery == null"},"bindings":{"inputs":[{"value":"factorSetup.code"},"factorSetup.setup","factorSetup.recovery"],"outputs":[{"value":"factorSetup.code"}]}},{"id":"ls-factor-confirm-submit","type":"render-block","config":{"widget":"button","label":"Confirm","variant":"primary","visibleWhen":"factorSetup.setup != null && factorSetup.recovery == null","disabledWhen":"factorSetup.code == null || factorSetup.code == ''","onClick":[{"type":"output","to":"factorSetup.draft","data":{"code":{"expr":"factorSetup.code"}}},{"type":"call","target":"ls-factor-confirm-ds","method":"create","out":"factorSetup.ack","errorInto":"factorSetup.error"},{"type":"output","to":"factorSetup.code","data":""},{"when":"factorSetup.error == null","type":"output","to":"factorSetup.recovery","data":{"expr":"factorSetup.ack[0].data.recoveryCodes"}},{"when":"factorSetup.error == null","type":"steps","steps":[]}]},"bindings":{"inputs":["factorSetup.ack","factorSetup.code","factorSetup.error","factorSetup.setup","factorSetup.recovery"],"outputs":["factorSetup.ack","factorSetup.code","factorSetup.draft","factorSetup.error","factorSetup.recovery"]}},{"id":"ls-factor-recovery","type":"render-block","config":{"widget":"html","cssClass":"ls-factor-recovery","visibleWhen":"factorSetup.recovery != null","template":"<p><strong>Keep these recovery codes somewhere safe.</strong> Each one signs you in once if you cannot get a code. They will not be shown again.</p><pre>{{ join(factorSetup.recovery, '\n') }}</pre>"},"bindings":{"inputs":["factorSetup.recovery"]}},{"id":"ls-factor-done","type":"render-block","config":{"widget":"button","label":"I have kept them, continue","variant":"primary","visibleWhen":"factorSetup.recovery != null","onClick":[{"type":"output","to":"factorSetup.recovery","data":null},{"type":"output","to":"factorSetup.setup","data":null},{"type":"call","target":"ls-session","method":"refresh"}]},"bindings":{"inputs":["factorSetup.recovery"],"outputs":["factorSetup.recovery","factorSetup.setup"]}},{"id":"ls-factor-setup-error-msg","type":"render-block","config":{"widget":"message","type":"error"},"bindings":{"inputs":[{"inlineText":"factorSetup.error"}]}}]}},{"_note":"An emailed code goes as the step shows; a reload within 30 seconds sends nothing more.","id":"ls-factor-send-at-step","type":"execute-block","config":{"when":"auth.pendingStep == 'second-factor' && auth.currentUser.secondFactor.method == 'email'","actions":[{"type":"call","target":"ls-factor-send-ds","method":"create","continueIfRefused":true}]},"bindings":{"inputs":["auth.pendingStep","auth.currentUser"]}},{"id":"ls-signup-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/sign-up","writes":{}},"bindings":{"inputs":[{"writeFrom":"signUp.draft"}]}},{"id":"ls-signup-finish-read","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/sign-up/finish","reads":{"method":"GET"}},"bindings":{"inputs":[{"activeFilters":"signUp.readFilters"},{"fetchWhen":"signUp.readFilters != null"}],"outputs":[{"data":"signUp.finish"},{"error":"signUp.finishRefused"}]}},{"id":"ls-signup-finish-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/sign-up/finish","writes":{}},"bindings":{"inputs":[{"writeFrom":"signUp.finishDraft"}]}},{"_note":"An address naming /sign-up: with a token, the finish page, the token held in state and the address cleared; with none, the card's sign-up face.","id":"ls-signup-arrive","type":"execute-block","config":{"when":"routing.launchPath == '/sign-up'","runOnMount":true,"actions":[{"when":"routing.launchQuery.token == null","type":"output","to":"login.view","data":"signup"},{"when":"routing.launchQuery.token != null","type":"output","to":"signUp.readFilters","data":{"token":{"expr":"routing.launchQuery.token"}}},{"when":"routing.launchQuery.token != null","type":"open-url","url":"/","params":{"replace":true}}]},"bindings":{"inputs":["routing.launchPath","routing.launchQuery"],"outputs":["login.view","signUp.readFilters"]}},{"id":"ls-change-password-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/change-password","writes":{}},"bindings":{"inputs":[{"writeFrom":"changePassword.draft"}]}},{"id":"ls-clear-credentials","type":"execute-block","config":{"when":"auth.isAuthenticated","actions":[{"type":"output","to":"login.email","data":""},{"type":"output","to":"login.password","data":""},{"type":"output","to":"login.draft","data":{}},{"type":"output","to":"login.error","data":null},{"type":"output","to":"login.reply","data":null},{"type":"output","to":"login.ack","data":null},{"type":"output","to":"auth.wasSignedIn","data":true}]},"bindings":{"inputs":["auth.isAuthenticated"],"outputs":["login.ack","login.draft","login.email","login.error","login.password","login.reply","auth.wasSignedIn"]}},{"_note":"A session that ends starts the page afresh: nothing of one person is left for the next.","id":"ls-session-ended","type":"execute-block","config":{"when":"auth.wasSignedIn == true && auth.isAuthenticated != true","actions":[{"type":"reload-page"}]},"bindings":{"inputs":["auth.wasSignedIn","auth.isAuthenticated"]}},{"_note":"The sign-in page of an app that splits its manifest starts afresh once someone is in; the server then sends the app. An embedded sign-in only tells its host, so it stays.","id":"ls-signed-in-page","type":"execute-block","config":{"when":"settings.page == 'signIn' && routing.launchQuery.embed == null && auth.currentUser.userId != null && auth.currentUser.pending == null && !auth.currentUser.requiresTenantSelection","actions":[{"type":"reload-page"}]},"bindings":{"inputs":["settings.page","routing.launchQuery","auth.currentUser"]}},{"_note":"A fresh page saying a session ended elsewhere forgets it, so a refresh does not say it again.","id":"ls-ended-forget","type":"execute-block","config":{"when":"auth.currentUser.ended != null && auth.wasSignedIn != true","actions":[{"type":"call","target":"ls-logout-ds","method":"create"}]},"bindings":{"inputs":["auth.currentUser","auth.wasSignedIn"]}},{"_note":"The reset link's token is held in state once the page shows, so the address is cleared.","id":"ls-reset-clear-address","type":"execute-block","config":{"when":"routing.launchPath == '/reset-password'","runOnMount":true,"actions":[{"type":"open-url","url":"/","params":{"replace":true}}]},"bindings":{"inputs":["routing.launchPath"]}},{"_note":"The embedded sign-in: the page that frames this login, told once the person is signed in.","id":"ls-embed-host","type":"data-block","config":{"source":"window-message","targetWindow":"parent","target":"signedIn","writes":{}},"bindings":{"inputs":["settings.embed.frameOrigins",{"writeFrom":"login.embedSignal","listenWhen":"routing.launchQuery.embed != null"}]}},{"id":"ls-embed-signed-in","type":"execute-block","config":{"when":"auth.isAuthenticated && routing.launchQuery.embed != null","runOnMount":true,"actions":[{"type":"output","to":"login.embedSignal","data":{"signedIn":true}},{"type":"call","target":"ls-embed-host","method":"create"}]},"bindings":{"inputs":["auth.isAuthenticated","routing.launchQuery"],"outputs":["login.embedSignal"]}},{"id":"ls-login-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/login","writes":{}},"bindings":{"inputs":[{"writeFrom":"login.draft"}]}},{"id":"ls-logout-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/logout","writes":{}}},{"_note":"Sign out: the session ended and read again. Called by each face's Cancel and by the shell's Logout.","id":"ls-sign-out","type":"execute-block","config":{"actions":[{"type":"call","target":"ls-logout-ds","method":"create"},{"type":"call","target":"ls-session","method":"refresh"}]}},{"_note":"Sign in: pressed by the button and by Enter in either field.","id":"ls-sign-in","type":"execute-block","config":{"actions":[{"type":"output","to":"login.reply","data":null},{"type":"output","to":"login.draft","data":{"email":{"expr":"login.email"},"password":{"expr":"login.password"},"via":{"expr":"routing.launchQuery.via"},"account":{"expr":"routing.launchQuery.account"}}},{"type":"call","target":"ls-login-ds","method":"create","out":"login.ack","errorInto":"login.error"},{"type":"output","to":"login.reply","data":{"expr":"login.ack != null && !login.ack[0].ok ? login.ack[0].error.reply : null"}},{"type":"call","target":"ls-session","method":"refresh"}]},"bindings":{"inputs":["login.email","login.password","login.ack","routing.launchQuery"],"outputs":["login.draft","login.ack","login.error","login.reply"]}},{"_note":"Send reset link: pressed by the button and by Enter in the email field.","id":"ls-forgot-request","type":"execute-block","config":{"actions":[{"type":"output","to":"forgotPassword.draft","data":{"email":{"expr":"forgotPassword.email"}}},{"type":"call","target":"ls-request-reset-wf","method":"run","errorInto":"forgotPassword.error"},{"type":"output","to":"forgotPassword.sent","data":{"expr":"forgotPassword.error == null"}}]},"bindings":{"inputs":["forgotPassword.email","forgotPassword.error"],"outputs":["forgotPassword.draft","forgotPassword.sent","forgotPassword.error"]}},{"_note":"Send link (signing up): pressed by the button and by Enter in the email field.","id":"ls-signup-request","type":"execute-block","config":{"actions":[{"type":"output","to":"signUp.draft","data":{"email":{"expr":"signUp.email"},"plan":{"expr":"routing.launchQuery.plan"},"interval":{"expr":"routing.launchQuery.interval"}}},{"type":"call","target":"ls-signup-ds","method":"create","errorInto":"signUp.error"},{"type":"output","to":"signUp.sent","data":{"expr":"signUp.error == null"}}]},"bindings":{"inputs":["signUp.email","signUp.error","routing.launchQuery"],"outputs":["signUp.draft","signUp.error","signUp.sent"]}},{"id":"ls-request-reset-wf","type":"workflow-block","config":{"systemWorkflow":"request-reset"},"bindings":{"inputs":[{"paramsFrom":"forgotPassword.draft"}]}},{"id":"ls-reset-password-wf","type":"workflow-block","config":{"systemWorkflow":"reset-password"},"bindings":{"inputs":[{"paramsFrom":"resetPassword.draft"}]}},{"_note":"A pass in the address signs in at the login door, then leaves the address.","id":"ls-pass-redeem","type":"execute-block","config":{"when":"routing.launchQuery.pass != null","runOnMount":true,"actions":[{"type":"output","to":"login.draft","data":{"pass":{"expr":"routing.launchQuery.pass"}}},{"type":"call","target":"ls-login-ds","method":"create","continueIfRefused":true,"out":"login.passAck"},{"type":"open-url","url":"","params":{"replace":true,"without":["pass"]}},{"type":"call","target":"ls-session","method":"refresh"}]},"bindings":{"inputs":["routing.launchQuery"],"outputs":["login.draft","login.passAck"]}},{"id":"ls-select-tenant-ds","type":"data-block","config":{"source":"rest-direct","endpoint":"/api/auth/select-tenant","writes":{}},"bindings":{"inputs":[{"writeFrom":"tenantSelect.draft"}]}},{"id":"ls-login-page","type":"render-block","config":{"widget":"container","layout":"column","cssClass":"ls-login-page","visibleWhen":"auth.sessionLoading == false && !auth.isAuthenticated && login.hidden != true","children":[{"id":"ls-login-card","type":"render-block","config":{"widget":"container","layout":"column","cssClass":"ls-login-card","classWhen":[{"when":"auth.requiresTenantSelection","class":"ls-login-card-wide"}],"title":"{{ coalesce(settings.modules.LoginScreen.title, settings.appTitle, 'Sign in') }}","titleClass":"ls-login-title","children":[{"id":"ls-login-view","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"visibleWhen":"(login.view != 'forgot') && (login.view != 'signup') && !auth.requiresTenantSelection && auth.pendingStep == null","children":[{"id":"ls-provider-error","type":"render-block","config":{"widget":"message","type":"error","text":"{{ when(routing.launchQuery.signInError == 'notMember', \"You can't sign in here yet. Ask your administrator to add you.\", when(routing.launchQuery.signInError == 'unverified', 'That account has not confirmed its email address.', when(routing.launchQuery.signInError == 'unavailable', 'That way of signing in is not available right now.', 'Signing in did not complete. Please try again.'))) }}","visibleWhen":"routing.launchQuery.signInError != null"},"bindings":{"inputs":["routing.launchQuery"]}},{"id":"ls-ended-note","type":"render-block","config":{"widget":"message","type":"warning","cssClass":"ls-ended-note","text":"You were signed out because this account signed in somewhere else.","visibleWhen":"auth.currentUser.ended == 'elsewhere'"},"bindings":{"inputs":["auth.currentUser"]}},{"id":"ls-via-note","type":"render-block","config":{"widget":"html","visibleWhen":"routing.launchQuery.via != null","cssClass":"ls-via-note","template":"<p>Sign in with your {{ coalesce(settings.signIn.sources[routing.launchQuery.via].label, routing.launchQuery.via) }} email and password.</p>"},"bindings":{"inputs":["routing.launchQuery","settings.signIn.sources"]}},{"id":"ls-field-email","type":"render-block","config":{"widget":"field","label":"Email","inputType":"email","onKeyPress":[{"key":"Enter","actions":[{"type":"call","target":"ls-sign-in","method":"run"}]}]},"bindings":{"inputs":[{"value":"login.email"}],"outputs":[{"value":"login.email"}]}},{"id":"ls-field-password","type":"render-block","config":{"widget":"field","label":"Password","inputType":"password","onKeyPress":[{"key":"Enter","actions":[{"type":"call","target":"ls-sign-in","method":"run"}]}]},"bindings":{"inputs":[{"value":"login.password"}],"outputs":[{"value":"login.password"}]}},{"id":"ls-submit","type":"render-block","config":{"widget":"button","label":"Sign in","variant":"primary","onClick":[{"type":"call","target":"ls-sign-in","method":"run"}]}},{"_note_error":"A refused sign-in has to say so. The write's refusal never reaches the data-block's `error` output — that slot is deposited by the READ path — so the ack is captured off the `call` itself with `out`, which is the same shape `ls-reset-submit` uses. It is captured rather than left to stop the chain because a failing write does not stop one: `ls-session` refreshes either way, finds no session, and the screen would otherwise sit there looking as though the click had been ignored.","id":"ls-login-error-msg","type":"render-block","config":{"widget":"message","type":"error"},"bindings":{"inputs":[{"inlineText":"login.error"}]}},{"_note":"A refusal's whole reply when it is not one of the app's messages, collapsed.","id":"ls-login-error-reply","type":"render-block","config":{"widget":"html","visibleWhen":"login.reply != null","template":"<details class=\"ls-login-reply\"><summary>Details</summary><pre>{{ login.reply }}</pre></details>"},"bindings":{"inputs":["login.reply"]}},{"_note":"Each ready provider, as a link the browser follows. Not inside another site's frame, whose page the provider refuses to show, and not on a link naming another application.","id":"ls-providers","type":"render-block","config":{"widget":"repeater","emptyMessage":"","visibleWhen":"settings.signIn.providers != null && routing.launchQuery.embed == null && routing.launchQuery.via == null","childrenTemplate":[{"id":"{{templateItem:id}}-link","type":"render-block","config":{"widget":"html","template":"<a class=\"ls-provider-link\" href=\"/api/auth/provider/{{ {{templateItem:id}}.providerKey }}/start\">Sign in with {{ {{templateItem:id}}.providerLabel }}</a>"},"bindings":{"inputs":["{{templateItem:id}}.providerKey","{{templateItem:id}}.providerLabel"]}}]},"bindings":{"inputs":[{"items":"settings.signIn.providers"},"routing.launchQuery"],"outputs":["*.providerKey","*.providerLabel"]}},{"id":"ls-forgot-link","type":"render-block","config":{"widget":"button","label":"Forgot your password?","variant":"link","cssClass":"ls-login-secondary","visibleWhen":"settings.modules.LoginScreen.showForgotPassword && routing.launchQuery.via == null","onClick":[{"type":"output","to":"login.view","data":"forgot"},{"type":"output","to":"forgotPassword.email","data":""},{"type":"output","to":"forgotPassword.sent","data":false},{"type":"output","to":"forgotPassword.error","data":null}]},"bindings":{"inputs":["settings.modules.LoginScreen.showForgotPassword","routing.launchQuery"],"outputs":["forgotPassword.email","forgotPassword.sent","forgotPassword.error","login.view"]}},{"id":"ls-signup-link","type":"render-block","config":{"widget":"button","label":"Create an account","variant":"link","cssClass":"ls-login-secondary","visibleWhen":"settings.signIn.signUp != null && routing.launchQuery.embed == null && routing.launchQuery.via == null","onClick":[{"type":"output","to":"login.view","data":"signup"},{"type":"output","to":"signUp.sent","data":false},{"type":"output","to":"signUp.error","data":null}]},"bindings":{"inputs":["settings.signIn.signUp","routing.launchQuery"],"outputs":["login.view","signUp.sent","signUp.error"]}}]},"bindings":{"inputs":["login.view","auth.requiresTenantSelection","auth.pendingStep"]}},{"id":"ls-forgot-view","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"visibleWhen":"(login.view == 'forgot') && !auth.requiresTenantSelection && auth.pendingStep == null","children":[{"id":"ls-forgot-email","type":"render-block","config":{"widget":"field","label":"Email","inputType":"email","onKeyPress":[{"key":"Enter","actions":[{"type":"call","target":"ls-forgot-request","method":"run","when":"forgotPassword.email != null && forgotPassword.email != '' && contains(forgotPassword.email, '@')"}]}]},"bindings":{"inputs":[{"value":"forgotPassword.email"},"forgotPassword.email"],"outputs":[{"value":"forgotPassword.email"}]}},{"id":"ls-forgot-sent-msg","type":"render-block","config":{"widget":"message","type":"success","text":"If an account exists for that email, a reset link has been sent.","visibleWhen":"forgotPassword.sent"},"bindings":{"inputs":["forgotPassword.sent"]}},{"id":"ls-forgot-error-msg","type":"render-block","config":{"widget":"message"},"bindings":{"inputs":[{"inlineText":"forgotPassword.error"}]}},{"id":"ls-forgot-send","type":"render-block","config":{"widget":"button","label":"Send reset link","variant":"primary","disabledWhen":"forgotPassword.email == null || forgotPassword.email == '' || !contains(forgotPassword.email, '@')","onClick":[{"type":"call","target":"ls-forgot-request","method":"run"}]},"bindings":{"inputs":["forgotPassword.email"]}},{"id":"ls-forgot-back","type":"render-block","config":{"widget":"button","label":"Back to sign in","variant":"link","cssClass":"ls-login-secondary","onClick":[{"type":"output","to":"login.view","data":"login"}]},"bindings":{"outputs":["login.view"]}}]},"bindings":{"inputs":["login.view","auth.requiresTenantSelection","auth.pendingStep"]}},{"id":"ls-signup-view","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"visibleWhen":"(login.view == 'signup') && !auth.requiresTenantSelection && auth.pendingStep == null","children":[{"id":"ls-signup-note","type":"render-block","config":{"widget":"html","cssClass":"ls-via-note","template":"<p>Create your account.{{ when(settings.signIn.signUp.passwords == true, ' Type your email, and we will send you a link to finish.', '') }}</p>"},"bindings":{"inputs":["settings.signIn.signUp"]}},{"id":"ls-signup-email","type":"render-block","config":{"widget":"field","label":"Email","inputType":"email","visibleWhen":"settings.signIn.signUp.passwords == true","onKeyPress":[{"key":"Enter","actions":[{"type":"call","target":"ls-signup-request","method":"run","when":"signUp.email != null && signUp.email != '' && contains(signUp.email, '@')"}]}]},"bindings":{"inputs":[{"value":"signUp.email"},"signUp.email","settings.signIn.signUp"],"outputs":[{"value":"signUp.email"}]}},{"id":"ls-signup-sent-msg","type":"render-block","config":{"widget":"message","type":"success","text":"Check your email: we have sent you a link.","visibleWhen":"signUp.sent == true"},"bindings":{"inputs":["signUp.sent"]}},{"id":"ls-signup-error-msg","type":"render-block","config":{"widget":"message","type":"error"},"bindings":{"inputs":[{"inlineText":"signUp.error"}]}},{"id":"ls-signup-send","type":"render-block","config":{"widget":"button","label":"Send link","variant":"primary","visibleWhen":"settings.signIn.signUp.passwords == true","disabledWhen":"signUp.email == null || signUp.email == '' || !contains(signUp.email, '@')","onClick":[{"type":"call","target":"ls-signup-request","method":"run"}]},"bindings":{"inputs":["signUp.email","settings.signIn.signUp"]}},{"id":"ls-signup-providers","type":"render-block","config":{"widget":"repeater","emptyMessage":"","visibleWhen":"settings.signIn.signUp.providers == true && settings.signIn.providers != null","childrenTemplate":[{"id":"{{templateItem:id}}-signup-link","type":"render-block","config":{"widget":"html","template":"<a class=\"ls-provider-link\" href=\"/api/auth/provider/{{ urlEncode({{templateItem:id}}.providerKey) }}/start?signUp=1&plan={{ urlEncode(routing.launchQuery.plan) }}&interval={{ urlEncode(routing.launchQuery.interval) }}\">Sign up with {{ {{templateItem:id}}.providerLabel }}</a>"},"bindings":{"inputs":["{{templateItem:id}}.providerKey","{{templateItem:id}}.providerLabel","routing.launchQuery"]}}]},"bindings":{"inputs":[{"items":"settings.signIn.providers"},"settings.signIn.signUp"],"outputs":["*.providerKey","*.providerLabel"]}},{"id":"ls-signup-back","type":"render-block","config":{"widget":"button","label":"Back to sign in","variant":"link","cssClass":"ls-login-secondary","onClick":[{"type":"output","to":"login.view","data":"login"}]},"bindings":{"outputs":["login.view"]}}]},"bindings":{"inputs":["login.view","auth.requiresTenantSelection","auth.pendingStep"]}},{"id":"ls-factor-view","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"visibleWhen":"auth.pendingStep == 'second-factor'","children":[{"id":"ls-factor-prompt","type":"render-block","config":{"widget":"html","cssClass":"ls-via-note","template":"<p>{{ when(auth.currentUser.secondFactor.method == 'email', 'We sent a code to your email. Type it here.', 'Type the code from your authenticator app.') }} A recovery code works too.</p>"},"bindings":{"inputs":["auth.currentUser"]}},{"id":"ls-factor-code","type":"render-block","config":{"widget":"field","label":"Code"},"bindings":{"inputs":[{"value":"factor.code"}],"outputs":[{"value":"factor.code"}]}},{"id":"ls-factor-error-msg","type":"render-block","config":{"widget":"message","type":"error"},"bindings":{"inputs":[{"inlineText":"factor.error"}]}},{"id":"ls-factor-submit","type":"render-block","config":{"widget":"button","label":"Continue","variant":"primary","disabledWhen":"factor.code == null || factor.code == ''","onClick":[{"type":"output","to":"factor.draft","data":{"code":{"expr":"factor.code"}}},{"type":"call","target":"ls-factor-verify-ds","method":"create","errorInto":"factor.error"},{"type":"output","to":"factor.code","data":""},{"when":"factor.error == null","type":"call","target":"ls-session","method":"refresh"},{"_note":"Too many wrong codes ends the step: the sign-in face says why.","when":"factor.error.code == 'tooManyCodes'","type":"steps","steps":[{"type":"output","to":"login.error","data":{"expr":"factor.error"}},{"type":"output","to":"factor.error","data":null},{"type":"call","target":"ls-session","method":"refresh"}]}]},"bindings":{"inputs":["factor.code","factor.error"],"outputs":["factor.code","factor.draft","factor.error","login.error"]}},{"id":"ls-factor-resend","type":"render-block","config":{"widget":"button","label":"Send another code","variant":"link","visibleWhen":"auth.currentUser.secondFactor.method == 'email'","onClick":[{"type":"call","target":"ls-factor-send-ds","method":"create","continueIfRefused":true}]},"bindings":{"inputs":["auth.currentUser"]}},{"id":"ls-factor-cancel","type":"render-block","config":{"widget":"button","label":"Cancel","variant":"link","onClick":[{"type":"call","target":"ls-sign-out","method":"run"}]}}]},"bindings":{"inputs":["auth.pendingStep"]}},{"id":"ls-factor-setup-view","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"visibleWhen":"auth.pendingStep == 'second-factor-setup'","children":[{"id":"ls-factor-choose-prompt","type":"render-block","config":{"widget":"html","cssClass":"ls-via-note","visibleWhen":"factorSetup.setup == null","template":"<p>This account needs a second step at sign-in. Choose how you will get your code.</p>"},"bindings":{"inputs":["factorSetup.setup"]}},"ls-factor-setup",{"id":"ls-factor-setup-cancel","type":"render-block","config":{"widget":"button","label":"Cancel","variant":"link","visibleWhen":"factorSetup.recovery == null","onClick":[{"type":"call","target":"ls-sign-out","method":"run"}]},"bindings":{"inputs":["factorSetup.recovery"]}}]},"bindings":{"inputs":["auth.pendingStep"]}},{"id":"ls-password-view","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"visibleWhen":"auth.pendingStep == 'password'","children":[{"id":"ls-password-prompt","type":"render-block","config":{"widget":"html","cssClass":"ls-via-note","template":"<p>Choose a new password to continue.</p><p>{{ auth.currentUser.passwordRules }}</p>"},"bindings":{"inputs":["auth.currentUser"]}},{"id":"ls-change-pw","type":"render-block","config":{"widget":"field","label":"New Password","inputType":"password"},"bindings":{"inputs":[{"value":"changePassword.password"}],"outputs":[{"value":"changePassword.password"}]}},{"id":"ls-change-confirm","type":"render-block","config":{"widget":"field","label":"Confirm Password","inputType":"password"},"bindings":{"inputs":[{"value":"changePassword.confirm"}],"outputs":[{"value":"changePassword.confirm"}]}},{"id":"ls-change-mismatch-msg","type":"render-block","config":{"widget":"message","type":"error","text":"Passwords do not match","visibleWhen":"changePassword.confirm != null && changePassword.confirm != '' && changePassword.password != changePassword.confirm"},"bindings":{"inputs":["changePassword.confirm","changePassword.password"]}},{"id":"ls-change-error-msg","type":"render-block","config":{"widget":"message","type":"error"},"bindings":{"inputs":[{"inlineText":"changePassword.error"}]}},{"id":"ls-change-submit","type":"render-block","config":{"widget":"button","label":"Save","variant":"primary","disabledWhen":"changePassword.password == null || changePassword.password == '' || changePassword.password != changePassword.confirm","onClick":[{"type":"output","to":"changePassword.draft","data":{"password":{"expr":"changePassword.password"}}},{"type":"call","target":"ls-change-password-ds","method":"create","errorInto":"changePassword.error"},{"when":"changePassword.error == null","type":"output","to":"changePassword.password","data":""},{"when":"changePassword.error == null","type":"output","to":"changePassword.confirm","data":""},{"when":"changePassword.error == null","type":"call","target":"ls-session","method":"refresh"}]},"bindings":{"inputs":["changePassword.confirm","changePassword.error","changePassword.password"],"outputs":["changePassword.confirm","changePassword.draft","changePassword.error","changePassword.password"]}},{"id":"ls-change-cancel","type":"render-block","config":{"widget":"button","label":"Cancel","variant":"link","onClick":[{"type":"call","target":"ls-sign-out","method":"run"}]}}]},"bindings":{"inputs":["auth.pendingStep"]}},{"id":"ls-tenant-view","type":"render-block","config":{"widget":"container","visibleWhen":"auth.requiresTenantSelection","children":[{"id":"ls-tenant-prompt","type":"render-block","config":{"widget":"message","text":"Choose where to work. Your choice is fixed for this session — sign out and back in to change it."}},{"id":"ls-tenant-list","type":"render-block","config":{"widget":"list","cssClass":"ls-tenant-list","columns":[{"field":"name","label":"Organisation","sortable":false}],"emptyMessage":"No organisation is available to you. Ask an administrator to add you to one.","rowActions":[{"label":"Continue","onClick":[{"type":"output","to":"tenantSelect.draft","data":{"tenantId":{"expr":"row.id"}}},{"type":"call","target":"ls-select-tenant-ds","method":"create","errorInto":"tenantSelect.error"},{"type":"call","target":"ls-session","method":"refresh"}]}]},"bindings":{"inputs":[{"data":"tenantSelect.options"}],"outputs":["tenantSelect.draft","tenantSelect.error"]}},{"id":"ls-tenant-error-msg","type":"render-block","config":{"widget":"message"},"bindings":{"inputs":[{"inlineText":"tenantSelect.error"}]}}]},"bindings":{"inputs":["auth.requiresTenantSelection"]}}]},"bindings":{"inputs":["settings.modules.LoginScreen.title","settings.appTitle","auth.requiresTenantSelection"]}}]},"bindings":{"inputs":["auth.isAuthenticated","auth.sessionLoading","login.hidden"]}},{"id":"ls-signup-page","type":"render-block","config":{"widget":"modal","visibleWhen":"signUp.readFilters != null","children":[{"id":"ls-signup-title","type":"render-block","config":{"widget":"message","text":"Finish signing up"}},{"id":"ls-signup-bad-link","type":"render-block","config":{"widget":"message","type":"error","text":"This link is not valid, or has expired or been used.","visibleWhen":"signUp.finishRefused != null"},"bindings":{"inputs":["signUp.finishRefused"]}},{"id":"ls-signup-form","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"visibleWhen":"signUp.finish.email != null && signUp.finishRefused == null","children":[{"id":"ls-signup-who","type":"render-block","config":{"widget":"html","cssClass":"ls-via-note","template":"<p>Signing up as {{ signUp.finish.email }}</p>"},"bindings":{"inputs":["signUp.finish"]}},{"id":"ls-signup-tenant","type":"render-block","config":{"widget":"field","label":"Your organisation's name","visibleWhen":"signUp.finish.newTenant == true"},"bindings":{"inputs":[{"value":"signUp.tenantName"},"signUp.finish"],"outputs":[{"value":"signUp.tenantName"}]}},{"id":"ls-signup-rules","type":"render-block","config":{"widget":"html","visibleWhen":"signUp.finish.needsPassword == true && signUp.finish.passwordRules != null && signUp.finish.passwordRules != ''","cssClass":"ls-via-note","template":"<p>{{ signUp.finish.passwordRules }}</p>"},"bindings":{"inputs":["signUp.finish"]}},{"id":"ls-signup-pw","type":"render-block","config":{"widget":"field","label":"Choose a password","inputType":"password","visibleWhen":"signUp.finish.needsPassword == true"},"bindings":{"inputs":[{"value":"signUp.password"},"signUp.finish"],"outputs":[{"value":"signUp.password"}]}},{"id":"ls-signup-confirm","type":"render-block","config":{"widget":"field","label":"Confirm Password","inputType":"password","visibleWhen":"signUp.finish.needsPassword == true"},"bindings":{"inputs":[{"value":"signUp.confirm"},"signUp.finish"],"outputs":[{"value":"signUp.confirm"}]}},{"id":"ls-signup-mismatch-msg","type":"render-block","config":{"widget":"message","text":"Passwords do not match","visibleWhen":"signUp.confirm != null && signUp.confirm != '' && signUp.password != signUp.confirm"},"bindings":{"inputs":["signUp.confirm","signUp.password"]}},{"id":"ls-signup-finish-error-msg","type":"render-block","config":{"widget":"message","type":"error"},"bindings":{"inputs":[{"inlineText":"signUp.finishError"}]}},{"id":"ls-signup-finish","type":"render-block","config":{"widget":"button","label":"Create my account","variant":"primary","disabledWhen":"(signUp.finish.newTenant == true && (signUp.tenantName == null || signUp.tenantName == '')) || (signUp.finish.needsPassword == true && (signUp.password == null || signUp.password == '' || signUp.password != signUp.confirm))","onClick":[{"type":"output","to":"signUp.finishDraft","data":{"token":{"expr":"signUp.readFilters.token"},"tenantName":{"expr":"signUp.tenantName"},"password":{"expr":"signUp.password"}}},{"type":"call","target":"ls-signup-finish-ds","method":"create","errorInto":"signUp.finishError"},{"when":"signUp.finishError == null","type":"output","to":"signUp.readFilters","data":null},{"when":"signUp.finishError == null","type":"output","to":"signUp.password","data":""},{"when":"signUp.finishError == null","type":"output","to":"signUp.confirm","data":""},{"when":"signUp.finishError == null","type":"output","to":"signUp.finishDraft","data":null},{"when":"signUp.finishError == null","type":"output","to":"routing.launchPath","data":null},{"when":"signUp.finishError == null","type":"call","target":"ls-session","method":"refresh"}]},"bindings":{"inputs":["signUp.confirm","signUp.finish","signUp.finishError","signUp.password","signUp.readFilters","signUp.tenantName"],"outputs":["signUp.confirm","signUp.finishDraft","signUp.finishError","signUp.password","signUp.readFilters","routing.launchPath"]}}]},"bindings":{"inputs":["signUp.finish","signUp.finishRefused"]}},{"id":"ls-signup-leave","type":"render-block","config":{"widget":"button","label":"Back to sign in","variant":"link","onClick":[{"type":"output","to":"signUp.readFilters","data":null},{"type":"output","to":"signUp.password","data":""},{"type":"output","to":"signUp.confirm","data":""},{"type":"output","to":"signUp.finishError","data":null},{"type":"output","to":"routing.launchPath","data":null}]},"bindings":{"outputs":["signUp.confirm","signUp.finishError","signUp.password","signUp.readFilters","routing.launchPath"]}}]},"bindings":{"inputs":["signUp.readFilters"]}},{"id":"ls-reset-page","type":"render-block","config":{"widget":"modal","visibleWhen":"routing.launchPath == '/reset-password'","children":[{"id":"ls-reset-title","type":"render-block","config":{"widget":"message","text":"Reset your password"}},{"id":"ls-reset-form","type":"render-block","config":{"widget":"container","layout":"column","stretch":true,"visibleWhen":"!resetPassword.done","children":[{"id":"ls-reset-rules","type":"render-block","config":{"widget":"html","visibleWhen":"resetPassword.rules.text != null && resetPassword.rules.text != ''","cssClass":"ls-via-note","template":"<p>{{ resetPassword.rules.text }}</p>"},"bindings":{"inputs":["resetPassword.rules"]}},{"id":"ls-reset-pw","type":"render-block","config":{"widget":"field","label":"New Password","inputType":"password"},"bindings":{"inputs":[{"value":"resetPassword.password"}],"outputs":[{"value":"resetPassword.password"}]}},{"id":"ls-reset-confirm","type":"render-block","config":{"widget":"field","label":"Confirm Password","inputType":"password"},"bindings":{"inputs":[{"value":"resetPassword.confirm"}],"outputs":[{"value":"resetPassword.confirm"}]}},{"id":"ls-reset-mismatch-msg","type":"render-block","config":{"widget":"message","text":"Passwords do not match","visibleWhen":"resetPassword.confirm != null && resetPassword.confirm != '' && resetPassword.password != resetPassword.confirm"},"bindings":{"inputs":["resetPassword.confirm","resetPassword.password"]}},{"id":"ls-reset-error-msg","type":"render-block","config":{"widget":"message"},"bindings":{"inputs":[{"inlineText":"resetPassword.error"}]}},{"id":"ls-reset-submit","type":"render-block","config":{"widget":"button","label":"Reset password","variant":"primary","disabledWhen":"resetPassword.password == null || resetPassword.password == '' || resetPassword.password != resetPassword.confirm","onClick":[{"type":"output","to":"resetPassword.draft","data":{"token":{"expr":"routing.launchQuery.token"},"password":{"expr":"resetPassword.password"}}},{"type":"call","target":"ls-reset-password-wf","method":"run","errorInto":"resetPassword.error"},{"type":"output","to":"resetPassword.done","data":{"expr":"resetPassword.error == null"}}]},"bindings":{"inputs":["resetPassword.confirm","resetPassword.error","resetPassword.password","routing.launchQuery"],"outputs":["resetPassword.done","resetPassword.draft","resetPassword.error"]}}]},"bindings":{"inputs":["resetPassword.done"]}},{"id":"ls-reset-done","type":"render-block","config":{"widget":"container","layout":"column","visibleWhen":"resetPassword.done","children":[{"id":"ls-reset-done-msg","type":"render-block","config":{"widget":"message","type":"success","text":"Your password has been reset. You can now sign in."}},{"id":"ls-reset-signin","type":"render-block","config":{"widget":"button","label":"Go to sign in","variant":"primary","onClick":[{"type":"output","to":"routing.launchPath","data":null},{"type":"output","to":"resetPassword.password","data":""},{"type":"output","to":"resetPassword.confirm","data":""},{"type":"output","to":"resetPassword.done","data":false},{"type":"output","to":"resetPassword.error","data":null}]},"bindings":{"outputs":["resetPassword.confirm","resetPassword.done","resetPassword.error","resetPassword.password","routing.launchPath"]}}]},"bindings":{"inputs":["resetPassword.done"]}}]},"bindings":{"inputs":["routing.launchPath"]}}],"moduleStyles":["/Framework/modules/LoginScreen/styles.css"],"deferredModules":["Dashboard"],"_fileMeta":{"compiled":true,"hash":"c63e8e47b7738606","modules":["ListScreen","Connections","Files","Workflows","Schedules","AuditLog","ErrorLog","Debug","StepEditor","LoginScreen","UserAccount","WorkflowResume","UserAdmin","AccessManagement","Settings","Dashboard","BasicPortal"],"frameworkVersions":{"backend":"5.0.0-candidate","web":"5.0.0-candidate","shared":"5.0.0-candidate"},"app":"BackendX","appVersion":"v.261109.1","builtAt":"2026-11-21T17:00:22.830Z"}}