@smartkomm/plexus-cli 0.1.363 → 0.1.365

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -11508,7 +11508,7 @@ plexus-cli --env prod jobs list --status running # nothing unexpectedly in
11508
11508
  `),n.applied?(r.write(`Rows deleted: ${n.deleted}${n.continuing?" so far \u2014 the purge goes on in scheduled steps":""}
11509
11509
  `),0):(r.write(`Dry run \u2014 every check passed; re-run with --confirm to delete.
11510
11510
  `),0)}},SN=[Xw,ek,tk,nk,rk,ik,lk,ok,sk,ak];function AN(e){return e.map(t=>{let[n="",r,...i]=t.split("=");if(!ud.test(n)||r!=="true"&&r!=="false"||i.length>0)throw new g(`--staff-input "${t}": expected key=true or key=false`);return{key:n,value:r==="true"}})}s(AN,"parseStaffInputs");var tn="contractGenerator",Qo="documentTemplate";function fd(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Object.keys(t);return(t.kind==="generator"||t.kind==="package")&&typeof t.key=="string"&&t.key.length>0&&(t.revision===void 0||typeof t.revision=="number"&&Number.isInteger(t.revision)&&t.revision>0)&&n.every(r=>r==="kind"||r==="key"||r==="revision")}s(fd,"isGeneratorRef");function TN(e,t){let n=e.inputs?.[t];return n?.kind==="literal"?n.value:void 0}s(TN,"literalOf");function Ii(e){let t=TN(e,tn);return fd(t)?t:null}s(Ii,"generatorRefOfNode");function Cr(e){let t=TN(e,Qo);return typeof t=="string"&&t.length>0?t:null}s(Cr,"documentTemplateKeyOfNode");function RN(e){return`${e.kind}:${e.key}${e.revision===void 0?"":`@${e.revision}`}`}s(RN,"generatorRefLabel");var PH=["formExports","generatorStamp"];function $N(e,t,n){let r=e.inputs?.[tn];(r?.kind!=="literal"||!fd(r.value))&&D(`applyGeneratorStamp: the node names no generator in inputs.${tn} \u2014 a stamp derives from it`),n.freezeRevision&&t.revision!==void 0&&(e.inputs[tn]={kind:"literal",value:{...r.value,revision:t.revision}}),e.generatorStamp={inputSchema:t.inputSchema,parties:t.parties,schemaDigest:t.schemaDigest,...t.parts===void 0?{}:{parts:t.parts},...t.coverLetter===void 0?{}:{coverLetter:t.coverLetter}}}s($N,"applyGeneratorStamp");var CH=["reads"];function fa(e){if(e===null||typeof e!="object")return e;let t={...e};return Array.isArray(t.nodes)&&(t.nodes=t.nodes.map(n=>{if(n===null||typeof n!="object")return n;let r={...n};for(let i of PH)delete r[i];for(let i of CH)Array.isArray(r[i])&&r[i].length===0&&delete r[i];return r})),t}s(fa,"comparableWorkflowGraph");var pd={id:{de:"die Identit\xE4t ist der Slug des Angebots (bundle.yaml slugs.manifest)",en:"the identity is the offer's slug (bundle.yaml slugs.manifest)"},label:{de:"der Titel steht in bundle.yaml `label`",en:"the title is bundle.yaml `label`"},version:{de:"die Revision z\xE4hlt die Datenbank",en:"the database counts the revision"},applicantMode:{de:"von nichts gelesen",en:"read by nothing"},signatureLevel:{de:"von nichts gelesen",en:"read by nothing"},roleInstances:{de:"die Rollen kommen aus den Formular-Effekten",en:"roles come from the form effects"},leistungen:{de:"von nichts gelesen",en:"read by nothing"},capacity:{de:"die Kapazit\xE4t geh\xF6rt der Kohorte (program.runs[].capacities)",en:"capacity belongs to the cohort (program.runs[].capacities)"},progressLayoutId:{de:"von nichts gelesen",en:"read by nothing"},bewerbungsfenster:{de:"die Kohorte besitzt die \xD6ffnung (isOpen / applicationOpensAt)",en:"the cohort owns opening (isOpen / applicationOpensAt)"},selection:{de:"die Reihenfolge ist der Eingang `waitlistOrder` des Wartelistenknotens (automatisches Nachr\xFCcken gibt es nicht mehr; Freigabe-Strategie und Stichtag las nichts)",en:"the order is the waitlist node's input `waitlistOrder` (automatic promotion is gone; release strategy and deadline were read by nothing)"},progressLayout:{de:"das Fortschrittslayout geh\xF6rt zum Workflow: den Block nach workflow.json `progressLayout` verschieben (ohne Workflow l\xF6schen)",en:"the progress layout belongs to the workflow: move the block to workflow.json `progressLayout` (without a workflow: delete it)"}};function Kp(e){return e===null||typeof e!="object"||Array.isArray(e)?["manifest: data must be an object"]:Object.keys(e).map(t=>{let n=pd[t];return n!==void 0?`manifest: \`${t}\` is no longer part of manifest.json (${n.en}). Delete the line.`:`manifest: unknown key \`${t}\` \u2014 manifest.json carries no key.`})}s(Kp,"manifestIssues");function DH(e){let t=[],n=e.buses;if(!Array.isArray(n))return t;let r=n.find(i=>!!i&&typeof i=="object"&&i.key==="process");if(!r||!Array.isArray(r.states))return t;for(let i of r.states){if(!i||typeof i!="object")continue;let o=i;if(o.terminal!==!0&&(!o.external||typeof o.external!="object")){let a=typeof o.id=="string"?o.id:"?";t.push(`progressLayout: progress state '${a}' is non-terminal but declares no 'external' block (applicant-facing copy) \u2014 resolveStatusPresentation would throw at runtime`)}}return t}s(DH,"validateProgressLayoutExternalCopy");function EN(e){if(e===null||typeof e!="object")return["progressLayout: the full layout object is required"];let t=e.buses;return!Array.isArray(t)||!t.some(n=>!!n&&typeof n=="object"&&n.key==="process")?["progressLayout: the layout must declare the `process` bus"]:DH(e)}s(EN,"progressLayoutIssues");var IN=new Set(["nodes","assignmentRules","channels","processStore","staffInputs"]);var FH=new Set(["sections","effects","outcomes","testScenarios","env","views"]),jp={id:{de:"der Schl\xFCssel des Formulars ist sein Slug",en:"the form's key is its slug"},label:{de:"der Name steht in der Formularzeile (createSmartForm.label)",en:"the name is the form row's (createSmartForm.label)"},outcomeIds:{de:"die Ergebnisse sind die ids von outcomes[]",en:"the outcomes are the ids of outcomes[]"},schoolSlug:{de:"von nichts gelesen",en:"read by nothing"}};function ON(e,t){if(e===null||typeof e!="object"||Array.isArray(e))return[{de:`${t}: die Formulardefinition muss ein Objekt sein.`,en:`${t}: the form definition must be an object.`}];let n=[];for(let i of Object.keys(e)){if(FH.has(i))continue;let o=jp[i];n.push(o!==void 0?{de:`${t}: \`${i}\` geh\xF6rt nicht mehr zur Formulardefinition (${o.de}). Die Zeile l\xF6schen.`,en:`${t}: \`${i}\` is no longer part of the form definition (${o.en}). Delete the line.`}:{de:`${t}: unbekannter Schl\xFCssel \`${i}\`.`,en:`${t}: unknown key \`${i}\`.`})}let r=e;for(let i of["sections","effects","outcomes"])Array.isArray(r[i])||n.push({de:`${t}: \`${i}\` muss eine Liste sein.`,en:`${t}: \`${i}\` must be a list.`});return n}s(ON,"smartFormDefinitionShapeIssues");var Pn=["granted","rejected","waitlisted","other"];function yo(e){return typeof e=="string"&&Pn.includes(e)}s(yo,"isOutcomeSemantic");var fr=["arrival","manual"],_N={arrival:{de:"Nach Eingang",en:"By arrival"},manual:{de:"Von Hand sortiert",en:"Sorted by hand"}};function LH(e,t){let n=e.inputs?.[t];return n?.kind==="literal"?n.value:void 0}s(LH,"literal");function ck(e){let t=LH(e,"waitlistOrder");return fr.includes(t)?{waitlistOrder:t}:null}s(ck,"waitlistPolicyOrNull");var xt="responsible",uk="team:";function Vp(e){return`${uk}${e}`}s(Vp,"teamSlot");function Bp(e){return e.startsWith(uk)?e.slice(uk.length):null}s(Bp,"teamKeyOfSlot");function NN(e){return e.kind==="responsible"?xt:Vp(e.groupKey)}s(NN,"slotIdOf");function Up(e){if(e===xt)return{kind:"responsible"};let t=Bp(e);return t===null||t.length===0?null:{kind:"team",groupKey:t}}s(Up,"slotOfId");var fk="review",pk="checkField",PN="reviewed",mk="reviewing",Gp=["rejected","waitlisted"];function hk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(hk,"isObject");var MH=new Set(["decision",fk]),CN={approved:"granted",accepted:"granted",admitted:"granted",direkt:"granted",rejected:"rejected",absage:"rejected",declined:"rejected",waitlisted:"waitlisted",warteliste:"waitlisted"};function gk(e){return Object.hasOwn(CN,e)?CN[e]:void 0}s(gk,"legacySemanticOfId");function qH(e){return e===fk?Pn.filter(t=>!Gp.includes(t)):Pn}s(qH,"allowedSemanticsFor");var KH="other";function DN(e){return hk(e)&&MH.has(String(e.type))&&Array.isArray(e.outcomes)?e.outcomes:[]}s(DN,"outcomesOf");function FN(e){return(e?.nodes??[]).some(t=>DN(t).some(n=>hk(n)&&!("semantic"in n)))}s(FN,"needsOutcomeSemantics");function LN(e,t={}){let n=[],r=[],i=[],o=e.nodes.map(a=>{let l=DN(a);if(l.length===0)return a;let d=a,c=String(d.id),u=String(d.type),p=qH(u),h=!1,y=l.map(b=>{if(!hk(b))return b;let k=String(b.id);if("semantic"in b)return yo(b.semantic)||i.push({nodeId:c,outcomeId:k,value:String(b.semantic)}),b;let v=`${c}.${k}`,T=Object.hasOwn(t,v)?t[v]:void 0;if(T!==void 0)return p.includes(T)?(n.push({nodeId:c,outcomeId:k,semantic:T,source:"answer"}),h=!0,{...b,semantic:T}):(r.push({nodeId:c,nodeType:u,outcomeId:k,allowed:p,answer:T}),b);let $=gk(k),I=$??KH;return p.includes(I)?(n.push({nodeId:c,outcomeId:k,semantic:I,source:$===void 0?"formerDefault":"legacyTable"}),h=!0,{...b,semantic:I}):(r.push({nodeId:c,nodeType:u,outcomeId:k,allowed:p}),b)});return h?{...d,outcomes:y}:a});return n.length===0?{graph:e,written:n,refused:r,invalid:i}:{graph:{...e,nodes:o},written:n,refused:r,invalid:i}}s(LN,"addOutcomeSemantics");var zn="bewerbungOffen";function Zo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Zo,"isObject");var yk=["event","effect"];function MN(e){return Zo(e)&&e.type==="eventTrigger"}s(MN,"isTrigger");function qN(e){let t=Zo(e.inputs)?e.inputs:{};return"outcomes"in e||yk.some(n=>n in e||n in t)}s(qN,"oldShape");function KN(e){return(e?.nodes??[]).some(t=>MN(t)&&qN(t))}s(KN,"needsEventTriggerStartMove");function jH(e){let t=String(e.id),r=(Array.isArray(e.outcomes)?e.outcomes:[]).map(l=>Zo(l)?l.id:void 0);if("outcomes"in e&&!(r.length===1&&r[0]===zn))return{unmoved:{nodeId:t,reason:"outcomesNotStart"}};let i=Object.keys(Zo(e.next)?e.next:{});if(!(i.length===1&&i[0]===zn))return{unmoved:{nodeId:t,reason:"nextNotStart"}};let o=Zo(e.inputs)?{...e.inputs}:{};for(let l of yk){let d=o[l];if(Zo(d)&&d.kind==="binding")return{unmoved:{nodeId:t,reason:"bindingCell"}}}let a={...e};delete a.outcomes;for(let l of yk)delete a[l],delete o[l];return Zo(e.inputs)&&(Object.keys(o).length>0?a.inputs=o:delete a.inputs),{node:a}}s(jH,"moveNode");function jN(e){let t=[],n=[],r=e.nodes.map(i=>{if(!MN(i)||!qN(i))return i;let o=jH(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(jN,"moveEventTriggerStart");function md(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(md,"isObject");var VN={waitlistOrder:"arrival"};function BN(e){return!md(e)||e.type!=="waitlist"?!1:!("waitlistOrder"in(md(e.inputs)?e.inputs:{}))}s(BN,"lacksPolicy");function VH(e){return(e?.nodes??[]).some(BN)}s(VH,"needsWaitlistPolicyMove");function wk(e){return md(e)&&fr.includes(e.waitlistOrder)}s(wk,"isWaitlistPolicy");function BH(e){if(e===void 0)return{policy:VN,stated:!1};if(!md(e))return"malformed";let t=e.waitlistOrder;return t!==void 0&&!fr.includes(t)?"malformed":{policy:{waitlistOrder:t??VN.waitlistOrder},stated:t!==void 0}}s(BH,"policyOfSelection");function UN(e,t,n={}){let r=[],i=[];if(!VH(e))return{graph:e,moved:r,refused:i};let o=BH(t),a=e.nodes.map(l=>{if(!BN(l))return l;let d=l,c=String(d.id),u=md(d.inputs)?{...d.inputs}:{},p=Object.hasOwn(n,c)?n[c]:void 0,h,y;if(p!==void 0)h=p,y="answer";else{if(o==="malformed")return i.push({nodeId:c,reason:"selectionMalformed"}),l;h=o.policy,y=o.stated?"manifest":"formerDefault"}return u.waitlistOrder={kind:"literal",value:h.waitlistOrder},r.push({nodeId:c,policy:h,source:y}),{...d,inputs:u}});return r.length===0?{graph:e,moved:r,refused:i}:{graph:{...e,nodes:a},moved:r,refused:i}}s(UN,"moveWaitlistPolicyToInputs");function Xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Xo,"isObject");var UH=[tn,Qo],GH=["inputSchema","parties","schemaDigest","parts"];function GN(e){return Xo(e)&&e.type==="governedDocument"&&("resolver"in e||Xo(e.template)&&("key"in e.template||"cockpitFields"in e.template))}s(GN,"oldShape");function zN(e){return(e?.nodes??[]).some(GN)}s(zN,"needsGeneratorInputMove");function zH(e){let t=Xo(e.inputs)?{...e.inputs}:{},n={...e},r;if("resolver"in e){let i=e.resolver;if(!Xo(i))return{unmoved:"resolverNotObject"};if(tn in t)return{unmoved:"generatorInputExists"};if(typeof i.key!="string"||i.key.length===0)return{unmoved:"pinWithoutKey"};if(i.kind!=="generator"&&i.kind!=="package")return{unmoved:"pinWithoutKind"};if(i.revision!==void 0&&!(typeof i.revision=="number"&&Number.isInteger(i.revision)&&i.revision>0))return{unmoved:"pinRevisionInvalid"};if((Xo(i.inputSchema)&&Array.isArray(i.inputSchema.fields)?i.inputSchema.fields:[]).find(d=>Xo(d)&&UH.includes(String(d.key)))!==void 0)return{unmoved:"stampDeclaresReservedKey"};t[tn]={kind:"literal",value:{kind:i.kind,key:i.key,...i.revision===void 0?{}:{revision:i.revision}}};let l=Object.fromEntries(GH.filter(d=>d in i).map(d=>[d,i[d]]));Object.keys(l).length>0&&(n.generatorStamp=l),r=i.cockpitFields,delete n.resolver}if(Xo(e.template)&&("key"in e.template||"cockpitFields"in e.template)){let{key:i,cockpitFields:o,...a}=e.template;if("key"in e.template){if(Qo in t)return{unmoved:"templateInputExists"};if(typeof i!="string"||i.length===0)return{unmoved:"templateKeyInvalid"};t[Qo]={kind:"literal",value:i}}if(o!==void 0){if(r!==void 0)return{unmoved:"cockpitFieldsTwice"};r=o}n.template=a}if(r!==void 0){if("cockpitFields"in e)return{unmoved:"cockpitFieldsExist"};n.cockpitFields=r}return n.inputs=t,{node:n}}s(zH,"moveNode");function WN(e){let t=[],n=[],r=e.nodes.map(i=>{if(!GN(i))return i;let o=zH(i);return"unmoved"in o?(n.push({nodeId:String(i.id),reason:o.unmoved}),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(WN,"moveGeneratorPinsToInputs");var YN=/^\d{4}-\d{2}-\d{2}$/;function Dr(e,t){return{de:e,en:t}}s(Dr,"issue");function es(e){if(typeof e!="object"||e===null)return Dr("keine Reduktion","not a reduction");let t=e;if(t.kind==="none")return Object.keys(t).length===1?null:Dr('\u201Ekeine Reduktion" tr\xE4gt keine weiteren Angaben','"no reduction" carries no further details');if(t.kind!=="amount")return Dr(`unbekannte Art ${JSON.stringify(t.kind)}`,`unknown kind ${JSON.stringify(t.kind)}`);let{amount:n,activeFrom:r,activeTo:i}=t;return typeof n!="number"||!Number.isFinite(n)||n<=0?Dr("der Betrag muss gr\xF6\xDFer als 0 \u20AC sein","the amount must be greater than \u20AC0"):Number.isInteger(Number((n*100).toFixed(6)))?typeof r!="string"||!YN.test(r)?Dr("der Beginn fehlt (JJJJ-MM-TT)","the start is missing (YYYY-MM-DD)"):typeof i!="string"||!YN.test(i)?Dr("das Ende fehlt (JJJJ-MM-TT)","the end is missing (YYYY-MM-DD)"):i<r?Dr("das Ende liegt vor dem Beginn","the end is before the start"):t.floorTotal!==void 0&&(typeof t.floorTotal!="number"||!Number.isSafeInteger(t.floorTotal)||t.floorTotal<0)?Dr("die Untergrenze muss ein nichtnegativer Centbetrag sein","the floor must be a non-negative amount in cents"):t.pricePeriod!==void 0&&!["month","year","once","unit"].includes(String(t.pricePeriod))?Dr("ung\xFCltige Preisperiode","invalid price period"):Object.keys(t).some(o=>!["kind","amount","activeFrom","activeTo","floorTotal","pricePeriod"].includes(o))?Dr("unbekannte Angaben","unknown details"):null:Dr("der Betrag hat mehr als zwei Nachkommastellen","the amount has more than two decimal places")}s(es,"reductionShapeIssue");function wo(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.itemKey=="string"&&t.itemKey.length>0&&Array.isArray(t.grantKeys)&&t.grantKeys.every(n=>typeof n=="string"&&n.length>0)&&(t.reduction===void 0||es(t.reduction)===null&&t.reduction.kind==="amount")}s(wo,"isPricedItemValue");var pa=["freetext","recommendation","choice","pricedItem","record","reduction"],ma=[...pa,"appointment"];function JN(e){return typeof e=="string"&&ma.includes(e)}s(JN,"isTaskResultKind");function ha(e){return typeof e=="string"&&pa.includes(e)}s(ha,"isRecordedTaskResultKind");function ga(e){return ha(e.kind)}s(ga,"isRecordedTaskResult");var zp=["number","boolean","enum","text","person","assignment"];function kk(e){return typeof e=="string"&&zp.includes(e)}s(kk,"isRecordFieldType");function QN(e){return e==="number"||e==="boolean"||e==="enum"}s(QN,"isSuggestibleFieldType");var bk=["form","siblingRank"],Wp=500;function WH(e){switch(e.type){case"number":case"boolean":case"enum":return e.type;case"text":return"string";case"person":return e.multiple===!0?"staffUserList":"staffUser";case"assignment":return"taskAssignment"}}s(WH,"recordFieldValueType");var Oi={freetext:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Freitext",en:"Free text"}},recommendation:{choiceValueType:"enum",valueType:null,textValueType:"string",label:{de:"Empfehlung",en:"Recommendation"}},choice:{choiceValueType:"enum",valueType:"enum",textValueType:"string",label:{de:"Auswahl",en:"Choice"}},pricedItem:{choiceValueType:"enum",valueType:"pricedItem",textValueType:"string",label:{de:"Preisposition",en:"Priced item"}},reduction:{choiceValueType:null,valueType:"reduction",textValueType:"string",label:{de:"Reduktion",en:"Reduction"}},record:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Erfassung",en:"Record"}},appointment:{choiceValueType:null,valueType:null,textValueType:null,label:{de:"Termin",en:"Appointment"}}};function vk(e){return(e.kind==="freetext"||e.kind==="recommendation"||e.kind==="choice")&&e.writes===void 0}s(vk,"isProseResult");function Yp(e){return e.kind==="record"?(e.fields??[]).filter(t=>typeof t.writes=="string"&&t.writes.length>0&&kk(t.type)).map(t=>({key:t.writes,valueType:WH(t),field:t})):YH(e)}s(Yp,"draftResultStoreWrites");function YH(e){let t=Oi[e.kind].valueType;return e.writes===void 0||t===null?[]:[{key:e.writes,valueType:t}]}s(YH,"singleStoreWrite");var HN="team:";function ya(e){if(e==="all")return{kind:"all"};if(e==="external"||e.length===0)return null;if(e.startsWith(HN)){let t=e.slice(HN.length);return t.length===0?null:{kind:"team",groupKey:t}}return{kind:"channel",channelKey:e}}s(ya,"parseTaskResultChat");var He={unknownKind:"[taskResult/unknownKind]",onApproval:"[taskResult/onApproval]",unknownField:"[taskResult/unknownField]",choiceOptions:"[taskResult/choiceOptions]",textRequiredOnFreetext:"[taskResult/textRequiredOnFreetext]",chatMissing:"[taskResult/chatMissing]",chatExternal:"[taskResult/chatExternal]",chatUnknownChannel:"[taskResult/chatUnknownChannel]",appointmentMissingTitle:"[taskResult/appointmentMissingTitle]",pricedItemMissingItem:"[taskResult/pricedItemMissingItem]",pricedItemUnknownItem:"[taskResult/pricedItemUnknownItem]",pricedItemNotInProgram:"[taskResult/pricedItemNotInProgram]",pricedItemOfferWithoutProgram:"[taskResult/pricedItemOfferWithoutProgram]",itemOnNonPricedItem:"[taskResult/itemOnNonPricedItem]",writesOnProse:"[taskResult/writesOnProse]",labelMissing:"[taskResult/labelMissing]",appointmentInvalidDuration:"[taskResult/appointmentInvalidDuration]",recordFields:"[taskResult/recordFields]",fieldsOnNonRecord:"[taskResult/fieldsOnNonRecord]",recordSuggest:"[taskResult/recordSuggest]",recordText:"[taskResult/recordText]",recordPerson:"[taskResult/recordPerson]",recordAssignment:"[taskResult/recordAssignment]",reductionPrices:"[taskResult/reductionPrices]"};var HH=new Set(["if","else","in","true","false","null"]),JH=new Set(["==","!=","<=",">=","&&","||"]);function QH(e){return e>="0"&&e<="9"}s(QH,"isDigit");function ZH(e){return/[a-zA-Z_$]/.test(e)}s(ZH,"isIdentStart");function XH(e){return/[a-zA-Z0-9_.$]/.test(e)}s(XH,"isIdentCont");function eJ(e){let t=[],n=0;for(;n<e.length;){let r=e.charAt(n);if(r===" "||r===" "||r===`
11511
- `||r==="\r"){n++;continue}if(r==="'"){let o=n+1,a="";for(;o<e.length&&e.charAt(o)!=="'";)e.charAt(o)==="\\"&&o+1<e.length?(a+=e.charAt(o+1),o+=2):(a+=e.charAt(o),o++);o>=e.length&&D(`Unterminated string at ${n}`),t.push({t:"str",v:a}),n=o+1;continue}if(QH(r)){let o=n;for(;o<e.length&&/[0-9.]/.test(e.charAt(o));)o++;t.push({t:"num",v:Number(e.slice(n,o))}),n=o;continue}if(ZH(r)){let o=n;for(;o<e.length&&XH(e.charAt(o));)o++;let a=e.slice(n,o);HH.has(a)?t.push({t:"kw",v:a}):t.push({t:"ident",v:a}),n=o;continue}let i=e.slice(n,n+2);if(JH.has(i)){t.push({t:"op",v:i}),n+=2;continue}if("<>!".includes(r)){t.push({t:"op",v:r}),n++;continue}if("()[],".includes(r)){t.push({t:"punct",v:r}),n++;continue}D(`Unexpected char '${r}' at ${n}`)}return t}s(eJ,"tokenise");var ZN=1e4,XN=128;function wa(e){e.depth++,e.depth>XN&&D(`Expression nesting too deep (> ${XN})`)}s(wa,"enterDepth");function oP(e){return e.pos<e.tokens.length?e.tokens[e.pos]:null}s(oP,"peek");function nn(e){let t=e.tokens[e.pos];return t||D(`Unexpected end at ${e.pos}`),e.pos++,t}s(nn,"take");function on(e,t,n){let r=oP(e);return!(!r||r.t!==t||n!==void 0&&r.v!==n)}s(on,"match");function ts(e,t,n){return on(e,t,n)||D(`Expected ${t}${n?`:${n}`:""} at ${e.pos}`),nn(e)}s(ts,"expect");function Ni(e){wa(e);try{return on(e,"kw","if")?tJ(e):nJ(e)}finally{e.depth--}}s(Ni,"parseExpr");function tJ(e){ts(e,"kw","if"),ts(e,"punct","(");let t=Ni(e);ts(e,"punct",")");let n=Ni(e);ts(e,"kw","else");let r=Ni(e);return{kind:"if",cond:t,then:n,else:r}}s(tJ,"parseIf");function nJ(e){let t=eP(e),n=0;try{for(;on(e,"op","||");){nn(e),wa(e),n++;let r=eP(e);t={kind:"binary",op:"||",left:t,right:r}}}finally{e.depth-=n}return t}s(nJ,"parseLogicOr");function eP(e){let t=tP(e),n=0;try{for(;on(e,"op","&&");){nn(e),wa(e),n++;let r=tP(e);t={kind:"binary",op:"&&",left:t,right:r}}}finally{e.depth-=n}return t}s(eP,"parseLogicAnd");function tP(e){let t=nP(e),n=0;try{for(;on(e,"op","==")||on(e,"op","!=");){let r=nn(e).v;wa(e),n++;let i=nP(e);t={kind:"binary",op:r,left:t,right:i}}}finally{e.depth-=n}return t}s(tP,"parseEquality");function nP(e){let t=Sk(e),n=0;try{for(;on(e,"op","<")||on(e,"op","<=")||on(e,"op",">")||on(e,"op",">=")||on(e,"kw","in");){let r=nn(e),i=r.t==="kw"?"in":r.v;wa(e),n++;let o=Sk(e);t={kind:"binary",op:i,left:t,right:o}}}finally{e.depth-=n}return t}s(nP,"parseCompare");function Sk(e){if(on(e,"op","!")){nn(e),wa(e);try{return{kind:"unary",op:"!",operand:Sk(e)}}finally{e.depth--}}return rJ(e)}s(Sk,"parseUnary");function rJ(e){let t=oP(e);if(t||D("Unexpected end"),t.t==="num")return nn(e),{kind:"num",value:t.v};if(t.t==="str")return nn(e),{kind:"str",value:t.v};if(t.t==="kw"&&t.v==="true")return nn(e),{kind:"bool",value:!0};if(t.t==="kw"&&t.v==="false")return nn(e),{kind:"bool",value:!1};if(t.t==="kw"&&t.v==="null")return nn(e),{kind:"null"};if(t.t==="punct"&&t.v==="("){nn(e);let n=Ni(e);return ts(e,"punct",")"),n}if(t.t==="punct"&&t.v==="["){nn(e);let n=[];if(!on(e,"punct","]"))for(n.push(Ni(e));on(e,"punct",",");)nn(e),n.push(Ni(e));return ts(e,"punct","]"),{kind:"arr",items:n}}if(t.t==="ident"){let n=t.v;if(nn(e),on(e,"punct","(")){nn(e);let r=[];if(!on(e,"punct",")"))for(r.push(Ni(e));on(e,"punct",",");)nn(e),r.push(Ni(e));return ts(e,"punct",")"),{kind:"call",name:n,args:r}}return{kind:"ident",path:n}}D(`Unexpected token at ${e.pos}`)}s(rJ,"parsePrimary");function Mt(e){e.length>ZN&&D(`Expression too long (${e.length} > ${ZN})`);let t={tokens:eJ(e),pos:0,depth:0},n=Ni(t);return t.pos<t.tokens.length&&D(`Unexpected trailing token at ${t.pos}`),n}s(Mt,"parseExpression");var iJ=new Map([["today",()=>new Date().toISOString().slice(0,10)],["years_between",(e,t)=>{if(typeof e!="string"||typeof t!="string")return null;let n=new Date(e),r=new Date(t);if(isNaN(n.getTime())||isNaN(r.getTime()))return null;let i=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return(o<0||o===0&&r.getDate()<n.getDate())&&i--,i}],["length",e=>typeof e=="string"||Array.isArray(e)?e.length:0]]);function rn(e,t){switch(e.kind){case"num":return e.value;case"str":return e.value;case"bool":return e.value;case"null":return null;case"ident":{let n=Object.hasOwn(t.values,e.path)?t.values[e.path]:void 0;return n===void 0?null:n}case"arr":return e.items.map(n=>rn(n,t));case"unary":{let n=rn(e.operand,t);return!ns(n)}case"call":{let n=t.functions!==void 0&&Object.hasOwn(t.functions,e.name)?t.functions[e.name]:iJ.get(e.name);n||D(`Unknown function '${e.name}'`);let r=e.args.map(i=>rn(i,t));return n(...r)}case"binary":return oJ(e.op,e.left,e.right,t);case"if":return ns(rn(e.cond,t))?rn(e.then,t):rn(e.else,t)}}s(rn,"evaluate");function oJ(e,t,n,r){if(e==="&&"){let a=rn(t,r);return ns(a)?ns(rn(n,r)):!1}if(e==="||"){let a=rn(t,r);return ns(a)?!0:ns(rn(n,r))}let i=rn(t,r),o=rn(n,r);switch(e){case"==":return xk(i,o);case"!=":return!xk(i,o);case"<":{let[a,l]=Hp(i,o);return a!==null&&l!==null&&a<l}case"<=":{let[a,l]=Hp(i,o);return a!==null&&l!==null&&a<=l}case">":{let[a,l]=Hp(i,o);return a!==null&&l!==null&&a>l}case">=":{let[a,l]=Hp(i,o);return a!==null&&l!==null&&a>=l}case"in":return Array.isArray(o)?o.some(a=>xk(a,i)):!1}}s(oJ,"evalBinary");function Hp(e,t){return[rP(e),rP(t)]}s(Hp,"orderedOperands");function rP(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"){if(e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}return null}s(rP,"numericOperand");function xk(e,t){return e===t?!0:e==null||t==null?!1:typeof e=="number"&&typeof t=="string"?e===Number(t):typeof e=="string"&&typeof t=="number"?Number(e)===t:!1}s(xk,"looseEq");function ns(e){return!(e==null||e===!1||e===0||e===""||Array.isArray(e)&&e.length===0)}s(ns,"truthy");function qt(e){let t=new Set;return _i(e,t),[...t]}s(qt,"dependencies");function _i(e,t){switch(e.kind){case"ident":t.add(e.path);return;case"call":e.args.forEach(n=>_i(n,t));return;case"arr":e.items.forEach(n=>_i(n,t));return;case"unary":_i(e.operand,t);return;case"binary":_i(e.left,t),_i(e.right,t);return;case"if":_i(e.cond,t),_i(e.then,t),_i(e.else,t);return;default:return}}s(_i,"walk");var iP=new Map;function Pi(e){let t=iP.get(e);return t||(t=Mt(e),iP.set(e,t)),t}s(Pi,"parseCached");function sJ(e,t){return rn(Pi(e),t)}s(sJ,"evalExpression");function sP(e,t){return ns(sJ(e,t))}s(sP,"evalBoolean");function aP(e,t){t!==null&&(typeof t=="object"||typeof t=="function")&&Object.hasOwn(t,"exports")&&D(`[workflow/registry] node type "${e}": custom spec.exports is unsupported; use artifact-slot exports.`)}s(aP,"assertNoCustomNodeExports");var Ak=null;function lP(e){for(let[t,n]of Object.entries(e))aP(t,n);Ak=e}s(lP,"setSpecs");function dP(){return Ak||D("[workflow/registry] Specs not initialised. Import convex/model/admission/specs before calling specFor()."),Ak}s(dP,"requireSpecs");function Ue(e){let t=dP(),n=t[e.type];return n===void 0&&de("INVALID",{de:`[workflow/registry] Unbekannter Knotentyp "${String(e.type)}" (Knoten "${String(e.id)}"). Registrierte Typen: ${Object.keys(t).sort().join(", ")}.`,en:`[workflow/registry] Unknown node type "${String(e.type)}" (node "${String(e.id)}"). Registered types: ${Object.keys(t).sort().join(", ")}.`}),n}s(Ue,"specFor");function cP(){return Object.keys(dP()).sort()}s(cP,"registeredNodeTypes");var uP=Fp.filter(e=>Ei[e].cohortBound!==!0);function Tk(e){return ur(e)&&Ei[e].cohortBound!==!0}s(Tk,"isEnvAddressLeaf");function Rk(e){return Jo(e).type}s(Rk,"envType");function $k(e){return Jo(e).label}s($k,"envLabel");function Ek(e){if(e.scope==="env"||e.path===void 0)return e;switch(e.scope){case"node":return{scope:"node",owner:e.owner,key:e.key};case"task":return{scope:"task",owner:e.owner,key:e.key}}}s(Ek,"addressBase");function pr(e){return e.scope==="node"&&e.key===Yt&&e.path===void 0}s(pr,"isInstanceAddress");function mt(e){return ke(e)&&e.scope==="node"&&e.key===Yt&&e.path!==void 0}s(mt,"isFormFieldAddress");function fP(e){return mt(e)?{owner:e.owner,path:e.path}:null}s(fP,"formFieldOf");function aJ(e){return qt(Pi(e)).map(t=>{if(!t.startsWith("$"))return{identifier:t,address:null,reason:"bareIdentifier"};let n=Ri(t);return n===null?{identifier:t,address:null,reason:"shape"}:{identifier:t,address:n}})}s(aJ,"expressionAddresses");var Yt="admission",Ik="document",Qp="contract",Zp="contracts",pP="payment",Ok=new Set(["adoptForm","setFlagTarget","form","familyRequestFrom"]);var xn={id:"identity",type:"identity",label:"display",sublabel:"display",library:"display",outcomes:"control",outputLabels:"display",inputs:"input",next:"control",tasks:"config",assign:"reference",actionTeams:"reference",optionalActions:"config",artifacts:"config",notifications:"config"},Mhe={join:{...xn},end:{...xn},eventTrigger:{...xn},form:{...xn,adoptForm:"address",formExports:"stamp"},roleAssign:{...xn},setFlag:{...xn},if:{...xn,condition:"address"},countersign:{...xn,contract:"address",titles:"display",signing:"config"},engagePush:{...xn,engage:"tenantRef",form:"address",contract:"address",payment:"address"},decision:{...xn,commentRequired:"config",decisionAsTask:"config",reads:"address",view:"config",requiresOneOf:"config"},review:{...xn,form:"address",commentRequired:"config",decisionAsTask:"config"},waitlist:{...xn},completenessCheck:{...xn,requires:"address",deadline:"config"},collectPayment:{...xn},governedDocument:{...xn,production:"config",form:"address",generatorStamp:"stamp",templateStamp:"stamp",approval:"config",confirmBeforeIssue:"config",confirmContractTerms:"config",contractTermsQuestionText:"display",responseStrategy:"config",titles:"display",responseLabels:"display",reads:"address"}};function ai(e){return Array.isArray(e)?e:[]}s(ai,"listOf");function Sn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}s(Sn,"record");function mP(e){switch(e.type){case"countersign":return["contract"];case"engagePush":return["form","contract","payment"];case"governedDocument":return e.production==="resolver"?["form"]:[];case"review":return["form"];default:return[]}}s(mP,"dataSourceFieldsOf");function hP(e){return e.type==="review"?[]:e.type==="engagePush"?["form"]:mP(e)}s(hP,"requiredDataSourceFields");var lJ={setFlag:{target:"setFlagTarget"}};function hd(e,t={}){let n=[],r=e,i=`nodes.${e.id}`,o=s((d,c,u,p={})=>{n.push({kind:d,at:c,nodeId:e.id,value:u,judgedTogether:null,...p})},"field"),a=new Map(t.slotTypes===!1?[]:(Ue(e).inputs?.(e)??[]).map(d=>[d.id,d.type])),l=lJ[e.type]??{};for(let[d,c]of Object.entries(Sn(r.inputs)??{})){let u=Sn(c);if(u?.kind!=="binding")continue;let p="address"in u?u.address:u.path,h=l[d];if(h!==void 0){o(h,`${i}.inputs.${d}`,p);continue}let y=a.get(d);o("binding",`${i}.inputs.${d}`,p,y!==void 0?{expectedType:y}:{})}for(let[d,c]of ai(r.reads).entries())o("nodeReads",`${i}.reads.${d}`,c,{judgedTogether:`${i}.reads`});for(let[d,c]of ai(r.requires).entries())o("requires",`${i}.requires.${d}`,c,{judgedTogether:`${i}.requires`});e.type==="form"&&r.adoptForm!==void 0&&o("adoptForm",`${i}.adoptForm`,r.adoptForm);for(let d of mP(e))r[d]!==void 0&&o(d,`${i}.${d}`,r[d]);e.type==="if"&&r.condition!==void 0&&o("condition",`${i}.condition`,r.condition);for(let[d,c]of Object.entries(Sn(r.assign)??{}))for(let[u,p]of ai(c).entries()){let h=Sn(p)?.when;h!=null&&o("teamWhen",dJ(e.id,d,u),h,{expectedType:"boolean"})}for(let[d,c]of ai(r.tasks).entries())n.push(...gP(e.id,c,d));for(let[d,c]of ai(r.optionalActions).entries()){let u=Sn(c);u?.when!==void 0&&o("optionalActionWhen",cJ(e.id,typeof u.key=="string"?u.key:String(d)),u.when)}return n}s(hd,"nodeAddressFields");function dJ(e,t,n){return`nodes.${e}.assign.${t}.${n}.when`}s(dJ,"teamWhenPath");function cJ(e,t){return`nodes.${e}.optionalActions.${t}.when`}s(cJ,"optionalActionWhenPath");function gP(e,t,n){let r=Sn(t);if(r===null)return[];let i=[],o=typeof r.key=="string"?r.key:String(n),a=`nodes.${e}.tasks.${o}`,l=s((p,h,y,b={})=>{i.push({kind:p,at:h,nodeId:e,taskKey:o,value:y,judgedTogether:null,...b})},"field"),d=`${a}.evidence`;r.when!==void 0&&l("taskWhen",`${a}.when`,r.when,{expectedType:"boolean",judgedTogether:d});for(let[p,h]of ai(r.reads).entries())l("taskReads",`${a}.reads.${p}`,h,{judgedTogether:d});for(let[p,h]of ai(r.inputs).entries())l("taskInput",`${a}.inputs.${p}`,h);for(let[p,h]of ai(r.documents).entries()){let y=Sn(h);y===null||y.kind!=="field"||l("taskDocument",`${a}.documents.${p}`,y.address)}let c=Sn(r.familyRequest);if(c!==null){for(let[p,h]of ai(c.fields).entries())l("familyRequestFields",`${a}.familyRequest.fields.${p}`,h,{judgedTogether:`${a}.familyRequest.fields`});c.from!==void 0&&l("familyRequestFrom",`${a}.familyRequest.from`,c.from)}let u=Sn(r.result);if(u?.kind==="record")for(let[p,h]of ai(u.fields).entries()){let y=Sn(Sn(h)?.suggest);if(y?.kind!=="form")continue;let b=Sn(h)?.type;l("suggest",`${a}.result.fields.${p}.suggest`,"address"in y?y.address:y.key,typeof b=="string"?{expectedType:b}:{})}return i}s(gP,"taskAddressFields");function ka(e){return _k(e)?(Nk(e.value)??[]).flatMap(t=>t.address===null?[]:[t.address]):ke(e.value)?[e.value]:[]}s(ka,"addressesInField");function _k(e){return e.kind==="condition"||e.kind==="optionalActionWhen"}s(_k,"isExpressionField");function Nk(e){if(typeof e!="string"||e.trim().length===0)return null;try{Pi(e)}catch{return null}return aJ(e)}s(Nk,"conditionAddresses");function Cn(e){return e.type==="form"&&e.adoptForm!==void 0&&e.adoptForm!==!1}s(Cn,"adoptsForm");function yP(e){if(e.type!=="form"||Cn({type:e.type,adoptForm:e.adoptForm}))return;let t=e.inputs?.smartForm;return t?.kind==="literal"&&typeof t.value=="string"&&t.value!==""?t.value:void 0}s(yP,"createdSmartFormSlug");function uJ(e,t){return e.type!=="governedDocument"||e.production!=="resolver"||t!==Ik?t:e.generatorStamp?.parts!==void 0?Zp:Qp}s(uJ,"addressKeyOfPort");function wP(e){let t=e.result;return t===void 0||!ga(t)?[]:Yp(t).map(n=>n.key)}s(wP,"storeWritesOf");function Pk(e,t){return(Array.isArray(e.processStore)?e.processStore:[]).find(n=>n.key===t)}s(Pk,"declaredKey");function li(e,t){let n=[];if(!Cn(t))for(let r of Ue(t).outputs?.(t)??[])n.push({address:{scope:"node",owner:t.id,key:uJ(t,r.name)},type:r.type,...r.label!==void 0?{label:r.label}:{},nodeId:t.id,nodePort:r});for(let r of Array.isArray(t.tasks)?t.tasks:[])for(let i of wP(r)){let o=Pk(e,i);n.push({address:{scope:"task",owner:r.key,key:i},type:o?.type??"unknown",...o!==void 0?{label:o.label}:{},nodeId:t.id})}return n}s(li,"producedAddresses");function kP(e,t,n){for(let r of e.nodes)for(let i of Array.isArray(r.tasks)?r.tasks:[])if(i.key===t&&wP(i).includes(n))return{nodeId:r.id,template:i};return null}s(kP,"taskWriter");function Ci(e,t,n){return kP(e,t,n)?.nodeId??null}s(Ci,"taskOwnerNode");function fJ(e){return hd(e,{slotTypes:!1}).flatMap(t=>ka(t).map(n=>({address:n,field:t})))}s(fJ,"writtenAddressesOf");function rs(e,t){let n=[],r=new Set,i=s((a,l,d,c)=>{let u=`${ce(a)}|${l}|${d.at}|${c===void 0?"":ce(c)}`;r.has(u)||(r.add(u),n.push({address:a,origin:l,field:d,...c!==void 0?{via:c}:{}}))},"push"),o=s((a,l)=>{if(a.scope!=="task")return;let d=kP(e,a.owner,a.key);if(d!==null){for(let c of gP(d.nodeId,d.template))if(!(c.kind!=="taskWhen"&&c.kind!=="taskReads"))for(let u of ka(c))i(u,"evidence",l,a)}},"carried");for(let{address:a,field:l}of fJ(t))i(a,"written",l),o(a,l);return n}s(rs,"addressReadsOf");function gd(e,t){switch(t.scope){case"env":return ur(t.key)?Rk(t.key):ua(e,t.key)?.type;case"task":return t.path!==void 0||Ci(e,t.owner,t.key)===null?void 0:Pk(e,t.key)?.type;case"node":{let n=e.nodes.find(i=>i.id===t.owner);if(n===void 0)return;let r=li(e,n).find(i=>i.address.scope==="node"&&i.address.key===t.key);return r===void 0?void 0:t.path===void 0?r.type:r.nodePort?.schema?.find(i=>i.key===t.path)?.type}}}s(gd,"addressType");function Jp(e,t){let n=Sn(e)?.[t];return typeof n=="string"&&n.length>0?n:void 0}s(Jp,"labelText");function Pe(e,t,n){let r=e.nodes.find(i=>i.id===t);return Jp(r?.label,n)??t}s(Pe,"nodeDisplayName");function is(e,t,n){for(let r of e.nodes){let i=(Array.isArray(r.tasks)?r.tasks:[]).find(o=>o.key===t);if(i!==void 0)return Jp(i.title,n)??t}return t}s(is,"taskDisplayName");function Ge(e,t,n){let r=[];switch(t.scope){case"env":r.push(ur(t.key)?$k(t.key)[n]:ua(e,t.key)?.label[n]??t.key);break;case"task":r.push(is(e,t.owner,n),Jp(Pk(e,t.key)?.label,n)??t.key);break;case"node":{r.push(Pe(e,t.owner,n));let i=e.nodes.find(a=>a.id===t.owner),o=i===void 0?void 0:li(e,i).find(a=>a.address.scope==="node"&&a.address.key===t.key);r.push(Jp(o?.label,n)??t.key);break}}return t.scope!=="env"&&t.path!==void 0&&r.push(t.path),`${r.join(" \u203A ")} (${ce(t)})`}s(Ge,"displayAddress");var yd=["beneficiary","signers"];function wd(e){let t=[];for(let[n,r]of Object.entries(Sn(e.inputs)??{})){let i=Sn(r);i?.kind==="binding"&&ke(i.address)&&t.push({slot:n,address:i.address})}return t}s(wd,"bindingAddresses");function bP(e,t){return wd(e).find(n=>n.slot===t)?.address??null}s(bP,"bindingAddressAt");function vP(e,t){let n=s(i=>i.scope==="node"&&i.owner===t||i.scope==="task"&&Ci(e,i.owner,i.key)===t,"names");return e.nodes.filter(i=>i.id!==t).flatMap(i=>hd(i,{slotTypes:!1})).flatMap(i=>ka(i).filter(n).map(o=>({at:i.at,nodeId:i.nodeId,address:o})))}s(vP,"addressesNaming");var Kt={target:"target",flagKey:"flagKey",value:"value"};function pJ(e){return bP(e,Kt.target)}s(pJ,"setFlagTarget");function xP(e){let t=pJ(e);return t!==null&&pr(t)?t.owner:null}s(xP,"setFlagTargetOwner");function Xp(e){let t=e.inputs?.[Kt.flagKey];return t?.kind==="literal"&&typeof t.value=="string"&&t.value.length>0?t.value:null}s(Xp,"setFlagKey");function SP(e){let t=e.inputs?.[Kt.value];if(t===void 0||t.kind==="unset")return!0;if(t.kind==="literal"&&typeof t.value=="boolean")return t.value;D(`[setFlag/valueType] setFlag node "${String(e.id)}": \`${Kt.value}\` is no yes/no literal \u2014 publish refuses that`)}s(SP,"setFlagValue");function AP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(AP,"isObject");var TP=["target","flagKey","value"];function RP(e){return AP(e)&&e.type==="setFlag"&&TP.some(t=>t in e)}s(RP,"oldShape");function $P(e){return(e?.nodes??[]).some(RP)}s($P,"needsSetFlagInputMove");function mJ(e){let t=AP(e.inputs)?{...e.inputs}:{};if(TP.some(a=>a in e&&Kt[a]in t))return{unmoved:"inputExists"};if("target"in e&&!ke(e.target))return{unmoved:"targetNotAddress"};if("flagKey"in e&&typeof e.flagKey!="string")return{unmoved:"flagKeyNotString"};if("value"in e&&typeof e.value!="boolean")return{unmoved:"valueNotBoolean"};let{target:n,flagKey:r,value:i,...o}=e;return n!==void 0&&(t[Kt.target]={kind:"binding",address:n}),typeof r=="string"&&r.length>0&&(t[Kt.flagKey]={kind:"literal",value:r}),i!==void 0&&(t[Kt.value]={kind:"literal",value:i}),{node:{...o,inputs:t}}}s(mJ,"moveNode");function EP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!RP(i))return i;let o=mJ(i);return"unmoved"in o?(n.push({nodeId:String(i.id),reason:o.unmoved}),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(EP,"moveSetFlagConfigToInputs");function IP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(IP,"isObject");var Ck={countersign:{dueInDays:"number"},decision:{allowSkipInTest:"boolean"},completenessCheck:{guestRole:"string"},governedDocument:{responseDueInDays:"number"}},Dk={review:["allowSkipInTest"]};function OP(e){return Ck[String(e)]??{}}s(OP,"movesOf");function _P(e){return Dk[String(e)]??[]}s(_P,"deadOf");function NP(e){return IP(e)&&[...Object.keys(OP(e.type)),..._P(e.type)].some(t=>t in e)}s(NP,"oldShape");function PP(e){return(e?.nodes??[]).some(NP)}s(PP,"needsScalarInputMove");function hJ(e,t){return t==="number"?typeof e=="number"&&Number.isInteger(e)&&e>=1:typeof e===t}s(hJ,"wellTyped");function gJ(e){let t=IP(e.inputs)?{...e.inputs}:{},n={...e};for(let[r,i]of Object.entries(OP(e.type))){if(!(r in e))continue;let o=e[r];if(r in t)return{unmoved:{nodeId:String(e.id),key:r,reason:"inputExists"}};if(!(i==="string"&&o==="")&&!hJ(o,i))return{unmoved:{nodeId:String(e.id),key:r,reason:"valueWrongType"}};o!==""&&(t[r]={kind:"literal",value:o}),delete n[r]}for(let r of _P(e.type))delete n[r];return n.inputs=t,{node:n}}s(gJ,"moveNode");function CP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!NP(i))return i;let o=gJ(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(CP,"moveScalarConfigToInputs");var ba={team:{label:{de:"Team",en:"Team"},optionSource:"tenantTeams",existence:{check:"generic",catalog:"teamKeys"}},roleKey:{label:{de:"Rolle",en:"Role"},optionSource:"tenantRoles",existence:{check:"node",codes:["roleAssign/unknownRoleKey","completenessCheck/unknownRole"]}},article:{label:{de:"Artikel",en:"Article"},optionSource:"programArticles",existence:{check:"node",codes:["collectPayment/unknownArticle"]}},legalEntity:{label:{de:"Tr\xE4ger",en:"Legal entity"},optionSource:"tenantTraeger",existence:{check:"node",codes:["governedDocument/unknownTraeger","collectPayment/unknownPayee"]}},contractGenerator:{label:{de:"Vertragsgenerator",en:"Contract generator"},optionSource:"tenantGenerators",existence:{check:"publish",by:"admittedGeneratorByKey"}},documentTemplate:{label:{de:"Dokumentvorlage",en:"Document template"},optionSource:"tenantDocumentTemplates",existence:{check:"publish",by:"governedDocument/unknownTemplate"}},smartForm:{label:{de:"Formular",en:"Form"},optionSource:"offerSmartForms",existence:{check:"publish",by:"form/unknownSmartForm"}},unit:{label:{de:"Einrichtung",en:"Unit"},optionSource:"tenantUnits",existence:{check:"generic",catalog:"unitKeys"}},formFlag:{label:{de:"Merkmal im Formular",en:"Flag in the form"},optionSource:"targetFormFlags",existence:{check:"node",codes:["setFlag/unknownFlag"]}}};function em(e){return typeof e=="string"&&Object.hasOwn(ba,e)}s(em,"isResourceType");var Xhe=Object.keys(ba).filter(e=>ba[e].existence.check==="generic");function DP(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.groupKey=="string"&&t.groupKey.length>0&&Array.isArray(t.grantKeys)&&t.grantKeys.every(n=>typeof n=="string"&&n.length>0)&&(t.reduction===void 0||es(t.reduction)===null&&t.reduction.kind==="amount")&&Object.keys(t).every(n=>n==="groupKey"||n==="grantKeys"||n==="reduction")}s(DP,"isPricedGroupValue");var Fk=["street","hausnr","plz","ort","land"];function FP(e){return Fk.includes(e)}s(FP,"isAddressPart");var yJ=["municipality","municipalityKey","district","districtKey"],Lk=[...Fk,...yJ],Mk={string:"text",email:"text",tel:"text",number:"number",date:"date",boolean:"boolean",consent:"boolean",enum:"option",address:"composite",docRef:"file",party:"edge",personRef:"edge",personList:"edge",roleKey:"roleKey",pricedItem:"pricedItem",pricedGroup:"pricedGroup",reduction:"reduction",article:"article",legalEntity:"legalEntity",contractGenerator:"contractGenerator",documentTemplate:"documentTemplate",localizedText:"localizedText",staffUser:"staffUser",staffUserList:"staffUser",taskAssignment:"taskAssignment"},va=Object.keys(Mk);function di(e){return typeof e=="string"&&e in Mk}s(di,"isValueType");function gn(e){return e===void 0?void 0:Mk[e]}s(gn,"dataTypeOf");function tm(e,t){let n=gn(e),r=gn(t);return n!==void 0&&n===r}s(tm,"valueTypesCompatible");function os(e){return e===null?"null is not a text in both languages":kd(e,{type:"localizedText"})}s(os,"completeLocalizedTextIssue");function kd(e,t){if(em(t.type)&&!di(t.type))return typeof e=="string"&&e.length>0?null:`${JSON.stringify(e)} is not a ${t.type} key`;let n=gn(t.type),r=JSON.stringify(e),i=`slot type "${t.type}" takes a binding, not a literal`;if(n===void 0||n==="composite"||n==="file"||n==="edge"||n==="staffUser"||n==="taskAssignment")return i;if(e===null)return null;switch(n){case"text":return typeof e=="string"?null:`${r} is not a text (slot type "${t.type}")`;case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?null:`${r} is not a date YYYY-MM-DD`;case"number":return typeof e=="number"&&Number.isFinite(e)?null:`${r} is not a number`;case"boolean":return typeof e=="boolean"?null:`${r} is not true/false`;case"option":{if(typeof e!="string")return`${r} is not an option value`;let o=(t.enumOptions??[]).map(a=>a.value);return o.length===0||o.includes(e)?null:`${r} is not one of the options ${o.join(", ")}`}case"pricedItem":{let o=e;return typeof o=="object"&&typeof o.itemKey=="string"&&o.itemKey.length>0&&Array.isArray(o.grantKeys)&&o.grantKeys.every(a=>typeof a=="string")?null:`${r} is not a priced item {"itemKey":\u2026,"grantKeys":[\u2026]}`}case"pricedGroup":return DP(e)?null:`${r} is not a priced group {"groupKey":\u2026,"grantKeys":[\u2026]}`;case"article":return typeof e=="string"&&e.length>0?null:`${r} is not an article key`;case"legalEntity":return typeof e=="string"&&e.length>0?null:`${r} is not a legal entity key`;case"contractGenerator":return fd(e)?null:`${r} is not a contract generator {"kind":"generator"|"package","key":\u2026,"revision"?:n}`;case"documentTemplate":return typeof e=="string"&&e.length>0?null:`${r} is not a document template key`;case"roleKey":return typeof e=="string"&&e.length>0?null:`${r} is not a role key`;case"localizedText":{let o=e,a=s(l=>typeof l=="string"&&l.trim().length>0,"filled");return typeof o=="object"&&Object.keys(o).sort().join(",")==="de,en"&&a(o.de)&&a(o.en)?null:`${r} is not a text in both languages {"de":\u2026,"en":\u2026}`}case"reduction":{let o=es(e);return o===null?null:`${r} is not a reduction \u2014 ${o.en}`}}}s(kd,"literalTypeIssue");function LP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(LP,"isObject");var wJ={collectPayment:{reason:"reason"}},kJ={governedDocument:["mockAutoProduce"]},MP={collectPayment:{reason:{de:"`reason` gibt es als Knoteneigenschaft nicht mehr \u2014 der Hinweis f\xFCr die Familie ist der Eingang `inputs.reason` (ein fester Text auf Deutsch und Englisch im Parameter-Bereich).",en:"`reason` no longer exists as a node property \u2014 the note for the family is the input `inputs.reason` (a fixed text in German and English among the parameters)."}},governedDocument:{template:{de:"`template` gibt es am Knoten nicht mehr \u2014 die Parameter geh\xF6ren der Vorlage (ihr Datensatz, `plexus-cli catalog` documentTemplates[].parameters) und werden beim Speichern und Ver\xF6ffentlichen als `templateStamp` \xFCbernommen.",en:"`template` no longer exists on the node \u2014 the parameters belong to the template (its record, `plexus-cli catalog` documentTemplates[].parameters) and are stamped as `templateStamp` on save and publish."},cockpitFields:{de:'`cockpitFields` gibt es nicht mehr \u2014 ein Parameter, der im Cockpit erg\xE4nzt wird, ist sein Eingang `{ kind: "cockpit" }` (im Parameter-Bereich \u201Eim Cockpit erg\xE4nzen").',en:'`cockpitFields` no longer exists \u2014 a parameter completed in the cockpit is its input `{ kind: "cockpit" }` ("complete in the cockpit" among the parameters).'},mockAutoProduce:{de:"`mockAutoProduce` gibt es nicht mehr \u2014 das Muster-Dokument, das ein Upload-Knoten beim Eintritt selbst einstellte, ist entfernt; das Dokument kommt aus einem Upload.",en:"`mockAutoProduce` no longer exists \u2014 the sample document an upload node put on its slot by itself on entry is removed; the document comes from an upload."}}};function qk(e){return wJ[String(e)]??{}}s(qk,"movesOf");function qP(e){return kJ[String(e)]??[]}s(qP,"deadOf");function KP(e){return LP(e)&&[...Object.keys(qk(e.type)),...qP(e.type)].some(t=>t in e)}s(KP,"oldShape");function jP(e){return(e?.nodes??[]).some(KP)}s(jP,"needsNodeConfigInputMove");function bJ(e){return os(e)===null}s(bJ,"isCompleteText");function vJ(e){let t=LP(e.inputs)?{...e.inputs}:{},n={...e};for(let[r,i]of Object.entries(qk(e.type)))if(r in e){if(i in t)return{unmoved:{nodeId:String(e.id),key:r,reason:"inputExists"}};if(!bJ(e[r]))return{unmoved:{nodeId:String(e.id),key:r,reason:"valueNotLocalized"}};t[i]={kind:"literal",value:e[r]},delete n[r]}for(let r of qP(e.type))delete n[r];return Object.keys(qk(e.type)).some(r=>r in e)&&(n.inputs=t),{node:n}}s(vJ,"moveNode");function VP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!KP(i))return i;let o=vJ(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(VP,"moveNodeConfigToInputs");var bd="collectPayment",xa=["online","manual"];function nm(e){return xa.includes(e)}s(nm,"isCollectPaymentMode");var ss="paid",Kk="skipPayment",jk="confirmPayment",Di="article",sn="mode",Fi="reason",Wn="payee",Vk=["one_time"];function rm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(rm,"isObject");function BP(e){if(!rm(e)||e.type!==bd)return!1;let t=rm(e.inputs)?e.inputs:{},n=t[sn];return!rm(n)||n.kind!=="literal"||n.value!=="online"?!1:!(Wn in t)}s(BP,"isOnlinePaymentWithoutPayee");function UP(e){return(e?.nodes??[]).some(BP)}s(UP,"needsPayee");function GP(e,t={}){let n=[],r=[],i=e.nodes.map(o=>{if(!BP(o))return o;let a=String(o.id),l=Object.hasOwn(t,a)?t[a]:void 0;if(l===void 0||l==="")return r.push(a),o;n.push({nodeId:a,payee:l});let d=rm(o.inputs)?o.inputs:{};return{...o,inputs:{...d,[Wn]:{kind:"literal",value:l}}}});return n.length===0?{graph:e,set:n,refused:r}:{graph:{...e,nodes:i},set:n,refused:r}}s(GP,"setPayeeOnOnlinePayments");var zP="settlement",xJ={online:"online",separate:"manual"};function Bk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Bk,"isObject");function WP(e){return Bk(e)&&e.type===bd&&Bk(e.inputs)&&zP in e.inputs}s(WP,"carriesSettlement");function YP(e){return(e?.nodes??[]).some(WP)}s(YP,"needsPaymentModeRename");function HP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!WP(i))return i;let o=String(i.id),{[zP]:a,...l}=i.inputs;if(sn in l)return n.push({nodeId:o,reason:"bothCells"}),i;let d=Bk(a)&&a.kind==="literal"&&typeof a.value=="string"?xJ[a.value]:void 0;return d===void 0?(n.push({nodeId:o,reason:"unknownValue"}),i):(t.push(o),{...i,inputs:{...l,[sn]:{...a,value:d}}})});return t.length===0?{graph:e,moved:t,refused:n}:{graph:{...e,nodes:r},moved:t,refused:n}}s(HP,"renameSettlementToMode");var QP="formView";function im(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(im,"isObject");function Uk(e){return Array.isArray(e.tasks)?e.tasks:[]}s(Uk,"tasksOf");function vd(e){return im(e)&&QP in e}s(vd,"carriesFormView");function ZP(e){return(e?.nodes??[]).some(t=>vd(t)||im(t)&&Uk(t).some(vd))}s(ZP,"needsFormViewMove");function JP(e){let{[QP]:t,...n}=e;return"view"in n?"bothFields":!im(t)||typeof t.form!="string"||typeof t.key!="string"?"malformed":{...n,view:{kind:"form",form:t.form,view:t.key}}}s(JP,"moved");function XP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!im(i))return i;let o=String(i.id),a=i;if(vd(a)){let l=JP(a);typeof l=="string"?n.push({nodeId:o,reason:l}):(a=l,t.push(o))}return Uk(a).some(vd)&&(a={...a,tasks:Uk(a).map(l=>{if(!vd(l))return l;let d=String(l.key),c=JP(l);return typeof c=="string"?(n.push({nodeId:o,taskKey:d,reason:c}),l):(t.push(`${o}.${d}`),c)})}),a});return t.length===0?{graph:e,moved:t,refused:n}:{graph:{...e,nodes:r},moved:t,refused:n}}s(XP,"moveFormViewToView");function sm(e){if(!Array.isArray(e))return[{code:"shape",index:null,detail:`expected a list of rows, got ${om(e)}`}];if(e.length===0)return[{code:"shape",index:null,detail:"expected at least the default row, got an empty list"}];let t=[];for(let i=0;i<e.length;i++){let o=AJ(e[i]);o!==null&&t.push({code:"shape",index:i,detail:o})}if(t.length>0)return t;let n=e.flatMap((i,o)=>i.when===null?[o]:[]),r=e.length-1;return(n.length!==1||n[0]!==r)&&t.push({code:"defaultLast",index:n.find(i=>i!==r)??null,detail:SJ(n,r)}),t}s(sm,"teamRulesShapeIssues");function SJ(e,t){return e.length===0?"no default row (`when: null`) \u2014 the last row must be the default":e.length>1?`${e.length} default rows (rows ${e.join(", ")}) \u2014 exactly one, the last`:`the default row is row ${e[0]}, not the last (${t})`}s(SJ,"defaultLastDetail");function Gk(e,t){let n=sm(e);return n.length>0&&D(`[assign/${n[0].code}] ${t}: ${n.map(r=>r.index===null?r.detail:`row ${r.index}: ${r.detail}`).join("; ")} \u2014 publish refuses such a graph`),e}s(Gk,"readTeamRules");function am(e){return sm(e).length===0?e:null}s(am,"tryReadTeamRules");function Yn(e){return lm([],e)}s(Yn,"fixedTeam");function lm(e,t){return Gk([...e.map(({when:n,team:r})=>({when:n,team:r})),{when:null,team:t}],"a constructed team position")}s(lm,"teamRulesOf");function zk(e,t){return e===void 0?Yn(t):lm(e.slice(0,-1),t)}s(zk,"withDefaultTeam");function eC(e){let t=e[e.length-1];return t===void 0&&D("[assign/shape] a team position has at least its default row \u2014 read it through readTeamRules"),t.team}s(eC,"defaultTeamOf");function tC(e){let t=new Map,n=[];return e.forEach((r,i)=>{if(r.when===null)return;let o=ce(r.when),a=t.get(o);a===void 0?t.set(o,i):n.push({index:i,first:a})}),n}s(tC,"shadowedRows");function AJ(e){if(typeof e!="object"||e===null||Array.isArray(e))return`expected { when, team }, got ${om(e)}`;let t=e,n=Object.keys(t).filter(r=>r!=="when"&&r!=="team");return n.length>0?`unknown key(s) ${n.map(r=>`"${r}"`).join(", ")} \u2014 a row is { when, team }`:typeof t.team!="string"||t.team.length===0?`"team" must be a team key, got ${om(t.team)}`:"when"in t?t.when!==null&&!ke(t.when)?`"when" must be an address or null, got ${om(t.when)}`:null:'"when" is missing \u2014 the default row says `when: null`'}s(AJ,"rowShapeProblem");function om(e){if(e===void 0)return"nothing";let t;try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>80?`${t.slice(0,77)}...`:t}s(om,"describe");function nC(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(nC,"isObject");function rC(e){return nC(e)&&nC(e.assign)?e.assign:null}s(rC,"assignOf");function iC(e){return(e?.nodes??[]).some(t=>Object.values(rC(t)??{}).some(n=>typeof n=="string"))}s(iC,"needsNodeAssignFold");function oC(e){let t=[],n=[],r=e.nodes.map(i=>{let o=rC(i);if(o===null)return i;let a=String(i.id),l=!1,d={};for(let[c,u]of Object.entries(o))typeof u=="string"&&u.length>0?(d[c]=Yn(u),t.push({nodeId:a,templateKey:c}),l=!0):(!Array.isArray(u)&&u!==void 0&&n.push({nodeId:a,templateKey:c}),d[c]=u);return l?{...i,assign:d}:i});return t.length===0?{graph:e,moved:t,refused:n}:{graph:{...e,nodes:r},moved:t,refused:n}}s(oC,"foldNodeAssignToTeamRules");function ci(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(ci,"isObject");function Wk(e){return Array.isArray(e.tasks)?e.tasks:[]}s(Wk,"tasksOf");function xd(e){return ci(e)&&Array.isArray(e.documents)?e.documents:[]}s(xd,"documentsOf");function Sd(e){return ci(e)&&e.kind==="document"}s(Sd,"isDocumentRef");function sC(e){return(e?.nodes??[]).some(t=>ci(t)&&Wk(t).some(n=>xd(n).some(Sd)))}s(sC,"needsDocumentRefMove");function TJ(e,t){let n=t.address;if(!ci(n)||n.scope!=="node"||typeof n.owner!="string"||n.path!==void 0||n.key!=="document"&&n.key!=="contract"&&n.key!=="contracts")return null;let r=e.find(a=>ci(a)&&a.id===n.owner),i=ci(r)&&Array.isArray(r.artifacts)?r.artifacts:[];if(i.length!==1)return null;let o=ci(i[0])?i[0].key:void 0;return typeof o=="string"&&o.length>0?o:null}s(TJ,"slotOf");function aC(e){let t=[],n=[],r=e.nodes.map(i=>{if(!ci(i)||!Wk(i).some(a=>xd(a).some(Sd)))return i;let o=String(i.id);return{...i,tasks:Wk(i).map(a=>{if(!ci(a)||!xd(a).some(Sd))return a;let l=String(a.key),d=xd(a).map(p=>Sd(p)?TJ(e.nodes,p):void 0);if(d.includes(null))return n.push({nodeId:o,taskKey:l,reason:"noSlot"}),a;let c=new Set,u=xd(a).flatMap((p,h)=>{let y=Sd(p)?{kind:"artifact",key:d[h]}:p;if(!ci(y)||y.kind!=="artifact")return[y];let b=String(y.key);return c.has(b)?[]:(c.add(b),[y])});return t.push(`${o}.${l}`),{...a,documents:u}})}});return t.length===0?{graph:e,moved:t,refused:n}:{graph:{...e,nodes:r},moved:t,refused:n}}s(aC,"moveDocumentRefsToArtifact");function dm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(dm,"isObject");function Yk(e){return dm(e)&&dm(e.assign)&&"userId"in e.assign}s(Yk,"namesUser");function cm(e){return(e?.nodes??[]).flatMap(t=>dm(t)&&Array.isArray(t.tasks)?t.tasks.filter(Yk).map(n=>({nodeId:String(t.id),taskKey:String(n.key),hasTeam:typeof n.assign.group=="string"&&n.assign.group.length>0})):[])}s(cm,"taskUserAssignments");function lC(e){let t=cm(e);if(t.length===0)return{graph:e,dropped:t};let n=e.nodes.map(r=>{if(!dm(r)||!Array.isArray(r.tasks)||!r.tasks.some(Yk))return r;let i=r.tasks.map(o=>{if(!Yk(o))return o;let{userId:a,...l}=o.assign,{assign:d,...c}=o;return Object.keys(l).length===0?c:{...c,assign:l}});return{...r,tasks:i}});return{graph:{...e,nodes:n},dropped:t}}s(lC,"dropTaskAssignUserIds");var Sa={"assign{}":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der Knoten-Aufgabe",en:"team of the node task"},consequence:{de:"beim Betreten des Knotens entsteht die Aufgabe f\xFCr niemanden",en:"entering the node creates the task for nobody"}},"actionTeams{}":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Knoten-Aktion ausf\xFChren darf",en:"team that may perform the node action"},consequence:{de:"au\xDFer der zust\xE4ndigen Person darf niemand die Aktion ausf\xFChren",en:"nobody but the responsible person may perform the action"}},"tasks[].assign.group":{kind:"team",codec:"key",involves:!0,required:!0,what:{de:"Team der Aufgabe",en:"team of the task"},consequence:{de:"die Aufgabe kann nicht angelegt werden, und der Prozess bleibt stehen",en:"the task cannot be created and the process stops"}},"tasks[].params.revisionGroup":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der \xDCberarbeitung",en:"revision team"},consequence:{de:"eine Ablehnung findet niemanden, der \xFCberarbeitet",en:"a rejection finds nobody to revise"}},"tasks[].result.chat":{kind:"team",codec:"chatTarget",involves:!1,required:!1,what:{de:"Chat des Ergebnisses",en:"chat of the result"},consequence:{de:"das Ergebnis l\xE4sst sich nicht im Chat ablegen",en:"the result cannot be posted to the chat"}},"tasks[].result.primaryParticipantTeams":{kind:"team",codec:"key",involves:!1,required:!1,list:!0,what:{de:"Team oben in der Teilnehmer-Auswahl",en:"team listed first in the participant picker"},consequence:{de:"die Teilnehmer-Auswahl kann das Team nicht oben zeigen",en:"the participant picker cannot list the team first"}},"tasks[].result.participants.prefill.group":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Teilnehmenden vorbelegt",en:"team that prefills the participants"},consequence:{de:"der Buchungsdialog kann die Teilnehmenden nicht vorbelegen",en:"the booking dialog cannot prefill the participants"}},"optionalActions[].trigger":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Aktion ausl\xF6sen darf",en:"team that may trigger the action"},consequence:{de:"niemand au\xDFer der Prozessverantwortung kann die Aktion ausl\xF6sen",en:"nobody but the process owner can trigger the action"}}},Hk=s(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null,"record");function um(e,t){if(typeof t!="string"||t.length===0)return null;if(e==="key")return t;let n=ya(t);return n?.kind==="team"?n.groupKey:null}s(um,"decodeKey");var dC={"assign{}":"assign","actionTeams{}":"actionTeams"},RJ=s(e=>e in dC,"isMapLeaf");function $J(e){let t=/^(tasks|optionalActions)\[\]((?:\.[a-zA-Z]+)*)\.([a-zA-Z]+)$/.exec(e);return t===null&&D(`[resource] unreadable reference leaf "${e}"`),{list:t[1],field:t[2]===""?null:t[2].slice(1),key:t[3]}}s($J,"locate");function EJ(e,t){if(t===null)return e;let n=e;for(let r of t.split("."))n=n===null?null:Hk(n[r]);return n}s(EJ,"holderAt");function fm(e){let t=[],n=e;for(let[r,i]of Object.entries(dC))for(let[o,a]of Object.entries(Hk(n[i])??{})){if(r==="assign{}"){let l=am(a);if(l===null){t.push({path:`${i}.${o}`,leaf:r,owner:o,key:um("key",a),missing:typeof a!="string"||a.length===0});continue}l.forEach((d,c)=>{t.push({path:`${i}.${o}.${c}.team`,leaf:r,owner:o,index:c,key:d.team,missing:!1})});continue}t.push({path:`${i}.${o}`,leaf:r,owner:o,key:um("key",a),missing:typeof a!="string"||a.length===0})}for(let r of Object.keys(Sa)){if(RJ(r))continue;let i=Sa[r],{list:o,field:a,key:l}=$J(r);for(let d of Array.isArray(n[o])?n[o]:[]){let c=Hk(d);if(c===null||typeof c.key!="string")continue;let p=EJ(c,a)?.[l];if(p===void 0&&!i.required)continue;let h=`${o}.${c.key}${a===null?"":`.${a}`}.${l}`;if(i.list===!0){if(!Array.isArray(p)){t.push({path:h,leaf:r,owner:c.key,key:null,missing:!0});continue}let b=c.key;p.forEach((k,v)=>{t.push({path:`${h}.${v}`,leaf:r,owner:b,index:v,key:um(i.codec,k),missing:typeof k!="string"||k.length===0})});continue}let y=typeof p!="string"||p.length===0;t.push({path:`${o}.${c.key}${a===null?"":`.${a}`}.${l}`,leaf:r,owner:c.key,key:um(i.codec,p),missing:y})}}return t}s(fm,"nodeResourceReferences");var cC=s(e=>(e??[]).map(t=>`\u201E${t}\u201C`).join(", "),"list"),uC=s(e=>(e??[]).map(t=>`"${t}"`).join(", "),"listEn"),IJ={"address/shape":{de:s(e=>({problem:`${e.where}: \u201E${e.address}\u201C ist keine g\xFCltige Adresse.`,remedy:"W\xE4hle die Adresse in der Auswahl neu."}),"de"),en:s(e=>({problem:`${e.where}: "${e.address}" is not a valid address.`,remedy:"Choose the address again from the picker."}),"en")},"address/missing":{de:s(e=>({problem:`${e.where}: Hier fehlt die Adresse, ohne die dieser Schritt nicht arbeiten kann.`,remedy:"W\xE4hle sie in der Auswahl."}),"de"),en:s(e=>({problem:`${e.where}: The address this step cannot work without is missing.`,remedy:"Choose it from the picker."}),"en")},"address/bareIdentifier":{de:s(e=>({problem:`${e.where}: \u201E${e.address}\u201C nennt nur einen Schl\xFCssel, nicht, wer ihn erzeugt.`,remedy:"W\xE4hle in der Auswahl die volle Adresse, z. B. das Feld aus dem Formular, das es erfasst."}),"de"),en:s(e=>({problem:`${e.where}: "${e.address}" names a key only, not who produces it.`,remedy:"Choose the full address from the picker, e.g. the field from the form that collects it."}),"en")},"address/unknownOwner":{de:s(e=>({problem:`${e.where}: ${e.address} nennt einen Knoten oder eine Aufgabe, die es im Ablauf nicht gibt.`,remedy:"W\xE4hle eine Adresse aus der Auswahl."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} names a node or task the workflow does not have.`,remedy:"Choose an address from the picker."}),"en")},"address/unknownKey":{de:s(e=>({problem:`${e.where}: ${e.producer??"der Erzeuger"} erzeugt ${e.address} nicht.`,remedy:"W\xE4hle einen Wert, den der Erzeuger tats\xE4chlich liefert."}),"de"),en:s(e=>({problem:`${e.where}: ${e.producer??"the producer"} does not produce ${e.address}.`,remedy:"Choose a value the producer actually delivers."}),"en")},"address/envCohortBound":{de:s(e=>({problem:`${e.where}: ${e.address} \xE4ndert sich, wenn Stufe oder Schuljahr gewechselt werden \u2014 ein Dokument, das den Wert druckt, w\xFCrde das nicht bemerken.`,remedy:"Lies den Wert \xFCber ein Formularfeld, das ihn berechnet (z. B. \u201EKlassenstufe\u201C): ein Wechsel friert es neu ein und h\xE4lt ein gedrucktes Dokument an."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} changes when the application's stage or school year is changed \u2014 a document printing it would not notice.`,remedy:'Read it through a form field that computes it (e.g. "Grade"): a change re-freezes it and holds a printed document.'}),"en")},"address/staffInputConditionOnly":{de:s(e=>({problem:`${e.where}: ${e.address} ist eine interne Angabe beim Anlegen \u2014 sie lenkt eine Weiche (\u201EWenn\u201C-Knoten) oder f\xFCllt einen Parameter eines Knotens.`,remedy:"Lies sie in der Bedingung eines \u201EWenn\u201C-Knotens oder binde einen Parameter des Knotens daran (z. B. im Vertrag); Formulare, Aufgaben und Regeln lesen sie nicht."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} is a staff input set at the start \u2014 it steers a branch (an "If" node) or fills a node's parameter.`,remedy:'Read it in the condition of an "If" node or bind a node parameter to it (e.g. in the contract); forms, tasks and rules do not read it.'}),"en")},"address/ownerNotWriter":{de:s(e=>({problem:`${e.where}: Die Aufgabe \u201E${e.producer}\u201C schreibt ${e.address} nicht.`,remedy:"W\xE4hle den Wert \xFCber seinen Schl\xFCssel; die schreibende Aufgabe folgt daraus."}),"de"),en:s(e=>({problem:`${e.where}: The task "${e.producer}" does not write ${e.address}.`,remedy:"Choose the value by its key; the writing task follows from it."}),"en")},"address/taskOwnerTaken":{de:s(e=>({problem:`${e.where}: Den Aufgaben-Schl\xFCssel gibt es mehrfach (${cC(e.names)}), und eine dieser Aufgaben schreibt Prozesswerte.`,remedy:"Gib der schreibenden Aufgabe einen Schl\xFCssel, den keine andere Aufgabe tr\xE4gt."}),"de"),en:s(e=>({problem:`${e.where}: The task key is used more than once (${uC(e.names)}), and one of these tasks writes process values.`,remedy:"Give the writing task a key no other task carries."}),"en")},"address/notVisible":{de:s(e=>({problem:e.producerNode!==void 0&&e.producerNode!==e.producer?`${e.where}: ${e.address} \u2014 \u201E${e.producer}\u201C h\xE4ngt an \u201E${e.producerNode}\u201C, das nicht auf jedem Weg vor \u201E${e.reader}\u201C liegt.`:`${e.where}: ${e.address} \u2014 \u201E${e.producer}\u201C liegt nicht auf jedem Weg vor \u201E${e.reader}\u201C.`,remedy:`Lies nur, was auf jedem Weg vor \u201E${e.reader}\u201C entsteht, oder ordne die Schritte so, dass der Erzeuger immer vorher l\xE4uft.`}),"de"),en:s(e=>({problem:e.producerNode!==void 0&&e.producerNode!==e.producer?`${e.where}: ${e.address} \u2014 "${e.producer}" hangs on "${e.producerNode}", which does not lie before "${e.reader}" on every path.`:`${e.where}: ${e.address} \u2014 "${e.producer}" does not lie before "${e.reader}" on every path.`,remedy:`Read only what is produced before "${e.reader}" on every path, or order the steps so the producer always runs first.`}),"en")},"address/pathNotInTarget":{de:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"der Erzeuger"} hat dieses Feld nicht.`,remedy:"W\xE4hle ein Feld, das es dort gibt."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"the producer"} has no such field.`,remedy:"Choose a field that exists there."}),"en")},"address/notExported":{de:s(e=>({problem:`${e.where}: ${e.address} \u2014 das Feld gibt es in ${e.producer??"dem Formular"}, es ist aber nicht exportiert.`,remedy:"Setze am Feld im Formular `export: true` (ein berechnetes Feld braucht dazu `exportType`). Ist es schon exportiert, ist der Stempel des Bundles veraltet: `plexus-cli offer workflow restamp-exports` laufen lassen."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"the form"} has this field, but it is not exported.`,remedy:"Set `export: true` on the field in the form (a computed field also needs `exportType`). If it is exported already, the bundle's stamp is stale: run `plexus-cli offer workflow restamp-exports`."}),"en")},"address/typeMismatch":{de:s(e=>({problem:`${e.where}: erwartet ${e.expected}, ${e.address} ist ${e.actual}.`,remedy:`W\xE4hle einen Wert vom Typ ${e.expected}.`}),"de"),en:s(e=>({problem:`${e.where}: expects ${e.expected}, ${e.address} is ${e.actual}.`,remedy:`Choose a value of type ${e.expected}.`}),"en")},"address/notFormInstance":{de:s(e=>({problem:`${e.where}: ${e.address} ist kein ganzes Formular.`,remedy:"W\xE4hle das Formular des Knotens, der es anlegt \u2014 ohne Feld, nicht den Knoten, der es \xFCbernimmt."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} is not a whole form.`,remedy:"Choose the form of the node that creates it \u2014 without a field, not the node that continues it."}),"en")},"address/mixedForms":{de:s(e=>({problem:`${e.where}: Die Liste liest Felder aus mehreren Formularen (${cC(e.names)}), beurteilt wird sie aber an einem Formular.`,remedy:"W\xE4hle alle Felder dieser Liste aus demselben Formular."}),"de"),en:s(e=>({problem:`${e.where}: The list reads fields of several forms (${uC(e.names)}) but is judged on one.`,remedy:"Choose every field of this list from the same form."}),"en")},"workItems/keyFormat":{de:s(e=>({problem:`${e.where}: Der Aufgaben-Schl\xFCssel \u201E${e.address}\u201C hat nicht die Form ^[a-z][a-zA-Z0-9_]*$.`,remedy:"Benenne die Aufgabe in camelCase um, z. B. \u201EgeschwisterRang\u201C."}),"de"),en:s(e=>({problem:`${e.where}: The task key "${e.address}" does not match ^[a-z][a-zA-Z0-9_]*$.`,remedy:'Rename the task in camelCase, e.g. "siblingRank".'}),"en")}};function Aa(e,t,n){let{problem:r,remedy:i}=IJ[e][n](t);return`[${e}] ${r} ${i}`}s(Aa,"addressMessage");var fC={type:"enum",dataType:"option"};function Jk(e){let t={};for(let n of We)t[n]=e(n);return t}s(Jk,"localized");function pC(e,t){let n=new Set(t);return e.last.filter(r=>!n.has(r))}s(pC,"unknownLastKeys");function mC(e,t){return e.enumOptionLabels?.[t]??{de:t,en:t}}s(mC,"inlineEnumOptionLabel");var gC={string:"string",boolean:"boolean",consent:"boolean",date:"date",enum:"enum",email:"email",tel:"tel",address:"address"};function pm(e){return gC[e]!==void 0}s(pm,"isExportableFieldType");function OJ(e){return e.exportType===void 0&&D(`formExports: computed '${e.key}' is exported without an exportType \u2014 the publish validator should have refused this form.`),{key:e.key,type:e.exportType,label:e.label??{de:e.key,en:e.key}}}s(OJ,"leafForComputed");function hC(e){let t=gC[e.type];return t===void 0&&D(`formExports: field '${e.key}' has type '${e.type}', which is not exportable \u2014 the publish validator should have refused this form.`),{key:e.key,type:t,label:e.label,...e.enumOptions!==void 0?{enumOptions:e.enumOptions.map(n=>({value:n,label:mC(e,n)}))}:{}}}s(hC,"leafFor");function Qk(e){let t=[],n=s(r=>{for(let i of r.fields)i.export===!0&&t.push(hC(i));for(let i of r.groups??[])for(let o of i.fields)o.export===!0&&t.push(hC(o));for(let i of r.computed??[])i.export===!0&&t.push(OJ(i));for(let i of r.subsections??[])n(i)},"visit");for(let r of e.sections)n(r);return t}s(Qk,"exportedFormLeaves");function Dn(e){let t=[];for(let n of e){let r=n.next;if(r)for(let[i,o]of Object.entries(r))t.push({id:`${n.id}|${i}`,source:n.id,target:o.to,sourceBranchId:i})}return t}s(Dn,"derivedEdges");function Zk(e){let t=new Map;for(let n of Dn(e.nodes)){let r=t.get(n.source)??[];r.push(n.target),t.set(n.source,r)}return t}s(Zk,"successorsOf");function Ta(e,t,n){if(t===n)return!0;let r=Zk(e),i=new Set([...r.values()].flat()),o=e.nodes.filter(l=>!i.has(l.id)&&l.id!==t).map(l=>l.id),a=new Set(o);for(;o.length>0;){let l=o.shift();if(l===n)return!1;for(let d of r.get(l)??[])d===t||a.has(d)||(a.add(d),o.push(d))}return!0}s(Ta,"dominates");function yC(e,t,n){if(t===n)return!0;let r=Zk(e),i=[t],o=new Set(i);for(;i.length>0;){let a=i.shift();for(let l of r.get(a)??[]){if(l===n)return!0;o.has(l)||(o.add(l),i.push(l))}}return!1}s(yC,"reaches");function wC(e,t,n,r){let i=new Map(e.nodes.map(d=>[d.id,d])),o=Zk(e),a=[t],l=new Set(a);for(;a.length>0;){let d=a.shift();for(let c of o.get(d)??[]){if(l.has(c)||n.has(c))continue;l.add(c);let u=i.get(c);if(u!==void 0&&r(u))return c;a.push(c)}}return null}s(wC,"reachedAvoiding");function Xk(e,t){let n=[],r=s(i=>({address:i.address,type:i.type,...i.label!==void 0?{label:i.label}:{},nodeId:i.nodeId}),"toVisible");for(let i of e.nodes)if(Ta(e,i.id,t))for(let o of li(e,i))n.push(r(o));for(let i of uP)n.push({address:{scope:"env",key:i},type:Rk(i),label:$k(i),nodeId:null});for(let i of Mp(e))n.push({address:{scope:"env",key:qp(i.key)},type:i.type,label:i.label,nodeId:null});return n}s(Xk,"visibleAddressesAt");function ui(e,t){let n=e?.readinessFormFieldsByFormNode?.get(t.owner);if(n!==void 0)return n.get(t.path)??null}s(ui,"formFieldEntryOf");var kC={binding:{de:"Eingang",en:"Input"},condition:{de:"Bedingung",en:"Condition"},nodeReads:{de:"Gelesene Felder",en:"Fields read"},requires:{de:"Geforderte Felder",en:"Required fields"},adoptForm:{de:"\xDCbernommenes Formular",en:"Continued form"},setFlagTarget:{de:"Freizuschaltendes Formular",en:"Form to unlock"},form:{de:"Formular",en:"Form"},contract:{de:"Vertrag",en:"Contract"},payment:{de:"Zahlung",en:"Payment"},taskWhen:{de:"Bedingung",en:"Condition"},optionalActionWhen:{de:"Bedingung der optionalen Aktion",en:"Condition of the optional action"},taskReads:{de:"Gelesene Felder der Aufgabe",en:"Fields the task reads"},taskDocument:{de:"Dokumente",en:"Documents"},familyRequestFields:{de:"Nachforderbare Felder",en:"Requestable fields"},familyRequestFrom:{de:"Nachforderung aus",en:"Request from"},suggest:{de:"Vorschlag",en:"Suggestion"},taskInput:{de:"Vorgaben",en:"Inputs"},teamWhen:{de:"Bedingung des Teams",en:"Condition of the team"}},_J=new Set(["nodeReads","requires","taskReads","taskDocument","familyRequestFields"]);function NJ(e,t,n){let r=[];t.taskKey!==void 0&&r.push(`${n==="de"?"Aufgabe":"task"} \u201E${is(e,t.taskKey,n)}\u201C`);let i=t.kind==="binding"?` \u201E${t.at.split(".").pop()}\u201C`:"";return r.push(`${kC[t.kind][n]}${i}`),r.join(" \u203A ")}s(NJ,"addressFieldWhere");function Ad(e,t,n){let r=NJ(e,t,n);return`\u201E${Pe(e,t.nodeId,n)}\u201C \u203A ${r}`}s(Ad,"whereOf");function bC(e,t,n){if(t.scope==="node")return Pe(e,t.owner,n);if(t.scope==="task")return is(e,t.owner,n)}s(bC,"producerName");function vC(e,t){let n=[],r=new Set,i=s((l,d,c)=>{let u={de:Aa(l,c("de"),"de"),en:Aa(l,c("en"),"en")},p=`${d}|${u.de}`;r.has(p)||(r.add(p),n.push({layer:"GRAPH",kind:"nodeRule",path:d,reason:u,severity:"error"}))},"report"),o=new Map(e.nodes.map(l=>[l.id,l])),a=[...e.nodes.flatMap(l=>hd(l))];for(let l of a){let d=s(c=>Ad(e,l,c),"where");for(let c of PJ(e,l,i))DJ(e,l,c,i)&&(LJ(e,l,c,t,i),Ok.has(l.kind)&&!KJ(o,c)&&i("address/notFormInstance",l.at,u=>({where:d(u),address:Ge(e,c,u)})))}return jJ(e,i),VJ(e,a,i),zJ(e,i),YJ(e,i),n}s(vC,"checkAddresses");function PJ(e,t,n){let r=s(i=>Ad(e,t,i),"where");if(_k(t)){let i=Nk(t.value)??[];for(let o of i)o.address===null&&n(o.reason==="bareIdentifier"?"address/bareIdentifier":"address/shape",t.at,a=>({where:r(a),address:o.identifier}));return ka(t)}return typeof t.value=="string"?(n("address/bareIdentifier",t.at,i=>({where:r(i),address:t.value})),[]):ke(t.value)?[t.value]:(n("address/shape",t.at,i=>({where:r(i),address:JSON.stringify(t.value)??"undefined"})),[])}s(PJ,"checkFieldShape");function xC(e,t,n,r){let i=bC(e,n,r);return{where:Ad(e,t,r),address:Ge(e,n,r),...i!==void 0?{producer:i}:{}}}s(xC,"addressParams");function CJ(e,t,n){return Tk(t)||n==="optionalActionWhen"&&(ua(e,t)!==void 0||ur(t))?null:ua(e,t)!==void 0?n==="condition"||n==="binding"?null:"address/staffInputConditionOnly":ur(t)?"address/envCohortBound":"address/unknownKey"}s(CJ,"envAddressRefusal");function DJ(e,t,n,r){let i=s(o=>xC(e,t,n,o),"params");switch(n.scope){case"env":{let o=CJ(e,n.key,t.kind);return o===null?!0:(r(o,t.at,i),!1)}case"task":return e.nodes.some(a=>(a.tasks??[]).some(l=>l.key===n.owner))?(e.processStore??[]).some(a=>a.key===n.key)?Ci(e,n.owner,n.key)===null?(r("address/ownerNotWriter",t.at,i),!1):!0:(r("address/unknownKey",t.at,i),!1):(r("address/unknownOwner",t.at,i),!1);case"node":{let o=e.nodes.find(a=>a.id===n.owner);return o===void 0?(r("address/unknownOwner",t.at,i),!1):li(e,o).some(a=>a.address.scope==="node"&&a.address.key===n.key)?!0:(r(Ok.has(t.kind)&&Cn(o)?"address/notFormInstance":"address/unknownKey",t.at,i),!1)}}}s(DJ,"resolves");function FJ(e,t){return e===void 0||t===void 0||gn(t)===void 0?!0:gn(e)!==void 0&&tm(e,t)}s(FJ,"addressTypeFits");function LJ(e,t,n,r,i){let o=s(l=>xC(e,t,n,l),"params");if(n.scope!=="env"&&n.path!==void 0&&!qJ(e,t,n,r)){i(MJ(n,r)?"address/notExported":"address/pathNotInTarget",t.at,o);return}if(t.expectedType===void 0)return;let a=gd(e,n);FJ(a,t.expectedType)||i("address/typeMismatch",t.at,l=>({...o(l),expected:t.expectedType,actual:a}))}s(LJ,"checkPathAndType");function MJ(e,t){if(e.scope!=="node"||e.key!==Yt||e.path===void 0)return!1;let n=ui(t,{scope:"node",owner:e.owner,key:Yt,path:e.path});return n==null?!1:n.kind==="computed"||!n.repeated&&pm(n.type)}s(MJ,"formFieldUnexported");function qJ(e,t,n,r){if(n.scope!=="node")return!1;if(gd(e,n)!==void 0)return!0;if(n.key!==Yt)return!1;if(!_J.has(t.kind))return e.nodes.find(o=>o.id===n.owner)?.formExports===void 0;let i=r?.readinessFormFieldsByFormNode?.get(n.owner);return i===void 0||i.has(n.path)}s(qJ,"pathExists");function KJ(e,t){if(!pr(t))return!1;let n=e.get(t.owner);return n!==void 0&&n.type==="form"&&!Cn(n)}s(KJ,"isCreatingFormInstance");function jJ(e,t){for(let n of e.nodes){let r=new Set(hd(n).map(i=>i.kind));for(let i of hP(n))r.has(i)||t("address/missing",`nodes.${n.id}.${i}`,o=>({where:`\u201E${Pe(e,n.id,o)}\u201C \u203A ${kC[i][o]}`}))}}s(jJ,"checkRequiredFields");function VJ(e,t,n){let r=new Map;for(let i of t)if(i.judgedTogether!==null)for(let o of ka(i)){if(o.scope!=="node"||o.key!==Yt)continue;let a=r.get(i.judgedTogether)??[];a.push({field:i,owner:o.owner}),r.set(i.judgedTogether,a)}for(let[i,o]of r){let a=[...new Set(o.map(l=>l.owner))];a.length<2||n("address/mixedForms",i,l=>({where:Ad(e,o[0].field,l),names:a.map(d=>Pe(e,d,l))}))}}s(VJ,"checkMixedForms");function BJ(e,t){return e.type==="engagePush"&&t.kind==="payment"}s(BJ,"readSkipsAbsentProducer");function UJ(e,t,n){return t!==n&&yC(e,t,n)}s(UJ,"precedesOnSomePath");function GJ(e,t,n,r){let i=Ek(n.address);return r.has(ce(i))||!WJ(e,i)?!0:n.origin==="written"&&i.scope==="node"&&BJ(t,n.field)&&UJ(e,i.owner,t.id)}s(GJ,"readPassesVisibility");function zJ(e,t){for(let n of e.nodes){let r=rs(e,n);if(r.length===0)continue;let i=new Set(Xk(e,n.id).map(o=>ce(o.address)));for(let o of r){let a=Ek(o.address);if(GJ(e,n,o,i))continue;let l=a.scope==="task"?Ci(e,a.owner,a.key):a.scope==="node"?a.owner:null;t("address/notVisible",o.field.at,d=>({where:Ad(e,o.field,d),address:Ge(e,o.address,d),producer:bC(e,a,d)??Ge(e,a,d),...l!==null?{producerNode:Pe(e,l,d)}:{},reader:Pe(e,n.id,d)}))}}}s(zJ,"checkVisibility");function WJ(e,t){if(t.scope==="env")return Tk(t.key);let n=ce(t);return e.nodes.some(r=>li(e,r).some(i=>ce(i.address)===n))}s(WJ,"producedSomewhere");function YJ(e,t){let n=new Map;for(let r of e.nodes){let i=new Set(li(e,r).flatMap(o=>o.address.scope==="task"?[o.address.owner]:[]));for(let[o,a]of(r.tasks??[]).entries()){let l=a.key;if(typeof l!="string"||!mo.test(l)){t("workItems/keyFormat",`nodes.${r.id}.tasks.${o}.key`,c=>({where:`\u201E${Pe(e,r.id,c)}\u201C`,address:String(l)}));continue}let d=n.get(l)??[];d.push({nodeId:r.id,writes:i.has(l)}),n.set(l,d)}}for(let[r,i]of n)if(!(i.length<2||!i.some(o=>o.writes)))for(let o of i)t("address/taskOwnerTaken",`nodes.${o.nodeId}.tasks.${r}`,a=>({where:`\u201E${Pe(e,o.nodeId,a)}\u201C \u203A ${a==="de"?"Aufgabe":"task"} \u201E${is(e,r,a)}\u201C`,names:i.map(l=>Pe(e,l.nodeId,a))}))}s(YJ,"checkTaskKeys");function mm(e,t){return e.label[t]??""}s(mm,"wordingIn");function ko(e,t){let n=SC(e,t),r=mm(e.qualifier,t);return n===""||r===""&&mm(e.qualifier,"de")!==""?"":r===""?n:`${r} \xB7 ${n}`}s(ko,"fieldLabelIn");function SC(e,t){return mm(e,t)}s(SC,"fieldOwnLabelIn");function Ra(e){return{key:e.key,kind:e.kind,type:e.kind==="entered"?e.type:null,repeated:e.kind==="entered"&&e.repeated,reviewRequired:e.kind==="entered"&&e.reviewRequired,name:{de:ko(e,"de"),en:ko(e,"en")}}}s(Ra,"catalogField");function $a(e,t){switch(e){case"nodeReads":return t.repeated?"repeated":null;case"requires":return t.repeated?"repeated":t.kind==="computed"?"computed":t.name.en===""?"untranslated":null;case"taskDocument":return t.repeated?"repeated":t.kind==="entered"&&t.type==="docRef"?null:"notDocument";case"taskReads":case"familyRequestFields":return null}}s($a,"catalogFieldRefusal");function hm(e,t){let n=e.buses.find(r=>r.key===t);return n||D(`[progress] layout '${e.id}' has no bus '${t}'`),n}s(hm,"progressBus");function Td(e,t){return e.states.some(n=>n.id===t)}s(Td,"isBusState");function AC(e,t){let n=e.terminalSemantics?.[t];return n||D(`[progress] no terminal semantics for state '${t}' on bus '${e.key}'`),n}s(AC,"terminalSemantics");function gm(e,t){return!!e.terminalSemantics&&Object.prototype.hasOwnProperty.call(e.terminalSemantics,t)}s(gm,"hasTerminalSemantics");function TC(e){return e.waitlist===!0}s(TC,"columnIsWaitlist");function HJ(e,t){return(e.boards??[]).find(n=>n.audience===t||n.audience==="both")??null}s(HJ,"boardForAudience");function eb(e){return HJ(hm(e,"process"),"internal")}s(eb,"internalProcessBoard");function as(e,t,n){let r=null;for(let i of e.mappings)if(i.event===n)if("nodeId"in i.match){if(i.match.nodeId===t.id)return{bus:i.bus,state:i.state}}else i.match.nodeType===t.type&&(r=i);return r?{bus:r.bus,state:r.state}:null}s(as,"resolveProgressEvent");var Ea={approved:"enrolled",rejected:"declined",withdrawn:"declined",expired:"declined"},Li=Object.keys(Ea);function bo(e){return Object.hasOwn(Ea,e)}s(bo,"isEndNodeOutcome");var tb={approved:{de:"Angenommen",en:"Admitted"},rejected:{de:"Abgelehnt",en:"Rejected"},withdrawn:{de:"Zur\xFCckgezogen",en:"Withdrawn"},expired:{de:"Abgelaufen",en:"Expired"}};var vo=["commit","discard"],_ye=m.union(...vo.map(e=>m.literal(e)));function ym(e){return typeof e=="string"&&vo.includes(e)}s(ym,"isApplicationDataDecision");function Ht(e){return Object.keys(e)}s(Ht,"progressEventsOf");var ie=s((e,t)=>({de:e,en:t}),"lt"),at=s((e,t,n,r,i=null,o=null)=>({chipLabel:e,tone:t,nextAction:i,affordance:o,title:n,body:r}),"ex"),RC={key:"eingeschrieben",label:ie("Eingeschrieben","Enrolled"),scope:"global",defaultCollapsed:!0},wm={key:"abgesagt",label:ie("Abgesagt","Declined"),scope:"global",track:"exit",defaultCollapsed:!0},$C={key:"abgelehnt",label:ie("Abgelehnt","Rejected"),scope:"global",track:"exit",defaultCollapsed:!0};var EC={enrolled:{label:ie("Eingeschrieben","Enrolled"),tone:"green",terminal:{lifecycleStatus:"completed",outcome:"approved"},phase:RC,external:at(ie("Eingeschrieben","Enrolled"),"green",ie("Sie sind eingeschrieben!","You are enrolled!"),ie("Ihre Anmeldung ist abgeschlossen und Ihr Platz ist gesichert. Wir freuen uns auf Sie.","Your enrolment is complete and your place is secured. We look forward to welcoming you."))},declined:{label:ie("Abgesagt","Declined"),tone:"red",terminal:{lifecycleStatus:"completed",outcome:"rejected"},phase:wm,external:at(ie("Abgesagt","Declined"),"red",ie("Die Bewerbung wurde beendet","The application has ended"),ie("Ihre Bewerbung wurde nicht fortgef\xFChrt.","Your application was not continued."))}},IC={role:"effect",effect:"pure",progressDefaults:EC,progressEvents:Ht(EC),inputs:s(()=>[{id:"applicationOutcome",label:{de:"Ergebnis",en:"Outcome"},type:"enum",required:!0,inspector:"literal-only",optionSource:"declared",enumOptions:Li.map(e=>({value:e,label:tb[e]}))},{id:"dataDecision",label:{de:"Erfasste Daten",en:"Captured data"},type:"enum",required:!0,inspector:"literal-only",optionSource:"declared",enumOptions:[{value:"commit",label:{de:"\xDCbernehmen",en:"Keep"}},{value:"discard",label:{de:"Verwerfen",en:"Discard"}}]}],"inputs"),notificationEvents:s(()=>[{id:"reached",label:{de:"Verfahren abgeschlossen",en:"Process completed"},audience:"external",args:[{key:"applicationId",type:"string",required:!0},{key:"outcome",type:"string",required:!0}]}],"notificationEvents"),validate:s(e=>[...JJ(e),...QJ(e),...ZJ(e)],"validate")},Ia=s((e,t,n,r)=>({layer:"GRAPH",kind:"nodeRule",path:`node.${e.id}.inputs.${t}`,reason:{de:n,en:r},severity:"error"}),"nodeIssue");function ls(e){let t=e.inputs?.applicationOutcome;return t?.kind==="literal"&&t.value!=null?String(t.value):null}s(ls,"literalOutcome");function JJ(e){if(e.type!=="end")return[];let t=e.inputs?.applicationOutcome;if(t===void 0||t.kind==="unset")return[];let n=ls(e);return n===null?[Ia(e,"applicationOutcome",`[end/applicationOutcome] ${e.label.de}: das Ergebnis ist kein fester Wert \u2014 die Engine kann den Abschluss nicht ableiten`,`[end/applicationOutcome] ${e.label.en}: the application outcome is no fixed value \u2014 the engine cannot derive the terminal`)]:bo(n)?[]:[Ia(e,"applicationOutcome",`[end/applicationOutcome] ${e.label.de}: '${n}' ist kein Ausgang eines Endknotens (${Li.join("|")}) \u2014 die Warteliste endet \xFCber das closed-Outcome ihres Wartelistenknotens`,`[end/applicationOutcome] ${e.label.en}: '${n}' is not an outcome of an end node (${Li.join("|")}) \u2014 the waitlist ends through the closed outcome of its waitlist node`)]}s(JJ,"checkEndApplicationOutcome");function QJ(e){if(e.type!=="end")return[];let t=e.inputs?.dataDecision;return!t||t.kind!=="literal"||t.value==null?[Ia(e,"dataDecision",`[end/dataDecision] ${e.label.de}: dataDecision fehlt \u2014 der Endknoten muss festlegen, ob die erfassten Daten \xFCbernommen (commit) oder verworfen (discard) werden`,`[end/dataDecision] ${e.label.en}: dataDecision is missing \u2014 the end node must decide whether the collected data is kept (commit) or discarded (discard)`)]:ym(t.value)?[]:[Ia(e,"dataDecision",`[end/dataDecision] ${e.label.de}: dataDecision '${String(t.value)}' ist ung\xFCltig (${vo.join("|")})`,`[end/dataDecision] ${e.label.en}: dataDecision '${String(t.value)}' is invalid (${vo.join("|")})`)]}s(QJ,"checkEndDataDecision");function ZJ(e){if(e.type!=="end")return[];let t=ls(e);if(t===null||!bo(t)||t==="approved")return[];let n=e.inputs?.dataDecision;if(n?.kind!=="literal"||n.value!=="commit")return[];let r=tb[t];return[{...Ia(e,"dataDecision",`[end/commitWithoutApproval] ${e.label.de}: Ende ohne Zusage \xFCbernimmt die erfassten Daten (commit) \u2014 Personen und Beziehungen bleiben nach dem Ergebnis \u201E${r.de}" bestehen. Gewollt? Sonst discard.`,`[end/commitWithoutApproval] ${e.label.en}: end without admission keeps the captured data (commit) \u2014 persons and relationships remain after the outcome "${r.en}". Intended? Otherwise discard.`),severity:"warning"}]}s(ZJ,"checkEndCommitWithoutApproval");function OC(e,t){if(!t?.layout||!t.wiring)return[];let n=[];for(let r of e.nodes){if(r.type!=="end")continue;let i=ls(r);if(i===null||!bo(i))continue;let o=Ea[i],a=as(t.wiring,r,o);if(a===null)continue;let l=t.layout.buses.find(c=>c.key===a.bus);if(l===void 0||!gm(l,a.state))continue;let d=AC(l,a.state).outcome;d!==i&&n.push(Ia(r,"applicationOutcome",`[end/outcomeMismatch] ${r.label.de}: das Ergebnis \u201E${i}" passt nicht zum Endzustand \u201E${a.state}" (Bus ${a.bus}), der \u201E${String(d)}" besiegelt \u2014 Ergebnis oder Verdrahtung angleichen.`,`[end/outcomeMismatch] ${r.label.en}: the outcome "${i}" does not match the final state "${a.state}" (bus ${a.bus}), which seals "${String(d)}" \u2014 align the outcome or the wiring.`))}return n}s(OC,"checkEndOutcomeMatchesTerminal");function Oa(e){let t=Ue(e);return typeof t.inputs=="function"?t.inputs(e):[]}s(Oa,"inputSlots");function XJ(e,t){return Oa(e).find(n=>n.id===t)}s(XJ,"findInputSlot");function e6(e,t){let n=XJ(e,t);if(!n)return{source:"missing",spec:{id:t,label:{de:t,en:t},type:"string"},unknownSlot:!0};let r=e.inputs?.[t]??{kind:"unset"};return r.kind==="binding"&&ke(r.address)?{source:"binding",spec:n,address:r.address}:r.kind==="literal"?{source:"literal",spec:n,value:r.value}:r.kind==="cockpit"&&n.deferrable===!0?{source:"cockpit",spec:n}:n.defaultValue!==void 0?{source:"default",spec:n,value:n.defaultValue}:n.required?{source:"missing",spec:n}:{source:"optional",spec:n}}s(e6,"resolveInput");function _C(e){return Oa(e).filter(t=>e6(e,t.id).source==="missing")}s(_C,"missingRequiredInputs");var t6=["personRef","formRef","documentRef","docRef"];function n6(e){let t=Ue(e);return typeof t.inputs!="function"?[]:t.inputs(e).map(n=>({id:n.id,type:n.type}))}s(n6,"listInputs");function NC(e){let t=[];for(let n of e.nodes)for(let r of n6(n))!t6.includes(r.type)||n.inputs?.[r.id]?.kind!=="literal"||t.push({layer:"GRAPH",kind:"modelError",path:`node.${n.id}.param.${r.id}`,reason:{de:`${n.label.de}: Literal f\xFCr referenztypisierten Slot "${r.id}" ist verboten \u2014 der Slot wird an eine Adresse gebunden`,en:`${n.label.en}: A literal for the reference-typed slot "${r.id}" is not allowed \u2014 the slot is bound to an address`},severity:"error"});return t}s(NC,"findParamValueRefSlotErrors");function PC(e){let t=[];for(let n of e.nodes){let r=Ue(n);if(typeof r.inputs=="function")for(let i of r.inputs(n)){let o=n.inputs?.[i.id];if(o?.kind==="cockpit"&&i.deferrable!==!0){t.push({layer:"GRAPH",kind:"modelError",path:`nodes.${n.id}.inputs.${i.id}`,reason:{de:`[inputs/notDeferrable] ${n.label.de}: Parameter \u201E${i.label.de}\u201C l\xE4sst sich nicht im Cockpit erg\xE4nzen \u2014 nur Parameter eines Generators oder einer Vorlage.`,en:`[inputs/notDeferrable] ${n.label.en}: Parameter "${i.label.en}" cannot be completed in the cockpit \u2014 only parameters of a generator or a template can.`},severity:"error"});continue}(i.inspector==="literal-only"&&o?.kind==="binding"||i.inspector==="binding-only"&&o?.kind==="literal")&&t.push({layer:"GRAPH",kind:"modelError",path:`nodes.${n.id}.inputs.${i.id}`,reason:i.inspector==="literal-only"?{de:`[inputs/inspectorKind] ${n.label.de}: Parameter \u201E${i.label.de}\u201C ist ein fester Wert \u2014 eine Bindung an eine Adresse ist hier nicht m\xF6glich.`,en:`[inputs/inspectorKind] ${n.label.en}: Parameter "${i.label.en}" is a fixed value \u2014 it cannot be bound to an address.`}:{de:`[inputs/inspectorKind] ${n.label.de}: Parameter \u201E${i.label.de}\u201C wird an eine Adresse gebunden \u2014 ein fester Wert ist hier nicht m\xF6glich.`,en:`[inputs/inspectorKind] ${n.label.en}: Parameter "${i.label.en}" is bound to an address \u2014 a fixed value is not possible here.`},severity:"error"})}}return t}s(PC,"findInspectorKindErrors");function CC(e){let t=[];for(let n of e.nodes)for(let r of _C(n))t.push({layer:"GRAPH",kind:"contractGap",path:`node.${n.id}.input.${r.id}`,reason:{de:`${n.label.de}: Pflicht-Slot "${r.label.de}" nicht gesetzt`,en:`${n.label.en}: Required slot "${r.label.en}" is not set`},severity:"error"});return t}s(CC,"findMissingRequiredInputs");function km(e){let t=e.processStore;return t===void 0?[]:(Array.isArray(t)||D("graph.processStore must be an array \u2014 the graph validator refuses anything else"),t)}s(km,"processStoreKeys");function DC(e){let t=[];for(let n of e.tasks??[]){let r=n.result;if(!(r===void 0||!ga(r)))for(let i of Yp(r))t.push({key:i.key,nodeId:e.id,taskKey:n.key,template:n,result:r,valueType:i.valueType,...i.field!==void 0?{fieldKey:i.field.key}:{}})}return t}s(DC,"storeWritersOn");function FC(e){let t=new Map;for(let n of e.nodes)for(let r of DC(n)){let i=t.get(r.key)??[];i.push(r),t.set(r.key,i)}return t}s(FC,"processStoreWriters");function r6(e,t,n){for(let r of e.nodes){let i=DC(r).find(o=>o.taskKey===t&&o.key===n);if(i!==void 0)return i}return null}s(r6,"writerAt");function i6(e,t,n){(t.scope!=="task"||t.path!==void 0)&&D(`[process] ${n}: ${ce(t)} is no task value`);let r=r6(e,t.owner,t.key);return r===null&&D(`[address/ownerNotWriter] ${n}: task "${t.owner}" writes no "${t.key}" \u2014 publish refuses that`),{key:t.key,nodeId:r.nodeId,taskKey:r.taskKey,...r.fieldKey!==void 0?{fieldKey:r.fieldKey}:{}}}s(i6,"sourceOfAddress");function LC(e,t){(t.scope!=="task"||t.path!==void 0)&&D(`[process] ${ce(t)} is no store address`);let n=km(e).find(r=>r.key===t.key);return n===void 0&&D(`[address/unknownKey] ${ce(t)}: "${t.key}" is not declared in processStore`),{key:n.key,type:n.type,label:n.label,audience:n.audience,source:i6(e,t,ce(t))}}s(LC,"processLeafOf");var nb=new Set(["enum","pricedItem","number","boolean","reduction","string","staffUser","staffUserList","taskAssignment"]),An={invalidKey:"[process/invalidKey]",unknownKey:"[process/unknownKey]",secondWriter:"[process/secondWriter]",noWriter:"[process/noWriter]",writerTypeMismatch:"[process/writerTypeMismatch]",pricedItemWritesNothing:"[process/pricedItemWritesNothing]",internalInDocument:"[process/internalInDocument]",writerMustBlock:"[process/writerMustBlock]",absentWithoutDefault:"[process/absentWithoutDefault]",defaultItemMismatch:"[process/defaultItemMismatch]"};function Tn(e,t,n,r){return{layer:"GRAPH",kind:"contractGap",path:e,reason:{de:`${t} ${n}`,en:`${t} ${r}`},severity:"error"}}s(Tn,"err");function qC(e){let t=[],n=km(e),r=new Map(n.map(l=>[l.key,l])),i=new Set;for(let[l,d]of n.entries()){let c=`processStore[${l}]`;if(typeof d.key!="string"||!/^[a-z][a-zA-Z0-9_]*$/.test(d.key)){t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel ${JSON.stringify(d.key)} \u2014 erlaubt sind Buchstaben, Ziffern und _, beginnend mit einem Kleinbuchstaben.`,`Process key ${JSON.stringify(d.key)} \u2014 letters, digits and _ are allowed, starting with a lowercase letter.`));continue}i.has(d.key)&&t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" ist doppelt deklariert.`,`Process key "${d.key}" is declared twice.`)),i.add(d.key),nb.has(d.type)||t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" hat den Typ "${d.type}" \u2014 der Vorgang speichert nur Ergebnisse mit Wert: ${[...nb].join(", ")}.`,`Process key "${d.key}" has the type "${d.type}" \u2014 the process only stores results with a value: ${[...nb].join(", ")}.`)),(!d.label?.de?.trim()||!d.label?.en?.trim())&&t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" braucht ein Label in beiden Sprachen.`,`Process key "${d.key}" needs a label in both languages.`)),d.audience!=="internal"&&d.audience!=="printable"&&t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}": audience muss 'internal' oder 'printable' sein.`,`Process key "${d.key}": audience must be 'internal' or 'printable'.`))}let o=FC(e);for(let l of e.nodes)for(let d of l.tasks??[]){let c=d.result;c?.kind==="pricedItem"&&c.writes===void 0&&t.push(Tn(`node.${l.id}.tasks.${d.key}.result.writes`,An.pricedItemWritesNothing,`Aufgabe "${d.key}" (Knoten "${l.id}") bepreist einen Artikel, schreibt das Ergebnis aber in keinen Vorgangs-Schl\xFCssel ('result.writes') \u2014 niemand k\xF6nnte den Preis lesen.`,`Task "${d.key}" (node "${l.id}") prices an article but writes the result to no process key ('result.writes') \u2014 nobody could read the price.`))}for(let[l,d]of o){let c=r.get(l);for(let u of d){let p=u.fieldKey===void 0?`node.${u.nodeId}.tasks.${u.taskKey}.result.writes`:`node.${u.nodeId}.tasks.${u.taskKey}.result.fields.${u.fieldKey}.writes`;if(c===void 0){t.push(Tn(p,An.unknownKey,`${u.fieldKey===void 0?"":`Feld "${u.fieldKey}" der `}Aufgabe "${u.taskKey}" schreibt "${l}", aber der Workflow deklariert keinen solchen Vorgangs-Schl\xFCssel (graph.processStore).`,`${u.fieldKey===void 0?"Task":`Field "${u.fieldKey}" of task`} "${u.taskKey}" writes "${l}", but the workflow declares no such process key (graph.processStore).`));continue}if(u.valueType!==c.type){let h=u.fieldKey===void 0?`Aufgabe "${u.taskKey}"`:`Feld "${u.fieldKey}" der Aufgabe "${u.taskKey}"`,y=u.fieldKey===void 0?`Task "${u.taskKey}"`:`Field "${u.fieldKey}" of task "${u.taskKey}"`;t.push(Tn(p,An.writerTypeMismatch,`${h} liefert ${u.valueType}, der Vorgangs-Schl\xFCssel "${l}" ist aber als ${c.type} deklariert.`,`${y} delivers ${u.valueType}, but the process key "${l}" is declared as ${c.type}.`))}}if(d.length>1){let u=d.map(p=>`${p.nodeId}/${p.taskKey}${p.fieldKey===void 0?"":`.${p.fieldKey}`}`).join(", ");t.push(Tn(`processStore.${l}`,An.secondWriter,`Vorgangs-Schl\xFCssel "${l}" wird ${d.length}-mal geschrieben (${u}) \u2014 genau ein Schreiber je Schl\xFCssel.`,`Process key "${l}" is written ${d.length} times (${u}) \u2014 exactly one writer per key.`))}}for(let l of n)o.has(l.key)||t.push(Tn(`processStore.${l.key}`,An.noWriter,`Vorgangs-Schl\xFCssel "${l.key}" ist deklariert, aber keine Aufgabe schreibt ihn ('result.writes').`,`Process key "${l.key}" is declared, but no task writes it ('result.writes').`));let a=new Map;for(let l of e.nodes){let d=Ue(l),c=typeof d.inputs=="function"?d.inputs(l):[];for(let u of c){let p=l.inputs?.[u.id];if(p?.kind!=="binding")continue;let h=o6(e,p.address);if(h===null)continue;let y=`node.${l.id}.input.${u.id}`,b=ce(p.address),k=a.get(h.source.key)??new Set;k.add(l.id),a.set(h.source.key,k),h.audience==="internal"&&t.push(Tn(y,An.internalInDocument,`${l.label.de}: "${u.id}" liest den internen Vorgangs-Schl\xFCssel "${h.key}" \u2014 ein Dokument dieses Knotens geht an die Familie; nur 'printable'-Schl\xFCssel d\xFCrfen hinein.`,`${l.label.en}: "${u.id}" reads the internal process key "${h.key}" \u2014 a document of this node goes to the family; only 'printable' keys may go in.`));let v=s6(o,h.source.key,h.source.taskKey);if(v.template.when!==void 0&&u.required===!0&&u.defaultValue===void 0&&t.push(Tn(y,An.absentWithoutDefault,`${l.label.de}: "${u.id}" ist Pflicht und an ${b} gebunden, aber die schreibende Aufgabe entsteht nur unter einer Bedingung (when: ${MC(v.template.when)}) \u2014 ohne Vorgabewert bliebe das Feld dann f\xFCr immer leer.`,`${l.label.en}: "${u.id}" is required and bound to ${b}, but the writing task only exists under a condition (when: ${MC(v.template.when)}) \u2014 without a default value the field would stay empty forever.`)),v.result.kind==="pricedItem"&&u.defaultValue!==void 0){let T=u.defaultValue;(!wo(T)||T.itemKey!==v.result.item||T.grantKeys.length>0)&&t.push(Tn(y,An.defaultItemMismatch,`${l.label.de}: der Vorgabewert von "${u.id}" muss der Artikel der schreibenden Aufgabe ohne Erm\xE4\xDFigung sein ({ itemKey: '${v.result.item??"?"}', grantKeys: [] }) \u2014 sonst rechnete die Familie ohne Antrag einen anderen Artikel als mit.`,`${l.label.en}: the default value of "${u.id}" must be the article of the writing task without a reduction ({ itemKey: '${v.result.item??"?"}', grantKeys: [] }) \u2014 otherwise the family would be charged a different article without an application than with one.`))}}}for(let[l,d]of a){let c=o.get(l)[0],u=c.template.blocks,p=u===void 0?void 0:u.node??c.nodeId,h=p!==void 0&&(()=>{let b=e.nodes.find(k=>k.id===p);return b!==void 0&&Ue(b).processHoldTemplate?.(b)===u.templateKey})(),y=`node.${c.nodeId}.tasks.${c.taskKey}.blocks`;if(!h){let b=[...d][0],k=e.nodes.find(T=>T.id===b),v=Ue(k).processHoldTemplate?.(k)??"?";t.push(Tn(y,An.writerMustBlock,`Die Aufgabe "${c.taskKey}" schreibt "${l}", h\xE4lt aber keinen der lesenden Knoten (${[...d].join(", ")}) zur\xFCck \u2014 sie muss den ersten blockieren, z. B. blocks: { ${b===c.nodeId?"":`node: '${b}', `}templateKey: '${v}' }, sonst arbeitet er, bevor der Wert existiert.`,`The task "${c.taskKey}" writes "${l}" but holds back none of the reading nodes (${[...d].join(", ")}) \u2014 it must block the first one, e.g. blocks: { ${b===c.nodeId?"":`node: '${b}', `}templateKey: '${v}' }, otherwise it works before the value exists.`));continue}for(let b of d)b===p||Ta(e,p,b)||t.push(Tn(y,An.writerMustBlock,`"${b}" liest "${l}", liegt aber nicht hinter dem zur\xFCckgehaltenen Knoten "${p}" \u2014 auf einem Weg an ihm vorbei l\xE4se er den Wert, bevor er feststeht.`,`"${b}" reads "${l}" but does not lie behind the held-back node "${p}" \u2014 on a path past it, it would read the value before it is settled.`))}return t}s(qC,"processBindingIssues");function o6(e,t){return!ke(t)||t.scope!=="task"||t.path!==void 0||!km(e).some(n=>n.key===t.key)||Ci(e,t.owner,t.key)===null?null:LC(e,t)}s(o6,"draftLeafOf");function s6(e,t,n){let r=e.get(t)?.find(i=>i.taskKey===n);return r===void 0&&D(`[process] the leaf of "${t}" names task "${n}", which does not write it`),r}s(s6,"writerOf");function MC(e){return ke(e)?ce(e):JSON.stringify(e)}s(MC,"shown");var KC=ho,xo=`${KC}.`,a6=new Set(["text","number","date","boolean","option","edge"]);function rb(e,t){let n=e[t];return n===void 0&&D(`[env/unknownKey] no environment key '${t}'`),typeof n=="string"?null:Object.keys(n)}s(rb,"contextFields");function jC(e,t){return Object.hasOwn(e,t)}s(jC,"isContextKey");function VC(e){let t=[];for(let n of Object.keys(e)){let r=rb(e,n);if(r===null)t.push(n);else for(let i of r)t.push(`${n}.${i}`)}return t}s(VC,"leafPaths");function Rd(e,t){let[n="",r,...i]=t.split(".");if(!jC(e,n)||i.length>0)return;let o=e[n];if(typeof o=="string")return r===void 0?o:void 0;if(!(r===void 0||!Object.hasOwn(o,r)))return o[r]}s(Rd,"leafType");function BC(e){let t=new Set;for(let n of e){let r=_a(n);r!==null&&t.add(r.split(".")[0])}return[...t]}s(BC,"contextKeysOf");function _a(e){return e.startsWith(xo)?e.slice(xo.length):null}s(_a,"contextPathOf");function $d(e){return e===KC||e.startsWith(xo)}s($d,"isContextIdentifier");function bm(e,t){let n=_a(t)??"",[r=""]=n.split("."),i=Object.keys(e);if(!jC(e,r))return{code:"env/unknownKey",message:{de:`'${t}' nennt keinen Umgebungsschl\xFCssel \u2014 bekannt: ${i.join(", ")}.`,en:`'${t}' names no environment key \u2014 known: ${i.join(", ")}.`}};if(Rd(e,n)!==void 0)return null;let o=rb(e,r);return{code:"env/unknownKey",message:o===null?{de:`'${t}': der Umgebungsschl\xFCssel '${r}' ist ein einzelner Wert \u2014 lies ihn als '${xo}${r}'.`,en:`'${t}': environment key '${r}' is a single value \u2014 read it as '${xo}${r}'.`}:{de:`'${t}': der Umgebungsschl\xFCssel '${r}' hat die Felder ${o.join(", ")}.`,en:`'${t}': environment key '${r}' has the fields ${o.join(", ")}.`}}}s(bm,"identifierIssue");function vm(e,t,n=Object.keys(e)){let r={};for(let i of n){let o=rb(e,i),a=Object.hasOwn(t,i)?t[i]:void 0;if(a===void 0&&D(`[env/missing] context key '${i}' was not supplied`),o===null){r[`${xo}${i}`]=a;continue}for(let l of o){let d=typeof a=="object"&&a!==null&&Object.hasOwn(a,l)?a[l]:void 0;d===void 0&&D(`[env/missing] context key '${i}' carries no '${l}'`),r[`${xo}${i}.${l}`]=d}}return r}s(vm,"flatten");function l6(e,t){switch(t){case"number":return typeof e=="number"&&Number.isFinite(e);case"boolean":return typeof e=="boolean";case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e);default:return typeof e=="string"}}s(l6,"valueMatchesDataType");function UC(e,t,n=Object.keys(e.types)){let r=new Set(n);for(let i of VC(e.types)){if(!r.has(i.split(".")[0]))continue;let o=t[`${xo}${i}`];o===void 0&&D(`[env/missing] context path '${i}' was not supplied`);let a=e.fields[i];if(o===null){a.nullable||D(`[env/null] context path '${i}' is not nullable but carries null`);continue}let l=gn(Rd(e.types,i));l6(o,l)||D(`[env/type] context path '${i}' expects ${l}, got ${JSON.stringify(o)}`),a.valueSet.kind==="fixed"&&!a.valueSet.values.includes(o)&&D(`[env/value] context path '${i}' carries '${String(o)}', outside ${a.valueSet.values.join(" | ")}`)}}s(UC,"assertContextValues");function d6(e){let t=[],n=VC(e.types);for(let r of n){let i=Rd(e.types,r),o=gn(i);if(!di(i)||o===void 0||!a6.has(o)){t.push(`'${r}' has type '${String(i)}', not a scalar value type`);continue}let a=Object.hasOwn(e.fields,r)?e.fields[r]:void 0;if(a===void 0){t.push(`'${r}' has no field spec (value set + nullability)`);continue}a.valueSet.kind==="fixed"&&(a.valueSet.values.length===0&&t.push(`'${r}' has an empty fixed value set`),o!=="text"&&o!=="option"&&t.push(`'${r}' is ${o}; a fixed value set needs a text or option leaf`))}for(let r of Object.keys(e.fields))n.includes(r)||t.push(`field spec '${r}' names no leaf of the schema`);return t}s(d6,"schemaIssues");function Na(e){let t=d6(e);t.length>0&&D(`[env/schema] ${t.join("; ")}`)}s(Na,"assertSchema");var xm={length:{params:["text"],returns:"number"},years_between:{params:["date","date"],returns:"number"}};function So(e){return JSON.stringify(e)}s(So,"canonical");function Ca(e){return e.kind==="binary"&&e.op==="&&"?[...Ca(e.left),...Ca(e.right)]:[e]}s(Ca,"conjuncts");function WC(e,t){let n;try{n=Mt(e)}catch{return!1}let r=So(Mt(t));return Ca(n).some(i=>So(i)===r)}s(WC,"hasConjunct");function YC(e,t){try{return So(Mt(e))===So(Mt(t))}catch{return!1}}s(YC,"sameCondition");function HC(e){let t=[];for(let n of e)t.push(...qt(Pi(n)));return BC(t)}s(HC,"contextKeysRead");function JC(e){try{return qt(Mt(e)).some($d)}catch{return!1}}s(JC,"readsContext");var c6=/^\d{4}-\d{2}-\d{2}$/,u6=new Set(["==","!=","<","<=",">",">=","in"]),f6=new Set(["<","<=",">",">="]);function Am(e,t,n=[]){Na(t);let r;try{r=Mt(e)}catch(a){let l=a.message;return[an("condition/parse",`Bedingung '${e}' ist nicht lesbar: ${l}`,`condition '${e}' does not parse: ${l}`)]}let i=[];for(let a of qt(r)){if(!$d(a)){i.push(an("condition/foreignIdentifier",`'${a}' ist kein Umgebungswert \u2014 Bedingungen lesen nur '$env.*'`,`'${a}' is not a context identifier \u2014 conditions read only '$env.*'`));continue}let l=bm(t.types,a);l!==null&&i.push(an("condition/unknownIdentifier",l.message.de,l.message.en))}if(i.length>0)return i;let o=fi(r,t,i);Ed(o)||i.push(an("condition/notBoolean",`Bedingung '${e}' ist kein Ja/Nein-Ausdruck`,`condition '${e}' is not a yes/no expression`)),g6(r,t,i);for(let{identifier:a,op:l}of sb(r,t))i.push(an("condition/unguardedNullable",`'${l}' \xFCber '${a}', das leer sein kann, braucht davor eine Absicherung '${a} != null &&'`,`'${l}' over '${a}', which may be null, needs a guard '${a} != null &&' before it`));return i.push(...p6(r,n)),i}s(Am,"conditionIssues");function p6(e,t){let n=Ca(e).map(So);return t.flatMap(r=>{let i=Mt(r),o=m6(i);return o===null||!n.includes(So(o))?[]:[{severity:"info",code:"condition/guardForm",message:{de:`[condition/guardForm] eine gespiegelte Absicherung z\xE4hlt nicht \u2014 schreibe sie genau als '${r}'`,en:`[condition/guardForm] a mirrored guard does not count \u2014 write it exactly as '${r}'`}}]})}s(p6,"guardFormHints");function m6(e){if(e.kind!=="binary"||e.op!=="=="&&e.op!=="!=")return null;let t={...e,left:e.right,right:e.left};return So(t)===So(e)?null:t}s(m6,"mirror");function Ed(e){return e.t==="unknown"||e.t==="data"&&e.dt==="boolean"}s(Ed,"isBooleanish");function QC(e){let t=_a(e);return t===null&&D(`[condition/invariant] '${e}' reached a pass that only sees $env identifiers`),t}s(QC,"contextPath");function ZC(e,t){let n=_a(t);return n!==null&&e.fields[n]?.nullable===!0}s(ZC,"isNullableLeaf");function h6(e,t){let n=gn(Rd(e.types,QC(t)));return n===void 0?{t:"unknown"}:{t:"data",dt:n}}s(h6,"identType");function Sm(e,t){return e.t==="unknown"||t.t==="unknown"||e.t==="null"||t.t==="null"?!0:e.t==="array"||t.t==="array"?!1:e.t==="str"&&t.t==="str"?!0:e.t==="str"?GC(e.value,t.dt):t.t==="str"?GC(t.value,e.dt):e.dt===t.dt}s(Sm,"fits");function GC(e,t){return t==="text"||t==="option"||t==="edge"?!0:t==="date"?c6.test(e):!1}s(GC,"strFits");function zC(e){return e.t==="unknown"?"unknown":e.t==="data"&&e.dt==="number"?"number":null}s(zC,"orderedCategory");function fi(e,t,n){switch(e.kind){case"num":return{t:"data",dt:"number"};case"bool":return{t:"data",dt:"boolean"};case"str":return{t:"str",value:e.value};case"null":return{t:"null"};case"ident":return h6(t,e.path);case"arr":for(let r of e.items)fi(r,t,n);return{t:"array"};case"unary":{let r=fi(e.operand,t,n);return Ed(r)||n.push(an("condition/notBoolean","'!' braucht einen Ja/Nein-Operanden","'!' needs a yes/no operand")),{t:"data",dt:"boolean"}}case"call":{let r=Object.hasOwn(xm,e.name)?xm[e.name]:void 0,i=e.args.map(l=>fi(l,t,n));return r===void 0?(n.push(an("condition/functionNotAllowed",`Funktion '${e.name}' ist nicht erlaubt \u2014 erlaubt: ${Object.keys(xm).join(", ")}`,`function '${e.name}' is not allowed \u2014 allowed: ${Object.keys(xm).join(", ")}`)),{t:"unknown"}):(i.length===r.params.length&&i.every((l,d)=>l.t!=="null"&&Sm(l,{t:"data",dt:r.params[d]}))||n.push(an("condition/typeMismatch",`'${e.name}' nimmt (${r.params.join(", ")})`,`'${e.name}' takes (${r.params.join(", ")})`)),{t:"data",dt:r.returns})}case"if":{let r=fi(e.cond,t,n);Ed(r)||n.push(an("condition/notBoolean","'if' braucht eine Ja/Nein-Bedingung","'if' needs a yes/no condition"));let i=fi(e.then,t,n),o=fi(e.else,t,n);return Sm(i,o)||n.push(an("condition/typeMismatch","die beiden Zweige von 'if' haben verschiedene Typen","the two arms of 'if' differ in type")),i.t==="null"?o:i}case"binary":{let r=fi(e.left,t,n),i=fi(e.right,t,n);if(e.op==="&&"||e.op==="||")(!Ed(r)||!Ed(i))&&n.push(an("condition/notBoolean",`'${e.op}' braucht Ja/Nein-Operanden`,`'${e.op}' needs yes/no operands`));else if(e.op==="in")e.right.kind!=="arr"?n.push(an("condition/inWithoutArray","'in' braucht rechts eine Liste, z. B. ['a', 'b']","'in' needs a list on its right, e.g. ['a', 'b']")):e.right.items.every(o=>Sm(r,fi(o,t,[])))||n.push(an("condition/typeMismatch","ein Listeneintrag von 'in' passt nicht zum Typ des linken Operanden","a list item of 'in' does not match the left operand's type"));else if(f6.has(e.op)){let o=zC(r),a=zC(i);(o===null||a===null||o!=="unknown"&&a!=="unknown"&&o!==a)&&n.push(an("condition/orderedComparison",`'${e.op}' vergleicht nur Zahlen \u2014 f\xFCr Daten years_between(\u2026) verwenden`,`'${e.op}' compares only numbers \u2014 for dates use years_between(\u2026)`))}else Sm(r,i)||n.push(an("condition/typeMismatch",`'${e.op}' vergleicht Werte verschiedener Typen`,`'${e.op}' compares values of different types`));return{t:"data",dt:"boolean"}}}}s(fi,"typeOf");function ib(e){return e.kind==="str"||e.kind==="num"||e.kind==="bool"}s(ib,"isLiteral");function XC(e){let t=[],n=s(r=>{if(r.kind==="binary"&&u6.has(r.op)){if(r.left.kind==="ident"){let i=r.op==="in"&&r.right.kind==="arr"?r.right.items.filter(ib):ib(r.right)?[r.right]:[];i.length>0&&t.push({ident:r.left.path,literals:i})}r.right.kind==="ident"&&ib(r.left)&&t.push({ident:r.right.path,literals:[r.left]})}eD(r,n)},"visit");return n(e),t}s(XC,"comparedLiterals");function g6(e,t,n){for(let{ident:r,literals:i}of XC(e)){let o=y6(r,i,t);o!==null&&n.push(o)}}s(g6,"literalIssues");function ob(e,t){let n;try{n=Mt(e)}catch{return[]}let r=[];for(let{ident:i,literals:o}of XC(n)){let a=_a(i);if(!(a===null||t.fields[a]?.valueSet.kind!=="live"))for(let l of o)l.kind==="str"&&r.push({path:a,value:l.value})}return r}s(ob,"liveLiterals");function y6(e,t,n){let r=n.fields[QC(e)]?.valueSet;if(r?.kind==="unstable")return an("condition/literalOnUnstable",`'${e}' ist nicht \xFCber Umgebungen stabil \u2014 vergleiche ihn mit keinem festen Wert; verzweige stattdessen \xFCber ein stabiles Merkmal`,`'${e}' is not stable across environments \u2014 compare it to no literal; branch on a stable attribute instead`);if(r?.kind!=="fixed")return null;let i=t.flatMap(a=>a.kind==="str"&&!r.values.includes(a.value)?[`'${a.value}'`]:[]);if(i.length===0)return null;let o=r.values.map(a=>`'${a}'`).join(", ");return an("condition/literalOutsideSet",`'${e}' kennt nur ${o} \u2014 nicht ${i.join(", ")}`,`'${e}' takes only ${o} \u2014 not ${i.join(", ")}`)}s(y6,"valueSetIssue");function eD(e,t){switch(e.kind){case"binary":t(e.left),t(e.right);return;case"unary":t(e.operand);return;case"call":e.args.forEach(t);return;case"arr":e.items.forEach(t);return;case"if":t(e.cond),t(e.then),t(e.else);return;default:return}}s(eD,"forEachChild");function tD(e){return e.kind==="binary"&&(e.op==="=="||e.op==="!=")&&(e.left.kind==="ident"&&e.right.kind==="null"||e.left.kind==="null"&&e.right.kind==="ident")}s(tD,"isNullTest");function nD(e){return Ca(e).flatMap(t=>{let n=rD(t);return n===null?[]:[n]})}s(nD,"guardsOf");function Id(e,t,n){switch(e.kind){case"ident":return ZC(t,e.path)&&!n.has(e.path)?e.path:null;case"call":for(let r of e.args){let i=Id(r,t,n);if(i!==null)return i}return null;case"if":return Id(e.then,t,new Set([...n,...nD(e.cond)]))??Id(e.else,t,n);default:return null}}s(Id,"unguardedNullSource");function rD(e){return!tD(e)||e.kind!=="binary"||e.op!=="!="?null:e.left.kind==="ident"?e.left.path:e.right.kind==="ident"?e.right.path:null}s(rD,"guardedIdent");function Pa(e,t,n,r){if(e.kind==="binary"&&e.op==="&&"){let i=new Set(n);for(let o of Ca(e)){Pa(o,t,i,r);let a=rD(o);a!==null&&i.add(a)}return}if(e.kind==="if"){Pa(e.cond,t,n,r),Pa(e.then,t,new Set([...n,...nD(e.cond)]),r),Pa(e.else,t,n,r);return}if(e.kind==="binary"&&e.op==="!="&&e.left.kind!=="null"&&e.right.kind!=="null"){let i=Id(e.left,t,n)??Id(e.right,t,n);i!==null&&r(i,"!=")}if(e.kind==="unary"&&!tD(e.operand)){let i=qt(e.operand).filter(o=>ZC(t,o)&&!n.has(o));i.length>0&&r(i[0],"!")}eD(e,i=>Pa(i,t,n,r))}s(Pa,"nullableReads");function sb(e,t){Na(t);let n=[];return Pa(e,t,new Set,(r,i)=>{n.some(o=>o.identifier===r)||n.push({identifier:r,op:i})}),n}s(sb,"unguardedNullableReads");function an(e,t,n){return{severity:"error",code:e,message:{de:`[${e}] ${t}`,en:`[${e}] ${n}`}}}s(an,"error");function Od(e){let t=Array.isArray(e.nodes)?e.nodes:[],n=new Set;for(let r of t)for(let i of fm(r))i.key!==null&&Sa[i.leaf].involves&&n.add(i.key);return n}s(Od,"declaredGroupKeys");var Da=Dp;var w6="unit.key",k6="offer.key";function iD(e,t){return e===w6?t.unitKeys:e===k6?t.offerKeys:null}s(iD,"liveKeyUniverse");function Tm(e){return[xt,...[...Od(e)].sort((t,n)=>t.localeCompare(n)).map(Vp)]}s(Tm,"requiredSlots");var Ao=`${Lp("applicant.channel")} == 'staff'`;var lb=["strict","leastLoaded"];var ab=2;function oD(e){return e.some(t=>t.length===0)?{de:"nennt einen leeren Personenschl\xFCssel",en:"names an empty person key"}:new Set(e).size!==e.length?{de:"nennt eine Person zweimal",en:"names a person twice"}:e.length<ab?{de:`braucht mindestens ${ab} Personen`,en:`needs at least ${ab} people`}:null}s(oD,"rotationPoolProblem");function b6(e,t){let n=t===null?-1:e.indexOf(t);return[...e.slice(n+1),...e.slice(0,n+1)]}s(b6,"strictOrder");function sD(e){let t=b6(e.pool,e.previous).filter(i=>e.eligible.has(i));if(t.length===0)return null;if(e.mode==="strict")return t[0];let n=e.openCounts;n===void 0&&D("[assignment/rotation] leastLoaded needs the open counts");let r=s(i=>{let o=n.get(i);return o===void 0&&D(`[assignment/rotation] no open count for '${i}'`),o},"load");return t.reduce((i,o)=>r(o)<r(i)?o:i)}s(sD,"pickFromPool");function lD(e){return e.map(t=>({slot:NN(t.slot),rules:[...t.rules]}))}s(lD,"rulesOfStored");function dD(e){return e.map(t=>({slot:v6(t.slot),rules:[...t.rules]}))}s(dD,"storedOfRules");function v6(e){let t=Up(e);return t===null&&D(`[assignment/unknownSlot] '${e}' is no slot \u2014 'responsible' or 'team:<teamKey>'`),t}s(v6,"slotOf");function cD(e,t){let n=e?.assignmentRules;n===void 0&&D(`[assignment/noRules] ${t}: the workflow has no assignment rule`);let r=mD(n);return r.length>0&&D(`${r.join("; ")} (${t})`),lD(n)}s(cD,"rulesOfGraph");function x6(e){return e===xt?{slot:e,rules:[{when:Ao,assign:{kind:"creator"}},{when:null,assign:{kind:"unassigned"}}]}:{slot:e,rules:[{when:null,assign:{kind:"queue"}}]}}s(x6,"defaultSlotRules");function uD(e,t){let n=new Set(e.map(o=>o.slot)),r=t.filter(o=>!n.has(o)).map(x6);return[...r.filter(o=>o.slot===xt),...e,...r.filter(o=>o.slot!==xt)]}s(uD,"withRequiredSlots");function jt(e,t){return t===void 0?`slot '${e}'`:`slot '${e}' row #${t+1}`}s(jt,"where");function Hn(e,t){return t===void 0?`Liste '${e}'`:`Liste '${e}', Zeile #${t+1}`}s(Hn,"whereDe");function Fn(e,t,n={},r="error"){return{severity:r,code:e,message:{de:`[${e}] ${t.de}`,en:`[${e}] ${t.en}`},...n}}s(Fn,"issue");function aD(e){if(e===xt)return!0;let t=Bp(e);return t!==null&&t.length>0}s(aD,"isKnownSlot");function S6(e,t){Na(Da);let n=[],r=new Set;e.forEach((o,a)=>{let{slot:l}=o;aD(l)||n.push(Fn("assignment/unknownSlot",{de:`'${l}' ist keine Liste \u2014 'responsible' oder 'team:<teamKey>'`,en:`'${l}' is no slot \u2014 'responsible' or 'team:<teamKey>'`},{slot:l})),r.has(l)&&n.push(Fn("assignment/duplicateSlot",{de:`${Hn(l)} steht zweimal da`,en:`${jt(l)} is listed twice`},{slot:l})),r.add(l),l===xt&&a!==0&&n.push(Fn("assignment/responsibleFirst",{de:`'${xt}' muss die erste Liste sein \u2014 Team-Zeilen \xFCbernehmen sie`,en:`'${xt}' must be the first slot \u2014 team rows copy it`},{slot:l})),n.push(...A6(o))});for(let o of t)r.has(o)||n.push(Fn("assignment/slotMissing",{de:`${Hn(o)} hat keine Regeln \u2014 der Workflow braucht sie`,en:`${jt(o)} has no rule list \u2014 the workflow needs it`},{slot:o}));let i=new Set(t);for(let{slot:o}of e)o!==xt&&!i.has(o)&&aD(o)&&n.push(Fn("assignment/unusedSlot",{de:`${Hn(o)} wird hier nicht gebraucht \u2014 erlaubt, und nicht ausgewertet`,en:`${jt(o)} is not needed here \u2014 allowed, and not evaluated`},{slot:o},"info"));return n}s(S6,"validateRules");function A6({slot:e,rules:t}){let n=[];return(t.length===0||t[t.length-1].when!==null)&&n.push(Fn("assignment/defaultRowMissing",{de:`${Hn(e)} muss mit einer Zeile ohne Bedingung enden (\u201Esonst\u201C)`,en:`${jt(e)} must end with a row without condition ("otherwise")`},{slot:e})),t.forEach((r,i)=>{let o={slot:e,row:i},{when:a,assign:l}=r;if(a===null&&i<t.length-1&&n.push(Fn("assignment/ruleAfterDefault",{de:`${Hn(e,i)} hat keine Bedingung, aber es folgen Zeilen \u2014 sie treffen nie zu`,en:`${jt(e,i)} has no condition, but rows follow it \u2014 they can never match`},o)),a!==null){let d=Am(a,Da,[Ao]);for(let c of d)n.push({...c,message:{de:`${c.message.de} (${Hn(e,i)})`,en:`${c.message.en} (${jt(e,i)})`},...o});if(d.every(c=>c.severity!=="error")){JC(a)||n.push(Fn("assignment/shadowedRule",{de:`${Hn(e,i)} liest nichts aus dem Vorgang \u2014 sie gilt immer oder nie`,en:`${jt(e,i)} reads nothing of the application \u2014 it holds for every application or for none`},o));let c=t.slice(0,i).findIndex(u=>u.when!==null&&YC(u.when,a));c!==-1&&n.push(Fn("assignment/shadowedRule",{de:`${Hn(e,i)} wiederholt die Bedingung von Zeile #${c+1} \u2014 sie trifft nie zu`,en:`${jt(e,i)} repeats the condition of row #${c+1} \u2014 it can never match`},o))}}if(e===xt&&l.kind==="slot"&&n.push(Fn("assignment/slotForwardRef",{de:`${Hn(e,i)} \xFCbernimmt '${l.slot}' \u2014 das darf nur eine Team-Liste nach '${xt}'`,en:`${jt(e,i)} copies '${l.slot}' \u2014 only a team slot after '${xt}' may`},o)),e===xt&&l.kind==="queue"&&n.push(Fn("assignment/queueOnProcessSlot",{de:`${Hn(e,i)} weist die Queue zu \u2014 die Prozesszust\xE4ndigkeit ist immer eine Person`,en:`${jt(e,i)} assigns the queue \u2014 the responsible slot is always a person`},o)),l.kind==="unassigned"&&n.push(Fn("assignment/targetMissing",{de:`${Hn(e,i)} nennt noch niemanden \u2014 Person w\xE4hlen`,en:`${jt(e,i)} names no one yet \u2014 choose a person`},o)),l.kind==="rotation"){let d=oD(l.configKeys);d!==null&&n.push(Fn("assignment/rotationPool",{de:`${Hn(e,i)}: die Reihum-Liste ${d.de}`,en:`${jt(e,i)} rotates over a pool that ${d.en}`},o))}l.kind==="creator"&&(a===null||!WC(a,Ao))&&n.push(Fn("assignment/unguardedTarget",{de:`${Hn(e,i)} weist die anlegende Person zu \u2014 die gibt es nur, wenn die Bedingung der Zeile '${Ao}' ist (oder enth\xE4lt)`,en:`${jt(e,i)} assigns the creator, which exists only when the row's condition is (or has the conjunct) '${Ao}'`},o))}),n}s(A6,"rowIssues");function fD(e,t){for(let r of t)e.some(i=>i.slot===r)||D(`[assignment/slotMissing] ${jt(r)} has no rule list`);let n=new Set(t);return e.filter(r=>n.has(r.slot))}s(fD,"selectSlots");function T6(e,t){return HC(fD(e,t).flatMap(n=>n.rules.flatMap(r=>r.when===null?[]:[r.when])))}s(T6,"contextKeysOfRules");function pD(e,t,n,r){Na(Da);let i=fD(e,n),o=T6(e,n),a=vm(Da.types,t,o);UC(Da,a,o);let l=[];for(let{slot:d,rules:c}of i){let u=c.findIndex((h,y)=>{if(h.when===null)return!0;for(let b of qt(Pi(h.when)))Object.hasOwn(a,b)||D(`[condition/unknownIdentifier] ${jt(d,y)} reads '${b}', which the context does not carry`);return sP(h.when,{values:a})});u===-1&&D(`[assignment/defaultRowMissing] ${jt(d)}: no row matched and there is no default row`);let p=c[u].assign;l.push({slot:d,ruleIndex:u,assign:p,value:R6(d,u,p,l,r)})}return l}s(pD,"evaluateRules");function R6(e,t,n,r,i){switch(n.kind){case"person":return{kind:"value",value:i.person(n.configKey)};case"creator":return{kind:"value",value:i.creator()};case"rotation":return{kind:"value",value:i.rotation(n,{slot:e,row:t})};case"unassigned":return D(`[assignment/targetMissing] ${jt(e,t)} names no one`);case"queue":return e===xt&&D(`[assignment/queueOnProcessSlot] ${jt(e,t)} assigns the queue`),{kind:"queue"};case"slot":{let o=e===xt?void 0:r.find(a=>a.slot===n.slot);return o===void 0&&D(`[assignment/slotForwardRef] ${jt(e,t)} copies '${n.slot}', which is not decided before it`),o.value}}}s(R6,"resolveTarget");var db={person:["kind","configKey"],creator:["kind"],slot:["kind","slot"],queue:["kind"],rotation:["kind","configKeys","mode"],unassigned:["kind"]};function $6(e){if(typeof e!="object"||e===null)return!1;let{kind:t,groupKey:n,...r}=e;return Object.keys(r).length>0?!1:t==="responsible"?n===void 0:t==="team"&&typeof n=="string"&&n.length>0}s($6,"isStoredSlot");function mD(e){let t=[],n=s((r,i)=>t.push(`[assignment/shape] ${r}: ${i}`),"bad");return Array.isArray(e)?(e.forEach((r,i)=>{let o=`slots[${i}]`;if(typeof r!="object"||r===null)return n(o,"must be { slot, rules }");let{slot:a,rules:l,...d}=r;if(Object.keys(d).length>0&&n(o,`unknown field(s) ${Object.keys(d).join(", ")}`),$6(a)||n(o,"slot must be { kind: 'responsible' } or { kind: 'team', groupKey: '<team key>' }"),!Array.isArray(l))return n(o,"rules must be a list");l.forEach((c,u)=>{let p=`${o}.rules[${u}]`;if(typeof c!="object"||c===null)return n(p,"must be { when, assign }");let{when:h,assign:y,...b}=c;Object.keys(b).length>0&&n(p,`unknown field(s) ${Object.keys(b).join(", ")}`),h!==null&&typeof h!="string"&&n(p,"when must be a condition string or null (\u201Esonst\u201C)");let k=y?.kind;if(typeof y!="object"||y===null||typeof k!="string"||!Object.hasOwn(db,k))return n(p,`assign must be one of ${Object.keys(db).map(I=>`{kind:'${I}'}`).join(", ")}`);let v=db[k],T=Object.keys(y);(T.some(I=>!v.includes(I))||v.some(I=>!T.includes(I)))&&n(p,`a '${k}' target has exactly the field(s) ${v.join(", ")}`);let $=y;if(k==="person"&&(typeof $.configKey!="string"||$.configKey.length===0)&&n(p,"a 'person' target needs a non-empty configKey"),k==="rotation"){let I=$.configKeys;(!Array.isArray(I)||I.some(C=>typeof C!="string"))&&n(p,"a 'rotation' target needs configKeys, a list of person keys"),lb.includes($.mode)||n(p,`a 'rotation' target's mode is one of ${lb.map(C=>`'${C}'`).join(", ")}`)}k==="slot"&&$.slot!==xt&&n(p,`a 'slot' target copies '${xt}' and nothing else`)})}),t):(n("slots","must be a list of { slot, rules }"),t)}s(mD,"ruleShapeIssues");function hD(e){let t=e??{},n=[];if(t.teamOwnerBindings!==void 0&&n.push({de:"[assignment/legacyBindings] der Workflow tr\xE4gt noch teamOwnerBindings \u2014 die Zust\xE4ndigkeitsregel ersetzt sie; das Feld entfernen",en:"[assignment/legacyBindings] the workflow still carries teamOwnerBindings \u2014 the assignment rule replaces them; remove the field"}),t.assignmentRules===void 0)return n.push({de:"[assignment/noRules] der Workflow hat keine Zust\xE4ndigkeitsregel (graph.assignmentRules) \u2014 jeder Workflow muss sagen, wer zust\xE4ndig wird",en:"[assignment/noRules] the workflow has no assignment rule (graph.assignmentRules) \u2014 every workflow must say who becomes responsible"}),n;let r=mD(t.assignmentRules);if(r.length>0)return[...n,...r.map(o=>({de:o,en:o}))];let i=Tm({nodes:Array.isArray(t.nodes)?t.nodes:[]});for(let o of S6(lD(t.assignmentRules),i))o.severity==="error"&&n.push(o.message);return n}s(hD,"workflowAssignmentIssues");var cb="team:",E6=/^[a-z0-9][a-z0-9-]*$/;function I6(e){if(!e.startsWith(cb))return null;let t=e.slice(cb.length);return t.length>0?t:null}s(I6,"teamKeyOfMember");function Rm(e){return`${cb}${e}`}s(Rm,"teamMember");function Fa(e){let t=e.channels;return t===void 0?[]:(Array.isArray(t)||D("graph.channels must be an array"),t)}s(Fa,"readAuthoredChannels");function gD(e){return[...Od(e)].sort()}s(gD,"derivedChannelTeamKeys");function yD(e,t){let n=e.toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/ß/g,"ss").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"channel";if(!t.has(n))return n;for(let r=2;;r++){let i=`${n}-${r}`;if(!t.has(i))return i}}s(yD,"mintChannelKey");function wD(e,t){let n=e.channels;if(n===void 0)return[];if(!Array.isArray(n))return[{path:"channels",reason:{de:"[channels/shape] graph.channels muss eine Liste sein.",en:"[channels/shape] graph.channels must be a list."}}];let r=[],i=Od(e),o=new Set,a=new Map;return n.forEach((l,d)=>{let c=`channels[${d}]`,u=l;if(u===null||typeof u!="object"||typeof u.key!="string"||Ft(u.label)==="not-localized"||!Array.isArray(u.members)||!u.members.every(T=>typeof T=="string")){r.push({path:c,reason:{de:"[channels/shape] Ein Kanal braucht key, label ({ de, en }) und members (Liste von Texten).",en:"[channels/shape] A channel needs key, label ({ de, en }) and members (a list of texts)."}});return}let p={de:`Kanal "${u.key}"`,en:`Channel "${u.key}"`};E6.test(u.key)||r.push({path:`${c}.key`,reason:{de:`[channels/invalidKey] ${p.de}: Schl\xFCssel nur aus Kleinbuchstaben, Ziffern und Bindestrich.`,en:`[channels/invalidKey] ${p.en}: key only from lowercase letters, digits and hyphens.`}}),o.has(u.key)&&r.push({path:`${c}.key`,reason:{de:`[channels/duplicateKey] ${p.de}: Schl\xFCssel ist doppelt vergeben.`,en:`[channels/duplicateKey] ${p.en}: key is used twice.`}}),o.add(u.key);let h=Ft(u.label);if(h!=="not-localized"&&h.length===2?r.push({path:`${c}.label`,reason:{de:`[channels/emptyLabel] ${p.de}: Bezeichnung fehlt.`,en:`[channels/emptyLabel] ${p.en}: name is missing.`}}):h!=="not-localized"&&h.length>0&&r.push({path:`${c}.label`,reason:{de:`[i18n/missingTranslation] ${p.de}: Bezeichnung fehlt in: ${h.join(", ")} \u2014 jeder angezeigte Text braucht Deutsch und Englisch.`,en:`[i18n/missingTranslation] ${p.en}: name is missing in: ${h.join(", ")} \u2014 every displayed text needs German and English.`}}),u.members.length===0){r.push({path:`${c}.members`,reason:{de:`[channels/emptyMembers] ${p.de}: mindestens ein Team.`,en:`[channels/emptyMembers] ${p.en}: at least one team.`}});return}let y=[];for(let T of u.members){let $=I6(T);if($===null){r.push({path:`${c}.members`,reason:{de:`[channels/invalidMember] ${p.de}: "${T}" ist kein "team:<schl\xFCssel>".`,en:`[channels/invalidMember] ${p.en}: "${T}" is not a "team:<key>".`}});continue}if(y.includes($)){r.push({path:`${c}.members`,reason:{de:`[channels/duplicateMember] ${p.de}: Team "${$}" ist doppelt genannt.`,en:`[channels/duplicateMember] ${p.en}: team "${$}" is named twice.`}});continue}t!==void 0&&!t.has($)&&r.push({path:`${c}.members`,reason:{de:`[channels/unknownTeam] ${p.de}: Team "${$}" gibt es in diesem Mandanten nicht (oder es ist die Bewerbergruppe).`,en:`[channels/unknownTeam] ${p.en}: team "${$}" does not exist at this school (or it is the applicant group).`}}),y.push($)}if(y.length===0)return;let b=[...y].sort().join("+"),[k]=y;y.length===1&&k!==void 0&&i.has(k)&&r.push({path:`${c}.members`,reason:{de:`[channels/duplicatesDerived] ${p.de}: Team "${k}" ist am Prozess beteiligt und hat seinen Kanal schon automatisch.`,en:`[channels/duplicatesDerived] ${p.en}: team "${k}" takes part in the process and already has its channel automatically.`}});let v=a.get(b);v!==void 0?r.push({path:`${c}.members`,reason:{de:`[channels/duplicateMembership] ${p.de}: dieselben Teams wie Kanal "${v}" \u2014 zwei Tabs w\xE4ren derselbe Chat.`,en:`[channels/duplicateMembership] ${p.en}: the same teams as channel "${v}" \u2014 two tabs would be the same chat.`}}):a.set(b,u.key)}),r}s(wD,"channelIssues");function $m(e){return e.kind==="entered"&&!e.repeated&&e.reviewRequired}s($m,"isReviewField");function La(e){let t=[],n=[];function r(k,v){try{return Mt(k)}catch(T){t.push({path:v,src:k,reason:T instanceof Error?T.message:String(T)});return}}s(r,"tryParse");function i(k,v){return{...k,visibleIf:k.visibleIf?r(k.visibleIf,`${v}.visibleIf`):void 0,requiredIf:k.requiredIf?r(k.requiredIf,`${v}.requiredIf`):void 0,disabledIf:k.disabledIf?r(k.disabledIf,`${v}.disabledIf`):void 0,defaultValue:k.defaultValue?r(k.defaultValue,`${v}.defaultValue`):void 0}}s(i,"compileField");function o(k,v){return{...k,visibleIf:k.visibleIf?r(k.visibleIf,`${v}.visibleIf`):void 0,fields:k.fields.map((T,$)=>i(T,`${v}.fields[${$}]`))}}s(o,"compileGroup");function a(k,v){return{...k,itemTemplate:k.itemTemplate.map((T,$)=>i(T,`${v}.itemTemplate[${$}]`)),effects:k.effects?.map((T,$)=>d(T,`${v}.effects[${$}]`)),itemVisibleIf:k.itemVisibleIf?r(k.itemVisibleIf,`${v}.itemVisibleIf`):void 0}}s(a,"compileRepeated");function l(k,v){let T=[];return k.fields.forEach(($,I)=>{if($.externalFlag){n.push({key:$.key,label:$.label,defaultValue:$.defaultValue?r($.defaultValue,`${v}.fields[${I}].defaultValue`):void 0});return}T.push(i($,`${v}.fields[${I}]`))}),{...k,visibleIf:k.visibleIf?r(k.visibleIf,`${v}.visibleIf`):void 0,fields:T,groups:k.groups?.map(($,I)=>o($,`${v}.groups[${I}]`)),computed:k.computed?.map(($,I)=>{let C=r($.expression,`${v}.computed[${I}].expression`);return{key:$.key,expression:C??{kind:"null"}}}),subsections:k.subsections?.map(($,I)=>l($,`${v}.subsections[${I}]`)),repeated:k.repeated?.map(($,I)=>a($,`${v}.repeated[${I}]`)),validators:k.validators}}s(l,"compileSection");function d(k,v){return{...k,when:k.when?r(k.when,`${v}.when`):void 0}}s(d,"compileEffect");function c(k,v){let T=r(k.when,`${v}.when`);return T?{...k,when:T}:null}s(c,"compileOutcome");let u=e.sections.map((k,v)=>l(k,`sections[${v}]`)),p=(e.effects??[]).map((k,v)=>d(k,`effects[${v}]`)),h=[],y=e.outcomes??[];for(let k=0;k<y.length;k++){let v=y[k],T=c(v,`outcomes[${k}]`);T&&h.push(T)}return{compiled:{...e,sections:u,effects:p,outcomes:h,flags:n},errors:t}}s(La,"compileForm");var O6=new Set(["decision","review","governedDocument"]);function bD(e){return O6.has(e.type)&&!(e.type==="governedDocument"&&e.production==="none")}s(bD,"isReadinessGatedNode");function _6(e){let t=new Map,n=P6(e),r=s((i,o)=>{let a=ub(o),l=[...i.fields,...(i.groups??[]).flatMap(d=>d.fields)];for(let d of l)d.externalFlag!==!0&&t.set(d.key,{kind:"entered",key:d.key,label:d.label,qualifier:N6(d.bucket,n,a),section:a,type:d.type,enumSource:kD(d),repeated:!1,reviewRequired:d.reviewRequired===!0});for(let d of i.repeated??[])for(let c of d.itemTemplate){let u=`${d.key}.${c.key}`;t.set(u,{kind:"entered",key:u,label:c.label,qualifier:ub(d),section:a,type:c.type,enumSource:kD(c),repeated:!0,reviewRequired:!1})}for(let d of i.computed??[]){let c=qt(Mt(d.expression));t.set(d.key,{kind:"computed",key:d.key,label:d.label??{de:d.key,en:d.key},qualifier:a,deps:c})}for(let d of i.subsections??[])r(d,o)},"visit");for(let i of e.sections)r(i,i);return t}s(_6,"formFieldCatalog");function kD(e){return e.type==="enum"?e:null}s(kD,"enumSourceOf");function N6(e,t,n){return e===void 0?n:t.get(e)??n}s(N6,"fieldQualifier");function P6(e){let t=new Map,n=s((r,i)=>{i===void 0||t.has(r)||t.set(r,ub(i))},"add");for(let r of xD(e))r.kind==="person"?n(r.bucket,r.display):r.kind==="organization"&&n(r.id.replace(/^o\./,""),r.display);return t}s(P6,"bucketWordings");function vD(e){return e.flatMap(t=>[t,...vD(t.subsections??[])])}s(vD,"allSections");function xD(e){return[...e.effects,...vD(e.sections).flatMap(t=>(t.repeated??[]).flatMap(n=>n.effects??[]))]}s(xD,"allEffects");function ub(e){return{label:e.label}}s(ub,"wordingOf");function SD(e){return wd(e).flatMap(({slot:t,address:n})=>{let r=fP(n);return r===null||yd.includes(r.path)?[]:[{slotId:t,owner:r.owner,fieldKey:r.path}]})}s(SD,"admissionBindingLeaves");function C6(e,t){let n=e.get(t);if(n===void 0)return null;let r=[],i=new Set,o=s(a=>{if(!i.has(a.key)&&(i.add(a.key),r.push({fieldKey:a.key,kind:a.kind}),a.kind==="computed"))for(let l of a.deps){let d=e.get(l);d!==void 0&&o(d)}},"walk");return o(n),r}s(C6,"expandKey");function D6(e){let t=new Set;for(let n of xD(e))if(!(n.kind!=="person"||n.contractParty===void 0)&&n.when!==void 0)for(let r of qt(Mt(n.when)))t.add(r);return[...t]}s(D6,"contractPartyConditionKeys");function F6(e){return La(e).compiled.flags.map(t=>({key:t.key,name:t.label}))}s(F6,"formExternalFlags");function AD(e){return{readinessFormFieldsByFormNode:new Map([...e].map(([t,n])=>[t,_6(n)])),readinessPartyConditionKeysByFormNode:new Map([...e].map(([t,n])=>[t,new Set(D6(n))])),formFlagKeysByFormNode:new Map([...e].map(([t,n])=>[t,new Set(F6(n).map(r=>r.key))])),formViewKeysByFormNode:new Map([...e].map(([t,n])=>[t,new Set((n.views??[]).map(r=>r.key))]))}}s(AD,"readinessUniverse");function fb(e,t){let n=new Set;for(let r of t)for(let i of C6(e,r)??[])i.kind==="entered"&&n.add(i.fieldKey);return n}s(fb,"enteredFieldsBehind");var L6=new Set(["label","sublabel","title","description","body","chipLabel","nextAction","confirmLabel","placeholder","helpText","subject","heading","hint","notice","reason"]);function M6(e){return L6.has(e)?!0:TD(e)?!1:/(Label|Title|Body|Description|Text|Hint|Heading|Placeholder)$/.test(e)}s(M6,"isTextKey");function TD(e){return/^localized[A-Z]/.test(e)}s(TD,"isLegacyTwinKey");var q6=new Set(["titles","responseLabels","outputLabels","enumOptionLabels"]),K6=new Set(["inputs","resolver","library"]);function Im(e,t){let n=[];return pb(e,t,n),n}s(Im,"findUnlocalizedTexts");function pb(e,t,n){if(Array.isArray(e)){e.forEach((i,o)=>pb(i,`${t}[${V6(i,o)}]`,n));return}if(e===null||typeof e!="object")return;let r=e;for(let[i,o]of Object.entries(r)){let a=`${t}.${i}`;if(!K6.has(i)){if(TD(i)){n.push({path:a,missing:"legacy-twin"});continue}if(M6(i)){j6(o,a,n);continue}if(q6.has(i)&&o!==null&&typeof o=="object"){for(let[l,d]of Object.entries(o))d!==void 0&&RD(d,`${a}.${l}`,n);continue}pb(o,a,n)}}}s(pb,"walk");function j6(e,t,n){e!=null&&RD(e,t,n)}s(j6,"checkText");function RD(e,t,n){let r=Ft(e);(r==="not-localized"||r.length>0)&&n.push({path:t,missing:r})}s(RD,"report");function V6(e,t){if(e!==null&&typeof e=="object"){let n=e;if(typeof n.id=="string")return n.id;if(typeof n.key=="string")return n.key}return String(t)}s(V6,"keyOf");function Em(e,t){return e==="not-localized"?t==="de"?"ist kein zweisprachiger Text ({ de, en })":"is not a bilingual text ({ de, en })":e==="legacy-twin"?t==="de"?'ist ein Zwilling der alten Form \u2014 der Text geh\xF6rt in das Feld ohne \u201Elocalized"':'is a twin of the old shape \u2014 the text belongs in the field without "localized"':t==="de"?`fehlt in: ${e.join(", ")}`:`is missing in: ${e.join(", ")}`}s(Em,"describe");function mb({path:e,missing:t}){return t==="legacy-twin"?{de:`[i18n/legacyTwin] ${e} ${Em(t,"de")}.`,en:`[i18n/legacyTwin] ${e} ${Em(t,"en")}.`}:{de:`[i18n/missingTranslation] ${e} ${Em(t,"de")} \u2014 jeder angezeigte Text braucht Deutsch und Englisch; die Sprache folgt dem Konto des Lesenden.`,en:`[i18n/missingTranslation] ${e} ${Em(t,"en")} \u2014 every displayed text needs German and English; the language follows the reader's account.`}}s(mb,"unlocalizedTextReason");var B6={engagePush:["engage"]};function U6(e){let t=B6[e.type];return t===void 0?e:Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}s(U6,"withoutMachineData");function $D(e,t){return[...Im(e.nodes.map(U6),"nodes"),...t===void 0?[]:Im(t,`layout.${t.id}`)].map(r=>({layer:"GRAPH",kind:"i18n",path:r.path,reason:mb(r),severity:"error"}))}s($D,"checkLocalizedTexts");var G6="Europe/Berlin";function hb(){return G6}s(hb,"tenantTimeZone");var ED=new Map;function z6(e){let t=ED.get(e);if(t)return t;let n;try{n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{de("INVALID",{de:`Unbekannte Zeitzone "${e}".`,en:`Unknown time zone "${e}".`})}return ED.set(e,n),n}s(z6,"formatterFor");function W6(e,t){let n=new Map(z6(e).formatToParts(new Date(t)).map(a=>[a.type,a.value])),r=s(a=>{let l=n.get(a);return l===void 0&&D(`Zeitzone "${e}" liefert kein Feld ${a}.`),Number(l)},"read"),i=r("hour")%24;return Date.UTC(r("year"),r("month")-1,r("day"),i,r("minute"),r("second"))-Math.floor(t/1e3)*1e3}s(W6,"zoneOffsetAt");function Om(e,t){let n=e+W6(t,e);return{wallClock:new Date(n).toISOString().slice(0,19),timeZone:t}}s(Om,"instantToLocalDateTime");var ds=5,cs=480;function Mi(e){return typeof e=="string"&&e.trim().length>0}s(Mi,"isNonEmptyString");function _D(e,t,n){return Object.keys(e).filter(r=>!t.includes(r)).map(r=>({field:`result.${r}`,code:He.unknownField,message:{de:`Unbekanntes Feld '${r}' im ${n.de}; erlaubt sind: ${t.join(", ")}.`,en:`Unknown field '${r}' in the ${n.en}; allowed: ${t.join(", ")}.`}}))}s(_D,"unknownFieldIssues");var _m="primaryHostTeams";function Y6(e){let t=[],n=e.title;(n===void 0||typeof n!="object"||n===null||!Mi(n.de)||!Mi(n.en))&&t.push({field:"result.title",code:He.appointmentMissingTitle,message:{de:"Ein Termin-Ergebnis braucht einen neutralen Titel in beiden Sprachen ({ de, en }) \u2014 er steht in der Mail und in der Kalenderdatei der Familie, deshalb nie ein Familienname.",en:"An appointment result needs a neutral title in both languages ({ de, en }) \u2014 it appears in the email and in the family's calendar file, so never a family name."}});let r=e.durationMinutes;(typeof r!="number"||!Number.isInteger(r)||r<ds||r>cs)&&t.push({field:"result.durationMinutes",code:He.appointmentInvalidDuration,message:{de:`'durationMinutes' muss eine ganze Zahl von ${ds} bis ${cs} sein, erhalten ${JSON.stringify(r)}.`,en:`'durationMinutes' must be a whole number from ${ds} to ${cs}, got ${JSON.stringify(r)}.`}});let{[_m]:i,...o}=e;return t.push(..._D(o,["kind","title","durationMinutes","primaryParticipantTeams","participants"],{de:"Termin-Ergebnis",en:"appointment result"})),t}s(Y6,"appointmentIssues");function OD(e){if(typeof e!="object"||e===null)return!1;let t=e;return Mi(t.de)&&Mi(t.en)}s(OD,"isBilingual");var gb=["key","type","label","writes","options","min","suggest","evidence","evidenceFrom","multiple","tasks","maxLength"];function H6(e,t){let n=s((o,a)=>({field:o,code:He.recordFields,message:a}),"issue");if(!Array.isArray(e)||e.length===0)return[n("result.fields",{de:"Eine Erfassung braucht mindestens ein Feld ('result.fields').",en:"A record needs at least one field ('result.fields')."})];let r=[],i=new Set;for(let[o,a]of e.entries()){let l=`result.fields[${o}]`;if(typeof a!="object"||a===null||Array.isArray(a)){r.push(n(l,{de:"Ein Feld der Erfassung muss ein Objekt sein.",en:"A field of the record must be an object."}));continue}let d=a,c=d.key;typeof c!="string"||!/^[a-z][a-zA-Z0-9_]*$/.test(c)?r.push(n(`${l}.key`,{de:`Feld-Schl\xFCssel ${JSON.stringify(c)} \u2014 erlaubt sind Buchstaben, Ziffern und _, beginnend mit einem Kleinbuchstaben.`,en:`Field key ${JSON.stringify(c)} \u2014 letters, digits and _ are allowed, starting with a lowercase letter.`})):i.has(c)?r.push(n(`${l}.key`,{de:`Feld-Schl\xFCssel "${c}" ist doppelt.`,en:`Field key "${c}" is duplicated.`})):i.add(c);let u=typeof c=="string"?`"${c}"`:`Nr. ${o+1}`,p=typeof c=="string"?`"${c}"`:`no. ${o+1}`;if(kk(d.type)||r.push(n(`${l}.type`,{de:`Feld ${u}: Typ ${JSON.stringify(d.type)} \u2014 erlaubt: ${zp.join(", ")}.`,en:`Field ${p}: type ${JSON.stringify(d.type)} \u2014 allowed: ${zp.join(", ")}.`})),OD(d.label)||r.push(n(`${l}.label`,{de:`Feld ${u} braucht ein Label in beiden Sprachen ({ de, en }).`,en:`Field ${p} needs a label in both languages ({ de, en }).`})),Mi(d.writes)||r.push(n(`${l}.writes`,{de:`Feld ${u} schreibt in keinen Vorgangs-Schl\xFCssel ('writes') \u2014 ein Wert, den niemand lesen kann, geh\xF6rt nicht in eine Erfassung.`,en:`Field ${p} writes to no process key ('writes') \u2014 a value nobody can read does not belong in a record.`})),d.type==="enum"){let y=Array.isArray(d.options)?d.options:[],b=y.map(k=>k.key);(y.length<2||b.some(k=>typeof k!="string"||k.length===0)||new Set(b).size!==b.length||y.some(k=>!OD(k.label)))&&r.push(n(`${l}.options`,{de:`Feld ${u} (Auswahl) braucht mindestens 2 Optionen mit eindeutigen Schl\xFCsseln und Labels in beiden Sprachen.`,en:`Field ${p} (choice) needs at least 2 options with unique keys and labels in both languages.`}))}else d.options!==void 0&&r.push(n(`${l}.options`,{de:`Feld ${u}: 'options' gibt es nur bei Typ 'enum'.`,en:`Field ${p}: 'options' exists only for type 'enum'.`}));if(d.min!==void 0&&(d.type!=="number"||typeof d.min!="number"||!Number.isInteger(d.min))&&r.push(n(`${l}.min`,{de:`Feld ${u}: 'min' gibt es nur bei Typ 'number', als ganze Zahl.`,en:`Field ${p}: 'min' exists only for type 'number', as a whole number.`})),d.evidence!==void 0&&typeof d.evidence!="boolean"&&r.push(n(`${l}.evidence`,{de:`Feld ${u}: 'evidence' ist true oder false.`,en:`Field ${p}: 'evidence' is true or false.`})),d.evidenceFrom!==void 0){let y=typeof d.min=="number"?d.min:0;(d.type!=="number"||d.evidence!==!0||typeof d.evidenceFrom!="number"||!Number.isInteger(d.evidenceFrom)||d.evidenceFrom<=y)&&r.push(n(`${l}.evidenceFrom`,{de:`Feld ${u}: 'evidenceFrom' gibt es nur bei Typ 'number' mit 'evidence', als ganze Zahl \xFCber dem Minimum (${y}) \u2014 sonst g\xE4lte der Nachweis immer.`,en:`Field ${p}: 'evidenceFrom' exists only for type 'number' with 'evidence', as a whole number above the minimum (${y}) \u2014 otherwise the proof would always apply.`}))}if(r.push(...J6(d,l,u,p,t)),d.suggest!==void 0){let y=d.suggest,b=typeof y=="object"&&y!==null?y.kind:void 0,k=b==="form"&&"address"in y&&Object.keys(y).length===2&&(!ke(y.address)||mt(y.address))||b==="siblingRank"&&Object.keys(y).length===1&&d.type==="number";QN(d.type)?k||r.push({field:`${l}.suggest`,code:He.recordSuggest,message:{de:`Feld ${u}: Vorschlag ${JSON.stringify(d.suggest)} \u2014 erlaubt: { kind: 'form', address: '$node.<formular>.admission.<export>' } oder { kind: 'siblingRank' } (nur bei Typ 'number'); bekannte Arten: ${bk.join(", ")}.`,en:`Field ${p}: suggestion ${JSON.stringify(d.suggest)} \u2014 allowed: { kind: 'form', address: '$node.<form>.admission.<export>' } or { kind: 'siblingRank' } (only for type 'number'); known kinds: ${bk.join(", ")}.`}}):r.push({field:`${l}.suggest`,code:He.recordSuggest,message:{de:`Feld ${u}: einen Vorschlag gibt es nur bei Typ number, boolean oder enum.`,en:`Field ${p}: a suggestion exists only for type number, boolean or enum.`}})}let h=Object.keys(d).filter(y=>!gb.includes(y));h.length>0&&r.push(n(l,{de:`Feld ${u}: unbekannte Angabe ${h.map(y=>`'${y}'`).join(", ")}; erlaubt: ${gb.join(", ")}.`,en:`Field ${p}: unknown entry ${h.map(y=>`'${y}'`).join(", ")}; allowed: ${gb.join(", ")}.`}))}return r}s(H6,"recordFieldIssues");function J6(e,t,n,r,i){let o=[],a=e.maxLength;if(a!==void 0&&(e.type!=="text"||typeof a!="number"||!Number.isInteger(a)||a<1||a>Wp)&&o.push({field:`${t}.maxLength`,code:He.recordText,message:{de:`Feld ${n}: 'maxLength' gibt es nur bei Typ 'text', als ganze Zahl von 1 bis ${Wp}.`,en:`Field ${r}: 'maxLength' exists only for type 'text', as a whole number from 1 to ${Wp}.`}}),e.multiple!==void 0&&(e.type!=="person"||typeof e.multiple!="boolean")&&o.push({field:`${t}.multiple`,code:He.recordPerson,message:{de:`Feld ${n}: 'multiple' gibt es nur bei Typ 'person', als true oder false.`,en:`Field ${r}: 'multiple' exists only for type 'person', as true or false.`}}),e.type!=="assignment")return e.tasks!==void 0&&o.push({field:`${t}.tasks`,code:He.recordAssignment,message:{de:`Feld ${n}: 'tasks' gibt es nur bei Typ 'assignment'.`,en:`Field ${r}: 'tasks' exists only for type 'assignment'.`}}),o;let l=e.tasks;if(!Array.isArray(l)||l.length===0||l.some(d=>typeof d!="string"||d.length===0)||new Set(l).size!==l.length)return o.push({field:`${t}.tasks`,code:He.recordAssignment,message:{de:`Feld ${n} (Zuordnung) braucht in 'tasks' mindestens eine Aufgabe, jede einmal.`,en:`Field ${r} (assignment) needs at least one task in 'tasks', each once.`}}),o;if(i.nodeTasks===void 0)return o;for(let d of l){let c=i.nodeTasks.get(d);c?.feedback!==!0&&o.push({field:`${t}.tasks`,code:He.recordAssignment,message:c===void 0?{de:`Feld ${n}: "${d}" ist keine Aufgabe dieses Knotens.`,en:`Field ${r}: "${d}" is no task of this node.`}:{de:`Feld ${n}: "${d}" ist keine Feedback-Aufgabe ('feedback: true') \u2014 zugeordnet wird nur, wer eine R\xFCckmeldung gibt.`,en:`Field ${r}: "${d}" is no feedback task ('feedback: true') \u2014 only a person who gives feedback is assigned.`}})}return o}s(J6,"typedFieldIssues");function Q6(e,t,n){let r=[],i=t.options;if(e==="choice"){let o=Array.isArray(i)?i:[],a=o.map(l=>l.key);(o.length<2||a.some(l=>typeof l!="string"||l.length===0)||new Set(a).size!==a.length)&&r.push({field:"result.options",code:He.choiceOptions,message:{de:`Ein Auswahl-Ergebnis braucht mindestens 2 Optionen mit eindeutigen Schl\xFCsseln, erhalten ${JSON.stringify(a)}.`,en:`A choice result needs at least 2 options with unique keys, got ${JSON.stringify(a)}.`}})}else i!==void 0&&r.push({field:"result.options",code:He.choiceOptions,message:{de:`'result.options' gibt es nur bei 'choice' \u2014 ${e==="recommendation"?"eine Empfehlung hat die festen Tendenzen Positiv/Neutral/Negativ":"ein Freitext hat keine Auswahl"}.`,en:`'result.options' exists only for 'choice' \u2014 ${e==="recommendation"?"a recommendation has the fixed leanings Positive/Neutral/Negative":"a free text has no choice"}.`}});if(e==="pricedItem"){let o=t.item;if(!Mi(o))r.push({field:"result.item",code:He.pricedItemMissingItem,message:{de:"Ein Preispositions-Ergebnis nennt den Artikel, den es bepreist \u2014 'result.item' (der Schl\xFCssel des Artikels, z. B. 'tuition') fehlt.",en:"A priced-item result names the article it prices \u2014 'result.item' (the article's key, e.g. 'tuition') is missing."}});else if(n.billingItemKeys!==void 0&&!n.billingItemKeys.has(o))r.push({field:"result.item",code:He.pricedItemUnknownItem,message:{de:`'result.item' "${o}" \u2014 kein Artikel dieses Mandanten tr\xE4gt diesen Schl\xFCssel (bekannt: ${[...n.billingItemKeys].join(", ")||"keine"}).`,en:`'result.item' "${o}" \u2014 no article of this school has this key (known: ${[...n.billingItemKeys].join(", ")||"none"}).`}});else if(n.offerProgram===null)r.push({field:"result.item",code:He.pricedItemOfferWithoutProgram,message:{de:`'result.item' "${o}" \u2014 das Angebot ist keinem Programm zugeordnet, also geh\xF6rt kein Artikel zu ihm; dem Angebot ein Programm geben.`,en:`'result.item' "${o}" \u2014 the offer is not assigned to a program, so no article belongs to it; give the offer a program.`}});else if(n.offerProgram!==void 0&&!n.offerProgram.billingItemKeys.has(o)){let l=n.offerProgram;r.push({field:"result.item",code:He.pricedItemNotInProgram,message:{de:`'result.item' "${o}" \u2014 der Artikel ist dem Programm \u201E${l.nameDe}\u201C des Angebots nicht zugeordnet (zugeordnet: ${[...l.billingItemKeys].join(", ")||"keine"}); unter Finanzen \u2192 Artikel zuordnen, direkt oder \xFCber ein Paket.`,en:`'result.item' "${o}" \u2014 the article is not assigned to the offer's program "${l.nameDe}" (assigned: ${[...l.billingItemKeys].join(", ")||"none"}); assign it under Finance \u2192 articles, directly or through a package.`}})}let a=t.label;(typeof a!="object"||a===null||!Mi(a.de)||!Mi(a.en))&&r.push({field:"result.label",code:He.labelMissing,message:{de:"Ein Preispositions-Ergebnis braucht einen Namen f\xFCr seinen Wert in beiden Sprachen ('result.label', z. B. { de: 'Schulgeld mit Erm\xE4\xDFigung', en: 'Tuition after reduction' }) \u2014 so hei\xDFt er im Workflow und in der Verdrahtung.",en:"A priced-item result needs a name for its value in both languages ('result.label', e.g. { de: 'Schulgeld mit Erm\xE4\xDFigung', en: 'Tuition after reduction' }) \u2014 that is what it is called in the workflow and in the wiring."}})}else t.item!==void 0&&r.push({field:"result.item",code:He.itemOnNonPricedItem,message:{de:`'result.item' gibt es nur bei 'pricedItem' \u2014 ein ${e}-Ergebnis bepreist keinen Artikel.`,en:`'result.item' exists only for 'pricedItem' \u2014 a ${e} result prices no article.`}});if(e==="record"?(r.push(...H6(t.fields,n)),t.writes!==void 0&&r.push({field:"result.writes",code:He.writesOnProse,message:{de:"Eine Erfassung schreibt je Feld ('fields[].writes'), nie als Ganzes ('result.writes').",en:"A record writes per field ('fields[].writes'), never as a whole ('result.writes')."}}),t.label!==void 0&&r.push({field:"result.label",code:He.unknownField,message:{de:"Eine Erfassung benennt ihre Werte je Feld ('fields[].label'), nicht als Ganzes ('result.label').",en:"A record names its values per field ('fields[].label'), not as a whole ('result.label')."}})):t.fields!==void 0&&r.push({field:"result.fields",code:He.fieldsOnNonRecord,message:{de:`'result.fields' gibt es nur bei 'record' \u2014 ein ${e}-Ergebnis hat keine Felder.`,en:`'result.fields' exists only for 'record' \u2014 a ${e} result has no fields.`}}),e==="reduction"&&(Mi(t.writes)||r.push({field:"result.writes",code:He.reductionPrices,message:{de:"Eine Reduktion schreibt ihren Betrag in einen Vorgangs-Schl\xFCssel vom Typ reduction ('result.writes') \u2014 sonst l\xE4se ihn kein Preis.",en:"A reduction writes its amount to a process key of type reduction ('result.writes') \u2014 otherwise no price would read it."}})),t.writes!==void 0&&(e==="freetext"||e==="recommendation")&&r.push({field:"result.writes",code:He.writesOnProse,message:{de:`'result.writes' gibt es nur bei Ergebnissen mit Wert (Auswahl, Preisposition) \u2014 ein ${e}-Ergebnis bleibt im Chat und schreibt nichts in den Vorgang.`,en:`'result.writes' exists only for results with a value (choice, priced item) \u2014 a ${e} result stays in the chat and writes nothing to the process.`}}),e==="freetext"&&t.textRequired!==void 0&&r.push({field:"result.textRequired",code:He.textRequiredOnFreetext,message:{de:"'textRequired' auf einem Freitext-Ergebnis \u2014 der Text eines Freitexts ist immer Pflicht; die Angabe entfernen.",en:"'textRequired' on a free-text result \u2014 the text of a free text is always required; remove the entry."}}),t.chat===void 0)r.push({field:"result.chat",code:He.chatMissing,message:{de:"Ein Aufgaben-Ergebnis steht nur im Chat \u2014 'result.chat' fehlt: 'all', 'team:<Gruppe>' oder einen Kanal des Workflows angeben.",en:"A task result appears only in the chat \u2014 'result.chat' is missing: give 'all', 'team:<group>' or a channel of the workflow."}});else{let o=t.chat,a=typeof o=="string"?ya(o):null;o==="external"||a===null?r.push({field:"result.chat",code:He.chatExternal,message:{de:`'result.chat' ${JSON.stringify(o)} \u2014 ein Aufgaben-Ergebnis bleibt intern: erlaubt sind 'all', 'team:<Gruppe>' oder ein Kanal des Workflows, nie 'external'.`,en:`'result.chat' ${JSON.stringify(o)} \u2014 a task result stays internal: 'all', 'team:<group>' or a channel of the workflow are allowed, never 'external'.`}}):a.kind==="channel"&&!n.channelKeys.has(a.channelKey)&&r.push({field:"result.chat",code:He.chatUnknownChannel,message:{de:`'result.chat' "${a.channelKey}" ist weder 'all' noch 'team:<Gruppe>' noch ein Kanal des Workflows (bekannt: ${[...n.channelKeys].join(", ")||"keine"}).`,en:`'result.chat' "${a.channelKey}" is neither 'all' nor 'team:<group>' nor a channel of the workflow (known: ${[...n.channelKeys].join(", ")||"none"}).`}})}return r.push(..._D(t,["kind","options","textRequired","chat","item","label","writes","fields","prices"],{de:"Aufgaben-Ergebnis",en:"task result"})),r}s(Q6,"recordedIssues");function ND(e,t,n={channelKeys:new Set}){if(t===void 0)return[];if(e!=="task")return[{field:"result",code:He.onApproval,message:{de:`'result' gilt nur f\xFCr die Art 'task' \u2014 eine '${e}' wird durch ihr Votum abgeschlossen, nicht durch ein Ergebnis.`,en:`'result' applies only to the kind 'task' \u2014 an '${e}' is completed by its vote, not by a result.`}}];if(typeof t!="object"||t===null||Array.isArray(t))return[{field:"result",code:He.unknownKind,message:{de:`'result' muss ein Objekt mit 'kind' sein; bekannte Arten: ${ma.join(", ")}.`,en:`'result' must be an object with 'kind'; known kinds: ${ma.join(", ")}.`}}];let r=t;return JN(r.kind)?r.kind==="appointment"?Y6(r):Q6(r.kind,r,n):[{field:"result.kind",code:He.unknownKind,message:{de:`Unbekannte Ergebnisart ${JSON.stringify(r.kind)}; bekannte Arten: ${ma.join(", ")}.`,en:`Unknown result kind ${JSON.stringify(r.kind)}; known kinds: ${ma.join(", ")}.`}}]}s(ND,"taskResultIssues");var Z6=["documentChangeRequested","documentReturned","coverLetterConfirmed","coverLetterRevisionRequested"];function PD(e){return Z6.includes(e)}s(PD,"isNonAdvancingExternalEvent");var Ma=["offer","contract"];function Nm(e){return typeof e=="string"&&Ma.includes(e)}s(Nm,"isArtifactSlotType");function CD(e){return typeof e=="object"&&e!==null&&"group"in e&&!("scope"in e)}s(CD,"isGroupPrefill");var DD="open",To="done";var X6="optionalAction:";function FD(e){return`${X6}${e}:trigger`}s(FD,"optionalActionTriggerActionId");var e3="processDecide";function LD(e){let t=e.optionalActions;return t==null?[]:(Array.isArray(t)||D(`[optionalAction/corrupt-section] node's 'optionalActions' is ${typeof t}, not an array \u2014 corrupt pinned graph (publish stores the section as authored)`),t)}s(LD,"optionalActionBindings");function MD(e){return LD(e).map(t=>({id:FD(t.key),kind:"internal",label:t.label,surface:e3,placement:"overflow",superUserOnly:!0}))}s(MD,"optionalActionTriggers");function qD(e){let t=e.tasks;return Array.isArray(t)?t:[]}s(qD,"authoredTemplates");function KD(e){let t=e?.result;return t?.kind!=="appointment"?[]:t.participants?.feedback?.tasks??[]}s(KD,"personTasksOf");function yb(e){let t=qD(e);return LD(e).map(n=>{let r=new Set(n.tasks??[]),i=new Set;for(let o of r)for(let a of KD(t.find(l=>l.key===o)))i.add(a);return{binding:n,tasks:r,personTasks:i,keys:new Set([...r,...i])}})}s(yb,"optionalActionMembership");function t3(e){let t=new Set;for(let n of qD(e))for(let r of KD(n))t.add(r);return t}s(t3,"personRowTemplateKeys");function jD(e){let t=new Set(t3(e));for(let{keys:n}of yb(e))for(let r of n)t.add(r);return t}s(jD,"referencedTaskTemplateKeys");var Fr={shape:"[taskInput/shape]",notInRound:"[taskInput/notInRound]",notRecord:"[taskInput/notRecord]",prefillNotDeclared:"[taskInput/prefillNotDeclared]",prefillType:"[taskInput/prefillType]",feedbackTasks:"[appointment/feedbackTasks]",feedbackOptional:"[appointment/feedbackOptional]",recordAssignment:"[taskResult/recordAssignment]"},wb=60;function qa(e,t,n){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:{de:`${t} ${n.de}`,en:`${t} ${n.en}`},severity:"error"}}s(qa,"error");function us(e){return Array.isArray(e.tasks)?e.tasks:[]}s(us,"tasksOf");function VD(e){return(Array.isArray(e.optionalActions)?e.optionalActions:[]).filter(n=>n.action==="spawnTasks")}s(VD,"spawnBindingsOf");function _d(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}s(_d,"stringList");function pi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}s(pi,"record");function bb(e){let t=pi(e?.result);return t?.kind==="appointment"?pi(t.participants):null}s(bb,"participantsOf");function kb(e){return _d(pi(bb(e)?.feedback)?.tasks)}s(kb,"feedbackTasksOf");function BD(e,t){return yb(e).find(n=>n.keys.has(t))}s(BD,"roundOf");function n3(e,t,n){let r=s(u=>({code:Fr.notInRound,reason:u}),"notInRound"),i=BD(e,t);if(i===void 0)return r({de:`Aufgabe "${t}" geh\xF6rt zu keiner optionalen Aktion \u2014 Vorgaben liest nur eine Aufgabe einer Runde.`,en:`Task "${t}" belongs to no optional action \u2014 only a task of a round reads inputs.`});if(n.scope!=="task"||n.path!==void 0)return r({de:`${ce(n)} ist kein Wert einer Aufgabe ($task.<aufgabe>.<schl\xFCssel>).`,en:`${ce(n)} is no value of a task ($task.<task>.<key>).`});let{binding:o}=i,a=n.owner;if(a===t)return r({de:`Aufgabe "${t}" liest ihren eigenen Wert.`,en:`Task "${t}" reads its own value.`});let l=us(e).find(u=>u.key===a),d=pi(l?.blocks),c=i.tasks.has(a)&&d?.templateKey===t&&(d.node===void 0||d.node===e.id);return a!==o.input&&!c?r({de:`"${a}" ist weder die Eingabe der Aktion "${o.key}" noch eine ihrer Aufgaben, die "${t}" per 'blocks' zur\xFCckh\xE4lt \u2014 der Wert st\xFCnde nicht fest, wenn die Aufgabe \xF6ffnet.`,en:`"${a}" is neither the input of the action "${o.key}" nor one of its tasks that holds "${t}" through 'blocks' \u2014 the value would not be settled when the task opens.`}):pi(l?.result)?.kind!=="record"?{code:Fr.notRecord,reason:{de:`"${a}" hat kein Ergebnis vom Typ 'record' \u2014 Vorgaben sind Felder einer Eingabe.`,en:`"${a}" has no result of kind 'record' \u2014 inputs are fields of an input task.`}}:null}s(n3,"taskInputRefusal");function r3(e,t){if(t.scope!=="task")return;let n=us(e).find(i=>i.key===t.owner),r=pi(n?.result);if(r?.kind==="record")return(Array.isArray(r.fields)?r.fields:[]).map(pi).find(i=>i?.writes===t.key)??void 0}s(r3,"writerField");function i3(e,t,n){let r=String(t.key);if(t.inputs===void 0)return[];if(!Array.isArray(t.inputs))return[qa(`${n}.inputs`,Fr.shape,{de:"'inputs' ist eine Liste von Adressen.",en:"'inputs' is a list of addresses."})];let i=[],o=new Set;for(let[a,l]of t.inputs.entries()){if(!ke(l))continue;let d=ce(l);if(o.has(d)){i.push(qa(`${n}.inputs.${a}`,Fr.shape,{de:`${d} steht zweimal in 'inputs'.`,en:`${d} is listed twice in 'inputs'.`}));continue}o.add(d);let c=n3(e,r,l);c!==null&&i.push(qa(`${n}.inputs.${a}`,c.code,c.reason))}return i}s(i3,"inputIssues");function o3(e,t,n,r){let i=n;if(CD(r))return kb(i).length===1?null:{code:Fr.prefillType,reason:{de:"Ein Team belegt nur vor, wenn 'feedback.tasks' genau eine Feedback-Art nennt \u2014 sonst w\xE4re offen, wer welche Art gibt.",en:"A team prefills only when 'feedback.tasks' names exactly one feedback kind \u2014 otherwise who gives which kind would be open."}};let o=Array.isArray(i.inputs)?i.inputs.filter(ke).map(ce):[];if(!ke(r)||!o.includes(ce(r)))return{code:Fr.prefillNotDeclared,reason:{de:"Die Vorbelegung der Teilnehmenden ist keine der Vorgaben ('inputs') der Aufgabe.",en:"The participants' prefill is none of the task's inputs ('inputs')."}};let a=s(c=>({code:Fr.prefillType,reason:c}),"prefillType"),l=kb(i),d=gd(e,r);if(d===void 0)return null;if(gn(d)==="staffUser")return l.length===1?null:a({de:"Eine Personenliste belegt nur vor, wenn 'feedback.tasks' genau eine Feedback-Art nennt \u2014 sonst w\xE4re offen, wer welche Art gibt.",en:"A list of persons prefills only when 'feedback.tasks' names exactly one feedback kind \u2014 otherwise who gives which kind would be open."});if(d==="taskAssignment"){let u=_d(r3(t,r)?.tasks).filter(p=>!l.includes(p));return u.length===0?null:a({de:`Die Zuordnung ordnet ${u.map(p=>`"${p}"`).join(", ")} zu, die 'feedback.tasks' nicht nennt.`,en:`The assignment assigns ${u.map(p=>`"${p}"`).join(", ")}, which 'feedback.tasks' does not name.`})}return a({de:`Vorbelegt werden Teilnehmende nur aus Personen ('person') oder einer Zuordnung ('assignment'), nicht aus "${d}".`,en:`Participants are prefilled only from persons ('person') or an assignment ('assignment'), not from "${d}".`})}s(o3,"participantPrefillRefusal");function s3(e,t,n,r){let i=bb(n)?.prefill;if(i===void 0)return[];let o=o3(e,t,n,i);return o===null?[]:[qa(`${r}.result.participants.prefill`,o.code,o.reason)]}s(s3,"prefillIssues");function a3(e,t){return VD(e).some(n=>_d(n.tasks).includes(t))}s(a3,"belongsToOptionalAction");function l3(e,t,n){let r=t.key,i=us(e).find(c=>c.key===n),o=s(c=>({code:Fr.feedbackTasks,reason:c}),"feedbackTasks");if(i===void 0)return[o({de:`"${n}" ist keine Aufgabe dieses Knotens.`,en:`"${n}" is no task of this node.`})];let a=[];i.feedback!==!0&&a.push(o({de:`"${n}" ist keine Feedback-Aufgabe ('feedback: true').`,en:`"${n}" is no feedback task ('feedback: true').`})),VD(e).some(c=>_d(c.tasks).includes(n))&&a.push(o({de:`"${n}" steht in den Aufgaben einer optionalen Aktion \u2014 eine Personenzeile entsteht nur beim Buchen.`,en:`"${n}" is among an optional action's tasks \u2014 a person row exists only through a booking.`}));let l=us(e).find(c=>c.key!==r&&kb(c).includes(n));l!==void 0&&a.push(o({de:`"${n}" wird auch von "${String(l.key)}" angelegt \u2014 jede Feedback-Art geh\xF6rt zu genau einem Termin.`,en:`"${n}" is also created by "${String(l.key)}" \u2014 each feedback kind belongs to exactly one appointment.`}));let d=["when","blocks"].filter(c=>i[c]!==void 0);return d.length>0&&a.push(o({de:`"${n}" tr\xE4gt ${d.map(c=>`'${c}'`).join(", ")} \u2014 eine Personenzeile entsteht nur beim Buchen und h\xE4lt nur ihre Runde.`,en:`"${n}" carries ${d.map(c=>`'${c}'`).join(", ")} \u2014 a person row exists only through a booking and holds only its round.`})),i.optional!==void 0&&a.push({code:Fr.feedbackOptional,reason:{de:`"${n}" ist optional \u2014 eine Personenzeile h\xE4lt ihre Runde und damit die Pause, sie kann nicht \xFCbersprungen werden.`,en:`"${n}" is optional \u2014 a person row holds its round and with it the pause; it cannot be skipped.`}}),a}s(l3,"participantFeedbackRefusals");function d3(e,t,n){let r=bb(t);if(r===null||r.feedback===void 0)return[];let i=String(t.key),o=`${n}.result.participants.feedback`,a=pi(r.feedback),l=a?.tasks,d=[],c=s((p,h,y=Fr.feedbackTasks)=>d.push(qa(p,y,h)),"fail");if(!Array.isArray(l)||l.length===0||l.some(p=>typeof p!="string")||new Set(l).size!==l.length)return c(`${o}.tasks`,{de:"'feedback.tasks' nennt mindestens eine Feedback-Aufgabe, jede einmal.",en:"'feedback.tasks' names at least one feedback task, each once."}),d;let u=a?.dueDaysAfterEnd;(typeof u!="number"||!Number.isInteger(u)||u<0||u>wb)&&c(`${o}.dueDaysAfterEnd`,{de:`'feedback.dueDaysAfterEnd' ist eine ganze Zahl von 0 bis ${wb}.`,en:`'feedback.dueDaysAfterEnd' is a whole number from 0 to ${wb}.`}),a3(e,i)||c(o,{de:`Aufgabe "${i}" legt Personenzeilen an, geh\xF6rt aber zu keiner optionalen Aktion \u2014 Personenzeilen geh\xF6ren zur Runde einer Aktion.`,en:`Task "${i}" creates person rows but belongs to no optional action \u2014 person rows belong to an action's round.`});for(let p of l)for(let h of l3(e,t,p))c(`${o}.tasks`,h.reason,h.code);return d}s(d3,"feedbackIssues");function c3(e,t){let n=BD(e,t)?.personTasks??new Set;return us(e).filter(r=>r.feedback===!0&&typeof r.key=="string"&&n.has(r.key)).map(r=>r.key)}s(c3,"assignableFeedbackTasks");function u3(e,t,n){let r=pi(t.result);if(r?.kind!=="record"||!Array.isArray(r.fields))return[];let i=c3(e,String(t.key)),o=new Map(us(e).map(l=>[l.key,l])),a=[];for(let[l,d]of r.fields.entries()){let c=pi(d);if(c?.type!=="assignment")continue;let u=_d(c.tasks).filter(p=>o.get(p)?.feedback===!0&&!i.includes(p));u.length!==0&&a.push(qa(`${n}.result.fields.${l}.tasks`,Fr.recordAssignment,{de:`Feld "${String(c.key)}": ${u.map(p=>`"${p}"`).join(", ")} legt kein Termin derselben optionalen Aktion an ('participants.feedback.tasks') \u2014 die Zuordnung h\xE4tte keine Zeile, die sie erh\xE4lt.`,en:`Field "${String(c.key)}": ${u.map(p=>`"${p}"`).join(", ")} is created by no appointment of the same optional action ('participants.feedback.tasks') \u2014 the assignment would have no row to receive it.`}))}return a}s(u3,"assignmentIssues");function UD(e,t){let n=[];for(let r of us(t)){if(typeof r.key!="string")continue;let i=`nodes.${t.id}.tasks.${r.key}`;n.push(...i3(t,r,i)),n.push(...s3(e,t,r,i)),n.push(...d3(t,r,i)),n.push(...u3(t,r,i))}return n}s(UD,"taskInputIssues");function mi(e){return e.nodes.map(t=>t)}s(mi,"rawNodesOf");var Ln={notOptionalAction:"[workItems/familyRequestNotOptionalAction]",notTask:"[workItems/familyRequestNotTask]",closedOtherwise:"[workItems/familyRequestClosedOtherwise]",blocks:"[workItems/familyRequestBlocks]",noDeadline:"[workItems/familyRequestNoDeadline]",fields:"[workItems/familyRequestFields]",unknownField:"[workItems/familyRequestUnknownField]",shape:"[workItems/familyRequestShape]",twicePerAction:"[workItems/familyRequestTwicePerAction]",deadlock:"[workItems/familyRequestOnlyWayButAsked]"};function Mn(e,t,n){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:{de:`${t} ${n.de}`,en:`${t} ${n.en}`},severity:"error"}}s(Mn,"issue");function f3(e,t,n){return e.flatMap(r=>(Array.isArray(r.tasks)?r.tasks:[]).filter(i=>{let o=i.blocks,a=typeof o?.node=="string"?o.node:r.id;return o?.templateKey===n&&a===t}).map(i=>({nodeId:r.id,key:String(i.key)})))}s(f3,"blockersOf");function GD(e){let{graph:t,node:n,task:r}=e,i=r.familyRequest;if(i===void 0)return[];let o=typeof r.key=="string"?r.key:"?",a=`nodes.${n.id}.tasks.${o}`,l={de:`Task "${o}" auf Knoten \u201E${Pe(t,n.id,"de")}\u201C (${n.id})`,en:`Task "${o}" on node "${Pe(t,n.id,"en")}" (${n.id})`},d=[];if(typeof i!="object"||i===null||Array.isArray(i))return[Mn(`${a}.familyRequest`,Ln.shape,{de:`${l.de}: 'familyRequest' muss ein Objekt { fields } oder { from } sein.`,en:`${l.en}: 'familyRequest' must be an object { fields } or { from }.`})];let c=Object.keys(i).filter(b=>b!=="fields"&&b!=="from");c.length>0&&d.push(Mn(`${a}.familyRequest.${c[0]}`,Ln.shape,{de:`${l.de}: 'familyRequest' kennt nur 'fields' oder 'from', nicht ${c.map(b=>`'${b}'`).join(", ")} \u2014 was angefordert wird und der Text an die Familie werden beim Ausl\xF6sen gew\xE4hlt.`,en:`${l.en}: 'familyRequest' only knows 'fields' or 'from', not ${c.map(b=>`'${b}'`).join(", ")} \u2014 what is requested and the text to the family are chosen when the action is triggered.`}));let{fields:u,from:p}=i;u===void 0==(p===void 0)&&d.push(Mn(`${a}.familyRequest`,Ln.shape,{de:`${l.de}: 'familyRequest' nennt genau eines \u2014 'fields' (die anforderbaren Felder) oder 'from' (das Formular, dessen Dateifelder alle zur Wahl stehen).`,en:`${l.en}: 'familyRequest' names exactly one \u2014 'fields' (the fields that can be requested) or 'from' (the form whose file fields are all available).`})),e.onTrigger.has(o)||d.push(Mn(`${a}.familyRequest`,Ln.notOptionalAction,{de:`${l.de} fordert bei der Familie an, geh\xF6rt aber zu keiner optionalen Aktion (spawnTasks) \u2014 nur deren Ausl\xF6sen \xF6ffnet die Anfrage an die Familie.`,en:`${l.en} requests from the family but belongs to no optional action (spawnTasks) \u2014 only triggering one opens the request to the family.`})),r.kind!=="task"&&d.push(Mn(`${a}.kind`,Ln.notTask,{de:`${l.de} fordert bei der Familie an und muss die Art 'task' haben, nicht ${JSON.stringify(r.kind)}.`,en:`${l.en} requests from the family and must have the kind 'task', not ${JSON.stringify(r.kind)}.`}));for(let b of["result","when","locksEvidence","gatesNode"])r[b]!==void 0&&d.push(Mn(`${a}.${b}`,Ln.closedOtherwise,{de:`${l.de} wartet auf die Familie und erledigt sich mit ihrer Antwort \u2014 '${b}' passt nicht dazu.`,en:`${l.en} waits for the family and completes with their answer \u2014 '${b}' does not fit that.`}));r.blocks!==void 0&&d.push(Mn(`${a}.blocks`,Ln.blocks,{de:`${l.de} wartet auf die Familie und darf nichts zur\xFCckhalten ('blocks') \u2014 sie h\xE4lt ihren Knoten schon als Aufgabe einer optionalen Aktion.`,en:`${l.en} waits for the family and must not hold anything back ('blocks') \u2014 as the task of an optional action it already holds its node.`}));for(let b of f3(mi(t),n.id,o))d.push(Mn(`nodes.${b.nodeId}.tasks.${b.key}.blocks`,Ln.blocks,{de:`Task "${b.key}" auf Knoten "${b.nodeId}" h\xE4lt ${l.de} zur\xFCck \u2014 eine Nachforderung darf nie zur\xFCckgehalten werden: zur\xFCckgehalten h\xE4tte sie keine Frist und k\xF6nnte mit der Antwort der Familie nicht erledigt werden.`,en:`Task "${b.key}" on node "${b.nodeId}" holds back ${l.en} \u2014 a follow-up request must never be held back: held back, it would have no deadline and could not be completed by the family's answer.`}));let h=r.params?.dueInDays;if((typeof h!="number"||!Number.isInteger(h)||h<1)&&d.push(Mn(`${a}.params.dueInDays`,Ln.noDeadline,{de:`${l.de} fordert bei der Familie an und braucht eine Frist in ganzen Tagen ('params.dueInDays' \u2265 1) \u2014 sie ist die Frist der Familie und Anlass der Erinnerung.`,en:`${l.en} requests from the family and needs a deadline in whole days ('params.dueInDays' \u2265 1) \u2014 it is the family's deadline and the reason for the reminder.`})),u===void 0)return d;if(!Array.isArray(u)||u.length===0)return d.push(Mn(`${a}.familyRequest.fields`,Ln.fields,{de:`${l.de}: 'familyRequest.fields' muss mindestens ein Feld eines Formulars nennen \u2014 oder statt dessen 'from' das Formular, dann stehen alle seine Dateifelder zur Wahl.`,en:`${l.en}: 'familyRequest.fields' must name at least one field of a form \u2014 or 'from' the form instead, then all its file fields are available.`})),d;let y=new Set;for(let b of u){if(!ke(b))continue;let k=ce(b);if(y.has(k)){d.push(Mn(`${a}.familyRequest.fields`,Ln.fields,{de:`${l.de}: 'familyRequest.fields' nennt ${Ge(t,b,"de")} mehrfach.`,en:`${l.en}: 'familyRequest.fields' names ${Ge(t,b,"en")} more than once.`}));continue}y.add(k),mt(b)||d.push(Mn(`${a}.familyRequest.fields`,Ln.unknownField,{de:`${l.de}: 'familyRequest.fields' nennt ${Ge(t,b,"de")} \u2014 anfordern l\xE4sst sich nur ein Feld eines Formulars ($node.<formular>.admission.<feld>).`,en:`${l.en}: 'familyRequest.fields' names ${Ge(t,b,"en")} \u2014 only a field of a form ($node.<form>.admission.<field>) can be requested.`}))}return d}s(GD,"familyRequestIssues");function zD(e){let t=new Set((Array.isArray(e.tasks)?e.tasks:[]).flatMap(r=>r.familyRequest!==void 0&&typeof r.key=="string"?[r.key]:[]));return(Array.isArray(e.optionalActions)?e.optionalActions:[]).flatMap((r,i)=>{if(r.action!=="spawnTasks"||!Array.isArray(r.tasks))return[];let o=r.tasks.filter(a=>typeof a=="string"&&t.has(a));return o.length<=1?[]:[Mn(`nodes.${e.id}.optionalActions.${i}.tasks`,Ln.twicePerAction,{de:`Optionale Aktion \u201E${String(r.key)}\u201C auf Knoten "${e.id}" startet ${o.length} Nachforderungen (${o.join(", ")}) \u2014 ein Ausl\xF6sen fragt die Familie nach EINER Sache; h\xF6chstens eine Nachforderung je Aktion.`,en:`Optional action "${String(r.key)}" on node "${e.id}" starts ${o.length} follow-up requests (${o.join(", ")}) \u2014 one trigger asks the family for ONE thing; at most one follow-up request per action.`})]})}s(zD,"familyRequestActionIssues");function WD(e,t){let n=mi(e),r=new Map;for(let a of n)if(!(a.type!=="completenessCheck"||!Array.isArray(a.requires)))for(let l of a.requires)mt(l)&&r.set(ce(l),l);if(r.size===0)return[];let i=s(a=>{let l=ui(t,a);return l===void 0||l!==null&&l.kind==="entered"&&l.type==="docRef"},"isFileField"),o=s(a=>{let{fields:l,from:d}=a??{};return Array.isArray(l)?l.filter(mt):!ke(d)||d.scope!=="node"?[]:[...r.values()].filter(c=>c.owner===d.owner&&i(c))},"offeredBy");return n.flatMap(a=>{let l=Array.isArray(a.requiresOneOf)?a.requiresOneOf:[],c=(Array.isArray(a.optionalActions)?a.optionalActions:[]).filter(h=>l.includes(h.key)),u=Array.isArray(a.tasks)?a.tasks:[];return c.filter(h=>Array.isArray(h.tasks)&&c.every(y=>y===h||y.when!==void 0)).flatMap(h=>u.flatMap(y=>{if(y.familyRequest===void 0||!h.tasks.includes(y.key))return[];let b=o(y.familyRequest).filter(k=>r.has(ce(k)));return b.length===0?[]:[{...Mn(`nodes.${a.id}.requiresOneOf`,Ln.deadlock,{de:`Auf Knoten \u201E${Pe(e,a.id,"de")}\u201C (${a.id}) ist die Nachforderung \u201E${String(h.key)}\u201C der einzige Weg durch 'requiresOneOf', und eine Vollst\xE4ndigkeitspr\xFCfung fragt dieselben Felder an (${b.map(k=>Ge(e,k,"de")).join(", ")}). Ist deren Anfrage offen, lassen sich diese Felder nicht nachfordern \u2014 die Entscheidung bliebe gesperrt. Eine zweite Aktion in 'requiresOneOf' oder andere Felder l\xF6sen das.`,en:`On node "${Pe(e,a.id,"en")}" (${a.id}) the follow-up request "${String(h.key)}" is the only way through 'requiresOneOf', and a completeness check asks for the same fields (${b.map(k=>Ge(e,k,"en")).join(", ")}). While its request is open, these fields cannot be requested \u2014 the decision would stay locked. A second action in 'requiresOneOf' or other fields solve this.`}),severity:"warning"}]}))})}s(WD,"familyRequestDeadlockWarnings");var vb={key:!0,kind:!0,title:!0,assign:!0,gatesNode:!0,blocks:!0,completableIf:!0,result:!0,when:!0,onConditionReturn:!0,reads:!0,locksEvidence:!0,feedback:!0,description:!0,documents:!0,view:!0,familyRequest:!0,optional:!0,inputs:!0,params:!0},xb={appointment:s((e,t)=>({de:`Aufgabe "${e}" an ${t.de}: \`appointment\` (Terminaufgabe) gibt es nicht mehr \u2014 ein Termin hat keine Leitung, die sie hielte. Was die Teilnehmenden nach dem Termin festhalten, ist je Person eine R\xFCckmeldung (\`result.participants.feedback\` der Terminvereinbarung).`,en:`Task "${e}" on ${t.en}: \`appointment\` (appointment task) no longer exists \u2014 an appointment has no lead to hold it. What the participants record after the appointment is one feedback per person (\`result.participants.feedback\` of the booking task).`}),"appointment")};function p3(e){let t=Ue(e);return new Map((typeof t.workItemTemplates=="function"?t.workItemTemplates(e):[]).map(n=>[n.key,n]))}s(p3,"intrinsicTemplatesOf");function YD(e,t,n){if(n!==void 0&&typeof n!="string")return null;let r=n??t,i=e.nodes.find(l=>l.id===r);if(i===void 0)return null;let o=i,a=Ue(i);return{node:o,composedKeys:new Set((Array.isArray(o.tasks)?o.tasks:[]).map(l=>l.key).filter(l=>typeof l=="string")),intrinsicByKey:p3(i),refuse:s(l=>typeof a.refuseBlocksTarget=="function"?a.refuseBlocksTarget(i,l):null,"refuse")}}s(YD,"resolveBlocksTargetNode");function m3(e){let t=new Map;for(let r of Dn(e.nodes)){let i=t.get(r.source)??[];i.push(r.target),t.set(r.source,i)}let n=new Map;return r=>{let i=n.get(r);if(i!==void 0)return i;let o=new Set,a=[...t.get(r)??[]];for(;a.length>0;){let l=a.shift();o.has(l)||(o.add(l),a.push(...t.get(l)??[]))}return n.set(r,o),o}}s(m3,"reachability");function HD(e){let t=[],n=new Map;for(let o of e.nodes){let a=o;for(let l of Array.isArray(a.tasks)?a.tasks:[]){let d=typeof l.key=="string"?l.key:void 0,c=l.blocks;if(d===void 0||typeof c?.templateKey!="string")continue;let u=typeof c.node=="string"?c.node:o.id;n.set(`${o.id}::${d}`,`${u}::${c.templateKey}`)}}let r=new Map,i=s((o,a)=>{if(r.get(o)==="done")return;if(r.get(o)==="visiting"){let d=[...a.slice(a.indexOf(o)),o],[c,u]=o.split("::");t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${c}.tasks.${u}.blocks`,reason:{de:`[workItems/blocksCycle] Zyklus im 'blocks'-Graphen: ${d.map(p=>`"${p.replace("::"," \xB7 ")}"`).join(" \u2192 ")} \u2014 jedes Mitglied w\xFCrde auf ein anderes warten, keines w\xFCrde je frei.`,en:`[workItems/blocksCycle] Cycle in the 'blocks' graph: ${d.map(p=>`"${p.replace("::"," \xB7 ")}"`).join(" \u2192 ")} \u2014 every member would wait for another, none would ever be released.`},severity:"error"});return}r.set(o,"visiting");let l=n.get(o);l!==void 0&&n.has(l)&&i(l,[...a,o]),r.set(o,"done")},"walk");for(let o of n.keys())i(o,[]);return t}s(HD,"checkBlocksCycles");function h3(e){let{requiresOneOf:t,optionalActions:n}=e;if(!Array.isArray(t)||!Array.isArray(n))return new Set;let r=new Set(t.filter(o=>typeof o=="string")),i=new Set;for(let o of n)if(!(typeof o.key!="string"||!r.has(o.key)||!Array.isArray(o.tasks)))for(let a of o.tasks)typeof a=="string"&&i.add(a);return i}s(h3,"tasksOfRequiresOneOf");function JD(e){if(typeof e!="object"||e===null)return!1;let{de:t,en:n}=e;return typeof t=="string"&&t.trim().length>0&&typeof n=="string"&&n.trim().length>0}s(JD,"isFilledBilingual");var g3=["blocks","gatesNode","locksEvidence","completableIf"];function y3(e,t){let n={de:`Task "${t.key}" (Knoten "${t.nodeId}")`,en:`Task "${t.key}" (node "${t.nodeId}")`},r=[];e.feedback!==!0&&r.push(Nt(`${t.base}.feedback`,{de:`[workItems/feedbackNotTrue] ${n.de}: 'feedback' kennt nur true; erhalten ${JSON.stringify(e.feedback)}.`,en:`[workItems/feedbackNotTrue] ${n.en}: 'feedback' only knows true; got ${JSON.stringify(e.feedback)}.`}));let i=e.result;if(e.kind!=="task"||typeof i?.kind!="string"||!vk({kind:i.kind,writes:i.writes})){let a=e.kind==="task"&&i?.writes!==void 0,l={de:e.kind!=="task"?`kind ${String(e.kind)}`:`Ergebnis ${String(i?.kind)}${a?" mit writes":""}`,en:e.kind!=="task"?`kind ${String(e.kind)}`:`result ${String(i?.kind)}${a?" with writes":""}`};r.push(Nt(`${t.base}.feedback`,{de:`[workItems/feedbackNeedsProse] ${n.de} ist eine Feedback-Aufgabe und schlie\xDFt daher mit Freitext, einer Empfehlung oder einer Auswahl ohne 'writes' \u2014 ein Wert, den ein sp\xE4terer Schritt liest, k\xE4me von einem wom\xF6glich weitergeleiteten Link; erhalten ${l.de}.`,en:`[workItems/feedbackNeedsProse] ${n.en} is a feedback task, so it closes with free text, a recommendation or a choice without 'writes' \u2014 a value a later step reads would come from a link that may have been forwarded; got ${l.en}.`}))}let o=["blocks","gatesNode","completableIf","locksEvidence","familyRequest"].filter(a=>e[a]!==void 0);return o.length>0&&r.push(Nt(`${t.base}.feedback`,{de:`[workItems/feedbackSteersProcess] ${n.de} ist eine Feedback-Aufgabe; die Antwort kommt von einer Seite ohne weitere Daten und darf deshalb nicht von ${o.join(", ")} abh\xE4ngen.`,en:`[workItems/feedbackSteersProcess] ${n.en} is a feedback task; its answer comes from a page without application data, so it may not depend on ${o.join(", ")}.`})),r}s(y3,"feedbackTaskIssues");function w3(e,t){let n=[],r={de:`Task "${t.key}" (Knoten "${t.nodeId}")`,en:`Task "${t.key}" (node "${t.nodeId}")`},i=e.optional;(!(typeof i=="object"&&i!==null&&Object.keys(i).every(d=>d==="skipLabel"))||!JD(i.skipLabel))&&n.push(Nt(`${t.base}.optional.skipLabel`,{de:`[workItems/optionalSkipLabel] ${r.de} ist optional, braucht daf\xFCr '{ skipLabel: { de, en } }' \u2014 die Worte des Knopfs, mit dem die zust\xE4ndige Person ohne Ergebnis abschlie\xDFt (\u201EKeine Einsch\xE4tzung abgeben"); erhalten ${JSON.stringify(i)}.`,en:`[workItems/optionalSkipLabel] ${r.en} is optional and needs '{ skipLabel: { de, en } }' for that \u2014 the words of the button the responsible person uses to finish without a result ("Give no assessment"); got ${JSON.stringify(i)}.`})),e.kind!=="task"&&n.push(Nt(`${t.base}.optional`,{de:`[workItems/optionalOnApproval] ${r.de} ist eine Freigabe \u2014 optional ist nur eine Aufgabe; eine Freigabe schlie\xDFt mit ihrem Urteil.`,en:`[workItems/optionalOnApproval] ${r.en} is an approval \u2014 only a task can be optional; an approval ends with its verdict.`}));let a=e.result;(a===void 0||typeof a.kind!="string"||!vk({kind:a.kind,writes:a.writes}))&&n.push(Nt(`${t.base}.optional`,{de:`[workItems/optionalNeedsProseResult] ${r.de} ist optional, schlie\xDFt aber ${a===void 0?"ohne Ergebnis":`mit einem ${String(a.kind)}-Ergebnis${a.writes!==void 0?" mit Wert":""}`} \u2014 optional ist nur eine Aufgabe mit Freitext, Empfehlung oder einer Auswahl ohne 'writes': einen Wert, den ein sp\xE4terer Schritt liest, g\xE4be es dann nie.`,en:`[workItems/optionalNeedsProseResult] ${r.en} is optional but ends ${a===void 0?"without a result":`with a ${String(a.kind)} result${a.writes!==void 0?" with a value":""}`} \u2014 only a task with free text, a recommendation or a choice without 'writes' can be optional: a value a later step reads would then never arrive.`}));let l=g3.filter(d=>e[d]!==void 0);return l.length>0&&n.push(Nt(`${t.base}.${l[0]}`,{de:`[workItems/optionalHolds] ${r.de} ist optional und tr\xE4gt ${l.map(d=>`'${d}'`).join(", ")} \u2014 auf eine optionale Aufgabe wartet nichts: sie h\xE4lt keinen Schritt zur\xFCck. Entweder optional oder zur\xFCckhaltend.`,en:`[workItems/optionalHolds] ${r.en} is optional and carries ${l.map(d=>`'${d}'`).join(", ")} \u2014 nothing waits for an optional task: it holds no step back. Either optional or holding back.`})),t.requiredByRule&&n.push(Nt(`${t.base}.optional`,{de:`[workItems/optionalInRequiresOneOf] ${r.de} ist optional, geh\xF6rt aber zu einer Aktion, die 'requiresOneOf' verlangt \u2014 \u201EKeine Einsch\xE4tzung abgeben" w\xFCrde die Regel erf\xFCllen, ohne dass etwas geschehen ist.`,en:`[workItems/optionalInRequiresOneOf] ${r.en} is optional but belongs to an action that 'requiresOneOf' requires \u2014 "Give no assessment" would satisfy the rule without anything having happened.`})),n}s(w3,"optionalTaskIssues");function Nt(e,t){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:t,severity:"error"}}s(Nt,"issue");function QD(e,t){let n=[],r=m3(e),i=new Set(Fa(e).map(o=>o.key));n.push(...WD(e,t));for(let o of e.nodes){let a=o,l=jD(o);n.push(...zD(o));let d=h3(a);n.push(...UD(e,a));let c=new Map((Array.isArray(a.tasks)?a.tasks:[]).filter(u=>typeof u.key=="string").map(u=>[u.key,{feedback:u.feedback===!0}]));for(let u of Array.isArray(a.tasks)?a.tasks:[]){let p=typeof u.key=="string"?u.key:"?",h=`nodes.${o.id}.tasks.${p}`,y=u.kind,b=u.result,k=u.blocks,v=typeof k?.node=="string"&&k.node!==o.id?k.node:void 0;if(typeof k?.templateKey=="string"){let A=typeof k.node=="string"?k.node:o.id,x=mi(e).find(se=>se.id===A),V=(Array.isArray(x?.tasks)?x.tasks:[]).find(se=>se.key===k.templateKey)?.blocks;typeof V?.node=="string"&&V.node!==A&&n.push(Nt(`${h}.blocks.templateKey`,{de:`[workItems/blocksCrossNodeTask] Task "${p}" auf Knoten "${o.id}" h\xE4lt "${k.templateKey}" auf Knoten "${A}" zur\xFCck \u2014 das ist selbst eine knoten\xFCbergreifende Aufgabe, die ihren Knoten \xFCberlebt; zur\xFCckgehalten k\xF6nnte sie nach dessen Verlassen weder bearbeitet noch freigegeben werden. Nur Aufgaben, die an ihrem Knoten bleiben, und intrinsische Vorlagen sind Ziele.`,en:`[workItems/blocksCrossNodeTask] Task "${p}" on node "${o.id}" holds back "${k.templateKey}" on node "${A}" \u2014 that is itself a cross-node task that outlives its node; held back, it could be neither worked nor released after the node is left. Only tasks that stay on their node and intrinsic templates are targets.`}))}if(v!==void 0){let A=v;e.nodes.some(x=>x.id===A)&&!r(o.id).has(A)&&n.push(Nt(`${h}.blocks.node`,{de:`[workItems/blocksTargetNotAfter] Task "${p}" auf Knoten "${o.id}" blockiert Knoten "${A}", der von hier aus nicht erreichbar ist \u2014 die Aufgabe entst\xFCnde erst, wenn ihr Ziel schon hinter dem Prozess liegt. Ziel ist derselbe Knoten oder ein sp\xE4terer.`,en:`[workItems/blocksTargetNotAfter] Task "${p}" on node "${o.id}" blocks node "${A}", which cannot be reached from here \u2014 the task would only be created when its target is already behind the process. The target is the same node or a later one.`})),(b===void 0||!ha(b.kind))&&n.push(Nt(`${h}.blocks.node`,{de:`[workItems/crossNodeBlocksNeedsResult] Task "${p}" auf Knoten "${o.id}" blockiert einen anderen Knoten ("${A}"), hat aber kein 'result' \u2014 eine knoten\xFCbergreifende Aufgabe \xFCberlebt ihren Knoten und wird \xFCber ihr Ergebnis abgeschlossen (Freitext, Empfehlung oder Auswahl).`,en:`[workItems/crossNodeBlocksNeedsResult] Task "${p}" on node "${o.id}" blocks another node ("${A}") but has no 'result' \u2014 a cross-node task outlives its node and is completed through its result (free text, recommendation or choice).`})),l.has(p)&&n.push(Nt(`${h}.blocks.node`,{de:`[optionalAction/crossNodeBlocks] Task "${p}" geh\xF6rt zu einer optionalen Aktion (spawnTasks) auf Knoten "${o.id}" und darf keinen anderen Knoten blockieren \u2014 ihre Zeilen sind die Runde der Aktion.`,en:`[optionalAction/crossNodeBlocks] Task "${p}" belongs to an optional action (spawnTasks) on node "${o.id}" and must not block another node \u2014 its rows are the round of the action.`}))}for(let A of ND(String(y),b,{channelKeys:i,nodeTasks:c,...t?.billingItemKeys!==void 0?{billingItemKeys:t.billingItemKeys}:{},...t?.offerProgram!==void 0?{offerProgram:t.offerProgram}:{}}))n.push(Nt(`${h}.${A.field}`,{de:`${A.code} ${A.message.de} (Task "${p}" auf Knoten "${o.id}").`,en:`${A.code} ${A.message.en} (task "${p}" on node "${o.id}").`}));let T=u.when,$=s((A,x,q)=>{!ke(x)||mt(x)||n.push(Nt(A,{de:`[workItems/evidenceNotFormField] ${q} auf Task "${p}" (Knoten "${o.id}") nennt ${Ge(e,x,"de")} \u2014 Bedingung und Belege einer Aufgabe sind Felder eines Formulars ($node.<formular>.admission.<feld>).`,en:`[workItems/evidenceNotFormField] ${q} on task "${p}" (node "${o.id}") names ${Ge(e,x,"en")} \u2014 the condition and evidence of a task are fields of a form ($node.<form>.admission.<field>).`}))},"notFormField");T!==void 0?($(`${h}.when`,T,"'when'"),u.onConditionReturn!=="respawn"&&u.onConditionReturn!=="stayClosed"&&n.push(Nt(`${h}.onConditionReturn`,{de:`[workItems/whenNeedsOnConditionReturn] Task "${p}" (Knoten "${o.id}") hat eine Bedingung, aber kein 'onConditionReturn' ('respawn' | 'stayClosed') \u2014 was bei der R\xFCckkehr der Bedingung geschieht, muss entschieden sein.`,en:`[workItems/whenNeedsOnConditionReturn] Task "${p}" (node "${o.id}") has a condition but no 'onConditionReturn' ('respawn' | 'stayClosed') \u2014 what happens when the condition returns must be decided.`}))):u.onConditionReturn!==void 0&&n.push(Nt(`${h}.onConditionReturn`,{de:`[workItems/whenNeedsOnConditionReturn] 'onConditionReturn' ohne 'when' auf Task "${p}" (Knoten "${o.id}") \u2014 ohne Bedingung kehrt nichts zur\xFCck.`,en:`[workItems/whenNeedsOnConditionReturn] 'onConditionReturn' without 'when' on task "${p}" (node "${o.id}") \u2014 without a condition nothing returns.`}));let I=u.reads;if(I!==void 0)if(!Array.isArray(I))n.push(Nt(`${h}.reads`,{de:`[workItems/readsUnknownField] 'reads' auf Task "${p}" (Knoten "${o.id}") muss eine Liste von Feldadressen sein.`,en:`[workItems/readsUnknownField] 'reads' on task "${p}" (node "${o.id}") must be a list of field addresses.`}));else for(let[A,x]of I.entries())$(`${h}.reads.${A}`,x,"'reads'");let C=u.locksEvidence,F=s((A,x)=>n.push(Nt(`${h}.locksEvidence`,{de:`[workItems/${A}] Task "${p}" (Knoten "${o.id}") ${x.de}`,en:`[workItems/${A}] Task "${p}" (node "${o.id}") ${x.en}`})),"lockIssue");C!==void 0&&C!==!0&&F("locksEvidenceNotTrue",{de:`tr\xE4gt 'locksEvidence' ${JSON.stringify(C)} \u2014 nur 'true' ist erlaubt; ohne Sperre entf\xE4llt das Feld.`,en:`carries 'locksEvidence' ${JSON.stringify(C)} \u2014 only 'true' is allowed; without a lock the field is dropped.`}),C===!0&&(I===void 0&&T===void 0&&F("locksEvidenceWithoutEvidence",{de:"sperrt seine Belege, hat aber weder 'reads' noch 'when' \u2014 es gibt nichts, worauf die Entscheidung beruht.",en:"locks its evidence but has neither 'reads' nor 'when' \u2014 there is nothing the decision rests on."}),(b===void 0||!ha(b.kind))&&F("locksEvidenceNeedsRecordedResult",{de:"sperrt seine Belege, schlie\xDFt aber nicht mit einem erfassten Ergebnis (Freitext, Empfehlung, Auswahl) \u2014 nur eine Entscheidung, die das Team wieder\xF6ffnen kann, darf Belege sperren (ein Termin bleibt gebucht).",en:"locks its evidence but does not end with a recorded result (free text, recommendation, choice) \u2014 only a decision the team can reopen may lock evidence (an appointment stays booked)."}),l.has(p)&&F("locksEvidenceOnOptionalAction",{de:"geh\xF6rt zu einer optionalen Aktion (spawnTasks) \u2014 ihre Zeilen sind die Runde der Aktion, wieder\xF6ffnen l\xE4sst sie sich nicht; Belege sperrt nur eine Knotenaufgabe.",en:"belongs to an optional action (spawnTasks) \u2014 its rows are the round of the action and cannot be reopened; only a node task locks evidence."})),n.push(...GD({graph:e,node:a,task:u,onTrigger:l,specCtx:t}));let N=Object.keys(u).filter(A=>!Object.hasOwn(vb,A)&&!Object.hasOwn(xb,A));N.length>0&&n.push(Nt(`${h}.${N[0]}`,{de:`[workItems/unknownKey] Task "${p}" (Knoten "${o.id}") tr\xE4gt ${N.map(A=>`'${A}'`).join(", ")} \u2014 kein Feld einer Aufgabe. Erlaubt: ${Object.keys(vb).join(", ")}. (Checklisten gibt es nicht mehr: Text als 'description', mehrere Arbeitsschritte sind mehrere Aufgaben.)`,en:`[workItems/unknownKey] Task "${p}" (node "${o.id}") carries ${N.map(A=>`'${A}'`).join(", ")} \u2014 not a field of a task. Allowed: ${Object.keys(vb).join(", ")}. (Checklists no longer exist: text goes in 'description', several work steps are several tasks.)`}));let M=u.description;M!==void 0&&!JD(M)&&n.push(Nt(`${h}.description`,{de:`[workItems/descriptionInvalid] 'description' auf Task "${p}" (Knoten "${o.id}") braucht Text in beiden Sprachen ({ de, en }), erhalten ${JSON.stringify(M)}.`,en:`[workItems/descriptionInvalid] 'description' on task "${p}" (node "${o.id}") needs text in both languages ({ de, en }), got ${JSON.stringify(M)}.`})),u.feedback!==void 0&&n.push(...y3(u,{key:p,nodeId:o.id,base:h})),u.optional!==void 0&&n.push(...w3(u,{key:p,nodeId:o.id,base:h,requiredByRule:d.has(p)}))}}return n}s(QD,"checkNodeTasks");function ZD(e){let t=e.indexOf(":"),n=t===-1?"":e.slice(0,t),r=t===-1?"":e.slice(t+1).trim();if(n==="artifact"&&r.length>0)return{kind:n,key:r};let i=Ri(r);return n==="field"&&i!==null?{kind:n,address:i}:de("INVALID",{de:`Dokument-Verweis "${e}" ist ung\xFCltig \u2014 erwartet artifact:<Slot-Schl\xFCssel> (auch der Slot eines anderen Knotens) oder field:$node.<Formular>.admission.<Feld>.`,en:`Document reference "${e}" is invalid \u2014 expected artifact:<slot key> (another node's slot too) or field:$node.<form>.admission.<field>.`})}s(ZD,"parseTaskDocumentRef");function Sb(e){return e.kind==="artifact"?`artifact:${e.key}`:`field:${ce(e.address)}`}s(Sb,"taskDocumentId");function qi(e,t){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:t,severity:"error"}}s(qi,"issue");function XD(e){return Array.isArray(e.tasks)?e.tasks:[]}s(XD,"tasksOf");function Nd(e){let t=new Map;for(let n of e){let{id:r,artifacts:i}=n;for(let o of Array.isArray(i)?i:[])typeof o?.key=="string"&&t.set(o.key,[...t.get(o.key)??[],{nodeId:r,slot:o}])}return t}s(Nd,"artifactSlotDeclarations");function k3(e){return e.flatMap(t=>{let{id:n,artifacts:r}=t;return(Array.isArray(r)?r:[]).filter(i=>!Nm(i?.type)).map(i=>({nodeId:String(n),slotKey:String(i?.key),type:JSON.stringify(i?.type??null)}))})}s(k3,"unknownArtifactSlotTypes");function eF(e){let t=[];for(let{nodeId:n,slotKey:r,type:i}of k3(e.nodes))t.push(qi(`nodes.${n}.artifacts.${r}.type`,{de:`[artifact/unknownType] Knoten "${n}" deklariert den Dokument-Slot \u201E${r}" mit der Art ${i} \u2014 erlaubt sind ${Ma.join(", ")}.`,en:`[artifact/unknownType] Node "${n}" declares the document slot "${r}" with the type ${i} \u2014 allowed are ${Ma.join(", ")}.`}));for(let[n,r]of Nd(e.nodes))for(let i of r.slice(1))t.push(qi(`nodes.${i.nodeId}.artifacts`,{de:`[governedDocument/slotKeyTaken] Knoten "${i.nodeId}" deklariert den Dokument-Slot \u201E${n}", den schon "${r[0].nodeId}" deklariert \u2014 jeder Slot-Schl\xFCssel geh\xF6rt genau einem Knoten.`,en:`[governedDocument/slotKeyTaken] Node "${i.nodeId}" declares the document slot "${n}", which "${r[0].nodeId}" already declares \u2014 every slot key belongs to exactly one node.`}));return t}s(eF,"checkArtifactSlotKeys");function b3(e,t,n,r=Nd(e.nodes)){let i=r.get(t)?.[0]?.nodeId;return i===void 0?{reason:"unknown"}:Ta(e,i,n)?null:{reason:"notBefore",owner:i}}s(b3,"slotLinkRefusal");function tF(e){if(!Array.isArray(e)||e.length===0)return null;let t=[];for(let n of e){let r=typeof n=="object"&&n!==null?n:{},i=Object.keys(r).sort().join(",");if(r.kind==="artifact"&&i==="key,kind"&&typeof r.key=="string"&&r.key.length>0)t.push({kind:"artifact",key:r.key});else if(r.kind==="field"&&i==="address,kind")t.push({kind:"field",address:r.address});else return null}return t}s(tF,"authoredRefs");function nF(e){let t=[],n=Nd(e.nodes);for(let r of mi(e))for(let i of XD(r)){if(i.documents===void 0)continue;let o=typeof i.key=="string"?i.key:"?",a=`nodes.${r.id}.tasks.${o}.documents`,l={de:`Task "${o}" (Knoten "${r.id}")`,en:`Task "${o}" (node "${r.id}")`},d=tF(i.documents);if(d===null){t.push(qi(a,{de:`[workItems/documentsInvalid] 'documents' auf ${l.de} muss eine nicht leere Liste von { kind: 'artifact', key } (Dokument-Slot eines Knotens) oder { kind: 'field', address } (Dateifeld eines Formulars) sein, erhalten ${JSON.stringify(i.documents)} \u2014 ein { kind: 'document', address } schreibt \`plexus-cli offer upgrade\` auf den Slot um.`,en:`[workItems/documentsInvalid] 'documents' on ${l.en} must be a non-empty list of { kind: 'artifact', key } (document slot of a node) or { kind: 'field', address } (file field of a form), got ${JSON.stringify(i.documents)} \u2014 \`plexus-cli offer upgrade\` rewrites a { kind: 'document', address } onto its slot.`}));continue}let c=new Set;for(let u of d){if(u.kind!=="artifact"&&!ke(u.address))continue;let p=u.kind==="artifact"?Sb(u):Sb({kind:"field",address:u.address});if(c.has(p)&&t.push(qi(a,{de:`[workItems/documentsDuplicate] ${l.de} verweist zweimal auf ${p}.`,en:`[workItems/documentsDuplicate] ${l.en} refers to ${p} twice.`})),c.add(p),u.kind==="artifact"){let h=b3(e,u.key,r.id,n);h?.reason==="unknown"?t.push(qi(a,{de:`[workItems/documentsUnknownArtifact] ${l.de} verweist auf das Dokument "${u.key}", aber kein Knoten deklariert einen solchen Slot.`,en:`[workItems/documentsUnknownArtifact] ${l.en} refers to the document "${u.key}", but no node declares such a slot.`})):h?.reason==="notBefore"&&t.push(qi(a,{de:`[workItems/documentsNotBefore] ${l.de} verweist auf das Dokument "${u.key}" des Knotens "${h.owner}", der nicht auf jedem Weg vor "${r.id}" liegt \u2014 auf einem Weg an ihm vorbei g\xE4be es das Dokument nie.`,en:`[workItems/documentsNotBefore] ${l.en} refers to the document "${u.key}" of node "${h.owner}", which does not lie on every path before "${r.id}" \u2014 on a path around it the document would never exist.`}))}u.kind==="field"&&!mt(u.address)&&t.push(qi(a,{de:`[workItems/documentsInvalid] ${l.de}: ein Feld-Dokument nennt ein Feld eines Formulars ($node.<formular>.admission.<feld>), nicht ${Ge(e,u.address,"de")}.`,en:`[workItems/documentsInvalid] ${l.en}: a field document names a field of a form ($node.<form>.admission.<field>), not ${Ge(e,u.address,"en")}.`}))}}return t}s(nF,"checkTaskDocuments");function rF(e,t){let n=[];for(let r of mi(e))for(let i of XD(r)){let o=tF(i.documents);if(o===null)continue;let a=typeof i.key=="string"?i.key:"?",l=`nodes.${r.id}.tasks.${a}.documents`;for(let d of o){if(d.kind!=="field"||!mt(d.address))continue;let c=ui(t,d.address);if(c==null)continue;let u={de:Ge(e,d.address,"de"),en:Ge(e,d.address,"en")},p=$a("taskDocument",Ra(c));if(p==="repeated"){n.push(qi(l,{de:`[workItems/documentsUnknownField] Task "${a}" (Knoten "${r.id}") verweist auf das Feld ${u.de} \u2014 ein Feld in einer Wiederholgruppe ist kein einzelnes Dokument der Anmeldung.`,en:`[workItems/documentsUnknownField] Task "${a}" (node "${r.id}") refers to the field ${u.en} \u2014 a field in a repeated group is not a single document of the application.`}));continue}p==="notDocument"&&n.push(qi(l,{de:`[workItems/documentsNotDocument] Task "${a}" (Knoten "${r.id}") verweist auf das Feld ${u.de}, das keine Datei enth\xE4lt \u2014 nur Datei-Felder (docRef) sind Dokumente.`,en:`[workItems/documentsNotDocument] Task "${a}" (node "${r.id}") refers to the field ${u.en}, which holds no file \u2014 only file fields (docRef) are documents.`}))}}return n}s(rF,"checkTaskDocumentFields");var Tb=["form","artifact","field"],Va=["coverLetter","contract"],oF="form",iF=/^[A-Za-z0-9_.-]+$/;function v3(e){return Va.includes(e)}s(v3,"isArtifactPart");function ja(e){return de("INVALID",{de:`Ansichts-Adresse "${e}" ist ung\xFCltig \u2014 erwartet form:<Formularknoten>#<Ansicht>, artifact:<Slot>[#${Va.join("|")}] oder field:$node.<Formular>.admission.<Feld>.`,en:`View address "${e}" is invalid \u2014 expected form:<form node>#<view>, artifact:<slot>[#${Va.join("|")}] or field:$node.<form>.admission.<field>.`})}s(ja,"invalid");function Rb(e){let t=e.indexOf(":");if(t===-1)return ja(e);let n=e.slice(0,t),r=e.slice(t+1);if(n==="field"){let l=Ri(r);return l===null?ja(e):{kind:n,address:l}}let i=r.indexOf("#"),o=i===-1?r:r.slice(0,i),a=i===-1?null:r.slice(i+1);return iF.test(o)?n==="form"?a!==null&&iF.test(a)?{kind:n,form:o,view:a}:ja(e):n==="artifact"?a===null?{kind:n,slot:o}:v3(a)?{kind:n,slot:o,part:a}:ja(e):ja(e):ja(e)}s(Rb,"parseViewAddress");function sF(e){let t=S3(e);if(t===null)return null;let n=x3(t);return n!==null&&JSON.stringify(Ab(n))===JSON.stringify(Ab(e))?n:null}s(sF,"viewAddressOf");function x3(e){try{return Rb(e)}catch{return null}}s(x3,"tryParseViewAddress");function S3(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.kind==="form"&&typeof t.form=="string"&&typeof t.view=="string")return`form:${t.form}#${t.view}`;if(t.kind==="artifact"&&typeof t.slot=="string")return t.part===void 0?`artifact:${t.slot}`:typeof t.part=="string"?`artifact:${t.slot}#${t.part}`:null;if(t.kind==="field"&&t.address!==null&&typeof t.address=="object"){let n=t.address;return typeof n.scope!="string"||typeof n.key!="string"?null:`field:${ce(n)}`}return null}s(S3,"spellingOf");function Ab(e){return e===null||typeof e!="object"||Array.isArray(e)?e:Object.fromEntries(Object.entries(e).sort(([t],[n])=>t<n?-1:t>n?1:0).map(([t,n])=>[t,Ab(n)]))}s(Ab,"canonical");function aF(e){switch(e.kind){case"form":return`form:${e.form}#${e.view}`;case"artifact":return e.part===void 0?`artifact:${e.slot}`:`artifact:${e.slot}#${e.part}`;case"field":return`field:${ce(e.address)}`}}s(aF,"formatViewAddress");var $b=["form","documents"],A3=/^[a-z][a-zA-Z0-9_-]*$/;function T3(e){let t=new Map,n=s(r=>{for(let i of[...r.fields,...(r.groups??[]).flatMap(o=>o.fields)])t.set(i.key,i.type==="docRef"?"document":"other");for(let i of r.repeated??[]){t.set(i.key,"other");for(let o of i.itemTemplate)t.set(`${i.key}[].${o.key}`,o.type==="docRef"?"row":"other")}r.subsections?.forEach(n)},"visit");return e.sections.forEach(n),t}s(T3,"fieldPlaces");function lF(e,t,n){let r=[],i=new Set;return e.forEach((o,a)=>{if(typeof o!="string"||!A3.test(o)){r.push({severity:"error",path:`${n(a)}.key`,code:"view.invalid-key",message:{de:`${t.de}: '${String(o)}' ist kein g\xFCltiger Schl\xFCssel (Kleinbuchstabe am Anfang, dann Buchstaben, Ziffern, - oder _).`,en:`${t.en}: '${String(o)}' is no valid key (a lower-case letter first, then letters, digits, - or _).`}});return}i.has(o)&&r.push({severity:"error",path:`${n(a)}.key`,code:"view.duplicate-key",message:{de:`${t.de}: Der Schl\xFCssel '${o}' kommt doppelt vor.`,en:`${t.en}: the key '${o}' occurs twice.`}}),i.add(o)}),r}s(lF,"keyIssues");function R3(e,t,n){return e==="document"?null:e===void 0?{severity:"error",path:n,code:"view.unknown-field",message:{de:`Ansicht: Das Formular hat kein Feld '${t}'.`,en:`View: the form has no field '${t}'.`}}:e==="row"?{severity:"error",path:n,code:"view.field-in-row",message:{de:`Ansicht: Das Dateifeld '${t}' liegt in einem wiederholten Block und kann nicht einzeln genannt werden.`,en:`View: the file field '${t}' sits in a repeated block and cannot be named on its own.`}}:{severity:"error",path:n,code:"view.not-a-document",message:{de:`Ansicht: Das Feld '${t}' enth\xE4lt keine Datei.`,en:`View: the field '${t}' holds no file.`}}}s(R3,"fieldIssue");function $3(e,t,n){let r=[];$b.includes(e.key)&&r.push({severity:"error",path:`${t}.key`,code:"view.reserved-key",message:{de:`Der Ansichtsschl\xFCssel '${e.key}' ist f\xFCr die Standardansicht reserviert.`,en:`The view key '${e.key}' is reserved for the standard view.`}});let i=e.groups;i.length===0&&r.push({severity:"error",path:`${t}.groups`,code:"view.empty",message:{de:`Ansicht '${e.key}' hat keine Gruppen.`,en:`View '${e.key}' has no groups.`}}),r.push(...lF(i.map(a=>a.key),{de:`Gruppe der Ansicht '${e.key}'`,en:`Group of view '${e.key}'`},a=>`${t}.groups[${a}]`));let o=new Set;return i.forEach((a,l)=>{let d=`${t}.groups[${l}]`,c=a.fields;c.length===0&&r.push({severity:"error",path:`${d}.fields`,code:"view.empty",message:{de:`Gruppe '${a.key}' der Ansicht '${e.key}' hat keine Felder.`,en:`Group '${a.key}' of view '${e.key}' has no fields.`}}),c.forEach((u,p)=>{let h=`${d}.fields[${p}]`,y=R3(n.get(u),u,h);y!==null&&r.push(y),o.has(u)&&r.push({severity:"error",path:h,code:"view.field-twice",message:{de:`Ansicht '${e.key}': Das Feld '${u}' steht mehrfach; eine Datei hat einen Platz.`,en:`View '${e.key}': the field '${u}' is listed more than once; a file has one place.`}}),o.add(u)})}),r}s($3,"viewIssues");function E3(e){if(!Array.isArray(e))return"views";for(let[t,n]of e.entries()){let r=n?.groups;if(!Array.isArray(r))return`views[${t}].groups`;for(let[i,o]of r.entries()){let a=o?.fields;if(!Array.isArray(a)||a.some(l=>typeof l!="string"))return`views[${t}].groups[${i}].fields`}}return null}s(E3,"malformedAt");function dF(e){let t=e.views;if(t===void 0)return[];let n=E3(t);if(n!==null)return[{severity:"error",path:n,code:"view.malformed",message:{de:`${n} hat nicht die Form einer Ansicht: views ist eine Liste von { key, label, groups }, groups eine Liste von { key, label, fields }, fields eine Liste von Feldschl\xFCsseln.`,en:`${n} is not shaped like a view: views is a list of { key, label, groups }, groups a list of { key, label, fields }, fields a list of field keys.`}}];let r=T3(e);return[...lF(t.map(i=>i.key),{de:"Ansicht",en:"View"},i=>`views[${i}]`),...t.flatMap((i,o)=>$3(i,`views[${o}]`,r))]}s(dF,"formViewIssues");function Ba(e,t){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:t,severity:"error"}}s(Ba,"issue");function cF(e,t,n,r,i){let o=sF(e);if(o===null)return[Ba(t,{de:`[view/invalid] 'view' auf ${n.de} ist keine Ansichts-Adresse \u2014 erwartet { kind: ${Tb.join(" | ")}, \u2026 }: form:<Formularknoten>#<Ansicht>, artifact:<Slot>[#${Va.join("|")}] oder field:$node.<Formular>.admission.<Feld>.`,en:`[view/invalid] 'view' on ${n.en} is no view address \u2014 expected { kind: ${Tb.join(" | ")}, \u2026 }: form:<form node>#<view>, artifact:<slot>[#${Va.join("|")}] or field:$node.<form>.admission.<field>.`})];let a=aF(o);switch(o.kind){case"artifact":return r.has(o.slot)?[]:[Ba(t,{de:`[view/unknownSlot] ${n.de} nennt "${a}", aber kein Knoten dieses Graphen hat den Dokument-Slot "${o.slot}".`,en:`[view/unknownSlot] ${n.en} names "${a}", but no node of this graph has the document slot "${o.slot}".`})];case"form":case"field":{let l=o.kind==="form"?o.form:o.address.scope==="node"?o.address.owner:null;if(l===null)return[Ba(t,{de:`[view/invalid] ${n.de} nennt "${a}" \u2014 ein Dateifeld liegt in einem Formular: field:$node.<Formular>.admission.<Feld>.`,en:`[view/invalid] ${n.en} names "${a}" \u2014 a file field lives in a form: field:$node.<form>.admission.<field>.`})];let d=i?.formViewKeysByFormNode;if(d===void 0)return[];let c=d.get(l);return c===void 0?[Ba(t,{de:`[view/unknownForm] ${n.de} nennt "${a}", aber kein Formularknoten hei\xDFt so.`,en:`[view/unknownForm] ${n.en} names "${a}", but no form node has that id.`})]:o.kind==="field"?[]:c.has(o.view)||$b.includes(o.view)?[]:[Ba(t,{de:`[view/unknownView] ${n.de} nennt "${a}", aber das Formular "${o.form}" hat keine Ansicht "${o.view}".`,en:`[view/unknownView] ${n.en} names "${a}", but the form "${o.form}" has no view "${o.view}".`})]}}}s(cF,"viewIssues");function uF(e,t){let n=[],r=new Set(Nd(e.nodes).keys());for(let i of mi(e)){if(i.view!==void 0){let o={de:`Knoten "${i.id}"`,en:`node "${i.id}"`};i.type!=="decision"?n.push(Ba(`nodes.${i.id}.view`,{de:`[view/invalid] ${o.de}: 'view' am Knoten gilt nur f\xFCr eine Entscheidung; eine Aufgabe tr\xE4gt ihre eigene.`,en:`[view/invalid] ${o.en}: 'view' on a node applies to a decision only; a task carries its own.`})):n.push(...cF(i.view,`nodes.${i.id}.view`,o,r,t))}for(let o of Array.isArray(i.tasks)?i.tasks:[]){if(o.view===void 0)continue;let a=String(o.key);n.push(...cF(o.view,`nodes.${i.id}.tasks.${a}.view`,{de:`Task "${a}" (Knoten "${i.id}")`,en:`Task "${a}" (node "${i.id}")`},r,t))}}return n}s(uF,"checkTaskViews");var Jn="traeger",fF={de:"Tr\xE4ger",en:"Provider"};function Ua(e){let t=e.inputs?.[Jn];return t?.kind==="literal"&&typeof t.value=="string"&&t.value.length>0?t.value:null}s(Ua,"traegerKeyOfNode");var Pm={name:"input.traeger.name",address:"input.traeger.anschrift"},zbe=Object.values(Pm);var pF="governedDocument",fs="prepareDocument",Pd="prepareDocument:revision",Lr="releaseApproval",ps="documentResponse",Ro="coverLetterResponse",Cm="confirmCoverLetter",Dm="requestCoverLetterRevision",Ga="coverLetterConfirmation",hi="responseCheck",Fm="returnSigned";var mF="requestApproval";var hF="issueDocument",gF="correctInPlace",yF="rescindAndReissue",Lm="requestChange";var za="releaseArtifact",yn="signingRecovery",Mm="resendESignature",ms="switchToPaper";var Cd=new Set([fs,Pd]),wF=["pending","producing","producingHeld","deferred","awaitingApproval","awaitingCoverLetter","awaitingResponse","responseReturned","responseInCheck","awaitingSignature","signatureStalled","done"],qm=["upload","resolver","template","none"],hs=1,gs=366,Ki="responseDueInDays";function ys(e){let t=e.inputs?.[Ga];return t?.kind==="literal"&&t.value===!0}s(ys,"coverLetterConfirmationOf");function Dd(e){let t=e.inputs?.[Ki];return t?.kind==="literal"&&Fd(t.value)?t.value:void 0}s(Dd,"responseDueInDaysForVocabulary");function Fd(e){return typeof e=="number"&&Number.isInteger(e)&&e>=hs&&e<=gs}s(Fd,"isValidResponseDueInDays");var Wa=["generatedAt","responseDueInDays","countersignature"],ws=["release","none"],Km=["confirm","signedUpload","signedUploadChecked","eSignature"];var I3={kind:"confirm",acceptOutcomeId:"accepted",declineOutcomeId:"declined",outcomeSemantics:{accept:"granted",decline:"rejected"},acceptEvent:"userTaskResolved",producesResponseArtifact:!1,declineIsAnswer:!0,acceptStatus:"accepted",checksReturn:!1,issuesBy:"paper",defaultLabels:{accept:{de:"Annehmen",en:"Accept"},decline:{de:"Ablehnen",en:"Decline"}}},kF={kind:"signedUpload",acceptOutcomeId:"signed",declineOutcomeId:"absage",outcomeSemantics:{accept:"other",decline:"rejected"},acceptEvent:"userTaskResolved",producesResponseArtifact:!0,declineIsAnswer:!1,acceptStatus:"signed",checksReturn:!1,issuesBy:"paper",defaultLabels:{accept:{de:"Unterschrieben zur\xFCcksenden",en:"Return signed"},decline:{de:"Ablehnen",en:"Decline"}}},bF={...kF,kind:"signedUploadChecked",acceptEvent:"contractEvent",checksReturn:!0},O3={...bF,kind:"eSignature",issuesBy:"provider"},ji={confirm:I3,signedUpload:kF,signedUploadChecked:bF,eSignature:O3};function Vi(e){let t=e.responseStrategy;if(typeof t=="string"&&t in ji)return ji[t];D(`governedDocument node "${e.id}" declares no valid responseStrategy (got ${JSON.stringify(t)}) \u2014 publish validation should have blocked this; corrupt pinned graph`)}s(Vi,"responseStrategyOf");function jm(e){if(e.type!==pF||e.production!=="resolver")return!1;let t=e.responseStrategy;return typeof t=="string"&&t in ji?ji[t].acceptEvent==="contractEvent":!1}s(jm,"isFamilySignedContractNode");function Ha(e){return e.label}s(Ha,"governedDocTitle");function Eb(e){return e.approval==="release"?mF:hF}s(Eb,"submitActionId");function vF(e,t,n){return{key:t,recipient:"internal",title:n,unlocks:[Eb(e)],gatesNode:!0,advancesNode:!0}}s(vF,"producerTemplate");function _3(e){return e.titles?.respond??e.label}s(_3,"responseTitle");var Ya={de:"\u27E8Titel fehlt\u27E9",en:"\u27E8title missing\u27E9"};function Vm(e){let t=Vi(e),n=[];if(e.production!=="none"&&n.push(vF(e,fs,e.titles?.prepare??Ya),vF(e,Pd,e.titles?.revise??Ya)),e.approval==="release"&&n.push({key:Lr,recipient:"internal",title:e.titles?.approve??Ya,unlocks:[],verdictResolved:!0,gatesNode:!0,advancesNode:!0}),n.push({key:ps,recipient:"external",title:_3(e),unlocks:t.producesResponseArtifact?[t.checksReturn?Fm:t.acceptOutcomeId,t.declineOutcomeId,Lm]:[t.acceptOutcomeId,t.declineOutcomeId],advancesNode:!0,...Dd(e)!==void 0?{dueInDays:Dd(e)}:{}}),ys(e)){let r=Ha(e);n.push({key:Ro,recipient:"external",title:{de:`${r.de}: Angebot best\xE4tigen`,en:`${r.en}: confirm offer`},unlocks:[Cm,Dm,t.declineOutcomeId],advancesNode:!0,...Dd(e)!==void 0?{dueInDays:Dd(e)}:{}})}if(t.checksReturn&&n.push({key:hi,recipient:"internal",title:e.titles?.check??Ya,unlocks:[],verdictResolved:!0,gatesNode:!1,advancesNode:!0}),t.issuesBy==="provider"){let r=Ha(e);n.push({key:yn,recipient:"internal",title:{de:`${r.de}: elektronische Unterschrift kl\xE4ren`,en:`${r.en}: resolve the e-signature`},unlocks:[Mm,ms],gatesNode:!1,advancesNode:!1})}return n}s(Vm,"governedDocIntrinsicTemplates");function N3(e){e.production==="none"&&D(`governedDocSlot: node "${e.id}" has production 'none' \u2014 it governs no artifact slot`);let t=e.artifacts??[];t.length!==1&&D(`governedDocSlot: node "${e.id}" declares ${t.length} artifact slots \u2014 exactly ONE is required (publish validation [governedDocument/slotContract])`);let n=t[0];return(typeof n.key!="string"||n.key.length===0)&&D(`governedDocSlot: node "${e.id}" declares an artifact slot without a key \u2014 corrupt pinned graph`),n}s(N3,"governedDocSlot");function Bm(e){return N3(e).key}s(Bm,"governedDocSlotKey");var mr="processFooter";var Ld="countersign",Ib="countersign",xF="countersigned",Ob="countersigning",SF="countersigned";var AF={de:"Vertrag gegenzeichnen",en:"Countersign the contract"},Md=["scan","eSignature"],Um="service_provider:1",TF=["countersigning","awaitingSignature","signatureStalled","done"],RF={de:"Elektronische Gegenzeichnung kl\xE4ren",en:"Resolve the electronic countersignature"};function $F(e){return{de:`[countersign/traegerSignatoryMissing] Die Schule zeichnet elektronisch gegen, aber f\xFCr ${e} ist keine Unterschriftsperson hinterlegt, die unterschreiben kann (Rechtstr\xE4ger \u2192 signatoryUserKey, aktives Personal der Schule).`,en:`[countersign/traegerSignatoryMissing] The school countersigns electronically, but no signatory who can sign is on file for ${e} (legal entity \u2192 signatoryUserKey, active staff of the school).`}}s($F,"traegerSignatoryMissingReason");function hr(e,t,n){return{layer:"GRAPH",kind:"nodeRule",path:`nodes.${e.id}.${t}`,reason:n,severity:"error"}}s(hr,"issue");function Gm(e,t){return e.nodes.filter(n=>{let r=n.contract;return n.type==="countersign"&&ke(r)&&r.scope==="node"&&r.owner===t})}s(Gm,"countersignersOf");function qd(e){return e.signing==="eSignature"}s(qd,"isElectronic");function P3(e,t){if(t===void 0||t.sendable||!qd(e))return[];let n=e.label?.de??e.id,r=e.label?.en||e.id;return[hr(e,"signing",{de:`[countersign/eSignatureNeedsProvider] \u201E${n}\u201C zeichnet elektronisch gegen, aber die Schule kann nicht senden: ${t.reason.de}`,en:`[countersign/eSignatureNeedsProvider] "${r}" countersigns electronically, but the school cannot send: ${t.reason.en}`})]}s(P3,"countersignProviderIssues");function C3(e,t,n){if(n.scope!=="node")return[];let r=e.nodes.find(o=>o.id===n.owner);if(r===void 0)return[];let i=[];return jm(r)||i.push("sourceNotCheckedContract"),Gm(e,r.id).some(o=>o.id!==t)&&i.push("twice"),i}s(C3,"countersignContractRefusals");function EF(e){let t=e.inputs?.dueInDays;return t?.kind==="literal"&&typeof t.value=="number"&&Number.isInteger(t.value)&&t.value>=1?t.value:void 0}s(EF,"validDueInDays");function D3(e,t,n){let r=e.label?.de??e.id,i=e.label?.en||e.id,o=e.signing;if(o!==void 0&&!Md.includes(o))return[hr(e,"signing",{de:`[countersign/unknownSigning] \u201E${r}\u201C: signing ist scan oder eSignature (gefunden: ${JSON.stringify(o)}).`,en:`[countersign/unknownSigning] "${i}": signing is scan or eSignature (found: ${JSON.stringify(o)}).`})];let a=e.assign?.[yn];if(!qd(e))return a===void 0?[]:[hr(e,"assign",{de:`[countersign/recoveryAssign] \u201E${r}\u201C zeichnet auf Papier gegen \u2014 \`assign.signingRecovery\` h\xE4lt keine Aufgabe und geh\xF6rt entfernt.`,en:`[countersign/recoveryAssign] "${i}" countersigns on paper \u2014 \`assign.signingRecovery\` holds no task and must be removed.`})];let l=[];return a===void 0&&l.push(hr(e,"assign",{de:`[countersign/recoveryAssign] \u201E${r}\u201C zeichnet elektronisch gegen \u2014 wer eine gescheiterte Gegenzeichnung kl\xE4rt, fehlt: \`assign.signingRecovery\` nennt das Team.`,en:`[countersign/recoveryAssign] "${i}" countersigns electronically \u2014 who resolves a failed countersignature is missing: \`assign.signingRecovery\` names the team.`})),l.push(...F3(e,t,n),...L3(e,t,n),...P3(e,n?.signingProvider)),l}s(D3,"signingIssues");function OF(e,t){let n=e.contract;if(!(!ke(n)||n.scope!=="node"))return t.nodes.find(r=>r.id===n.owner)}s(OF,"contractNodeOf");function F3(e,t,n){let r=OF(e,t),i=r===void 0?null:Ua(r),o=i===null?void 0:n?.traeger?.get(i);return o===void 0||o.hasSignatory?[]:[hr(e,"signing",$F(o.name))]}s(F3,"traegerSignatoryIssues");function L3(e,t,n){let r=OF(e,t);if(r===void 0)return[];let i=n?.resolverDocumentAnchors?.get(r.id);if(i===void 0)return[];let o=e.label?.de??e.id,a=e.label?.en||e.id,l=[];for(let d of i)d.documentAnchors===null?l.push(hr(e,"signing",{de:`[countersign/eSignatureAnchorMissing] \u201E${o}\u201C zeichnet elektronisch gegen, aber die Vorlage des Generators \u201E${d.pin}\u201C wurde nie auf Unterschriftsanker gelesen \u2014 Vorlage neu hochladen und den Generator neu versiegeln.`,en:`[countersign/eSignatureAnchorMissing] "${a}" countersigns electronically, but the template of generator "${d.pin}" was never read for signature anchors \u2014 upload the template again and seal the generator again.`})):d.documentAnchors.has(Um)||l.push(hr(e,"signing",{de:`[countersign/eSignatureAnchorMissing] \u201E${o}\u201C zeichnet elektronisch gegen, aber die Vorlage von \u201E${d.pin}\u201C tr\xE4gt keinen Anker /unterschrift:${Um}/ \u2014 der Anbieter f\xE4nde f\xFCr die Schule kein Unterschriftsfeld.`,en:`[countersign/eSignatureAnchorMissing] "${a}" countersigns electronically, but the template of "${d.pin}" carries no anchor /unterschrift:${Um}/ \u2014 the provider would find no signature field for the school.`}));return l}s(L3,"traegerAnchorIssues");var _b=100;async function M3(e,t){let n=await e.db.query("work_items").withIndex("by_applicationId_and_nodeId",o=>o.eq("context.applicationId",t.applicationId).eq("context.anchor.nodeId",t.node.id)).take(_b+1);n.length>_b&&D(`countersign node "${t.node.id}" of ${t.applicationId} holds more than ${_b} rows`);let r=n.filter(o=>o.isOpen),i=s(o=>{if(o.context.kind!=="admission")return;let a=o.context.anchor;return"templateKey"in a?a.templateKey:void 0},"templateKeyOf");return r.some(o=>i(o)===yn)?"signatureStalled":r.some(o=>i(o)===Ld)?"countersigning":qd(t.node)?"awaitingSignature":"done"}s(M3,"countersignCurrentState");var IF={[Ob]:{label:ie("Gegenzeichnung","Countersignature"),tone:"teal",phase:{key:"gegenzeichnung",label:ie("Gegenzeichnung","Countersignature"),scope:"node"},external:at(ie("Vertrag unterschrieben","Contract signed"),"blue",ie("Die Schule zeichnet Ihren Vertrag gegen","The school is countersigning your contract"),ie("Vielen Dank f\xFCr Ihre Unterschrift. Sobald die Schule gegengezeichnet hat, finden Sie Ihr Exemplar hier.","Thank you for signing. As soon as the school has countersigned, you will find your copy here."))}},_F={inputs:s(()=>[{id:"dueInDays",label:{de:"Frist der Aufgabe (Tage)",en:"Task due in (days)"},type:"number",inspector:"literal-only"}],"inputs"),role:"user-action",effect:"side-effect",outcomes:[{id:xF,label:{de:"Gegengezeichnet",en:"Countersigned"}}],progressDefaults:IF,progressEvents:Ht(IF),entryProgressEvent:s(()=>Ob,"entryProgressEvent"),notificationEvents:s(()=>[{id:SF,label:{de:"Vertrag gegengezeichnet",en:"Contract countersigned"},audience:"external",required:!0,args:[{key:"applicationId",type:"string",required:!0},{key:"documentTitle",type:"localizedText",required:!0}]}],"notificationEvents"),actions:s(e=>[{id:Ib,kind:"internal",label:AF,surface:mr,availableIn:["countersigning"]},...qd(e)?[{id:ms,kind:"internal",surface:mr,label:{de:"Auf Papier umstellen",en:"Switch to paper"},availableIn:["signatureStalled"]}]:[]],"actions"),workItemTemplates:s(e=>[{key:Ld,recipient:"internal",title:e.titles?.countersign??Ya,unlocks:[Ib],advancesNode:!0,...EF(e)!==void 0?{dueInDays:EF(e)}:{}},...qd(e)?[{key:yn,recipient:"internal",title:RF,unlocks:[ms],gatesNode:!1,advancesNode:!1}]:[]],"workItemTemplates"),placelessTasks:{[Ld]:"Worked in its own step: the contract it countersigns is another node's slot, which this node names by address only.",[yn]:"Worked in its own step (\u201EAuf Papier umstellen\u201C): it is about the Tr\xE4ger's Vorgang, which has no view of its own."},states:TF,currentState:M3,validate:s((e,t,n)=>{let r=[],i=e.label?.de??e.id,o=e.label?.en||e.id;e.assign?.[Ld]===void 0&&r.push(hr(e,"assign",{de:`[countersign/assign] \u201E${i}": wer gegenzeichnet, fehlt \u2014 \`assign.countersign\` nennt das Team.`,en:`[countersign/assign] "${o}": who countersigns is missing \u2014 \`assign.countersign\` names the team.`})),po(e.titles?.countersign)||r.push(hr(e,"titles",{de:`[countersign/missingTitle] \u201E${i}": der Titel der Aufgabe fehlt \u2014 \`titles.countersign\` auf Deutsch und Englisch.`,en:`[countersign/missingTitle] "${o}": the task title is missing \u2014 \`titles.countersign\` in German and English.`}));let l=e.inputs?.dueInDays;l!==void 0&&l.kind!=="unset"&&!(l.kind==="literal"&&typeof l.value=="number"&&Number.isInteger(l.value)&&l.value>=1)&&r.push(hr(e,"inputs.dueInDays",{de:`[countersign/dueInDays] \u201E${i}": dueInDays ist eine ganze Zahl \u2265 1.`,en:`[countersign/dueInDays] "${o}": dueInDays is a whole number \u2265 1.`})),r.push(...D3(e,t,n));let d=e.contract;if(!ke(d))return r;let c=C3(t,e.id,d);if(c.length===0)return r;let u=t.nodes.find(p=>d.scope==="node"&&p.id===d.owner);if(c.includes("sourceNotCheckedContract")&&r.push(hr(e,"contract",{de:`[countersign/sourceNotCheckedContract] \u201E${i}" zeichnet das Dokument von \u201E${u.label?.de??u.id}" (${u.id}) gegen \u2014 gegenzeichnen l\xE4sst sich nur ein erzeugter Vertrag, den die Familie mit verbuchten Unterschriften unterschreibt (governedDocument mit production: resolver und responseStrategy: signedUploadChecked oder eSignature).`,en:`[countersign/sourceNotCheckedContract] "${o}" countersigns the document of "${u.label?.en||u.id}" (${u.id}) \u2014 only a generated contract that the family signs with booked signatures can be countersigned (governedDocument with production: resolver and responseStrategy: signedUploadChecked or eSignature).`})),c.includes("twice")){let p=Gm(t,u.id).filter(h=>h.id!==e.id);r.push(hr(e,"contract",{de:`[countersign/twice] \u201E${i}": \u201E${u.label?.de??u.id}" (${u.id}) wird schon von ${p.map(h=>`"${h.id}"`).join(", ")} gegengezeichnet \u2014 ein Vertrag hat eine Gegenzeichnung.`,en:`[countersign/twice] "${o}": "${u.label?.en||u.id}" (${u.id}) is already countersigned by ${p.map(h=>`"${h.id}"`).join(", ")} \u2014 a contract has one countersignature.`}))}return r},"validate")};function q3(e){return jm(e)?Ua(e):null}s(q3,"traegerSignerOf");var K3=s(e=>e.type==="end"&&ls(e)==="approved","isApprovedEnd");function NF(e){let t=[];for(let n of e.nodes){let r=q3(n);if(r===null)continue;let i=Gm(e,n.id).map(u=>u.id),o=wC(e,n.id,new Set(i),K3);if(o===null)continue;let a=n.label?.de||n.id,l=n.label?.en||n.id,d={de:`Einen Knoten \u201EUnterschrift (intern)\u201C (countersign) mit contract: $node.${n.id}.contract auf jeden Weg zu einem Ende mit Ergebnis approved setzen.`,en:`Place an "Internal signature" node (countersign) with contract: $node.${n.id}.contract on every path to an end with outcome approved.`},c=i.length===0?{de:`[countersign/missingForContract] \u201E${a}\u201C (${n.id}) erzeugt einen Vertrag, den der Tr\xE4ger \u201E${r}\u201C mitunterschreibt, aber keine Gegenzeichnung nennt ihn \u2014 der Vertrag w\xFCrde nie unterschrieben und nie abgerechnet. ${d.de}`,en:`[countersign/missingForContract] "${l}" (${n.id}) generates a contract the legal entity "${r}" co-signs, but no countersignature names it \u2014 the contract would never be signed and never billed. ${d.en}`}:{de:`[countersign/missingForContract] \u201E${a}\u201C (${n.id}): ein Weg erreicht das Ende \u201E${o}\u201C (Ergebnis approved), ohne durch die Gegenzeichnung ${i.map(u=>`\u201E${u}\u201C`).join(", ")} zu laufen \u2014 dort bliebe der Vertrag ohne Unterschrift des Tr\xE4gers \u201E${r}\u201C und w\xFCrde nie abgerechnet. ${d.de}`,en:`[countersign/missingForContract] "${l}" (${n.id}): a path reaches the end "${o}" (outcome approved) without passing the countersignature ${i.map(u=>`"${u}"`).join(", ")} \u2014 there the contract would lack the signature of the legal entity "${r}" and never be billed. ${d.en}`};t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${n.id}`,reason:c,severity:"error"})}return t}s(NF,"checkCountersignCoverage");function zm(e){let t=Ue(e);return e.outcomes&&e.outcomes.length>0?[...e.outcomes]:t.outcomes&&t.outcomes.length>0?[...t.outcomes]:null}s(zm,"nodeOutcomes");function Wm(e,t){let o=new Map;for(let d of e)o.set(d,0);let a=new Map,l=[];for(let d of e){if((o.get(d)??0)!==0)continue;let c=[{id:d,edges:t(d),idx:0}];for(o.set(d,1),a.set(d,null);c.length>0;){let u=c[c.length-1];if(u.idx>=u.edges.length){o.set(u.id,2),c.pop();continue}let{target:p,edge:h}=u.edges[u.idx];u.idx++;let y=o.get(p)??0;if(y===1){let b=[p],k=u.id;for(;k&&k!==p;)b.push(k),k=a.get(k)??null;b.reverse(),l.push({edge:h,source:u.id,target:p,cycle:b})}else y===0&&(o.set(p,1),a.set(p,u.id),c.push({id:p,edges:t(p),idx:0}))}}return l}s(Wm,"detectBackEdges");function Nb(e){let t="error",n=new Map;for(let a of Dn(e.nodes)){let l=n.get(a.source)??[];l.push({id:a.id,target:a.target}),n.set(a.source,l)}let r=[],i=new Set,o=Wm(e.nodes.map(a=>a.id),a=>(n.get(a)??[]).map(({id:l,target:d})=>({target:d,edge:l})));for(let a of o)i.has(a.edge)||(i.add(a.edge),r.push({layer:"GRAPH",kind:"cycle",path:`edge.${a.edge}`,reason:{de:`Zyklus \xFCber Kante ${a.source} \u2192 ${a.target}`,en:`Cycle through edge ${a.source} \u2192 ${a.target}`},severity:t}));return r}s(Nb,"checkAcyclic");function Pb(e){let t=[],n=new Set(e.nodes.map(i=>i.id)),r="error";for(let i of e.nodes){let o=i.next;if(o)for(let[a,l]of Object.entries(o))n.has(l.to)||t.push({layer:"GRAPH",kind:"routing",path:`node.${i.id}.next.${a}`,reason:{de:`${i.label.de}: next.${a} verweist auf nicht-existenten Knoten '${l.to}'`,en:`${i.label.en}: next.${a} points to a node that does not exist: '${l.to}'`},severity:"error"});if(i.type!=="end"&&!(!i.outcomes||i.outcomes.length===0))for(let a of i.outcomes)(!o||!(a.id in o))&&t.push({layer:"GRAPH",kind:"routing",path:`node.${i.id}.outcome.${a.id}`,reason:{de:`${i.label.de}: Outcome '${a.label.de}' fehlt im next-Mapping`,en:`${i.label.en}: outcome '${a.label.en}' is missing from the next mapping`},severity:r})}return t}s(Pb,"checkNextTargets");function Cb(e){let t=[];for(let n of e.nodes){let r=n.next;if(!r)continue;let i=zm(n),o=new Set(i?i.map(a=>a.id):[To]);for(let a of Object.keys(r))o.has(a)||t.push({layer:"GRAPH",kind:"unknownOutcome",path:`node.${n.id}.next.${a}`,reason:{de:`${n.label.de}: next-Schl\xFCssel '${a}' ist kein g\xFCltiges Outcome dieses Knotens (erlaubt: ${[...o].join(", ")}) \u2014 die Kante w\xFCrde im Editor verschwinden`,en:`${n.label.en}: next key '${a}' is not a valid outcome of this node (allowed: ${[...o].join(", ")}) \u2014 the edge would disappear in the editor`},severity:"error"})}return t}s(Cb,"checkNextOutcomesKnown");function Db(e){let t=[],n=new Set(Dn(e.nodes).map(o=>o.target)),r=e.nodes.filter(o=>!n.has(o.id));return r.length===0?t.push({layer:"GRAPH",kind:"startEnd",path:"graph",reason:{de:"Kein Start-Knoten",en:"No start node"},severity:"error"}):r.length>1&&t.push({layer:"GRAPH",kind:"startEnd",path:"graph",reason:{de:`Mehrere Start-Knoten (${r.map(o=>o.label.de).join(", ")})`,en:`Multiple start nodes (${r.map(o=>o.label.en).join(", ")})`},severity:"warning"}),e.nodes.filter(o=>o.type==="end").length===0&&t.push({layer:"GRAPH",kind:"startEnd",path:"graph",reason:{de:"Kein End-Knoten",en:"No end node"},severity:"warning"}),t}s(Db,"checkStartEnd");function Fb(e){let t=new Map;for(let r of Dn(e.nodes))t.set(r.source,(t.get(r.source)??0)+1);let n=[];for(let r of e.nodes)r.type!=="end"&&(t.get(r.id)??0)===0&&n.push({layer:"GRAPH",kind:"startEnd",path:`node.${r.id}`,reason:{de:`${r.label.de}: keine ausgehende Kante`,en:`${r.label.en}: no outgoing edge`},severity:"warning"});return n}s(Fb,"checkNoOutgoingEdge");function Lb(e){return e.nodes.filter(t=>!Qw(t.id)).map(t=>({layer:"GRAPH",kind:"nodeRule",path:`nodes.${t.id}.id`,reason:{de:`[graph/nodeIdFormat] Knoten "${t.id}": eine Knoten-ID ist ein Bezeichner ohne Punkt (${Pr.source}), z. B. "reviewEingereicht". Ein Bundle von vor der Umstellung neu exportieren.`,en:`[graph/nodeIdFormat] Node "${t.id}": a node id is an identifier without a dot (${Pr.source}), e.g. "reviewSubmitted". Export a bundle from before the change again.`},severity:"error"}))}s(Lb,"checkNodeIdFormat");function Mb(e){let t=new Set(e.nodes.map(r=>r.id)),n=[];for(let r of Dn(e.nodes))t.has(r.source)||n.push({layer:"GRAPH",kind:"startEnd",path:`edge.${r.id}`,reason:{de:`Kante ${r.id}: Quelle '${r.source}' nicht gefunden`,en:`Edge ${r.id}: source '${r.source}' not found`},severity:"error"}),t.has(r.target)||n.push({layer:"GRAPH",kind:"startEnd",path:`edge.${r.id}`,reason:{de:`Kante ${r.id}: Ziel '${r.target}' nicht gefunden`,en:`Edge ${r.id}: target '${r.target}' not found`},severity:"error"});return n}s(Mb,"checkEdgeEndpoints");function PF(e){let t=[];for(let n of e.nodes)for(let r of n.tasks??[]){let i=r.result;i===null||typeof i!="object"||!(_m in i)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${n.id}.tasks.${r.key}.result.${_m}`,reason:{de:`[graph/retiredField] Aufgabe "${r.key}": \`primaryHostTeams\` hei\xDFt jetzt \`primaryParticipantTeams\` \u2014 der alte Name wird nicht mehr gelesen, die Teilnehmer-Auswahl zeigt die Teams nicht oben. Bitte umbenennen.`,en:`[graph/retiredField] Task "${r.key}": \`primaryHostTeams\` is now called \`primaryParticipantTeams\` \u2014 the old name is no longer read, so the participant picker does not list the teams first. Please rename it.`},severity:"error"})}return t}s(PF,"checkRenamedFields");var j3=new Set(["countersignature"]);function CF(e){let t=[],n=s((o,a)=>{t.push({layer:"GRAPH",kind:"nodeRule",path:o,reason:{de:`[graph/retiredField] ${a.de}`,en:`[graph/retiredField] ${a.en}`},severity:"error"})},"retired"),r={de:"Preise rechnet der Vertragsgenerator (`prices`), nicht der Workflow \u2014 binde Rang und Reduktion an seine Eing\xE4nge.",en:"Prices are computed by the contract generator (`prices`), not the workflow \u2014 bind rank and reduction to its inputs."},i=e;"pricingRules"in i&&n("pricingRules",r);for(let[o,a]of(Array.isArray(i.processStore)?i.processStore:[]).entries())for(let l of["derive","absentValue"])a!==null&&typeof a=="object"&&l in a&&n(`processStore.${o}.${l}`,r);for(let o of e.nodes)for(let a of o.tasks??[]){let l=a.result;l!==null&&typeof l=="object"&&"prices"in l&&n(`nodes.${o.id}.tasks.${a.key}.result.prices`,r)}for(let o of e.nodes){let a=o,l={de:`Knoten \u201E${Pe(e,o.id,"de")}\u201C (${o.id})`,en:`Node "${Pe(e,o.id,"en")}" (${o.id})`};for(let[c,u]of Object.entries(a.next??{}))u!==null&&typeof u=="object"&&"emits"in u&&n(`nodes.${o.id}.next.${c}.emits`,{de:`${l.de}: \`next.${c}.emits\` gibt es nicht mehr \u2014 ein Ausgang routet nur; ein Knoten liest Daten \xFCber Adressen in seinen eigenen Feldern.`,en:`${l.en}: \`next.${c}.emits\` no longer exists \u2014 an outcome only routes; a node reads data through addresses in its own fields.`});for(let c of Array.isArray(a.outcomes)?a.outcomes:[])c!==null&&typeof c=="object"&&"emits"in c&&n(`nodes.${o.id}.outcomes.${String(c.id)}.emits`,{de:`${l.de}: \`emits\` am Ausgang "${String(c.id)}" gibt es nicht mehr \u2014 ein Knoten liest Daten \xFCber Adressen in seinen eigenen Feldern.`,en:`${l.en}: \`emits\` on the outcome "${String(c.id)}" no longer exists \u2014 a node reads data through addresses in its own fields.`});"targetFormNodeId"in a&&n(`nodes.${o.id}.targetFormNodeId`,{de:`${l.de}: \`targetFormNodeId\` gibt es nicht mehr \u2014 welches Formular freigeschaltet wird, sagt die Adresse, an die der Eingang \`inputs.target\` gebunden ist ($node.<formular>.admission).`,en:`${l.en}: \`targetFormNodeId\` no longer exists \u2014 the address the input \`inputs.target\` is bound to says which form is unlocked ($node.<form>.admission).`}),"wires"in a&&n(`nodes.${o.id}.wires`,{de:`${l.de}: Datenkanten (\`wires\`) gibt es nicht mehr \u2014 jedes Feld, das Daten eines anderen Knotens liest, tr\xE4gt selbst die volle Adresse ($node.\u2026, $task.\u2026, $env.\u2026).`,en:`${l.en}: data edges (\`wires\`) no longer exist \u2014 every field that reads data of another node carries the full address itself ($node.\u2026, $task.\u2026, $env.\u2026).`});for(let[c,u]of Object.entries(a.inputs??{}))u!==null&&typeof u=="object"&&u.kind==="binding"&&"path"in u&&n(`nodes.${o.id}.inputs.${c}.path`,{de:`${l.de}: Der Eingang \u201E${c}\u201C ist \xFCber einen Pfad (\`path\`) gebunden \u2014 eine Bindung tr\xE4gt die volle Adresse (\`address\`) dessen, was sie liest.`,en:`${l.en}: The input "${c}" is bound through a path (\`path\`) \u2014 a binding carries the full address (\`address\`) of what it reads.`});o.type==="governedDocument"&&"resolver"in a&&n(`nodes.${o.id}.resolver`,{de:`${l.de}: \`resolver\` gibt es nicht mehr \u2014 der Generator ist der Eingang \`inputs.contractGenerator\` ({ kind, key }), seine Parameter stempelt die Plattform (\`generatorStamp\`), ein im Cockpit erg\xE4nzter Parameter ist sein Eingang \`{ kind: "cockpit" }\`.`,en:`${l.en}: \`resolver\` no longer exists \u2014 the generator is the input \`inputs.contractGenerator\` ({ kind, key }), the platform stamps its parameters (\`generatorStamp\`), a parameter completed in the cockpit is its input \`{ kind: "cockpit" }\`.`});let d=a.template;if(o.type==="governedDocument"&&d!==null&&typeof d=="object")for(let c of["key","cockpitFields"])c in d&&n(`nodes.${o.id}.template.${c}`,{de:`${l.de}: \`template.${c}\` gibt es nicht mehr \u2014 ${c==="key"?"die Vorlage ist der Eingang `inputs.documentTemplate`":'ein im Cockpit erg\xE4nzter Parameter ist sein Eingang `{ kind: "cockpit" }`'}.`,en:`${l.en}: \`template.${c}\` no longer exists \u2014 ${c==="key"?"the template is the input `inputs.documentTemplate`":'a parameter completed in the cockpit is its input `{ kind: "cockpit" }`'}.`});if(o.type==="setFlag")for(let c of["target","flagKey","value"])c in a&&n(`nodes.${o.id}.${c}`,{de:`${l.de}: \`${c}\` gibt es am setFlag-Knoten nicht mehr \u2014 Formular, Merkmal und Wert sind die Eing\xE4nge \`inputs.target\` (gebunden an die Adresse $node.<formular>.admission), \`inputs.flagKey\` und \`inputs.value\` (feste Werte).`,en:`${l.en}: \`${c}\` no longer exists on a setFlag node \u2014 form, flag and value are the inputs \`inputs.target\` (bound to the address $node.<form>.admission), \`inputs.flagKey\` and \`inputs.value\` (literals).`});for(let c of Object.keys(Ck[o.type]??{}))c in a&&n(`nodes.${o.id}.${c}`,{de:`${l.de}: \`${c}\` gibt es als Knoteneigenschaft nicht mehr \u2014 es ist der Eingang \`inputs.${c}\` (ein fester Wert im Parameter-Bereich).`,en:`${l.en}: \`${c}\` no longer exists as a node property \u2014 it is the input \`inputs.${c}\` (a fixed value among the parameters).`});for(let c of Array.isArray(a.tasks)?a.tasks:[]){if(c===null||typeof c!="object")continue;let u=String(c.key),p=c.assign;p!==null&&typeof p=="object"&&"userId"in p&&n(`nodes.${o.id}.tasks.${u}.assign.userId`,{de:`Aufgabe "${u}" an ${l.de}: \`assign.userId\` gibt es nicht mehr \u2014 eine Aufgabe nennt ihr Team (\`assign.group\`), nie eine feste Person.`,en:`Task "${u}" on ${l.en}: \`assign.userId\` no longer exists \u2014 a task names its team (\`assign.group\`), never a fixed person.`});for(let[h,y]of Object.entries(xb))h in c&&n(`nodes.${o.id}.tasks.${u}.${h}`,y(u,l))}for(let c of Dk[o.type]??[])c in a&&n(`nodes.${o.id}.${c}`,{de:`${l.de}: \`${c}\` gibt es nicht mehr \u2014 dieser Knotentyp liest es nicht.`,en:`${l.en}: \`${c}\` no longer exists \u2014 this node type does not read it.`});for(let[c,u]of Object.entries(MP[o.type]??{}))c in a&&n(`nodes.${o.id}.${c}`,{de:`${l.de}: ${u.de}`,en:`${l.en}: ${u.en}`});a.adoptForm===!0&&n(`nodes.${o.id}.adoptForm`,{de:`${l.de}: \`adoptForm: true\` gibt es nicht mehr \u2014 \`adoptForm\` ist die Adresse des \xFCbernommenen Formulars ($node.<anlegender Formularknoten>.admission).`,en:`${l.en}: \`adoptForm: true\` no longer exists \u2014 \`adoptForm\` is the address of the adopted form ($node.<creating form node>.admission).`});for(let c of Array.isArray(a.tasks)?a.tasks:[]){let u=c?.result?.kind;typeof u=="string"&&j3.has(u)&&n(`nodes.${o.id}.tasks.${String(c.key)}.result`,{de:`Aufgabe "${String(c.key)}" an ${l.de}: das Ergebnis \u201E${u}" gibt es nicht mehr \u2014 die Gegenzeichnung ist der Knotentyp \u201EUnterschrift (intern)" (countersign).`,en:`Task "${String(c.key)}" on ${l.en}: the result "${u}" no longer exists \u2014 the countersignature is the node type "Signature (internal)" (countersign).`})}}return t}s(CF,"checkRetiredDataFields");function qb(e){let t=new Set(cP()),n=[];for(let r of e.nodes)t.has(r.type)||n.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.type`,reason:{de:`[graph/unknownNodeType] Knoten "${r.id}" hat den unbekannten Typ "${String(r.type)}". Registrierte Typen: ${[...t].join(", ")}.`,en:`[graph/unknownNodeType] Node "${r.id}" has the unknown type "${String(r.type)}". Registered types: ${[...t].join(", ")}.`},severity:"error"});return n}s(qb,"checkKnownNodeTypes");function ks(e,t){return t?.wiring&&t.layout?{wiring:t.wiring,layout:t.layout}:null}s(ks,"resolveLayoutContext");function Kb(e,t){let n=ks(e,t);if(!n)return e.nodes.some(o=>(Ue(o)?.progressEvents?.length??0)>0)?[{layer:"GRAPH",kind:"progressState",path:"graph.progressWiring",reason:{de:`Graph emittiert Progress-Events, aber (Layout, Wiring) konnte nicht aufgel\xF6st werden (Wiring ${t?.wiring?"vorhanden":"fehlt"}, Layout ${t?.layout?"vorhanden":"fehlt"}) \u2014 der Engine wirft beim Spiegeln zur Laufzeit. Der Workflow-Entwurf muss progressLayout und progressWiring tragen.`,en:`The graph emits progress events, but (layout, wiring) could not be resolved (wiring ${t?.wiring?"present":"missing"}, layout ${t?.layout?"present":"missing"}) \u2014 the engine throws at runtime when mirroring. The workflow draft must carry progressLayout and progressWiring.`},severity:"error"}]:[];let r=[];for(let i of e.nodes){let a=Ue(i)?.progressEvents;if(a)for(let l of a){let d=as(n.wiring,{id:i.id,type:i.type},l);if(!d){r.push({layer:"GRAPH",kind:"progressState",path:`node.${i.id}.progressEvents.${l}`,reason:{de:`${i.type} '${i.id}': Progress-Event '${l}' ist im Wiring (Layout '${n.layout.id}') keinem (Bus, State) zugeordnet \u2014 der Engine wirft beim Spiegeln`,en:`${i.type} '${i.id}': progress event '${l}' is not mapped to any (bus, state) in the wiring (layout '${n.layout.id}') \u2014 the engine throws when mirroring`},severity:"error"});continue}let c;try{c=hm(n.layout,d.bus)}catch{r.push({layer:"GRAPH",kind:"progressState",path:`node.${i.id}.progressEvents.${l}`,reason:{de:`${i.type} '${i.id}': Event '${l}' verweist auf unbekannten Bus '${d.bus}' im Layout '${n.layout.id}'`,en:`${i.type} '${i.id}': event '${l}' points to unknown bus '${d.bus}' in layout '${n.layout.id}'`},severity:"error"});continue}Td(c,d.state)||r.push({layer:"GRAPH",kind:"progressState",path:`node.${i.id}.progressEvents.${l}`,reason:{de:`${i.type} '${i.id}': Event '${l}' verweist auf State '${d.state}', der nicht im Bus '${d.bus}' deklariert ist`,en:`${i.type} '${i.id}': event '${l}' points to state '${d.state}', which is not declared in bus '${d.bus}'`},severity:"error"})}}return r}s(Kb,"checkProgressEventMappings");function jb(e,t){let n=ks(e,t);if(!n)return[];let r=[];for(let i of n.layout.buses){if(!i.boards||i.boards.length===0)continue;let o=new Set(i.unboarded??[]),a=new Set;for(let l of i.boards)for(let d of l.columns)for(let c of d.states)a.add(c),Td(i,c)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.board.${l.id}.column.${d.id}.${c}`,reason:{de:`Board '${l.id}', Spalte '${d.id}' referenziert State '${c}', der nicht im Bus '${i.key}' deklariert ist`,en:`Board '${l.id}', column '${d.id}' references state '${c}', which is not declared in bus '${i.key}'`},severity:"error"});for(let l of i.states)a.has(l.id)||o.has(l.id)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.${l.id}`,reason:{de:`State '${l.id}' (${l.label.de}) erscheint in keiner Board-Spalte und nicht in 'unboarded' \u2014 nicht darstellbar`,en:`State '${l.id}' (${l.label.en}) appears in no board column and not in 'unboarded' \u2014 it cannot be displayed`},severity:"error"})}return r}s(jb,"checkProgressBoardCoverage");function Vb(e,t){let n=ks(e,t);if(!n)return[];let r=[];for(let i of n.layout.buses)if(!(!i.boards||i.boards.length===0))for(let o of i.boards)for(let a of We){let l=new Map;for(let d of o.columns){if(!po(d.label))continue;let c=d.label[a],u=c.trim().toLocaleLowerCase(a),p=l.get(u);if(p===void 0){l.set(u,d.id);continue}r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.board.${o.id}.column.${d.id}.label.${a}`,reason:{de:`Board '${o.id}' hat zwei Spalten mit dem Label '${c}' (${a}) ('${p}' und '${d.id}') \u2014 f\xFCr Lesende nicht unterscheidbar. F\xFChre die Spalten zusammen (states beider in EINE Spalte) oder vergib unterschiedliche Labels.`,en:`Board '${o.id}' has two columns with the label '${c}' (${a}) ('${p}' and '${d.id}') \u2014 readers cannot tell them apart. Merge the columns (put the states of both into ONE column) or give them different labels.`},severity:"error"})}}return r}s(Vb,"checkProgressBoardDistinctLabels");function Bb(e,t){let n=ks(e,t);if(!n)return[];let r=[];for(let i of n.layout.buses)for(let o of i.states){let a=gm(i,o.id);o.terminal&&!a&&r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.${o.id}.terminalSemantics`,reason:{de:`Terminal-State '${o.id}' hat keine Terminal-Semantik im Bus '${i.key}' \u2014 der Engine wirft beim Versiegeln`,en:`Terminal state '${o.id}' has no terminal semantics in bus '${i.key}' \u2014 the engine throws when sealing`},severity:"error"}),!o.terminal&&a&&r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.${o.id}.terminalSemantics`,reason:{de:`State '${o.id}' ist nicht terminal, hat aber Terminal-Semantik im Bus '${i.key}' \u2014 Inkonsistenz`,en:`State '${o.id}' is not terminal but has terminal semantics in bus '${i.key}' \u2014 inconsistent`},severity:"error"})}return r}s(Bb,"checkProgressTerminalSemantics");function Ub(e,t){let n=ks(e,t);if(!n)return[];let r=[];for(let i of n.layout.buses){let o=new Set(i.holdsSeat??[]);for(let a of i.holdsSeat??[])Td(i,a)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.holdsSeat.${a}`,reason:{de:`holdsSeat referenziert '${a}', das kein State im Bus '${i.key}' ist`,en:`holdsSeat references '${a}', which is not a state in bus '${i.key}'`},severity:"error"});for(let a of i.commitsSeat??[])Td(i,a)?o.has(a)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.commitsSeat.${a}`,reason:{de:`commitsSeat '${a}' ist nicht in holdsSeat \u2014 ein fest belegter Platz muss auch belegt sein`,en:`commitsSeat '${a}' is not in holdsSeat \u2014 a firmly committed seat must also be held`},severity:"error"}):r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.commitsSeat.${a}`,reason:{de:`commitsSeat referenziert '${a}', das kein State im Bus '${i.key}' ist`,en:`commitsSeat references '${a}', which is not a state in bus '${i.key}'`},severity:"error"});for(let[a,l]of Object.entries(i.terminalSemantics??{}))l.outcome==="approved"&&(o.has(a)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.holdsSeat`,reason:{de:`Endzustand '${a}' schlie\xDFt den Prozess positiv ab (outcome 'approved'), steht aber nicht in holdsSeat \u2014 damit z\xE4hlt er als Absage und f\xE4llt aus dem Fortschrittsbalken. Nimm '${a}' in holdsSeat (und in commitsSeat, wenn der Platz damit wirklich belegt ist) auf.`,en:`Final state '${a}' ends the process positively (outcome 'approved'), but is not in holdsSeat \u2014 so it counts as a rejection and drops out of the progress bar. Add '${a}' to holdsSeat (and to commitsSeat, if the seat is really taken by it).`},severity:"error"}))}return r}s(Ub,"checkProgressSeatStates");var Ym={de:"Abhilfe: nach dem Formularknoten einen review-Knoten einf\xFCgen und dessen 'reviewing' auf diesen Zustand mappen",en:"Remedy: insert a review node after the form node and map its 'reviewing' to this state"};function DF(e,t,n){let r=new Map(e.nodes.map(y=>[y.id,y])),i=new Set(Dn(e.nodes).map(y=>y.target)),o=e.nodes.filter(y=>!i.has(y.id)),a=o.some(y=>y.type==="eventTrigger"),l=s(y=>Object.values(y.next??{}).map(b=>b.to),"routesOf"),d=[],c=s((y,b,k)=>{let v=r.get(y);if(!v||k.has(y)){d.push({at:y,state:null});return}let T=new Set([...k,y]);if(a&&o.includes(v)&&v.type!=="eventTrigger")return;if(v.type==="eventTrigger"&&o.includes(v)){let F=v.next?.[zn]?.to;F===void 0?d.push({at:y,state:null}):c(F,b,T);return}let $=Ue(v);if(Kd[v.type]===!1){if(Ue(v).progressEvents?.length){d.push({at:y,state:null});return}let F=l(v);F.length===0&&d.push({at:y,state:null});for(let N of F)c(N,b,T);return}let I=$.entryProgressEvent?.(v),C=b;if(I!==void 0){let F=as(t,v,I);F?.bus==="process"&&(C=F.state)}if($.advancesAtEntry?.(v)===!0)for(let F of l(v))c(F,b,T);d.push({at:y,state:C})},"walk");for(let y of o)c(y.id,null,new Set);let u=d.map(y=>`'${y.at}'${y.state===null?"":` \u2192 '${y.state}'`}`),p=d.map(y=>y.state===null?null:n.columns.find(b=>b.states.includes(y.state))?.id??null);if(p.length===0||p.includes(null))return{kind:"none",landings:u};let h=[...new Set(p)];return h.length>1?{kind:"many",columnIds:h,landings:u}:{kind:"one",columnId:h[0]}}s(DF,"startColumnOf");function Gb(e,t){let n=ks(e,t);if(!n)return[];if(!n.layout.buses.some(l=>l.key==="process"))return[];let r=eb(n.layout);if(!r)return[];let i=DF(e,n.wiring,r);if(i.kind==="one"){let l=r.columns.find(d=>d.id===i.columnId);return l.defaultCollapsed!==!0&&!TC(l)?[]:[{layer:"GRAPH",kind:"progressState",path:`progressLayout.process.boards.${r.id}.columns.${l.id}`,reason:{de:`[progress/startColumnHidden] Neue Vorg\xE4nge landen in Spalte '${l.id}' (Board '${r.id}'), die ${l.defaultCollapsed===!0?"eingeklappt":"die Warteliste"} ist \u2014 dort w\xE4re das Plus zum Hinzuf\xFCgen nicht zu sehen.`,en:`[progress/startColumnHidden] New applications land in column '${l.id}' (board '${r.id}'), which is ${l.defaultCollapsed===!0?"collapsed":"the waitlist"} \u2014 the add plus would not show there.`},severity:"error"}]}let o=i.landings.join(", "),a=i.kind==="none"?{de:`[progress/startColumnNone] Ein neuer Vorgang landet auf keiner Spalte des Boards '${r.id}' (Start endet bei ${o}) \u2014 ordne den Zustand, mit dem er anh\xE4lt, einer Spalte zu.`,en:`[progress/startColumnNone] A new application lands in no column of board '${r.id}' (the start stops at ${o}) \u2014 put the state it parks with into a column.`}:{de:`[progress/startColumnAmbiguous] Ein neuer Vorgang kann in mehreren Spalten des Boards '${r.id}' landen (${i.columnIds.join(", ")}; Start endet bei ${o}) \u2014 das Plus zum Hinzuf\xFCgen braucht genau eine Startspalte.`,en:`[progress/startColumnAmbiguous] A new application can land in several columns of board '${r.id}' (${i.columnIds.join(", ")}; the start stops at ${o}) \u2014 the add plus needs exactly one start column.`};return[{layer:"GRAPH",kind:"progressState",path:`progressLayout.process.boards.${r.id}`,reason:a,severity:"error"}]}s(Gb,"checkProgressStartColumn");function V3(e){return e==="both"?{de:`${Ym.de} \u2014 die Spalte ist auch der Schritt, den die Familie sieht; den Zustand in die Spalte des Nachfolgers zu legen, n\xE4hme ihr diesen Schritt.`,en:`${Ym.en} \u2014 the column is also the step the family sees; moving the state into the successor's column would take that step away from them.`}:{de:`${Ym.de}, oder den Zustand in die Spalte des Nachfolgers legen.`,en:`${Ym.en}, or move the state into the successor's column.`}}s(V3,"passThroughRemedy");function zb(e,t){let n=ks(e,t);if(!n)return[];let{layout:r,wiring:i}=n;if(!r.buses.some(v=>v.key==="process"))return[];let o=eb(r);if(!o)return[];let a=new Map(e.nodes.map(v=>[v.id,v])),l=s(v=>Ue(v).progressEvents??[],"eventsOf"),d=s(v=>Object.values(v.next??{}).map(T=>T.to),"routesOf"),c=s((v,T)=>{let $=a.get(v);if(!$||T.has(v))return null;if(l($).length>0)return[$];if(Kd[$.type]!==!1)return null;let I=d($);if(I.length===0)return null;let C=[];for(let F of I){let N=c(F,new Set([...T,v]));if(!N)return null;C.push(...N)}return C},"firstProgressNodes"),u=s((v,T)=>{let $=[];for(let I of l(v)){let C=as(i,v,I);if(!C||C.bus!==T.bus||C.state===T.state)return null;$.push(C.state)}return[...new Set($)].join("' / '")},"overwrites"),p=s((v,T)=>{let $=d(v);if($.length===0)return null;let I=[];for(let C of $){let F=c(C,new Set([v.id]));if(!F)return null;for(let N of F){let M=u(N,T);if(M===null)return null;I.push({de:`'${N.id}' (${N.type}) mit '${M}'`,en:`'${N.id}' (${N.type}) with '${M}'`})}}return[...new Map(I.map(C=>[C.de,C])).values()]},"submitOverwrittenBy"),h=new Map;for(let v of e.nodes)for(let T of l(v)){let $=as(i,v,T);if(!$||$.bus!=="process")continue;let I=v.type==="form"&&T===_p?p(v,$):null,C=I?{de:`'${v.id}'.${T} erreicht ihn, und ${I.map(F=>F.de).join(", ")} \xFCberschreibt ihn in derselben Transaktion`,en:`'${v.id}'.${T} reaches it, and ${I.map(F=>F.en).join(", ")} overwrites it in the same transaction`}:null;h.set($.state,[...h.get($.state)??[],C])}let y=hm(r,"process"),b=new Map;for(let[v,T]of h){if(!T.every(I=>I!==null))continue;let $=[...new Map(T.map(I=>[I.de,I])).values()];b.set(v,{de:$.map(I=>I.de).join("; "),en:$.map(I=>I.en).join("; ")})}let k=[];for(let v of o.columns){if(v.states.length===0||!v.states.every(I=>b.has(I)))continue;let T=v.states.map(I=>{let C=y.holdsSeat?.includes(I)===!0,F=b.get(I);return{de:`Zustand '${I}'${C?" (steht in holdsSeat, belegt aber nie einen Platz)":""}: ${F.de}`,en:`State '${I}'${C?" (is in holdsSeat, but never takes a seat)":""}: ${F.en}`}}),$=V3(o.audience);k.push({layer:"GRAPH",kind:"progressState",path:`progressLayout.process.boards.${o.id}.columns.${v.id}`,reason:{de:`[progress/passThroughState] Spalte \u201E${v.label.de}" ('${v.id}', Board '${o.id}') bleibt immer leer \u2014 ${T.map(I=>I.de).join("; ")}. ${$.de}`,en:`[progress/passThroughState] Column "${v.label.en}" ('${v.id}', board '${o.id}') always stays empty \u2014 ${T.map(I=>I.en).join("; ")}. ${$.en}`},severity:"warning"})}return k}s(zb,"checkProgressPassThroughColumns");var Kd={form:!0,decision:!0,review:!0,waitlist:!0,completenessCheck:!0,collectPayment:!0,eventTrigger:!0,join:!1,roleAssign:!1,setFlag:!1,if:!1,end:!1,countersign:!0,engagePush:!1,governedDocument:!0};function B3(e){return e.kind==="task"&&!("title"in e)}s(B3,"isLegacyFreeTodoContext");function Wb(e){let{context:t}=e;if(B3(t)&&D(`[workItems/legacyFreeTodo] work_item ${e._id} is a free to-do in its former shape \u2014 run migrations:freeTodosToContext`),t.kind==="task")return{...e,context:t,kind:"task",createdVia:"human",partyId:t.partyId};let{anchor:n,task:r,kind:i,title:o,description:a,...l}=t,d=n.scope==="node"?{nodeId:n.nodeId,templateKey:n.templateKey,gatesNode:n.gatesNode,blocks:n.blocks}:n.scope==="application"?{scope:"application",templateKey:n.templateKey}:n.scope==="crossNode"?{scope:"application",nodeId:n.nodeId,templateKey:n.templateKey,blocks:n.blocks}:{};return{...e,context:t,...l,...d,...r??{},kind:i}}s(Wb,"readWorkItem");async function Ja(e,t){let n;if(t.nodeId!==void 0){let r=t.nodeId;n=await e.db.query("work_items").withIndex("by_applicationId_and_nodeId",i=>i.eq("context.applicationId",t.applicationId).eq("context.anchor.nodeId",r)).collect()}else if(t.isOpen!==void 0){let r=t.isOpen;n=await e.db.query("work_items").withIndex("by_applicationId_and_isOpen",i=>i.eq("context.applicationId",t.applicationId).eq("isOpen",r)).collect()}else n=await e.db.query("work_items").withIndex("by_applicationId_and_nodeId",r=>r.eq("context.applicationId",t.applicationId)).collect();return n.filter(r=>t.isOpen===void 0||r.isOpen===t.isOpen).map(Wb)}s(Ja,"listWorkItemsForApplication");var hxe=m.union(m.literal("approved"),m.literal("rejected")),jd=new Set(["task","approval"]);function G3(e,t){switch(e){case"task":return t?.gatesNode===!0&&D("expandComposedTask: gatesNode is approval-only \u2014 a 'task' template never gates its node (use blocks to hold a gating sibling back)"),{kind:"task",recipient:"internal",gatesNode:!1};case"approval":return{kind:"approval",recipient:"internal",isApproval:!0,gatesNode:t?.gatesNode??!0};default:D(`expandComposedTask: unknown composed-task kind ${JSON.stringify(e)} \u2014 authorable: ${[...jd].join(", ")}`)}}s(G3,"expandComposedTask");for(let e of["task","approval"]){let t=G3(e);t.kind==="approval"!=(t.isApproval===!0)&&D(`composed-task kind "${e}": isApproval must be present iff kind === 'approval'`)}function Yb(e){let t=["workItems","workitems","work_items","taskTemplates"],n=[];for(let r of e.nodes){let i=r;for(let o of t){let a=i[o];a!=null&&n.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.${o}`,reason:{de:`[workItems/misnamedTasksKey] Knoten "${r.id}" deklariert "${o}" \u2014 komponierte Aufgaben werden ausschlie\xDFlich unter "tasks" gelesen. So wie es dasteht, w\xFCrde die Aufgabenkette stillschweigend nie entstehen. Benenne den Schl\xFCssel in "tasks" um.`,en:`[workItems/misnamedTasksKey] Node "${r.id}" declares "${o}" \u2014 composed tasks are read only from "tasks". As it stands, the task chain would silently never be created. Rename the key to "tasks".`},severity:"error"})}}return n}s(Yb,"checkMisnamedTasksKey");function Hb(e){let t=[];for(let n of e.nodes){let r=n,i=Array.isArray(r.tasks)?r.tasks:[],o=new Set;for(let c of i){let u=typeof c.key=="string"?c.key:void 0;u!==void 0&&(o.has(u)&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}`,reason:{de:`[workItems/duplicateTemplateKey] Doppelter Template-Key "${u}" auf Knoten "${r.id}".`,en:`[workItems/duplicateTemplateKey] Duplicate template key "${u}" on node "${r.id}".`},severity:"error"}),o.add(u))}let a=new Set;for(let c of Array.isArray(r.artifacts)?r.artifacts:[])typeof c.key=="string"&&a.add(`${c.key}Uploaded`);let l=Ue(n),d=new Map((typeof l.workItemTemplates=="function"?l.workItemTemplates(n):[]).map(c=>[c.key,c]));for(let c of i){let u=typeof c.key=="string"?c.key:"?",p=typeof c.kind=="string"?c.kind:void 0;if(p===void 0||!jd.has(p)){t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.kind`,reason:{de:`[workItems/invalidKind] Task "${u}" auf Knoten "${r.id}" hat Art ${JSON.stringify(c.kind)}; komponierbar sind: ${[...jd].join(", ")}.`,en:`[workItems/invalidKind] Task "${u}" on node "${r.id}" has kind ${JSON.stringify(c.kind)}; composable kinds are: ${[...jd].join(", ")}.`},severity:"error"});continue}p==="task"&&c.gatesNode!==void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.gatesNode`,reason:{de:`[workItems/gatesNodeOnTask] 'gatesNode' ist nur f\xFCr die Art 'approval' zul\xE4ssig \u2014 eine Task gated ihren Knoten nie direkt. Um eine gatende Freigabe zur\xFCckzuhalten, 'blocks' verwenden (Task "${u}" auf Knoten "${r.id}").`,en:`[workItems/gatesNodeOnTask] 'gatesNode' is only allowed for the kind 'approval' \u2014 a task never gates its node directly. To hold back a gating approval, use 'blocks' (task "${u}" on node "${r.id}").`},severity:"error"});let h=c.blocks,y=h===void 0?void 0:YD(e,r.id,h.node);if(h!==void 0&&y===null)t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.node`,reason:{de:`[workItems/blocksUnknownNode] 'blocks.node' auf Task "${u}" (Knoten "${r.id}") nennt ${JSON.stringify(h.node)} \u2014 diesen Knoten gibt es im Workflow nicht.`,en:`[workItems/blocksUnknownNode] 'blocks.node' on task "${u}" (node "${r.id}") names ${JSON.stringify(h.node)} \u2014 there is no such node in the workflow.`},severity:"error"});else if(h!==void 0&&y!==void 0&&y!==null){let k=y.node.id===r.id,v=y.node.id,T=k?o:y.composedKeys,$=k?d:y.intrinsicByKey,I=y.node.assign??{};p==="approval"&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks`,reason:{de:`[workItems/blocksOnApproval] 'blocks' ist auf der Art 'approval' verboten \u2014 nur Task-Zeilen d\xFCrfen einen Geschwister-Spawn zur\xFCckhalten (Approval "${u}" auf Knoten "${r.id}").`,en:`[workItems/blocksOnApproval] 'blocks' is forbidden on the kind 'approval' \u2014 only task rows may hold back a sibling spawn (approval "${u}" on node "${r.id}").`},severity:"error"});let C=h.templateKey,F=[...new Set([...T,...$.keys()])].filter(M=>!k||M!==u).join(", "),N={de:F||"keine",en:F||"none"};if(typeof C!="string"||k&&C===u||!T.has(C)&&!$.has(C))t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.templateKey`,reason:{de:`[workItems/blocksUnknownTarget] 'blocks' muss ein Template auf dem Zielknoten benennen \u2014 komponiert ODER intrinsisch (nie sich selbst, nie ohne 'templateKey': die zielfreie Form geh\xF6rt der Maschine, nicht dem Autor). Ziel ${JSON.stringify(C)} auf Knoten "${v}"; zul\xE4ssige Ziele: ${N.de}.`,en:`[workItems/blocksUnknownTarget] 'blocks' must name a template on the target node \u2014 composed OR intrinsic (never itself, never without 'templateKey': the target-less form belongs to the engine, not the author). Target ${JSON.stringify(C)} on node "${v}"; allowed targets: ${N.en}.`},severity:"error"});else if(y.refuse(C)!==null)t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.templateKey`,reason:y.refuse(C),severity:"error"});else{let M=$.get(C);h.except!==void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.except`,reason:{de:`[workItems/blocksExceptRetired] 'blocks.except' auf Task "${u}" (Knoten "${r.id}") gibt es nicht mehr: eine blockierende Aufgabe sperrt die ganze Aktionsgruppe ihres Ziels (bei einer Entscheidung Freigeben, Warteliste, Ablehnen und das Nachr\xFCcken). 'except' entfernen.`,en:`[workItems/blocksExceptRetired] 'blocks.except' on task "${u}" (node "${r.id}") no longer exists: a blocking task locks the whole action group of its target (for a decision: approve, waitlist, reject and promote). Remove 'except'.`},severity:"error"}),M!==void 0&&M.recipient!=="external"&&M.verdictResolved!==!0&&I[C]===void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.templateKey`,reason:{de:`[workItems/blocksUnwiredTarget] Task "${u}" auf Knoten "${r.id}" h\xE4lt "${C}" (Knoten "${v}") zur\xFCck, aber der Knoten weist "${C}" keiner Gruppe zu \u2014 ohne 'assign.${C}' entsteht diese Zeile nie: kein Team bekommt die zur\xFCckgehaltene Arbeit, niemand au\xDFer der verantwortlichen Person kann sie tun. Entweder 'assign.${C}' erg\xE4nzen oder das 'blocks' entfernen.`,en:`[workItems/blocksUnwiredTarget] Task "${u}" on node "${r.id}" holds back "${C}" (node "${v}"), but the node assigns "${C}" to no group \u2014 without 'assign.${C}' this row is never created: no team receives the held-back work, and nobody except the responsible person can do it. Either add 'assign.${C}' or remove the 'blocks'.`},severity:"error"})}}{let k=c.completableIf;if(typeof k=="string"&&k.trim().length>0){let v=k.trim().replace(/^!/,"").trim();a.has(v)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.completableIf`,reason:{de:`[workItems/unknownExport] completableIf "${k}" verweist auf unbekannten Node-Export "${v}"; bekannt: ${[...a].join(", ")||"keine"}.`,en:`[workItems/unknownExport] completableIf "${k}" refers to unknown node export "${v}"; known: ${[...a].join(", ")||"none"}.`},severity:"error"})}}let b=c.params;if(b?.commentRequired!==void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.params.commentRequired`,reason:{de:"[workItems/removedParam] 'params.commentRequired' wurde entfernt \u2014 Kommentar-Pflichten werden am Decision-Node ('commentRequired') autorisiert.",en:"[workItems/removedParam] 'params.commentRequired' was removed \u2014 comment requirements are authored on the decision node ('commentRequired')."},severity:"error"}),p!=="approval"){let k=[];b?.onReject!==void 0&&k.push("params.onReject"),b?.revisionGroup!==void 0&&k.push("params.revisionGroup");for(let v of k)t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.${v}`,reason:{de:`[workItems/approvalOnlyField] '${v}' gilt nur f\xFCr die Art 'approval' (Task "${u}" ist '${p}').`,en:`[workItems/approvalOnlyField] '${v}' only applies to the kind 'approval' (task "${u}" is '${p}').`},severity:"error"});continue}b?.onReject!==void 0&&b.onReject!=="spawnRevision"&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.params.onReject`,reason:{de:`[workItems/invalidOnReject] Erwartet 'spawnRevision', erhalten ${JSON.stringify(b.onReject)}.`,en:`[workItems/invalidOnReject] Expected 'spawnRevision', got ${JSON.stringify(b.onReject)}.`},severity:"error"}),b?.onReject==="spawnRevision"&&(typeof b.revisionGroup!="string"||b.revisionGroup.length===0)&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.params.revisionGroup`,reason:{de:`[workItems/spawnRevisionNoTarget] Approval "${u}" mit 'params.onReject: spawnRevision' ohne 'params.revisionGroup' \u2014 die \xDCberarbeitung h\xE4tte keine Ziel-Gruppe.`,en:`[workItems/spawnRevisionNoTarget] Approval "${u}" with 'params.onReject: spawnRevision' but no 'params.revisionGroup' \u2014 the revision would have no target group.`},severity:"error"})}}return t.push(...HD(e)),t}s(Hb,"checkWorkItemTemplates");function LF(e,t,n){let r=sm(e);return r.length>0?r.map(i=>{let o=i.index===null?t:`${t}.${i.index}`;return i.code==="defaultLast"?FF(o,{de:`[assign/defaultLast] ${n.de}: genau eine Sonst-Zeile (\`when: null\`), und sie steht am Ende \u2014 ${i.detail}.`,en:`[assign/defaultLast] ${n.en}: exactly one default row (\`when: null\`), and it is the last \u2014 ${i.detail}.`}):FF(o,{de:`[assign/shape] ${n.de}${i.index===null?"":`, Zeile ${i.index}`}: ${i.detail}.`,en:`[assign/shape] ${n.en}${i.index===null?"":`, row ${i.index}`}: ${i.detail}.`})}):tC(e).map(({index:i,first:o})=>MF(`${t}.${i}.when`,"warning",{de:`[assign/duplicateRow] ${n.de}: Zeile ${i} hat dieselbe Bedingung wie Zeile ${o} und greift nie.`,en:`[assign/duplicateRow] ${n.en}: row ${i} has the same condition as row ${o} and never applies.`}))}s(LF,"teamRulesIssues");function MF(e,t,n){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:n,severity:t}}s(MF,"issue");function FF(e,t){return MF(e,"error",t)}s(FF,"error");var qF=new Set(["complete","approve","reject"]);function Jb(e){let t=[];for(let n of e.nodes){let r=n,i=Ue(n),o=Array.isArray(r.tasks)?r.tasks.length:0,a=i.workItemTemplates?.(n)??[];if(o+a.length>0){let v=Kd[r.type];v===void 0?t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks`,reason:{de:`[workItems/unknownParkSemantics] Knotentyp "${r.type}" hat keine bekannte Park-Semantik \u2014 NODE_TYPE_PARKS in validators.ts erg\xE4nzen.`,en:`[workItems/unknownParkSemantics] Node type "${r.type}" has no known parking semantics \u2014 add it to NODE_TYPE_PARKS in validators.ts.`},severity:"error"}):v||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks`,reason:{de:`[workItems/templatesOnNonParkingNode] Knoten "${r.id}" (Typ "${r.type}") parkt nie \u2014 seine Work-Item-Templates w\xFCrden im selben Dispatch gespawnt und storniert (totes Muster).`,en:`[workItems/templatesOnNonParkingNode] Node "${r.id}" (type "${r.type}") never parks \u2014 its work-item templates would be spawned and cancelled in the same dispatch (dead pattern).`},severity:"error"})}let l=i.actions?.(n)??[];if(l.length===0&&a.length===0)continue;let d=new Map(l.map(v=>[v.id,v]));for(let v of l)qF.has(v.id)&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actions.${v.id}`,reason:{de:`[capability/reservedActionId] Knotentyp "${r.type}" deklariert die Action "${v.id}" \u2014 reserviert f\xFCr den generischen Complete-/Verdict-Pfad (complete, approve, reject); die Spec muss eine andere Action-Id w\xE4hlen.`,en:`[capability/reservedActionId] Node type "${r.type}" declares the action "${v.id}" \u2014 reserved for the generic complete/verdict path (complete, approve, reject); the spec must choose a different action id.`},severity:"error"});let c=new Set(i.states??[DD]);for(let v of l)if(v.availableIn!==void 0)for(let T of v.availableIn)c.has(T)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actions.${v.id}.availableIn`,reason:{de:`[capability/unknownActionState] Action "${v.id}" auf Knotentyp "${r.type}" ist f\xFCr Zustand "${T}" deklariert \u2014 der Typ kennt nur: ${[...c].join(", ")}.`,en:`[capability/unknownActionState] Action "${v.id}" on node type "${r.type}" is declared for state "${T}" \u2014 the type only knows: ${[...c].join(", ")}.`},severity:"error"});let u=zm(n),p=new Set(u?u.map(v=>v.id):[To]);for(let v of l){if(v.external===void 0)continue;let T=PD(v.external.event),$={de:"hat keine Beschriftung (der Empf\xE4nger bekommt einen leeren Button)",en:"has no label (the recipient would get an empty button)"},I=T?v.kind==="advance"?{de:`ist als "advance" deklariert, l\xF6st den Knoten aber nicht auf (Ereignis "${v.external.event}") \u2014 solche Aktionen sind "internal"`,en:`is declared as "advance", but does not resolve the node (event "${v.external.event}") \u2014 such actions are "internal"`}:v.outcome!==void 0?{de:`nennt das Outcome "${v.outcome}", l\xF6st den Knoten aber nicht auf (Ereignis "${v.external.event}") \u2014 ein Outcome w\xFCrde eine zweite, stille Routing-Vokabel behaupten`,en:`names the outcome "${v.outcome}", but does not resolve the node (event "${v.external.event}") \u2014 an outcome would claim a second, silent routing vocabulary`}:v.label===void 0?$:null:v.kind!=="advance"?{de:`ist als "${v.kind}" deklariert (externe Aktionen l\xF6sen den Knoten auf und m\xFCssen "advance" sein)`,en:`is declared as "${v.kind}" (external actions resolve the node and must be "advance")`}:v.outcome===void 0?{de:"nennt kein Outcome",en:"names no outcome"}:p.has(v.outcome)?v.label===void 0?$:null:{de:`verweist auf das unbekannte Outcome "${v.outcome}" (deklariert: ${[...p].join(", ")||"keine"})`,en:`refers to the unknown outcome "${v.outcome}" (declared: ${[...p].join(", ")||"none"})`};I!==null&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actions.${v.id}.external`,reason:{de:`[capability/externalActionNeedsOutcome] Externe Aktion "${v.id}" auf Knotentyp "${r.type}" ${I.de}.`,en:`[capability/externalActionNeedsOutcome] External action "${v.id}" on node type "${r.type}" ${I.en}.`},severity:"error"})}for(let v of a){let T=v.unlocks;if(T.length===0&&v.verdictResolved!==!0&&v.informational!==!0){t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.workItemTemplates.${v.key}.unlocks`,reason:{de:`[capability/emptyUnlocks] Intrinsisches Template "${v.key}" auf Knoten "${r.id}" schaltet keine Action frei (B5).`,en:`[capability/emptyUnlocks] Intrinsic template "${v.key}" on node "${r.id}" unlocks no action (B5).`},severity:"error"});continue}for(let $ of T)d.get($)===void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.workItemTemplates.${v.key}.unlocks`,reason:{de:`[capability/danglingUnlock] Template "${v.key}" auf Knoten "${r.id}" schaltet unbekannte Action "${$}" frei; deklariert: ${[...d.keys()].join(", ")||"keine"}.`,en:`[capability/danglingUnlock] Template "${v.key}" on node "${r.id}" unlocks the unknown action "${$}"; declared: ${[...d.keys()].join(", ")||"none"}.`},severity:"error"})}let h=new Set(a.map(v=>v.key));for(let v of Object.keys(r.assign??{}))h.has(v)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.assign.${v}`,reason:{de:`[capability/unknownAssignKey] assign-Key "${v}" auf Knoten "${r.id}" ist kein intrinsisches Template dieses Knotentyps; bekannt: ${[...h].join(", ")||"keine"}.`,en:`[capability/unknownAssignKey] assign key "${v}" on node "${r.id}" is not an intrinsic template of this node type; known: ${[...h].join(", ")||"none"}.`},severity:"error"});for(let[v,T]of Object.entries(r.assign??{})){if(T===void 0)continue;let $=`nodes.${r.id}.assign.${v}`,I={de:`Team der Vorlage "${v}" (Knoten "${r.id}")`,en:`team of the template "${v}" (node "${r.id}")`};t.push(...LF(T,$,I));for(let[C,F]of(Array.isArray(T)?T:[]).entries()){let N=F?.when;N==null||!ke(N)||mt(N)||t.push({layer:"GRAPH",kind:"nodeRule",path:`${$}.${C}.when`,severity:"error",reason:{de:`[assign/conditionNotFormField] ${I.de}, Zeile ${C+1}: die Bedingung nennt ${Ge(e,N,"de")} \u2014 ein Team wird nach einem Ja/Nein-Feld eines Formulars gew\xE4hlt ($node.<formular>.admission.<feld>).`,en:`[assign/conditionNotFormField] ${I.en}, row ${C+1}: the condition names ${Ge(e,N,"en")} \u2014 a team is chosen by a yes/no field of a form ($node.<form>.admission.<field>).`}})}}let y=l.filter(v=>v.teamAssignable===!0).map(v=>v.id);for(let v of Object.keys(r.actionTeams??{}))y.includes(v)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actionTeams.${v}`,reason:{de:`[capability/unknownActionTeam] Knoten "${r.id}" nennt ein Team f\xFCr "${v}", aber diese Aktion l\xE4sst sich hier keinem Team geben; m\xF6glich: ${y.join(", ")||"keine"}.`,en:`[capability/unknownActionTeam] Node "${r.id}" names a team for "${v}", but this action cannot be given to a team here; possible: ${y.join(", ")||"none"}.`},severity:"error"});let b=new Set;for(let v of a)if(v.recipient==="external"||(r.assign??{})[v.key]!==void 0)for(let $ of v.unlocks)b.add($);let k=i.strictActionCoverage===!0;for(let v of l){if(b.has(v.id)||v.superUserOnly===!0)continue;let T=a.find(I=>I.unlocks.includes(v.id)),$=T!==void 0?{de:` Fehlt die Zuweisung assign.${T.key}?`,en:` Is the assignment assign.${T.key} missing?`}:{de:"",en:""};t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actions.${v.id}`,reason:{de:`[capability/superUserOnly] Action "${v.id}" auf Knoten "${r.id}" ist von keinem verdrahteten Work-Item freigeschaltet \u2014 nur die verantwortliche Person (Super-User) kann sie ausf\xFChren.${$.de}`,en:`[capability/superUserOnly] Action "${v.id}" on node "${r.id}" is unlocked by no wired work item \u2014 only the responsible person (super user) can perform it.${$.en}`},severity:k?"error":"warning"})}}return t}s(Jb,"checkNodeCapabilityWiring");var KF=[{key:"tenantSlug",type:"string"}];var Vd="subject";function jF(e){return e.category==="login"}s(jF,"isSignInLetter");var Je={key:"schoolName",label:"Name der Schule"},VF={de:"Zu Ihren Bewerbungen",en:"View your applications"},it={key:"portalLink",label:"Link zum Bewerberportal",required:!0,link:!0,actionLabel:VF},Bd={key:it.key,label:it.label,link:!0,actionLabel:VF},gr={key:"applicationLink",label:"Link zur Bewerbung",required:!0,link:!0,actionLabel:{de:"Bewerbung \xF6ffnen",en:"Open application"}},Bi={key:"anmeldeLink",label:"Anmeldelink",required:!0,link:!0,actionLabel:{de:"Jetzt anmelden",en:"Sign in now"},previewValue:{de:"https://beispiel.plexus.schule/anmelden?token=BEISPIEL",en:"https://beispiel.plexus.schule/anmelden?token=BEISPIEL"}},Ud={key:"bestaetigungsLink",label:"Best\xE4tigungslink",required:!0,link:!0,actionLabel:{de:"E-Mail best\xE4tigen",en:"Confirm email address"},previewValue:{de:"https://beispiel.plexus.schule/bestaetigen?token=BEISPIEL",en:"https://beispiel.plexus.schule/bestaetigen?token=BEISPIEL"}},yr={key:"gueltigkeit",label:"G\xFCltigkeitsdauer des Links"};function be(e){return{key:Vd,label:"Betreff",default:e}}s(be,"subjectSlot");var wr=m.object({de:m.string(),en:m.string()}),Xe={tenantSlug:m.string(),applicationId:m.id("applications")},Qa=m.object({...Xe,workItemId:m.id("work_items"),dueAt:m.number()}),Ui={key:"taskTitle",label:"Titel der Aufgabe"},Gi={key:"dueDate",label:"F\xE4lligkeitstag",subjectSafe:!0},kr={key:"applicantName",label:"Name aus der Bewerbung"},bs={key:"appointmentTitle",label:"Anlass des Termins"},vs={key:"appointmentWhen",label:"Datum und Uhrzeit des Termins",required:!0},xs={key:"appointmentLocation",label:"Ort des Termins",required:!0};var z3={key:"passwortLink",label:"Link zum neuen Passwort",required:!0,link:!0,actionLabel:{de:"Neues Passwort festlegen",en:"Set a new password"},previewValue:{de:"https://beispiel.plexus.schule/login/reset?token=BEISPIEL",en:"https://beispiel.plexus.schule/login/reset?token=BEISPIEL"}},W3=m.object({callbackPath:m.string()}),BF={id:"account.loginLink",category:"login",label:"Anmeldelink (Anmeldeseite)",occasion:{de:"Wenn jemand auf der Anmeldeseite einen Anmeldelink anfordert",en:"When someone asks for a sign-in link on the login page"},audience:"internal",frame:"letter",timeline:"hidden",paramsValidator:W3,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Bi,yr],slots:[be({de:"Ihr Anmeldelink f\xFCr Plexus",en:"Your sign-in link for Plexus"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`hier ist Ihr Anmeldelink. Damit melden Sie sich ohne Passwort bei Plexus an:
11511
+ `||r==="\r"){n++;continue}if(r==="'"){let o=n+1,a="";for(;o<e.length&&e.charAt(o)!=="'";)e.charAt(o)==="\\"&&o+1<e.length?(a+=e.charAt(o+1),o+=2):(a+=e.charAt(o),o++);o>=e.length&&D(`Unterminated string at ${n}`),t.push({t:"str",v:a}),n=o+1;continue}if(QH(r)){let o=n;for(;o<e.length&&/[0-9.]/.test(e.charAt(o));)o++;t.push({t:"num",v:Number(e.slice(n,o))}),n=o;continue}if(ZH(r)){let o=n;for(;o<e.length&&XH(e.charAt(o));)o++;let a=e.slice(n,o);HH.has(a)?t.push({t:"kw",v:a}):t.push({t:"ident",v:a}),n=o;continue}let i=e.slice(n,n+2);if(JH.has(i)){t.push({t:"op",v:i}),n+=2;continue}if("<>!".includes(r)){t.push({t:"op",v:r}),n++;continue}if("()[],".includes(r)){t.push({t:"punct",v:r}),n++;continue}D(`Unexpected char '${r}' at ${n}`)}return t}s(eJ,"tokenise");var ZN=1e4,XN=128;function wa(e){e.depth++,e.depth>XN&&D(`Expression nesting too deep (> ${XN})`)}s(wa,"enterDepth");function oP(e){return e.pos<e.tokens.length?e.tokens[e.pos]:null}s(oP,"peek");function nn(e){let t=e.tokens[e.pos];return t||D(`Unexpected end at ${e.pos}`),e.pos++,t}s(nn,"take");function on(e,t,n){let r=oP(e);return!(!r||r.t!==t||n!==void 0&&r.v!==n)}s(on,"match");function ts(e,t,n){return on(e,t,n)||D(`Expected ${t}${n?`:${n}`:""} at ${e.pos}`),nn(e)}s(ts,"expect");function Ni(e){wa(e);try{return on(e,"kw","if")?tJ(e):nJ(e)}finally{e.depth--}}s(Ni,"parseExpr");function tJ(e){ts(e,"kw","if"),ts(e,"punct","(");let t=Ni(e);ts(e,"punct",")");let n=Ni(e);ts(e,"kw","else");let r=Ni(e);return{kind:"if",cond:t,then:n,else:r}}s(tJ,"parseIf");function nJ(e){let t=eP(e),n=0;try{for(;on(e,"op","||");){nn(e),wa(e),n++;let r=eP(e);t={kind:"binary",op:"||",left:t,right:r}}}finally{e.depth-=n}return t}s(nJ,"parseLogicOr");function eP(e){let t=tP(e),n=0;try{for(;on(e,"op","&&");){nn(e),wa(e),n++;let r=tP(e);t={kind:"binary",op:"&&",left:t,right:r}}}finally{e.depth-=n}return t}s(eP,"parseLogicAnd");function tP(e){let t=nP(e),n=0;try{for(;on(e,"op","==")||on(e,"op","!=");){let r=nn(e).v;wa(e),n++;let i=nP(e);t={kind:"binary",op:r,left:t,right:i}}}finally{e.depth-=n}return t}s(tP,"parseEquality");function nP(e){let t=Sk(e),n=0;try{for(;on(e,"op","<")||on(e,"op","<=")||on(e,"op",">")||on(e,"op",">=")||on(e,"kw","in");){let r=nn(e),i=r.t==="kw"?"in":r.v;wa(e),n++;let o=Sk(e);t={kind:"binary",op:i,left:t,right:o}}}finally{e.depth-=n}return t}s(nP,"parseCompare");function Sk(e){if(on(e,"op","!")){nn(e),wa(e);try{return{kind:"unary",op:"!",operand:Sk(e)}}finally{e.depth--}}return rJ(e)}s(Sk,"parseUnary");function rJ(e){let t=oP(e);if(t||D("Unexpected end"),t.t==="num")return nn(e),{kind:"num",value:t.v};if(t.t==="str")return nn(e),{kind:"str",value:t.v};if(t.t==="kw"&&t.v==="true")return nn(e),{kind:"bool",value:!0};if(t.t==="kw"&&t.v==="false")return nn(e),{kind:"bool",value:!1};if(t.t==="kw"&&t.v==="null")return nn(e),{kind:"null"};if(t.t==="punct"&&t.v==="("){nn(e);let n=Ni(e);return ts(e,"punct",")"),n}if(t.t==="punct"&&t.v==="["){nn(e);let n=[];if(!on(e,"punct","]"))for(n.push(Ni(e));on(e,"punct",",");)nn(e),n.push(Ni(e));return ts(e,"punct","]"),{kind:"arr",items:n}}if(t.t==="ident"){let n=t.v;if(nn(e),on(e,"punct","(")){nn(e);let r=[];if(!on(e,"punct",")"))for(r.push(Ni(e));on(e,"punct",",");)nn(e),r.push(Ni(e));return ts(e,"punct",")"),{kind:"call",name:n,args:r}}return{kind:"ident",path:n}}D(`Unexpected token at ${e.pos}`)}s(rJ,"parsePrimary");function Mt(e){e.length>ZN&&D(`Expression too long (${e.length} > ${ZN})`);let t={tokens:eJ(e),pos:0,depth:0},n=Ni(t);return t.pos<t.tokens.length&&D(`Unexpected trailing token at ${t.pos}`),n}s(Mt,"parseExpression");var iJ=new Map([["today",()=>new Date().toISOString().slice(0,10)],["years_between",(e,t)=>{if(typeof e!="string"||typeof t!="string")return null;let n=new Date(e),r=new Date(t);if(isNaN(n.getTime())||isNaN(r.getTime()))return null;let i=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return(o<0||o===0&&r.getDate()<n.getDate())&&i--,i}],["length",e=>typeof e=="string"||Array.isArray(e)?e.length:0]]);function rn(e,t){switch(e.kind){case"num":return e.value;case"str":return e.value;case"bool":return e.value;case"null":return null;case"ident":{let n=Object.hasOwn(t.values,e.path)?t.values[e.path]:void 0;return n===void 0?null:n}case"arr":return e.items.map(n=>rn(n,t));case"unary":{let n=rn(e.operand,t);return!ns(n)}case"call":{let n=t.functions!==void 0&&Object.hasOwn(t.functions,e.name)?t.functions[e.name]:iJ.get(e.name);n||D(`Unknown function '${e.name}'`);let r=e.args.map(i=>rn(i,t));return n(...r)}case"binary":return oJ(e.op,e.left,e.right,t);case"if":return ns(rn(e.cond,t))?rn(e.then,t):rn(e.else,t)}}s(rn,"evaluate");function oJ(e,t,n,r){if(e==="&&"){let a=rn(t,r);return ns(a)?ns(rn(n,r)):!1}if(e==="||"){let a=rn(t,r);return ns(a)?!0:ns(rn(n,r))}let i=rn(t,r),o=rn(n,r);switch(e){case"==":return xk(i,o);case"!=":return!xk(i,o);case"<":{let[a,l]=Hp(i,o);return a!==null&&l!==null&&a<l}case"<=":{let[a,l]=Hp(i,o);return a!==null&&l!==null&&a<=l}case">":{let[a,l]=Hp(i,o);return a!==null&&l!==null&&a>l}case">=":{let[a,l]=Hp(i,o);return a!==null&&l!==null&&a>=l}case"in":return Array.isArray(o)?o.some(a=>xk(a,i)):!1}}s(oJ,"evalBinary");function Hp(e,t){return[rP(e),rP(t)]}s(Hp,"orderedOperands");function rP(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"){if(e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}return null}s(rP,"numericOperand");function xk(e,t){return e===t?!0:e==null||t==null?!1:typeof e=="number"&&typeof t=="string"?e===Number(t):typeof e=="string"&&typeof t=="number"?Number(e)===t:!1}s(xk,"looseEq");function ns(e){return!(e==null||e===!1||e===0||e===""||Array.isArray(e)&&e.length===0)}s(ns,"truthy");function qt(e){let t=new Set;return _i(e,t),[...t]}s(qt,"dependencies");function _i(e,t){switch(e.kind){case"ident":t.add(e.path);return;case"call":e.args.forEach(n=>_i(n,t));return;case"arr":e.items.forEach(n=>_i(n,t));return;case"unary":_i(e.operand,t);return;case"binary":_i(e.left,t),_i(e.right,t);return;case"if":_i(e.cond,t),_i(e.then,t),_i(e.else,t);return;default:return}}s(_i,"walk");var iP=new Map;function Pi(e){let t=iP.get(e);return t||(t=Mt(e),iP.set(e,t)),t}s(Pi,"parseCached");function sJ(e,t){return rn(Pi(e),t)}s(sJ,"evalExpression");function sP(e,t){return ns(sJ(e,t))}s(sP,"evalBoolean");function aP(e,t){t!==null&&(typeof t=="object"||typeof t=="function")&&Object.hasOwn(t,"exports")&&D(`[workflow/registry] node type "${e}": custom spec.exports is unsupported; use artifact-slot exports.`)}s(aP,"assertNoCustomNodeExports");var Ak=null;function lP(e){for(let[t,n]of Object.entries(e))aP(t,n);Ak=e}s(lP,"setSpecs");function dP(){return Ak||D("[workflow/registry] Specs not initialised. Import convex/model/admission/specs before calling specFor()."),Ak}s(dP,"requireSpecs");function Ue(e){let t=dP(),n=t[e.type];return n===void 0&&de("INVALID",{de:`[workflow/registry] Unbekannter Knotentyp "${String(e.type)}" (Knoten "${String(e.id)}"). Registrierte Typen: ${Object.keys(t).sort().join(", ")}.`,en:`[workflow/registry] Unknown node type "${String(e.type)}" (node "${String(e.id)}"). Registered types: ${Object.keys(t).sort().join(", ")}.`}),n}s(Ue,"specFor");function cP(){return Object.keys(dP()).sort()}s(cP,"registeredNodeTypes");var uP=Fp.filter(e=>Ei[e].cohortBound!==!0);function Tk(e){return ur(e)&&Ei[e].cohortBound!==!0}s(Tk,"isEnvAddressLeaf");function Rk(e){return Jo(e).type}s(Rk,"envType");function $k(e){return Jo(e).label}s($k,"envLabel");function Ek(e){if(e.scope==="env"||e.path===void 0)return e;switch(e.scope){case"node":return{scope:"node",owner:e.owner,key:e.key};case"task":return{scope:"task",owner:e.owner,key:e.key}}}s(Ek,"addressBase");function pr(e){return e.scope==="node"&&e.key===Yt&&e.path===void 0}s(pr,"isInstanceAddress");function mt(e){return ke(e)&&e.scope==="node"&&e.key===Yt&&e.path!==void 0}s(mt,"isFormFieldAddress");function fP(e){return mt(e)?{owner:e.owner,path:e.path}:null}s(fP,"formFieldOf");function aJ(e){return qt(Pi(e)).map(t=>{if(!t.startsWith("$"))return{identifier:t,address:null,reason:"bareIdentifier"};let n=Ri(t);return n===null?{identifier:t,address:null,reason:"shape"}:{identifier:t,address:n}})}s(aJ,"expressionAddresses");var Yt="admission",Ik="document",Qp="contract",Zp="contracts",pP="payment",Ok=new Set(["adoptForm","setFlagTarget","form","familyRequestFrom"]);var xn={id:"identity",type:"identity",label:"display",sublabel:"display",library:"display",outcomes:"control",outputLabels:"display",inputs:"input",next:"control",tasks:"config",assign:"reference",actionTeams:"reference",optionalActions:"config",artifacts:"config",notifications:"config"},Mhe={join:{...xn},end:{...xn},eventTrigger:{...xn},form:{...xn,adoptForm:"address",formExports:"stamp"},roleAssign:{...xn},setFlag:{...xn},if:{...xn,condition:"address"},countersign:{...xn,contract:"address",titles:"display",signing:"config"},engagePush:{...xn,engage:"tenantRef",form:"address",contract:"address",payment:"address"},decision:{...xn,commentRequired:"config",decisionAsTask:"config",reads:"address",view:"config",requiresOneOf:"config"},review:{...xn,form:"address",commentRequired:"config",decisionAsTask:"config"},waitlist:{...xn},completenessCheck:{...xn,requires:"address",deadline:"config"},collectPayment:{...xn},governedDocument:{...xn,production:"config",form:"address",generatorStamp:"stamp",templateStamp:"stamp",approval:"config",confirmBeforeIssue:"config",confirmContractTerms:"config",contractTermsQuestionText:"display",responseStrategy:"config",titles:"display",responseLabels:"display",reads:"address"}};function ai(e){return Array.isArray(e)?e:[]}s(ai,"listOf");function Sn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}s(Sn,"record");function mP(e){switch(e.type){case"countersign":return["contract"];case"engagePush":return["form","contract","payment"];case"governedDocument":return e.production==="resolver"?["form"]:[];case"review":return["form"];default:return[]}}s(mP,"dataSourceFieldsOf");function hP(e){return e.type==="review"?[]:e.type==="engagePush"?["form"]:mP(e)}s(hP,"requiredDataSourceFields");var lJ={setFlag:{target:"setFlagTarget"}};function hd(e,t={}){let n=[],r=e,i=`nodes.${e.id}`,o=s((d,c,u,p={})=>{n.push({kind:d,at:c,nodeId:e.id,value:u,judgedTogether:null,...p})},"field"),a=new Map(t.slotTypes===!1?[]:(Ue(e).inputs?.(e)??[]).map(d=>[d.id,d.type])),l=lJ[e.type]??{};for(let[d,c]of Object.entries(Sn(r.inputs)??{})){let u=Sn(c);if(u?.kind!=="binding")continue;let p="address"in u?u.address:u.path,h=l[d];if(h!==void 0){o(h,`${i}.inputs.${d}`,p);continue}let y=a.get(d);o("binding",`${i}.inputs.${d}`,p,y!==void 0?{expectedType:y}:{})}for(let[d,c]of ai(r.reads).entries())o("nodeReads",`${i}.reads.${d}`,c,{judgedTogether:`${i}.reads`});for(let[d,c]of ai(r.requires).entries())o("requires",`${i}.requires.${d}`,c,{judgedTogether:`${i}.requires`});e.type==="form"&&r.adoptForm!==void 0&&o("adoptForm",`${i}.adoptForm`,r.adoptForm);for(let d of mP(e))r[d]!==void 0&&o(d,`${i}.${d}`,r[d]);e.type==="if"&&r.condition!==void 0&&o("condition",`${i}.condition`,r.condition);for(let[d,c]of Object.entries(Sn(r.assign)??{}))for(let[u,p]of ai(c).entries()){let h=Sn(p)?.when;h!=null&&o("teamWhen",dJ(e.id,d,u),h,{expectedType:"boolean"})}for(let[d,c]of ai(r.tasks).entries())n.push(...gP(e.id,c,d));for(let[d,c]of ai(r.optionalActions).entries()){let u=Sn(c);u?.when!==void 0&&o("optionalActionWhen",cJ(e.id,typeof u.key=="string"?u.key:String(d)),u.when)}return n}s(hd,"nodeAddressFields");function dJ(e,t,n){return`nodes.${e}.assign.${t}.${n}.when`}s(dJ,"teamWhenPath");function cJ(e,t){return`nodes.${e}.optionalActions.${t}.when`}s(cJ,"optionalActionWhenPath");function gP(e,t,n){let r=Sn(t);if(r===null)return[];let i=[],o=typeof r.key=="string"?r.key:String(n),a=`nodes.${e}.tasks.${o}`,l=s((p,h,y,b={})=>{i.push({kind:p,at:h,nodeId:e,taskKey:o,value:y,judgedTogether:null,...b})},"field"),d=`${a}.evidence`;r.when!==void 0&&l("taskWhen",`${a}.when`,r.when,{expectedType:"boolean",judgedTogether:d});for(let[p,h]of ai(r.reads).entries())l("taskReads",`${a}.reads.${p}`,h,{judgedTogether:d});for(let[p,h]of ai(r.inputs).entries())l("taskInput",`${a}.inputs.${p}`,h);for(let[p,h]of ai(r.documents).entries()){let y=Sn(h);y===null||y.kind!=="field"||l("taskDocument",`${a}.documents.${p}`,y.address)}let c=Sn(r.familyRequest);if(c!==null){for(let[p,h]of ai(c.fields).entries())l("familyRequestFields",`${a}.familyRequest.fields.${p}`,h,{judgedTogether:`${a}.familyRequest.fields`});c.from!==void 0&&l("familyRequestFrom",`${a}.familyRequest.from`,c.from)}let u=Sn(r.result);if(u?.kind==="record")for(let[p,h]of ai(u.fields).entries()){let y=Sn(Sn(h)?.suggest);if(y?.kind!=="form")continue;let b=Sn(h)?.type;l("suggest",`${a}.result.fields.${p}.suggest`,"address"in y?y.address:y.key,typeof b=="string"?{expectedType:b}:{})}return i}s(gP,"taskAddressFields");function ka(e){return _k(e)?(Nk(e.value)??[]).flatMap(t=>t.address===null?[]:[t.address]):ke(e.value)?[e.value]:[]}s(ka,"addressesInField");function _k(e){return e.kind==="condition"||e.kind==="optionalActionWhen"}s(_k,"isExpressionField");function Nk(e){if(typeof e!="string"||e.trim().length===0)return null;try{Pi(e)}catch{return null}return aJ(e)}s(Nk,"conditionAddresses");function Cn(e){return e.type==="form"&&e.adoptForm!==void 0&&e.adoptForm!==!1}s(Cn,"adoptsForm");function yP(e){if(e.type!=="form"||Cn({type:e.type,adoptForm:e.adoptForm}))return;let t=e.inputs?.smartForm;return t?.kind==="literal"&&typeof t.value=="string"&&t.value!==""?t.value:void 0}s(yP,"createdSmartFormSlug");function uJ(e,t){return e.type!=="governedDocument"||e.production!=="resolver"||t!==Ik?t:e.generatorStamp?.parts!==void 0?Zp:Qp}s(uJ,"addressKeyOfPort");function wP(e){let t=e.result;return t===void 0||!ga(t)?[]:Yp(t).map(n=>n.key)}s(wP,"storeWritesOf");function Pk(e,t){return(Array.isArray(e.processStore)?e.processStore:[]).find(n=>n.key===t)}s(Pk,"declaredKey");function li(e,t){let n=[];if(!Cn(t))for(let r of Ue(t).outputs?.(t)??[])n.push({address:{scope:"node",owner:t.id,key:uJ(t,r.name)},type:r.type,...r.label!==void 0?{label:r.label}:{},nodeId:t.id,nodePort:r});for(let r of Array.isArray(t.tasks)?t.tasks:[])for(let i of wP(r)){let o=Pk(e,i);n.push({address:{scope:"task",owner:r.key,key:i},type:o?.type??"unknown",...o!==void 0?{label:o.label}:{},nodeId:t.id})}return n}s(li,"producedAddresses");function kP(e,t,n){for(let r of e.nodes)for(let i of Array.isArray(r.tasks)?r.tasks:[])if(i.key===t&&wP(i).includes(n))return{nodeId:r.id,template:i};return null}s(kP,"taskWriter");function Ci(e,t,n){return kP(e,t,n)?.nodeId??null}s(Ci,"taskOwnerNode");function fJ(e){return hd(e,{slotTypes:!1}).flatMap(t=>ka(t).map(n=>({address:n,field:t})))}s(fJ,"writtenAddressesOf");function rs(e,t){let n=[],r=new Set,i=s((a,l,d,c)=>{let u=`${ce(a)}|${l}|${d.at}|${c===void 0?"":ce(c)}`;r.has(u)||(r.add(u),n.push({address:a,origin:l,field:d,...c!==void 0?{via:c}:{}}))},"push"),o=s((a,l)=>{if(a.scope!=="task")return;let d=kP(e,a.owner,a.key);if(d!==null){for(let c of gP(d.nodeId,d.template))if(!(c.kind!=="taskWhen"&&c.kind!=="taskReads"))for(let u of ka(c))i(u,"evidence",l,a)}},"carried");for(let{address:a,field:l}of fJ(t))i(a,"written",l),o(a,l);return n}s(rs,"addressReadsOf");function gd(e,t){switch(t.scope){case"env":return ur(t.key)?Rk(t.key):ua(e,t.key)?.type;case"task":return t.path!==void 0||Ci(e,t.owner,t.key)===null?void 0:Pk(e,t.key)?.type;case"node":{let n=e.nodes.find(i=>i.id===t.owner);if(n===void 0)return;let r=li(e,n).find(i=>i.address.scope==="node"&&i.address.key===t.key);return r===void 0?void 0:t.path===void 0?r.type:r.nodePort?.schema?.find(i=>i.key===t.path)?.type}}}s(gd,"addressType");function Jp(e,t){let n=Sn(e)?.[t];return typeof n=="string"&&n.length>0?n:void 0}s(Jp,"labelText");function Pe(e,t,n){let r=e.nodes.find(i=>i.id===t);return Jp(r?.label,n)??t}s(Pe,"nodeDisplayName");function is(e,t,n){for(let r of e.nodes){let i=(Array.isArray(r.tasks)?r.tasks:[]).find(o=>o.key===t);if(i!==void 0)return Jp(i.title,n)??t}return t}s(is,"taskDisplayName");function Ge(e,t,n){let r=[];switch(t.scope){case"env":r.push(ur(t.key)?$k(t.key)[n]:ua(e,t.key)?.label[n]??t.key);break;case"task":r.push(is(e,t.owner,n),Jp(Pk(e,t.key)?.label,n)??t.key);break;case"node":{r.push(Pe(e,t.owner,n));let i=e.nodes.find(a=>a.id===t.owner),o=i===void 0?void 0:li(e,i).find(a=>a.address.scope==="node"&&a.address.key===t.key);r.push(Jp(o?.label,n)??t.key);break}}return t.scope!=="env"&&t.path!==void 0&&r.push(t.path),`${r.join(" \u203A ")} (${ce(t)})`}s(Ge,"displayAddress");var yd=["beneficiary","signers"];function wd(e){let t=[];for(let[n,r]of Object.entries(Sn(e.inputs)??{})){let i=Sn(r);i?.kind==="binding"&&ke(i.address)&&t.push({slot:n,address:i.address})}return t}s(wd,"bindingAddresses");function bP(e,t){return wd(e).find(n=>n.slot===t)?.address??null}s(bP,"bindingAddressAt");function vP(e,t){let n=s(i=>i.scope==="node"&&i.owner===t||i.scope==="task"&&Ci(e,i.owner,i.key)===t,"names");return e.nodes.filter(i=>i.id!==t).flatMap(i=>hd(i,{slotTypes:!1})).flatMap(i=>ka(i).filter(n).map(o=>({at:i.at,nodeId:i.nodeId,address:o})))}s(vP,"addressesNaming");var Kt={target:"target",flagKey:"flagKey",value:"value"};function pJ(e){return bP(e,Kt.target)}s(pJ,"setFlagTarget");function xP(e){let t=pJ(e);return t!==null&&pr(t)?t.owner:null}s(xP,"setFlagTargetOwner");function Xp(e){let t=e.inputs?.[Kt.flagKey];return t?.kind==="literal"&&typeof t.value=="string"&&t.value.length>0?t.value:null}s(Xp,"setFlagKey");function SP(e){let t=e.inputs?.[Kt.value];if(t===void 0||t.kind==="unset")return!0;if(t.kind==="literal"&&typeof t.value=="boolean")return t.value;D(`[setFlag/valueType] setFlag node "${String(e.id)}": \`${Kt.value}\` is no yes/no literal \u2014 publish refuses that`)}s(SP,"setFlagValue");function AP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(AP,"isObject");var TP=["target","flagKey","value"];function RP(e){return AP(e)&&e.type==="setFlag"&&TP.some(t=>t in e)}s(RP,"oldShape");function $P(e){return(e?.nodes??[]).some(RP)}s($P,"needsSetFlagInputMove");function mJ(e){let t=AP(e.inputs)?{...e.inputs}:{};if(TP.some(a=>a in e&&Kt[a]in t))return{unmoved:"inputExists"};if("target"in e&&!ke(e.target))return{unmoved:"targetNotAddress"};if("flagKey"in e&&typeof e.flagKey!="string")return{unmoved:"flagKeyNotString"};if("value"in e&&typeof e.value!="boolean")return{unmoved:"valueNotBoolean"};let{target:n,flagKey:r,value:i,...o}=e;return n!==void 0&&(t[Kt.target]={kind:"binding",address:n}),typeof r=="string"&&r.length>0&&(t[Kt.flagKey]={kind:"literal",value:r}),i!==void 0&&(t[Kt.value]={kind:"literal",value:i}),{node:{...o,inputs:t}}}s(mJ,"moveNode");function EP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!RP(i))return i;let o=mJ(i);return"unmoved"in o?(n.push({nodeId:String(i.id),reason:o.unmoved}),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(EP,"moveSetFlagConfigToInputs");function IP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(IP,"isObject");var Ck={countersign:{dueInDays:"number"},decision:{allowSkipInTest:"boolean"},completenessCheck:{guestRole:"string"},governedDocument:{responseDueInDays:"number"}},Dk={review:["allowSkipInTest"]};function OP(e){return Ck[String(e)]??{}}s(OP,"movesOf");function _P(e){return Dk[String(e)]??[]}s(_P,"deadOf");function NP(e){return IP(e)&&[...Object.keys(OP(e.type)),..._P(e.type)].some(t=>t in e)}s(NP,"oldShape");function PP(e){return(e?.nodes??[]).some(NP)}s(PP,"needsScalarInputMove");function hJ(e,t){return t==="number"?typeof e=="number"&&Number.isInteger(e)&&e>=1:typeof e===t}s(hJ,"wellTyped");function gJ(e){let t=IP(e.inputs)?{...e.inputs}:{},n={...e};for(let[r,i]of Object.entries(OP(e.type))){if(!(r in e))continue;let o=e[r];if(r in t)return{unmoved:{nodeId:String(e.id),key:r,reason:"inputExists"}};if(!(i==="string"&&o==="")&&!hJ(o,i))return{unmoved:{nodeId:String(e.id),key:r,reason:"valueWrongType"}};o!==""&&(t[r]={kind:"literal",value:o}),delete n[r]}for(let r of _P(e.type))delete n[r];return n.inputs=t,{node:n}}s(gJ,"moveNode");function CP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!NP(i))return i;let o=gJ(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(CP,"moveScalarConfigToInputs");var ba={team:{label:{de:"Team",en:"Team"},optionSource:"tenantTeams",existence:{check:"generic",catalog:"teamKeys"}},roleKey:{label:{de:"Rolle",en:"Role"},optionSource:"tenantRoles",existence:{check:"node",codes:["roleAssign/unknownRoleKey","completenessCheck/unknownRole"]}},article:{label:{de:"Artikel",en:"Article"},optionSource:"programArticles",existence:{check:"node",codes:["collectPayment/unknownArticle"]}},legalEntity:{label:{de:"Tr\xE4ger",en:"Legal entity"},optionSource:"tenantTraeger",existence:{check:"node",codes:["governedDocument/unknownTraeger","collectPayment/unknownPayee"]}},contractGenerator:{label:{de:"Vertragsgenerator",en:"Contract generator"},optionSource:"tenantGenerators",existence:{check:"publish",by:"admittedGeneratorByKey"}},documentTemplate:{label:{de:"Dokumentvorlage",en:"Document template"},optionSource:"tenantDocumentTemplates",existence:{check:"publish",by:"governedDocument/unknownTemplate"}},smartForm:{label:{de:"Formular",en:"Form"},optionSource:"offerSmartForms",existence:{check:"publish",by:"form/unknownSmartForm"}},unit:{label:{de:"Einrichtung",en:"Unit"},optionSource:"tenantUnits",existence:{check:"generic",catalog:"unitKeys"}},formFlag:{label:{de:"Merkmal im Formular",en:"Flag in the form"},optionSource:"targetFormFlags",existence:{check:"node",codes:["setFlag/unknownFlag"]}}};function em(e){return typeof e=="string"&&Object.hasOwn(ba,e)}s(em,"isResourceType");var Xhe=Object.keys(ba).filter(e=>ba[e].existence.check==="generic");function DP(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.groupKey=="string"&&t.groupKey.length>0&&Array.isArray(t.grantKeys)&&t.grantKeys.every(n=>typeof n=="string"&&n.length>0)&&(t.reduction===void 0||es(t.reduction)===null&&t.reduction.kind==="amount")&&Object.keys(t).every(n=>n==="groupKey"||n==="grantKeys"||n==="reduction")}s(DP,"isPricedGroupValue");var Fk=["street","hausnr","plz","ort","land"];function FP(e){return Fk.includes(e)}s(FP,"isAddressPart");var yJ=["municipality","municipalityKey","district","districtKey"],Lk=[...Fk,...yJ],Mk={string:"text",email:"text",tel:"text",number:"number",date:"date",boolean:"boolean",consent:"boolean",enum:"option",address:"composite",docRef:"file",party:"edge",personRef:"edge",personList:"edge",roleKey:"roleKey",pricedItem:"pricedItem",pricedGroup:"pricedGroup",reduction:"reduction",article:"article",legalEntity:"legalEntity",contractGenerator:"contractGenerator",documentTemplate:"documentTemplate",localizedText:"localizedText",staffUser:"staffUser",staffUserList:"staffUser",taskAssignment:"taskAssignment"},va=Object.keys(Mk);function di(e){return typeof e=="string"&&e in Mk}s(di,"isValueType");function gn(e){return e===void 0?void 0:Mk[e]}s(gn,"dataTypeOf");function tm(e,t){let n=gn(e),r=gn(t);return n!==void 0&&n===r}s(tm,"valueTypesCompatible");function os(e){return e===null?"null is not a text in both languages":kd(e,{type:"localizedText"})}s(os,"completeLocalizedTextIssue");function kd(e,t){if(em(t.type)&&!di(t.type))return typeof e=="string"&&e.length>0?null:`${JSON.stringify(e)} is not a ${t.type} key`;let n=gn(t.type),r=JSON.stringify(e),i=`slot type "${t.type}" takes a binding, not a literal`;if(n===void 0||n==="composite"||n==="file"||n==="edge"||n==="staffUser"||n==="taskAssignment")return i;if(e===null)return null;switch(n){case"text":return typeof e=="string"?null:`${r} is not a text (slot type "${t.type}")`;case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?null:`${r} is not a date YYYY-MM-DD`;case"number":return typeof e=="number"&&Number.isFinite(e)?null:`${r} is not a number`;case"boolean":return typeof e=="boolean"?null:`${r} is not true/false`;case"option":{if(typeof e!="string")return`${r} is not an option value`;let o=(t.enumOptions??[]).map(a=>a.value);return o.length===0||o.includes(e)?null:`${r} is not one of the options ${o.join(", ")}`}case"pricedItem":{let o=e;return typeof o=="object"&&typeof o.itemKey=="string"&&o.itemKey.length>0&&Array.isArray(o.grantKeys)&&o.grantKeys.every(a=>typeof a=="string")?null:`${r} is not a priced item {"itemKey":\u2026,"grantKeys":[\u2026]}`}case"pricedGroup":return DP(e)?null:`${r} is not a priced group {"groupKey":\u2026,"grantKeys":[\u2026]}`;case"article":return typeof e=="string"&&e.length>0?null:`${r} is not an article key`;case"legalEntity":return typeof e=="string"&&e.length>0?null:`${r} is not a legal entity key`;case"contractGenerator":return fd(e)?null:`${r} is not a contract generator {"kind":"generator"|"package","key":\u2026,"revision"?:n}`;case"documentTemplate":return typeof e=="string"&&e.length>0?null:`${r} is not a document template key`;case"roleKey":return typeof e=="string"&&e.length>0?null:`${r} is not a role key`;case"localizedText":{let o=e,a=s(l=>typeof l=="string"&&l.trim().length>0,"filled");return typeof o=="object"&&Object.keys(o).sort().join(",")==="de,en"&&a(o.de)&&a(o.en)?null:`${r} is not a text in both languages {"de":\u2026,"en":\u2026}`}case"reduction":{let o=es(e);return o===null?null:`${r} is not a reduction \u2014 ${o.en}`}}}s(kd,"literalTypeIssue");function LP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(LP,"isObject");var wJ={collectPayment:{reason:"reason"}},kJ={governedDocument:["mockAutoProduce"]},MP={collectPayment:{reason:{de:"`reason` gibt es als Knoteneigenschaft nicht mehr \u2014 der Hinweis f\xFCr die Familie ist der Eingang `inputs.reason` (ein fester Text auf Deutsch und Englisch im Parameter-Bereich).",en:"`reason` no longer exists as a node property \u2014 the note for the family is the input `inputs.reason` (a fixed text in German and English among the parameters)."}},governedDocument:{template:{de:"`template` gibt es am Knoten nicht mehr \u2014 die Parameter geh\xF6ren der Vorlage (ihr Datensatz, `plexus-cli catalog` documentTemplates[].parameters) und werden beim Speichern und Ver\xF6ffentlichen als `templateStamp` \xFCbernommen.",en:"`template` no longer exists on the node \u2014 the parameters belong to the template (its record, `plexus-cli catalog` documentTemplates[].parameters) and are stamped as `templateStamp` on save and publish."},cockpitFields:{de:'`cockpitFields` gibt es nicht mehr \u2014 ein Parameter, der im Cockpit erg\xE4nzt wird, ist sein Eingang `{ kind: "cockpit" }` (im Parameter-Bereich \u201Eim Cockpit erg\xE4nzen").',en:'`cockpitFields` no longer exists \u2014 a parameter completed in the cockpit is its input `{ kind: "cockpit" }` ("complete in the cockpit" among the parameters).'},mockAutoProduce:{de:"`mockAutoProduce` gibt es nicht mehr \u2014 das Muster-Dokument, das ein Upload-Knoten beim Eintritt selbst einstellte, ist entfernt; das Dokument kommt aus einem Upload.",en:"`mockAutoProduce` no longer exists \u2014 the sample document an upload node put on its slot by itself on entry is removed; the document comes from an upload."}}};function qk(e){return wJ[String(e)]??{}}s(qk,"movesOf");function qP(e){return kJ[String(e)]??[]}s(qP,"deadOf");function KP(e){return LP(e)&&[...Object.keys(qk(e.type)),...qP(e.type)].some(t=>t in e)}s(KP,"oldShape");function jP(e){return(e?.nodes??[]).some(KP)}s(jP,"needsNodeConfigInputMove");function bJ(e){return os(e)===null}s(bJ,"isCompleteText");function vJ(e){let t=LP(e.inputs)?{...e.inputs}:{},n={...e};for(let[r,i]of Object.entries(qk(e.type)))if(r in e){if(i in t)return{unmoved:{nodeId:String(e.id),key:r,reason:"inputExists"}};if(!bJ(e[r]))return{unmoved:{nodeId:String(e.id),key:r,reason:"valueNotLocalized"}};t[i]={kind:"literal",value:e[r]},delete n[r]}for(let r of qP(e.type))delete n[r];return Object.keys(qk(e.type)).some(r=>r in e)&&(n.inputs=t),{node:n}}s(vJ,"moveNode");function VP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!KP(i))return i;let o=vJ(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(VP,"moveNodeConfigToInputs");var bd="collectPayment",xa=["online","manual"];function nm(e){return xa.includes(e)}s(nm,"isCollectPaymentMode");var ss="paid",Kk="skipPayment",jk="confirmPayment",Di="article",sn="mode",Fi="reason",Wn="payee",Vk=["one_time"];function rm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(rm,"isObject");function BP(e){if(!rm(e)||e.type!==bd)return!1;let t=rm(e.inputs)?e.inputs:{},n=t[sn];return!rm(n)||n.kind!=="literal"||n.value!=="online"?!1:!(Wn in t)}s(BP,"isOnlinePaymentWithoutPayee");function UP(e){return(e?.nodes??[]).some(BP)}s(UP,"needsPayee");function GP(e,t={}){let n=[],r=[],i=e.nodes.map(o=>{if(!BP(o))return o;let a=String(o.id),l=Object.hasOwn(t,a)?t[a]:void 0;if(l===void 0||l==="")return r.push(a),o;n.push({nodeId:a,payee:l});let d=rm(o.inputs)?o.inputs:{};return{...o,inputs:{...d,[Wn]:{kind:"literal",value:l}}}});return n.length===0?{graph:e,set:n,refused:r}:{graph:{...e,nodes:i},set:n,refused:r}}s(GP,"setPayeeOnOnlinePayments");var zP="settlement",xJ={online:"online",separate:"manual"};function Bk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Bk,"isObject");function WP(e){return Bk(e)&&e.type===bd&&Bk(e.inputs)&&zP in e.inputs}s(WP,"carriesSettlement");function YP(e){return(e?.nodes??[]).some(WP)}s(YP,"needsPaymentModeRename");function HP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!WP(i))return i;let o=String(i.id),{[zP]:a,...l}=i.inputs;if(sn in l)return n.push({nodeId:o,reason:"bothCells"}),i;let d=Bk(a)&&a.kind==="literal"&&typeof a.value=="string"?xJ[a.value]:void 0;return d===void 0?(n.push({nodeId:o,reason:"unknownValue"}),i):(t.push(o),{...i,inputs:{...l,[sn]:{...a,value:d}}})});return t.length===0?{graph:e,moved:t,refused:n}:{graph:{...e,nodes:r},moved:t,refused:n}}s(HP,"renameSettlementToMode");var QP="formView";function im(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(im,"isObject");function Uk(e){return Array.isArray(e.tasks)?e.tasks:[]}s(Uk,"tasksOf");function vd(e){return im(e)&&QP in e}s(vd,"carriesFormView");function ZP(e){return(e?.nodes??[]).some(t=>vd(t)||im(t)&&Uk(t).some(vd))}s(ZP,"needsFormViewMove");function JP(e){let{[QP]:t,...n}=e;return"view"in n?"bothFields":!im(t)||typeof t.form!="string"||typeof t.key!="string"?"malformed":{...n,view:{kind:"form",form:t.form,view:t.key}}}s(JP,"moved");function XP(e){let t=[],n=[],r=e.nodes.map(i=>{if(!im(i))return i;let o=String(i.id),a=i;if(vd(a)){let l=JP(a);typeof l=="string"?n.push({nodeId:o,reason:l}):(a=l,t.push(o))}return Uk(a).some(vd)&&(a={...a,tasks:Uk(a).map(l=>{if(!vd(l))return l;let d=String(l.key),c=JP(l);return typeof c=="string"?(n.push({nodeId:o,taskKey:d,reason:c}),l):(t.push(`${o}.${d}`),c)})}),a});return t.length===0?{graph:e,moved:t,refused:n}:{graph:{...e,nodes:r},moved:t,refused:n}}s(XP,"moveFormViewToView");function sm(e){if(!Array.isArray(e))return[{code:"shape",index:null,detail:`expected a list of rows, got ${om(e)}`}];if(e.length===0)return[{code:"shape",index:null,detail:"expected at least the default row, got an empty list"}];let t=[];for(let i=0;i<e.length;i++){let o=AJ(e[i]);o!==null&&t.push({code:"shape",index:i,detail:o})}if(t.length>0)return t;let n=e.flatMap((i,o)=>i.when===null?[o]:[]),r=e.length-1;return(n.length!==1||n[0]!==r)&&t.push({code:"defaultLast",index:n.find(i=>i!==r)??null,detail:SJ(n,r)}),t}s(sm,"teamRulesShapeIssues");function SJ(e,t){return e.length===0?"no default row (`when: null`) \u2014 the last row must be the default":e.length>1?`${e.length} default rows (rows ${e.join(", ")}) \u2014 exactly one, the last`:`the default row is row ${e[0]}, not the last (${t})`}s(SJ,"defaultLastDetail");function Gk(e,t){let n=sm(e);return n.length>0&&D(`[assign/${n[0].code}] ${t}: ${n.map(r=>r.index===null?r.detail:`row ${r.index}: ${r.detail}`).join("; ")} \u2014 publish refuses such a graph`),e}s(Gk,"readTeamRules");function am(e){return sm(e).length===0?e:null}s(am,"tryReadTeamRules");function Yn(e){return lm([],e)}s(Yn,"fixedTeam");function lm(e,t){return Gk([...e.map(({when:n,team:r})=>({when:n,team:r})),{when:null,team:t}],"a constructed team position")}s(lm,"teamRulesOf");function zk(e,t){return e===void 0?Yn(t):lm(e.slice(0,-1),t)}s(zk,"withDefaultTeam");function eC(e){let t=e[e.length-1];return t===void 0&&D("[assign/shape] a team position has at least its default row \u2014 read it through readTeamRules"),t.team}s(eC,"defaultTeamOf");function tC(e){let t=new Map,n=[];return e.forEach((r,i)=>{if(r.when===null)return;let o=ce(r.when),a=t.get(o);a===void 0?t.set(o,i):n.push({index:i,first:a})}),n}s(tC,"shadowedRows");function AJ(e){if(typeof e!="object"||e===null||Array.isArray(e))return`expected { when, team }, got ${om(e)}`;let t=e,n=Object.keys(t).filter(r=>r!=="when"&&r!=="team");return n.length>0?`unknown key(s) ${n.map(r=>`"${r}"`).join(", ")} \u2014 a row is { when, team }`:typeof t.team!="string"||t.team.length===0?`"team" must be a team key, got ${om(t.team)}`:"when"in t?t.when!==null&&!ke(t.when)?`"when" must be an address or null, got ${om(t.when)}`:null:'"when" is missing \u2014 the default row says `when: null`'}s(AJ,"rowShapeProblem");function om(e){if(e===void 0)return"nothing";let t;try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>80?`${t.slice(0,77)}...`:t}s(om,"describe");function nC(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(nC,"isObject");function rC(e){return nC(e)&&nC(e.assign)?e.assign:null}s(rC,"assignOf");function iC(e){return(e?.nodes??[]).some(t=>Object.values(rC(t)??{}).some(n=>typeof n=="string"))}s(iC,"needsNodeAssignFold");function oC(e){let t=[],n=[],r=e.nodes.map(i=>{let o=rC(i);if(o===null)return i;let a=String(i.id),l=!1,d={};for(let[c,u]of Object.entries(o))typeof u=="string"&&u.length>0?(d[c]=Yn(u),t.push({nodeId:a,templateKey:c}),l=!0):(!Array.isArray(u)&&u!==void 0&&n.push({nodeId:a,templateKey:c}),d[c]=u);return l?{...i,assign:d}:i});return t.length===0?{graph:e,moved:t,refused:n}:{graph:{...e,nodes:r},moved:t,refused:n}}s(oC,"foldNodeAssignToTeamRules");function ci(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(ci,"isObject");function Wk(e){return Array.isArray(e.tasks)?e.tasks:[]}s(Wk,"tasksOf");function xd(e){return ci(e)&&Array.isArray(e.documents)?e.documents:[]}s(xd,"documentsOf");function Sd(e){return ci(e)&&e.kind==="document"}s(Sd,"isDocumentRef");function sC(e){return(e?.nodes??[]).some(t=>ci(t)&&Wk(t).some(n=>xd(n).some(Sd)))}s(sC,"needsDocumentRefMove");function TJ(e,t){let n=t.address;if(!ci(n)||n.scope!=="node"||typeof n.owner!="string"||n.path!==void 0||n.key!=="document"&&n.key!=="contract"&&n.key!=="contracts")return null;let r=e.find(a=>ci(a)&&a.id===n.owner),i=ci(r)&&Array.isArray(r.artifacts)?r.artifacts:[];if(i.length!==1)return null;let o=ci(i[0])?i[0].key:void 0;return typeof o=="string"&&o.length>0?o:null}s(TJ,"slotOf");function aC(e){let t=[],n=[],r=e.nodes.map(i=>{if(!ci(i)||!Wk(i).some(a=>xd(a).some(Sd)))return i;let o=String(i.id);return{...i,tasks:Wk(i).map(a=>{if(!ci(a)||!xd(a).some(Sd))return a;let l=String(a.key),d=xd(a).map(p=>Sd(p)?TJ(e.nodes,p):void 0);if(d.includes(null))return n.push({nodeId:o,taskKey:l,reason:"noSlot"}),a;let c=new Set,u=xd(a).flatMap((p,h)=>{let y=Sd(p)?{kind:"artifact",key:d[h]}:p;if(!ci(y)||y.kind!=="artifact")return[y];let b=String(y.key);return c.has(b)?[]:(c.add(b),[y])});return t.push(`${o}.${l}`),{...a,documents:u}})}});return t.length===0?{graph:e,moved:t,refused:n}:{graph:{...e,nodes:r},moved:t,refused:n}}s(aC,"moveDocumentRefsToArtifact");function dm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(dm,"isObject");function Yk(e){return dm(e)&&dm(e.assign)&&"userId"in e.assign}s(Yk,"namesUser");function cm(e){return(e?.nodes??[]).flatMap(t=>dm(t)&&Array.isArray(t.tasks)?t.tasks.filter(Yk).map(n=>({nodeId:String(t.id),taskKey:String(n.key),hasTeam:typeof n.assign.group=="string"&&n.assign.group.length>0})):[])}s(cm,"taskUserAssignments");function lC(e){let t=cm(e);if(t.length===0)return{graph:e,dropped:t};let n=e.nodes.map(r=>{if(!dm(r)||!Array.isArray(r.tasks)||!r.tasks.some(Yk))return r;let i=r.tasks.map(o=>{if(!Yk(o))return o;let{userId:a,...l}=o.assign,{assign:d,...c}=o;return Object.keys(l).length===0?c:{...c,assign:l}});return{...r,tasks:i}});return{graph:{...e,nodes:n},dropped:t}}s(lC,"dropTaskAssignUserIds");var Sa={"assign{}":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der Knoten-Aufgabe",en:"team of the node task"},consequence:{de:"beim Betreten des Knotens entsteht die Aufgabe f\xFCr niemanden",en:"entering the node creates the task for nobody"}},"actionTeams{}":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Knoten-Aktion ausf\xFChren darf",en:"team that may perform the node action"},consequence:{de:"au\xDFer der zust\xE4ndigen Person darf niemand die Aktion ausf\xFChren",en:"nobody but the responsible person may perform the action"}},"tasks[].assign.group":{kind:"team",codec:"key",involves:!0,required:!0,what:{de:"Team der Aufgabe",en:"team of the task"},consequence:{de:"die Aufgabe kann nicht angelegt werden, und der Prozess bleibt stehen",en:"the task cannot be created and the process stops"}},"tasks[].params.revisionGroup":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der \xDCberarbeitung",en:"revision team"},consequence:{de:"eine Ablehnung findet niemanden, der \xFCberarbeitet",en:"a rejection finds nobody to revise"}},"tasks[].result.chat":{kind:"team",codec:"chatTarget",involves:!1,required:!1,what:{de:"Chat des Ergebnisses",en:"chat of the result"},consequence:{de:"das Ergebnis l\xE4sst sich nicht im Chat ablegen",en:"the result cannot be posted to the chat"}},"tasks[].result.primaryParticipantTeams":{kind:"team",codec:"key",involves:!1,required:!1,list:!0,what:{de:"Team oben in der Teilnehmer-Auswahl",en:"team listed first in the participant picker"},consequence:{de:"die Teilnehmer-Auswahl kann das Team nicht oben zeigen",en:"the participant picker cannot list the team first"}},"tasks[].result.participants.prefill.group":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Teilnehmenden vorbelegt",en:"team that prefills the participants"},consequence:{de:"der Buchungsdialog kann die Teilnehmenden nicht vorbelegen",en:"the booking dialog cannot prefill the participants"}},"optionalActions[].trigger":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Aktion ausl\xF6sen darf",en:"team that may trigger the action"},consequence:{de:"niemand au\xDFer der Prozessverantwortung kann die Aktion ausl\xF6sen",en:"nobody but the process owner can trigger the action"}}},Hk=s(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null,"record");function um(e,t){if(typeof t!="string"||t.length===0)return null;if(e==="key")return t;let n=ya(t);return n?.kind==="team"?n.groupKey:null}s(um,"decodeKey");var dC={"assign{}":"assign","actionTeams{}":"actionTeams"},RJ=s(e=>e in dC,"isMapLeaf");function $J(e){let t=/^(tasks|optionalActions)\[\]((?:\.[a-zA-Z]+)*)\.([a-zA-Z]+)$/.exec(e);return t===null&&D(`[resource] unreadable reference leaf "${e}"`),{list:t[1],field:t[2]===""?null:t[2].slice(1),key:t[3]}}s($J,"locate");function EJ(e,t){if(t===null)return e;let n=e;for(let r of t.split("."))n=n===null?null:Hk(n[r]);return n}s(EJ,"holderAt");function fm(e){let t=[],n=e;for(let[r,i]of Object.entries(dC))for(let[o,a]of Object.entries(Hk(n[i])??{})){if(r==="assign{}"){let l=am(a);if(l===null){t.push({path:`${i}.${o}`,leaf:r,owner:o,key:um("key",a),missing:typeof a!="string"||a.length===0});continue}l.forEach((d,c)=>{t.push({path:`${i}.${o}.${c}.team`,leaf:r,owner:o,index:c,key:d.team,missing:!1})});continue}t.push({path:`${i}.${o}`,leaf:r,owner:o,key:um("key",a),missing:typeof a!="string"||a.length===0})}for(let r of Object.keys(Sa)){if(RJ(r))continue;let i=Sa[r],{list:o,field:a,key:l}=$J(r);for(let d of Array.isArray(n[o])?n[o]:[]){let c=Hk(d);if(c===null||typeof c.key!="string")continue;let p=EJ(c,a)?.[l];if(p===void 0&&!i.required)continue;let h=`${o}.${c.key}${a===null?"":`.${a}`}.${l}`;if(i.list===!0){if(!Array.isArray(p)){t.push({path:h,leaf:r,owner:c.key,key:null,missing:!0});continue}let b=c.key;p.forEach((k,v)=>{t.push({path:`${h}.${v}`,leaf:r,owner:b,index:v,key:um(i.codec,k),missing:typeof k!="string"||k.length===0})});continue}let y=typeof p!="string"||p.length===0;t.push({path:`${o}.${c.key}${a===null?"":`.${a}`}.${l}`,leaf:r,owner:c.key,key:um(i.codec,p),missing:y})}}return t}s(fm,"nodeResourceReferences");var cC=s(e=>(e??[]).map(t=>`\u201E${t}\u201C`).join(", "),"list"),uC=s(e=>(e??[]).map(t=>`"${t}"`).join(", "),"listEn"),IJ={"address/shape":{de:s(e=>({problem:`${e.where}: \u201E${e.address}\u201C ist keine g\xFCltige Adresse.`,remedy:"W\xE4hle die Adresse in der Auswahl neu."}),"de"),en:s(e=>({problem:`${e.where}: "${e.address}" is not a valid address.`,remedy:"Choose the address again from the picker."}),"en")},"address/missing":{de:s(e=>({problem:`${e.where}: Hier fehlt die Adresse, ohne die dieser Schritt nicht arbeiten kann.`,remedy:"W\xE4hle sie in der Auswahl."}),"de"),en:s(e=>({problem:`${e.where}: The address this step cannot work without is missing.`,remedy:"Choose it from the picker."}),"en")},"address/bareIdentifier":{de:s(e=>({problem:`${e.where}: \u201E${e.address}\u201C nennt nur einen Schl\xFCssel, nicht, wer ihn erzeugt.`,remedy:"W\xE4hle in der Auswahl die volle Adresse, z. B. das Feld aus dem Formular, das es erfasst."}),"de"),en:s(e=>({problem:`${e.where}: "${e.address}" names a key only, not who produces it.`,remedy:"Choose the full address from the picker, e.g. the field from the form that collects it."}),"en")},"address/unknownOwner":{de:s(e=>({problem:`${e.where}: ${e.address} nennt einen Knoten oder eine Aufgabe, die es im Ablauf nicht gibt.`,remedy:"W\xE4hle eine Adresse aus der Auswahl."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} names a node or task the workflow does not have.`,remedy:"Choose an address from the picker."}),"en")},"address/unknownKey":{de:s(e=>({problem:`${e.where}: ${e.producer??"der Erzeuger"} erzeugt ${e.address} nicht.`,remedy:"W\xE4hle einen Wert, den der Erzeuger tats\xE4chlich liefert."}),"de"),en:s(e=>({problem:`${e.where}: ${e.producer??"the producer"} does not produce ${e.address}.`,remedy:"Choose a value the producer actually delivers."}),"en")},"address/envCohortBound":{de:s(e=>({problem:`${e.where}: ${e.address} \xE4ndert sich, wenn Stufe oder Schuljahr gewechselt werden \u2014 ein Dokument, das den Wert druckt, w\xFCrde das nicht bemerken.`,remedy:"Lies den Wert \xFCber ein Formularfeld, das ihn berechnet (z. B. \u201EKlassenstufe\u201C): ein Wechsel friert es neu ein und h\xE4lt ein gedrucktes Dokument an."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} changes when the application's stage or school year is changed \u2014 a document printing it would not notice.`,remedy:'Read it through a form field that computes it (e.g. "Grade"): a change re-freezes it and holds a printed document.'}),"en")},"address/staffInputConditionOnly":{de:s(e=>({problem:`${e.where}: ${e.address} ist eine interne Angabe beim Anlegen \u2014 sie lenkt eine Weiche (\u201EWenn\u201C-Knoten) oder f\xFCllt einen Parameter eines Knotens.`,remedy:"Lies sie in der Bedingung eines \u201EWenn\u201C-Knotens oder binde einen Parameter des Knotens daran (z. B. im Vertrag); Formulare, Aufgaben und Regeln lesen sie nicht."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} is a staff input set at the start \u2014 it steers a branch (an "If" node) or fills a node's parameter.`,remedy:'Read it in the condition of an "If" node or bind a node parameter to it (e.g. in the contract); forms, tasks and rules do not read it.'}),"en")},"address/ownerNotWriter":{de:s(e=>({problem:`${e.where}: Die Aufgabe \u201E${e.producer}\u201C schreibt ${e.address} nicht.`,remedy:"W\xE4hle den Wert \xFCber seinen Schl\xFCssel; die schreibende Aufgabe folgt daraus."}),"de"),en:s(e=>({problem:`${e.where}: The task "${e.producer}" does not write ${e.address}.`,remedy:"Choose the value by its key; the writing task follows from it."}),"en")},"address/taskOwnerTaken":{de:s(e=>({problem:`${e.where}: Den Aufgaben-Schl\xFCssel gibt es mehrfach (${cC(e.names)}), und eine dieser Aufgaben schreibt Prozesswerte.`,remedy:"Gib der schreibenden Aufgabe einen Schl\xFCssel, den keine andere Aufgabe tr\xE4gt."}),"de"),en:s(e=>({problem:`${e.where}: The task key is used more than once (${uC(e.names)}), and one of these tasks writes process values.`,remedy:"Give the writing task a key no other task carries."}),"en")},"address/notVisible":{de:s(e=>({problem:e.producerNode!==void 0&&e.producerNode!==e.producer?`${e.where}: ${e.address} \u2014 \u201E${e.producer}\u201C h\xE4ngt an \u201E${e.producerNode}\u201C, das nicht auf jedem Weg vor \u201E${e.reader}\u201C liegt.`:`${e.where}: ${e.address} \u2014 \u201E${e.producer}\u201C liegt nicht auf jedem Weg vor \u201E${e.reader}\u201C.`,remedy:`Lies nur, was auf jedem Weg vor \u201E${e.reader}\u201C entsteht, oder ordne die Schritte so, dass der Erzeuger immer vorher l\xE4uft.`}),"de"),en:s(e=>({problem:e.producerNode!==void 0&&e.producerNode!==e.producer?`${e.where}: ${e.address} \u2014 "${e.producer}" hangs on "${e.producerNode}", which does not lie before "${e.reader}" on every path.`:`${e.where}: ${e.address} \u2014 "${e.producer}" does not lie before "${e.reader}" on every path.`,remedy:`Read only what is produced before "${e.reader}" on every path, or order the steps so the producer always runs first.`}),"en")},"address/pathNotInTarget":{de:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"der Erzeuger"} hat dieses Feld nicht.`,remedy:"W\xE4hle ein Feld, das es dort gibt."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"the producer"} has no such field.`,remedy:"Choose a field that exists there."}),"en")},"address/notExported":{de:s(e=>({problem:`${e.where}: ${e.address} \u2014 das Feld gibt es in ${e.producer??"dem Formular"}, es ist aber nicht exportiert.`,remedy:"Setze am Feld im Formular `export: true` (ein berechnetes Feld braucht dazu `exportType`). Ist es schon exportiert, ist der Stempel des Bundles veraltet: `plexus-cli offer workflow restamp-exports` laufen lassen."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"the form"} has this field, but it is not exported.`,remedy:"Set `export: true` on the field in the form (a computed field also needs `exportType`). If it is exported already, the bundle's stamp is stale: run `plexus-cli offer workflow restamp-exports`."}),"en")},"address/typeMismatch":{de:s(e=>({problem:`${e.where}: erwartet ${e.expected}, ${e.address} ist ${e.actual}.`,remedy:`W\xE4hle einen Wert vom Typ ${e.expected}.`}),"de"),en:s(e=>({problem:`${e.where}: expects ${e.expected}, ${e.address} is ${e.actual}.`,remedy:`Choose a value of type ${e.expected}.`}),"en")},"address/notFormInstance":{de:s(e=>({problem:`${e.where}: ${e.address} ist kein ganzes Formular.`,remedy:"W\xE4hle das Formular des Knotens, der es anlegt \u2014 ohne Feld, nicht den Knoten, der es \xFCbernimmt."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} is not a whole form.`,remedy:"Choose the form of the node that creates it \u2014 without a field, not the node that continues it."}),"en")},"address/mixedForms":{de:s(e=>({problem:`${e.where}: Die Liste liest Felder aus mehreren Formularen (${cC(e.names)}), beurteilt wird sie aber an einem Formular.`,remedy:"W\xE4hle alle Felder dieser Liste aus demselben Formular."}),"de"),en:s(e=>({problem:`${e.where}: The list reads fields of several forms (${uC(e.names)}) but is judged on one.`,remedy:"Choose every field of this list from the same form."}),"en")},"workItems/keyFormat":{de:s(e=>({problem:`${e.where}: Der Aufgaben-Schl\xFCssel \u201E${e.address}\u201C hat nicht die Form ^[a-z][a-zA-Z0-9_]*$.`,remedy:"Benenne die Aufgabe in camelCase um, z. B. \u201EgeschwisterRang\u201C."}),"de"),en:s(e=>({problem:`${e.where}: The task key "${e.address}" does not match ^[a-z][a-zA-Z0-9_]*$.`,remedy:'Rename the task in camelCase, e.g. "siblingRank".'}),"en")}};function Aa(e,t,n){let{problem:r,remedy:i}=IJ[e][n](t);return`[${e}] ${r} ${i}`}s(Aa,"addressMessage");var fC={type:"enum",dataType:"option"};function Jk(e){let t={};for(let n of We)t[n]=e(n);return t}s(Jk,"localized");function pC(e,t){let n=new Set(t);return e.last.filter(r=>!n.has(r))}s(pC,"unknownLastKeys");function mC(e,t){return e.enumOptionLabels?.[t]??{de:t,en:t}}s(mC,"inlineEnumOptionLabel");var gC={string:"string",boolean:"boolean",consent:"boolean",date:"date",enum:"enum",email:"email",tel:"tel",address:"address"};function pm(e){return gC[e]!==void 0}s(pm,"isExportableFieldType");function OJ(e){return e.exportType===void 0&&D(`formExports: computed '${e.key}' is exported without an exportType \u2014 the publish validator should have refused this form.`),{key:e.key,type:e.exportType,label:e.label??{de:e.key,en:e.key}}}s(OJ,"leafForComputed");function hC(e){let t=gC[e.type];return t===void 0&&D(`formExports: field '${e.key}' has type '${e.type}', which is not exportable \u2014 the publish validator should have refused this form.`),{key:e.key,type:t,label:e.label,...e.enumOptions!==void 0?{enumOptions:e.enumOptions.map(n=>({value:n,label:mC(e,n)}))}:{}}}s(hC,"leafFor");function Qk(e){let t=[],n=s(r=>{for(let i of r.fields)i.export===!0&&t.push(hC(i));for(let i of r.groups??[])for(let o of i.fields)o.export===!0&&t.push(hC(o));for(let i of r.computed??[])i.export===!0&&t.push(OJ(i));for(let i of r.subsections??[])n(i)},"visit");for(let r of e.sections)n(r);return t}s(Qk,"exportedFormLeaves");function Dn(e){let t=[];for(let n of e){let r=n.next;if(r)for(let[i,o]of Object.entries(r))t.push({id:`${n.id}|${i}`,source:n.id,target:o.to,sourceBranchId:i})}return t}s(Dn,"derivedEdges");function Zk(e){let t=new Map;for(let n of Dn(e.nodes)){let r=t.get(n.source)??[];r.push(n.target),t.set(n.source,r)}return t}s(Zk,"successorsOf");function Ta(e,t,n){if(t===n)return!0;let r=Zk(e),i=new Set([...r.values()].flat()),o=e.nodes.filter(l=>!i.has(l.id)&&l.id!==t).map(l=>l.id),a=new Set(o);for(;o.length>0;){let l=o.shift();if(l===n)return!1;for(let d of r.get(l)??[])d===t||a.has(d)||(a.add(d),o.push(d))}return!0}s(Ta,"dominates");function yC(e,t,n){if(t===n)return!0;let r=Zk(e),i=[t],o=new Set(i);for(;i.length>0;){let a=i.shift();for(let l of r.get(a)??[]){if(l===n)return!0;o.has(l)||(o.add(l),i.push(l))}}return!1}s(yC,"reaches");function wC(e,t,n,r){let i=new Map(e.nodes.map(d=>[d.id,d])),o=Zk(e),a=[t],l=new Set(a);for(;a.length>0;){let d=a.shift();for(let c of o.get(d)??[]){if(l.has(c)||n.has(c))continue;l.add(c);let u=i.get(c);if(u!==void 0&&r(u))return c;a.push(c)}}return null}s(wC,"reachedAvoiding");function Xk(e,t){let n=[],r=s(i=>({address:i.address,type:i.type,...i.label!==void 0?{label:i.label}:{},nodeId:i.nodeId}),"toVisible");for(let i of e.nodes)if(Ta(e,i.id,t))for(let o of li(e,i))n.push(r(o));for(let i of uP)n.push({address:{scope:"env",key:i},type:Rk(i),label:$k(i),nodeId:null});for(let i of Mp(e))n.push({address:{scope:"env",key:qp(i.key)},type:i.type,label:i.label,nodeId:null});return n}s(Xk,"visibleAddressesAt");function ui(e,t){let n=e?.readinessFormFieldsByFormNode?.get(t.owner);if(n!==void 0)return n.get(t.path)??null}s(ui,"formFieldEntryOf");var kC={binding:{de:"Eingang",en:"Input"},condition:{de:"Bedingung",en:"Condition"},nodeReads:{de:"Gelesene Felder",en:"Fields read"},requires:{de:"Geforderte Felder",en:"Required fields"},adoptForm:{de:"\xDCbernommenes Formular",en:"Continued form"},setFlagTarget:{de:"Freizuschaltendes Formular",en:"Form to unlock"},form:{de:"Formular",en:"Form"},contract:{de:"Vertrag",en:"Contract"},payment:{de:"Zahlung",en:"Payment"},taskWhen:{de:"Bedingung",en:"Condition"},optionalActionWhen:{de:"Bedingung der optionalen Aktion",en:"Condition of the optional action"},taskReads:{de:"Gelesene Felder der Aufgabe",en:"Fields the task reads"},taskDocument:{de:"Dokumente",en:"Documents"},familyRequestFields:{de:"Nachforderbare Felder",en:"Requestable fields"},familyRequestFrom:{de:"Nachforderung aus",en:"Request from"},suggest:{de:"Vorschlag",en:"Suggestion"},taskInput:{de:"Vorgaben",en:"Inputs"},teamWhen:{de:"Bedingung des Teams",en:"Condition of the team"}},_J=new Set(["nodeReads","requires","taskReads","taskDocument","familyRequestFields"]);function NJ(e,t,n){let r=[];t.taskKey!==void 0&&r.push(`${n==="de"?"Aufgabe":"task"} \u201E${is(e,t.taskKey,n)}\u201C`);let i=t.kind==="binding"?` \u201E${t.at.split(".").pop()}\u201C`:"";return r.push(`${kC[t.kind][n]}${i}`),r.join(" \u203A ")}s(NJ,"addressFieldWhere");function Ad(e,t,n){let r=NJ(e,t,n);return`\u201E${Pe(e,t.nodeId,n)}\u201C \u203A ${r}`}s(Ad,"whereOf");function bC(e,t,n){if(t.scope==="node")return Pe(e,t.owner,n);if(t.scope==="task")return is(e,t.owner,n)}s(bC,"producerName");function vC(e,t){let n=[],r=new Set,i=s((l,d,c)=>{let u={de:Aa(l,c("de"),"de"),en:Aa(l,c("en"),"en")},p=`${d}|${u.de}`;r.has(p)||(r.add(p),n.push({layer:"GRAPH",kind:"nodeRule",path:d,reason:u,severity:"error"}))},"report"),o=new Map(e.nodes.map(l=>[l.id,l])),a=[...e.nodes.flatMap(l=>hd(l))];for(let l of a){let d=s(c=>Ad(e,l,c),"where");for(let c of PJ(e,l,i))DJ(e,l,c,i)&&(LJ(e,l,c,t,i),Ok.has(l.kind)&&!KJ(o,c)&&i("address/notFormInstance",l.at,u=>({where:d(u),address:Ge(e,c,u)})))}return jJ(e,i),VJ(e,a,i),zJ(e,i),YJ(e,i),n}s(vC,"checkAddresses");function PJ(e,t,n){let r=s(i=>Ad(e,t,i),"where");if(_k(t)){let i=Nk(t.value)??[];for(let o of i)o.address===null&&n(o.reason==="bareIdentifier"?"address/bareIdentifier":"address/shape",t.at,a=>({where:r(a),address:o.identifier}));return ka(t)}return typeof t.value=="string"?(n("address/bareIdentifier",t.at,i=>({where:r(i),address:t.value})),[]):ke(t.value)?[t.value]:(n("address/shape",t.at,i=>({where:r(i),address:JSON.stringify(t.value)??"undefined"})),[])}s(PJ,"checkFieldShape");function xC(e,t,n,r){let i=bC(e,n,r);return{where:Ad(e,t,r),address:Ge(e,n,r),...i!==void 0?{producer:i}:{}}}s(xC,"addressParams");function CJ(e,t,n){return Tk(t)||n==="optionalActionWhen"&&(ua(e,t)!==void 0||ur(t))?null:ua(e,t)!==void 0?n==="condition"||n==="binding"?null:"address/staffInputConditionOnly":ur(t)?"address/envCohortBound":"address/unknownKey"}s(CJ,"envAddressRefusal");function DJ(e,t,n,r){let i=s(o=>xC(e,t,n,o),"params");switch(n.scope){case"env":{let o=CJ(e,n.key,t.kind);return o===null?!0:(r(o,t.at,i),!1)}case"task":return e.nodes.some(a=>(a.tasks??[]).some(l=>l.key===n.owner))?(e.processStore??[]).some(a=>a.key===n.key)?Ci(e,n.owner,n.key)===null?(r("address/ownerNotWriter",t.at,i),!1):!0:(r("address/unknownKey",t.at,i),!1):(r("address/unknownOwner",t.at,i),!1);case"node":{let o=e.nodes.find(a=>a.id===n.owner);return o===void 0?(r("address/unknownOwner",t.at,i),!1):li(e,o).some(a=>a.address.scope==="node"&&a.address.key===n.key)?!0:(r(Ok.has(t.kind)&&Cn(o)?"address/notFormInstance":"address/unknownKey",t.at,i),!1)}}}s(DJ,"resolves");function FJ(e,t){return e===void 0||t===void 0||gn(t)===void 0?!0:gn(e)!==void 0&&tm(e,t)}s(FJ,"addressTypeFits");function LJ(e,t,n,r,i){let o=s(l=>xC(e,t,n,l),"params");if(n.scope!=="env"&&n.path!==void 0&&!qJ(e,t,n,r)){i(MJ(n,r)?"address/notExported":"address/pathNotInTarget",t.at,o);return}if(t.expectedType===void 0)return;let a=gd(e,n);FJ(a,t.expectedType)||i("address/typeMismatch",t.at,l=>({...o(l),expected:t.expectedType,actual:a}))}s(LJ,"checkPathAndType");function MJ(e,t){if(e.scope!=="node"||e.key!==Yt||e.path===void 0)return!1;let n=ui(t,{scope:"node",owner:e.owner,key:Yt,path:e.path});return n==null?!1:n.kind==="computed"||!n.repeated&&pm(n.type)}s(MJ,"formFieldUnexported");function qJ(e,t,n,r){if(n.scope!=="node")return!1;if(gd(e,n)!==void 0)return!0;if(n.key!==Yt)return!1;if(!_J.has(t.kind))return e.nodes.find(o=>o.id===n.owner)?.formExports===void 0;let i=r?.readinessFormFieldsByFormNode?.get(n.owner);return i===void 0||i.has(n.path)}s(qJ,"pathExists");function KJ(e,t){if(!pr(t))return!1;let n=e.get(t.owner);return n!==void 0&&n.type==="form"&&!Cn(n)}s(KJ,"isCreatingFormInstance");function jJ(e,t){for(let n of e.nodes){let r=new Set(hd(n).map(i=>i.kind));for(let i of hP(n))r.has(i)||t("address/missing",`nodes.${n.id}.${i}`,o=>({where:`\u201E${Pe(e,n.id,o)}\u201C \u203A ${kC[i][o]}`}))}}s(jJ,"checkRequiredFields");function VJ(e,t,n){let r=new Map;for(let i of t)if(i.judgedTogether!==null)for(let o of ka(i)){if(o.scope!=="node"||o.key!==Yt)continue;let a=r.get(i.judgedTogether)??[];a.push({field:i,owner:o.owner}),r.set(i.judgedTogether,a)}for(let[i,o]of r){let a=[...new Set(o.map(l=>l.owner))];a.length<2||n("address/mixedForms",i,l=>({where:Ad(e,o[0].field,l),names:a.map(d=>Pe(e,d,l))}))}}s(VJ,"checkMixedForms");function BJ(e,t){return e.type==="engagePush"&&t.kind==="payment"}s(BJ,"readSkipsAbsentProducer");function UJ(e,t,n){return t!==n&&yC(e,t,n)}s(UJ,"precedesOnSomePath");function GJ(e,t,n,r){let i=Ek(n.address);return r.has(ce(i))||!WJ(e,i)?!0:n.origin==="written"&&i.scope==="node"&&BJ(t,n.field)&&UJ(e,i.owner,t.id)}s(GJ,"readPassesVisibility");function zJ(e,t){for(let n of e.nodes){let r=rs(e,n);if(r.length===0)continue;let i=new Set(Xk(e,n.id).map(o=>ce(o.address)));for(let o of r){let a=Ek(o.address);if(GJ(e,n,o,i))continue;let l=a.scope==="task"?Ci(e,a.owner,a.key):a.scope==="node"?a.owner:null;t("address/notVisible",o.field.at,d=>({where:Ad(e,o.field,d),address:Ge(e,o.address,d),producer:bC(e,a,d)??Ge(e,a,d),...l!==null?{producerNode:Pe(e,l,d)}:{},reader:Pe(e,n.id,d)}))}}}s(zJ,"checkVisibility");function WJ(e,t){if(t.scope==="env")return Tk(t.key);let n=ce(t);return e.nodes.some(r=>li(e,r).some(i=>ce(i.address)===n))}s(WJ,"producedSomewhere");function YJ(e,t){let n=new Map;for(let r of e.nodes){let i=new Set(li(e,r).flatMap(o=>o.address.scope==="task"?[o.address.owner]:[]));for(let[o,a]of(r.tasks??[]).entries()){let l=a.key;if(typeof l!="string"||!mo.test(l)){t("workItems/keyFormat",`nodes.${r.id}.tasks.${o}.key`,c=>({where:`\u201E${Pe(e,r.id,c)}\u201C`,address:String(l)}));continue}let d=n.get(l)??[];d.push({nodeId:r.id,writes:i.has(l)}),n.set(l,d)}}for(let[r,i]of n)if(!(i.length<2||!i.some(o=>o.writes)))for(let o of i)t("address/taskOwnerTaken",`nodes.${o.nodeId}.tasks.${r}`,a=>({where:`\u201E${Pe(e,o.nodeId,a)}\u201C \u203A ${a==="de"?"Aufgabe":"task"} \u201E${is(e,r,a)}\u201C`,names:i.map(l=>Pe(e,l.nodeId,a))}))}s(YJ,"checkTaskKeys");function mm(e,t){return e.label[t]??""}s(mm,"wordingIn");function ko(e,t){let n=SC(e,t),r=mm(e.qualifier,t);return n===""||r===""&&mm(e.qualifier,"de")!==""?"":r===""?n:`${r} \xB7 ${n}`}s(ko,"fieldLabelIn");function SC(e,t){return mm(e,t)}s(SC,"fieldOwnLabelIn");function Ra(e){return{key:e.key,kind:e.kind,type:e.kind==="entered"?e.type:null,repeated:e.kind==="entered"&&e.repeated,reviewRequired:e.kind==="entered"&&e.reviewRequired,name:{de:ko(e,"de"),en:ko(e,"en")}}}s(Ra,"catalogField");function $a(e,t){switch(e){case"nodeReads":return t.repeated?"repeated":null;case"requires":return t.repeated?"repeated":t.kind==="computed"?"computed":t.name.en===""?"untranslated":null;case"taskDocument":return t.repeated?"repeated":t.kind==="entered"&&t.type==="docRef"?null:"notDocument";case"taskReads":case"familyRequestFields":return null}}s($a,"catalogFieldRefusal");function hm(e,t){let n=e.buses.find(r=>r.key===t);return n||D(`[progress] layout '${e.id}' has no bus '${t}'`),n}s(hm,"progressBus");function Td(e,t){return e.states.some(n=>n.id===t)}s(Td,"isBusState");function AC(e,t){let n=e.terminalSemantics?.[t];return n||D(`[progress] no terminal semantics for state '${t}' on bus '${e.key}'`),n}s(AC,"terminalSemantics");function gm(e,t){return!!e.terminalSemantics&&Object.prototype.hasOwnProperty.call(e.terminalSemantics,t)}s(gm,"hasTerminalSemantics");function TC(e){return e.waitlist===!0}s(TC,"columnIsWaitlist");function HJ(e,t){return(e.boards??[]).find(n=>n.audience===t||n.audience==="both")??null}s(HJ,"boardForAudience");function eb(e){return HJ(hm(e,"process"),"internal")}s(eb,"internalProcessBoard");function as(e,t,n){let r=null;for(let i of e.mappings)if(i.event===n)if("nodeId"in i.match){if(i.match.nodeId===t.id)return{bus:i.bus,state:i.state}}else i.match.nodeType===t.type&&(r=i);return r?{bus:r.bus,state:r.state}:null}s(as,"resolveProgressEvent");var Ea={approved:"enrolled",rejected:"declined",withdrawn:"declined",expired:"declined"},Li=Object.keys(Ea);function bo(e){return Object.hasOwn(Ea,e)}s(bo,"isEndNodeOutcome");var tb={approved:{de:"Angenommen",en:"Admitted"},rejected:{de:"Abgelehnt",en:"Rejected"},withdrawn:{de:"Zur\xFCckgezogen",en:"Withdrawn"},expired:{de:"Abgelaufen",en:"Expired"}};var vo=["commit","discard"],_ye=m.union(...vo.map(e=>m.literal(e)));function ym(e){return typeof e=="string"&&vo.includes(e)}s(ym,"isApplicationDataDecision");function Ht(e){return Object.keys(e)}s(Ht,"progressEventsOf");var ie=s((e,t)=>({de:e,en:t}),"lt"),at=s((e,t,n,r,i=null,o=null)=>({chipLabel:e,tone:t,nextAction:i,affordance:o,title:n,body:r}),"ex"),RC={key:"eingeschrieben",label:ie("Eingeschrieben","Enrolled"),scope:"global",defaultCollapsed:!0},wm={key:"abgesagt",label:ie("Abgesagt","Declined"),scope:"global",track:"exit",defaultCollapsed:!0},$C={key:"abgelehnt",label:ie("Abgelehnt","Rejected"),scope:"global",track:"exit",defaultCollapsed:!0};var EC={enrolled:{label:ie("Eingeschrieben","Enrolled"),tone:"green",terminal:{lifecycleStatus:"completed",outcome:"approved"},phase:RC,external:at(ie("Eingeschrieben","Enrolled"),"green",ie("Sie sind eingeschrieben!","You are enrolled!"),ie("Ihre Anmeldung ist abgeschlossen und Ihr Platz ist gesichert. Wir freuen uns auf Sie.","Your enrolment is complete and your place is secured. We look forward to welcoming you."))},declined:{label:ie("Abgesagt","Declined"),tone:"red",terminal:{lifecycleStatus:"completed",outcome:"rejected"},phase:wm,external:at(ie("Abgesagt","Declined"),"red",ie("Die Bewerbung wurde beendet","The application has ended"),ie("Ihre Bewerbung wurde nicht fortgef\xFChrt.","Your application was not continued."))}},IC={role:"effect",effect:"pure",progressDefaults:EC,progressEvents:Ht(EC),inputs:s(()=>[{id:"applicationOutcome",label:{de:"Ergebnis",en:"Outcome"},type:"enum",required:!0,inspector:"literal-only",optionSource:"declared",enumOptions:Li.map(e=>({value:e,label:tb[e]}))},{id:"dataDecision",label:{de:"Erfasste Daten",en:"Captured data"},type:"enum",required:!0,inspector:"literal-only",optionSource:"declared",enumOptions:[{value:"commit",label:{de:"\xDCbernehmen",en:"Keep"}},{value:"discard",label:{de:"Verwerfen",en:"Discard"}}]}],"inputs"),notificationEvents:s(()=>[{id:"reached",label:{de:"Verfahren abgeschlossen",en:"Process completed"},audience:"external",args:[{key:"applicationId",type:"string",required:!0},{key:"outcome",type:"string",required:!0}]}],"notificationEvents"),validate:s(e=>[...JJ(e),...QJ(e),...ZJ(e)],"validate")},Ia=s((e,t,n,r)=>({layer:"GRAPH",kind:"nodeRule",path:`node.${e.id}.inputs.${t}`,reason:{de:n,en:r},severity:"error"}),"nodeIssue");function ls(e){let t=e.inputs?.applicationOutcome;return t?.kind==="literal"&&t.value!=null?String(t.value):null}s(ls,"literalOutcome");function JJ(e){if(e.type!=="end")return[];let t=e.inputs?.applicationOutcome;if(t===void 0||t.kind==="unset")return[];let n=ls(e);return n===null?[Ia(e,"applicationOutcome",`[end/applicationOutcome] ${e.label.de}: das Ergebnis ist kein fester Wert \u2014 die Engine kann den Abschluss nicht ableiten`,`[end/applicationOutcome] ${e.label.en}: the application outcome is no fixed value \u2014 the engine cannot derive the terminal`)]:bo(n)?[]:[Ia(e,"applicationOutcome",`[end/applicationOutcome] ${e.label.de}: '${n}' ist kein Ausgang eines Endknotens (${Li.join("|")}) \u2014 die Warteliste endet \xFCber das closed-Outcome ihres Wartelistenknotens`,`[end/applicationOutcome] ${e.label.en}: '${n}' is not an outcome of an end node (${Li.join("|")}) \u2014 the waitlist ends through the closed outcome of its waitlist node`)]}s(JJ,"checkEndApplicationOutcome");function QJ(e){if(e.type!=="end")return[];let t=e.inputs?.dataDecision;return!t||t.kind!=="literal"||t.value==null?[Ia(e,"dataDecision",`[end/dataDecision] ${e.label.de}: dataDecision fehlt \u2014 der Endknoten muss festlegen, ob die erfassten Daten \xFCbernommen (commit) oder verworfen (discard) werden`,`[end/dataDecision] ${e.label.en}: dataDecision is missing \u2014 the end node must decide whether the collected data is kept (commit) or discarded (discard)`)]:ym(t.value)?[]:[Ia(e,"dataDecision",`[end/dataDecision] ${e.label.de}: dataDecision '${String(t.value)}' ist ung\xFCltig (${vo.join("|")})`,`[end/dataDecision] ${e.label.en}: dataDecision '${String(t.value)}' is invalid (${vo.join("|")})`)]}s(QJ,"checkEndDataDecision");function ZJ(e){if(e.type!=="end")return[];let t=ls(e);if(t===null||!bo(t)||t==="approved")return[];let n=e.inputs?.dataDecision;if(n?.kind!=="literal"||n.value!=="commit")return[];let r=tb[t];return[{...Ia(e,"dataDecision",`[end/commitWithoutApproval] ${e.label.de}: Ende ohne Zusage \xFCbernimmt die erfassten Daten (commit) \u2014 Personen und Beziehungen bleiben nach dem Ergebnis \u201E${r.de}" bestehen. Gewollt? Sonst discard.`,`[end/commitWithoutApproval] ${e.label.en}: end without admission keeps the captured data (commit) \u2014 persons and relationships remain after the outcome "${r.en}". Intended? Otherwise discard.`),severity:"warning"}]}s(ZJ,"checkEndCommitWithoutApproval");function OC(e,t){if(!t?.layout||!t.wiring)return[];let n=[];for(let r of e.nodes){if(r.type!=="end")continue;let i=ls(r);if(i===null||!bo(i))continue;let o=Ea[i],a=as(t.wiring,r,o);if(a===null)continue;let l=t.layout.buses.find(c=>c.key===a.bus);if(l===void 0||!gm(l,a.state))continue;let d=AC(l,a.state).outcome;d!==i&&n.push(Ia(r,"applicationOutcome",`[end/outcomeMismatch] ${r.label.de}: das Ergebnis \u201E${i}" passt nicht zum Endzustand \u201E${a.state}" (Bus ${a.bus}), der \u201E${String(d)}" besiegelt \u2014 Ergebnis oder Verdrahtung angleichen.`,`[end/outcomeMismatch] ${r.label.en}: the outcome "${i}" does not match the final state "${a.state}" (bus ${a.bus}), which seals "${String(d)}" \u2014 align the outcome or the wiring.`))}return n}s(OC,"checkEndOutcomeMatchesTerminal");function Oa(e){let t=Ue(e);return typeof t.inputs=="function"?t.inputs(e):[]}s(Oa,"inputSlots");function XJ(e,t){return Oa(e).find(n=>n.id===t)}s(XJ,"findInputSlot");function e6(e,t){let n=XJ(e,t);if(!n)return{source:"missing",spec:{id:t,label:{de:t,en:t},type:"string"},unknownSlot:!0};let r=e.inputs?.[t]??{kind:"unset"};return r.kind==="binding"&&ke(r.address)?{source:"binding",spec:n,address:r.address}:r.kind==="literal"?{source:"literal",spec:n,value:r.value}:r.kind==="cockpit"&&n.deferrable===!0?{source:"cockpit",spec:n}:n.defaultValue!==void 0?{source:"default",spec:n,value:n.defaultValue}:n.required?{source:"missing",spec:n}:{source:"optional",spec:n}}s(e6,"resolveInput");function _C(e){return Oa(e).filter(t=>e6(e,t.id).source==="missing")}s(_C,"missingRequiredInputs");var t6=["personRef","formRef","documentRef","docRef"];function n6(e){let t=Ue(e);return typeof t.inputs!="function"?[]:t.inputs(e).map(n=>({id:n.id,type:n.type}))}s(n6,"listInputs");function NC(e){let t=[];for(let n of e.nodes)for(let r of n6(n))!t6.includes(r.type)||n.inputs?.[r.id]?.kind!=="literal"||t.push({layer:"GRAPH",kind:"modelError",path:`node.${n.id}.param.${r.id}`,reason:{de:`${n.label.de}: Literal f\xFCr referenztypisierten Slot "${r.id}" ist verboten \u2014 der Slot wird an eine Adresse gebunden`,en:`${n.label.en}: A literal for the reference-typed slot "${r.id}" is not allowed \u2014 the slot is bound to an address`},severity:"error"});return t}s(NC,"findParamValueRefSlotErrors");function PC(e){let t=[];for(let n of e.nodes){let r=Ue(n);if(typeof r.inputs=="function")for(let i of r.inputs(n)){let o=n.inputs?.[i.id];if(o?.kind==="cockpit"&&i.deferrable!==!0){t.push({layer:"GRAPH",kind:"modelError",path:`nodes.${n.id}.inputs.${i.id}`,reason:{de:`[inputs/notDeferrable] ${n.label.de}: Parameter \u201E${i.label.de}\u201C l\xE4sst sich nicht im Cockpit erg\xE4nzen \u2014 nur Parameter eines Generators oder einer Vorlage.`,en:`[inputs/notDeferrable] ${n.label.en}: Parameter "${i.label.en}" cannot be completed in the cockpit \u2014 only parameters of a generator or a template can.`},severity:"error"});continue}(i.inspector==="literal-only"&&o?.kind==="binding"||i.inspector==="binding-only"&&o?.kind==="literal")&&t.push({layer:"GRAPH",kind:"modelError",path:`nodes.${n.id}.inputs.${i.id}`,reason:i.inspector==="literal-only"?{de:`[inputs/inspectorKind] ${n.label.de}: Parameter \u201E${i.label.de}\u201C ist ein fester Wert \u2014 eine Bindung an eine Adresse ist hier nicht m\xF6glich.`,en:`[inputs/inspectorKind] ${n.label.en}: Parameter "${i.label.en}" is a fixed value \u2014 it cannot be bound to an address.`}:{de:`[inputs/inspectorKind] ${n.label.de}: Parameter \u201E${i.label.de}\u201C wird an eine Adresse gebunden \u2014 ein fester Wert ist hier nicht m\xF6glich.`,en:`[inputs/inspectorKind] ${n.label.en}: Parameter "${i.label.en}" is bound to an address \u2014 a fixed value is not possible here.`},severity:"error"})}}return t}s(PC,"findInspectorKindErrors");function CC(e){let t=[];for(let n of e.nodes)for(let r of _C(n))t.push({layer:"GRAPH",kind:"contractGap",path:`node.${n.id}.input.${r.id}`,reason:{de:`${n.label.de}: Pflicht-Slot "${r.label.de}" nicht gesetzt`,en:`${n.label.en}: Required slot "${r.label.en}" is not set`},severity:"error"});return t}s(CC,"findMissingRequiredInputs");function km(e){let t=e.processStore;return t===void 0?[]:(Array.isArray(t)||D("graph.processStore must be an array \u2014 the graph validator refuses anything else"),t)}s(km,"processStoreKeys");function DC(e){let t=[];for(let n of e.tasks??[]){let r=n.result;if(!(r===void 0||!ga(r)))for(let i of Yp(r))t.push({key:i.key,nodeId:e.id,taskKey:n.key,template:n,result:r,valueType:i.valueType,...i.field!==void 0?{fieldKey:i.field.key}:{}})}return t}s(DC,"storeWritersOn");function FC(e){let t=new Map;for(let n of e.nodes)for(let r of DC(n)){let i=t.get(r.key)??[];i.push(r),t.set(r.key,i)}return t}s(FC,"processStoreWriters");function r6(e,t,n){for(let r of e.nodes){let i=DC(r).find(o=>o.taskKey===t&&o.key===n);if(i!==void 0)return i}return null}s(r6,"writerAt");function i6(e,t,n){(t.scope!=="task"||t.path!==void 0)&&D(`[process] ${n}: ${ce(t)} is no task value`);let r=r6(e,t.owner,t.key);return r===null&&D(`[address/ownerNotWriter] ${n}: task "${t.owner}" writes no "${t.key}" \u2014 publish refuses that`),{key:t.key,nodeId:r.nodeId,taskKey:r.taskKey,...r.fieldKey!==void 0?{fieldKey:r.fieldKey}:{}}}s(i6,"sourceOfAddress");function LC(e,t){(t.scope!=="task"||t.path!==void 0)&&D(`[process] ${ce(t)} is no store address`);let n=km(e).find(r=>r.key===t.key);return n===void 0&&D(`[address/unknownKey] ${ce(t)}: "${t.key}" is not declared in processStore`),{key:n.key,type:n.type,label:n.label,audience:n.audience,source:i6(e,t,ce(t))}}s(LC,"processLeafOf");var nb=new Set(["enum","pricedItem","number","boolean","reduction","string","staffUser","staffUserList","taskAssignment"]),An={invalidKey:"[process/invalidKey]",unknownKey:"[process/unknownKey]",secondWriter:"[process/secondWriter]",noWriter:"[process/noWriter]",writerTypeMismatch:"[process/writerTypeMismatch]",pricedItemWritesNothing:"[process/pricedItemWritesNothing]",internalInDocument:"[process/internalInDocument]",writerMustBlock:"[process/writerMustBlock]",absentWithoutDefault:"[process/absentWithoutDefault]",defaultItemMismatch:"[process/defaultItemMismatch]"};function Tn(e,t,n,r){return{layer:"GRAPH",kind:"contractGap",path:e,reason:{de:`${t} ${n}`,en:`${t} ${r}`},severity:"error"}}s(Tn,"err");function qC(e){let t=[],n=km(e),r=new Map(n.map(l=>[l.key,l])),i=new Set;for(let[l,d]of n.entries()){let c=`processStore[${l}]`;if(typeof d.key!="string"||!/^[a-z][a-zA-Z0-9_]*$/.test(d.key)){t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel ${JSON.stringify(d.key)} \u2014 erlaubt sind Buchstaben, Ziffern und _, beginnend mit einem Kleinbuchstaben.`,`Process key ${JSON.stringify(d.key)} \u2014 letters, digits and _ are allowed, starting with a lowercase letter.`));continue}i.has(d.key)&&t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" ist doppelt deklariert.`,`Process key "${d.key}" is declared twice.`)),i.add(d.key),nb.has(d.type)||t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" hat den Typ "${d.type}" \u2014 der Vorgang speichert nur Ergebnisse mit Wert: ${[...nb].join(", ")}.`,`Process key "${d.key}" has the type "${d.type}" \u2014 the process only stores results with a value: ${[...nb].join(", ")}.`)),(!d.label?.de?.trim()||!d.label?.en?.trim())&&t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" braucht ein Label in beiden Sprachen.`,`Process key "${d.key}" needs a label in both languages.`)),d.audience!=="internal"&&d.audience!=="printable"&&t.push(Tn(c,An.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}": audience muss 'internal' oder 'printable' sein.`,`Process key "${d.key}": audience must be 'internal' or 'printable'.`))}let o=FC(e);for(let l of e.nodes)for(let d of l.tasks??[]){let c=d.result;c?.kind==="pricedItem"&&c.writes===void 0&&t.push(Tn(`node.${l.id}.tasks.${d.key}.result.writes`,An.pricedItemWritesNothing,`Aufgabe "${d.key}" (Knoten "${l.id}") bepreist einen Artikel, schreibt das Ergebnis aber in keinen Vorgangs-Schl\xFCssel ('result.writes') \u2014 niemand k\xF6nnte den Preis lesen.`,`Task "${d.key}" (node "${l.id}") prices an article but writes the result to no process key ('result.writes') \u2014 nobody could read the price.`))}for(let[l,d]of o){let c=r.get(l);for(let u of d){let p=u.fieldKey===void 0?`node.${u.nodeId}.tasks.${u.taskKey}.result.writes`:`node.${u.nodeId}.tasks.${u.taskKey}.result.fields.${u.fieldKey}.writes`;if(c===void 0){t.push(Tn(p,An.unknownKey,`${u.fieldKey===void 0?"":`Feld "${u.fieldKey}" der `}Aufgabe "${u.taskKey}" schreibt "${l}", aber der Workflow deklariert keinen solchen Vorgangs-Schl\xFCssel (graph.processStore).`,`${u.fieldKey===void 0?"Task":`Field "${u.fieldKey}" of task`} "${u.taskKey}" writes "${l}", but the workflow declares no such process key (graph.processStore).`));continue}if(u.valueType!==c.type){let h=u.fieldKey===void 0?`Aufgabe "${u.taskKey}"`:`Feld "${u.fieldKey}" der Aufgabe "${u.taskKey}"`,y=u.fieldKey===void 0?`Task "${u.taskKey}"`:`Field "${u.fieldKey}" of task "${u.taskKey}"`;t.push(Tn(p,An.writerTypeMismatch,`${h} liefert ${u.valueType}, der Vorgangs-Schl\xFCssel "${l}" ist aber als ${c.type} deklariert.`,`${y} delivers ${u.valueType}, but the process key "${l}" is declared as ${c.type}.`))}}if(d.length>1){let u=d.map(p=>`${p.nodeId}/${p.taskKey}${p.fieldKey===void 0?"":`.${p.fieldKey}`}`).join(", ");t.push(Tn(`processStore.${l}`,An.secondWriter,`Vorgangs-Schl\xFCssel "${l}" wird ${d.length}-mal geschrieben (${u}) \u2014 genau ein Schreiber je Schl\xFCssel.`,`Process key "${l}" is written ${d.length} times (${u}) \u2014 exactly one writer per key.`))}}for(let l of n)o.has(l.key)||t.push(Tn(`processStore.${l.key}`,An.noWriter,`Vorgangs-Schl\xFCssel "${l.key}" ist deklariert, aber keine Aufgabe schreibt ihn ('result.writes').`,`Process key "${l.key}" is declared, but no task writes it ('result.writes').`));let a=new Map;for(let l of e.nodes){let d=Ue(l),c=typeof d.inputs=="function"?d.inputs(l):[];for(let u of c){let p=l.inputs?.[u.id];if(p?.kind!=="binding")continue;let h=o6(e,p.address);if(h===null)continue;let y=`node.${l.id}.input.${u.id}`,b=ce(p.address),k=a.get(h.source.key)??new Set;k.add(l.id),a.set(h.source.key,k),h.audience==="internal"&&t.push(Tn(y,An.internalInDocument,`${l.label.de}: "${u.id}" liest den internen Vorgangs-Schl\xFCssel "${h.key}" \u2014 ein Dokument dieses Knotens geht an die Familie; nur 'printable'-Schl\xFCssel d\xFCrfen hinein.`,`${l.label.en}: "${u.id}" reads the internal process key "${h.key}" \u2014 a document of this node goes to the family; only 'printable' keys may go in.`));let v=s6(o,h.source.key,h.source.taskKey);if(v.template.when!==void 0&&u.required===!0&&u.defaultValue===void 0&&t.push(Tn(y,An.absentWithoutDefault,`${l.label.de}: "${u.id}" ist Pflicht und an ${b} gebunden, aber die schreibende Aufgabe entsteht nur unter einer Bedingung (when: ${MC(v.template.when)}) \u2014 ohne Vorgabewert bliebe das Feld dann f\xFCr immer leer.`,`${l.label.en}: "${u.id}" is required and bound to ${b}, but the writing task only exists under a condition (when: ${MC(v.template.when)}) \u2014 without a default value the field would stay empty forever.`)),v.result.kind==="pricedItem"&&u.defaultValue!==void 0){let T=u.defaultValue;(!wo(T)||T.itemKey!==v.result.item||T.grantKeys.length>0)&&t.push(Tn(y,An.defaultItemMismatch,`${l.label.de}: der Vorgabewert von "${u.id}" muss der Artikel der schreibenden Aufgabe ohne Erm\xE4\xDFigung sein ({ itemKey: '${v.result.item??"?"}', grantKeys: [] }) \u2014 sonst rechnete die Familie ohne Antrag einen anderen Artikel als mit.`,`${l.label.en}: the default value of "${u.id}" must be the article of the writing task without a reduction ({ itemKey: '${v.result.item??"?"}', grantKeys: [] }) \u2014 otherwise the family would be charged a different article without an application than with one.`))}}}for(let[l,d]of a){let c=o.get(l)[0],u=c.template.blocks,p=u===void 0?void 0:u.node??c.nodeId,h=p!==void 0&&(()=>{let b=e.nodes.find(k=>k.id===p);return b!==void 0&&Ue(b).processHoldTemplate?.(b)===u.templateKey})(),y=`node.${c.nodeId}.tasks.${c.taskKey}.blocks`;if(!h){let b=[...d][0],k=e.nodes.find(T=>T.id===b),v=Ue(k).processHoldTemplate?.(k)??"?";t.push(Tn(y,An.writerMustBlock,`Die Aufgabe "${c.taskKey}" schreibt "${l}", h\xE4lt aber keinen der lesenden Knoten (${[...d].join(", ")}) zur\xFCck \u2014 sie muss den ersten blockieren, z. B. blocks: { ${b===c.nodeId?"":`node: '${b}', `}templateKey: '${v}' }, sonst arbeitet er, bevor der Wert existiert.`,`The task "${c.taskKey}" writes "${l}" but holds back none of the reading nodes (${[...d].join(", ")}) \u2014 it must block the first one, e.g. blocks: { ${b===c.nodeId?"":`node: '${b}', `}templateKey: '${v}' }, otherwise it works before the value exists.`));continue}for(let b of d)b===p||Ta(e,p,b)||t.push(Tn(y,An.writerMustBlock,`"${b}" liest "${l}", liegt aber nicht hinter dem zur\xFCckgehaltenen Knoten "${p}" \u2014 auf einem Weg an ihm vorbei l\xE4se er den Wert, bevor er feststeht.`,`"${b}" reads "${l}" but does not lie behind the held-back node "${p}" \u2014 on a path past it, it would read the value before it is settled.`))}return t}s(qC,"processBindingIssues");function o6(e,t){return!ke(t)||t.scope!=="task"||t.path!==void 0||!km(e).some(n=>n.key===t.key)||Ci(e,t.owner,t.key)===null?null:LC(e,t)}s(o6,"draftLeafOf");function s6(e,t,n){let r=e.get(t)?.find(i=>i.taskKey===n);return r===void 0&&D(`[process] the leaf of "${t}" names task "${n}", which does not write it`),r}s(s6,"writerOf");function MC(e){return ke(e)?ce(e):JSON.stringify(e)}s(MC,"shown");var KC=ho,xo=`${KC}.`,a6=new Set(["text","number","date","boolean","option","edge"]);function rb(e,t){let n=e[t];return n===void 0&&D(`[env/unknownKey] no environment key '${t}'`),typeof n=="string"?null:Object.keys(n)}s(rb,"contextFields");function jC(e,t){return Object.hasOwn(e,t)}s(jC,"isContextKey");function VC(e){let t=[];for(let n of Object.keys(e)){let r=rb(e,n);if(r===null)t.push(n);else for(let i of r)t.push(`${n}.${i}`)}return t}s(VC,"leafPaths");function Rd(e,t){let[n="",r,...i]=t.split(".");if(!jC(e,n)||i.length>0)return;let o=e[n];if(typeof o=="string")return r===void 0?o:void 0;if(!(r===void 0||!Object.hasOwn(o,r)))return o[r]}s(Rd,"leafType");function BC(e){let t=new Set;for(let n of e){let r=_a(n);r!==null&&t.add(r.split(".")[0])}return[...t]}s(BC,"contextKeysOf");function _a(e){return e.startsWith(xo)?e.slice(xo.length):null}s(_a,"contextPathOf");function $d(e){return e===KC||e.startsWith(xo)}s($d,"isContextIdentifier");function bm(e,t){let n=_a(t)??"",[r=""]=n.split("."),i=Object.keys(e);if(!jC(e,r))return{code:"env/unknownKey",message:{de:`'${t}' nennt keinen Umgebungsschl\xFCssel \u2014 bekannt: ${i.join(", ")}.`,en:`'${t}' names no environment key \u2014 known: ${i.join(", ")}.`}};if(Rd(e,n)!==void 0)return null;let o=rb(e,r);return{code:"env/unknownKey",message:o===null?{de:`'${t}': der Umgebungsschl\xFCssel '${r}' ist ein einzelner Wert \u2014 lies ihn als '${xo}${r}'.`,en:`'${t}': environment key '${r}' is a single value \u2014 read it as '${xo}${r}'.`}:{de:`'${t}': der Umgebungsschl\xFCssel '${r}' hat die Felder ${o.join(", ")}.`,en:`'${t}': environment key '${r}' has the fields ${o.join(", ")}.`}}}s(bm,"identifierIssue");function vm(e,t,n=Object.keys(e)){let r={};for(let i of n){let o=rb(e,i),a=Object.hasOwn(t,i)?t[i]:void 0;if(a===void 0&&D(`[env/missing] context key '${i}' was not supplied`),o===null){r[`${xo}${i}`]=a;continue}for(let l of o){let d=typeof a=="object"&&a!==null&&Object.hasOwn(a,l)?a[l]:void 0;d===void 0&&D(`[env/missing] context key '${i}' carries no '${l}'`),r[`${xo}${i}.${l}`]=d}}return r}s(vm,"flatten");function l6(e,t){switch(t){case"number":return typeof e=="number"&&Number.isFinite(e);case"boolean":return typeof e=="boolean";case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e);default:return typeof e=="string"}}s(l6,"valueMatchesDataType");function UC(e,t,n=Object.keys(e.types)){let r=new Set(n);for(let i of VC(e.types)){if(!r.has(i.split(".")[0]))continue;let o=t[`${xo}${i}`];o===void 0&&D(`[env/missing] context path '${i}' was not supplied`);let a=e.fields[i];if(o===null){a.nullable||D(`[env/null] context path '${i}' is not nullable but carries null`);continue}let l=gn(Rd(e.types,i));l6(o,l)||D(`[env/type] context path '${i}' expects ${l}, got ${JSON.stringify(o)}`),a.valueSet.kind==="fixed"&&!a.valueSet.values.includes(o)&&D(`[env/value] context path '${i}' carries '${String(o)}', outside ${a.valueSet.values.join(" | ")}`)}}s(UC,"assertContextValues");function d6(e){let t=[],n=VC(e.types);for(let r of n){let i=Rd(e.types,r),o=gn(i);if(!di(i)||o===void 0||!a6.has(o)){t.push(`'${r}' has type '${String(i)}', not a scalar value type`);continue}let a=Object.hasOwn(e.fields,r)?e.fields[r]:void 0;if(a===void 0){t.push(`'${r}' has no field spec (value set + nullability)`);continue}a.valueSet.kind==="fixed"&&(a.valueSet.values.length===0&&t.push(`'${r}' has an empty fixed value set`),o!=="text"&&o!=="option"&&t.push(`'${r}' is ${o}; a fixed value set needs a text or option leaf`))}for(let r of Object.keys(e.fields))n.includes(r)||t.push(`field spec '${r}' names no leaf of the schema`);return t}s(d6,"schemaIssues");function Na(e){let t=d6(e);t.length>0&&D(`[env/schema] ${t.join("; ")}`)}s(Na,"assertSchema");var xm={length:{params:["text"],returns:"number"},years_between:{params:["date","date"],returns:"number"}};function So(e){return JSON.stringify(e)}s(So,"canonical");function Ca(e){return e.kind==="binary"&&e.op==="&&"?[...Ca(e.left),...Ca(e.right)]:[e]}s(Ca,"conjuncts");function WC(e,t){let n;try{n=Mt(e)}catch{return!1}let r=So(Mt(t));return Ca(n).some(i=>So(i)===r)}s(WC,"hasConjunct");function YC(e,t){try{return So(Mt(e))===So(Mt(t))}catch{return!1}}s(YC,"sameCondition");function HC(e){let t=[];for(let n of e)t.push(...qt(Pi(n)));return BC(t)}s(HC,"contextKeysRead");function JC(e){try{return qt(Mt(e)).some($d)}catch{return!1}}s(JC,"readsContext");var c6=/^\d{4}-\d{2}-\d{2}$/,u6=new Set(["==","!=","<","<=",">",">=","in"]),f6=new Set(["<","<=",">",">="]);function Am(e,t,n=[]){Na(t);let r;try{r=Mt(e)}catch(a){let l=a.message;return[an("condition/parse",`Bedingung '${e}' ist nicht lesbar: ${l}`,`condition '${e}' does not parse: ${l}`)]}let i=[];for(let a of qt(r)){if(!$d(a)){i.push(an("condition/foreignIdentifier",`'${a}' ist kein Umgebungswert \u2014 Bedingungen lesen nur '$env.*'`,`'${a}' is not a context identifier \u2014 conditions read only '$env.*'`));continue}let l=bm(t.types,a);l!==null&&i.push(an("condition/unknownIdentifier",l.message.de,l.message.en))}if(i.length>0)return i;let o=fi(r,t,i);Ed(o)||i.push(an("condition/notBoolean",`Bedingung '${e}' ist kein Ja/Nein-Ausdruck`,`condition '${e}' is not a yes/no expression`)),g6(r,t,i);for(let{identifier:a,op:l}of sb(r,t))i.push(an("condition/unguardedNullable",`'${l}' \xFCber '${a}', das leer sein kann, braucht davor eine Absicherung '${a} != null &&'`,`'${l}' over '${a}', which may be null, needs a guard '${a} != null &&' before it`));return i.push(...p6(r,n)),i}s(Am,"conditionIssues");function p6(e,t){let n=Ca(e).map(So);return t.flatMap(r=>{let i=Mt(r),o=m6(i);return o===null||!n.includes(So(o))?[]:[{severity:"info",code:"condition/guardForm",message:{de:`[condition/guardForm] eine gespiegelte Absicherung z\xE4hlt nicht \u2014 schreibe sie genau als '${r}'`,en:`[condition/guardForm] a mirrored guard does not count \u2014 write it exactly as '${r}'`}}]})}s(p6,"guardFormHints");function m6(e){if(e.kind!=="binary"||e.op!=="=="&&e.op!=="!=")return null;let t={...e,left:e.right,right:e.left};return So(t)===So(e)?null:t}s(m6,"mirror");function Ed(e){return e.t==="unknown"||e.t==="data"&&e.dt==="boolean"}s(Ed,"isBooleanish");function QC(e){let t=_a(e);return t===null&&D(`[condition/invariant] '${e}' reached a pass that only sees $env identifiers`),t}s(QC,"contextPath");function ZC(e,t){let n=_a(t);return n!==null&&e.fields[n]?.nullable===!0}s(ZC,"isNullableLeaf");function h6(e,t){let n=gn(Rd(e.types,QC(t)));return n===void 0?{t:"unknown"}:{t:"data",dt:n}}s(h6,"identType");function Sm(e,t){return e.t==="unknown"||t.t==="unknown"||e.t==="null"||t.t==="null"?!0:e.t==="array"||t.t==="array"?!1:e.t==="str"&&t.t==="str"?!0:e.t==="str"?GC(e.value,t.dt):t.t==="str"?GC(t.value,e.dt):e.dt===t.dt}s(Sm,"fits");function GC(e,t){return t==="text"||t==="option"||t==="edge"?!0:t==="date"?c6.test(e):!1}s(GC,"strFits");function zC(e){return e.t==="unknown"?"unknown":e.t==="data"&&e.dt==="number"?"number":null}s(zC,"orderedCategory");function fi(e,t,n){switch(e.kind){case"num":return{t:"data",dt:"number"};case"bool":return{t:"data",dt:"boolean"};case"str":return{t:"str",value:e.value};case"null":return{t:"null"};case"ident":return h6(t,e.path);case"arr":for(let r of e.items)fi(r,t,n);return{t:"array"};case"unary":{let r=fi(e.operand,t,n);return Ed(r)||n.push(an("condition/notBoolean","'!' braucht einen Ja/Nein-Operanden","'!' needs a yes/no operand")),{t:"data",dt:"boolean"}}case"call":{let r=Object.hasOwn(xm,e.name)?xm[e.name]:void 0,i=e.args.map(l=>fi(l,t,n));return r===void 0?(n.push(an("condition/functionNotAllowed",`Funktion '${e.name}' ist nicht erlaubt \u2014 erlaubt: ${Object.keys(xm).join(", ")}`,`function '${e.name}' is not allowed \u2014 allowed: ${Object.keys(xm).join(", ")}`)),{t:"unknown"}):(i.length===r.params.length&&i.every((l,d)=>l.t!=="null"&&Sm(l,{t:"data",dt:r.params[d]}))||n.push(an("condition/typeMismatch",`'${e.name}' nimmt (${r.params.join(", ")})`,`'${e.name}' takes (${r.params.join(", ")})`)),{t:"data",dt:r.returns})}case"if":{let r=fi(e.cond,t,n);Ed(r)||n.push(an("condition/notBoolean","'if' braucht eine Ja/Nein-Bedingung","'if' needs a yes/no condition"));let i=fi(e.then,t,n),o=fi(e.else,t,n);return Sm(i,o)||n.push(an("condition/typeMismatch","die beiden Zweige von 'if' haben verschiedene Typen","the two arms of 'if' differ in type")),i.t==="null"?o:i}case"binary":{let r=fi(e.left,t,n),i=fi(e.right,t,n);if(e.op==="&&"||e.op==="||")(!Ed(r)||!Ed(i))&&n.push(an("condition/notBoolean",`'${e.op}' braucht Ja/Nein-Operanden`,`'${e.op}' needs yes/no operands`));else if(e.op==="in")e.right.kind!=="arr"?n.push(an("condition/inWithoutArray","'in' braucht rechts eine Liste, z. B. ['a', 'b']","'in' needs a list on its right, e.g. ['a', 'b']")):e.right.items.every(o=>Sm(r,fi(o,t,[])))||n.push(an("condition/typeMismatch","ein Listeneintrag von 'in' passt nicht zum Typ des linken Operanden","a list item of 'in' does not match the left operand's type"));else if(f6.has(e.op)){let o=zC(r),a=zC(i);(o===null||a===null||o!=="unknown"&&a!=="unknown"&&o!==a)&&n.push(an("condition/orderedComparison",`'${e.op}' vergleicht nur Zahlen \u2014 f\xFCr Daten years_between(\u2026) verwenden`,`'${e.op}' compares only numbers \u2014 for dates use years_between(\u2026)`))}else Sm(r,i)||n.push(an("condition/typeMismatch",`'${e.op}' vergleicht Werte verschiedener Typen`,`'${e.op}' compares values of different types`));return{t:"data",dt:"boolean"}}}}s(fi,"typeOf");function ib(e){return e.kind==="str"||e.kind==="num"||e.kind==="bool"}s(ib,"isLiteral");function XC(e){let t=[],n=s(r=>{if(r.kind==="binary"&&u6.has(r.op)){if(r.left.kind==="ident"){let i=r.op==="in"&&r.right.kind==="arr"?r.right.items.filter(ib):ib(r.right)?[r.right]:[];i.length>0&&t.push({ident:r.left.path,literals:i})}r.right.kind==="ident"&&ib(r.left)&&t.push({ident:r.right.path,literals:[r.left]})}eD(r,n)},"visit");return n(e),t}s(XC,"comparedLiterals");function g6(e,t,n){for(let{ident:r,literals:i}of XC(e)){let o=y6(r,i,t);o!==null&&n.push(o)}}s(g6,"literalIssues");function ob(e,t){let n;try{n=Mt(e)}catch{return[]}let r=[];for(let{ident:i,literals:o}of XC(n)){let a=_a(i);if(!(a===null||t.fields[a]?.valueSet.kind!=="live"))for(let l of o)l.kind==="str"&&r.push({path:a,value:l.value})}return r}s(ob,"liveLiterals");function y6(e,t,n){let r=n.fields[QC(e)]?.valueSet;if(r?.kind==="unstable")return an("condition/literalOnUnstable",`'${e}' ist nicht \xFCber Umgebungen stabil \u2014 vergleiche ihn mit keinem festen Wert; verzweige stattdessen \xFCber ein stabiles Merkmal`,`'${e}' is not stable across environments \u2014 compare it to no literal; branch on a stable attribute instead`);if(r?.kind!=="fixed")return null;let i=t.flatMap(a=>a.kind==="str"&&!r.values.includes(a.value)?[`'${a.value}'`]:[]);if(i.length===0)return null;let o=r.values.map(a=>`'${a}'`).join(", ");return an("condition/literalOutsideSet",`'${e}' kennt nur ${o} \u2014 nicht ${i.join(", ")}`,`'${e}' takes only ${o} \u2014 not ${i.join(", ")}`)}s(y6,"valueSetIssue");function eD(e,t){switch(e.kind){case"binary":t(e.left),t(e.right);return;case"unary":t(e.operand);return;case"call":e.args.forEach(t);return;case"arr":e.items.forEach(t);return;case"if":t(e.cond),t(e.then),t(e.else);return;default:return}}s(eD,"forEachChild");function tD(e){return e.kind==="binary"&&(e.op==="=="||e.op==="!=")&&(e.left.kind==="ident"&&e.right.kind==="null"||e.left.kind==="null"&&e.right.kind==="ident")}s(tD,"isNullTest");function nD(e){return Ca(e).flatMap(t=>{let n=rD(t);return n===null?[]:[n]})}s(nD,"guardsOf");function Id(e,t,n){switch(e.kind){case"ident":return ZC(t,e.path)&&!n.has(e.path)?e.path:null;case"call":for(let r of e.args){let i=Id(r,t,n);if(i!==null)return i}return null;case"if":return Id(e.then,t,new Set([...n,...nD(e.cond)]))??Id(e.else,t,n);default:return null}}s(Id,"unguardedNullSource");function rD(e){return!tD(e)||e.kind!=="binary"||e.op!=="!="?null:e.left.kind==="ident"?e.left.path:e.right.kind==="ident"?e.right.path:null}s(rD,"guardedIdent");function Pa(e,t,n,r){if(e.kind==="binary"&&e.op==="&&"){let i=new Set(n);for(let o of Ca(e)){Pa(o,t,i,r);let a=rD(o);a!==null&&i.add(a)}return}if(e.kind==="if"){Pa(e.cond,t,n,r),Pa(e.then,t,new Set([...n,...nD(e.cond)]),r),Pa(e.else,t,n,r);return}if(e.kind==="binary"&&e.op==="!="&&e.left.kind!=="null"&&e.right.kind!=="null"){let i=Id(e.left,t,n)??Id(e.right,t,n);i!==null&&r(i,"!=")}if(e.kind==="unary"&&!tD(e.operand)){let i=qt(e.operand).filter(o=>ZC(t,o)&&!n.has(o));i.length>0&&r(i[0],"!")}eD(e,i=>Pa(i,t,n,r))}s(Pa,"nullableReads");function sb(e,t){Na(t);let n=[];return Pa(e,t,new Set,(r,i)=>{n.some(o=>o.identifier===r)||n.push({identifier:r,op:i})}),n}s(sb,"unguardedNullableReads");function an(e,t,n){return{severity:"error",code:e,message:{de:`[${e}] ${t}`,en:`[${e}] ${n}`}}}s(an,"error");function Od(e){let t=Array.isArray(e.nodes)?e.nodes:[],n=new Set;for(let r of t)for(let i of fm(r))i.key!==null&&Sa[i.leaf].involves&&n.add(i.key);return n}s(Od,"declaredGroupKeys");var Da=Dp;var w6="unit.key",k6="offer.key";function iD(e,t){return e===w6?t.unitKeys:e===k6?t.offerKeys:null}s(iD,"liveKeyUniverse");function Tm(e){return[xt,...[...Od(e)].sort((t,n)=>t.localeCompare(n)).map(Vp)]}s(Tm,"requiredSlots");var Ao=`${Lp("applicant.channel")} == 'staff'`;var lb=["strict","leastLoaded"];var ab=2;function oD(e){return e.some(t=>t.length===0)?{de:"nennt einen leeren Personenschl\xFCssel",en:"names an empty person key"}:new Set(e).size!==e.length?{de:"nennt eine Person zweimal",en:"names a person twice"}:e.length<ab?{de:`braucht mindestens ${ab} Personen`,en:`needs at least ${ab} people`}:null}s(oD,"rotationPoolProblem");function b6(e,t){let n=t===null?-1:e.indexOf(t);return[...e.slice(n+1),...e.slice(0,n+1)]}s(b6,"strictOrder");function sD(e){let t=b6(e.pool,e.previous).filter(i=>e.eligible.has(i));if(t.length===0)return null;if(e.mode==="strict")return t[0];let n=e.openCounts;n===void 0&&D("[assignment/rotation] leastLoaded needs the open counts");let r=s(i=>{let o=n.get(i);return o===void 0&&D(`[assignment/rotation] no open count for '${i}'`),o},"load");return t.reduce((i,o)=>r(o)<r(i)?o:i)}s(sD,"pickFromPool");function lD(e){return e.map(t=>({slot:NN(t.slot),rules:[...t.rules]}))}s(lD,"rulesOfStored");function dD(e){return e.map(t=>({slot:v6(t.slot),rules:[...t.rules]}))}s(dD,"storedOfRules");function v6(e){let t=Up(e);return t===null&&D(`[assignment/unknownSlot] '${e}' is no slot \u2014 'responsible' or 'team:<teamKey>'`),t}s(v6,"slotOf");function cD(e,t){let n=e?.assignmentRules;n===void 0&&D(`[assignment/noRules] ${t}: the workflow has no assignment rule`);let r=mD(n);return r.length>0&&D(`${r.join("; ")} (${t})`),lD(n)}s(cD,"rulesOfGraph");function x6(e){return e===xt?{slot:e,rules:[{when:Ao,assign:{kind:"creator"}},{when:null,assign:{kind:"unassigned"}}]}:{slot:e,rules:[{when:null,assign:{kind:"queue"}}]}}s(x6,"defaultSlotRules");function uD(e,t){let n=new Set(e.map(o=>o.slot)),r=t.filter(o=>!n.has(o)).map(x6);return[...r.filter(o=>o.slot===xt),...e,...r.filter(o=>o.slot!==xt)]}s(uD,"withRequiredSlots");function jt(e,t){return t===void 0?`slot '${e}'`:`slot '${e}' row #${t+1}`}s(jt,"where");function Hn(e,t){return t===void 0?`Liste '${e}'`:`Liste '${e}', Zeile #${t+1}`}s(Hn,"whereDe");function Fn(e,t,n={},r="error"){return{severity:r,code:e,message:{de:`[${e}] ${t.de}`,en:`[${e}] ${t.en}`},...n}}s(Fn,"issue");function aD(e){if(e===xt)return!0;let t=Bp(e);return t!==null&&t.length>0}s(aD,"isKnownSlot");function S6(e,t){Na(Da);let n=[],r=new Set;e.forEach((o,a)=>{let{slot:l}=o;aD(l)||n.push(Fn("assignment/unknownSlot",{de:`'${l}' ist keine Liste \u2014 'responsible' oder 'team:<teamKey>'`,en:`'${l}' is no slot \u2014 'responsible' or 'team:<teamKey>'`},{slot:l})),r.has(l)&&n.push(Fn("assignment/duplicateSlot",{de:`${Hn(l)} steht zweimal da`,en:`${jt(l)} is listed twice`},{slot:l})),r.add(l),l===xt&&a!==0&&n.push(Fn("assignment/responsibleFirst",{de:`'${xt}' muss die erste Liste sein \u2014 Team-Zeilen \xFCbernehmen sie`,en:`'${xt}' must be the first slot \u2014 team rows copy it`},{slot:l})),n.push(...A6(o))});for(let o of t)r.has(o)||n.push(Fn("assignment/slotMissing",{de:`${Hn(o)} hat keine Regeln \u2014 der Workflow braucht sie`,en:`${jt(o)} has no rule list \u2014 the workflow needs it`},{slot:o}));let i=new Set(t);for(let{slot:o}of e)o!==xt&&!i.has(o)&&aD(o)&&n.push(Fn("assignment/unusedSlot",{de:`${Hn(o)} wird hier nicht gebraucht \u2014 erlaubt, und nicht ausgewertet`,en:`${jt(o)} is not needed here \u2014 allowed, and not evaluated`},{slot:o},"info"));return n}s(S6,"validateRules");function A6({slot:e,rules:t}){let n=[];return(t.length===0||t[t.length-1].when!==null)&&n.push(Fn("assignment/defaultRowMissing",{de:`${Hn(e)} muss mit einer Zeile ohne Bedingung enden (\u201Esonst\u201C)`,en:`${jt(e)} must end with a row without condition ("otherwise")`},{slot:e})),t.forEach((r,i)=>{let o={slot:e,row:i},{when:a,assign:l}=r;if(a===null&&i<t.length-1&&n.push(Fn("assignment/ruleAfterDefault",{de:`${Hn(e,i)} hat keine Bedingung, aber es folgen Zeilen \u2014 sie treffen nie zu`,en:`${jt(e,i)} has no condition, but rows follow it \u2014 they can never match`},o)),a!==null){let d=Am(a,Da,[Ao]);for(let c of d)n.push({...c,message:{de:`${c.message.de} (${Hn(e,i)})`,en:`${c.message.en} (${jt(e,i)})`},...o});if(d.every(c=>c.severity!=="error")){JC(a)||n.push(Fn("assignment/shadowedRule",{de:`${Hn(e,i)} liest nichts aus dem Vorgang \u2014 sie gilt immer oder nie`,en:`${jt(e,i)} reads nothing of the application \u2014 it holds for every application or for none`},o));let c=t.slice(0,i).findIndex(u=>u.when!==null&&YC(u.when,a));c!==-1&&n.push(Fn("assignment/shadowedRule",{de:`${Hn(e,i)} wiederholt die Bedingung von Zeile #${c+1} \u2014 sie trifft nie zu`,en:`${jt(e,i)} repeats the condition of row #${c+1} \u2014 it can never match`},o))}}if(e===xt&&l.kind==="slot"&&n.push(Fn("assignment/slotForwardRef",{de:`${Hn(e,i)} \xFCbernimmt '${l.slot}' \u2014 das darf nur eine Team-Liste nach '${xt}'`,en:`${jt(e,i)} copies '${l.slot}' \u2014 only a team slot after '${xt}' may`},o)),e===xt&&l.kind==="queue"&&n.push(Fn("assignment/queueOnProcessSlot",{de:`${Hn(e,i)} weist die Queue zu \u2014 die Prozesszust\xE4ndigkeit ist immer eine Person`,en:`${jt(e,i)} assigns the queue \u2014 the responsible slot is always a person`},o)),l.kind==="unassigned"&&n.push(Fn("assignment/targetMissing",{de:`${Hn(e,i)} nennt noch niemanden \u2014 Person w\xE4hlen`,en:`${jt(e,i)} names no one yet \u2014 choose a person`},o)),l.kind==="rotation"){let d=oD(l.configKeys);d!==null&&n.push(Fn("assignment/rotationPool",{de:`${Hn(e,i)}: die Reihum-Liste ${d.de}`,en:`${jt(e,i)} rotates over a pool that ${d.en}`},o))}l.kind==="creator"&&(a===null||!WC(a,Ao))&&n.push(Fn("assignment/unguardedTarget",{de:`${Hn(e,i)} weist die anlegende Person zu \u2014 die gibt es nur, wenn die Bedingung der Zeile '${Ao}' ist (oder enth\xE4lt)`,en:`${jt(e,i)} assigns the creator, which exists only when the row's condition is (or has the conjunct) '${Ao}'`},o))}),n}s(A6,"rowIssues");function fD(e,t){for(let r of t)e.some(i=>i.slot===r)||D(`[assignment/slotMissing] ${jt(r)} has no rule list`);let n=new Set(t);return e.filter(r=>n.has(r.slot))}s(fD,"selectSlots");function T6(e,t){return HC(fD(e,t).flatMap(n=>n.rules.flatMap(r=>r.when===null?[]:[r.when])))}s(T6,"contextKeysOfRules");function pD(e,t,n,r){Na(Da);let i=fD(e,n),o=T6(e,n),a=vm(Da.types,t,o);UC(Da,a,o);let l=[];for(let{slot:d,rules:c}of i){let u=c.findIndex((h,y)=>{if(h.when===null)return!0;for(let b of qt(Pi(h.when)))Object.hasOwn(a,b)||D(`[condition/unknownIdentifier] ${jt(d,y)} reads '${b}', which the context does not carry`);return sP(h.when,{values:a})});u===-1&&D(`[assignment/defaultRowMissing] ${jt(d)}: no row matched and there is no default row`);let p=c[u].assign;l.push({slot:d,ruleIndex:u,assign:p,value:R6(d,u,p,l,r)})}return l}s(pD,"evaluateRules");function R6(e,t,n,r,i){switch(n.kind){case"person":return{kind:"value",value:i.person(n.configKey)};case"creator":return{kind:"value",value:i.creator()};case"rotation":return{kind:"value",value:i.rotation(n,{slot:e,row:t})};case"unassigned":return D(`[assignment/targetMissing] ${jt(e,t)} names no one`);case"queue":return e===xt&&D(`[assignment/queueOnProcessSlot] ${jt(e,t)} assigns the queue`),{kind:"queue"};case"slot":{let o=e===xt?void 0:r.find(a=>a.slot===n.slot);return o===void 0&&D(`[assignment/slotForwardRef] ${jt(e,t)} copies '${n.slot}', which is not decided before it`),o.value}}}s(R6,"resolveTarget");var db={person:["kind","configKey"],creator:["kind"],slot:["kind","slot"],queue:["kind"],rotation:["kind","configKeys","mode"],unassigned:["kind"]};function $6(e){if(typeof e!="object"||e===null)return!1;let{kind:t,groupKey:n,...r}=e;return Object.keys(r).length>0?!1:t==="responsible"?n===void 0:t==="team"&&typeof n=="string"&&n.length>0}s($6,"isStoredSlot");function mD(e){let t=[],n=s((r,i)=>t.push(`[assignment/shape] ${r}: ${i}`),"bad");return Array.isArray(e)?(e.forEach((r,i)=>{let o=`slots[${i}]`;if(typeof r!="object"||r===null)return n(o,"must be { slot, rules }");let{slot:a,rules:l,...d}=r;if(Object.keys(d).length>0&&n(o,`unknown field(s) ${Object.keys(d).join(", ")}`),$6(a)||n(o,"slot must be { kind: 'responsible' } or { kind: 'team', groupKey: '<team key>' }"),!Array.isArray(l))return n(o,"rules must be a list");l.forEach((c,u)=>{let p=`${o}.rules[${u}]`;if(typeof c!="object"||c===null)return n(p,"must be { when, assign }");let{when:h,assign:y,...b}=c;Object.keys(b).length>0&&n(p,`unknown field(s) ${Object.keys(b).join(", ")}`),h!==null&&typeof h!="string"&&n(p,"when must be a condition string or null (\u201Esonst\u201C)");let k=y?.kind;if(typeof y!="object"||y===null||typeof k!="string"||!Object.hasOwn(db,k))return n(p,`assign must be one of ${Object.keys(db).map(I=>`{kind:'${I}'}`).join(", ")}`);let v=db[k],T=Object.keys(y);(T.some(I=>!v.includes(I))||v.some(I=>!T.includes(I)))&&n(p,`a '${k}' target has exactly the field(s) ${v.join(", ")}`);let $=y;if(k==="person"&&(typeof $.configKey!="string"||$.configKey.length===0)&&n(p,"a 'person' target needs a non-empty configKey"),k==="rotation"){let I=$.configKeys;(!Array.isArray(I)||I.some(C=>typeof C!="string"))&&n(p,"a 'rotation' target needs configKeys, a list of person keys"),lb.includes($.mode)||n(p,`a 'rotation' target's mode is one of ${lb.map(C=>`'${C}'`).join(", ")}`)}k==="slot"&&$.slot!==xt&&n(p,`a 'slot' target copies '${xt}' and nothing else`)})}),t):(n("slots","must be a list of { slot, rules }"),t)}s(mD,"ruleShapeIssues");function hD(e){let t=e??{},n=[];if(t.teamOwnerBindings!==void 0&&n.push({de:"[assignment/legacyBindings] der Workflow tr\xE4gt noch teamOwnerBindings \u2014 die Zust\xE4ndigkeitsregel ersetzt sie; das Feld entfernen",en:"[assignment/legacyBindings] the workflow still carries teamOwnerBindings \u2014 the assignment rule replaces them; remove the field"}),t.assignmentRules===void 0)return n.push({de:"[assignment/noRules] der Workflow hat keine Zust\xE4ndigkeitsregel (graph.assignmentRules) \u2014 jeder Workflow muss sagen, wer zust\xE4ndig wird",en:"[assignment/noRules] the workflow has no assignment rule (graph.assignmentRules) \u2014 every workflow must say who becomes responsible"}),n;let r=mD(t.assignmentRules);if(r.length>0)return[...n,...r.map(o=>({de:o,en:o}))];let i=Tm({nodes:Array.isArray(t.nodes)?t.nodes:[]});for(let o of S6(lD(t.assignmentRules),i))o.severity==="error"&&n.push(o.message);return n}s(hD,"workflowAssignmentIssues");var cb="team:",E6=/^[a-z0-9][a-z0-9-]*$/;function I6(e){if(!e.startsWith(cb))return null;let t=e.slice(cb.length);return t.length>0?t:null}s(I6,"teamKeyOfMember");function Rm(e){return`${cb}${e}`}s(Rm,"teamMember");function Fa(e){let t=e.channels;return t===void 0?[]:(Array.isArray(t)||D("graph.channels must be an array"),t)}s(Fa,"readAuthoredChannels");function gD(e){return[...Od(e)].sort()}s(gD,"derivedChannelTeamKeys");function yD(e,t){let n=e.toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/ß/g,"ss").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"channel";if(!t.has(n))return n;for(let r=2;;r++){let i=`${n}-${r}`;if(!t.has(i))return i}}s(yD,"mintChannelKey");function wD(e,t){let n=e.channels;if(n===void 0)return[];if(!Array.isArray(n))return[{path:"channels",reason:{de:"[channels/shape] graph.channels muss eine Liste sein.",en:"[channels/shape] graph.channels must be a list."}}];let r=[],i=Od(e),o=new Set,a=new Map;return n.forEach((l,d)=>{let c=`channels[${d}]`,u=l;if(u===null||typeof u!="object"||typeof u.key!="string"||Ft(u.label)==="not-localized"||!Array.isArray(u.members)||!u.members.every(T=>typeof T=="string")){r.push({path:c,reason:{de:"[channels/shape] Ein Kanal braucht key, label ({ de, en }) und members (Liste von Texten).",en:"[channels/shape] A channel needs key, label ({ de, en }) and members (a list of texts)."}});return}let p={de:`Kanal "${u.key}"`,en:`Channel "${u.key}"`};E6.test(u.key)||r.push({path:`${c}.key`,reason:{de:`[channels/invalidKey] ${p.de}: Schl\xFCssel nur aus Kleinbuchstaben, Ziffern und Bindestrich.`,en:`[channels/invalidKey] ${p.en}: key only from lowercase letters, digits and hyphens.`}}),o.has(u.key)&&r.push({path:`${c}.key`,reason:{de:`[channels/duplicateKey] ${p.de}: Schl\xFCssel ist doppelt vergeben.`,en:`[channels/duplicateKey] ${p.en}: key is used twice.`}}),o.add(u.key);let h=Ft(u.label);if(h!=="not-localized"&&h.length===2?r.push({path:`${c}.label`,reason:{de:`[channels/emptyLabel] ${p.de}: Bezeichnung fehlt.`,en:`[channels/emptyLabel] ${p.en}: name is missing.`}}):h!=="not-localized"&&h.length>0&&r.push({path:`${c}.label`,reason:{de:`[i18n/missingTranslation] ${p.de}: Bezeichnung fehlt in: ${h.join(", ")} \u2014 jeder angezeigte Text braucht Deutsch und Englisch.`,en:`[i18n/missingTranslation] ${p.en}: name is missing in: ${h.join(", ")} \u2014 every displayed text needs German and English.`}}),u.members.length===0){r.push({path:`${c}.members`,reason:{de:`[channels/emptyMembers] ${p.de}: mindestens ein Team.`,en:`[channels/emptyMembers] ${p.en}: at least one team.`}});return}let y=[];for(let T of u.members){let $=I6(T);if($===null){r.push({path:`${c}.members`,reason:{de:`[channels/invalidMember] ${p.de}: "${T}" ist kein "team:<schl\xFCssel>".`,en:`[channels/invalidMember] ${p.en}: "${T}" is not a "team:<key>".`}});continue}if(y.includes($)){r.push({path:`${c}.members`,reason:{de:`[channels/duplicateMember] ${p.de}: Team "${$}" ist doppelt genannt.`,en:`[channels/duplicateMember] ${p.en}: team "${$}" is named twice.`}});continue}t!==void 0&&!t.has($)&&r.push({path:`${c}.members`,reason:{de:`[channels/unknownTeam] ${p.de}: Team "${$}" gibt es in diesem Mandanten nicht (oder es ist die Bewerbergruppe).`,en:`[channels/unknownTeam] ${p.en}: team "${$}" does not exist at this school (or it is the applicant group).`}}),y.push($)}if(y.length===0)return;let b=[...y].sort().join("+"),[k]=y;y.length===1&&k!==void 0&&i.has(k)&&r.push({path:`${c}.members`,reason:{de:`[channels/duplicatesDerived] ${p.de}: Team "${k}" ist am Prozess beteiligt und hat seinen Kanal schon automatisch.`,en:`[channels/duplicatesDerived] ${p.en}: team "${k}" takes part in the process and already has its channel automatically.`}});let v=a.get(b);v!==void 0?r.push({path:`${c}.members`,reason:{de:`[channels/duplicateMembership] ${p.de}: dieselben Teams wie Kanal "${v}" \u2014 zwei Tabs w\xE4ren derselbe Chat.`,en:`[channels/duplicateMembership] ${p.en}: the same teams as channel "${v}" \u2014 two tabs would be the same chat.`}}):a.set(b,u.key)}),r}s(wD,"channelIssues");function $m(e){return e.kind==="entered"&&!e.repeated&&e.reviewRequired}s($m,"isReviewField");function La(e){let t=[],n=[];function r(k,v){try{return Mt(k)}catch(T){t.push({path:v,src:k,reason:T instanceof Error?T.message:String(T)});return}}s(r,"tryParse");function i(k,v){return{...k,visibleIf:k.visibleIf?r(k.visibleIf,`${v}.visibleIf`):void 0,requiredIf:k.requiredIf?r(k.requiredIf,`${v}.requiredIf`):void 0,disabledIf:k.disabledIf?r(k.disabledIf,`${v}.disabledIf`):void 0,defaultValue:k.defaultValue?r(k.defaultValue,`${v}.defaultValue`):void 0}}s(i,"compileField");function o(k,v){return{...k,visibleIf:k.visibleIf?r(k.visibleIf,`${v}.visibleIf`):void 0,fields:k.fields.map((T,$)=>i(T,`${v}.fields[${$}]`))}}s(o,"compileGroup");function a(k,v){return{...k,itemTemplate:k.itemTemplate.map((T,$)=>i(T,`${v}.itemTemplate[${$}]`)),effects:k.effects?.map((T,$)=>d(T,`${v}.effects[${$}]`)),itemVisibleIf:k.itemVisibleIf?r(k.itemVisibleIf,`${v}.itemVisibleIf`):void 0}}s(a,"compileRepeated");function l(k,v){let T=[];return k.fields.forEach(($,I)=>{if($.externalFlag){n.push({key:$.key,label:$.label,defaultValue:$.defaultValue?r($.defaultValue,`${v}.fields[${I}].defaultValue`):void 0});return}T.push(i($,`${v}.fields[${I}]`))}),{...k,visibleIf:k.visibleIf?r(k.visibleIf,`${v}.visibleIf`):void 0,fields:T,groups:k.groups?.map(($,I)=>o($,`${v}.groups[${I}]`)),computed:k.computed?.map(($,I)=>{let C=r($.expression,`${v}.computed[${I}].expression`);return{key:$.key,expression:C??{kind:"null"}}}),subsections:k.subsections?.map(($,I)=>l($,`${v}.subsections[${I}]`)),repeated:k.repeated?.map(($,I)=>a($,`${v}.repeated[${I}]`)),validators:k.validators}}s(l,"compileSection");function d(k,v){return{...k,when:k.when?r(k.when,`${v}.when`):void 0}}s(d,"compileEffect");function c(k,v){let T=r(k.when,`${v}.when`);return T?{...k,when:T}:null}s(c,"compileOutcome");let u=e.sections.map((k,v)=>l(k,`sections[${v}]`)),p=(e.effects??[]).map((k,v)=>d(k,`effects[${v}]`)),h=[],y=e.outcomes??[];for(let k=0;k<y.length;k++){let v=y[k],T=c(v,`outcomes[${k}]`);T&&h.push(T)}return{compiled:{...e,sections:u,effects:p,outcomes:h,flags:n},errors:t}}s(La,"compileForm");var O6=new Set(["decision","review","governedDocument"]);function bD(e){return O6.has(e.type)&&!(e.type==="governedDocument"&&e.production==="none")}s(bD,"isReadinessGatedNode");function _6(e){let t=new Map,n=P6(e),r=s((i,o)=>{let a=ub(o),l=[...i.fields,...(i.groups??[]).flatMap(d=>d.fields)];for(let d of l)d.externalFlag!==!0&&t.set(d.key,{kind:"entered",key:d.key,label:d.label,qualifier:N6(d.bucket,n,a),section:a,type:d.type,enumSource:kD(d),repeated:!1,reviewRequired:d.reviewRequired===!0});for(let d of i.repeated??[])for(let c of d.itemTemplate){let u=`${d.key}.${c.key}`;t.set(u,{kind:"entered",key:u,label:c.label,qualifier:ub(d),section:a,type:c.type,enumSource:kD(c),repeated:!0,reviewRequired:!1})}for(let d of i.computed??[]){let c=qt(Mt(d.expression));t.set(d.key,{kind:"computed",key:d.key,label:d.label??{de:d.key,en:d.key},qualifier:a,deps:c})}for(let d of i.subsections??[])r(d,o)},"visit");for(let i of e.sections)r(i,i);return t}s(_6,"formFieldCatalog");function kD(e){return e.type==="enum"?e:null}s(kD,"enumSourceOf");function N6(e,t,n){return e===void 0?n:t.get(e)??n}s(N6,"fieldQualifier");function P6(e){let t=new Map,n=s((r,i)=>{i===void 0||t.has(r)||t.set(r,ub(i))},"add");for(let r of xD(e))r.kind==="person"?n(r.bucket,r.display):r.kind==="organization"&&n(r.id.replace(/^o\./,""),r.display);return t}s(P6,"bucketWordings");function vD(e){return e.flatMap(t=>[t,...vD(t.subsections??[])])}s(vD,"allSections");function xD(e){return[...e.effects,...vD(e.sections).flatMap(t=>(t.repeated??[]).flatMap(n=>n.effects??[]))]}s(xD,"allEffects");function ub(e){return{label:e.label}}s(ub,"wordingOf");function SD(e){return wd(e).flatMap(({slot:t,address:n})=>{let r=fP(n);return r===null||yd.includes(r.path)?[]:[{slotId:t,owner:r.owner,fieldKey:r.path}]})}s(SD,"admissionBindingLeaves");function C6(e,t){let n=e.get(t);if(n===void 0)return null;let r=[],i=new Set,o=s(a=>{if(!i.has(a.key)&&(i.add(a.key),r.push({fieldKey:a.key,kind:a.kind}),a.kind==="computed"))for(let l of a.deps){let d=e.get(l);d!==void 0&&o(d)}},"walk");return o(n),r}s(C6,"expandKey");function D6(e){let t=new Set;for(let n of xD(e))if(!(n.kind!=="person"||n.contractParty===void 0)&&n.when!==void 0)for(let r of qt(Mt(n.when)))t.add(r);return[...t]}s(D6,"contractPartyConditionKeys");function F6(e){return La(e).compiled.flags.map(t=>({key:t.key,name:t.label}))}s(F6,"formExternalFlags");function AD(e){return{readinessFormFieldsByFormNode:new Map([...e].map(([t,n])=>[t,_6(n)])),readinessPartyConditionKeysByFormNode:new Map([...e].map(([t,n])=>[t,new Set(D6(n))])),formFlagKeysByFormNode:new Map([...e].map(([t,n])=>[t,new Set(F6(n).map(r=>r.key))])),formViewKeysByFormNode:new Map([...e].map(([t,n])=>[t,new Set((n.views??[]).map(r=>r.key))]))}}s(AD,"readinessUniverse");function fb(e,t){let n=new Set;for(let r of t)for(let i of C6(e,r)??[])i.kind==="entered"&&n.add(i.fieldKey);return n}s(fb,"enteredFieldsBehind");var L6=new Set(["label","sublabel","title","description","body","chipLabel","nextAction","confirmLabel","placeholder","helpText","subject","heading","hint","notice","reason"]);function M6(e){return L6.has(e)?!0:TD(e)?!1:/(Label|Title|Body|Description|Text|Hint|Heading|Placeholder)$/.test(e)}s(M6,"isTextKey");function TD(e){return/^localized[A-Z]/.test(e)}s(TD,"isLegacyTwinKey");var q6=new Set(["titles","responseLabels","outputLabels","enumOptionLabels"]),K6=new Set(["inputs","resolver","library"]);function Im(e,t){let n=[];return pb(e,t,n),n}s(Im,"findUnlocalizedTexts");function pb(e,t,n){if(Array.isArray(e)){e.forEach((i,o)=>pb(i,`${t}[${V6(i,o)}]`,n));return}if(e===null||typeof e!="object")return;let r=e;for(let[i,o]of Object.entries(r)){let a=`${t}.${i}`;if(!K6.has(i)){if(TD(i)){n.push({path:a,missing:"legacy-twin"});continue}if(M6(i)){j6(o,a,n);continue}if(q6.has(i)&&o!==null&&typeof o=="object"){for(let[l,d]of Object.entries(o))d!==void 0&&RD(d,`${a}.${l}`,n);continue}pb(o,a,n)}}}s(pb,"walk");function j6(e,t,n){e!=null&&RD(e,t,n)}s(j6,"checkText");function RD(e,t,n){let r=Ft(e);(r==="not-localized"||r.length>0)&&n.push({path:t,missing:r})}s(RD,"report");function V6(e,t){if(e!==null&&typeof e=="object"){let n=e;if(typeof n.id=="string")return n.id;if(typeof n.key=="string")return n.key}return String(t)}s(V6,"keyOf");function Em(e,t){return e==="not-localized"?t==="de"?"ist kein zweisprachiger Text ({ de, en })":"is not a bilingual text ({ de, en })":e==="legacy-twin"?t==="de"?'ist ein Zwilling der alten Form \u2014 der Text geh\xF6rt in das Feld ohne \u201Elocalized"':'is a twin of the old shape \u2014 the text belongs in the field without "localized"':t==="de"?`fehlt in: ${e.join(", ")}`:`is missing in: ${e.join(", ")}`}s(Em,"describe");function mb({path:e,missing:t}){return t==="legacy-twin"?{de:`[i18n/legacyTwin] ${e} ${Em(t,"de")}.`,en:`[i18n/legacyTwin] ${e} ${Em(t,"en")}.`}:{de:`[i18n/missingTranslation] ${e} ${Em(t,"de")} \u2014 jeder angezeigte Text braucht Deutsch und Englisch; die Sprache folgt dem Konto des Lesenden.`,en:`[i18n/missingTranslation] ${e} ${Em(t,"en")} \u2014 every displayed text needs German and English; the language follows the reader's account.`}}s(mb,"unlocalizedTextReason");var B6={engagePush:["engage"]};function U6(e){let t=B6[e.type];return t===void 0?e:Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}s(U6,"withoutMachineData");function $D(e,t){return[...Im(e.nodes.map(U6),"nodes"),...t===void 0?[]:Im(t,`layout.${t.id}`)].map(r=>({layer:"GRAPH",kind:"i18n",path:r.path,reason:mb(r),severity:"error"}))}s($D,"checkLocalizedTexts");var G6="Europe/Berlin";function hb(){return G6}s(hb,"tenantTimeZone");var ED=new Map;function z6(e){let t=ED.get(e);if(t)return t;let n;try{n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{de("INVALID",{de:`Unbekannte Zeitzone "${e}".`,en:`Unknown time zone "${e}".`})}return ED.set(e,n),n}s(z6,"formatterFor");function W6(e,t){let n=new Map(z6(e).formatToParts(new Date(t)).map(a=>[a.type,a.value])),r=s(a=>{let l=n.get(a);return l===void 0&&D(`Zeitzone "${e}" liefert kein Feld ${a}.`),Number(l)},"read"),i=r("hour")%24;return Date.UTC(r("year"),r("month")-1,r("day"),i,r("minute"),r("second"))-Math.floor(t/1e3)*1e3}s(W6,"zoneOffsetAt");function Om(e,t){let n=e+W6(t,e);return{wallClock:new Date(n).toISOString().slice(0,19),timeZone:t}}s(Om,"instantToLocalDateTime");var ds=5,cs=480;function Mi(e){return typeof e=="string"&&e.trim().length>0}s(Mi,"isNonEmptyString");function _D(e,t,n){return Object.keys(e).filter(r=>!t.includes(r)).map(r=>({field:`result.${r}`,code:He.unknownField,message:{de:`Unbekanntes Feld '${r}' im ${n.de}; erlaubt sind: ${t.join(", ")}.`,en:`Unknown field '${r}' in the ${n.en}; allowed: ${t.join(", ")}.`}}))}s(_D,"unknownFieldIssues");var _m="primaryHostTeams";function Y6(e){let t=[],n=e.title;(n===void 0||typeof n!="object"||n===null||!Mi(n.de)||!Mi(n.en))&&t.push({field:"result.title",code:He.appointmentMissingTitle,message:{de:"Ein Termin-Ergebnis braucht einen neutralen Titel in beiden Sprachen ({ de, en }) \u2014 er steht in der Mail und in der Kalenderdatei der Familie, deshalb nie ein Familienname.",en:"An appointment result needs a neutral title in both languages ({ de, en }) \u2014 it appears in the email and in the family's calendar file, so never a family name."}});let r=e.durationMinutes;(typeof r!="number"||!Number.isInteger(r)||r<ds||r>cs)&&t.push({field:"result.durationMinutes",code:He.appointmentInvalidDuration,message:{de:`'durationMinutes' muss eine ganze Zahl von ${ds} bis ${cs} sein, erhalten ${JSON.stringify(r)}.`,en:`'durationMinutes' must be a whole number from ${ds} to ${cs}, got ${JSON.stringify(r)}.`}});let{[_m]:i,...o}=e;return t.push(..._D(o,["kind","title","durationMinutes","primaryParticipantTeams","participants"],{de:"Termin-Ergebnis",en:"appointment result"})),t}s(Y6,"appointmentIssues");function OD(e){if(typeof e!="object"||e===null)return!1;let t=e;return Mi(t.de)&&Mi(t.en)}s(OD,"isBilingual");var gb=["key","type","label","writes","options","min","suggest","evidence","evidenceFrom","multiple","tasks","maxLength"];function H6(e,t){let n=s((o,a)=>({field:o,code:He.recordFields,message:a}),"issue");if(!Array.isArray(e)||e.length===0)return[n("result.fields",{de:"Eine Erfassung braucht mindestens ein Feld ('result.fields').",en:"A record needs at least one field ('result.fields')."})];let r=[],i=new Set;for(let[o,a]of e.entries()){let l=`result.fields[${o}]`;if(typeof a!="object"||a===null||Array.isArray(a)){r.push(n(l,{de:"Ein Feld der Erfassung muss ein Objekt sein.",en:"A field of the record must be an object."}));continue}let d=a,c=d.key;typeof c!="string"||!/^[a-z][a-zA-Z0-9_]*$/.test(c)?r.push(n(`${l}.key`,{de:`Feld-Schl\xFCssel ${JSON.stringify(c)} \u2014 erlaubt sind Buchstaben, Ziffern und _, beginnend mit einem Kleinbuchstaben.`,en:`Field key ${JSON.stringify(c)} \u2014 letters, digits and _ are allowed, starting with a lowercase letter.`})):i.has(c)?r.push(n(`${l}.key`,{de:`Feld-Schl\xFCssel "${c}" ist doppelt.`,en:`Field key "${c}" is duplicated.`})):i.add(c);let u=typeof c=="string"?`"${c}"`:`Nr. ${o+1}`,p=typeof c=="string"?`"${c}"`:`no. ${o+1}`;if(kk(d.type)||r.push(n(`${l}.type`,{de:`Feld ${u}: Typ ${JSON.stringify(d.type)} \u2014 erlaubt: ${zp.join(", ")}.`,en:`Field ${p}: type ${JSON.stringify(d.type)} \u2014 allowed: ${zp.join(", ")}.`})),OD(d.label)||r.push(n(`${l}.label`,{de:`Feld ${u} braucht ein Label in beiden Sprachen ({ de, en }).`,en:`Field ${p} needs a label in both languages ({ de, en }).`})),Mi(d.writes)||r.push(n(`${l}.writes`,{de:`Feld ${u} schreibt in keinen Vorgangs-Schl\xFCssel ('writes') \u2014 ein Wert, den niemand lesen kann, geh\xF6rt nicht in eine Erfassung.`,en:`Field ${p} writes to no process key ('writes') \u2014 a value nobody can read does not belong in a record.`})),d.type==="enum"){let y=Array.isArray(d.options)?d.options:[],b=y.map(k=>k.key);(y.length<2||b.some(k=>typeof k!="string"||k.length===0)||new Set(b).size!==b.length||y.some(k=>!OD(k.label)))&&r.push(n(`${l}.options`,{de:`Feld ${u} (Auswahl) braucht mindestens 2 Optionen mit eindeutigen Schl\xFCsseln und Labels in beiden Sprachen.`,en:`Field ${p} (choice) needs at least 2 options with unique keys and labels in both languages.`}))}else d.options!==void 0&&r.push(n(`${l}.options`,{de:`Feld ${u}: 'options' gibt es nur bei Typ 'enum'.`,en:`Field ${p}: 'options' exists only for type 'enum'.`}));if(d.min!==void 0&&(d.type!=="number"||typeof d.min!="number"||!Number.isInteger(d.min))&&r.push(n(`${l}.min`,{de:`Feld ${u}: 'min' gibt es nur bei Typ 'number', als ganze Zahl.`,en:`Field ${p}: 'min' exists only for type 'number', as a whole number.`})),d.evidence!==void 0&&typeof d.evidence!="boolean"&&r.push(n(`${l}.evidence`,{de:`Feld ${u}: 'evidence' ist true oder false.`,en:`Field ${p}: 'evidence' is true or false.`})),d.evidenceFrom!==void 0){let y=typeof d.min=="number"?d.min:0;(d.type!=="number"||d.evidence!==!0||typeof d.evidenceFrom!="number"||!Number.isInteger(d.evidenceFrom)||d.evidenceFrom<=y)&&r.push(n(`${l}.evidenceFrom`,{de:`Feld ${u}: 'evidenceFrom' gibt es nur bei Typ 'number' mit 'evidence', als ganze Zahl \xFCber dem Minimum (${y}) \u2014 sonst g\xE4lte der Nachweis immer.`,en:`Field ${p}: 'evidenceFrom' exists only for type 'number' with 'evidence', as a whole number above the minimum (${y}) \u2014 otherwise the proof would always apply.`}))}if(r.push(...J6(d,l,u,p,t)),d.suggest!==void 0){let y=d.suggest,b=typeof y=="object"&&y!==null?y.kind:void 0,k=b==="form"&&"address"in y&&Object.keys(y).length===2&&(!ke(y.address)||mt(y.address))||b==="siblingRank"&&Object.keys(y).length===1&&d.type==="number";QN(d.type)?k||r.push({field:`${l}.suggest`,code:He.recordSuggest,message:{de:`Feld ${u}: Vorschlag ${JSON.stringify(d.suggest)} \u2014 erlaubt: { kind: 'form', address: '$node.<formular>.admission.<export>' } oder { kind: 'siblingRank' } (nur bei Typ 'number'); bekannte Arten: ${bk.join(", ")}.`,en:`Field ${p}: suggestion ${JSON.stringify(d.suggest)} \u2014 allowed: { kind: 'form', address: '$node.<form>.admission.<export>' } or { kind: 'siblingRank' } (only for type 'number'); known kinds: ${bk.join(", ")}.`}}):r.push({field:`${l}.suggest`,code:He.recordSuggest,message:{de:`Feld ${u}: einen Vorschlag gibt es nur bei Typ number, boolean oder enum.`,en:`Field ${p}: a suggestion exists only for type number, boolean or enum.`}})}let h=Object.keys(d).filter(y=>!gb.includes(y));h.length>0&&r.push(n(l,{de:`Feld ${u}: unbekannte Angabe ${h.map(y=>`'${y}'`).join(", ")}; erlaubt: ${gb.join(", ")}.`,en:`Field ${p}: unknown entry ${h.map(y=>`'${y}'`).join(", ")}; allowed: ${gb.join(", ")}.`}))}return r}s(H6,"recordFieldIssues");function J6(e,t,n,r,i){let o=[],a=e.maxLength;if(a!==void 0&&(e.type!=="text"||typeof a!="number"||!Number.isInteger(a)||a<1||a>Wp)&&o.push({field:`${t}.maxLength`,code:He.recordText,message:{de:`Feld ${n}: 'maxLength' gibt es nur bei Typ 'text', als ganze Zahl von 1 bis ${Wp}.`,en:`Field ${r}: 'maxLength' exists only for type 'text', as a whole number from 1 to ${Wp}.`}}),e.multiple!==void 0&&(e.type!=="person"||typeof e.multiple!="boolean")&&o.push({field:`${t}.multiple`,code:He.recordPerson,message:{de:`Feld ${n}: 'multiple' gibt es nur bei Typ 'person', als true oder false.`,en:`Field ${r}: 'multiple' exists only for type 'person', as true or false.`}}),e.type!=="assignment")return e.tasks!==void 0&&o.push({field:`${t}.tasks`,code:He.recordAssignment,message:{de:`Feld ${n}: 'tasks' gibt es nur bei Typ 'assignment'.`,en:`Field ${r}: 'tasks' exists only for type 'assignment'.`}}),o;let l=e.tasks;if(!Array.isArray(l)||l.length===0||l.some(d=>typeof d!="string"||d.length===0)||new Set(l).size!==l.length)return o.push({field:`${t}.tasks`,code:He.recordAssignment,message:{de:`Feld ${n} (Zuordnung) braucht in 'tasks' mindestens eine Aufgabe, jede einmal.`,en:`Field ${r} (assignment) needs at least one task in 'tasks', each once.`}}),o;if(i.nodeTasks===void 0)return o;for(let d of l){let c=i.nodeTasks.get(d);c?.feedback!==!0&&o.push({field:`${t}.tasks`,code:He.recordAssignment,message:c===void 0?{de:`Feld ${n}: "${d}" ist keine Aufgabe dieses Knotens.`,en:`Field ${r}: "${d}" is no task of this node.`}:{de:`Feld ${n}: "${d}" ist keine Feedback-Aufgabe ('feedback: true') \u2014 zugeordnet wird nur, wer eine R\xFCckmeldung gibt.`,en:`Field ${r}: "${d}" is no feedback task ('feedback: true') \u2014 only a person who gives feedback is assigned.`}})}return o}s(J6,"typedFieldIssues");function Q6(e,t,n){let r=[],i=t.options;if(e==="choice"){let o=Array.isArray(i)?i:[],a=o.map(l=>l.key);(o.length<2||a.some(l=>typeof l!="string"||l.length===0)||new Set(a).size!==a.length)&&r.push({field:"result.options",code:He.choiceOptions,message:{de:`Ein Auswahl-Ergebnis braucht mindestens 2 Optionen mit eindeutigen Schl\xFCsseln, erhalten ${JSON.stringify(a)}.`,en:`A choice result needs at least 2 options with unique keys, got ${JSON.stringify(a)}.`}})}else i!==void 0&&r.push({field:"result.options",code:He.choiceOptions,message:{de:`'result.options' gibt es nur bei 'choice' \u2014 ${e==="recommendation"?"eine Empfehlung hat die festen Tendenzen Positiv/Neutral/Negativ":"ein Freitext hat keine Auswahl"}.`,en:`'result.options' exists only for 'choice' \u2014 ${e==="recommendation"?"a recommendation has the fixed leanings Positive/Neutral/Negative":"a free text has no choice"}.`}});if(e==="pricedItem"){let o=t.item;if(!Mi(o))r.push({field:"result.item",code:He.pricedItemMissingItem,message:{de:"Ein Preispositions-Ergebnis nennt den Artikel, den es bepreist \u2014 'result.item' (der Schl\xFCssel des Artikels, z. B. 'tuition') fehlt.",en:"A priced-item result names the article it prices \u2014 'result.item' (the article's key, e.g. 'tuition') is missing."}});else if(n.billingItemKeys!==void 0&&!n.billingItemKeys.has(o))r.push({field:"result.item",code:He.pricedItemUnknownItem,message:{de:`'result.item' "${o}" \u2014 kein Artikel dieses Mandanten tr\xE4gt diesen Schl\xFCssel (bekannt: ${[...n.billingItemKeys].join(", ")||"keine"}).`,en:`'result.item' "${o}" \u2014 no article of this school has this key (known: ${[...n.billingItemKeys].join(", ")||"none"}).`}});else if(n.offerProgram===null)r.push({field:"result.item",code:He.pricedItemOfferWithoutProgram,message:{de:`'result.item' "${o}" \u2014 das Angebot ist keinem Programm zugeordnet, also geh\xF6rt kein Artikel zu ihm; dem Angebot ein Programm geben.`,en:`'result.item' "${o}" \u2014 the offer is not assigned to a program, so no article belongs to it; give the offer a program.`}});else if(n.offerProgram!==void 0&&!n.offerProgram.billingItemKeys.has(o)){let l=n.offerProgram;r.push({field:"result.item",code:He.pricedItemNotInProgram,message:{de:`'result.item' "${o}" \u2014 der Artikel ist dem Programm \u201E${l.nameDe}\u201C des Angebots nicht zugeordnet (zugeordnet: ${[...l.billingItemKeys].join(", ")||"keine"}); unter Finanzen \u2192 Artikel zuordnen, direkt oder \xFCber ein Paket.`,en:`'result.item' "${o}" \u2014 the article is not assigned to the offer's program "${l.nameDe}" (assigned: ${[...l.billingItemKeys].join(", ")||"none"}); assign it under Finance \u2192 articles, directly or through a package.`}})}let a=t.label;(typeof a!="object"||a===null||!Mi(a.de)||!Mi(a.en))&&r.push({field:"result.label",code:He.labelMissing,message:{de:"Ein Preispositions-Ergebnis braucht einen Namen f\xFCr seinen Wert in beiden Sprachen ('result.label', z. B. { de: 'Schulgeld mit Erm\xE4\xDFigung', en: 'Tuition after reduction' }) \u2014 so hei\xDFt er im Workflow und in der Verdrahtung.",en:"A priced-item result needs a name for its value in both languages ('result.label', e.g. { de: 'Schulgeld mit Erm\xE4\xDFigung', en: 'Tuition after reduction' }) \u2014 that is what it is called in the workflow and in the wiring."}})}else t.item!==void 0&&r.push({field:"result.item",code:He.itemOnNonPricedItem,message:{de:`'result.item' gibt es nur bei 'pricedItem' \u2014 ein ${e}-Ergebnis bepreist keinen Artikel.`,en:`'result.item' exists only for 'pricedItem' \u2014 a ${e} result prices no article.`}});if(e==="record"?(r.push(...H6(t.fields,n)),t.writes!==void 0&&r.push({field:"result.writes",code:He.writesOnProse,message:{de:"Eine Erfassung schreibt je Feld ('fields[].writes'), nie als Ganzes ('result.writes').",en:"A record writes per field ('fields[].writes'), never as a whole ('result.writes')."}}),t.label!==void 0&&r.push({field:"result.label",code:He.unknownField,message:{de:"Eine Erfassung benennt ihre Werte je Feld ('fields[].label'), nicht als Ganzes ('result.label').",en:"A record names its values per field ('fields[].label'), not as a whole ('result.label')."}})):t.fields!==void 0&&r.push({field:"result.fields",code:He.fieldsOnNonRecord,message:{de:`'result.fields' gibt es nur bei 'record' \u2014 ein ${e}-Ergebnis hat keine Felder.`,en:`'result.fields' exists only for 'record' \u2014 a ${e} result has no fields.`}}),e==="reduction"&&(Mi(t.writes)||r.push({field:"result.writes",code:He.reductionPrices,message:{de:"Eine Reduktion schreibt ihren Betrag in einen Vorgangs-Schl\xFCssel vom Typ reduction ('result.writes') \u2014 sonst l\xE4se ihn kein Preis.",en:"A reduction writes its amount to a process key of type reduction ('result.writes') \u2014 otherwise no price would read it."}})),t.writes!==void 0&&(e==="freetext"||e==="recommendation")&&r.push({field:"result.writes",code:He.writesOnProse,message:{de:`'result.writes' gibt es nur bei Ergebnissen mit Wert (Auswahl, Preisposition) \u2014 ein ${e}-Ergebnis bleibt im Chat und schreibt nichts in den Vorgang.`,en:`'result.writes' exists only for results with a value (choice, priced item) \u2014 a ${e} result stays in the chat and writes nothing to the process.`}}),e==="freetext"&&t.textRequired!==void 0&&r.push({field:"result.textRequired",code:He.textRequiredOnFreetext,message:{de:"'textRequired' auf einem Freitext-Ergebnis \u2014 der Text eines Freitexts ist immer Pflicht; die Angabe entfernen.",en:"'textRequired' on a free-text result \u2014 the text of a free text is always required; remove the entry."}}),t.chat===void 0)r.push({field:"result.chat",code:He.chatMissing,message:{de:"Ein Aufgaben-Ergebnis steht nur im Chat \u2014 'result.chat' fehlt: 'all', 'team:<Gruppe>' oder einen Kanal des Workflows angeben.",en:"A task result appears only in the chat \u2014 'result.chat' is missing: give 'all', 'team:<group>' or a channel of the workflow."}});else{let o=t.chat,a=typeof o=="string"?ya(o):null;o==="external"||a===null?r.push({field:"result.chat",code:He.chatExternal,message:{de:`'result.chat' ${JSON.stringify(o)} \u2014 ein Aufgaben-Ergebnis bleibt intern: erlaubt sind 'all', 'team:<Gruppe>' oder ein Kanal des Workflows, nie 'external'.`,en:`'result.chat' ${JSON.stringify(o)} \u2014 a task result stays internal: 'all', 'team:<group>' or a channel of the workflow are allowed, never 'external'.`}}):a.kind==="channel"&&!n.channelKeys.has(a.channelKey)&&r.push({field:"result.chat",code:He.chatUnknownChannel,message:{de:`'result.chat' "${a.channelKey}" ist weder 'all' noch 'team:<Gruppe>' noch ein Kanal des Workflows (bekannt: ${[...n.channelKeys].join(", ")||"keine"}).`,en:`'result.chat' "${a.channelKey}" is neither 'all' nor 'team:<group>' nor a channel of the workflow (known: ${[...n.channelKeys].join(", ")||"none"}).`}})}return r.push(..._D(t,["kind","options","textRequired","chat","item","label","writes","fields","prices"],{de:"Aufgaben-Ergebnis",en:"task result"})),r}s(Q6,"recordedIssues");function ND(e,t,n={channelKeys:new Set}){if(t===void 0)return[];if(e!=="task")return[{field:"result",code:He.onApproval,message:{de:`'result' gilt nur f\xFCr die Art 'task' \u2014 eine '${e}' wird durch ihr Votum abgeschlossen, nicht durch ein Ergebnis.`,en:`'result' applies only to the kind 'task' \u2014 an '${e}' is completed by its vote, not by a result.`}}];if(typeof t!="object"||t===null||Array.isArray(t))return[{field:"result",code:He.unknownKind,message:{de:`'result' muss ein Objekt mit 'kind' sein; bekannte Arten: ${ma.join(", ")}.`,en:`'result' must be an object with 'kind'; known kinds: ${ma.join(", ")}.`}}];let r=t;return JN(r.kind)?r.kind==="appointment"?Y6(r):Q6(r.kind,r,n):[{field:"result.kind",code:He.unknownKind,message:{de:`Unbekannte Ergebnisart ${JSON.stringify(r.kind)}; bekannte Arten: ${ma.join(", ")}.`,en:`Unknown result kind ${JSON.stringify(r.kind)}; known kinds: ${ma.join(", ")}.`}}]}s(ND,"taskResultIssues");var Z6=["documentChangeRequested","documentReturned","coverLetterConfirmed","coverLetterRevisionRequested"];function PD(e){return Z6.includes(e)}s(PD,"isNonAdvancingExternalEvent");var Ma=["offer","contract"];function Nm(e){return typeof e=="string"&&Ma.includes(e)}s(Nm,"isArtifactSlotType");function CD(e){return typeof e=="object"&&e!==null&&"group"in e&&!("scope"in e)}s(CD,"isGroupPrefill");var DD="open",To="done";var X6="optionalAction:";function FD(e){return`${X6}${e}:trigger`}s(FD,"optionalActionTriggerActionId");var e4="processDecide";function LD(e){let t=e.optionalActions;return t==null?[]:(Array.isArray(t)||D(`[optionalAction/corrupt-section] node's 'optionalActions' is ${typeof t}, not an array \u2014 corrupt pinned graph (publish stores the section as authored)`),t)}s(LD,"optionalActionBindings");function MD(e){return LD(e).map(t=>({id:FD(t.key),kind:"internal",label:t.label,surface:e4,placement:"overflow",superUserOnly:!0}))}s(MD,"optionalActionTriggers");function qD(e){let t=e.tasks;return Array.isArray(t)?t:[]}s(qD,"authoredTemplates");function KD(e){let t=e?.result;return t?.kind!=="appointment"?[]:t.participants?.feedback?.tasks??[]}s(KD,"personTasksOf");function yb(e){let t=qD(e);return LD(e).map(n=>{let r=new Set(n.tasks??[]),i=new Set;for(let o of r)for(let a of KD(t.find(l=>l.key===o)))i.add(a);return{binding:n,tasks:r,personTasks:i,keys:new Set([...r,...i])}})}s(yb,"optionalActionMembership");function t4(e){let t=new Set;for(let n of qD(e))for(let r of KD(n))t.add(r);return t}s(t4,"personRowTemplateKeys");function jD(e){let t=new Set(t4(e));for(let{keys:n}of yb(e))for(let r of n)t.add(r);return t}s(jD,"referencedTaskTemplateKeys");var Fr={shape:"[taskInput/shape]",notInRound:"[taskInput/notInRound]",notRecord:"[taskInput/notRecord]",prefillNotDeclared:"[taskInput/prefillNotDeclared]",prefillType:"[taskInput/prefillType]",feedbackTasks:"[appointment/feedbackTasks]",feedbackOptional:"[appointment/feedbackOptional]",recordAssignment:"[taskResult/recordAssignment]"},wb=60;function qa(e,t,n){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:{de:`${t} ${n.de}`,en:`${t} ${n.en}`},severity:"error"}}s(qa,"error");function us(e){return Array.isArray(e.tasks)?e.tasks:[]}s(us,"tasksOf");function VD(e){return(Array.isArray(e.optionalActions)?e.optionalActions:[]).filter(n=>n.action==="spawnTasks")}s(VD,"spawnBindingsOf");function _d(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}s(_d,"stringList");function pi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}s(pi,"record");function bb(e){let t=pi(e?.result);return t?.kind==="appointment"?pi(t.participants):null}s(bb,"participantsOf");function kb(e){return _d(pi(bb(e)?.feedback)?.tasks)}s(kb,"feedbackTasksOf");function BD(e,t){return yb(e).find(n=>n.keys.has(t))}s(BD,"roundOf");function n4(e,t,n){let r=s(u=>({code:Fr.notInRound,reason:u}),"notInRound"),i=BD(e,t);if(i===void 0)return r({de:`Aufgabe "${t}" geh\xF6rt zu keiner optionalen Aktion \u2014 Vorgaben liest nur eine Aufgabe einer Runde.`,en:`Task "${t}" belongs to no optional action \u2014 only a task of a round reads inputs.`});if(n.scope!=="task"||n.path!==void 0)return r({de:`${ce(n)} ist kein Wert einer Aufgabe ($task.<aufgabe>.<schl\xFCssel>).`,en:`${ce(n)} is no value of a task ($task.<task>.<key>).`});let{binding:o}=i,a=n.owner;if(a===t)return r({de:`Aufgabe "${t}" liest ihren eigenen Wert.`,en:`Task "${t}" reads its own value.`});let l=us(e).find(u=>u.key===a),d=pi(l?.blocks),c=i.tasks.has(a)&&d?.templateKey===t&&(d.node===void 0||d.node===e.id);return a!==o.input&&!c?r({de:`"${a}" ist weder die Eingabe der Aktion "${o.key}" noch eine ihrer Aufgaben, die "${t}" per 'blocks' zur\xFCckh\xE4lt \u2014 der Wert st\xFCnde nicht fest, wenn die Aufgabe \xF6ffnet.`,en:`"${a}" is neither the input of the action "${o.key}" nor one of its tasks that holds "${t}" through 'blocks' \u2014 the value would not be settled when the task opens.`}):pi(l?.result)?.kind!=="record"?{code:Fr.notRecord,reason:{de:`"${a}" hat kein Ergebnis vom Typ 'record' \u2014 Vorgaben sind Felder einer Eingabe.`,en:`"${a}" has no result of kind 'record' \u2014 inputs are fields of an input task.`}}:null}s(n4,"taskInputRefusal");function r4(e,t){if(t.scope!=="task")return;let n=us(e).find(i=>i.key===t.owner),r=pi(n?.result);if(r?.kind==="record")return(Array.isArray(r.fields)?r.fields:[]).map(pi).find(i=>i?.writes===t.key)??void 0}s(r4,"writerField");function i4(e,t,n){let r=String(t.key);if(t.inputs===void 0)return[];if(!Array.isArray(t.inputs))return[qa(`${n}.inputs`,Fr.shape,{de:"'inputs' ist eine Liste von Adressen.",en:"'inputs' is a list of addresses."})];let i=[],o=new Set;for(let[a,l]of t.inputs.entries()){if(!ke(l))continue;let d=ce(l);if(o.has(d)){i.push(qa(`${n}.inputs.${a}`,Fr.shape,{de:`${d} steht zweimal in 'inputs'.`,en:`${d} is listed twice in 'inputs'.`}));continue}o.add(d);let c=n4(e,r,l);c!==null&&i.push(qa(`${n}.inputs.${a}`,c.code,c.reason))}return i}s(i4,"inputIssues");function o4(e,t,n,r){let i=n;if(CD(r))return kb(i).length===1?null:{code:Fr.prefillType,reason:{de:"Ein Team belegt nur vor, wenn 'feedback.tasks' genau eine Feedback-Art nennt \u2014 sonst w\xE4re offen, wer welche Art gibt.",en:"A team prefills only when 'feedback.tasks' names exactly one feedback kind \u2014 otherwise who gives which kind would be open."}};let o=Array.isArray(i.inputs)?i.inputs.filter(ke).map(ce):[];if(!ke(r)||!o.includes(ce(r)))return{code:Fr.prefillNotDeclared,reason:{de:"Die Vorbelegung der Teilnehmenden ist keine der Vorgaben ('inputs') der Aufgabe.",en:"The participants' prefill is none of the task's inputs ('inputs')."}};let a=s(c=>({code:Fr.prefillType,reason:c}),"prefillType"),l=kb(i),d=gd(e,r);if(d===void 0)return null;if(gn(d)==="staffUser")return l.length===1?null:a({de:"Eine Personenliste belegt nur vor, wenn 'feedback.tasks' genau eine Feedback-Art nennt \u2014 sonst w\xE4re offen, wer welche Art gibt.",en:"A list of persons prefills only when 'feedback.tasks' names exactly one feedback kind \u2014 otherwise who gives which kind would be open."});if(d==="taskAssignment"){let u=_d(r4(t,r)?.tasks).filter(p=>!l.includes(p));return u.length===0?null:a({de:`Die Zuordnung ordnet ${u.map(p=>`"${p}"`).join(", ")} zu, die 'feedback.tasks' nicht nennt.`,en:`The assignment assigns ${u.map(p=>`"${p}"`).join(", ")}, which 'feedback.tasks' does not name.`})}return a({de:`Vorbelegt werden Teilnehmende nur aus Personen ('person') oder einer Zuordnung ('assignment'), nicht aus "${d}".`,en:`Participants are prefilled only from persons ('person') or an assignment ('assignment'), not from "${d}".`})}s(o4,"participantPrefillRefusal");function s4(e,t,n,r){let i=bb(n)?.prefill;if(i===void 0)return[];let o=o4(e,t,n,i);return o===null?[]:[qa(`${r}.result.participants.prefill`,o.code,o.reason)]}s(s4,"prefillIssues");function a4(e,t){return VD(e).some(n=>_d(n.tasks).includes(t))}s(a4,"belongsToOptionalAction");function l4(e,t,n){let r=t.key,i=us(e).find(c=>c.key===n),o=s(c=>({code:Fr.feedbackTasks,reason:c}),"feedbackTasks");if(i===void 0)return[o({de:`"${n}" ist keine Aufgabe dieses Knotens.`,en:`"${n}" is no task of this node.`})];let a=[];i.feedback!==!0&&a.push(o({de:`"${n}" ist keine Feedback-Aufgabe ('feedback: true').`,en:`"${n}" is no feedback task ('feedback: true').`})),VD(e).some(c=>_d(c.tasks).includes(n))&&a.push(o({de:`"${n}" steht in den Aufgaben einer optionalen Aktion \u2014 eine Personenzeile entsteht nur beim Buchen.`,en:`"${n}" is among an optional action's tasks \u2014 a person row exists only through a booking.`}));let l=us(e).find(c=>c.key!==r&&kb(c).includes(n));l!==void 0&&a.push(o({de:`"${n}" wird auch von "${String(l.key)}" angelegt \u2014 jede Feedback-Art geh\xF6rt zu genau einem Termin.`,en:`"${n}" is also created by "${String(l.key)}" \u2014 each feedback kind belongs to exactly one appointment.`}));let d=["when","blocks"].filter(c=>i[c]!==void 0);return d.length>0&&a.push(o({de:`"${n}" tr\xE4gt ${d.map(c=>`'${c}'`).join(", ")} \u2014 eine Personenzeile entsteht nur beim Buchen und h\xE4lt nur ihre Runde.`,en:`"${n}" carries ${d.map(c=>`'${c}'`).join(", ")} \u2014 a person row exists only through a booking and holds only its round.`})),i.optional!==void 0&&a.push({code:Fr.feedbackOptional,reason:{de:`"${n}" ist optional \u2014 eine Personenzeile h\xE4lt ihre Runde und damit die Pause, sie kann nicht \xFCbersprungen werden.`,en:`"${n}" is optional \u2014 a person row holds its round and with it the pause; it cannot be skipped.`}}),a}s(l4,"participantFeedbackRefusals");function d4(e,t,n){let r=bb(t);if(r===null||r.feedback===void 0)return[];let i=String(t.key),o=`${n}.result.participants.feedback`,a=pi(r.feedback),l=a?.tasks,d=[],c=s((p,h,y=Fr.feedbackTasks)=>d.push(qa(p,y,h)),"fail");if(!Array.isArray(l)||l.length===0||l.some(p=>typeof p!="string")||new Set(l).size!==l.length)return c(`${o}.tasks`,{de:"'feedback.tasks' nennt mindestens eine Feedback-Aufgabe, jede einmal.",en:"'feedback.tasks' names at least one feedback task, each once."}),d;let u=a?.dueDaysAfterEnd;(typeof u!="number"||!Number.isInteger(u)||u<0||u>wb)&&c(`${o}.dueDaysAfterEnd`,{de:`'feedback.dueDaysAfterEnd' ist eine ganze Zahl von 0 bis ${wb}.`,en:`'feedback.dueDaysAfterEnd' is a whole number from 0 to ${wb}.`}),a4(e,i)||c(o,{de:`Aufgabe "${i}" legt Personenzeilen an, geh\xF6rt aber zu keiner optionalen Aktion \u2014 Personenzeilen geh\xF6ren zur Runde einer Aktion.`,en:`Task "${i}" creates person rows but belongs to no optional action \u2014 person rows belong to an action's round.`});for(let p of l)for(let h of l4(e,t,p))c(`${o}.tasks`,h.reason,h.code);return d}s(d4,"feedbackIssues");function c4(e,t){let n=BD(e,t)?.personTasks??new Set;return us(e).filter(r=>r.feedback===!0&&typeof r.key=="string"&&n.has(r.key)).map(r=>r.key)}s(c4,"assignableFeedbackTasks");function u4(e,t,n){let r=pi(t.result);if(r?.kind!=="record"||!Array.isArray(r.fields))return[];let i=c4(e,String(t.key)),o=new Map(us(e).map(l=>[l.key,l])),a=[];for(let[l,d]of r.fields.entries()){let c=pi(d);if(c?.type!=="assignment")continue;let u=_d(c.tasks).filter(p=>o.get(p)?.feedback===!0&&!i.includes(p));u.length!==0&&a.push(qa(`${n}.result.fields.${l}.tasks`,Fr.recordAssignment,{de:`Feld "${String(c.key)}": ${u.map(p=>`"${p}"`).join(", ")} legt kein Termin derselben optionalen Aktion an ('participants.feedback.tasks') \u2014 die Zuordnung h\xE4tte keine Zeile, die sie erh\xE4lt.`,en:`Field "${String(c.key)}": ${u.map(p=>`"${p}"`).join(", ")} is created by no appointment of the same optional action ('participants.feedback.tasks') \u2014 the assignment would have no row to receive it.`}))}return a}s(u4,"assignmentIssues");function UD(e,t){let n=[];for(let r of us(t)){if(typeof r.key!="string")continue;let i=`nodes.${t.id}.tasks.${r.key}`;n.push(...i4(t,r,i)),n.push(...s4(e,t,r,i)),n.push(...d4(t,r,i)),n.push(...u4(t,r,i))}return n}s(UD,"taskInputIssues");function mi(e){return e.nodes.map(t=>t)}s(mi,"rawNodesOf");var Ln={notOptionalAction:"[workItems/familyRequestNotOptionalAction]",notTask:"[workItems/familyRequestNotTask]",closedOtherwise:"[workItems/familyRequestClosedOtherwise]",blocks:"[workItems/familyRequestBlocks]",noDeadline:"[workItems/familyRequestNoDeadline]",fields:"[workItems/familyRequestFields]",unknownField:"[workItems/familyRequestUnknownField]",shape:"[workItems/familyRequestShape]",twicePerAction:"[workItems/familyRequestTwicePerAction]",deadlock:"[workItems/familyRequestOnlyWayButAsked]"};function Mn(e,t,n){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:{de:`${t} ${n.de}`,en:`${t} ${n.en}`},severity:"error"}}s(Mn,"issue");function f4(e,t,n){return e.flatMap(r=>(Array.isArray(r.tasks)?r.tasks:[]).filter(i=>{let o=i.blocks,a=typeof o?.node=="string"?o.node:r.id;return o?.templateKey===n&&a===t}).map(i=>({nodeId:r.id,key:String(i.key)})))}s(f4,"blockersOf");function GD(e){let{graph:t,node:n,task:r}=e,i=r.familyRequest;if(i===void 0)return[];let o=typeof r.key=="string"?r.key:"?",a=`nodes.${n.id}.tasks.${o}`,l={de:`Task "${o}" auf Knoten \u201E${Pe(t,n.id,"de")}\u201C (${n.id})`,en:`Task "${o}" on node "${Pe(t,n.id,"en")}" (${n.id})`},d=[];if(typeof i!="object"||i===null||Array.isArray(i))return[Mn(`${a}.familyRequest`,Ln.shape,{de:`${l.de}: 'familyRequest' muss ein Objekt { fields } oder { from } sein.`,en:`${l.en}: 'familyRequest' must be an object { fields } or { from }.`})];let c=Object.keys(i).filter(b=>b!=="fields"&&b!=="from");c.length>0&&d.push(Mn(`${a}.familyRequest.${c[0]}`,Ln.shape,{de:`${l.de}: 'familyRequest' kennt nur 'fields' oder 'from', nicht ${c.map(b=>`'${b}'`).join(", ")} \u2014 was angefordert wird und der Text an die Familie werden beim Ausl\xF6sen gew\xE4hlt.`,en:`${l.en}: 'familyRequest' only knows 'fields' or 'from', not ${c.map(b=>`'${b}'`).join(", ")} \u2014 what is requested and the text to the family are chosen when the action is triggered.`}));let{fields:u,from:p}=i;u===void 0==(p===void 0)&&d.push(Mn(`${a}.familyRequest`,Ln.shape,{de:`${l.de}: 'familyRequest' nennt genau eines \u2014 'fields' (die anforderbaren Felder) oder 'from' (das Formular, dessen Dateifelder alle zur Wahl stehen).`,en:`${l.en}: 'familyRequest' names exactly one \u2014 'fields' (the fields that can be requested) or 'from' (the form whose file fields are all available).`})),e.onTrigger.has(o)||d.push(Mn(`${a}.familyRequest`,Ln.notOptionalAction,{de:`${l.de} fordert bei der Familie an, geh\xF6rt aber zu keiner optionalen Aktion (spawnTasks) \u2014 nur deren Ausl\xF6sen \xF6ffnet die Anfrage an die Familie.`,en:`${l.en} requests from the family but belongs to no optional action (spawnTasks) \u2014 only triggering one opens the request to the family.`})),r.kind!=="task"&&d.push(Mn(`${a}.kind`,Ln.notTask,{de:`${l.de} fordert bei der Familie an und muss die Art 'task' haben, nicht ${JSON.stringify(r.kind)}.`,en:`${l.en} requests from the family and must have the kind 'task', not ${JSON.stringify(r.kind)}.`}));for(let b of["result","when","locksEvidence","gatesNode"])r[b]!==void 0&&d.push(Mn(`${a}.${b}`,Ln.closedOtherwise,{de:`${l.de} wartet auf die Familie und erledigt sich mit ihrer Antwort \u2014 '${b}' passt nicht dazu.`,en:`${l.en} waits for the family and completes with their answer \u2014 '${b}' does not fit that.`}));r.blocks!==void 0&&d.push(Mn(`${a}.blocks`,Ln.blocks,{de:`${l.de} wartet auf die Familie und darf nichts zur\xFCckhalten ('blocks') \u2014 sie h\xE4lt ihren Knoten schon als Aufgabe einer optionalen Aktion.`,en:`${l.en} waits for the family and must not hold anything back ('blocks') \u2014 as the task of an optional action it already holds its node.`}));for(let b of f4(mi(t),n.id,o))d.push(Mn(`nodes.${b.nodeId}.tasks.${b.key}.blocks`,Ln.blocks,{de:`Task "${b.key}" auf Knoten "${b.nodeId}" h\xE4lt ${l.de} zur\xFCck \u2014 eine Nachforderung darf nie zur\xFCckgehalten werden: zur\xFCckgehalten h\xE4tte sie keine Frist und k\xF6nnte mit der Antwort der Familie nicht erledigt werden.`,en:`Task "${b.key}" on node "${b.nodeId}" holds back ${l.en} \u2014 a follow-up request must never be held back: held back, it would have no deadline and could not be completed by the family's answer.`}));let h=r.params?.dueInDays;if((typeof h!="number"||!Number.isInteger(h)||h<1)&&d.push(Mn(`${a}.params.dueInDays`,Ln.noDeadline,{de:`${l.de} fordert bei der Familie an und braucht eine Frist in ganzen Tagen ('params.dueInDays' \u2265 1) \u2014 sie ist die Frist der Familie und Anlass der Erinnerung.`,en:`${l.en} requests from the family and needs a deadline in whole days ('params.dueInDays' \u2265 1) \u2014 it is the family's deadline and the reason for the reminder.`})),u===void 0)return d;if(!Array.isArray(u)||u.length===0)return d.push(Mn(`${a}.familyRequest.fields`,Ln.fields,{de:`${l.de}: 'familyRequest.fields' muss mindestens ein Feld eines Formulars nennen \u2014 oder statt dessen 'from' das Formular, dann stehen alle seine Dateifelder zur Wahl.`,en:`${l.en}: 'familyRequest.fields' must name at least one field of a form \u2014 or 'from' the form instead, then all its file fields are available.`})),d;let y=new Set;for(let b of u){if(!ke(b))continue;let k=ce(b);if(y.has(k)){d.push(Mn(`${a}.familyRequest.fields`,Ln.fields,{de:`${l.de}: 'familyRequest.fields' nennt ${Ge(t,b,"de")} mehrfach.`,en:`${l.en}: 'familyRequest.fields' names ${Ge(t,b,"en")} more than once.`}));continue}y.add(k),mt(b)||d.push(Mn(`${a}.familyRequest.fields`,Ln.unknownField,{de:`${l.de}: 'familyRequest.fields' nennt ${Ge(t,b,"de")} \u2014 anfordern l\xE4sst sich nur ein Feld eines Formulars ($node.<formular>.admission.<feld>).`,en:`${l.en}: 'familyRequest.fields' names ${Ge(t,b,"en")} \u2014 only a field of a form ($node.<form>.admission.<field>) can be requested.`}))}return d}s(GD,"familyRequestIssues");function zD(e){let t=new Set((Array.isArray(e.tasks)?e.tasks:[]).flatMap(r=>r.familyRequest!==void 0&&typeof r.key=="string"?[r.key]:[]));return(Array.isArray(e.optionalActions)?e.optionalActions:[]).flatMap((r,i)=>{if(r.action!=="spawnTasks"||!Array.isArray(r.tasks))return[];let o=r.tasks.filter(a=>typeof a=="string"&&t.has(a));return o.length<=1?[]:[Mn(`nodes.${e.id}.optionalActions.${i}.tasks`,Ln.twicePerAction,{de:`Optionale Aktion \u201E${String(r.key)}\u201C auf Knoten "${e.id}" startet ${o.length} Nachforderungen (${o.join(", ")}) \u2014 ein Ausl\xF6sen fragt die Familie nach EINER Sache; h\xF6chstens eine Nachforderung je Aktion.`,en:`Optional action "${String(r.key)}" on node "${e.id}" starts ${o.length} follow-up requests (${o.join(", ")}) \u2014 one trigger asks the family for ONE thing; at most one follow-up request per action.`})]})}s(zD,"familyRequestActionIssues");function WD(e,t){let n=mi(e),r=new Map;for(let a of n)if(!(a.type!=="completenessCheck"||!Array.isArray(a.requires)))for(let l of a.requires)mt(l)&&r.set(ce(l),l);if(r.size===0)return[];let i=s(a=>{let l=ui(t,a);return l===void 0||l!==null&&l.kind==="entered"&&l.type==="docRef"},"isFileField"),o=s(a=>{let{fields:l,from:d}=a??{};return Array.isArray(l)?l.filter(mt):!ke(d)||d.scope!=="node"?[]:[...r.values()].filter(c=>c.owner===d.owner&&i(c))},"offeredBy");return n.flatMap(a=>{let l=Array.isArray(a.requiresOneOf)?a.requiresOneOf:[],c=(Array.isArray(a.optionalActions)?a.optionalActions:[]).filter(h=>l.includes(h.key)),u=Array.isArray(a.tasks)?a.tasks:[];return c.filter(h=>Array.isArray(h.tasks)&&c.every(y=>y===h||y.when!==void 0)).flatMap(h=>u.flatMap(y=>{if(y.familyRequest===void 0||!h.tasks.includes(y.key))return[];let b=o(y.familyRequest).filter(k=>r.has(ce(k)));return b.length===0?[]:[{...Mn(`nodes.${a.id}.requiresOneOf`,Ln.deadlock,{de:`Auf Knoten \u201E${Pe(e,a.id,"de")}\u201C (${a.id}) ist die Nachforderung \u201E${String(h.key)}\u201C der einzige Weg durch 'requiresOneOf', und eine Vollst\xE4ndigkeitspr\xFCfung fragt dieselben Felder an (${b.map(k=>Ge(e,k,"de")).join(", ")}). Ist deren Anfrage offen, lassen sich diese Felder nicht nachfordern \u2014 die Entscheidung bliebe gesperrt. Eine zweite Aktion in 'requiresOneOf' oder andere Felder l\xF6sen das.`,en:`On node "${Pe(e,a.id,"en")}" (${a.id}) the follow-up request "${String(h.key)}" is the only way through 'requiresOneOf', and a completeness check asks for the same fields (${b.map(k=>Ge(e,k,"en")).join(", ")}). While its request is open, these fields cannot be requested \u2014 the decision would stay locked. A second action in 'requiresOneOf' or other fields solve this.`}),severity:"warning"}]}))})}s(WD,"familyRequestDeadlockWarnings");var vb={key:!0,kind:!0,title:!0,assign:!0,gatesNode:!0,blocks:!0,completableIf:!0,result:!0,when:!0,onConditionReturn:!0,reads:!0,locksEvidence:!0,feedback:!0,description:!0,documents:!0,view:!0,familyRequest:!0,optional:!0,inputs:!0,params:!0},xb={appointment:s((e,t)=>({de:`Aufgabe "${e}" an ${t.de}: \`appointment\` (Terminaufgabe) gibt es nicht mehr \u2014 ein Termin hat keine Leitung, die sie hielte. Was die Teilnehmenden nach dem Termin festhalten, ist je Person eine R\xFCckmeldung (\`result.participants.feedback\` der Terminvereinbarung).`,en:`Task "${e}" on ${t.en}: \`appointment\` (appointment task) no longer exists \u2014 an appointment has no lead to hold it. What the participants record after the appointment is one feedback per person (\`result.participants.feedback\` of the booking task).`}),"appointment")};function p4(e){let t=Ue(e);return new Map((typeof t.workItemTemplates=="function"?t.workItemTemplates(e):[]).map(n=>[n.key,n]))}s(p4,"intrinsicTemplatesOf");function YD(e,t,n){if(n!==void 0&&typeof n!="string")return null;let r=n??t,i=e.nodes.find(l=>l.id===r);if(i===void 0)return null;let o=i,a=Ue(i);return{node:o,composedKeys:new Set((Array.isArray(o.tasks)?o.tasks:[]).map(l=>l.key).filter(l=>typeof l=="string")),intrinsicByKey:p4(i),refuse:s(l=>typeof a.refuseBlocksTarget=="function"?a.refuseBlocksTarget(i,l):null,"refuse")}}s(YD,"resolveBlocksTargetNode");function m4(e){let t=new Map;for(let r of Dn(e.nodes)){let i=t.get(r.source)??[];i.push(r.target),t.set(r.source,i)}let n=new Map;return r=>{let i=n.get(r);if(i!==void 0)return i;let o=new Set,a=[...t.get(r)??[]];for(;a.length>0;){let l=a.shift();o.has(l)||(o.add(l),a.push(...t.get(l)??[]))}return n.set(r,o),o}}s(m4,"reachability");function HD(e){let t=[],n=new Map;for(let o of e.nodes){let a=o;for(let l of Array.isArray(a.tasks)?a.tasks:[]){let d=typeof l.key=="string"?l.key:void 0,c=l.blocks;if(d===void 0||typeof c?.templateKey!="string")continue;let u=typeof c.node=="string"?c.node:o.id;n.set(`${o.id}::${d}`,`${u}::${c.templateKey}`)}}let r=new Map,i=s((o,a)=>{if(r.get(o)==="done")return;if(r.get(o)==="visiting"){let d=[...a.slice(a.indexOf(o)),o],[c,u]=o.split("::");t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${c}.tasks.${u}.blocks`,reason:{de:`[workItems/blocksCycle] Zyklus im 'blocks'-Graphen: ${d.map(p=>`"${p.replace("::"," \xB7 ")}"`).join(" \u2192 ")} \u2014 jedes Mitglied w\xFCrde auf ein anderes warten, keines w\xFCrde je frei.`,en:`[workItems/blocksCycle] Cycle in the 'blocks' graph: ${d.map(p=>`"${p.replace("::"," \xB7 ")}"`).join(" \u2192 ")} \u2014 every member would wait for another, none would ever be released.`},severity:"error"});return}r.set(o,"visiting");let l=n.get(o);l!==void 0&&n.has(l)&&i(l,[...a,o]),r.set(o,"done")},"walk");for(let o of n.keys())i(o,[]);return t}s(HD,"checkBlocksCycles");function h4(e){let{requiresOneOf:t,optionalActions:n}=e;if(!Array.isArray(t)||!Array.isArray(n))return new Set;let r=new Set(t.filter(o=>typeof o=="string")),i=new Set;for(let o of n)if(!(typeof o.key!="string"||!r.has(o.key)||!Array.isArray(o.tasks)))for(let a of o.tasks)typeof a=="string"&&i.add(a);return i}s(h4,"tasksOfRequiresOneOf");function JD(e){if(typeof e!="object"||e===null)return!1;let{de:t,en:n}=e;return typeof t=="string"&&t.trim().length>0&&typeof n=="string"&&n.trim().length>0}s(JD,"isFilledBilingual");var g4=["blocks","gatesNode","locksEvidence","completableIf"];function y4(e,t){let n={de:`Task "${t.key}" (Knoten "${t.nodeId}")`,en:`Task "${t.key}" (node "${t.nodeId}")`},r=[];e.feedback!==!0&&r.push(Nt(`${t.base}.feedback`,{de:`[workItems/feedbackNotTrue] ${n.de}: 'feedback' kennt nur true; erhalten ${JSON.stringify(e.feedback)}.`,en:`[workItems/feedbackNotTrue] ${n.en}: 'feedback' only knows true; got ${JSON.stringify(e.feedback)}.`}));let i=e.result;if(e.kind!=="task"||typeof i?.kind!="string"||!vk({kind:i.kind,writes:i.writes})){let a=e.kind==="task"&&i?.writes!==void 0,l={de:e.kind!=="task"?`kind ${String(e.kind)}`:`Ergebnis ${String(i?.kind)}${a?" mit writes":""}`,en:e.kind!=="task"?`kind ${String(e.kind)}`:`result ${String(i?.kind)}${a?" with writes":""}`};r.push(Nt(`${t.base}.feedback`,{de:`[workItems/feedbackNeedsProse] ${n.de} ist eine Feedback-Aufgabe und schlie\xDFt daher mit Freitext, einer Empfehlung oder einer Auswahl ohne 'writes' \u2014 ein Wert, den ein sp\xE4terer Schritt liest, k\xE4me von einem wom\xF6glich weitergeleiteten Link; erhalten ${l.de}.`,en:`[workItems/feedbackNeedsProse] ${n.en} is a feedback task, so it closes with free text, a recommendation or a choice without 'writes' \u2014 a value a later step reads would come from a link that may have been forwarded; got ${l.en}.`}))}let o=["blocks","gatesNode","completableIf","locksEvidence","familyRequest"].filter(a=>e[a]!==void 0);return o.length>0&&r.push(Nt(`${t.base}.feedback`,{de:`[workItems/feedbackSteersProcess] ${n.de} ist eine Feedback-Aufgabe; die Antwort kommt von einer Seite ohne weitere Daten und darf deshalb nicht von ${o.join(", ")} abh\xE4ngen.`,en:`[workItems/feedbackSteersProcess] ${n.en} is a feedback task; its answer comes from a page without application data, so it may not depend on ${o.join(", ")}.`})),r}s(y4,"feedbackTaskIssues");function w4(e,t){let n=[],r={de:`Task "${t.key}" (Knoten "${t.nodeId}")`,en:`Task "${t.key}" (node "${t.nodeId}")`},i=e.optional;(!(typeof i=="object"&&i!==null&&Object.keys(i).every(d=>d==="skipLabel"))||!JD(i.skipLabel))&&n.push(Nt(`${t.base}.optional.skipLabel`,{de:`[workItems/optionalSkipLabel] ${r.de} ist optional, braucht daf\xFCr '{ skipLabel: { de, en } }' \u2014 die Worte des Knopfs, mit dem die zust\xE4ndige Person ohne Ergebnis abschlie\xDFt (\u201EKeine Einsch\xE4tzung abgeben"); erhalten ${JSON.stringify(i)}.`,en:`[workItems/optionalSkipLabel] ${r.en} is optional and needs '{ skipLabel: { de, en } }' for that \u2014 the words of the button the responsible person uses to finish without a result ("Give no assessment"); got ${JSON.stringify(i)}.`})),e.kind!=="task"&&n.push(Nt(`${t.base}.optional`,{de:`[workItems/optionalOnApproval] ${r.de} ist eine Freigabe \u2014 optional ist nur eine Aufgabe; eine Freigabe schlie\xDFt mit ihrem Urteil.`,en:`[workItems/optionalOnApproval] ${r.en} is an approval \u2014 only a task can be optional; an approval ends with its verdict.`}));let a=e.result;(a===void 0||typeof a.kind!="string"||!vk({kind:a.kind,writes:a.writes}))&&n.push(Nt(`${t.base}.optional`,{de:`[workItems/optionalNeedsProseResult] ${r.de} ist optional, schlie\xDFt aber ${a===void 0?"ohne Ergebnis":`mit einem ${String(a.kind)}-Ergebnis${a.writes!==void 0?" mit Wert":""}`} \u2014 optional ist nur eine Aufgabe mit Freitext, Empfehlung oder einer Auswahl ohne 'writes': einen Wert, den ein sp\xE4terer Schritt liest, g\xE4be es dann nie.`,en:`[workItems/optionalNeedsProseResult] ${r.en} is optional but ends ${a===void 0?"without a result":`with a ${String(a.kind)} result${a.writes!==void 0?" with a value":""}`} \u2014 only a task with free text, a recommendation or a choice without 'writes' can be optional: a value a later step reads would then never arrive.`}));let l=g4.filter(d=>e[d]!==void 0);return l.length>0&&n.push(Nt(`${t.base}.${l[0]}`,{de:`[workItems/optionalHolds] ${r.de} ist optional und tr\xE4gt ${l.map(d=>`'${d}'`).join(", ")} \u2014 auf eine optionale Aufgabe wartet nichts: sie h\xE4lt keinen Schritt zur\xFCck. Entweder optional oder zur\xFCckhaltend.`,en:`[workItems/optionalHolds] ${r.en} is optional and carries ${l.map(d=>`'${d}'`).join(", ")} \u2014 nothing waits for an optional task: it holds no step back. Either optional or holding back.`})),t.requiredByRule&&n.push(Nt(`${t.base}.optional`,{de:`[workItems/optionalInRequiresOneOf] ${r.de} ist optional, geh\xF6rt aber zu einer Aktion, die 'requiresOneOf' verlangt \u2014 \u201EKeine Einsch\xE4tzung abgeben" w\xFCrde die Regel erf\xFCllen, ohne dass etwas geschehen ist.`,en:`[workItems/optionalInRequiresOneOf] ${r.en} is optional but belongs to an action that 'requiresOneOf' requires \u2014 "Give no assessment" would satisfy the rule without anything having happened.`})),n}s(w4,"optionalTaskIssues");function Nt(e,t){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:t,severity:"error"}}s(Nt,"issue");function QD(e,t){let n=[],r=m4(e),i=new Set(Fa(e).map(o=>o.key));n.push(...WD(e,t));for(let o of e.nodes){let a=o,l=jD(o);n.push(...zD(o));let d=h4(a);n.push(...UD(e,a));let c=new Map((Array.isArray(a.tasks)?a.tasks:[]).filter(u=>typeof u.key=="string").map(u=>[u.key,{feedback:u.feedback===!0}]));for(let u of Array.isArray(a.tasks)?a.tasks:[]){let p=typeof u.key=="string"?u.key:"?",h=`nodes.${o.id}.tasks.${p}`,y=u.kind,b=u.result,k=u.blocks,v=typeof k?.node=="string"&&k.node!==o.id?k.node:void 0;if(typeof k?.templateKey=="string"){let A=typeof k.node=="string"?k.node:o.id,x=mi(e).find(se=>se.id===A),V=(Array.isArray(x?.tasks)?x.tasks:[]).find(se=>se.key===k.templateKey)?.blocks;typeof V?.node=="string"&&V.node!==A&&n.push(Nt(`${h}.blocks.templateKey`,{de:`[workItems/blocksCrossNodeTask] Task "${p}" auf Knoten "${o.id}" h\xE4lt "${k.templateKey}" auf Knoten "${A}" zur\xFCck \u2014 das ist selbst eine knoten\xFCbergreifende Aufgabe, die ihren Knoten \xFCberlebt; zur\xFCckgehalten k\xF6nnte sie nach dessen Verlassen weder bearbeitet noch freigegeben werden. Nur Aufgaben, die an ihrem Knoten bleiben, und intrinsische Vorlagen sind Ziele.`,en:`[workItems/blocksCrossNodeTask] Task "${p}" on node "${o.id}" holds back "${k.templateKey}" on node "${A}" \u2014 that is itself a cross-node task that outlives its node; held back, it could be neither worked nor released after the node is left. Only tasks that stay on their node and intrinsic templates are targets.`}))}if(v!==void 0){let A=v;e.nodes.some(x=>x.id===A)&&!r(o.id).has(A)&&n.push(Nt(`${h}.blocks.node`,{de:`[workItems/blocksTargetNotAfter] Task "${p}" auf Knoten "${o.id}" blockiert Knoten "${A}", der von hier aus nicht erreichbar ist \u2014 die Aufgabe entst\xFCnde erst, wenn ihr Ziel schon hinter dem Prozess liegt. Ziel ist derselbe Knoten oder ein sp\xE4terer.`,en:`[workItems/blocksTargetNotAfter] Task "${p}" on node "${o.id}" blocks node "${A}", which cannot be reached from here \u2014 the task would only be created when its target is already behind the process. The target is the same node or a later one.`})),(b===void 0||!ha(b.kind))&&n.push(Nt(`${h}.blocks.node`,{de:`[workItems/crossNodeBlocksNeedsResult] Task "${p}" auf Knoten "${o.id}" blockiert einen anderen Knoten ("${A}"), hat aber kein 'result' \u2014 eine knoten\xFCbergreifende Aufgabe \xFCberlebt ihren Knoten und wird \xFCber ihr Ergebnis abgeschlossen (Freitext, Empfehlung oder Auswahl).`,en:`[workItems/crossNodeBlocksNeedsResult] Task "${p}" on node "${o.id}" blocks another node ("${A}") but has no 'result' \u2014 a cross-node task outlives its node and is completed through its result (free text, recommendation or choice).`})),l.has(p)&&n.push(Nt(`${h}.blocks.node`,{de:`[optionalAction/crossNodeBlocks] Task "${p}" geh\xF6rt zu einer optionalen Aktion (spawnTasks) auf Knoten "${o.id}" und darf keinen anderen Knoten blockieren \u2014 ihre Zeilen sind die Runde der Aktion.`,en:`[optionalAction/crossNodeBlocks] Task "${p}" belongs to an optional action (spawnTasks) on node "${o.id}" and must not block another node \u2014 its rows are the round of the action.`}))}for(let A of ND(String(y),b,{channelKeys:i,nodeTasks:c,...t?.billingItemKeys!==void 0?{billingItemKeys:t.billingItemKeys}:{},...t?.offerProgram!==void 0?{offerProgram:t.offerProgram}:{}}))n.push(Nt(`${h}.${A.field}`,{de:`${A.code} ${A.message.de} (Task "${p}" auf Knoten "${o.id}").`,en:`${A.code} ${A.message.en} (task "${p}" on node "${o.id}").`}));let T=u.when,$=s((A,x,q)=>{!ke(x)||mt(x)||n.push(Nt(A,{de:`[workItems/evidenceNotFormField] ${q} auf Task "${p}" (Knoten "${o.id}") nennt ${Ge(e,x,"de")} \u2014 Bedingung und Belege einer Aufgabe sind Felder eines Formulars ($node.<formular>.admission.<feld>).`,en:`[workItems/evidenceNotFormField] ${q} on task "${p}" (node "${o.id}") names ${Ge(e,x,"en")} \u2014 the condition and evidence of a task are fields of a form ($node.<form>.admission.<field>).`}))},"notFormField");T!==void 0?($(`${h}.when`,T,"'when'"),u.onConditionReturn!=="respawn"&&u.onConditionReturn!=="stayClosed"&&n.push(Nt(`${h}.onConditionReturn`,{de:`[workItems/whenNeedsOnConditionReturn] Task "${p}" (Knoten "${o.id}") hat eine Bedingung, aber kein 'onConditionReturn' ('respawn' | 'stayClosed') \u2014 was bei der R\xFCckkehr der Bedingung geschieht, muss entschieden sein.`,en:`[workItems/whenNeedsOnConditionReturn] Task "${p}" (node "${o.id}") has a condition but no 'onConditionReturn' ('respawn' | 'stayClosed') \u2014 what happens when the condition returns must be decided.`}))):u.onConditionReturn!==void 0&&n.push(Nt(`${h}.onConditionReturn`,{de:`[workItems/whenNeedsOnConditionReturn] 'onConditionReturn' ohne 'when' auf Task "${p}" (Knoten "${o.id}") \u2014 ohne Bedingung kehrt nichts zur\xFCck.`,en:`[workItems/whenNeedsOnConditionReturn] 'onConditionReturn' without 'when' on task "${p}" (node "${o.id}") \u2014 without a condition nothing returns.`}));let I=u.reads;if(I!==void 0)if(!Array.isArray(I))n.push(Nt(`${h}.reads`,{de:`[workItems/readsUnknownField] 'reads' auf Task "${p}" (Knoten "${o.id}") muss eine Liste von Feldadressen sein.`,en:`[workItems/readsUnknownField] 'reads' on task "${p}" (node "${o.id}") must be a list of field addresses.`}));else for(let[A,x]of I.entries())$(`${h}.reads.${A}`,x,"'reads'");let C=u.locksEvidence,F=s((A,x)=>n.push(Nt(`${h}.locksEvidence`,{de:`[workItems/${A}] Task "${p}" (Knoten "${o.id}") ${x.de}`,en:`[workItems/${A}] Task "${p}" (node "${o.id}") ${x.en}`})),"lockIssue");C!==void 0&&C!==!0&&F("locksEvidenceNotTrue",{de:`tr\xE4gt 'locksEvidence' ${JSON.stringify(C)} \u2014 nur 'true' ist erlaubt; ohne Sperre entf\xE4llt das Feld.`,en:`carries 'locksEvidence' ${JSON.stringify(C)} \u2014 only 'true' is allowed; without a lock the field is dropped.`}),C===!0&&(I===void 0&&T===void 0&&F("locksEvidenceWithoutEvidence",{de:"sperrt seine Belege, hat aber weder 'reads' noch 'when' \u2014 es gibt nichts, worauf die Entscheidung beruht.",en:"locks its evidence but has neither 'reads' nor 'when' \u2014 there is nothing the decision rests on."}),(b===void 0||!ha(b.kind))&&F("locksEvidenceNeedsRecordedResult",{de:"sperrt seine Belege, schlie\xDFt aber nicht mit einem erfassten Ergebnis (Freitext, Empfehlung, Auswahl) \u2014 nur eine Entscheidung, die das Team wieder\xF6ffnen kann, darf Belege sperren (ein Termin bleibt gebucht).",en:"locks its evidence but does not end with a recorded result (free text, recommendation, choice) \u2014 only a decision the team can reopen may lock evidence (an appointment stays booked)."}),l.has(p)&&F("locksEvidenceOnOptionalAction",{de:"geh\xF6rt zu einer optionalen Aktion (spawnTasks) \u2014 ihre Zeilen sind die Runde der Aktion, wieder\xF6ffnen l\xE4sst sie sich nicht; Belege sperrt nur eine Knotenaufgabe.",en:"belongs to an optional action (spawnTasks) \u2014 its rows are the round of the action and cannot be reopened; only a node task locks evidence."})),n.push(...GD({graph:e,node:a,task:u,onTrigger:l,specCtx:t}));let N=Object.keys(u).filter(A=>!Object.hasOwn(vb,A)&&!Object.hasOwn(xb,A));N.length>0&&n.push(Nt(`${h}.${N[0]}`,{de:`[workItems/unknownKey] Task "${p}" (Knoten "${o.id}") tr\xE4gt ${N.map(A=>`'${A}'`).join(", ")} \u2014 kein Feld einer Aufgabe. Erlaubt: ${Object.keys(vb).join(", ")}. (Checklisten gibt es nicht mehr: Text als 'description', mehrere Arbeitsschritte sind mehrere Aufgaben.)`,en:`[workItems/unknownKey] Task "${p}" (node "${o.id}") carries ${N.map(A=>`'${A}'`).join(", ")} \u2014 not a field of a task. Allowed: ${Object.keys(vb).join(", ")}. (Checklists no longer exist: text goes in 'description', several work steps are several tasks.)`}));let M=u.description;M!==void 0&&!JD(M)&&n.push(Nt(`${h}.description`,{de:`[workItems/descriptionInvalid] 'description' auf Task "${p}" (Knoten "${o.id}") braucht Text in beiden Sprachen ({ de, en }), erhalten ${JSON.stringify(M)}.`,en:`[workItems/descriptionInvalid] 'description' on task "${p}" (node "${o.id}") needs text in both languages ({ de, en }), got ${JSON.stringify(M)}.`})),u.feedback!==void 0&&n.push(...y4(u,{key:p,nodeId:o.id,base:h})),u.optional!==void 0&&n.push(...w4(u,{key:p,nodeId:o.id,base:h,requiredByRule:d.has(p)}))}}return n}s(QD,"checkNodeTasks");function ZD(e){let t=e.indexOf(":"),n=t===-1?"":e.slice(0,t),r=t===-1?"":e.slice(t+1).trim();if(n==="artifact"&&r.length>0)return{kind:n,key:r};let i=Ri(r);return n==="field"&&i!==null?{kind:n,address:i}:de("INVALID",{de:`Dokument-Verweis "${e}" ist ung\xFCltig \u2014 erwartet artifact:<Slot-Schl\xFCssel> (auch der Slot eines anderen Knotens) oder field:$node.<Formular>.admission.<Feld>.`,en:`Document reference "${e}" is invalid \u2014 expected artifact:<slot key> (another node's slot too) or field:$node.<form>.admission.<field>.`})}s(ZD,"parseTaskDocumentRef");function Sb(e){return e.kind==="artifact"?`artifact:${e.key}`:`field:${ce(e.address)}`}s(Sb,"taskDocumentId");function qi(e,t){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:t,severity:"error"}}s(qi,"issue");function XD(e){return Array.isArray(e.tasks)?e.tasks:[]}s(XD,"tasksOf");function Nd(e){let t=new Map;for(let n of e){let{id:r,artifacts:i}=n;for(let o of Array.isArray(i)?i:[])typeof o?.key=="string"&&t.set(o.key,[...t.get(o.key)??[],{nodeId:r,slot:o}])}return t}s(Nd,"artifactSlotDeclarations");function k4(e){return e.flatMap(t=>{let{id:n,artifacts:r}=t;return(Array.isArray(r)?r:[]).filter(i=>!Nm(i?.type)).map(i=>({nodeId:String(n),slotKey:String(i?.key),type:JSON.stringify(i?.type??null)}))})}s(k4,"unknownArtifactSlotTypes");function eF(e){let t=[];for(let{nodeId:n,slotKey:r,type:i}of k4(e.nodes))t.push(qi(`nodes.${n}.artifacts.${r}.type`,{de:`[artifact/unknownType] Knoten "${n}" deklariert den Dokument-Slot \u201E${r}" mit der Art ${i} \u2014 erlaubt sind ${Ma.join(", ")}.`,en:`[artifact/unknownType] Node "${n}" declares the document slot "${r}" with the type ${i} \u2014 allowed are ${Ma.join(", ")}.`}));for(let[n,r]of Nd(e.nodes))for(let i of r.slice(1))t.push(qi(`nodes.${i.nodeId}.artifacts`,{de:`[governedDocument/slotKeyTaken] Knoten "${i.nodeId}" deklariert den Dokument-Slot \u201E${n}", den schon "${r[0].nodeId}" deklariert \u2014 jeder Slot-Schl\xFCssel geh\xF6rt genau einem Knoten.`,en:`[governedDocument/slotKeyTaken] Node "${i.nodeId}" declares the document slot "${n}", which "${r[0].nodeId}" already declares \u2014 every slot key belongs to exactly one node.`}));return t}s(eF,"checkArtifactSlotKeys");function b4(e,t,n,r=Nd(e.nodes)){let i=r.get(t)?.[0]?.nodeId;return i===void 0?{reason:"unknown"}:Ta(e,i,n)?null:{reason:"notBefore",owner:i}}s(b4,"slotLinkRefusal");function tF(e){if(!Array.isArray(e)||e.length===0)return null;let t=[];for(let n of e){let r=typeof n=="object"&&n!==null?n:{},i=Object.keys(r).sort().join(",");if(r.kind==="artifact"&&i==="key,kind"&&typeof r.key=="string"&&r.key.length>0)t.push({kind:"artifact",key:r.key});else if(r.kind==="field"&&i==="address,kind")t.push({kind:"field",address:r.address});else return null}return t}s(tF,"authoredRefs");function nF(e){let t=[],n=Nd(e.nodes);for(let r of mi(e))for(let i of XD(r)){if(i.documents===void 0)continue;let o=typeof i.key=="string"?i.key:"?",a=`nodes.${r.id}.tasks.${o}.documents`,l={de:`Task "${o}" (Knoten "${r.id}")`,en:`Task "${o}" (node "${r.id}")`},d=tF(i.documents);if(d===null){t.push(qi(a,{de:`[workItems/documentsInvalid] 'documents' auf ${l.de} muss eine nicht leere Liste von { kind: 'artifact', key } (Dokument-Slot eines Knotens) oder { kind: 'field', address } (Dateifeld eines Formulars) sein, erhalten ${JSON.stringify(i.documents)} \u2014 ein { kind: 'document', address } schreibt \`plexus-cli offer upgrade\` auf den Slot um.`,en:`[workItems/documentsInvalid] 'documents' on ${l.en} must be a non-empty list of { kind: 'artifact', key } (document slot of a node) or { kind: 'field', address } (file field of a form), got ${JSON.stringify(i.documents)} \u2014 \`plexus-cli offer upgrade\` rewrites a { kind: 'document', address } onto its slot.`}));continue}let c=new Set;for(let u of d){if(u.kind!=="artifact"&&!ke(u.address))continue;let p=u.kind==="artifact"?Sb(u):Sb({kind:"field",address:u.address});if(c.has(p)&&t.push(qi(a,{de:`[workItems/documentsDuplicate] ${l.de} verweist zweimal auf ${p}.`,en:`[workItems/documentsDuplicate] ${l.en} refers to ${p} twice.`})),c.add(p),u.kind==="artifact"){let h=b4(e,u.key,r.id,n);h?.reason==="unknown"?t.push(qi(a,{de:`[workItems/documentsUnknownArtifact] ${l.de} verweist auf das Dokument "${u.key}", aber kein Knoten deklariert einen solchen Slot.`,en:`[workItems/documentsUnknownArtifact] ${l.en} refers to the document "${u.key}", but no node declares such a slot.`})):h?.reason==="notBefore"&&t.push(qi(a,{de:`[workItems/documentsNotBefore] ${l.de} verweist auf das Dokument "${u.key}" des Knotens "${h.owner}", der nicht auf jedem Weg vor "${r.id}" liegt \u2014 auf einem Weg an ihm vorbei g\xE4be es das Dokument nie.`,en:`[workItems/documentsNotBefore] ${l.en} refers to the document "${u.key}" of node "${h.owner}", which does not lie on every path before "${r.id}" \u2014 on a path around it the document would never exist.`}))}u.kind==="field"&&!mt(u.address)&&t.push(qi(a,{de:`[workItems/documentsInvalid] ${l.de}: ein Feld-Dokument nennt ein Feld eines Formulars ($node.<formular>.admission.<feld>), nicht ${Ge(e,u.address,"de")}.`,en:`[workItems/documentsInvalid] ${l.en}: a field document names a field of a form ($node.<form>.admission.<field>), not ${Ge(e,u.address,"en")}.`}))}}return t}s(nF,"checkTaskDocuments");function rF(e,t){let n=[];for(let r of mi(e))for(let i of XD(r)){let o=tF(i.documents);if(o===null)continue;let a=typeof i.key=="string"?i.key:"?",l=`nodes.${r.id}.tasks.${a}.documents`;for(let d of o){if(d.kind!=="field"||!mt(d.address))continue;let c=ui(t,d.address);if(c==null)continue;let u={de:Ge(e,d.address,"de"),en:Ge(e,d.address,"en")},p=$a("taskDocument",Ra(c));if(p==="repeated"){n.push(qi(l,{de:`[workItems/documentsUnknownField] Task "${a}" (Knoten "${r.id}") verweist auf das Feld ${u.de} \u2014 ein Feld in einer Wiederholgruppe ist kein einzelnes Dokument der Anmeldung.`,en:`[workItems/documentsUnknownField] Task "${a}" (node "${r.id}") refers to the field ${u.en} \u2014 a field in a repeated group is not a single document of the application.`}));continue}p==="notDocument"&&n.push(qi(l,{de:`[workItems/documentsNotDocument] Task "${a}" (Knoten "${r.id}") verweist auf das Feld ${u.de}, das keine Datei enth\xE4lt \u2014 nur Datei-Felder (docRef) sind Dokumente.`,en:`[workItems/documentsNotDocument] Task "${a}" (node "${r.id}") refers to the field ${u.en}, which holds no file \u2014 only file fields (docRef) are documents.`}))}}return n}s(rF,"checkTaskDocumentFields");var Tb=["form","artifact","field"],Va=["coverLetter","contract"],oF="form",iF=/^[A-Za-z0-9_.-]+$/;function v4(e){return Va.includes(e)}s(v4,"isArtifactPart");function ja(e){return de("INVALID",{de:`Ansichts-Adresse "${e}" ist ung\xFCltig \u2014 erwartet form:<Formularknoten>#<Ansicht>, artifact:<Slot>[#${Va.join("|")}] oder field:$node.<Formular>.admission.<Feld>.`,en:`View address "${e}" is invalid \u2014 expected form:<form node>#<view>, artifact:<slot>[#${Va.join("|")}] or field:$node.<form>.admission.<field>.`})}s(ja,"invalid");function Rb(e){let t=e.indexOf(":");if(t===-1)return ja(e);let n=e.slice(0,t),r=e.slice(t+1);if(n==="field"){let l=Ri(r);return l===null?ja(e):{kind:n,address:l}}let i=r.indexOf("#"),o=i===-1?r:r.slice(0,i),a=i===-1?null:r.slice(i+1);return iF.test(o)?n==="form"?a!==null&&iF.test(a)?{kind:n,form:o,view:a}:ja(e):n==="artifact"?a===null?{kind:n,slot:o}:v4(a)?{kind:n,slot:o,part:a}:ja(e):ja(e):ja(e)}s(Rb,"parseViewAddress");function sF(e){let t=S4(e);if(t===null)return null;let n=x4(t);return n!==null&&JSON.stringify(Ab(n))===JSON.stringify(Ab(e))?n:null}s(sF,"viewAddressOf");function x4(e){try{return Rb(e)}catch{return null}}s(x4,"tryParseViewAddress");function S4(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.kind==="form"&&typeof t.form=="string"&&typeof t.view=="string")return`form:${t.form}#${t.view}`;if(t.kind==="artifact"&&typeof t.slot=="string")return t.part===void 0?`artifact:${t.slot}`:typeof t.part=="string"?`artifact:${t.slot}#${t.part}`:null;if(t.kind==="field"&&t.address!==null&&typeof t.address=="object"){let n=t.address;return typeof n.scope!="string"||typeof n.key!="string"?null:`field:${ce(n)}`}return null}s(S4,"spellingOf");function Ab(e){return e===null||typeof e!="object"||Array.isArray(e)?e:Object.fromEntries(Object.entries(e).sort(([t],[n])=>t<n?-1:t>n?1:0).map(([t,n])=>[t,Ab(n)]))}s(Ab,"canonical");function aF(e){switch(e.kind){case"form":return`form:${e.form}#${e.view}`;case"artifact":return e.part===void 0?`artifact:${e.slot}`:`artifact:${e.slot}#${e.part}`;case"field":return`field:${ce(e.address)}`}}s(aF,"formatViewAddress");var $b=["form","documents"],A4=/^[a-z][a-zA-Z0-9_-]*$/;function T4(e){let t=new Map,n=s(r=>{for(let i of[...r.fields,...(r.groups??[]).flatMap(o=>o.fields)])t.set(i.key,i.type==="docRef"?"document":"other");for(let i of r.repeated??[]){t.set(i.key,"other");for(let o of i.itemTemplate)t.set(`${i.key}[].${o.key}`,o.type==="docRef"?"row":"other")}r.subsections?.forEach(n)},"visit");return e.sections.forEach(n),t}s(T4,"fieldPlaces");function lF(e,t,n){let r=[],i=new Set;return e.forEach((o,a)=>{if(typeof o!="string"||!A4.test(o)){r.push({severity:"error",path:`${n(a)}.key`,code:"view.invalid-key",message:{de:`${t.de}: '${String(o)}' ist kein g\xFCltiger Schl\xFCssel (Kleinbuchstabe am Anfang, dann Buchstaben, Ziffern, - oder _).`,en:`${t.en}: '${String(o)}' is no valid key (a lower-case letter first, then letters, digits, - or _).`}});return}i.has(o)&&r.push({severity:"error",path:`${n(a)}.key`,code:"view.duplicate-key",message:{de:`${t.de}: Der Schl\xFCssel '${o}' kommt doppelt vor.`,en:`${t.en}: the key '${o}' occurs twice.`}}),i.add(o)}),r}s(lF,"keyIssues");function R4(e,t,n){return e==="document"?null:e===void 0?{severity:"error",path:n,code:"view.unknown-field",message:{de:`Ansicht: Das Formular hat kein Feld '${t}'.`,en:`View: the form has no field '${t}'.`}}:e==="row"?{severity:"error",path:n,code:"view.field-in-row",message:{de:`Ansicht: Das Dateifeld '${t}' liegt in einem wiederholten Block und kann nicht einzeln genannt werden.`,en:`View: the file field '${t}' sits in a repeated block and cannot be named on its own.`}}:{severity:"error",path:n,code:"view.not-a-document",message:{de:`Ansicht: Das Feld '${t}' enth\xE4lt keine Datei.`,en:`View: the field '${t}' holds no file.`}}}s(R4,"fieldIssue");function $4(e,t,n){let r=[];$b.includes(e.key)&&r.push({severity:"error",path:`${t}.key`,code:"view.reserved-key",message:{de:`Der Ansichtsschl\xFCssel '${e.key}' ist f\xFCr die Standardansicht reserviert.`,en:`The view key '${e.key}' is reserved for the standard view.`}});let i=e.groups;i.length===0&&r.push({severity:"error",path:`${t}.groups`,code:"view.empty",message:{de:`Ansicht '${e.key}' hat keine Gruppen.`,en:`View '${e.key}' has no groups.`}}),r.push(...lF(i.map(a=>a.key),{de:`Gruppe der Ansicht '${e.key}'`,en:`Group of view '${e.key}'`},a=>`${t}.groups[${a}]`));let o=new Set;return i.forEach((a,l)=>{let d=`${t}.groups[${l}]`,c=a.fields;c.length===0&&r.push({severity:"error",path:`${d}.fields`,code:"view.empty",message:{de:`Gruppe '${a.key}' der Ansicht '${e.key}' hat keine Felder.`,en:`Group '${a.key}' of view '${e.key}' has no fields.`}}),c.forEach((u,p)=>{let h=`${d}.fields[${p}]`,y=R4(n.get(u),u,h);y!==null&&r.push(y),o.has(u)&&r.push({severity:"error",path:h,code:"view.field-twice",message:{de:`Ansicht '${e.key}': Das Feld '${u}' steht mehrfach; eine Datei hat einen Platz.`,en:`View '${e.key}': the field '${u}' is listed more than once; a file has one place.`}}),o.add(u)})}),r}s($4,"viewIssues");function E4(e){if(!Array.isArray(e))return"views";for(let[t,n]of e.entries()){let r=n?.groups;if(!Array.isArray(r))return`views[${t}].groups`;for(let[i,o]of r.entries()){let a=o?.fields;if(!Array.isArray(a)||a.some(l=>typeof l!="string"))return`views[${t}].groups[${i}].fields`}}return null}s(E4,"malformedAt");function dF(e){let t=e.views;if(t===void 0)return[];let n=E4(t);if(n!==null)return[{severity:"error",path:n,code:"view.malformed",message:{de:`${n} hat nicht die Form einer Ansicht: views ist eine Liste von { key, label, groups }, groups eine Liste von { key, label, fields }, fields eine Liste von Feldschl\xFCsseln.`,en:`${n} is not shaped like a view: views is a list of { key, label, groups }, groups a list of { key, label, fields }, fields a list of field keys.`}}];let r=T4(e);return[...lF(t.map(i=>i.key),{de:"Ansicht",en:"View"},i=>`views[${i}]`),...t.flatMap((i,o)=>$4(i,`views[${o}]`,r))]}s(dF,"formViewIssues");function Ba(e,t){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:t,severity:"error"}}s(Ba,"issue");function cF(e,t,n,r,i){let o=sF(e);if(o===null)return[Ba(t,{de:`[view/invalid] 'view' auf ${n.de} ist keine Ansichts-Adresse \u2014 erwartet { kind: ${Tb.join(" | ")}, \u2026 }: form:<Formularknoten>#<Ansicht>, artifact:<Slot>[#${Va.join("|")}] oder field:$node.<Formular>.admission.<Feld>.`,en:`[view/invalid] 'view' on ${n.en} is no view address \u2014 expected { kind: ${Tb.join(" | ")}, \u2026 }: form:<form node>#<view>, artifact:<slot>[#${Va.join("|")}] or field:$node.<form>.admission.<field>.`})];let a=aF(o);switch(o.kind){case"artifact":return r.has(o.slot)?[]:[Ba(t,{de:`[view/unknownSlot] ${n.de} nennt "${a}", aber kein Knoten dieses Graphen hat den Dokument-Slot "${o.slot}".`,en:`[view/unknownSlot] ${n.en} names "${a}", but no node of this graph has the document slot "${o.slot}".`})];case"form":case"field":{let l=o.kind==="form"?o.form:o.address.scope==="node"?o.address.owner:null;if(l===null)return[Ba(t,{de:`[view/invalid] ${n.de} nennt "${a}" \u2014 ein Dateifeld liegt in einem Formular: field:$node.<Formular>.admission.<Feld>.`,en:`[view/invalid] ${n.en} names "${a}" \u2014 a file field lives in a form: field:$node.<form>.admission.<field>.`})];let d=i?.formViewKeysByFormNode;if(d===void 0)return[];let c=d.get(l);return c===void 0?[Ba(t,{de:`[view/unknownForm] ${n.de} nennt "${a}", aber kein Formularknoten hei\xDFt so.`,en:`[view/unknownForm] ${n.en} names "${a}", but no form node has that id.`})]:o.kind==="field"?[]:c.has(o.view)||$b.includes(o.view)?[]:[Ba(t,{de:`[view/unknownView] ${n.de} nennt "${a}", aber das Formular "${o.form}" hat keine Ansicht "${o.view}".`,en:`[view/unknownView] ${n.en} names "${a}", but the form "${o.form}" has no view "${o.view}".`})]}}}s(cF,"viewIssues");function uF(e,t){let n=[],r=new Set(Nd(e.nodes).keys());for(let i of mi(e)){if(i.view!==void 0){let o={de:`Knoten "${i.id}"`,en:`node "${i.id}"`};i.type!=="decision"?n.push(Ba(`nodes.${i.id}.view`,{de:`[view/invalid] ${o.de}: 'view' am Knoten gilt nur f\xFCr eine Entscheidung; eine Aufgabe tr\xE4gt ihre eigene.`,en:`[view/invalid] ${o.en}: 'view' on a node applies to a decision only; a task carries its own.`})):n.push(...cF(i.view,`nodes.${i.id}.view`,o,r,t))}for(let o of Array.isArray(i.tasks)?i.tasks:[]){if(o.view===void 0)continue;let a=String(o.key);n.push(...cF(o.view,`nodes.${i.id}.tasks.${a}.view`,{de:`Task "${a}" (Knoten "${i.id}")`,en:`Task "${a}" (node "${i.id}")`},r,t))}}return n}s(uF,"checkTaskViews");var Jn="traeger",fF={de:"Tr\xE4ger",en:"Provider"};function Ua(e){let t=e.inputs?.[Jn];return t?.kind==="literal"&&typeof t.value=="string"&&t.value.length>0?t.value:null}s(Ua,"traegerKeyOfNode");var Pm={name:"input.traeger.name",address:"input.traeger.anschrift"},zbe=Object.values(Pm);var pF="governedDocument",fs="prepareDocument",Pd="prepareDocument:revision",Lr="releaseApproval",ps="documentResponse",Ro="coverLetterResponse",Cm="confirmCoverLetter",Dm="requestCoverLetterRevision",Ga="coverLetterConfirmation",hi="responseCheck",Fm="returnSigned";var mF="requestApproval";var hF="issueDocument",gF="correctInPlace",yF="rescindAndReissue",Lm="requestChange";var za="releaseArtifact",yn="signingRecovery",Mm="resendESignature",ms="switchToPaper";var Cd=new Set([fs,Pd]),wF=["pending","producing","producingHeld","deferred","awaitingApproval","awaitingCoverLetter","awaitingResponse","responseReturned","responseInCheck","awaitingSignature","signatureStalled","done"],qm=["upload","resolver","template","none"],hs=1,gs=366,Ki="responseDueInDays";function ys(e){let t=e.inputs?.[Ga];return t?.kind==="literal"&&t.value===!0}s(ys,"coverLetterConfirmationOf");function Dd(e){let t=e.inputs?.[Ki];return t?.kind==="literal"&&Fd(t.value)?t.value:void 0}s(Dd,"responseDueInDaysForVocabulary");function Fd(e){return typeof e=="number"&&Number.isInteger(e)&&e>=hs&&e<=gs}s(Fd,"isValidResponseDueInDays");var Wa=["generatedAt","responseDueInDays","countersignature"],ws=["release","none"],Km=["confirm","signedUpload","signedUploadChecked","eSignature"];var I4={kind:"confirm",acceptOutcomeId:"accepted",declineOutcomeId:"declined",outcomeSemantics:{accept:"granted",decline:"rejected"},acceptEvent:"userTaskResolved",producesResponseArtifact:!1,declineIsAnswer:!0,acceptStatus:"accepted",checksReturn:!1,issuesBy:"paper",defaultLabels:{accept:{de:"Annehmen",en:"Accept"},decline:{de:"Ablehnen",en:"Decline"}}},kF={kind:"signedUpload",acceptOutcomeId:"signed",declineOutcomeId:"absage",outcomeSemantics:{accept:"other",decline:"rejected"},acceptEvent:"userTaskResolved",producesResponseArtifact:!0,declineIsAnswer:!1,acceptStatus:"signed",checksReturn:!1,issuesBy:"paper",defaultLabels:{accept:{de:"Unterschrieben zur\xFCcksenden",en:"Return signed"},decline:{de:"Ablehnen",en:"Decline"}}},bF={...kF,kind:"signedUploadChecked",acceptEvent:"contractEvent",checksReturn:!0},O4={...bF,kind:"eSignature",issuesBy:"provider"},ji={confirm:I4,signedUpload:kF,signedUploadChecked:bF,eSignature:O4};function Vi(e){let t=e.responseStrategy;if(typeof t=="string"&&t in ji)return ji[t];D(`governedDocument node "${e.id}" declares no valid responseStrategy (got ${JSON.stringify(t)}) \u2014 publish validation should have blocked this; corrupt pinned graph`)}s(Vi,"responseStrategyOf");function jm(e){if(e.type!==pF||e.production!=="resolver")return!1;let t=e.responseStrategy;return typeof t=="string"&&t in ji?ji[t].acceptEvent==="contractEvent":!1}s(jm,"isFamilySignedContractNode");function Ha(e){return e.label}s(Ha,"governedDocTitle");function Eb(e){return e.approval==="release"?mF:hF}s(Eb,"submitActionId");function vF(e,t,n){return{key:t,recipient:"internal",title:n,unlocks:[Eb(e)],gatesNode:!0,advancesNode:!0}}s(vF,"producerTemplate");function _4(e){return e.titles?.respond??e.label}s(_4,"responseTitle");var Ya={de:"\u27E8Titel fehlt\u27E9",en:"\u27E8title missing\u27E9"};function Vm(e){let t=Vi(e),n=[];if(e.production!=="none"&&n.push(vF(e,fs,e.titles?.prepare??Ya),vF(e,Pd,e.titles?.revise??Ya)),e.approval==="release"&&n.push({key:Lr,recipient:"internal",title:e.titles?.approve??Ya,unlocks:[],verdictResolved:!0,gatesNode:!0,advancesNode:!0}),n.push({key:ps,recipient:"external",title:_4(e),unlocks:t.producesResponseArtifact?[t.checksReturn?Fm:t.acceptOutcomeId,t.declineOutcomeId,Lm]:[t.acceptOutcomeId,t.declineOutcomeId],advancesNode:!0,...Dd(e)!==void 0?{dueInDays:Dd(e)}:{}}),ys(e)){let r=Ha(e);n.push({key:Ro,recipient:"external",title:{de:`${r.de}: Angebot best\xE4tigen`,en:`${r.en}: confirm offer`},unlocks:[Cm,Dm,t.declineOutcomeId],advancesNode:!0,...Dd(e)!==void 0?{dueInDays:Dd(e)}:{}})}if(t.checksReturn&&n.push({key:hi,recipient:"internal",title:e.titles?.check??Ya,unlocks:[],verdictResolved:!0,gatesNode:!1,advancesNode:!0}),t.issuesBy==="provider"){let r=Ha(e);n.push({key:yn,recipient:"internal",title:{de:`${r.de}: elektronische Unterschrift kl\xE4ren`,en:`${r.en}: resolve the e-signature`},unlocks:[Mm,ms],gatesNode:!1,advancesNode:!1})}return n}s(Vm,"governedDocIntrinsicTemplates");function N4(e){e.production==="none"&&D(`governedDocSlot: node "${e.id}" has production 'none' \u2014 it governs no artifact slot`);let t=e.artifacts??[];t.length!==1&&D(`governedDocSlot: node "${e.id}" declares ${t.length} artifact slots \u2014 exactly ONE is required (publish validation [governedDocument/slotContract])`);let n=t[0];return(typeof n.key!="string"||n.key.length===0)&&D(`governedDocSlot: node "${e.id}" declares an artifact slot without a key \u2014 corrupt pinned graph`),n}s(N4,"governedDocSlot");function Bm(e){return N4(e).key}s(Bm,"governedDocSlotKey");var mr="processFooter";var Ld="countersign",Ib="countersign",xF="countersigned",Ob="countersigning",SF="countersigned";var AF={de:"Vertrag gegenzeichnen",en:"Countersign the contract"},Md=["scan","eSignature"],Um="service_provider:1",TF=["countersigning","awaitingSignature","signatureStalled","done"],RF={de:"Elektronische Gegenzeichnung kl\xE4ren",en:"Resolve the electronic countersignature"};function $F(e){return{de:`[countersign/traegerSignatoryMissing] Die Schule zeichnet elektronisch gegen, aber f\xFCr ${e} ist keine Unterschriftsperson hinterlegt, die unterschreiben kann (Rechtstr\xE4ger \u2192 signatoryUserKey, aktives Personal der Schule).`,en:`[countersign/traegerSignatoryMissing] The school countersigns electronically, but no signatory who can sign is on file for ${e} (legal entity \u2192 signatoryUserKey, active staff of the school).`}}s($F,"traegerSignatoryMissingReason");function hr(e,t,n){return{layer:"GRAPH",kind:"nodeRule",path:`nodes.${e.id}.${t}`,reason:n,severity:"error"}}s(hr,"issue");function Gm(e,t){return e.nodes.filter(n=>{let r=n.contract;return n.type==="countersign"&&ke(r)&&r.scope==="node"&&r.owner===t})}s(Gm,"countersignersOf");function qd(e){return e.signing==="eSignature"}s(qd,"isElectronic");function P4(e,t){if(t===void 0||t.sendable||!qd(e))return[];let n=e.label?.de??e.id,r=e.label?.en||e.id;return[hr(e,"signing",{de:`[countersign/eSignatureNeedsProvider] \u201E${n}\u201C zeichnet elektronisch gegen, aber die Schule kann nicht senden: ${t.reason.de}`,en:`[countersign/eSignatureNeedsProvider] "${r}" countersigns electronically, but the school cannot send: ${t.reason.en}`})]}s(P4,"countersignProviderIssues");function C4(e,t,n){if(n.scope!=="node")return[];let r=e.nodes.find(o=>o.id===n.owner);if(r===void 0)return[];let i=[];return jm(r)||i.push("sourceNotCheckedContract"),Gm(e,r.id).some(o=>o.id!==t)&&i.push("twice"),i}s(C4,"countersignContractRefusals");function EF(e){let t=e.inputs?.dueInDays;return t?.kind==="literal"&&typeof t.value=="number"&&Number.isInteger(t.value)&&t.value>=1?t.value:void 0}s(EF,"validDueInDays");function D4(e,t,n){let r=e.label?.de??e.id,i=e.label?.en||e.id,o=e.signing;if(o!==void 0&&!Md.includes(o))return[hr(e,"signing",{de:`[countersign/unknownSigning] \u201E${r}\u201C: signing ist scan oder eSignature (gefunden: ${JSON.stringify(o)}).`,en:`[countersign/unknownSigning] "${i}": signing is scan or eSignature (found: ${JSON.stringify(o)}).`})];let a=e.assign?.[yn];if(!qd(e))return a===void 0?[]:[hr(e,"assign",{de:`[countersign/recoveryAssign] \u201E${r}\u201C zeichnet auf Papier gegen \u2014 \`assign.signingRecovery\` h\xE4lt keine Aufgabe und geh\xF6rt entfernt.`,en:`[countersign/recoveryAssign] "${i}" countersigns on paper \u2014 \`assign.signingRecovery\` holds no task and must be removed.`})];let l=[];return a===void 0&&l.push(hr(e,"assign",{de:`[countersign/recoveryAssign] \u201E${r}\u201C zeichnet elektronisch gegen \u2014 wer eine gescheiterte Gegenzeichnung kl\xE4rt, fehlt: \`assign.signingRecovery\` nennt das Team.`,en:`[countersign/recoveryAssign] "${i}" countersigns electronically \u2014 who resolves a failed countersignature is missing: \`assign.signingRecovery\` names the team.`})),l.push(...F4(e,t,n),...L4(e,t,n),...P4(e,n?.signingProvider)),l}s(D4,"signingIssues");function OF(e,t){let n=e.contract;if(!(!ke(n)||n.scope!=="node"))return t.nodes.find(r=>r.id===n.owner)}s(OF,"contractNodeOf");function F4(e,t,n){let r=OF(e,t),i=r===void 0?null:Ua(r),o=i===null?void 0:n?.traeger?.get(i);return o===void 0||o.hasSignatory?[]:[hr(e,"signing",$F(o.name))]}s(F4,"traegerSignatoryIssues");function L4(e,t,n){let r=OF(e,t);if(r===void 0)return[];let i=n?.resolverDocumentAnchors?.get(r.id);if(i===void 0)return[];let o=e.label?.de??e.id,a=e.label?.en||e.id,l=[];for(let d of i)d.documentAnchors===null?l.push(hr(e,"signing",{de:`[countersign/eSignatureAnchorMissing] \u201E${o}\u201C zeichnet elektronisch gegen, aber die Vorlage des Generators \u201E${d.pin}\u201C wurde nie auf Unterschriftsanker gelesen \u2014 Vorlage neu hochladen und den Generator neu versiegeln.`,en:`[countersign/eSignatureAnchorMissing] "${a}" countersigns electronically, but the template of generator "${d.pin}" was never read for signature anchors \u2014 upload the template again and seal the generator again.`})):d.documentAnchors.has(Um)||l.push(hr(e,"signing",{de:`[countersign/eSignatureAnchorMissing] \u201E${o}\u201C zeichnet elektronisch gegen, aber die Vorlage von \u201E${d.pin}\u201C tr\xE4gt keinen Anker /unterschrift:${Um}/ \u2014 der Anbieter f\xE4nde f\xFCr die Schule kein Unterschriftsfeld.`,en:`[countersign/eSignatureAnchorMissing] "${a}" countersigns electronically, but the template of "${d.pin}" carries no anchor /unterschrift:${Um}/ \u2014 the provider would find no signature field for the school.`}));return l}s(L4,"traegerAnchorIssues");var _b=100;async function M4(e,t){let n=await e.db.query("work_items").withIndex("by_applicationId_and_nodeId",o=>o.eq("context.applicationId",t.applicationId).eq("context.anchor.nodeId",t.node.id)).take(_b+1);n.length>_b&&D(`countersign node "${t.node.id}" of ${t.applicationId} holds more than ${_b} rows`);let r=n.filter(o=>o.isOpen),i=s(o=>{if(o.context.kind!=="admission")return;let a=o.context.anchor;return"templateKey"in a?a.templateKey:void 0},"templateKeyOf");return r.some(o=>i(o)===yn)?"signatureStalled":r.some(o=>i(o)===Ld)?"countersigning":qd(t.node)?"awaitingSignature":"done"}s(M4,"countersignCurrentState");var IF={[Ob]:{label:ie("Gegenzeichnung","Countersignature"),tone:"teal",phase:{key:"gegenzeichnung",label:ie("Gegenzeichnung","Countersignature"),scope:"node"},external:at(ie("Vertrag unterschrieben","Contract signed"),"blue",ie("Die Schule zeichnet Ihren Vertrag gegen","The school is countersigning your contract"),ie("Vielen Dank f\xFCr Ihre Unterschrift. Sobald die Schule gegengezeichnet hat, finden Sie Ihr Exemplar hier.","Thank you for signing. As soon as the school has countersigned, you will find your copy here."))}},_F={inputs:s(()=>[{id:"dueInDays",label:{de:"Frist der Aufgabe (Tage)",en:"Task due in (days)"},type:"number",inspector:"literal-only"}],"inputs"),role:"user-action",effect:"side-effect",outcomes:[{id:xF,label:{de:"Gegengezeichnet",en:"Countersigned"}}],progressDefaults:IF,progressEvents:Ht(IF),entryProgressEvent:s(()=>Ob,"entryProgressEvent"),notificationEvents:s(()=>[{id:SF,label:{de:"Vertrag gegengezeichnet",en:"Contract countersigned"},audience:"external",required:!0,args:[{key:"applicationId",type:"string",required:!0},{key:"documentTitle",type:"localizedText",required:!0}]}],"notificationEvents"),actions:s(e=>[{id:Ib,kind:"internal",label:AF,surface:mr,availableIn:["countersigning"]},...qd(e)?[{id:ms,kind:"internal",surface:mr,label:{de:"Auf Papier umstellen",en:"Switch to paper"},availableIn:["signatureStalled"]}]:[]],"actions"),workItemTemplates:s(e=>[{key:Ld,recipient:"internal",title:e.titles?.countersign??Ya,unlocks:[Ib],advancesNode:!0,...EF(e)!==void 0?{dueInDays:EF(e)}:{}},...qd(e)?[{key:yn,recipient:"internal",title:RF,unlocks:[ms],gatesNode:!1,advancesNode:!1}]:[]],"workItemTemplates"),placelessTasks:{[Ld]:"Worked in its own step: the contract it countersigns is another node's slot, which this node names by address only.",[yn]:"Worked in its own step (\u201EAuf Papier umstellen\u201C): it is about the Tr\xE4ger's Vorgang, which has no view of its own."},states:TF,currentState:M4,validate:s((e,t,n)=>{let r=[],i=e.label?.de??e.id,o=e.label?.en||e.id;e.assign?.[Ld]===void 0&&r.push(hr(e,"assign",{de:`[countersign/assign] \u201E${i}": wer gegenzeichnet, fehlt \u2014 \`assign.countersign\` nennt das Team.`,en:`[countersign/assign] "${o}": who countersigns is missing \u2014 \`assign.countersign\` names the team.`})),po(e.titles?.countersign)||r.push(hr(e,"titles",{de:`[countersign/missingTitle] \u201E${i}": der Titel der Aufgabe fehlt \u2014 \`titles.countersign\` auf Deutsch und Englisch.`,en:`[countersign/missingTitle] "${o}": the task title is missing \u2014 \`titles.countersign\` in German and English.`}));let l=e.inputs?.dueInDays;l!==void 0&&l.kind!=="unset"&&!(l.kind==="literal"&&typeof l.value=="number"&&Number.isInteger(l.value)&&l.value>=1)&&r.push(hr(e,"inputs.dueInDays",{de:`[countersign/dueInDays] \u201E${i}": dueInDays ist eine ganze Zahl \u2265 1.`,en:`[countersign/dueInDays] "${o}": dueInDays is a whole number \u2265 1.`})),r.push(...D4(e,t,n));let d=e.contract;if(!ke(d))return r;let c=C4(t,e.id,d);if(c.length===0)return r;let u=t.nodes.find(p=>d.scope==="node"&&p.id===d.owner);if(c.includes("sourceNotCheckedContract")&&r.push(hr(e,"contract",{de:`[countersign/sourceNotCheckedContract] \u201E${i}" zeichnet das Dokument von \u201E${u.label?.de??u.id}" (${u.id}) gegen \u2014 gegenzeichnen l\xE4sst sich nur ein erzeugter Vertrag, den die Familie mit verbuchten Unterschriften unterschreibt (governedDocument mit production: resolver und responseStrategy: signedUploadChecked oder eSignature).`,en:`[countersign/sourceNotCheckedContract] "${o}" countersigns the document of "${u.label?.en||u.id}" (${u.id}) \u2014 only a generated contract that the family signs with booked signatures can be countersigned (governedDocument with production: resolver and responseStrategy: signedUploadChecked or eSignature).`})),c.includes("twice")){let p=Gm(t,u.id).filter(h=>h.id!==e.id);r.push(hr(e,"contract",{de:`[countersign/twice] \u201E${i}": \u201E${u.label?.de??u.id}" (${u.id}) wird schon von ${p.map(h=>`"${h.id}"`).join(", ")} gegengezeichnet \u2014 ein Vertrag hat eine Gegenzeichnung.`,en:`[countersign/twice] "${o}": "${u.label?.en||u.id}" (${u.id}) is already countersigned by ${p.map(h=>`"${h.id}"`).join(", ")} \u2014 a contract has one countersignature.`}))}return r},"validate")};function q4(e){return jm(e)?Ua(e):null}s(q4,"traegerSignerOf");var K4=s(e=>e.type==="end"&&ls(e)==="approved","isApprovedEnd");function NF(e){let t=[];for(let n of e.nodes){let r=q4(n);if(r===null)continue;let i=Gm(e,n.id).map(u=>u.id),o=wC(e,n.id,new Set(i),K4);if(o===null)continue;let a=n.label?.de||n.id,l=n.label?.en||n.id,d={de:`Einen Knoten \u201EUnterschrift (intern)\u201C (countersign) mit contract: $node.${n.id}.contract auf jeden Weg zu einem Ende mit Ergebnis approved setzen.`,en:`Place an "Internal signature" node (countersign) with contract: $node.${n.id}.contract on every path to an end with outcome approved.`},c=i.length===0?{de:`[countersign/missingForContract] \u201E${a}\u201C (${n.id}) erzeugt einen Vertrag, den der Tr\xE4ger \u201E${r}\u201C mitunterschreibt, aber keine Gegenzeichnung nennt ihn \u2014 der Vertrag w\xFCrde nie unterschrieben und nie abgerechnet. ${d.de}`,en:`[countersign/missingForContract] "${l}" (${n.id}) generates a contract the legal entity "${r}" co-signs, but no countersignature names it \u2014 the contract would never be signed and never billed. ${d.en}`}:{de:`[countersign/missingForContract] \u201E${a}\u201C (${n.id}): ein Weg erreicht das Ende \u201E${o}\u201C (Ergebnis approved), ohne durch die Gegenzeichnung ${i.map(u=>`\u201E${u}\u201C`).join(", ")} zu laufen \u2014 dort bliebe der Vertrag ohne Unterschrift des Tr\xE4gers \u201E${r}\u201C und w\xFCrde nie abgerechnet. ${d.de}`,en:`[countersign/missingForContract] "${l}" (${n.id}): a path reaches the end "${o}" (outcome approved) without passing the countersignature ${i.map(u=>`"${u}"`).join(", ")} \u2014 there the contract would lack the signature of the legal entity "${r}" and never be billed. ${d.en}`};t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${n.id}`,reason:c,severity:"error"})}return t}s(NF,"checkCountersignCoverage");function zm(e){let t=Ue(e);return e.outcomes&&e.outcomes.length>0?[...e.outcomes]:t.outcomes&&t.outcomes.length>0?[...t.outcomes]:null}s(zm,"nodeOutcomes");function Wm(e,t){let o=new Map;for(let d of e)o.set(d,0);let a=new Map,l=[];for(let d of e){if((o.get(d)??0)!==0)continue;let c=[{id:d,edges:t(d),idx:0}];for(o.set(d,1),a.set(d,null);c.length>0;){let u=c[c.length-1];if(u.idx>=u.edges.length){o.set(u.id,2),c.pop();continue}let{target:p,edge:h}=u.edges[u.idx];u.idx++;let y=o.get(p)??0;if(y===1){let b=[p],k=u.id;for(;k&&k!==p;)b.push(k),k=a.get(k)??null;b.reverse(),l.push({edge:h,source:u.id,target:p,cycle:b})}else y===0&&(o.set(p,1),a.set(p,u.id),c.push({id:p,edges:t(p),idx:0}))}}return l}s(Wm,"detectBackEdges");function Nb(e){let t="error",n=new Map;for(let a of Dn(e.nodes)){let l=n.get(a.source)??[];l.push({id:a.id,target:a.target}),n.set(a.source,l)}let r=[],i=new Set,o=Wm(e.nodes.map(a=>a.id),a=>(n.get(a)??[]).map(({id:l,target:d})=>({target:d,edge:l})));for(let a of o)i.has(a.edge)||(i.add(a.edge),r.push({layer:"GRAPH",kind:"cycle",path:`edge.${a.edge}`,reason:{de:`Zyklus \xFCber Kante ${a.source} \u2192 ${a.target}`,en:`Cycle through edge ${a.source} \u2192 ${a.target}`},severity:t}));return r}s(Nb,"checkAcyclic");function Pb(e){let t=[],n=new Set(e.nodes.map(i=>i.id)),r="error";for(let i of e.nodes){let o=i.next;if(o)for(let[a,l]of Object.entries(o))n.has(l.to)||t.push({layer:"GRAPH",kind:"routing",path:`node.${i.id}.next.${a}`,reason:{de:`${i.label.de}: next.${a} verweist auf nicht-existenten Knoten '${l.to}'`,en:`${i.label.en}: next.${a} points to a node that does not exist: '${l.to}'`},severity:"error"});if(i.type!=="end"&&!(!i.outcomes||i.outcomes.length===0))for(let a of i.outcomes)(!o||!(a.id in o))&&t.push({layer:"GRAPH",kind:"routing",path:`node.${i.id}.outcome.${a.id}`,reason:{de:`${i.label.de}: Outcome '${a.label.de}' fehlt im next-Mapping`,en:`${i.label.en}: outcome '${a.label.en}' is missing from the next mapping`},severity:r})}return t}s(Pb,"checkNextTargets");function Cb(e){let t=[];for(let n of e.nodes){let r=n.next;if(!r)continue;let i=zm(n),o=new Set(i?i.map(a=>a.id):[To]);for(let a of Object.keys(r))o.has(a)||t.push({layer:"GRAPH",kind:"unknownOutcome",path:`node.${n.id}.next.${a}`,reason:{de:`${n.label.de}: next-Schl\xFCssel '${a}' ist kein g\xFCltiges Outcome dieses Knotens (erlaubt: ${[...o].join(", ")}) \u2014 die Kante w\xFCrde im Editor verschwinden`,en:`${n.label.en}: next key '${a}' is not a valid outcome of this node (allowed: ${[...o].join(", ")}) \u2014 the edge would disappear in the editor`},severity:"error"})}return t}s(Cb,"checkNextOutcomesKnown");function Db(e){let t=[],n=new Set(Dn(e.nodes).map(o=>o.target)),r=e.nodes.filter(o=>!n.has(o.id));return r.length===0?t.push({layer:"GRAPH",kind:"startEnd",path:"graph",reason:{de:"Kein Start-Knoten",en:"No start node"},severity:"error"}):r.length>1&&t.push({layer:"GRAPH",kind:"startEnd",path:"graph",reason:{de:`Mehrere Start-Knoten (${r.map(o=>o.label.de).join(", ")})`,en:`Multiple start nodes (${r.map(o=>o.label.en).join(", ")})`},severity:"warning"}),e.nodes.filter(o=>o.type==="end").length===0&&t.push({layer:"GRAPH",kind:"startEnd",path:"graph",reason:{de:"Kein End-Knoten",en:"No end node"},severity:"warning"}),t}s(Db,"checkStartEnd");function Fb(e){let t=new Map;for(let r of Dn(e.nodes))t.set(r.source,(t.get(r.source)??0)+1);let n=[];for(let r of e.nodes)r.type!=="end"&&(t.get(r.id)??0)===0&&n.push({layer:"GRAPH",kind:"startEnd",path:`node.${r.id}`,reason:{de:`${r.label.de}: keine ausgehende Kante`,en:`${r.label.en}: no outgoing edge`},severity:"warning"});return n}s(Fb,"checkNoOutgoingEdge");function Lb(e){return e.nodes.filter(t=>!Qw(t.id)).map(t=>({layer:"GRAPH",kind:"nodeRule",path:`nodes.${t.id}.id`,reason:{de:`[graph/nodeIdFormat] Knoten "${t.id}": eine Knoten-ID ist ein Bezeichner ohne Punkt (${Pr.source}), z. B. "reviewEingereicht". Ein Bundle von vor der Umstellung neu exportieren.`,en:`[graph/nodeIdFormat] Node "${t.id}": a node id is an identifier without a dot (${Pr.source}), e.g. "reviewSubmitted". Export a bundle from before the change again.`},severity:"error"}))}s(Lb,"checkNodeIdFormat");function Mb(e){let t=new Set(e.nodes.map(r=>r.id)),n=[];for(let r of Dn(e.nodes))t.has(r.source)||n.push({layer:"GRAPH",kind:"startEnd",path:`edge.${r.id}`,reason:{de:`Kante ${r.id}: Quelle '${r.source}' nicht gefunden`,en:`Edge ${r.id}: source '${r.source}' not found`},severity:"error"}),t.has(r.target)||n.push({layer:"GRAPH",kind:"startEnd",path:`edge.${r.id}`,reason:{de:`Kante ${r.id}: Ziel '${r.target}' nicht gefunden`,en:`Edge ${r.id}: target '${r.target}' not found`},severity:"error"});return n}s(Mb,"checkEdgeEndpoints");function PF(e){let t=[];for(let n of e.nodes)for(let r of n.tasks??[]){let i=r.result;i===null||typeof i!="object"||!(_m in i)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${n.id}.tasks.${r.key}.result.${_m}`,reason:{de:`[graph/retiredField] Aufgabe "${r.key}": \`primaryHostTeams\` hei\xDFt jetzt \`primaryParticipantTeams\` \u2014 der alte Name wird nicht mehr gelesen, die Teilnehmer-Auswahl zeigt die Teams nicht oben. Bitte umbenennen.`,en:`[graph/retiredField] Task "${r.key}": \`primaryHostTeams\` is now called \`primaryParticipantTeams\` \u2014 the old name is no longer read, so the participant picker does not list the teams first. Please rename it.`},severity:"error"})}return t}s(PF,"checkRenamedFields");var j4=new Set(["countersignature"]);function CF(e){let t=[],n=s((o,a)=>{t.push({layer:"GRAPH",kind:"nodeRule",path:o,reason:{de:`[graph/retiredField] ${a.de}`,en:`[graph/retiredField] ${a.en}`},severity:"error"})},"retired"),r={de:"Preise rechnet der Vertragsgenerator (`prices`), nicht der Workflow \u2014 binde Rang und Reduktion an seine Eing\xE4nge.",en:"Prices are computed by the contract generator (`prices`), not the workflow \u2014 bind rank and reduction to its inputs."},i=e;"pricingRules"in i&&n("pricingRules",r);for(let[o,a]of(Array.isArray(i.processStore)?i.processStore:[]).entries())for(let l of["derive","absentValue"])a!==null&&typeof a=="object"&&l in a&&n(`processStore.${o}.${l}`,r);for(let o of e.nodes)for(let a of o.tasks??[]){let l=a.result;l!==null&&typeof l=="object"&&"prices"in l&&n(`nodes.${o.id}.tasks.${a.key}.result.prices`,r)}for(let o of e.nodes){let a=o,l={de:`Knoten \u201E${Pe(e,o.id,"de")}\u201C (${o.id})`,en:`Node "${Pe(e,o.id,"en")}" (${o.id})`};for(let[c,u]of Object.entries(a.next??{}))u!==null&&typeof u=="object"&&"emits"in u&&n(`nodes.${o.id}.next.${c}.emits`,{de:`${l.de}: \`next.${c}.emits\` gibt es nicht mehr \u2014 ein Ausgang routet nur; ein Knoten liest Daten \xFCber Adressen in seinen eigenen Feldern.`,en:`${l.en}: \`next.${c}.emits\` no longer exists \u2014 an outcome only routes; a node reads data through addresses in its own fields.`});for(let c of Array.isArray(a.outcomes)?a.outcomes:[])c!==null&&typeof c=="object"&&"emits"in c&&n(`nodes.${o.id}.outcomes.${String(c.id)}.emits`,{de:`${l.de}: \`emits\` am Ausgang "${String(c.id)}" gibt es nicht mehr \u2014 ein Knoten liest Daten \xFCber Adressen in seinen eigenen Feldern.`,en:`${l.en}: \`emits\` on the outcome "${String(c.id)}" no longer exists \u2014 a node reads data through addresses in its own fields.`});"targetFormNodeId"in a&&n(`nodes.${o.id}.targetFormNodeId`,{de:`${l.de}: \`targetFormNodeId\` gibt es nicht mehr \u2014 welches Formular freigeschaltet wird, sagt die Adresse, an die der Eingang \`inputs.target\` gebunden ist ($node.<formular>.admission).`,en:`${l.en}: \`targetFormNodeId\` no longer exists \u2014 the address the input \`inputs.target\` is bound to says which form is unlocked ($node.<form>.admission).`}),"wires"in a&&n(`nodes.${o.id}.wires`,{de:`${l.de}: Datenkanten (\`wires\`) gibt es nicht mehr \u2014 jedes Feld, das Daten eines anderen Knotens liest, tr\xE4gt selbst die volle Adresse ($node.\u2026, $task.\u2026, $env.\u2026).`,en:`${l.en}: data edges (\`wires\`) no longer exist \u2014 every field that reads data of another node carries the full address itself ($node.\u2026, $task.\u2026, $env.\u2026).`});for(let[c,u]of Object.entries(a.inputs??{}))u!==null&&typeof u=="object"&&u.kind==="binding"&&"path"in u&&n(`nodes.${o.id}.inputs.${c}.path`,{de:`${l.de}: Der Eingang \u201E${c}\u201C ist \xFCber einen Pfad (\`path\`) gebunden \u2014 eine Bindung tr\xE4gt die volle Adresse (\`address\`) dessen, was sie liest.`,en:`${l.en}: The input "${c}" is bound through a path (\`path\`) \u2014 a binding carries the full address (\`address\`) of what it reads.`});o.type==="governedDocument"&&"resolver"in a&&n(`nodes.${o.id}.resolver`,{de:`${l.de}: \`resolver\` gibt es nicht mehr \u2014 der Generator ist der Eingang \`inputs.contractGenerator\` ({ kind, key }), seine Parameter stempelt die Plattform (\`generatorStamp\`), ein im Cockpit erg\xE4nzter Parameter ist sein Eingang \`{ kind: "cockpit" }\`.`,en:`${l.en}: \`resolver\` no longer exists \u2014 the generator is the input \`inputs.contractGenerator\` ({ kind, key }), the platform stamps its parameters (\`generatorStamp\`), a parameter completed in the cockpit is its input \`{ kind: "cockpit" }\`.`});let d=a.template;if(o.type==="governedDocument"&&d!==null&&typeof d=="object")for(let c of["key","cockpitFields"])c in d&&n(`nodes.${o.id}.template.${c}`,{de:`${l.de}: \`template.${c}\` gibt es nicht mehr \u2014 ${c==="key"?"die Vorlage ist der Eingang `inputs.documentTemplate`":'ein im Cockpit erg\xE4nzter Parameter ist sein Eingang `{ kind: "cockpit" }`'}.`,en:`${l.en}: \`template.${c}\` no longer exists \u2014 ${c==="key"?"the template is the input `inputs.documentTemplate`":'a parameter completed in the cockpit is its input `{ kind: "cockpit" }`'}.`});if(o.type==="setFlag")for(let c of["target","flagKey","value"])c in a&&n(`nodes.${o.id}.${c}`,{de:`${l.de}: \`${c}\` gibt es am setFlag-Knoten nicht mehr \u2014 Formular, Merkmal und Wert sind die Eing\xE4nge \`inputs.target\` (gebunden an die Adresse $node.<formular>.admission), \`inputs.flagKey\` und \`inputs.value\` (feste Werte).`,en:`${l.en}: \`${c}\` no longer exists on a setFlag node \u2014 form, flag and value are the inputs \`inputs.target\` (bound to the address $node.<form>.admission), \`inputs.flagKey\` and \`inputs.value\` (literals).`});for(let c of Object.keys(Ck[o.type]??{}))c in a&&n(`nodes.${o.id}.${c}`,{de:`${l.de}: \`${c}\` gibt es als Knoteneigenschaft nicht mehr \u2014 es ist der Eingang \`inputs.${c}\` (ein fester Wert im Parameter-Bereich).`,en:`${l.en}: \`${c}\` no longer exists as a node property \u2014 it is the input \`inputs.${c}\` (a fixed value among the parameters).`});for(let c of Array.isArray(a.tasks)?a.tasks:[]){if(c===null||typeof c!="object")continue;let u=String(c.key),p=c.assign;p!==null&&typeof p=="object"&&"userId"in p&&n(`nodes.${o.id}.tasks.${u}.assign.userId`,{de:`Aufgabe "${u}" an ${l.de}: \`assign.userId\` gibt es nicht mehr \u2014 eine Aufgabe nennt ihr Team (\`assign.group\`), nie eine feste Person.`,en:`Task "${u}" on ${l.en}: \`assign.userId\` no longer exists \u2014 a task names its team (\`assign.group\`), never a fixed person.`});for(let[h,y]of Object.entries(xb))h in c&&n(`nodes.${o.id}.tasks.${u}.${h}`,y(u,l))}for(let c of Dk[o.type]??[])c in a&&n(`nodes.${o.id}.${c}`,{de:`${l.de}: \`${c}\` gibt es nicht mehr \u2014 dieser Knotentyp liest es nicht.`,en:`${l.en}: \`${c}\` no longer exists \u2014 this node type does not read it.`});for(let[c,u]of Object.entries(MP[o.type]??{}))c in a&&n(`nodes.${o.id}.${c}`,{de:`${l.de}: ${u.de}`,en:`${l.en}: ${u.en}`});a.adoptForm===!0&&n(`nodes.${o.id}.adoptForm`,{de:`${l.de}: \`adoptForm: true\` gibt es nicht mehr \u2014 \`adoptForm\` ist die Adresse des \xFCbernommenen Formulars ($node.<anlegender Formularknoten>.admission).`,en:`${l.en}: \`adoptForm: true\` no longer exists \u2014 \`adoptForm\` is the address of the adopted form ($node.<creating form node>.admission).`});for(let c of Array.isArray(a.tasks)?a.tasks:[]){let u=c?.result?.kind;typeof u=="string"&&j4.has(u)&&n(`nodes.${o.id}.tasks.${String(c.key)}.result`,{de:`Aufgabe "${String(c.key)}" an ${l.de}: das Ergebnis \u201E${u}" gibt es nicht mehr \u2014 die Gegenzeichnung ist der Knotentyp \u201EUnterschrift (intern)" (countersign).`,en:`Task "${String(c.key)}" on ${l.en}: the result "${u}" no longer exists \u2014 the countersignature is the node type "Signature (internal)" (countersign).`})}}return t}s(CF,"checkRetiredDataFields");function qb(e){let t=new Set(cP()),n=[];for(let r of e.nodes)t.has(r.type)||n.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.type`,reason:{de:`[graph/unknownNodeType] Knoten "${r.id}" hat den unbekannten Typ "${String(r.type)}". Registrierte Typen: ${[...t].join(", ")}.`,en:`[graph/unknownNodeType] Node "${r.id}" has the unknown type "${String(r.type)}". Registered types: ${[...t].join(", ")}.`},severity:"error"});return n}s(qb,"checkKnownNodeTypes");function ks(e,t){return t?.wiring&&t.layout?{wiring:t.wiring,layout:t.layout}:null}s(ks,"resolveLayoutContext");function Kb(e,t){let n=ks(e,t);if(!n)return e.nodes.some(o=>(Ue(o)?.progressEvents?.length??0)>0)?[{layer:"GRAPH",kind:"progressState",path:"graph.progressWiring",reason:{de:`Graph emittiert Progress-Events, aber (Layout, Wiring) konnte nicht aufgel\xF6st werden (Wiring ${t?.wiring?"vorhanden":"fehlt"}, Layout ${t?.layout?"vorhanden":"fehlt"}) \u2014 der Engine wirft beim Spiegeln zur Laufzeit. Der Workflow-Entwurf muss progressLayout und progressWiring tragen.`,en:`The graph emits progress events, but (layout, wiring) could not be resolved (wiring ${t?.wiring?"present":"missing"}, layout ${t?.layout?"present":"missing"}) \u2014 the engine throws at runtime when mirroring. The workflow draft must carry progressLayout and progressWiring.`},severity:"error"}]:[];let r=[];for(let i of e.nodes){let a=Ue(i)?.progressEvents;if(a)for(let l of a){let d=as(n.wiring,{id:i.id,type:i.type},l);if(!d){r.push({layer:"GRAPH",kind:"progressState",path:`node.${i.id}.progressEvents.${l}`,reason:{de:`${i.type} '${i.id}': Progress-Event '${l}' ist im Wiring (Layout '${n.layout.id}') keinem (Bus, State) zugeordnet \u2014 der Engine wirft beim Spiegeln`,en:`${i.type} '${i.id}': progress event '${l}' is not mapped to any (bus, state) in the wiring (layout '${n.layout.id}') \u2014 the engine throws when mirroring`},severity:"error"});continue}let c;try{c=hm(n.layout,d.bus)}catch{r.push({layer:"GRAPH",kind:"progressState",path:`node.${i.id}.progressEvents.${l}`,reason:{de:`${i.type} '${i.id}': Event '${l}' verweist auf unbekannten Bus '${d.bus}' im Layout '${n.layout.id}'`,en:`${i.type} '${i.id}': event '${l}' points to unknown bus '${d.bus}' in layout '${n.layout.id}'`},severity:"error"});continue}Td(c,d.state)||r.push({layer:"GRAPH",kind:"progressState",path:`node.${i.id}.progressEvents.${l}`,reason:{de:`${i.type} '${i.id}': Event '${l}' verweist auf State '${d.state}', der nicht im Bus '${d.bus}' deklariert ist`,en:`${i.type} '${i.id}': event '${l}' points to state '${d.state}', which is not declared in bus '${d.bus}'`},severity:"error"})}}return r}s(Kb,"checkProgressEventMappings");function jb(e,t){let n=ks(e,t);if(!n)return[];let r=[];for(let i of n.layout.buses){if(!i.boards||i.boards.length===0)continue;let o=new Set(i.unboarded??[]),a=new Set;for(let l of i.boards)for(let d of l.columns)for(let c of d.states)a.add(c),Td(i,c)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.board.${l.id}.column.${d.id}.${c}`,reason:{de:`Board '${l.id}', Spalte '${d.id}' referenziert State '${c}', der nicht im Bus '${i.key}' deklariert ist`,en:`Board '${l.id}', column '${d.id}' references state '${c}', which is not declared in bus '${i.key}'`},severity:"error"});for(let l of i.states)a.has(l.id)||o.has(l.id)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.${l.id}`,reason:{de:`State '${l.id}' (${l.label.de}) erscheint in keiner Board-Spalte und nicht in 'unboarded' \u2014 nicht darstellbar`,en:`State '${l.id}' (${l.label.en}) appears in no board column and not in 'unboarded' \u2014 it cannot be displayed`},severity:"error"})}return r}s(jb,"checkProgressBoardCoverage");function Vb(e,t){let n=ks(e,t);if(!n)return[];let r=[];for(let i of n.layout.buses)if(!(!i.boards||i.boards.length===0))for(let o of i.boards)for(let a of We){let l=new Map;for(let d of o.columns){if(!po(d.label))continue;let c=d.label[a],u=c.trim().toLocaleLowerCase(a),p=l.get(u);if(p===void 0){l.set(u,d.id);continue}r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.board.${o.id}.column.${d.id}.label.${a}`,reason:{de:`Board '${o.id}' hat zwei Spalten mit dem Label '${c}' (${a}) ('${p}' und '${d.id}') \u2014 f\xFCr Lesende nicht unterscheidbar. F\xFChre die Spalten zusammen (states beider in EINE Spalte) oder vergib unterschiedliche Labels.`,en:`Board '${o.id}' has two columns with the label '${c}' (${a}) ('${p}' and '${d.id}') \u2014 readers cannot tell them apart. Merge the columns (put the states of both into ONE column) or give them different labels.`},severity:"error"})}}return r}s(Vb,"checkProgressBoardDistinctLabels");function Bb(e,t){let n=ks(e,t);if(!n)return[];let r=[];for(let i of n.layout.buses)for(let o of i.states){let a=gm(i,o.id);o.terminal&&!a&&r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.${o.id}.terminalSemantics`,reason:{de:`Terminal-State '${o.id}' hat keine Terminal-Semantik im Bus '${i.key}' \u2014 der Engine wirft beim Versiegeln`,en:`Terminal state '${o.id}' has no terminal semantics in bus '${i.key}' \u2014 the engine throws when sealing`},severity:"error"}),!o.terminal&&a&&r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.${o.id}.terminalSemantics`,reason:{de:`State '${o.id}' ist nicht terminal, hat aber Terminal-Semantik im Bus '${i.key}' \u2014 Inkonsistenz`,en:`State '${o.id}' is not terminal but has terminal semantics in bus '${i.key}' \u2014 inconsistent`},severity:"error"})}return r}s(Bb,"checkProgressTerminalSemantics");function Ub(e,t){let n=ks(e,t);if(!n)return[];let r=[];for(let i of n.layout.buses){let o=new Set(i.holdsSeat??[]);for(let a of i.holdsSeat??[])Td(i,a)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.holdsSeat.${a}`,reason:{de:`holdsSeat referenziert '${a}', das kein State im Bus '${i.key}' ist`,en:`holdsSeat references '${a}', which is not a state in bus '${i.key}'`},severity:"error"});for(let a of i.commitsSeat??[])Td(i,a)?o.has(a)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.commitsSeat.${a}`,reason:{de:`commitsSeat '${a}' ist nicht in holdsSeat \u2014 ein fest belegter Platz muss auch belegt sein`,en:`commitsSeat '${a}' is not in holdsSeat \u2014 a firmly committed seat must also be held`},severity:"error"}):r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.commitsSeat.${a}`,reason:{de:`commitsSeat referenziert '${a}', das kein State im Bus '${i.key}' ist`,en:`commitsSeat references '${a}', which is not a state in bus '${i.key}'`},severity:"error"});for(let[a,l]of Object.entries(i.terminalSemantics??{}))l.outcome==="approved"&&(o.has(a)||r.push({layer:"GRAPH",kind:"progressState",path:`layout.${n.layout.id}.bus.${i.key}.holdsSeat`,reason:{de:`Endzustand '${a}' schlie\xDFt den Prozess positiv ab (outcome 'approved'), steht aber nicht in holdsSeat \u2014 damit z\xE4hlt er als Absage und f\xE4llt aus dem Fortschrittsbalken. Nimm '${a}' in holdsSeat (und in commitsSeat, wenn der Platz damit wirklich belegt ist) auf.`,en:`Final state '${a}' ends the process positively (outcome 'approved'), but is not in holdsSeat \u2014 so it counts as a rejection and drops out of the progress bar. Add '${a}' to holdsSeat (and to commitsSeat, if the seat is really taken by it).`},severity:"error"}))}return r}s(Ub,"checkProgressSeatStates");var Ym={de:"Abhilfe: nach dem Formularknoten einen review-Knoten einf\xFCgen und dessen 'reviewing' auf diesen Zustand mappen",en:"Remedy: insert a review node after the form node and map its 'reviewing' to this state"};function DF(e,t,n){let r=new Map(e.nodes.map(y=>[y.id,y])),i=new Set(Dn(e.nodes).map(y=>y.target)),o=e.nodes.filter(y=>!i.has(y.id)),a=o.some(y=>y.type==="eventTrigger"),l=s(y=>Object.values(y.next??{}).map(b=>b.to),"routesOf"),d=[],c=s((y,b,k)=>{let v=r.get(y);if(!v||k.has(y)){d.push({at:y,state:null});return}let T=new Set([...k,y]);if(a&&o.includes(v)&&v.type!=="eventTrigger")return;if(v.type==="eventTrigger"&&o.includes(v)){let F=v.next?.[zn]?.to;F===void 0?d.push({at:y,state:null}):c(F,b,T);return}let $=Ue(v);if(Kd[v.type]===!1){if(Ue(v).progressEvents?.length){d.push({at:y,state:null});return}let F=l(v);F.length===0&&d.push({at:y,state:null});for(let N of F)c(N,b,T);return}let I=$.entryProgressEvent?.(v),C=b;if(I!==void 0){let F=as(t,v,I);F?.bus==="process"&&(C=F.state)}if($.advancesAtEntry?.(v)===!0)for(let F of l(v))c(F,b,T);d.push({at:y,state:C})},"walk");for(let y of o)c(y.id,null,new Set);let u=d.map(y=>`'${y.at}'${y.state===null?"":` \u2192 '${y.state}'`}`),p=d.map(y=>y.state===null?null:n.columns.find(b=>b.states.includes(y.state))?.id??null);if(p.length===0||p.includes(null))return{kind:"none",landings:u};let h=[...new Set(p)];return h.length>1?{kind:"many",columnIds:h,landings:u}:{kind:"one",columnId:h[0]}}s(DF,"startColumnOf");function Gb(e,t){let n=ks(e,t);if(!n)return[];if(!n.layout.buses.some(l=>l.key==="process"))return[];let r=eb(n.layout);if(!r)return[];let i=DF(e,n.wiring,r);if(i.kind==="one"){let l=r.columns.find(d=>d.id===i.columnId);return l.defaultCollapsed!==!0&&!TC(l)?[]:[{layer:"GRAPH",kind:"progressState",path:`progressLayout.process.boards.${r.id}.columns.${l.id}`,reason:{de:`[progress/startColumnHidden] Neue Vorg\xE4nge landen in Spalte '${l.id}' (Board '${r.id}'), die ${l.defaultCollapsed===!0?"eingeklappt":"die Warteliste"} ist \u2014 dort w\xE4re das Plus zum Hinzuf\xFCgen nicht zu sehen.`,en:`[progress/startColumnHidden] New applications land in column '${l.id}' (board '${r.id}'), which is ${l.defaultCollapsed===!0?"collapsed":"the waitlist"} \u2014 the add plus would not show there.`},severity:"error"}]}let o=i.landings.join(", "),a=i.kind==="none"?{de:`[progress/startColumnNone] Ein neuer Vorgang landet auf keiner Spalte des Boards '${r.id}' (Start endet bei ${o}) \u2014 ordne den Zustand, mit dem er anh\xE4lt, einer Spalte zu.`,en:`[progress/startColumnNone] A new application lands in no column of board '${r.id}' (the start stops at ${o}) \u2014 put the state it parks with into a column.`}:{de:`[progress/startColumnAmbiguous] Ein neuer Vorgang kann in mehreren Spalten des Boards '${r.id}' landen (${i.columnIds.join(", ")}; Start endet bei ${o}) \u2014 das Plus zum Hinzuf\xFCgen braucht genau eine Startspalte.`,en:`[progress/startColumnAmbiguous] A new application can land in several columns of board '${r.id}' (${i.columnIds.join(", ")}; the start stops at ${o}) \u2014 the add plus needs exactly one start column.`};return[{layer:"GRAPH",kind:"progressState",path:`progressLayout.process.boards.${r.id}`,reason:a,severity:"error"}]}s(Gb,"checkProgressStartColumn");function V4(e){return e==="both"?{de:`${Ym.de} \u2014 die Spalte ist auch der Schritt, den die Familie sieht; den Zustand in die Spalte des Nachfolgers zu legen, n\xE4hme ihr diesen Schritt.`,en:`${Ym.en} \u2014 the column is also the step the family sees; moving the state into the successor's column would take that step away from them.`}:{de:`${Ym.de}, oder den Zustand in die Spalte des Nachfolgers legen.`,en:`${Ym.en}, or move the state into the successor's column.`}}s(V4,"passThroughRemedy");function zb(e,t){let n=ks(e,t);if(!n)return[];let{layout:r,wiring:i}=n;if(!r.buses.some(v=>v.key==="process"))return[];let o=eb(r);if(!o)return[];let a=new Map(e.nodes.map(v=>[v.id,v])),l=s(v=>Ue(v).progressEvents??[],"eventsOf"),d=s(v=>Object.values(v.next??{}).map(T=>T.to),"routesOf"),c=s((v,T)=>{let $=a.get(v);if(!$||T.has(v))return null;if(l($).length>0)return[$];if(Kd[$.type]!==!1)return null;let I=d($);if(I.length===0)return null;let C=[];for(let F of I){let N=c(F,new Set([...T,v]));if(!N)return null;C.push(...N)}return C},"firstProgressNodes"),u=s((v,T)=>{let $=[];for(let I of l(v)){let C=as(i,v,I);if(!C||C.bus!==T.bus||C.state===T.state)return null;$.push(C.state)}return[...new Set($)].join("' / '")},"overwrites"),p=s((v,T)=>{let $=d(v);if($.length===0)return null;let I=[];for(let C of $){let F=c(C,new Set([v.id]));if(!F)return null;for(let N of F){let M=u(N,T);if(M===null)return null;I.push({de:`'${N.id}' (${N.type}) mit '${M}'`,en:`'${N.id}' (${N.type}) with '${M}'`})}}return[...new Map(I.map(C=>[C.de,C])).values()]},"submitOverwrittenBy"),h=new Map;for(let v of e.nodes)for(let T of l(v)){let $=as(i,v,T);if(!$||$.bus!=="process")continue;let I=v.type==="form"&&T===_p?p(v,$):null,C=I?{de:`'${v.id}'.${T} erreicht ihn, und ${I.map(F=>F.de).join(", ")} \xFCberschreibt ihn in derselben Transaktion`,en:`'${v.id}'.${T} reaches it, and ${I.map(F=>F.en).join(", ")} overwrites it in the same transaction`}:null;h.set($.state,[...h.get($.state)??[],C])}let y=hm(r,"process"),b=new Map;for(let[v,T]of h){if(!T.every(I=>I!==null))continue;let $=[...new Map(T.map(I=>[I.de,I])).values()];b.set(v,{de:$.map(I=>I.de).join("; "),en:$.map(I=>I.en).join("; ")})}let k=[];for(let v of o.columns){if(v.states.length===0||!v.states.every(I=>b.has(I)))continue;let T=v.states.map(I=>{let C=y.holdsSeat?.includes(I)===!0,F=b.get(I);return{de:`Zustand '${I}'${C?" (steht in holdsSeat, belegt aber nie einen Platz)":""}: ${F.de}`,en:`State '${I}'${C?" (is in holdsSeat, but never takes a seat)":""}: ${F.en}`}}),$=V4(o.audience);k.push({layer:"GRAPH",kind:"progressState",path:`progressLayout.process.boards.${o.id}.columns.${v.id}`,reason:{de:`[progress/passThroughState] Spalte \u201E${v.label.de}" ('${v.id}', Board '${o.id}') bleibt immer leer \u2014 ${T.map(I=>I.de).join("; ")}. ${$.de}`,en:`[progress/passThroughState] Column "${v.label.en}" ('${v.id}', board '${o.id}') always stays empty \u2014 ${T.map(I=>I.en).join("; ")}. ${$.en}`},severity:"warning"})}return k}s(zb,"checkProgressPassThroughColumns");var Kd={form:!0,decision:!0,review:!0,waitlist:!0,completenessCheck:!0,collectPayment:!0,eventTrigger:!0,join:!1,roleAssign:!1,setFlag:!1,if:!1,end:!1,countersign:!0,engagePush:!1,governedDocument:!0};function B4(e){return e.kind==="task"&&!("title"in e)}s(B4,"isLegacyFreeTodoContext");function Wb(e){let{context:t}=e;if(B4(t)&&D(`[workItems/legacyFreeTodo] work_item ${e._id} is a free to-do in its former shape \u2014 run migrations:freeTodosToContext`),t.kind==="task")return{...e,context:t,kind:"task",createdVia:"human",partyId:t.partyId};let{anchor:n,task:r,kind:i,title:o,description:a,...l}=t,d=n.scope==="node"?{nodeId:n.nodeId,templateKey:n.templateKey,gatesNode:n.gatesNode,blocks:n.blocks}:n.scope==="application"?{scope:"application",templateKey:n.templateKey}:n.scope==="crossNode"?{scope:"application",nodeId:n.nodeId,templateKey:n.templateKey,blocks:n.blocks}:{};return{...e,context:t,...l,...d,...r??{},kind:i}}s(Wb,"readWorkItem");async function Ja(e,t){let n;if(t.nodeId!==void 0){let r=t.nodeId;n=await e.db.query("work_items").withIndex("by_applicationId_and_nodeId",i=>i.eq("context.applicationId",t.applicationId).eq("context.anchor.nodeId",r)).collect()}else if(t.isOpen!==void 0){let r=t.isOpen;n=await e.db.query("work_items").withIndex("by_applicationId_and_isOpen",i=>i.eq("context.applicationId",t.applicationId).eq("isOpen",r)).collect()}else n=await e.db.query("work_items").withIndex("by_applicationId_and_nodeId",r=>r.eq("context.applicationId",t.applicationId)).collect();return n.filter(r=>t.isOpen===void 0||r.isOpen===t.isOpen).map(Wb)}s(Ja,"listWorkItemsForApplication");var hxe=m.union(m.literal("approved"),m.literal("rejected")),jd=new Set(["task","approval"]);function G4(e,t){switch(e){case"task":return t?.gatesNode===!0&&D("expandComposedTask: gatesNode is approval-only \u2014 a 'task' template never gates its node (use blocks to hold a gating sibling back)"),{kind:"task",recipient:"internal",gatesNode:!1};case"approval":return{kind:"approval",recipient:"internal",isApproval:!0,gatesNode:t?.gatesNode??!0};default:D(`expandComposedTask: unknown composed-task kind ${JSON.stringify(e)} \u2014 authorable: ${[...jd].join(", ")}`)}}s(G4,"expandComposedTask");for(let e of["task","approval"]){let t=G4(e);t.kind==="approval"!=(t.isApproval===!0)&&D(`composed-task kind "${e}": isApproval must be present iff kind === 'approval'`)}function Yb(e){let t=["workItems","workitems","work_items","taskTemplates"],n=[];for(let r of e.nodes){let i=r;for(let o of t){let a=i[o];a!=null&&n.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.${o}`,reason:{de:`[workItems/misnamedTasksKey] Knoten "${r.id}" deklariert "${o}" \u2014 komponierte Aufgaben werden ausschlie\xDFlich unter "tasks" gelesen. So wie es dasteht, w\xFCrde die Aufgabenkette stillschweigend nie entstehen. Benenne den Schl\xFCssel in "tasks" um.`,en:`[workItems/misnamedTasksKey] Node "${r.id}" declares "${o}" \u2014 composed tasks are read only from "tasks". As it stands, the task chain would silently never be created. Rename the key to "tasks".`},severity:"error"})}}return n}s(Yb,"checkMisnamedTasksKey");function Hb(e){let t=[];for(let n of e.nodes){let r=n,i=Array.isArray(r.tasks)?r.tasks:[],o=new Set;for(let c of i){let u=typeof c.key=="string"?c.key:void 0;u!==void 0&&(o.has(u)&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}`,reason:{de:`[workItems/duplicateTemplateKey] Doppelter Template-Key "${u}" auf Knoten "${r.id}".`,en:`[workItems/duplicateTemplateKey] Duplicate template key "${u}" on node "${r.id}".`},severity:"error"}),o.add(u))}let a=new Set;for(let c of Array.isArray(r.artifacts)?r.artifacts:[])typeof c.key=="string"&&a.add(`${c.key}Uploaded`);let l=Ue(n),d=new Map((typeof l.workItemTemplates=="function"?l.workItemTemplates(n):[]).map(c=>[c.key,c]));for(let c of i){let u=typeof c.key=="string"?c.key:"?",p=typeof c.kind=="string"?c.kind:void 0;if(p===void 0||!jd.has(p)){t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.kind`,reason:{de:`[workItems/invalidKind] Task "${u}" auf Knoten "${r.id}" hat Art ${JSON.stringify(c.kind)}; komponierbar sind: ${[...jd].join(", ")}.`,en:`[workItems/invalidKind] Task "${u}" on node "${r.id}" has kind ${JSON.stringify(c.kind)}; composable kinds are: ${[...jd].join(", ")}.`},severity:"error"});continue}p==="task"&&c.gatesNode!==void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.gatesNode`,reason:{de:`[workItems/gatesNodeOnTask] 'gatesNode' ist nur f\xFCr die Art 'approval' zul\xE4ssig \u2014 eine Task gated ihren Knoten nie direkt. Um eine gatende Freigabe zur\xFCckzuhalten, 'blocks' verwenden (Task "${u}" auf Knoten "${r.id}").`,en:`[workItems/gatesNodeOnTask] 'gatesNode' is only allowed for the kind 'approval' \u2014 a task never gates its node directly. To hold back a gating approval, use 'blocks' (task "${u}" on node "${r.id}").`},severity:"error"});let h=c.blocks,y=h===void 0?void 0:YD(e,r.id,h.node);if(h!==void 0&&y===null)t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.node`,reason:{de:`[workItems/blocksUnknownNode] 'blocks.node' auf Task "${u}" (Knoten "${r.id}") nennt ${JSON.stringify(h.node)} \u2014 diesen Knoten gibt es im Workflow nicht.`,en:`[workItems/blocksUnknownNode] 'blocks.node' on task "${u}" (node "${r.id}") names ${JSON.stringify(h.node)} \u2014 there is no such node in the workflow.`},severity:"error"});else if(h!==void 0&&y!==void 0&&y!==null){let k=y.node.id===r.id,v=y.node.id,T=k?o:y.composedKeys,$=k?d:y.intrinsicByKey,I=y.node.assign??{};p==="approval"&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks`,reason:{de:`[workItems/blocksOnApproval] 'blocks' ist auf der Art 'approval' verboten \u2014 nur Task-Zeilen d\xFCrfen einen Geschwister-Spawn zur\xFCckhalten (Approval "${u}" auf Knoten "${r.id}").`,en:`[workItems/blocksOnApproval] 'blocks' is forbidden on the kind 'approval' \u2014 only task rows may hold back a sibling spawn (approval "${u}" on node "${r.id}").`},severity:"error"});let C=h.templateKey,F=[...new Set([...T,...$.keys()])].filter(M=>!k||M!==u).join(", "),N={de:F||"keine",en:F||"none"};if(typeof C!="string"||k&&C===u||!T.has(C)&&!$.has(C))t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.templateKey`,reason:{de:`[workItems/blocksUnknownTarget] 'blocks' muss ein Template auf dem Zielknoten benennen \u2014 komponiert ODER intrinsisch (nie sich selbst, nie ohne 'templateKey': die zielfreie Form geh\xF6rt der Maschine, nicht dem Autor). Ziel ${JSON.stringify(C)} auf Knoten "${v}"; zul\xE4ssige Ziele: ${N.de}.`,en:`[workItems/blocksUnknownTarget] 'blocks' must name a template on the target node \u2014 composed OR intrinsic (never itself, never without 'templateKey': the target-less form belongs to the engine, not the author). Target ${JSON.stringify(C)} on node "${v}"; allowed targets: ${N.en}.`},severity:"error"});else if(y.refuse(C)!==null)t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.templateKey`,reason:y.refuse(C),severity:"error"});else{let M=$.get(C);h.except!==void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.except`,reason:{de:`[workItems/blocksExceptRetired] 'blocks.except' auf Task "${u}" (Knoten "${r.id}") gibt es nicht mehr: eine blockierende Aufgabe sperrt die ganze Aktionsgruppe ihres Ziels (bei einer Entscheidung Freigeben, Warteliste, Ablehnen und das Nachr\xFCcken). 'except' entfernen.`,en:`[workItems/blocksExceptRetired] 'blocks.except' on task "${u}" (node "${r.id}") no longer exists: a blocking task locks the whole action group of its target (for a decision: approve, waitlist, reject and promote). Remove 'except'.`},severity:"error"}),M!==void 0&&M.recipient!=="external"&&M.verdictResolved!==!0&&I[C]===void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.blocks.templateKey`,reason:{de:`[workItems/blocksUnwiredTarget] Task "${u}" auf Knoten "${r.id}" h\xE4lt "${C}" (Knoten "${v}") zur\xFCck, aber der Knoten weist "${C}" keiner Gruppe zu \u2014 ohne 'assign.${C}' entsteht diese Zeile nie: kein Team bekommt die zur\xFCckgehaltene Arbeit, niemand au\xDFer der verantwortlichen Person kann sie tun. Entweder 'assign.${C}' erg\xE4nzen oder das 'blocks' entfernen.`,en:`[workItems/blocksUnwiredTarget] Task "${u}" on node "${r.id}" holds back "${C}" (node "${v}"), but the node assigns "${C}" to no group \u2014 without 'assign.${C}' this row is never created: no team receives the held-back work, and nobody except the responsible person can do it. Either add 'assign.${C}' or remove the 'blocks'.`},severity:"error"})}}{let k=c.completableIf;if(typeof k=="string"&&k.trim().length>0){let v=k.trim().replace(/^!/,"").trim();a.has(v)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.completableIf`,reason:{de:`[workItems/unknownExport] completableIf "${k}" verweist auf unbekannten Node-Export "${v}"; bekannt: ${[...a].join(", ")||"keine"}.`,en:`[workItems/unknownExport] completableIf "${k}" refers to unknown node export "${v}"; known: ${[...a].join(", ")||"none"}.`},severity:"error"})}}let b=c.params;if(b?.commentRequired!==void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.params.commentRequired`,reason:{de:"[workItems/removedParam] 'params.commentRequired' wurde entfernt \u2014 Kommentar-Pflichten werden am Decision-Node ('commentRequired') autorisiert.",en:"[workItems/removedParam] 'params.commentRequired' was removed \u2014 comment requirements are authored on the decision node ('commentRequired')."},severity:"error"}),p!=="approval"){let k=[];b?.onReject!==void 0&&k.push("params.onReject"),b?.revisionGroup!==void 0&&k.push("params.revisionGroup");for(let v of k)t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.${v}`,reason:{de:`[workItems/approvalOnlyField] '${v}' gilt nur f\xFCr die Art 'approval' (Task "${u}" ist '${p}').`,en:`[workItems/approvalOnlyField] '${v}' only applies to the kind 'approval' (task "${u}" is '${p}').`},severity:"error"});continue}b?.onReject!==void 0&&b.onReject!=="spawnRevision"&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.params.onReject`,reason:{de:`[workItems/invalidOnReject] Erwartet 'spawnRevision', erhalten ${JSON.stringify(b.onReject)}.`,en:`[workItems/invalidOnReject] Expected 'spawnRevision', got ${JSON.stringify(b.onReject)}.`},severity:"error"}),b?.onReject==="spawnRevision"&&(typeof b.revisionGroup!="string"||b.revisionGroup.length===0)&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks.${u}.params.revisionGroup`,reason:{de:`[workItems/spawnRevisionNoTarget] Approval "${u}" mit 'params.onReject: spawnRevision' ohne 'params.revisionGroup' \u2014 die \xDCberarbeitung h\xE4tte keine Ziel-Gruppe.`,en:`[workItems/spawnRevisionNoTarget] Approval "${u}" with 'params.onReject: spawnRevision' but no 'params.revisionGroup' \u2014 the revision would have no target group.`},severity:"error"})}}return t.push(...HD(e)),t}s(Hb,"checkWorkItemTemplates");function LF(e,t,n){let r=sm(e);return r.length>0?r.map(i=>{let o=i.index===null?t:`${t}.${i.index}`;return i.code==="defaultLast"?FF(o,{de:`[assign/defaultLast] ${n.de}: genau eine Sonst-Zeile (\`when: null\`), und sie steht am Ende \u2014 ${i.detail}.`,en:`[assign/defaultLast] ${n.en}: exactly one default row (\`when: null\`), and it is the last \u2014 ${i.detail}.`}):FF(o,{de:`[assign/shape] ${n.de}${i.index===null?"":`, Zeile ${i.index}`}: ${i.detail}.`,en:`[assign/shape] ${n.en}${i.index===null?"":`, row ${i.index}`}: ${i.detail}.`})}):tC(e).map(({index:i,first:o})=>MF(`${t}.${i}.when`,"warning",{de:`[assign/duplicateRow] ${n.de}: Zeile ${i} hat dieselbe Bedingung wie Zeile ${o} und greift nie.`,en:`[assign/duplicateRow] ${n.en}: row ${i} has the same condition as row ${o} and never applies.`}))}s(LF,"teamRulesIssues");function MF(e,t,n){return{layer:"GRAPH",kind:"nodeRule",path:e,reason:n,severity:t}}s(MF,"issue");function FF(e,t){return MF(e,"error",t)}s(FF,"error");var qF=new Set(["complete","approve","reject"]);function Jb(e){let t=[];for(let n of e.nodes){let r=n,i=Ue(n),o=Array.isArray(r.tasks)?r.tasks.length:0,a=i.workItemTemplates?.(n)??[];if(o+a.length>0){let v=Kd[r.type];v===void 0?t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks`,reason:{de:`[workItems/unknownParkSemantics] Knotentyp "${r.type}" hat keine bekannte Park-Semantik \u2014 NODE_TYPE_PARKS in validators.ts erg\xE4nzen.`,en:`[workItems/unknownParkSemantics] Node type "${r.type}" has no known parking semantics \u2014 add it to NODE_TYPE_PARKS in validators.ts.`},severity:"error"}):v||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.tasks`,reason:{de:`[workItems/templatesOnNonParkingNode] Knoten "${r.id}" (Typ "${r.type}") parkt nie \u2014 seine Work-Item-Templates w\xFCrden im selben Dispatch gespawnt und storniert (totes Muster).`,en:`[workItems/templatesOnNonParkingNode] Node "${r.id}" (type "${r.type}") never parks \u2014 its work-item templates would be spawned and cancelled in the same dispatch (dead pattern).`},severity:"error"})}let l=i.actions?.(n)??[];if(l.length===0&&a.length===0)continue;let d=new Map(l.map(v=>[v.id,v]));for(let v of l)qF.has(v.id)&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actions.${v.id}`,reason:{de:`[capability/reservedActionId] Knotentyp "${r.type}" deklariert die Action "${v.id}" \u2014 reserviert f\xFCr den generischen Complete-/Verdict-Pfad (complete, approve, reject); die Spec muss eine andere Action-Id w\xE4hlen.`,en:`[capability/reservedActionId] Node type "${r.type}" declares the action "${v.id}" \u2014 reserved for the generic complete/verdict path (complete, approve, reject); the spec must choose a different action id.`},severity:"error"});let c=new Set(i.states??[DD]);for(let v of l)if(v.availableIn!==void 0)for(let T of v.availableIn)c.has(T)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actions.${v.id}.availableIn`,reason:{de:`[capability/unknownActionState] Action "${v.id}" auf Knotentyp "${r.type}" ist f\xFCr Zustand "${T}" deklariert \u2014 der Typ kennt nur: ${[...c].join(", ")}.`,en:`[capability/unknownActionState] Action "${v.id}" on node type "${r.type}" is declared for state "${T}" \u2014 the type only knows: ${[...c].join(", ")}.`},severity:"error"});let u=zm(n),p=new Set(u?u.map(v=>v.id):[To]);for(let v of l){if(v.external===void 0)continue;let T=PD(v.external.event),$={de:"hat keine Beschriftung (der Empf\xE4nger bekommt einen leeren Button)",en:"has no label (the recipient would get an empty button)"},I=T?v.kind==="advance"?{de:`ist als "advance" deklariert, l\xF6st den Knoten aber nicht auf (Ereignis "${v.external.event}") \u2014 solche Aktionen sind "internal"`,en:`is declared as "advance", but does not resolve the node (event "${v.external.event}") \u2014 such actions are "internal"`}:v.outcome!==void 0?{de:`nennt das Outcome "${v.outcome}", l\xF6st den Knoten aber nicht auf (Ereignis "${v.external.event}") \u2014 ein Outcome w\xFCrde eine zweite, stille Routing-Vokabel behaupten`,en:`names the outcome "${v.outcome}", but does not resolve the node (event "${v.external.event}") \u2014 an outcome would claim a second, silent routing vocabulary`}:v.label===void 0?$:null:v.kind!=="advance"?{de:`ist als "${v.kind}" deklariert (externe Aktionen l\xF6sen den Knoten auf und m\xFCssen "advance" sein)`,en:`is declared as "${v.kind}" (external actions resolve the node and must be "advance")`}:v.outcome===void 0?{de:"nennt kein Outcome",en:"names no outcome"}:p.has(v.outcome)?v.label===void 0?$:null:{de:`verweist auf das unbekannte Outcome "${v.outcome}" (deklariert: ${[...p].join(", ")||"keine"})`,en:`refers to the unknown outcome "${v.outcome}" (declared: ${[...p].join(", ")||"none"})`};I!==null&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actions.${v.id}.external`,reason:{de:`[capability/externalActionNeedsOutcome] Externe Aktion "${v.id}" auf Knotentyp "${r.type}" ${I.de}.`,en:`[capability/externalActionNeedsOutcome] External action "${v.id}" on node type "${r.type}" ${I.en}.`},severity:"error"})}for(let v of a){let T=v.unlocks;if(T.length===0&&v.verdictResolved!==!0&&v.informational!==!0){t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.workItemTemplates.${v.key}.unlocks`,reason:{de:`[capability/emptyUnlocks] Intrinsisches Template "${v.key}" auf Knoten "${r.id}" schaltet keine Action frei (B5).`,en:`[capability/emptyUnlocks] Intrinsic template "${v.key}" on node "${r.id}" unlocks no action (B5).`},severity:"error"});continue}for(let $ of T)d.get($)===void 0&&t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.workItemTemplates.${v.key}.unlocks`,reason:{de:`[capability/danglingUnlock] Template "${v.key}" auf Knoten "${r.id}" schaltet unbekannte Action "${$}" frei; deklariert: ${[...d.keys()].join(", ")||"keine"}.`,en:`[capability/danglingUnlock] Template "${v.key}" on node "${r.id}" unlocks the unknown action "${$}"; declared: ${[...d.keys()].join(", ")||"none"}.`},severity:"error"})}let h=new Set(a.map(v=>v.key));for(let v of Object.keys(r.assign??{}))h.has(v)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.assign.${v}`,reason:{de:`[capability/unknownAssignKey] assign-Key "${v}" auf Knoten "${r.id}" ist kein intrinsisches Template dieses Knotentyps; bekannt: ${[...h].join(", ")||"keine"}.`,en:`[capability/unknownAssignKey] assign key "${v}" on node "${r.id}" is not an intrinsic template of this node type; known: ${[...h].join(", ")||"none"}.`},severity:"error"});for(let[v,T]of Object.entries(r.assign??{})){if(T===void 0)continue;let $=`nodes.${r.id}.assign.${v}`,I={de:`Team der Vorlage "${v}" (Knoten "${r.id}")`,en:`team of the template "${v}" (node "${r.id}")`};t.push(...LF(T,$,I));for(let[C,F]of(Array.isArray(T)?T:[]).entries()){let N=F?.when;N==null||!ke(N)||mt(N)||t.push({layer:"GRAPH",kind:"nodeRule",path:`${$}.${C}.when`,severity:"error",reason:{de:`[assign/conditionNotFormField] ${I.de}, Zeile ${C+1}: die Bedingung nennt ${Ge(e,N,"de")} \u2014 ein Team wird nach einem Ja/Nein-Feld eines Formulars gew\xE4hlt ($node.<formular>.admission.<feld>).`,en:`[assign/conditionNotFormField] ${I.en}, row ${C+1}: the condition names ${Ge(e,N,"en")} \u2014 a team is chosen by a yes/no field of a form ($node.<form>.admission.<field>).`}})}}let y=l.filter(v=>v.teamAssignable===!0).map(v=>v.id);for(let v of Object.keys(r.actionTeams??{}))y.includes(v)||t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actionTeams.${v}`,reason:{de:`[capability/unknownActionTeam] Knoten "${r.id}" nennt ein Team f\xFCr "${v}", aber diese Aktion l\xE4sst sich hier keinem Team geben; m\xF6glich: ${y.join(", ")||"keine"}.`,en:`[capability/unknownActionTeam] Node "${r.id}" names a team for "${v}", but this action cannot be given to a team here; possible: ${y.join(", ")||"none"}.`},severity:"error"});let b=new Set;for(let v of a)if(v.recipient==="external"||(r.assign??{})[v.key]!==void 0)for(let $ of v.unlocks)b.add($);let k=i.strictActionCoverage===!0;for(let v of l){if(b.has(v.id)||v.superUserOnly===!0)continue;let T=a.find(I=>I.unlocks.includes(v.id)),$=T!==void 0?{de:` Fehlt die Zuweisung assign.${T.key}?`,en:` Is the assignment assign.${T.key} missing?`}:{de:"",en:""};t.push({layer:"GRAPH",kind:"nodeRule",path:`nodes.${r.id}.actions.${v.id}`,reason:{de:`[capability/superUserOnly] Action "${v.id}" auf Knoten "${r.id}" ist von keinem verdrahteten Work-Item freigeschaltet \u2014 nur die verantwortliche Person (Super-User) kann sie ausf\xFChren.${$.de}`,en:`[capability/superUserOnly] Action "${v.id}" on node "${r.id}" is unlocked by no wired work item \u2014 only the responsible person (super user) can perform it.${$.en}`},severity:k?"error":"warning"})}}return t}s(Jb,"checkNodeCapabilityWiring");var KF=[{key:"tenantSlug",type:"string"}];var Vd="subject";function jF(e){return e.category==="login"}s(jF,"isSignInLetter");var Je={key:"schoolName",label:"Name der Schule"},VF={de:"Zu Ihren Bewerbungen",en:"View your applications"},it={key:"portalLink",label:"Link zum Bewerberportal",required:!0,link:!0,actionLabel:VF},Bd={key:it.key,label:it.label,link:!0,actionLabel:VF},gr={key:"applicationLink",label:"Link zur Bewerbung",required:!0,link:!0,actionLabel:{de:"Bewerbung \xF6ffnen",en:"Open application"}},Bi={key:"anmeldeLink",label:"Anmeldelink",required:!0,link:!0,actionLabel:{de:"Jetzt anmelden",en:"Sign in now"},previewValue:{de:"https://beispiel.plexus.schule/anmelden?token=BEISPIEL",en:"https://beispiel.plexus.schule/anmelden?token=BEISPIEL"}},Ud={key:"bestaetigungsLink",label:"Best\xE4tigungslink",required:!0,link:!0,actionLabel:{de:"E-Mail best\xE4tigen",en:"Confirm email address"},previewValue:{de:"https://beispiel.plexus.schule/bestaetigen?token=BEISPIEL",en:"https://beispiel.plexus.schule/bestaetigen?token=BEISPIEL"}},yr={key:"gueltigkeit",label:"G\xFCltigkeitsdauer des Links"};function be(e){return{key:Vd,label:"Betreff",default:e}}s(be,"subjectSlot");var wr=m.object({de:m.string(),en:m.string()}),Xe={tenantSlug:m.string(),applicationId:m.id("applications")},Qa=m.object({...Xe,workItemId:m.id("work_items"),dueAt:m.number()}),Ui={key:"taskTitle",label:"Titel der Aufgabe"},Gi={key:"dueDate",label:"F\xE4lligkeitstag",subjectSafe:!0},kr={key:"applicantName",label:"Name aus der Bewerbung"},bs={key:"appointmentTitle",label:"Anlass des Termins"},vs={key:"appointmentWhen",label:"Datum und Uhrzeit des Termins",required:!0},xs={key:"appointmentLocation",label:"Ort des Termins",required:!0};var z4={key:"passwortLink",label:"Link zum neuen Passwort",required:!0,link:!0,actionLabel:{de:"Neues Passwort festlegen",en:"Set a new password"},previewValue:{de:"https://beispiel.plexus.schule/login/reset?token=BEISPIEL",en:"https://beispiel.plexus.schule/login/reset?token=BEISPIEL"}},W4=m.object({callbackPath:m.string()}),BF={id:"account.loginLink",category:"login",label:"Anmeldelink (Anmeldeseite)",occasion:{de:"Wenn jemand auf der Anmeldeseite einen Anmeldelink anfordert",en:"When someone asks for a sign-in link on the login page"},audience:"internal",frame:"letter",timeline:"hidden",paramsValidator:W4,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Bi,yr],slots:[be({de:"Ihr Anmeldelink f\xFCr Plexus",en:"Your sign-in link for Plexus"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`hier ist Ihr Anmeldelink. Damit melden Sie sich ohne Passwort bei Plexus an:
11512
11512
 
11513
11513
  {{anmeldeLink}}
11514
11514
 
@@ -11516,7 +11516,7 @@ Der Link gilt {{gueltigkeit}} und funktioniert einmal. Wenn Sie ihn nicht angefo
11516
11516
 
11517
11517
  {{anmeldeLink}}
11518
11518
 
11519
- The link is valid for {{gueltigkeit}} and works once. If you did not request it, you can ignore this email \u2014 your account stays as it is.`}}]},Y3=m.object({tenantSlug:m.string()}),UF={id:"account.invitation",category:"login",label:"Einladung (Mitarbeitende)",occasion:{de:"Wenn die Schulverwaltung eine Person einl\xE4dt oder ihr einen Anmeldelink schickt",en:"When a school's administration invites a person or sends them a sign-in link"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:Y3,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Je,Bi,yr],slots:[be({de:"Ihr Zugang zu Plexus",en:"Your access to Plexus"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`{{schoolName}} hat Ihnen einen Zugang zu Plexus eingerichtet. Mit diesem Link melden Sie sich an:
11519
+ The link is valid for {{gueltigkeit}} and works once. If you did not request it, you can ignore this email \u2014 your account stays as it is.`}}]},Y4=m.object({tenantSlug:m.string()}),UF={id:"account.invitation",category:"login",label:"Einladung (Mitarbeitende)",occasion:{de:"Wenn die Schulverwaltung eine Person einl\xE4dt oder ihr einen Anmeldelink schickt",en:"When a school's administration invites a person or sends them a sign-in link"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:Y4,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Je,Bi,yr],slots:[be({de:"Ihr Zugang zu Plexus",en:"Your access to Plexus"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`{{schoolName}} hat Ihnen einen Zugang zu Plexus eingerichtet. Mit diesem Link melden Sie sich an:
11520
11520
 
11521
11521
  {{anmeldeLink}}
11522
11522
 
@@ -11524,7 +11524,7 @@ Der Link gilt {{gueltigkeit}} und funktioniert einmal. Danach fordern Sie auf de
11524
11524
 
11525
11525
  {{anmeldeLink}}
11526
11526
 
11527
- The link is valid for {{gueltigkeit}} and works once. After that you can ask for a new one on the sign-in page at any time.`}}]},H3=m.object({}),GF={id:"account.passwordReset",category:"login",label:"Passwort zur\xFCcksetzen",occasion:{de:"Wenn die Schulverwaltung das Passwort eines Kontos zur\xFCcksetzt",en:"When a school's administration resets an account's password"},audience:"internal",frame:"letter",timeline:"hidden",paramsValidator:H3,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[z3,yr],slots:[be({de:"Ihr Link f\xFCr ein neues Plexus-Passwort",en:"Your link to a new Plexus password"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`Ihre Schulverwaltung hat f\xFCr Ihr Plexus-Konto ein neues Passwort angesto\xDFen. Mit diesem Link legen Sie es selbst fest:
11527
+ The link is valid for {{gueltigkeit}} and works once. After that you can ask for a new one on the sign-in page at any time.`}}]},H4=m.object({}),GF={id:"account.passwordReset",category:"login",label:"Passwort zur\xFCcksetzen",occasion:{de:"Wenn die Schulverwaltung das Passwort eines Kontos zur\xFCcksetzt",en:"When a school's administration resets an account's password"},audience:"internal",frame:"letter",timeline:"hidden",paramsValidator:H4,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[z4,yr],slots:[be({de:"Ihr Link f\xFCr ein neues Plexus-Passwort",en:"Your link to a new Plexus password"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`Ihre Schulverwaltung hat f\xFCr Ihr Plexus-Konto ein neues Passwort angesto\xDFen. Mit diesem Link legen Sie es selbst fest:
11528
11528
 
11529
11529
  {{passwortLink}}
11530
11530
 
@@ -11532,23 +11532,23 @@ Der Link gilt {{gueltigkeit}} und funktioniert einmal. Danach werden Sie \xFCber
11532
11532
 
11533
11533
  {{passwortLink}}
11534
11534
 
11535
- The link is valid for {{gueltigkeit}} and works once. Afterwards you are signed out everywhere. Until then your current password keeps working \u2014 if you want nothing changed, ignore this email.`}}]},J3=m.object({}),zF={id:"account.emailChanged",category:"security",label:"Anmelde-Adresse ge\xE4ndert",occasion:{de:"Wenn jemand anderes als der Kontoinhaber die Anmelde-Adresse \xE4ndert \u2014 an die bisherige Adresse",en:"When someone other than the account holder changes the login address \u2014 to the previous address"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:J3,channels:["email"],lockedReason:{de:"Dieser Hinweis sch\xFCtzt Familien davor, dass jemand unbemerkt ihr Konto \xFCbernimmt. Sein Wortlaut ist deshalb fest.",en:"This notice protects families from someone taking over their account unnoticed, so its wording is fixed."},maxAttempts:4,portalVisible:!1};var Q3=m.object(Xe),WF={id:"admission.approved",category:"admission",label:"Zusage",occasion:{de:"Sobald eine Bewerbung mit \u201EZusage\u201C entschieden ist",en:"As soon as an application has been decided \u201Capproved\u201D"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:Q3,channels:["email"],portalVisible:!0,placeholders:[Je,it],slots:[be({de:"Zusage f\xFCr Ihre Bewerbung",en:"Offer of a place \u2014 your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"wir freuen uns, Ihnen einen Platz bei {{schoolName}} anbieten zu k\xF6nnen.",en:"We are delighted to offer you a place at {{schoolName}}."}},{key:"next",label:"Wie es weitergeht",multiline:!0,default:{de:"\xDCber die n\xE4chsten Schritte informieren wir Sie rechtzeitig.",en:"We will let you know about the next steps in good time."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Ihre Bewerbung finden Sie hier:
11535
+ The link is valid for {{gueltigkeit}} and works once. Afterwards you are signed out everywhere. Until then your current password keeps working \u2014 if you want nothing changed, ignore this email.`}}]},J4=m.object({}),zF={id:"account.emailChanged",category:"security",label:"Anmelde-Adresse ge\xE4ndert",occasion:{de:"Wenn jemand anderes als der Kontoinhaber die Anmelde-Adresse \xE4ndert \u2014 an die bisherige Adresse",en:"When someone other than the account holder changes the login address \u2014 to the previous address"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:J4,channels:["email"],lockedReason:{de:"Dieser Hinweis sch\xFCtzt Familien davor, dass jemand unbemerkt ihr Konto \xFCbernimmt. Sein Wortlaut ist deshalb fest.",en:"This notice protects families from someone taking over their account unnoticed, so its wording is fixed."},maxAttempts:4,portalVisible:!1};var Q4=m.object(Xe),WF={id:"admission.approved",category:"admission",label:"Zusage",occasion:{de:"Sobald eine Bewerbung mit \u201EZusage\u201C entschieden ist",en:"As soon as an application has been decided \u201Capproved\u201D"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:Q4,channels:["email"],portalVisible:!0,placeholders:[Je,it],slots:[be({de:"Zusage f\xFCr Ihre Bewerbung",en:"Offer of a place \u2014 your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"wir freuen uns, Ihnen einen Platz bei {{schoolName}} anbieten zu k\xF6nnen.",en:"We are delighted to offer you a place at {{schoolName}}."}},{key:"next",label:"Wie es weitergeht",multiline:!0,default:{de:"\xDCber die n\xE4chsten Schritte informieren wir Sie rechtzeitig.",en:"We will let you know about the next steps in good time."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Ihre Bewerbung finden Sie hier:
11536
11536
 
11537
11537
  {{portalLink}}`,en:`You can find your application here:
11538
11538
 
11539
- {{portalLink}}`}}]},Z3=m.object({...Xe,comment:m.optional(m.string())}),X3={key:"comment",label:"Begr\xFCndung der Entscheidung"},YF={id:"admission.rejected",category:"admission",label:"Absage",occasion:{de:"Sobald eine Bewerbung mit \u201EAbsage\u201C entschieden ist",en:"As soon as an application has been decided \u201Crejected\u201D"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:Z3,channels:["email"],portalVisible:!0,placeholders:[Je,X3,Bd],slots:[be({de:"Absage zu Ihrer Bewerbung",en:"Your application \u2014 we are unable to offer a place"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"leider k\xF6nnen wir Ihnen keinen Platz bei {{schoolName}} anbieten.",en:"Unfortunately, we are unable to offer you a place at {{schoolName}}."}},{key:"reason",label:"Begr\xFCndung",multiline:!0,default:{de:"{{comment}}",en:"{{comment}}"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:"F\xFCr Ihr Interesse danken wir Ihnen.",en:"Thank you for your interest."}}]},e4=m.object(Xe),HF={id:"admission.waitlisted",category:"admission",label:"Warteliste",occasion:{de:"Sobald eine Bewerbung auf die Warteliste gesetzt wird",en:"As soon as an application is placed on the waiting list"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:e4,channels:["email"],portalVisible:!0,placeholders:[Je,Bd],slots:[be({de:"Ihre Bewerbung steht auf der Warteliste",en:"Your application is on the waiting list"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"zurzeit k\xF6nnen wir Ihnen keinen Platz bei {{schoolName}} zusagen. Ihre Bewerbung steht auf der Warteliste.",en:"At the moment we are unable to offer you a place at {{schoolName}}. Your application has been placed on the waiting list."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:"Sobald ein Platz frei wird, melden wir uns bei Ihnen.",en:"We will be in touch as soon as a place becomes available."}}]},t4=m.object(Xe),JF={id:"admission.waitlistPromoted",category:"admission",label:"Nachger\xFCckt",occasion:{de:"Sobald eine Bewerbung von der Warteliste nachr\xFCckt",en:"As soon as an application moves up off the waiting list"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:t4,channels:["email"],portalVisible:!0,placeholders:[Je,it],slots:[be({de:"Ein Platz ist frei geworden",en:"A place has become available"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"ein Platz bei {{schoolName}} ist frei geworden \u2014 Ihre Bewerbung ist nachger\xFCckt.",en:"A place has become available at {{schoolName}} \u2014 your application has moved up from the waiting list."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Alles Weitere finden Sie hier:
11539
+ {{portalLink}}`}}]},Z4=m.object({...Xe,comment:m.optional(m.string())}),X4={key:"comment",label:"Begr\xFCndung der Entscheidung"},YF={id:"admission.rejected",category:"admission",label:"Absage",occasion:{de:"Sobald eine Bewerbung mit \u201EAbsage\u201C entschieden ist",en:"As soon as an application has been decided \u201Crejected\u201D"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:Z4,channels:["email"],portalVisible:!0,placeholders:[Je,X4,Bd],slots:[be({de:"Absage zu Ihrer Bewerbung",en:"Your application \u2014 we are unable to offer a place"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"leider k\xF6nnen wir Ihnen keinen Platz bei {{schoolName}} anbieten.",en:"Unfortunately, we are unable to offer you a place at {{schoolName}}."}},{key:"reason",label:"Begr\xFCndung",multiline:!0,default:{de:"{{comment}}",en:"{{comment}}"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:"F\xFCr Ihr Interesse danken wir Ihnen.",en:"Thank you for your interest."}}]},e3=m.object(Xe),HF={id:"admission.waitlisted",category:"admission",label:"Warteliste",occasion:{de:"Sobald eine Bewerbung auf die Warteliste gesetzt wird",en:"As soon as an application is placed on the waiting list"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:e3,channels:["email"],portalVisible:!0,placeholders:[Je,Bd],slots:[be({de:"Ihre Bewerbung steht auf der Warteliste",en:"Your application is on the waiting list"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"zurzeit k\xF6nnen wir Ihnen keinen Platz bei {{schoolName}} zusagen. Ihre Bewerbung steht auf der Warteliste.",en:"At the moment we are unable to offer you a place at {{schoolName}}. Your application has been placed on the waiting list."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:"Sobald ein Platz frei wird, melden wir uns bei Ihnen.",en:"We will be in touch as soon as a place becomes available."}}]},t3=m.object(Xe),JF={id:"admission.waitlistPromoted",category:"admission",label:"Nachger\xFCckt",occasion:{de:"Sobald eine Bewerbung von der Warteliste nachr\xFCckt",en:"As soon as an application moves up off the waiting list"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:t3,channels:["email"],portalVisible:!0,placeholders:[Je,it],slots:[be({de:"Ein Platz ist frei geworden",en:"A place has become available"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"ein Platz bei {{schoolName}} ist frei geworden \u2014 Ihre Bewerbung ist nachger\xFCckt.",en:"A place has become available at {{schoolName}} \u2014 your application has moved up from the waiting list."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Alles Weitere finden Sie hier:
11540
11540
 
11541
11541
  {{portalLink}}`,en:`You can find all further details here:
11542
11542
 
11543
- {{portalLink}}`}}]},n4=m.object({...Xe,sectionLabel:wr}),r4={key:"sectionLabel",label:"Freigeschalteter Abschnitt",subjectSafe:!0},QF={id:"admission.sectionUnlocked",category:"admission",label:"Abschnitt freigeschaltet",occasion:{de:"Sobald ein Prozess einen weiteren Abschnitt des Formulars zum Ausf\xFCllen freischaltet",en:"As soon as a process unlocks a further section of the form to fill in"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:n4,channels:["email"],portalVisible:!0,placeholders:[Je,r4,it],slots:[be({de:"Sie k\xF6nnen jetzt die {{sectionLabel}} ausf\xFCllen",en:"You can now fill in {{sectionLabel}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"Sie k\xF6nnen jetzt die {{sectionLabel}} zu Ihrer Bewerbung bei {{schoolName}} ausf\xFCllen.",en:"You can now fill in {{sectionLabel}} for your application to {{schoolName}}."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Zum Formular geht es hier:
11543
+ {{portalLink}}`}}]},n3=m.object({...Xe,sectionLabel:wr}),r3={key:"sectionLabel",label:"Freigeschalteter Abschnitt",subjectSafe:!0},QF={id:"admission.sectionUnlocked",category:"admission",label:"Abschnitt freigeschaltet",occasion:{de:"Sobald ein Prozess einen weiteren Abschnitt des Formulars zum Ausf\xFCllen freischaltet",en:"As soon as a process unlocks a further section of the form to fill in"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:n3,channels:["email"],portalVisible:!0,placeholders:[Je,r3,it],slots:[be({de:"Sie k\xF6nnen jetzt die {{sectionLabel}} ausf\xFCllen",en:"You can now fill in {{sectionLabel}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"Sie k\xF6nnen jetzt die {{sectionLabel}} zu Ihrer Bewerbung bei {{schoolName}} ausf\xFCllen.",en:"You can now fill in {{sectionLabel}} for your application to {{schoolName}}."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Zum Formular geht es hier:
11544
11544
 
11545
11545
  {{portalLink}}`,en:`You can get to the form here:
11546
11546
 
11547
- {{portalLink}}`}}]},i4=m.object({...Xe,amount:m.float64()}),o4={key:"amount",label:"Betrag",subjectSafe:!0},ZF={id:"admission.paymentRequested",category:"admission",label:"Zahlung angefordert",occasion:{de:"Sobald ein Prozess eine Zahlung anfordert",en:"As soon as a process asks for a payment"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:i4,channels:["email"],portalVisible:!0,placeholders:[Je,o4,it],slots:[be({de:"Offene Zahlung zu Ihrer Bewerbung",en:"Payment due for your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"f\xFCr Ihre Bewerbung bei {{schoolName}} ist ein Betrag von {{amount}} f\xE4llig.",en:"A payment of {{amount}} is due for your application to {{schoolName}}."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Bezahlen k\xF6nnen Sie hier:
11547
+ {{portalLink}}`}}]},i3=m.object({...Xe,amount:m.float64()}),o3={key:"amount",label:"Betrag",subjectSafe:!0},ZF={id:"admission.paymentRequested",category:"admission",label:"Zahlung angefordert",occasion:{de:"Sobald ein Prozess eine Zahlung anfordert",en:"As soon as a process asks for a payment"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:i3,channels:["email"],portalVisible:!0,placeholders:[Je,o3,it],slots:[be({de:"Offene Zahlung zu Ihrer Bewerbung",en:"Payment due for your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"f\xFCr Ihre Bewerbung bei {{schoolName}} ist ein Betrag von {{amount}} f\xE4llig.",en:"A payment of {{amount}} is due for your application to {{schoolName}}."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Bezahlen k\xF6nnen Sie hier:
11548
11548
 
11549
11549
  {{portalLink}}`,en:`You can pay here:
11550
11550
 
11551
- {{portalLink}}`}}]},s4=m.object(Xe),XF={id:"admission.enrolled",category:"admission",label:"Aufgenommen",occasion:{de:"Sobald das Aufnahmeverfahren mit einer Aufnahme abgeschlossen ist",en:"As soon as the admission process has ended in an enrolment"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:s4,channels:["email"],portalVisible:!0,placeholders:[Je,Bd],slots:[be({de:"Herzlich willkommen an unserer Schule",en:"A warm welcome to our school"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"herzlich willkommen bei {{schoolName}}! Der Vertrag ist geschlossen, und wir freuen uns sehr, Ihr Kind bald bei uns begr\xFC\xDFen zu d\xFCrfen.",en:"A very warm welcome to {{schoolName}}! The contract is now in place, and we are very much looking forward to welcoming your child soon."}},{key:"next",label:"Wie es weitergeht",multiline:!0,default:{de:"Wie es weitergeht, teilen wir Ihnen rechtzeitig mit.",en:"We will let you know in good time what happens next."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:"Wir freuen uns auf die gemeinsame Zeit.",en:"We look forward to the time ahead together."}}]};var Qb=m.object({...Xe,bookingId:m.id("appointment_bookings")}),eL={id:"admission.appointmentBooked",category:"admission",label:"Termin vereinbart",occasion:{de:"Sobald die Schule f\xFCr eine Bewerbung einen Termin eingetragen hat (Ergebnis der Aufgabe \u201ETermin vereinbaren\u201C)",en:"As soon as the school has booked an appointment for an application (result of a \u201Cschedule appointment\u201D task)"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:Qb,channels:["email"],portalVisible:!0,placeholders:[Je,bs,vs,xs,it],slots:[be({de:"Ihr Termin bei uns",en:"Your appointment with us"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"wir haben f\xFCr Ihre Bewerbung bei {{schoolName}} einen Termin vereinbart:",en:"We have arranged an appointment for your application to {{schoolName}}:"}},{key:"details",label:"Termin",multiline:!0,default:{de:`{{appointmentTitle}}
11551
+ {{portalLink}}`}}]},s3=m.object(Xe),XF={id:"admission.enrolled",category:"admission",label:"Aufgenommen",occasion:{de:"Sobald das Aufnahmeverfahren mit einer Aufnahme abgeschlossen ist",en:"As soon as the admission process has ended in an enrolment"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:s3,channels:["email"],portalVisible:!0,placeholders:[Je,Bd],slots:[be({de:"Herzlich willkommen an unserer Schule",en:"A warm welcome to our school"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"herzlich willkommen bei {{schoolName}}! Der Vertrag ist geschlossen, und wir freuen uns sehr, Ihr Kind bald bei uns begr\xFC\xDFen zu d\xFCrfen.",en:"A very warm welcome to {{schoolName}}! The contract is now in place, and we are very much looking forward to welcoming your child soon."}},{key:"next",label:"Wie es weitergeht",multiline:!0,default:{de:"Wie es weitergeht, teilen wir Ihnen rechtzeitig mit.",en:"We will let you know in good time what happens next."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:"Wir freuen uns auf die gemeinsame Zeit.",en:"We look forward to the time ahead together."}}]};var Qb=m.object({...Xe,bookingId:m.id("appointment_bookings")}),eL={id:"admission.appointmentBooked",category:"admission",label:"Termin vereinbart",occasion:{de:"Sobald die Schule f\xFCr eine Bewerbung einen Termin eingetragen hat (Ergebnis der Aufgabe \u201ETermin vereinbaren\u201C)",en:"As soon as the school has booked an appointment for an application (result of a \u201Cschedule appointment\u201D task)"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:Qb,channels:["email"],portalVisible:!0,placeholders:[Je,bs,vs,xs,it],slots:[be({de:"Ihr Termin bei uns",en:"Your appointment with us"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"wir haben f\xFCr Ihre Bewerbung bei {{schoolName}} einen Termin vereinbart:",en:"We have arranged an appointment for your application to {{schoolName}}:"}},{key:"details",label:"Termin",multiline:!0,default:{de:`{{appointmentTitle}}
11552
11552
  {{appointmentWhen}}
11553
11553
  Ort: {{appointmentLocation}}`,en:`{{appointmentTitle}}
11554
11554
  {{appointmentWhen}}
@@ -11572,19 +11572,19 @@ Location: {{appointmentLocation}}`}},{key:"outro",label:"Abschluss",multiline:!0
11572
11572
 
11573
11573
  {{portalLink}}`,en:`The attached calendar file removes the entry from your calendar. You can find your application here:
11574
11574
 
11575
- {{portalLink}}`}}]};var a4=m.object({...Xe,documentTitle:wr,dueInDays:m.optional(m.number())}),Zb={key:"documentTitle",label:"Name des Dokuments",subjectSafe:!0},l4={key:"dueInDays",label:"Antwortfrist in Tagen"},rL={id:"admission.documentIssued",category:"admission",label:"Dokument bereitgestellt",occasion:{de:"Sobald ein Dokument \u2014 Platzangebot, Vertrag \u2014 f\xFCr die Familie bereitliegt",en:"As soon as a document \u2014 offer letter, contract \u2014 is ready for the family"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:a4,channels:["email"],portalVisible:!0,placeholders:[Je,Zb,l4,it],slots:[be({de:"{{documentTitle}} liegt f\xFCr Sie bereit",en:"{{documentTitle}} is ready for you"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"{{documentTitle}} von {{schoolName}} wartet auf Ihre Antwort.",en:"{{documentTitle}} from {{schoolName}} is waiting for your response."}},{key:"deadline",label:"Frist",multiline:!0,default:{de:"Bitte antworten Sie innerhalb von {{dueInDays}} Tagen.",en:"Please respond within {{dueInDays}} days."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Ansehen und beantworten k\xF6nnen Sie es hier:
11575
+ {{portalLink}}`}}]};var a3=m.object({...Xe,documentTitle:wr,dueInDays:m.optional(m.number())}),Zb={key:"documentTitle",label:"Name des Dokuments",subjectSafe:!0},l3={key:"dueInDays",label:"Antwortfrist in Tagen"},rL={id:"admission.documentIssued",category:"admission",label:"Dokument bereitgestellt",occasion:{de:"Sobald ein Dokument \u2014 Platzangebot, Vertrag \u2014 f\xFCr die Familie bereitliegt",en:"As soon as a document \u2014 offer letter, contract \u2014 is ready for the family"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:a3,channels:["email"],portalVisible:!0,placeholders:[Je,Zb,l3,it],slots:[be({de:"{{documentTitle}} liegt f\xFCr Sie bereit",en:"{{documentTitle}} is ready for you"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"{{documentTitle}} von {{schoolName}} wartet auf Ihre Antwort.",en:"{{documentTitle}} from {{schoolName}} is waiting for your response."}},{key:"deadline",label:"Frist",multiline:!0,default:{de:"Bitte antworten Sie innerhalb von {{dueInDays}} Tagen.",en:"Please respond within {{dueInDays}} days."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Ansehen und beantworten k\xF6nnen Sie es hier:
11576
11576
 
11577
11577
  {{portalLink}}`,en:`You can view it and respond here:
11578
11578
 
11579
- {{portalLink}}`}}]},d4=m.object({...Xe,documentTitle:wr,reason:m.string()}),c4={key:"reason",label:"Begr\xFCndung der Schule",required:!0},iL={id:"admission.documentReturnHandedBack",category:"admission",label:"R\xFCcklauf zur\xFCckgegeben",occasion:{de:"Sobald die Schule ein unterschrieben zur\xFCckgesendetes Dokument mit Begr\xFCndung an die Familie zur\xFCckgibt",en:"As soon as the school hands a returned signed document back to the family with a reason"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:d4,channels:["email"],portalVisible:!0,placeholders:[Je,Zb,c4,it],slots:[be({de:"{{documentTitle}}: bitte noch einmal unterschreiben",en:"{{documentTitle}}: please sign again"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"vielen Dank f\xFCr Ihren R\xFCcklauf. {{schoolName}} kann {{documentTitle}} in dieser Form leider noch nicht annehmen:",en:"Thank you for returning it. Unfortunately {{schoolName}} cannot accept {{documentTitle}} as it is yet:"}},{key:"reason",label:"Begr\xFCndung",multiline:!0,default:{de:"{{reason}}",en:"{{reason}}"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Bitte laden Sie das unterschriebene Dokument hier erneut hoch:
11579
+ {{portalLink}}`}}]},d3=m.object({...Xe,documentTitle:wr,reason:m.string()}),c3={key:"reason",label:"Begr\xFCndung der Schule",required:!0},iL={id:"admission.documentReturnHandedBack",category:"admission",label:"R\xFCcklauf zur\xFCckgegeben",occasion:{de:"Sobald die Schule ein unterschrieben zur\xFCckgesendetes Dokument mit Begr\xFCndung an die Familie zur\xFCckgibt",en:"As soon as the school hands a returned signed document back to the family with a reason"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:d3,channels:["email"],portalVisible:!0,placeholders:[Je,Zb,c3,it],slots:[be({de:"{{documentTitle}}: bitte noch einmal unterschreiben",en:"{{documentTitle}}: please sign again"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"vielen Dank f\xFCr Ihren R\xFCcklauf. {{schoolName}} kann {{documentTitle}} in dieser Form leider noch nicht annehmen:",en:"Thank you for returning it. Unfortunately {{schoolName}} cannot accept {{documentTitle}} as it is yet:"}},{key:"reason",label:"Begr\xFCndung",multiline:!0,default:{de:"{{reason}}",en:"{{reason}}"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Bitte laden Sie das unterschriebene Dokument hier erneut hoch:
11580
11580
 
11581
11581
  {{portalLink}}`,en:`Please upload the signed document again here:
11582
11582
 
11583
- {{portalLink}}`}}]},u4=m.object({...Xe,documentTitle:wr}),oL={id:"admission.contractCountersigned",category:"admission",label:"Vertrag gegengezeichnet",occasion:{de:"Sobald die Schule den von der Familie unterschriebenen Vertrag gegengezeichnet hat",en:"As soon as the school has countersigned the contract the family signed"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:u4,channels:["email"],portalVisible:!0,placeholders:[Je,Zb,it],slots:[be({de:"{{documentTitle}} gegengezeichnet",en:"{{documentTitle}} countersigned"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"{{schoolName}} hat das Dokument \u201E{{documentTitle}}\u201C gegengezeichnet. Damit ist der Vertrag geschlossen.",en:"{{schoolName}} has countersigned the document \u201C{{documentTitle}}\u201D. The contract is now concluded."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Das gegengezeichnete Exemplar finden Sie hier:
11583
+ {{portalLink}}`}}]},u3=m.object({...Xe,documentTitle:wr}),oL={id:"admission.contractCountersigned",category:"admission",label:"Vertrag gegengezeichnet",occasion:{de:"Sobald die Schule den von der Familie unterschriebenen Vertrag gegengezeichnet hat",en:"As soon as the school has countersigned the contract the family signed"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:u3,channels:["email"],portalVisible:!0,placeholders:[Je,Zb,it],slots:[be({de:"{{documentTitle}} gegengezeichnet",en:"{{documentTitle}} countersigned"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"{{schoolName}} hat das Dokument \u201E{{documentTitle}}\u201C gegengezeichnet. Damit ist der Vertrag geschlossen.",en:"{{schoolName}} has countersigned the document \u201C{{documentTitle}}\u201D. The contract is now concluded."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Das gegengezeichnete Exemplar finden Sie hier:
11584
11584
 
11585
11585
  {{portalLink}}`,en:`You will find the countersigned copy here:
11586
11586
 
11587
- {{portalLink}}`}}]},f4=m.object({...Xe,fieldLabels:wr,dueAt:m.number()}),p4={key:"fieldLabels",label:"Fehlende Unterlagen",subjectSafe:!0},sL={id:"admission.documentsRequested",category:"admission",label:"Unterlagen angefordert",occasion:{de:"Sobald eine Vollst\xE4ndigkeitspr\xFCfung fehlende Unterlagen mit Frist bei der Familie anfordert",en:"As soon as a completeness check asks the family for missing documents by a deadline"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:f4,channels:["email"],portalVisible:!0,placeholders:[Je,p4,Gi,it],slots:[be({de:"Bitte reichen Sie Unterlagen bis {{dueDate}} nach",en:"Please submit outstanding documents by {{dueDate}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`f\xFCr Ihre Anmeldung bei {{schoolName}} fehlen noch folgende Unterlagen: {{fieldLabels}}.
11587
+ {{portalLink}}`}}]},f3=m.object({...Xe,fieldLabels:wr,dueAt:m.number()}),p3={key:"fieldLabels",label:"Fehlende Unterlagen",subjectSafe:!0},sL={id:"admission.documentsRequested",category:"admission",label:"Unterlagen angefordert",occasion:{de:"Sobald eine Vollst\xE4ndigkeitspr\xFCfung fehlende Unterlagen mit Frist bei der Familie anfordert",en:"As soon as a completeness check asks the family for missing documents by a deadline"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:f3,channels:["email"],portalVisible:!0,placeholders:[Je,p3,Gi,it],slots:[be({de:"Bitte reichen Sie Unterlagen bis {{dueDate}} nach",en:"Please submit outstanding documents by {{dueDate}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`f\xFCr Ihre Anmeldung bei {{schoolName}} fehlen noch folgende Unterlagen: {{fieldLabels}}.
11588
11588
 
11589
11589
  Bitte reichen Sie diese bis zum {{dueDate}} nach.`,en:`The following documents are still missing for your application to {{schoolName}}: {{fieldLabels}}.
11590
11590
 
@@ -11592,11 +11592,11 @@ Please submit them by {{dueDate}}.`}},{key:"outro",label:"Abschluss",multiline:!
11592
11592
 
11593
11593
  {{portalLink}}`,en:`You can upload them here:
11594
11594
 
11595
- {{portalLink}}`}}]};var m4=/^(\d{4})-(\d{2})-(\d{2})$/;function h4(e){return e>=1900&&e<=2100}s(h4,"isSupportedYear");function g4(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}s(g4,"isRealDate");function Xb(e){if(typeof e!="string")return null;let t=m4.exec(e);if(t===null)return null;let[,n,r,i]=t;return n===void 0||r===void 0||i===void 0||!h4(Number(n))||!g4(Number(n),Number(r),Number(i))?null:{year:n,month:r,day:i}}s(Xb,"isoDateParts");var ev=3;function aL(e){return Om(e,hb()).wallClock.slice(0,10)}s(aL,"localIsoDate");var y4=m.object({tenantSlug:m.string()}),lL={id:"applicant.welcome",category:"admission",label:"Willkommen",occasion:{de:"Sobald f\xFCr eine Familie ein Zugang angelegt wurde",en:"As soon as an account has been created for a family"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:y4,channels:["email"],portalVisible:!0,placeholders:[Je,it],slots:[be({de:"Willkommen \u2014 Ihre Bewerbung bei uns",en:"Welcome \u2014 your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`vielen Dank f\xFCr Ihre Registrierung bei {{schoolName}}. \xDCber den folgenden Link k\xF6nnen Sie jederzeit Ihre Bewerbungen einsehen und fortsetzen:
11595
+ {{portalLink}}`}}]};var m3=/^(\d{4})-(\d{2})-(\d{2})$/;function h3(e){return e>=1900&&e<=2100}s(h3,"isSupportedYear");function g3(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}s(g3,"isRealDate");function Xb(e){if(typeof e!="string")return null;let t=m3.exec(e);if(t===null)return null;let[,n,r,i]=t;return n===void 0||r===void 0||i===void 0||!h3(Number(n))||!g3(Number(n),Number(r),Number(i))?null:{year:n,month:r,day:i}}s(Xb,"isoDateParts");var ev=3;function aL(e){return Om(e,hb()).wallClock.slice(0,10)}s(aL,"localIsoDate");var y3=m.object({tenantSlug:m.string()}),lL={id:"applicant.welcome",category:"admission",label:"Willkommen",occasion:{de:"Sobald f\xFCr eine Familie ein Zugang angelegt wurde",en:"As soon as an account has been created for a family"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:y3,channels:["email"],portalVisible:!0,placeholders:[Je,it],slots:[be({de:"Willkommen \u2014 Ihre Bewerbung bei uns",en:"Welcome \u2014 your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`vielen Dank f\xFCr Ihre Registrierung bei {{schoolName}}. \xDCber den folgenden Link k\xF6nnen Sie jederzeit Ihre Bewerbungen einsehen und fortsetzen:
11596
11596
 
11597
11597
  {{portalLink}}`,en:`Thank you for registering with {{schoolName}}. You can view and continue your applications at any time using the link below:
11598
11598
 
11599
- {{portalLink}}`}}]},w4=m.object({tenantSlug:m.string(),confirmPath:m.string()}),dL={id:"applicant.applicationStarted",category:"login",label:"Bewerbung begonnen",occasion:{de:"Sobald eine Familie eine Bewerbung mit einer neuen E-Mail-Adresse beginnt",en:"As soon as a family starts an application with a new e-mail address"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:w4,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Ud,yr],slots:[be({de:"Ihre Bewerbung \u2014 bitte E-Mail-Adresse best\xE4tigen",en:"Your application \u2014 please confirm your email address"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`Sie haben soeben eine Bewerbung bei uns begonnen. Bitte best\xE4tigen Sie einmal Ihre E-Mail-Adresse \u2014 ohne diesen Klick k\xF6nnen Sie die Bewerbung sp\xE4ter nicht absenden:
11599
+ {{portalLink}}`}}]},w3=m.object({tenantSlug:m.string(),confirmPath:m.string()}),dL={id:"applicant.applicationStarted",category:"login",label:"Bewerbung begonnen",occasion:{de:"Sobald eine Familie eine Bewerbung mit einer neuen E-Mail-Adresse beginnt",en:"As soon as a family starts an application with a new e-mail address"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:w3,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Ud,yr],slots:[be({de:"Ihre Bewerbung \u2014 bitte E-Mail-Adresse best\xE4tigen",en:"Your application \u2014 please confirm your email address"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`Sie haben soeben eine Bewerbung bei uns begonnen. Bitte best\xE4tigen Sie einmal Ihre E-Mail-Adresse \u2014 ohne diesen Klick k\xF6nnen Sie die Bewerbung sp\xE4ter nicht absenden:
11600
11600
 
11601
11601
  {{bestaetigungsLink}}
11602
11602
 
@@ -11612,7 +11612,7 @@ You can carry on filling in the form in your own time; the window you are workin
11612
11612
 
11613
11613
  Would you like to continue later on another device? Open the application page there and enter this email address \u2014 you will then receive a sign-in link. You do not need a password.
11614
11614
 
11615
- If you did not start an application, you can ignore this email; nothing further happens without confirmation.`}}]},k4=m.object({tenantSlug:m.string(),callbackPath:m.string()}),cL={id:"applicant.applicationParked",category:"login",label:"Bewerbung wartet",occasion:{de:"Wenn eine Bewerbung mit einer Adresse begonnen wird, zu der es schon ein Konto gibt",en:"When an application is started with an address that already has an account"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:k4,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Bi,yr],slots:[be({de:"Eine Bewerbung wartet auf Sie",en:"An application is waiting for you"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`mit Ihrer E-Mail-Adresse wurde eine Bewerbung begonnen. Sie haben bei uns bereits ein Konto \u2014 melden Sie sich hier an, dann liegt die begonnene Bewerbung darin bereit:
11615
+ If you did not start an application, you can ignore this email; nothing further happens without confirmation.`}}]},k3=m.object({tenantSlug:m.string(),callbackPath:m.string()}),cL={id:"applicant.applicationParked",category:"login",label:"Bewerbung wartet",occasion:{de:"Wenn eine Bewerbung mit einer Adresse begonnen wird, zu der es schon ein Konto gibt",en:"When an application is started with an address that already has an account"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:k3,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Bi,yr],slots:[be({de:"Eine Bewerbung wartet auf Sie",en:"An application is waiting for you"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`mit Ihrer E-Mail-Adresse wurde eine Bewerbung begonnen. Sie haben bei uns bereits ein Konto \u2014 melden Sie sich hier an, dann liegt die begonnene Bewerbung darin bereit:
11616
11616
 
11617
11617
  {{anmeldeLink}}
11618
11618
 
@@ -11624,7 +11624,7 @@ Haben Sie selbst keine Bewerbung begonnen, ignorieren Sie diese E-Mail \u2014 di
11624
11624
 
11625
11625
  You do not need a password. The link is valid for {{gueltigkeit}}.
11626
11626
 
11627
- If you did not start an application yourself, please ignore this email \u2014 the application will then not be added to your account.`}}]},uL={key:"applicantFirstName",label:"Vorname aus der Bewerbung"},b4=m.object(Xe),fL={id:"applicant.applicationSubmitted",category:"admission",label:"Eingangsbest\xE4tigung",occasion:{de:"Sobald eine Familie das Formular eines Schritts abgesendet hat",en:"As soon as a family has submitted the form of a step"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:b4,channels:["email"],portalVisible:!0,placeholders:[Je,uL,it],slots:[be({de:"Ihre Bewerbung ist bei uns eingegangen",en:"We have received your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`wir haben Ihre Bewerbung bei {{schoolName}} erhalten \u2014 vielen Dank. Sie h\xF6ren von uns, sobald es einen neuen Stand gibt.
11627
+ If you did not start an application yourself, please ignore this email \u2014 the application will then not be added to your account.`}}]},uL={key:"applicantFirstName",label:"Vorname aus der Bewerbung"},b3=m.object(Xe),fL={id:"applicant.applicationSubmitted",category:"admission",label:"Eingangsbest\xE4tigung",occasion:{de:"Sobald eine Familie das Formular eines Schritts abgesendet hat",en:"As soon as a family has submitted the form of a step"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:b3,channels:["email"],portalVisible:!0,placeholders:[Je,uL,it],slots:[be({de:"Ihre Bewerbung ist bei uns eingegangen",en:"We have received your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`wir haben Ihre Bewerbung bei {{schoolName}} erhalten \u2014 vielen Dank. Sie h\xF6ren von uns, sobald es einen neuen Stand gibt.
11628
11628
 
11629
11629
  Den aktuellen Stand sehen Sie jederzeit hier:
11630
11630
 
@@ -11632,11 +11632,11 @@ Den aktuellen Stand sehen Sie jederzeit hier:
11632
11632
 
11633
11633
  You can check the current status at any time here:
11634
11634
 
11635
- {{portalLink}}`}}]},v4=m.object(Xe),x4={key:"taskCount",label:"Anzahl der offenen Aufgaben"},pL={id:"applicant.tasksOpen",category:"tasks",label:"Offene Aufgaben",occasion:{de:"Sobald eine Bewerbung etwas offen hat, das die Familie erledigen muss",en:"As soon as an application has something waiting for the family to do"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:v4,channels:["email"],portalVisible:!0,placeholders:[Je,x4,it],slots:[be({de:"Zu Ihrer Bewerbung ist noch etwas offen",en:"Something is still outstanding on your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"f\xFCr Ihre Bewerbung bei {{schoolName}} wartet noch etwas auf Sie.",en:"There is still something waiting for you on your application to {{schoolName}}."}},{key:"taskListLead",label:"\xDCberschrift der Aufgabenliste",multiline:!0,default:{de:"Das ist noch zu tun:",en:"Still to do:"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Erledigen k\xF6nnen Sie das in Ihrem Portal:
11635
+ {{portalLink}}`}}]},v3=m.object(Xe),x3={key:"taskCount",label:"Anzahl der offenen Aufgaben"},pL={id:"applicant.tasksOpen",category:"tasks",label:"Offene Aufgaben",occasion:{de:"Sobald eine Bewerbung etwas offen hat, das die Familie erledigen muss",en:"As soon as an application has something waiting for the family to do"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:v3,channels:["email"],portalVisible:!0,placeholders:[Je,x3,it],slots:[be({de:"Zu Ihrer Bewerbung ist noch etwas offen",en:"Something is still outstanding on your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"f\xFCr Ihre Bewerbung bei {{schoolName}} wartet noch etwas auf Sie.",en:"There is still something waiting for you on your application to {{schoolName}}."}},{key:"taskListLead",label:"\xDCberschrift der Aufgabenliste",multiline:!0,default:{de:"Das ist noch zu tun:",en:"Still to do:"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Erledigen k\xF6nnen Sie das in Ihrem Portal:
11636
11636
 
11637
11637
  {{portalLink}}`,en:`You can take care of this in your applicant portal:
11638
11638
 
11639
- {{portalLink}}`}}]},S4=m.object(Xe),mL={id:"applicant.stillOpen",category:"tasks",label:"Erinnerung: noch Schritte offen",occasion:{de:"Wenn die Familie so viele Tage nichts an einer Bewerbung mit offenen Schritten getan hat, wie die Schule eingestellt hat (Vorgabe: 3, dann alle 7 Tage, h\xF6chstens 2-mal)",en:"When the family has done nothing on an application with open steps for as many days as the school set (default: 3, then every 7 days, at most twice)"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:S4,channels:["email"],portalVisible:!0,placeholders:[Je,uL,it],slots:[be({de:"Ihre Bewerbung \u2013 noch ein paar Schritte",en:"Your application \u2013 a few more steps"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"vielen Dank, dass Sie Ihre Bewerbung bei {{schoolName}} begonnen haben. Bis Ihre Bewerbung vollst\xE4ndig ist, sind noch ein paar Schritte offen.",en:"Thank you for starting your application to {{schoolName}}. There are still a few steps to complete before your application is complete."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`In Ihrem Portal sehen Sie, was noch fehlt, und k\xF6nnen es erledigen:
11639
+ {{portalLink}}`}}]},S3=m.object(Xe),mL={id:"applicant.stillOpen",category:"tasks",label:"Erinnerung: noch Schritte offen",occasion:{de:"Wenn die Familie so viele Tage nichts an einer Bewerbung mit offenen Schritten getan hat, wie die Schule eingestellt hat (Vorgabe: 3, dann alle 7 Tage, h\xF6chstens 2-mal)",en:"When the family has done nothing on an application with open steps for as many days as the school set (default: 3, then every 7 days, at most twice)"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:S3,channels:["email"],portalVisible:!0,placeholders:[Je,uL,it],slots:[be({de:"Ihre Bewerbung \u2013 noch ein paar Schritte",en:"Your application \u2013 a few more steps"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"vielen Dank, dass Sie Ihre Bewerbung bei {{schoolName}} begonnen haben. Bis Ihre Bewerbung vollst\xE4ndig ist, sind noch ein paar Schritte offen.",en:"Thank you for starting your application to {{schoolName}}. There are still a few steps to complete before your application is complete."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`In Ihrem Portal sehen Sie, was noch fehlt, und k\xF6nnen es erledigen:
11640
11640
 
11641
11641
  {{portalLink}}`,en:`You can review and complete your application in your portal:
11642
11642
 
@@ -11648,15 +11648,15 @@ You can check the current status at any time here:
11648
11648
 
11649
11649
  {{portalLink}}`,en:`Please complete the task as soon as possible in your applicant portal:
11650
11650
 
11651
- {{portalLink}}`}}]},A4=m.object({...Xe,requestId:m.id("field_requests")}),T4={key:"requestedFields",label:"Angeforderte Angaben"},R4=m.object({tenantSlug:m.string(),contractSnapshotId:m.id("contract_snapshots")}),yL={id:"applicant.coverLetterToConfirm",category:"deadlines",label:"Schreiben zur Best\xE4tigung",occasion:{de:"Wenn die Schule ein Schreiben zu einem einzelnen Vertrag best\xE4tigen l\xE4sst",en:"When the school asks for a letter on a contract without an application to be confirmed"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:R4,channels:["email"],placeholders:[Je,it],slots:[be({de:"Bitte best\xE4tigen Sie unser Schreiben",en:"Please confirm our letter"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"{{schoolName}} bittet Sie, ein Schreiben zu Ihrem Vertrag zu best\xE4tigen. Danach geht Ihnen der Vertrag zur Unterschrift zu.",en:"{{schoolName}} asks you to confirm a letter about your contract. The contract then comes to you for signature."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Das Schreiben finden Sie hier:
11651
+ {{portalLink}}`}}]},A3=m.object({...Xe,requestId:m.id("field_requests")}),T3={key:"requestedFields",label:"Angeforderte Angaben"},R3=m.object({tenantSlug:m.string(),contractSnapshotId:m.id("contract_snapshots")}),yL={id:"applicant.coverLetterToConfirm",category:"deadlines",label:"Schreiben zur Best\xE4tigung",occasion:{de:"Wenn die Schule ein Schreiben zu einem einzelnen Vertrag best\xE4tigen l\xE4sst",en:"When the school asks for a letter on a contract without an application to be confirmed"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:R3,channels:["email"],placeholders:[Je,it],slots:[be({de:"Bitte best\xE4tigen Sie unser Schreiben",en:"Please confirm our letter"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"{{schoolName}} bittet Sie, ein Schreiben zu Ihrem Vertrag zu best\xE4tigen. Danach geht Ihnen der Vertrag zur Unterschrift zu.",en:"{{schoolName}} asks you to confirm a letter about your contract. The contract then comes to you for signature."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Das Schreiben finden Sie hier:
11652
11652
 
11653
11653
  {{portalLink}}`,en:`You can find the letter here:
11654
11654
 
11655
- {{portalLink}}`}}]},wL={id:"applicant.requestCancelled",category:"tasks",label:"Nachforderung entf\xE4llt",occasion:{de:"Wenn die Schule eine Nachforderung zur\xFCcknimmt oder anders entscheidet, bevor die Familie geantwortet hat",en:"When the school takes back a request for documents, or decides otherwise, before the family has answered"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:A4,channels:["email"],portalVisible:!0,placeholders:[Je,kr,T4,it],slots:[be({de:"Eine Nachforderung zu Ihrer Bewerbung entf\xE4llt",en:"A request on your application has been withdrawn"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"f\xFCr die Bewerbung von {{applicantName}} bei {{schoolName}} ben\xF6tigen wir die angeforderten Angaben nicht mehr: {{requestedFields}}. Sie m\xFCssen dazu nichts mehr einreichen.",en:"For {{applicantName}}\u2019s application to {{schoolName}} we no longer need the details we asked for: {{requestedFields}}. You do not need to hand in anything for this."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Den Stand Ihrer Bewerbung sehen Sie in Ihrem Portal:
11655
+ {{portalLink}}`}}]},wL={id:"applicant.requestCancelled",category:"tasks",label:"Nachforderung entf\xE4llt",occasion:{de:"Wenn die Schule eine Nachforderung zur\xFCcknimmt oder anders entscheidet, bevor die Familie geantwortet hat",en:"When the school takes back a request for documents, or decides otherwise, before the family has answered"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:A3,channels:["email"],portalVisible:!0,placeholders:[Je,kr,T3,it],slots:[be({de:"Eine Nachforderung zu Ihrer Bewerbung entf\xE4llt",en:"A request on your application has been withdrawn"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"f\xFCr die Bewerbung von {{applicantName}} bei {{schoolName}} ben\xF6tigen wir die angeforderten Angaben nicht mehr: {{requestedFields}}. Sie m\xFCssen dazu nichts mehr einreichen.",en:"For {{applicantName}}\u2019s application to {{schoolName}} we no longer need the details we asked for: {{requestedFields}}. You do not need to hand in anything for this."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Den Stand Ihrer Bewerbung sehen Sie in Ihrem Portal:
11656
11656
 
11657
11657
  {{portalLink}}`,en:`You can see where your application stands in your applicant portal:
11658
11658
 
11659
- {{portalLink}}`}}]},$4=m.object({tenantSlug:m.string(),instanceId:m.id("smart_form_instances")}),kL={id:"applicant.reentry",category:"admission",label:"Es geht weiter (abgel\xF6st)",occasion:{de:"Wird nicht mehr verschickt \u2014 abgel\xF6st durch \u201EOffene Aufgaben\u201C",en:"No longer sent \u2014 superseded by \u201COffene Aufgaben\u201D"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:$4,channels:["email"],lockedReason:{de:"Diese Benachrichtigung wird nicht mehr verschickt \u2014 \u201EOffene Aufgaben\u201C hat sie abgel\xF6st. Anpassen lie\xDFe sich nur Wortlaut, den niemand mehr liest.",en:"This notification is no longer sent \u2014 \u201COffene Aufgaben\u201D has replaced it. Rewording it would only change words nobody reads any more."},portalVisible:!1};var E4=m.object({tenantSlug:m.string(),purpose:m.union(m.literal("apply"),m.literal("reentry")),callbackPath:m.string()}),bL={id:"applicant.magicLink",category:"login",label:"Anmeldelink",occasion:{de:"Wenn eine Familie sich ohne Passwort anmelden m\xF6chte",en:"When a family signs in without a password"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:E4,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Bi,yr],slots:[be({de:"Ihr Anmeldelink",en:"Your sign-in link"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`hier ist Ihr Anmeldelink. Damit kommen Sie ohne Passwort zu Ihren Bewerbungen:
11659
+ {{portalLink}}`}}]},$3=m.object({tenantSlug:m.string(),instanceId:m.id("smart_form_instances")}),kL={id:"applicant.reentry",category:"admission",label:"Es geht weiter (abgel\xF6st)",occasion:{de:"Wird nicht mehr verschickt \u2014 abgel\xF6st durch \u201EOffene Aufgaben\u201C",en:"No longer sent \u2014 superseded by \u201COffene Aufgaben\u201D"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:$3,channels:["email"],lockedReason:{de:"Diese Benachrichtigung wird nicht mehr verschickt \u2014 \u201EOffene Aufgaben\u201C hat sie abgel\xF6st. Anpassen lie\xDFe sich nur Wortlaut, den niemand mehr liest.",en:"This notification is no longer sent \u2014 \u201COffene Aufgaben\u201D has replaced it. Rewording it would only change words nobody reads any more."},portalVisible:!1};var E3=m.object({tenantSlug:m.string(),purpose:m.union(m.literal("apply"),m.literal("reentry")),callbackPath:m.string()}),bL={id:"applicant.magicLink",category:"login",label:"Anmeldelink",occasion:{de:"Wenn eine Familie sich ohne Passwort anmelden m\xF6chte",en:"When a family signs in without a password"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:E3,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Bi,yr],slots:[be({de:"Ihr Anmeldelink",en:"Your sign-in link"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`hier ist Ihr Anmeldelink. Damit kommen Sie ohne Passwort zu Ihren Bewerbungen:
11660
11660
 
11661
11661
  {{anmeldeLink}}
11662
11662
 
@@ -11664,7 +11664,7 @@ Der Link gilt {{gueltigkeit}}. Wenn Sie das nicht angefordert haben, k\xF6nnen S
11664
11664
 
11665
11665
  {{anmeldeLink}}
11666
11666
 
11667
- The link is valid for {{gueltigkeit}}. If you did not request it, you can ignore this email.`}}]},I4=m.object(Xe),vL={id:"applicant.accessSent",category:"login",label:"Zugang zur Bewerbung",occasion:{de:"Wenn die Schule einer Familie den Zugang zu ihrer Bewerbung schickt",en:"When the school sends a family the access to its application"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:I4,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Bi,yr],slots:[be({de:"Ihr Zugang zur Bewerbung",en:"Access to your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`wir schicken Ihnen den Zugang zu Ihrer Bewerbung. Mit diesem Link melden Sie sich ohne Passwort an:
11667
+ The link is valid for {{gueltigkeit}}. If you did not request it, you can ignore this email.`}}]},I3=m.object(Xe),vL={id:"applicant.accessSent",category:"login",label:"Zugang zur Bewerbung",occasion:{de:"Wenn die Schule einer Familie den Zugang zu ihrer Bewerbung schickt",en:"When the school sends a family the access to its application"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:I3,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Bi,yr],slots:[be({de:"Ihr Zugang zur Bewerbung",en:"Access to your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`wir schicken Ihnen den Zugang zu Ihrer Bewerbung. Mit diesem Link melden Sie sich ohne Passwort an:
11668
11668
 
11669
11669
  {{anmeldeLink}}
11670
11670
 
@@ -11672,7 +11672,7 @@ Der Link gilt {{gueltigkeit}}. Bitte leiten Sie diese E-Mail nicht weiter \u2014
11672
11672
 
11673
11673
  {{anmeldeLink}}
11674
11674
 
11675
- The link is valid for {{gueltigkeit}}. Please do not forward this email \u2014 anyone who opens the link will be signed in to your account.`}}]},O4=m.object({tenantSlug:m.string(),callbackPath:m.string()}),xL={id:"applicant.verifyEmail",category:"login",label:"E-Mail-Adresse best\xE4tigen",occasion:{de:"Bevor eine Familie zum ersten Mal etwas absenden kann",en:"Before a family can submit anything for the first time"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:O4,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Ud,yr],slots:[be({de:"Bitte best\xE4tigen Sie Ihre E-Mail-Adresse",en:"Please confirm your email address"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`bitte best\xE4tigen Sie kurz Ihre E-Mail-Adresse \u2014 ein Klick gen\xFCgt:
11675
+ The link is valid for {{gueltigkeit}}. Please do not forward this email \u2014 anyone who opens the link will be signed in to your account.`}}]},O3=m.object({tenantSlug:m.string(),callbackPath:m.string()}),xL={id:"applicant.verifyEmail",category:"login",label:"E-Mail-Adresse best\xE4tigen",occasion:{de:"Bevor eine Familie zum ersten Mal etwas absenden kann",en:"Before a family can submit anything for the first time"},audience:"external",frame:"letter",timeline:"hidden",paramsValidator:O3,channels:["email"],maxAttempts:4,portalVisible:!1,placeholders:[Ud,yr],slots:[be({de:"Bitte best\xE4tigen Sie Ihre E-Mail-Adresse",en:"Please confirm your email address"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`bitte best\xE4tigen Sie kurz Ihre E-Mail-Adresse \u2014 ein Klick gen\xFCgt:
11676
11676
 
11677
11677
  {{bestaetigungsLink}}
11678
11678
 
@@ -11704,19 +11704,19 @@ You can then submit your application. The link is valid for {{gueltigkeit}}. If
11704
11704
 
11705
11705
  {{applicationLink}}`,en:`You were mentioned in a message about an application. The message has since been removed.
11706
11706
 
11707
- {{applicationLink}}`}}]};var Hm=["login","security","admission","tasks","deadlines","schoolMessages","staffAssigned","staffFeedback","staffAppointments","staffDeadlines","staffWaitlist","staffUnassigned","familyMessages","mentions"],$L=m.union(...Hm.map(e=>m.literal(e)));var TSe=m.union(m.literal("admission"),m.literal("tasks"),m.literal("staff"),m.literal("chat")),nv=["loginOnly","all"],RSe=m.union(m.literal("loginOnly"),m.literal("all"));function EL(e){return typeof e=="string"&&nv.includes(e)}s(EL,"isMailLevel");var _4=m.object({...Xe,lastReminderAt:m.number()}),N4={key:"lastReminderDate",label:"Tag der letzten Erinnerung",subjectSafe:!0},IL={id:"staff.externalNotResponding",category:"staffDeadlines",label:"Familie reagiert nicht auf Erinnerungen",occasion:{de:"Wenn eine Familie nach der letzten Erinnerung noch einmal so viele Tage nichts getan hat, wie die Schule als Abstand eingestellt hat (Vorgabe: 7) \u2014 einmal je Bewerbung",en:"When a family has done nothing for another reminder interval after its last reminder (default: 7 days) \u2014 once per application"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:_4,channels:["email"],portalVisible:!1,placeholders:[kr,N4,gr],slots:[be({de:"Keine Reaktion seit der Erinnerung vom {{lastReminderDate}}",en:"No response since the reminder of {{lastReminderDate}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"die Familie von {{applicantName}} hat auf die Erinnerungen an ihre offenen Schritte nicht reagiert; die letzte ging am {{lastReminderDate}} hinaus. Plexus erinnert sie nicht weiter.",en:"The family of {{applicantName}} has not responded to the reminders about its open steps; the last one went out on {{lastReminderDate}}. Plexus will not remind them again."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Vielleicht hilft ein Anruf. Zur Bewerbung:
11707
+ {{applicationLink}}`}}]};var Hm=["login","security","admission","tasks","deadlines","schoolMessages","staffAssigned","staffFeedback","staffAppointments","staffDeadlines","staffWaitlist","staffUnassigned","familyMessages","mentions"],$L=m.union(...Hm.map(e=>m.literal(e)));var TSe=m.union(m.literal("admission"),m.literal("tasks"),m.literal("staff"),m.literal("chat")),nv=["loginOnly","all"],RSe=m.union(m.literal("loginOnly"),m.literal("all"));function EL(e){return typeof e=="string"&&nv.includes(e)}s(EL,"isMailLevel");var _3=m.object({...Xe,lastReminderAt:m.number()}),N3={key:"lastReminderDate",label:"Tag der letzten Erinnerung",subjectSafe:!0},IL={id:"staff.externalNotResponding",category:"staffDeadlines",label:"Familie reagiert nicht auf Erinnerungen",occasion:{de:"Wenn eine Familie nach der letzten Erinnerung noch einmal so viele Tage nichts getan hat, wie die Schule als Abstand eingestellt hat (Vorgabe: 7) \u2014 einmal je Bewerbung",en:"When a family has done nothing for another reminder interval after its last reminder (default: 7 days) \u2014 once per application"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:_3,channels:["email"],portalVisible:!1,placeholders:[kr,N3,gr],slots:[be({de:"Keine Reaktion seit der Erinnerung vom {{lastReminderDate}}",en:"No response since the reminder of {{lastReminderDate}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"die Familie von {{applicantName}} hat auf die Erinnerungen an ihre offenen Schritte nicht reagiert; die letzte ging am {{lastReminderDate}} hinaus. Plexus erinnert sie nicht weiter.",en:"The family of {{applicantName}} has not responded to the reminders about its open steps; the last one went out on {{lastReminderDate}}. Plexus will not remind them again."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Vielleicht hilft ein Anruf. Zur Bewerbung:
11708
11708
 
11709
11709
  {{applicationLink}}`,en:`A call may help. To the application:
11710
11710
 
11711
- {{applicationLink}}`}}]},P4=m.object({tenantSlug:m.string(),contractId:m.id("contracts")}),C4={key:"contractLink",label:"Link zum Vertrag",required:!0,link:!0,actionLabel:{de:"Vertrag \xF6ffnen",en:"Open contract"}},OL={id:"staff.coverLetterAnswered",category:"staffAssigned",label:"Antwort auf ein Schreiben",occasion:{de:"Wenn eine Familie ein Schreiben zu einem einzelnen Vertrag beantwortet \u2014 an die Person, die gefragt hat",en:"When a family answers a letter on a contract without an application \u2014 to the person who asked"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:P4,channels:["email"],portalVisible:!1,placeholders:[C4],slots:[be({de:"Antwort auf Ihr Schreiben zu einem Vertrag",en:"An answer to your letter on a contract"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`Die Familie hat das Schreiben zu einem Vertrag beantwortet. Der n\xE4chste Schritt liegt bei Ihnen.
11711
+ {{applicationLink}}`}}]},P3=m.object({tenantSlug:m.string(),contractId:m.id("contracts")}),C3={key:"contractLink",label:"Link zum Vertrag",required:!0,link:!0,actionLabel:{de:"Vertrag \xF6ffnen",en:"Open contract"}},OL={id:"staff.coverLetterAnswered",category:"staffAssigned",label:"Antwort auf ein Schreiben",occasion:{de:"Wenn eine Familie ein Schreiben zu einem einzelnen Vertrag beantwortet \u2014 an die Person, die gefragt hat",en:"When a family answers a letter on a contract without an application \u2014 to the person who asked"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:P3,channels:["email"],portalVisible:!1,placeholders:[C3],slots:[be({de:"Antwort auf Ihr Schreiben zu einem Vertrag",en:"An answer to your letter on a contract"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`Die Familie hat das Schreiben zu einem Vertrag beantwortet. Der n\xE4chste Schritt liegt bei Ihnen.
11712
11712
 
11713
11713
  {{contractLink}}`,en:`The family has answered the letter on a contract. The next step is yours.
11714
11714
 
11715
- {{contractLink}}`}}]},D4=m.object({...Xe,offerLabel:wr,stageLabel:wr,runLabel:wr}),F4={key:"offerLabel",label:"Angebot",subjectSafe:!0},L4={key:"stageLabel",label:"Stufe",subjectSafe:!0},M4={key:"runLabel",label:"Schuljahr",subjectSafe:!0},_L={id:"staff.waitlistVacancy",category:"staffWaitlist",label:"Platz frei, Warteliste wartet",occasion:{de:"Sobald in einer Kohorte ein Platz frei wird (R\xFCckzug, Stufenwechsel) und dort Bewerbungen auf der Warteliste stehen \u2014 an die Zust\xE4ndigen der ersten Bewerbung der Warteliste",en:"When a place frees up in a cohort (withdrawal, change of level) while applications wait on its waiting list \u2014 to the staff of the first application on the list"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:D4,channels:["email"],portalVisible:!1,placeholders:[F4,L4,M4,kr,gr],slots:[be({de:"Platz frei: {{offerLabel}} \xB7 {{stageLabel}} \xB7 {{runLabel}}",en:"Place available: {{offerLabel}} \xB7 {{stageLabel}} \xB7 {{runLabel}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"in {{offerLabel}} ({{stageLabel}}, {{runLabel}}) ist ein Platz frei geworden. Als N\xE4chste steht die Bewerbung von {{applicantName}} auf der Warteliste. Niemand r\xFCckt von selbst nach \u2014 bitte entscheiden Sie in der Bewerbung \xFCber \u201ENachr\xFCcken\u201C.",en:"A place has become available in {{offerLabel}} ({{stageLabel}}, {{runLabel}}). Next on the waiting list is {{applicantName}}\u2019s application. Nobody is promoted automatically \u2014 please decide on \u201CPromote\u201D in the application."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Die Bewerbung finden Sie hier:
11715
+ {{contractLink}}`}}]},D3=m.object({...Xe,offerLabel:wr,stageLabel:wr,runLabel:wr}),F3={key:"offerLabel",label:"Angebot",subjectSafe:!0},L3={key:"stageLabel",label:"Stufe",subjectSafe:!0},M3={key:"runLabel",label:"Schuljahr",subjectSafe:!0},_L={id:"staff.waitlistVacancy",category:"staffWaitlist",label:"Platz frei, Warteliste wartet",occasion:{de:"Sobald in einer Kohorte ein Platz frei wird (R\xFCckzug, Stufenwechsel) und dort Bewerbungen auf der Warteliste stehen \u2014 an die Zust\xE4ndigen der ersten Bewerbung der Warteliste",en:"When a place frees up in a cohort (withdrawal, change of level) while applications wait on its waiting list \u2014 to the staff of the first application on the list"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:D3,channels:["email"],portalVisible:!1,placeholders:[F3,L3,M3,kr,gr],slots:[be({de:"Platz frei: {{offerLabel}} \xB7 {{stageLabel}} \xB7 {{runLabel}}",en:"Place available: {{offerLabel}} \xB7 {{stageLabel}} \xB7 {{runLabel}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"in {{offerLabel}} ({{stageLabel}}, {{runLabel}}) ist ein Platz frei geworden. Als N\xE4chste steht die Bewerbung von {{applicantName}} auf der Warteliste. Niemand r\xFCckt von selbst nach \u2014 bitte entscheiden Sie in der Bewerbung \xFCber \u201ENachr\xFCcken\u201C.",en:"A place has become available in {{offerLabel}} ({{stageLabel}}, {{runLabel}}). Next on the waiting list is {{applicantName}}\u2019s application. Nobody is promoted automatically \u2014 please decide on \u201CPromote\u201D in the application."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Die Bewerbung finden Sie hier:
11716
11716
 
11717
11717
  {{applicationLink}}`,en:`You can find the application here:
11718
11718
 
11719
- {{applicationLink}}`}}]},q4=["invite","update","cancel"],K4=m.object({...Xe,appointmentId:m.id("appointments"),kind:m.union(...q4.map(e=>m.literal(e))),appointmentTitle:m.string()}),j4={...bs,subjectSafe:!0},V4={key:"appointmentChange",label:"Art der Nachricht",subjectSafe:!0},NL={id:"staff.appointmentHosted",category:"staffAppointments",label:"Kalendereinladung an die Teilnehmenden",occasion:{de:"Sobald ein Termin gebucht, verschoben oder abgesagt wird oder sich die Teilnehmenden \xE4ndern \u2014 an jede teilnehmende Person",en:"When an appointment is booked, moved or cancelled, or its participants change \u2014 to each participant"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:K4,channels:["email"],portalVisible:!1,placeholders:[V4,j4,vs,xs,gr],bodyVariants:[["intro","details","outro"],["updatedIntro","details","outro"],["cancelledIntro","details","cancelledOutro"]],slots:[be({de:"{{appointmentChange}}: Termin \u201E{{appointmentTitle}}\u201C",en:"{{appointmentChange}}: appointment \u201C{{appointmentTitle}}\u201D"}),{key:"intro",label:"Einleitung (Einladung)",multiline:!0,default:{de:"Sie nehmen an diesem Termin teil:",en:"You are taking part in this appointment:"}},{key:"updatedIntro",label:"Einleitung (ge\xE4ndert)",multiline:!0,default:{de:"Ein Termin, an dem Sie teilnehmen, hat sich ge\xE4ndert:",en:"An appointment you are taking part in has changed:"}},{key:"cancelledIntro",label:"Einleitung (abgesagt)",multiline:!0,default:{de:"Dieser Termin findet f\xFCr Sie nicht statt:",en:"This appointment no longer takes place for you:"}},{key:"details",label:"Termin",multiline:!0,default:{de:`{{appointmentTitle}}
11719
+ {{applicationLink}}`}}]},q3=["invite","update","cancel"],K3=m.object({...Xe,appointmentId:m.id("appointments"),kind:m.union(...q3.map(e=>m.literal(e))),appointmentTitle:m.string()}),j3={...bs,subjectSafe:!0},V3={key:"appointmentChange",label:"Art der Nachricht",subjectSafe:!0},NL={id:"staff.appointmentHosted",category:"staffAppointments",label:"Kalendereinladung an die Teilnehmenden",occasion:{de:"Sobald ein Termin gebucht, verschoben oder abgesagt wird oder sich die Teilnehmenden \xE4ndern \u2014 an jede teilnehmende Person",en:"When an appointment is booked, moved or cancelled, or its participants change \u2014 to each participant"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:K3,channels:["email"],portalVisible:!1,placeholders:[V3,j3,vs,xs,gr],bodyVariants:[["intro","details","outro"],["updatedIntro","details","outro"],["cancelledIntro","details","cancelledOutro"]],slots:[be({de:"{{appointmentChange}}: Termin \u201E{{appointmentTitle}}\u201C",en:"{{appointmentChange}}: appointment \u201C{{appointmentTitle}}\u201D"}),{key:"intro",label:"Einleitung (Einladung)",multiline:!0,default:{de:"Sie nehmen an diesem Termin teil:",en:"You are taking part in this appointment:"}},{key:"updatedIntro",label:"Einleitung (ge\xE4ndert)",multiline:!0,default:{de:"Ein Termin, an dem Sie teilnehmen, hat sich ge\xE4ndert:",en:"An appointment you are taking part in has changed:"}},{key:"cancelledIntro",label:"Einleitung (abgesagt)",multiline:!0,default:{de:"Dieser Termin findet f\xFCr Sie nicht statt:",en:"This appointment no longer takes place for you:"}},{key:"details",label:"Termin",multiline:!0,default:{de:`{{appointmentTitle}}
11720
11720
  {{appointmentWhen}}
11721
11721
  Ort: {{appointmentLocation}}`,en:`{{appointmentTitle}}
11722
11722
  {{appointmentWhen}}
@@ -11728,11 +11728,11 @@ Location: {{appointmentLocation}}`}},{key:"outro",label:"Abschluss",multiline:!0
11728
11728
 
11729
11729
  {{applicationLink}}`,en:`The attached calendar file removes the appointment from your calendar. The application:
11730
11730
 
11731
- {{applicationLink}}`}}]},PL={key:"einstellungenLink",label:"Link zu Plexus (Einstellungen)",required:!0,link:!0,actionLabel:{de:"Plexus \xF6ffnen",en:"Open Plexus"}},B4={key:"kategorie",label:"Ge\xE4nderte Mailart"},U4={key:"vorher",label:"Bisherige Einstellung"},G4={key:"nachher",label:"Neue Einstellung"},z4=m.object({tenantSlug:m.string(),category:$L,email:m.boolean()}),CL={id:"staff.mailSettingChanged",category:"security",label:"E-Mail-Einstellung ge\xE4ndert",occasion:{de:"Wenn die Schulverwaltung eine pers\xF6nliche E-Mail-Einstellung einer Person \xE4ndert",en:"When the school's administration changes a person's personal email setting"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:z4,channels:["email"],portalVisible:!1,placeholders:[Je,B4,U4,G4,PL],slots:[be({de:"Ihre E-Mail-Einstellungen wurden ge\xE4ndert",en:"Your email settings were changed"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"die Schulverwaltung von {{schoolName}} hat eine Ihrer E-Mail-Einstellungen ge\xE4ndert: \u201E{{kategorie}}\u201C ist jetzt {{nachher}} (bisher {{vorher}}).",en:"The administration of {{schoolName}} has changed one of your email settings: \u201C{{kategorie}}\u201D is now {{nachher}} (previously {{vorher}})."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Sie k\xF6nnen die Einstellung jederzeit selbst wieder \xE4ndern \u2014 es gilt immer die letzte \xC4nderung. In Plexus finden Sie sie im Benutzermen\xFC unter \u201EEinstellungen\u201C:
11731
+ {{applicationLink}}`}}]},PL={key:"einstellungenLink",label:"Link zu Plexus (Einstellungen)",required:!0,link:!0,actionLabel:{de:"Plexus \xF6ffnen",en:"Open Plexus"}},B3={key:"kategorie",label:"Ge\xE4nderte Mailart"},U3={key:"vorher",label:"Bisherige Einstellung"},G3={key:"nachher",label:"Neue Einstellung"},z3=m.object({tenantSlug:m.string(),category:$L,email:m.boolean()}),CL={id:"staff.mailSettingChanged",category:"security",label:"E-Mail-Einstellung ge\xE4ndert",occasion:{de:"Wenn die Schulverwaltung eine pers\xF6nliche E-Mail-Einstellung einer Person \xE4ndert",en:"When the school's administration changes a person's personal email setting"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:z3,channels:["email"],portalVisible:!1,placeholders:[Je,B3,U3,G3,PL],slots:[be({de:"Ihre E-Mail-Einstellungen wurden ge\xE4ndert",en:"Your email settings were changed"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"die Schulverwaltung von {{schoolName}} hat eine Ihrer E-Mail-Einstellungen ge\xE4ndert: \u201E{{kategorie}}\u201C ist jetzt {{nachher}} (bisher {{vorher}}).",en:"The administration of {{schoolName}} has changed one of your email settings: \u201C{{kategorie}}\u201D is now {{nachher}} (previously {{vorher}})."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Sie k\xF6nnen die Einstellung jederzeit selbst wieder \xE4ndern \u2014 es gilt immer die letzte \xC4nderung. In Plexus finden Sie sie im Benutzermen\xFC unter \u201EEinstellungen\u201C:
11732
11732
 
11733
11733
  {{einstellungenLink}}`,en:`You can change the setting back yourself at any time \u2014 the latest change always applies. In Plexus you find it in the user menu under \u201CSettings\u201D:
11734
11734
 
11735
- {{einstellungenLink}}`}}]},W4=m.object({tenantSlug:m.string()}),DL={id:"staff.signatureRequested",category:"security",label:"Unterschrift angefordert",occasion:{de:"Wenn die Schulverwaltung eine Person bittet, ihre Unterschrift zu hinterlegen",en:"When the school's administration asks a person to store their signature"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:W4,channels:["email"],portalVisible:!1,placeholders:[Je,PL],slots:[be({de:"Bitte hinterlegen Sie Ihre Unterschrift",en:"Please store your signature"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"die Schulverwaltung von {{schoolName}} bittet Sie, in Plexus Ihre Unterschrift zu hinterlegen. Nur Sie selbst k\xF6nnen sie hinterlegen; die Schule sieht danach, dass sie vorliegt.",en:"The administration of {{schoolName}} asks you to store your signature in Plexus. Only you can store it; the school then sees that it is there."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`\xD6ffnen Sie Plexus und im Benutzermen\xFC \u201EEinstellungen\u201C \u2192 \u201EUnterschrift\u201C:
11735
+ {{einstellungenLink}}`}}]},W3=m.object({tenantSlug:m.string()}),DL={id:"staff.signatureRequested",category:"security",label:"Unterschrift angefordert",occasion:{de:"Wenn die Schulverwaltung eine Person bittet, ihre Unterschrift zu hinterlegen",en:"When the school's administration asks a person to store their signature"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:W3,channels:["email"],portalVisible:!1,placeholders:[Je,PL],slots:[be({de:"Bitte hinterlegen Sie Ihre Unterschrift",en:"Please store your signature"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"die Schulverwaltung von {{schoolName}} bittet Sie, in Plexus Ihre Unterschrift zu hinterlegen. Nur Sie selbst k\xF6nnen sie hinterlegen; die Schule sieht danach, dass sie vorliegt.",en:"The administration of {{schoolName}} asks you to store your signature in Plexus. Only you can store it; the school then sees that it is there."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`\xD6ffnen Sie Plexus und im Benutzermen\xFC \u201EEinstellungen\u201C \u2192 \u201EUnterschrift\u201C:
11736
11736
 
11737
11737
  {{einstellungenLink}}`,en:`Open Plexus and, in the user menu, \u201CSettings\u201D \u2192 \u201CSignature\u201D:
11738
11738
 
@@ -11744,7 +11744,7 @@ Location: {{appointmentLocation}}`}},{key:"outro",label:"Abschluss",multiline:!0
11744
11744
 
11745
11745
  {{applicationLink}}`,en:`Please assign the task to a person in the application:
11746
11746
 
11747
- {{applicationLink}}`}}]},Y4=m.object({...Xe,workItemId:m.id("work_items"),queuedAt:m.number()}),H4={key:"queuedDate",label:"Seit (Tag der Ankunft in der Queue)",subjectSafe:!0},BL={id:"staff.taskUnassignedTooLong",category:"staffUnassigned",label:"Aufgabe zu lange niemandem zugewiesen",occasion:{de:`Wenn eine Aufgabe einer Bewerbung so viele Tage bearbeitbar in der Queue ihres Teams liegt, wie die Schule eingestellt hat (Vorgabe: ${3}), und niemand sie \xFCbernommen hat \u2014 einmal je Ankunft`,en:`When a task of an application has been workable in its team's queue for as many days as the school set (default: ${3}) and nobody has taken it \u2014 once per arrival`},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:Y4,channels:["email"],portalVisible:!1,placeholders:[Ui,H4,kr,gr],slots:[be({de:"Seit {{queuedDate}} niemandem zugewiesen: eine Aufgabe wartet",en:"Assigned to nobody since {{queuedDate}}: a task is waiting"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"die Aufgabe \u201E{{taskTitle}}\u201C in der Bewerbung von {{applicantName}} liegt seit dem {{queuedDate}} in der Queue ihres Teams, und niemand hat sie \xFCbernommen.",en:"The task \u201C{{taskTitle}}\u201D on {{applicantName}}\u2019s application has been waiting in its team\u2019s queue since {{queuedDate}}, and nobody has taken it."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Bitte weisen Sie die Aufgabe in der Bewerbung einer Person zu:
11747
+ {{applicationLink}}`}}]},Y3=m.object({...Xe,workItemId:m.id("work_items"),queuedAt:m.number()}),H3={key:"queuedDate",label:"Seit (Tag der Ankunft in der Queue)",subjectSafe:!0},BL={id:"staff.taskUnassignedTooLong",category:"staffUnassigned",label:"Aufgabe zu lange niemandem zugewiesen",occasion:{de:`Wenn eine Aufgabe einer Bewerbung so viele Tage bearbeitbar in der Queue ihres Teams liegt, wie die Schule eingestellt hat (Vorgabe: ${3}), und niemand sie \xFCbernommen hat \u2014 einmal je Ankunft`,en:`When a task of an application has been workable in its team's queue for as many days as the school set (default: ${3}) and nobody has taken it \u2014 once per arrival`},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:Y3,channels:["email"],portalVisible:!1,placeholders:[Ui,H3,kr,gr],slots:[be({de:"Seit {{queuedDate}} niemandem zugewiesen: eine Aufgabe wartet",en:"Assigned to nobody since {{queuedDate}}: a task is waiting"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"die Aufgabe \u201E{{taskTitle}}\u201C in der Bewerbung von {{applicantName}} liegt seit dem {{queuedDate}} in der Queue ihres Teams, und niemand hat sie \xFCbernommen.",en:"The task \u201C{{taskTitle}}\u201D on {{applicantName}}\u2019s application has been waiting in its team\u2019s queue since {{queuedDate}}, and nobody has taken it."}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Bitte weisen Sie die Aufgabe in der Bewerbung einer Person zu:
11748
11748
 
11749
11749
  {{applicationLink}}`,en:`Please assign the task to a person in the application:
11750
11750
 
@@ -11752,11 +11752,11 @@ Location: {{appointmentLocation}}`}},{key:"outro",label:"Abschluss",multiline:!0
11752
11752
 
11753
11753
  {{taskLink}}`,en:`Go straight to the task:
11754
11754
 
11755
- {{taskLink}}`}}]},J4={key:"feedbackLink",label:"Link zum Feedback",required:!0,link:!0,actionLabel:{de:"Feedback abgeben",en:"Give feedback"},previewValue:{de:"https://beispiel.plexus.schule/schule/respond?token=BEISPIEL",en:"https://beispiel.plexus.schule/schule/respond?token=BEISPIEL"}},Q4={key:"appointmentWhen",label:"Datum und Uhrzeit des Termins"},KL={plain:["intro","outro"],appointment:["intro","appointment","outro"]},WL={id:"staff.feedbackRequested",category:"staffFeedback",label:"Bitte um Feedback",occasion:{de:"Sobald eine Feedback-Aufgabe beantwortet werden kann \u2014 an die Person, die sie hat, oder \u2014 solange niemand sie hat \u2014 an die verantwortliche Person des Prozesses",en:"When a feedback task can be answered \u2014 to the person who has it, or \u2014 while nobody has it \u2014 to the process's responsible person"},audience:"internal",deputyCopy:!1,frame:"notice",timeline:"hidden",paramsValidator:UL,channels:["email"],portalVisible:!1,placeholders:[rv,J4,Q4],bodyVariants:[KL.plain,KL.appointment],slots:[be({de:"Bitte um Feedback: {{taskTitle}}",en:"Feedback requested: {{taskTitle}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"Ihre Schule hat eine Aufgabe f\xFCr Sie: {{taskTitle}}.",en:"Your school has a task for you: {{taskTitle}}."}},{key:"appointment",label:"Termin",multiline:!0,default:{de:"Termin: {{appointmentWhen}}",en:"Appointment: {{appointmentWhen}}"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`{{feedbackLink}}
11755
+ {{taskLink}}`}}]},J3={key:"feedbackLink",label:"Link zum Feedback",required:!0,link:!0,actionLabel:{de:"Feedback abgeben",en:"Give feedback"},previewValue:{de:"https://beispiel.plexus.schule/schule/respond?token=BEISPIEL",en:"https://beispiel.plexus.schule/schule/respond?token=BEISPIEL"}},Q3={key:"appointmentWhen",label:"Datum und Uhrzeit des Termins"},KL={plain:["intro","outro"],appointment:["intro","appointment","outro"]},WL={id:"staff.feedbackRequested",category:"staffFeedback",label:"Bitte um Feedback",occasion:{de:"Sobald eine Feedback-Aufgabe beantwortet werden kann \u2014 an die Person, die sie hat, oder \u2014 solange niemand sie hat \u2014 an die verantwortliche Person des Prozesses",en:"When a feedback task can be answered \u2014 to the person who has it, or \u2014 while nobody has it \u2014 to the process's responsible person"},audience:"internal",deputyCopy:!1,frame:"notice",timeline:"hidden",paramsValidator:UL,channels:["email"],portalVisible:!1,placeholders:[rv,J3,Q3],bodyVariants:[KL.plain,KL.appointment],slots:[be({de:"Bitte um Feedback: {{taskTitle}}",en:"Feedback requested: {{taskTitle}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"Ihre Schule hat eine Aufgabe f\xFCr Sie: {{taskTitle}}.",en:"Your school has a task for you: {{taskTitle}}."}},{key:"appointment",label:"Termin",multiline:!0,default:{de:"Termin: {{appointmentWhen}}",en:"Appointment: {{appointmentWhen}}"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`{{feedbackLink}}
11756
11756
 
11757
11757
  Der Link gilt 30 Tage und antwortet in Ihrem Namen. Bitte leiten Sie diese E-Mail nicht weiter.`,en:`{{feedbackLink}}
11758
11758
 
11759
- The link is valid for 30 days and answers in your name. Please do not forward this email.`}}]},Z4=m.object({tenantSlug:m.string(),recipientUserId:m.id("users"),workItemId:m.id("work_items"),taskTitle:m.string(),actionLabel:m.string()}),X4={key:"actionLabel",label:"Worauf die Aufgabe gewartet hat",subjectSafe:!0},YL={id:"staff.taskResumed",category:"staffAssigned",label:"Aufgabe kann weitergef\xFChrt werden",occasion:{de:"Sobald eine Aufgabe, die auf eine optionale Aktion (z. B. Taster Day) oder die Nachbearbeitung durch die Familie gewartet hat, weitergef\xFChrt werden kann \u2014 an die Person, die sie hat (nicht an die, die das Warten beendet hat)",en:"When a task that waited for an optional action (e.g. Taster Day) or for the family's rework can be continued \u2014 to the person who has it (not to whoever ended the wait)"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:Z4,channels:["email"],portalVisible:!1,placeholders:[rv,X4,GL],slots:[be({de:"Kann weitergef\xFChrt werden: {{taskTitle}}",en:"Can be continued: {{taskTitle}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"\u201E{{actionLabel}}\u201C ist beendet. Diese Aufgabe kann weitergef\xFChrt werden:",en:"\u201C{{actionLabel}}\u201D has ended. This task can be continued:"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Direkt zur Aufgabe:
11759
+ The link is valid for 30 days and answers in your name. Please do not forward this email.`}}]},Z3=m.object({tenantSlug:m.string(),recipientUserId:m.id("users"),workItemId:m.id("work_items"),taskTitle:m.string(),actionLabel:m.string()}),X3={key:"actionLabel",label:"Worauf die Aufgabe gewartet hat",subjectSafe:!0},YL={id:"staff.taskResumed",category:"staffAssigned",label:"Aufgabe kann weitergef\xFChrt werden",occasion:{de:"Sobald eine Aufgabe, die auf eine optionale Aktion (z. B. Taster Day) oder die Nachbearbeitung durch die Familie gewartet hat, weitergef\xFChrt werden kann \u2014 an die Person, die sie hat (nicht an die, die das Warten beendet hat)",en:"When a task that waited for an optional action (e.g. Taster Day) or for the family's rework can be continued \u2014 to the person who has it (not to whoever ended the wait)"},audience:"internal",frame:"notice",timeline:"hidden",paramsValidator:Z3,channels:["email"],portalVisible:!1,placeholders:[rv,X3,GL],slots:[be({de:"Kann weitergef\xFChrt werden: {{taskTitle}}",en:"Can be continued: {{taskTitle}}"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:"\u201E{{actionLabel}}\u201C ist beendet. Diese Aufgabe kann weitergef\xFChrt werden:",en:"\u201C{{actionLabel}}\u201D has ended. This task can be continued:"}},{key:"outro",label:"Abschluss",multiline:!0,default:{de:`Direkt zur Aufgabe:
11760
11760
 
11761
11761
  {{taskLink}}`,en:`Go straight to the task:
11762
11762
 
@@ -12033,7 +12033,7 @@ ${n.length} unusable ${o}:
12033
12033
  `),r.length>0&&this.context.stdout.write(` ${r.length} linkable \u2014 plexus-cli platform users relink-auth <email>
12034
12034
  `),i.length>0&&this.context.stdout.write(` ${i.length} without any login account \u2014 plexus-cli platform users provision --tenant <slug> --email <email> --name <name>
12035
12035
  `)}else this.context.stdout.write(`No unusable identities.
12036
- `);return n.length>0?1:0}},GE=class extends Er{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=E.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=n.changed?`Relinked ${this.email} to live auth account ${n.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(n,r),0}};function aW(e,t){if(e===t)throw new g("Pass exactly one of --on or --off.");return e}s(aW,"requireOnOff");var lW=[EE,IE,OE,_E,NE,PE,CE,DE,FE,LE,ff,ME,qE,KE,jE,VE,BE,UE,GE];function dW(e){return e.de??e.en??Object.values(e)[0]??""}s(dW,"titleDe");function Wte(e){return{id:e._id,kind:e.kind,status:e.status,title:dW(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(Wte,"row");var Yte=["id","kind","status","title","assignee","group","outcome"],YE=class extends P{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=E.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.list,{client:n,...this.mine?{mine:!0}:{},...this.application?{applicationId:ee(this.application,"application")}:{},...this.group?{queueGroupId:ee(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:ee(this.assignee,"user")}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(Wte),Yte),0}},HE=class extends P{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=E.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.get,{client:n,workItemId:ee(this.workItemId,"work item")});if(r===null)throw new g(`work-item ${this.workItemId} not found in tenant ${n}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:dW(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},JE=class extends P{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=E.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.createManual,{client:n,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:ee(this.application,"application")}:{},...this.group?{queueGroupId:ee(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:ee(this.assignee,"user")}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},QE=class extends P{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=E.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.complete,{client:n,workItemId:ee(this.workItemId,"work item"),...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},ZE=class extends P{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=E.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.assign,{client:n,workItemId:ee(this.workItemId,"work item"),...this.user?{userId:ee(this.user,"user")}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},cW=[YE,HE,JE,QE,ZE];var El=[...W_,...bM,...IM,...Mq,...Vq,...Lq,...mK,...vK,...bK,...oW,...lW,...iW,...qG,...GG,...JG,...tM,...cK,...zz,...U_,...SN,...K0,...AK,...SK,...$K,...OK,...lK,...Yq,...cW,...JB,...qU,...LG,...KU,...Oz,...Lz,...QG,...sz,...dz,...pz,...hz,...Kz,...Qz,...pN];for(let e of El){let t=e.paths?.[0];t===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:sO(e.usage.category,t.join(" "))})}var uW="0.1.363";function XE(){return El.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=nO[Go(n)];return{path:n,effect:Ai(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(XE,"plexusCommandCatalog");import Vs from"node:path";function Hte(e){let t=gt()?.workspaceRoot??process.cwd(),n=Vs.resolve(t,e),r=Vs.relative(t,n);if(Vs.isAbsolute(e)||r===".."||r.startsWith(`..${Vs.sep}`))throw new g("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(Hte,"workspacePath");function Jte(e){let{absolute:t,relative:n}=Hte(e.path??".");if(e.operation==="list"){if(!Re(t))return{files:[]};let r=[],i=s(o=>{for(let a of Hr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new g("plexus: workspace symlinks are not supported.");let l=Vs.join(o,a.name);if(a.isDirectory()?i(l):r.push(Vs.relative(t,l)),r.length>200)throw new g("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(t),{files:r.sort()}}if(!n)throw new g("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=Ne(t);if(r.length>10*1024*1024)throw new g("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:n,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new g("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:n,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new g("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new g("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new g("plexus: the edited file exceeds 10 MB.");return Ze(t,a,"utf8"),{path:n,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new g("plexus: file content is missing or too large.");return Gt(Vs.dirname(t),{recursive:!0}),Ze(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return zs(t),{path:n,removed:!0};throw new g("plexus: unknown workspace operation.")}s(Jte,"plexusWorkspace");function fW(e){return s(async function(n,r){if(!r||typeof r!="object"||Array.isArray(r))throw new g("plexus: tool input must be an object.");let i=r,o=dd[n];if(!o||!Object.hasOwn(dd,n))throw new g("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new g("plexus: unexpected tool argument.");if(n==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new g("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(n==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(jw,i.path))throw new g("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:jw[i.path],skillHash:Sp}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new g("plexus: invalid workspace input.");return Jte(i)},"executePlexusAgentTool")}s(fW,"createPlexusAgentToolExecutor");var Qte=["--env","--tenant"];function pW(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i==="--"){t.push(...e.slice(r));break}let o=Qte.find(l=>i===l||i.startsWith(`${l}=`)),a=e[r+1];o===void 0?t.push(i):i!==o?n.push({name:o,value:i.slice(o.length+1)}):a!==void 0&&!a.startsWith("-")?(n.push({name:o,value:a}),r++):t.push(i)}return{rest:t,given:n}}s(pW,"splitGlobalOptions");function mW(e,t){let n=ew(e)==="offline";if(n&&Ai(e)==="read")return t.map(i=>`plexus-cli: ${i.name} ${i.value} has no effect: \`${e}\` runs offline (this CLI's own files, no deployment).
12036
+ `);return n.length>0?1:0}},GE=class extends Er{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=E.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=n.changed?`Relinked ${this.email} to live auth account ${n.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(n,r),0}};function aW(e,t){if(e===t)throw new g("Pass exactly one of --on or --off.");return e}s(aW,"requireOnOff");var lW=[EE,IE,OE,_E,NE,PE,CE,DE,FE,LE,ff,ME,qE,KE,jE,VE,BE,UE,GE];function dW(e){return e.de??e.en??Object.values(e)[0]??""}s(dW,"titleDe");function Wte(e){return{id:e._id,kind:e.kind,status:e.status,title:dW(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(Wte,"row");var Yte=["id","kind","status","title","assignee","group","outcome"],YE=class extends P{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=E.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.list,{client:n,...this.mine?{mine:!0}:{},...this.application?{applicationId:ee(this.application,"application")}:{},...this.group?{queueGroupId:ee(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:ee(this.assignee,"user")}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(Wte),Yte),0}},HE=class extends P{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=E.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.get,{client:n,workItemId:ee(this.workItemId,"work item")});if(r===null)throw new g(`work-item ${this.workItemId} not found in tenant ${n}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:dW(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},JE=class extends P{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=E.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.createManual,{client:n,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:ee(this.application,"application")}:{},...this.group?{queueGroupId:ee(this.group,"permission group")}:{},...this.assignee?{assigneeUserId:ee(this.assignee,"user")}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},QE=class extends P{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=E.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.complete,{client:n,workItemId:ee(this.workItemId,"work item"),...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},ZE=class extends P{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=E.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.assign,{client:n,workItemId:ee(this.workItemId,"work item"),...this.user?{userId:ee(this.user,"user")}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},cW=[YE,HE,JE,QE,ZE];var El=[...W_,...bM,...IM,...Mq,...Vq,...Lq,...mK,...vK,...bK,...oW,...lW,...iW,...qG,...GG,...JG,...tM,...cK,...zz,...U_,...SN,...K0,...AK,...SK,...$K,...OK,...lK,...Yq,...cW,...JB,...qU,...LG,...KU,...Oz,...Lz,...QG,...sz,...dz,...pz,...hz,...Kz,...Qz,...pN];for(let e of El){let t=e.paths?.[0];t===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:sO(e.usage.category,t.join(" "))})}var uW="0.1.365";function XE(){return El.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=nO[Go(n)];return{path:n,effect:Ai(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(XE,"plexusCommandCatalog");import Vs from"node:path";function Hte(e){let t=gt()?.workspaceRoot??process.cwd(),n=Vs.resolve(t,e),r=Vs.relative(t,n);if(Vs.isAbsolute(e)||r===".."||r.startsWith(`..${Vs.sep}`))throw new g("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(Hte,"workspacePath");function Jte(e){let{absolute:t,relative:n}=Hte(e.path??".");if(e.operation==="list"){if(!Re(t))return{files:[]};let r=[],i=s(o=>{for(let a of Hr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new g("plexus: workspace symlinks are not supported.");let l=Vs.join(o,a.name);if(a.isDirectory()?i(l):r.push(Vs.relative(t,l)),r.length>200)throw new g("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(t),{files:r.sort()}}if(!n)throw new g("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=Ne(t);if(r.length>10*1024*1024)throw new g("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:n,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new g("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:n,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new g("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new g("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new g("plexus: the edited file exceeds 10 MB.");return Ze(t,a,"utf8"),{path:n,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new g("plexus: file content is missing or too large.");return Gt(Vs.dirname(t),{recursive:!0}),Ze(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return zs(t),{path:n,removed:!0};throw new g("plexus: unknown workspace operation.")}s(Jte,"plexusWorkspace");function fW(e){return s(async function(n,r){if(!r||typeof r!="object"||Array.isArray(r))throw new g("plexus: tool input must be an object.");let i=r,o=dd[n];if(!o||!Object.hasOwn(dd,n))throw new g("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new g("plexus: unexpected tool argument.");if(n==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new g("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(n==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(jw,i.path))throw new g("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:jw[i.path],skillHash:Sp}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new g("plexus: invalid workspace input.");return Jte(i)},"executePlexusAgentTool")}s(fW,"createPlexusAgentToolExecutor");var Qte=["--env","--tenant"];function pW(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i==="--"){t.push(...e.slice(r));break}let o=Qte.find(l=>i===l||i.startsWith(`${l}=`)),a=e[r+1];o===void 0?t.push(i):i!==o?n.push({name:o,value:i.slice(o.length+1)}):a!==void 0&&!a.startsWith("-")?(n.push({name:o,value:a}),r++):t.push(i)}return{rest:t,given:n}}s(pW,"splitGlobalOptions");function mW(e,t){let n=ew(e)==="offline";if(n&&Ai(e)==="read")return t.map(i=>`plexus-cli: ${i.name} ${i.value} has no effect: \`${e}\` runs offline (this CLI's own files, no deployment).
12037
12037
  `);let r=[...new Set(t.map(i=>i.name))].join(", ");throw new g(n?`\`${e}\` does not take ${r}: it never targets a chosen deployment \u2014 drop the option.`:`\`${e}\` does not take ${r}.`)}s(mW,"globalOptionNotes");var Ty=fW({inspectCommand:gW,executeCommand:yW});function Ry(){let e=new Js({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:uW});e.register(Kl.HelpCommand),e.register(Kl.VersionCommand);for(let r of El)e.register(r);function t(r,i){try{return{command:e.process(r,i),notes:[]}}catch(o){let{rest:a,given:l}=pW(r);if(l.length===0)throw o;let d;try{d=e.process(a,i)}catch{throw o}if(!El.some(u=>d instanceof u))return{command:d,notes:[]};let c=d.path.join(" ");if(!XE().some(u=>u.path===c))throw o;return{command:d,notes:mW(c,l)}}}s(t,"resolve");async function n(r,i){let o=i.stderr??process.stderr,a;try{a=t(r,i)}catch(l){return o.write(e.error(l,{colored:!1})),2}for(let l of a.notes)o.write(l);return ene(a.command,o),e.run(a.command,i)}return s(n,"run"),{process(r,i){return t(r,i).command},run:n,async runExit(r,i){process.exitCode=await n(r,i)}}}s(Ry,"createPlexusCli");function ene(e,t){let n=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&n!==r&&Wl[n]===r&&pt(t,n,r),n in Wl&&Ai(n)==="confirm"&&!Yl(e)&&t.write(`plexus-cli: \`${Wl[n]}\` only prints its plan without --confirm \u2014 nothing was changed.
12038
12038
  `)}s(ene,"noteRetiredPath");function gW(e){let t=Ry().process(_l(e),{executePlexusAgentTool:Ty}),n=t.path.join(" ");if(n.startsWith("agent "))throw new Error("plexus: nested agent transports are not allowed.");let r=XE().find(d=>d.path===n);if(!r){if(n===""||n==="--help"||n==="--version")return{path:n,writes:!1,host:"shared"};throw new Error(`plexus: command ${n} has no host classification.`)}let i="fn"in t&&typeof t.fn=="string"?t.fn:"",o="kind"in t&&typeof t.kind=="string"?t.kind:void 0,a=r.effect==="callKind"?Fh(dl(cl),i,o):void 0,l=zf(n,{confirm:Yl(t),callKind:a});return{...r,writes:l}}s(gW,"inspectPlexusCommand");async function yW(e,t){if(t)return sI(t,()=>yW(e));if(!Array.isArray(e.argv)||e.argv.length===0||e.argv.length>128||e.argv.some(l=>typeof l!="string"||l.length>128e3)||(e.stdin?.length??0)>1e6)throw new Error("plexus: invalid command invocation.");let n="",r="",i=Ry();if(gt()){let l=gW(e.argv);if(l.host==="terminal")throw new Error(`plexus: this command requires a local machine. ${l.reason??""}`)}return{exitCode:await i.run(_l(e.argv),{executePlexusAgentTool:Ty,stdin:Xte.from(e.stdin===void 0?[]:[e.stdin]),stdout:new hW({write(l,d,c){n+=String(l),c()}}),stderr:new hW({write(l,d,c){r+=String(l),c()}})}),stdout:n,stderr:r}}s(yW,"executePlexusCommand");iI();uI({source:tne.join(import.meta.dirname,"skill")});Ry().runExit(_l(process.argv.slice(2)),{executePlexusAgentTool:Ty});
12039
12039
  //# sourceMappingURL=cli.mjs.map