// @requirements REQ-PRODUCT-COLLECTION-FLOW REQ-TR-BASIS REQ-PRODUCT-MOBILE import {build as bundle} from 'esbuild'; import {readFile} from 'node:fs/promises'; import {collectionFlowExample} from './example.mjs'; import {renderCollectionFlow} from '@notabenda/core/collection/flow'; import {renderLegalLinks} from '@notabenda/core'; const attribute=value=>value.replaceAll('&','&').replaceAll('"','"').replaceAll('<','<').replaceAll('>','>'); export async function collectionFlowFiles(base){ const {build,flow,settings}=collectionFlowExample(base),files={...build.files,'collection-flow/flow.json':JSON.stringify(flow),'collection-flow/settings.json':JSON.stringify(settings),'assets/collection-flow-example.css':await readFile(new URL('./style.css',import.meta.url),'utf8')}; const result=await bundle({entryPoints:[new URL('./client.mjs',import.meta.url).pathname],bundle:true,minify:true,format:'esm',platform:'browser',target:'es2022',write:false,external:['/assets/demo-session.mjs']});files['assets/collection-flow-example.mjs']=result.outputFiles[0].text; for(const dark of [false,true]){const route=dark?'dark/collection-flow':'collection-flow';files[route+'/index.html']=`A message and a separate choice · Juniper Notes
Juniper NotesAll examples ↗

Notice + optional permission

A message.
A separate choice.

Preparing a message and choosing email updates are different actions. The notice explains both uses; only the updates have a permission control.

Your message

This example prepares a local draft. It sends no message or email.

${renderCollectionFlow(flow,{idPrefix:'message-privacy',allowPreview:true})}

No email permission is needed to prepare the message.

Email updatesNo permission checked
How the two actions stay separate

The message purpose is configured as notice-only. The updates purpose has its own offer, unchecked control and recording action. Opening the notice, checking a box or preparing the message creates no permission record.

The host supplies the reviewed processing conditions and texts. This example shows presentation and recording mechanics; it does not establish a lawful condition for your service.

`;} return files; }