@stndrds/schema 1.0.0-alpha.298 → 1.0.0-alpha.299

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.
Files changed (59) hide show
  1. package/dist/{all-BekDmUP1.d.mts → all-A2bb4nkl.d.mts} +3 -3
  2. package/dist/{all-Bl3DlCEn.d.ts → all-pjzlyj8G.d.ts} +3 -3
  3. package/dist/{attributes-SIbTof03.d.ts → attributes-DfhBu4HT.d.ts} +7 -1
  4. package/dist/{attributes-CtS5Gf_i.d.mts → attributes-Zw-DDGE7.d.mts} +7 -1
  5. package/dist/{chunk-GWAHL4A2.mjs → chunk-MQO25YZ6.mjs} +1 -1
  6. package/dist/{chunk-SDOYGWU4.js → chunk-VJYVPQ5E.js} +1 -1
  7. package/dist/exceptions.d.mts +2 -2
  8. package/dist/exceptions.d.ts +2 -2
  9. package/dist/{helpers-BUsoR80N.d.mts → helpers-BeDYpa3f.d.mts} +3 -3
  10. package/dist/{helpers-DZFOorZt.d.ts → helpers-D4S6olXa.d.ts} +3 -3
  11. package/dist/{index-DaY37pqb.d.ts → index-bLWyLCrA.d.ts} +4 -2
  12. package/dist/{index-EHhbbH-p.d.mts → index-vpNijPxd.d.mts} +4 -2
  13. package/dist/index.d.mts +41 -16
  14. package/dist/index.d.ts +41 -16
  15. package/dist/index.js +18 -18
  16. package/dist/index.mjs +15 -15
  17. package/dist/{migrations-DhQ05TqN.d.ts → migrations-B1Wl_3RY.d.ts} +1 -1
  18. package/dist/{migrations-DRBic-QO.d.mts → migrations-BG2mNaJn.d.mts} +1 -1
  19. package/dist/{objects-KU7alqZq.d.mts → objects-CmdtJjMN.d.mts} +2 -2
  20. package/dist/{objects-DMOfJNYg.d.ts → objects-DyVm3xIi.d.ts} +2 -2
  21. package/dist/{types-ldo4nJxP.d.mts → types-M5L07ItN.d.mts} +1 -1
  22. package/dist/{types-BNaHEz_n.d.ts → types-R2f1GdCB.d.ts} +1 -1
  23. package/dist/validation/all.d.mts +7 -7
  24. package/dist/validation/all.d.ts +7 -7
  25. package/dist/validation/all.js +1 -1
  26. package/dist/validation/all.mjs +1 -1
  27. package/dist/validation/complex/currency.d.mts +2 -2
  28. package/dist/validation/complex/currency.d.ts +2 -2
  29. package/dist/validation/complex/location.d.mts +2 -2
  30. package/dist/validation/complex/location.d.ts +2 -2
  31. package/dist/validation/complex/phone.d.mts +2 -2
  32. package/dist/validation/complex/phone.d.ts +2 -2
  33. package/dist/validation/complex/relation.d.mts +2 -2
  34. package/dist/validation/complex/relation.d.ts +2 -2
  35. package/dist/validation/complex/richtext.d.mts +2 -2
  36. package/dist/validation/complex/richtext.d.ts +2 -2
  37. package/dist/validation/complex/select.d.mts +2 -2
  38. package/dist/validation/complex/select.d.ts +2 -2
  39. package/dist/validation/complex/user.d.mts +2 -2
  40. package/dist/validation/complex/user.d.ts +2 -2
  41. package/dist/validation/computed/formula.d.mts +2 -2
  42. package/dist/validation/computed/formula.d.ts +2 -2
  43. package/dist/validation/computed/rollup.d.mts +2 -2
  44. package/dist/validation/computed/rollup.d.ts +2 -2
  45. package/dist/validation/config/index.d.mts +4 -4
  46. package/dist/validation/config/index.d.ts +4 -4
  47. package/dist/validation/core/index.d.mts +3 -3
  48. package/dist/validation/core/index.d.ts +3 -3
  49. package/dist/validation/object/index.d.mts +5 -5
  50. package/dist/validation/object/index.d.ts +5 -5
  51. package/dist/validation/primitives/checkbox.d.mts +2 -2
  52. package/dist/validation/primitives/checkbox.d.ts +2 -2
  53. package/dist/validation/primitives/date.d.mts +2 -2
  54. package/dist/validation/primitives/date.d.ts +2 -2
  55. package/dist/validation/primitives/number.d.mts +2 -2
  56. package/dist/validation/primitives/number.d.ts +2 -2
  57. package/dist/validation/primitives/text.d.mts +2 -2
  58. package/dist/validation/primitives/text.d.ts +2 -2
  59. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
- 'use strict';var chunkLQYUPOWB_js=require('./chunk-LQYUPOWB.js'),chunkSDOYGWU4_js=require('./chunk-SDOYGWU4.js'),chunk47EGJRW7_js=require('./chunk-47EGJRW7.js'),chunk5QAE5NPN_js=require('./chunk-5QAE5NPN.js');require('./chunk-LWSOKXPF.js'),require('./chunk-XXTKNIBK.js'),require('./chunk-JOS2XMXY.js');var chunk47KVYDKG_js=require('./chunk-47KVYDKG.js'),chunkKLR22JMC_js=require('./chunk-KLR22JMC.js'),chunkGXSNLYRR_js=require('./chunk-GXSNLYRR.js');require('./chunk-UXISKZ5Y.js'),require('./chunk-XUAP7KWK.js'),require('./chunk-JVLH3DVZ.js'),require('./chunk-LSCBR4VS.js'),require('./chunk-23KPS33D.js');var chunk72TQRSNX_js=require('./chunk-72TQRSNX.js'),chunkXHEBV2HE_js=require('./chunk-XHEBV2HE.js'),chunkSLYRQ72J_js=require('./chunk-SLYRQ72J.js'),chunkJFSQ24XR_js=require('./chunk-JFSQ24XR.js'),chunkDPD6ZWL2_js=require('./chunk-DPD6ZWL2.js'),constants=require('@stndrds/constants'),Jt=require('zod');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Jt__default=/*#__PURE__*/_interopDefault(Jt);/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- var ki=["fyi","task","question","handoff","system"],Oi=["low","normal","high","urgent"],_i=["public","internal","sensitive"],Pi=["unread","read","archived","snoozed"],Fi=["none","pending","processing","completed","dismissed","expired","failed"],hs="agent.session.waiting_human",As="agent.task.assigned",Ts="agent.question.requested",Hf=[hs,As,Ts];var Jf=["name","type"],Xf=["required","hidden","archived","deprecated","defaultValue","config","order","unique"],Zf=["label","description","placeholder","icon"];var Vi=["text","richtext","number","checkbox","date","phone","currency","status","location","select","multiselect","user","relation","formula","rollup","document"],$t="*";function ji(e){return e.targets.length===1&&e.targets[0].object===$t}chunkDPD6ZWL2_js.a(ji,"isUniversalRelation");function rb(e){return e.bilateral!==void 0}chunkDPD6ZWL2_js.a(rb,"isBilateralRelation");function nb(e){return "many"}chunkDPD6ZWL2_js.a(nb,"inferInverseCardinality");function ib(e){return chunkSDOYGWU4_js.n(e)}chunkDPD6ZWL2_js.a(ib,"isAttributeSortable");var sb=["record","object","attribute","view","user","role","settings","file","agent","schema_source"],ub=["record.created","record.updated","record.deleted","record.restored","record.purged","object.created","object.updated","object.deleted","attribute.created","attribute.updated","attribute.deleted","view.created","view.updated","view.deleted","schema_source.applied","schema_source.removed","user.created","user.invited","user.updated","user.deleted","user.login","user.logout","role.created","role.updated","role.deleted","role.assigned","role.revoked","settings.updated","file.uploaded","file.updated","file.deleted"];function cb(e){return e.phase==="terminal"}chunkDPD6ZWL2_js.a(cb,"isTerminalState");function pb(e){switch(e.phase){case "running":return "active";case "queued":return "idle";case "parked":if(e.parkedOn===void 0)throw new chunk72TQRSNX_js.b("parked state without parkedOn",chunk72TQRSNX_js.a.INVARIANT_VIOLATION);return e.parkedOn==="agents"?"waiting_agents":"waiting_human";case "terminal":if(e.outcome===void 0)throw new chunk72TQRSNX_js.b("terminal state without outcome",chunk72TQRSNX_js.a.INVARIANT_VIOLATION);return e.outcome}}chunkDPD6ZWL2_js.a(pb,"sessionStateToLegacyStatus");function mb(e){switch(e){case "active":return {phase:"running"};case "idle":return {phase:"queued"};case "waiting_human":return {phase:"parked",parkedOn:"human",humanRequestIds:[]};case "waiting_agents":return {phase:"parked",parkedOn:"agents"};default:return {phase:"terminal",outcome:e}}}chunkDPD6ZWL2_js.a(mb,"legacyStatusToSessionState");var ws=["completed","failed","cancelled","timeout","expired"];function fb(e){return ws.includes(e)}chunkDPD6ZWL2_js.a(fb,"isTerminalSessionStatus");var xs=["idle","completed","waiting_human","waiting_agents","cancelled","failed","timeout"];function bb(e){return xs.includes(e)}chunkDPD6ZWL2_js.a(bb,"isClaimableSessionStatus");var Mi=Object.freeze({mutation:"ask",destructive:"ask",outward:"ask"}),gb=["active","completed","abandoned"],Li=["openai","anthropic","google","spacexai","deepseek","moonshotai","alibaba","mistral","minimax","meta","zai"],Bi=["standard","fast"],Ui=["none","minimal","low","medium","high","xhigh"];function yb(e){return e.label?.trim()||e.name}chunkDPD6ZWL2_js.a(yb,"agentDisplayName");var $i=["approval-requested","approval-responded","approval-dispatched"],Is=["streaming","running",...$i];function hb(e){return Is.includes(e)}chunkDPD6ZWL2_js.a(hb,"isOpenToolPartState");function Ab(e){return $i.includes(e)}chunkDPD6ZWL2_js.a(Ab,"isToolApprovalState");var qt=["CREDITS_EXHAUSTED"];function Tb(e){return typeof e=="string"&&qt.includes(e)}chunkDPD6ZWL2_js.a(Tb,"isSystemPartCode");function Ss(e,t){let r=e.createdAt.getTime()-t.createdAt.getTime();return r===0?e.id.localeCompare(t.id):r}chunkDPD6ZWL2_js.a(Ss,"compareAgentSessionMessages");function wb(e){return [...e].sort(Ss)}chunkDPD6ZWL2_js.a(wb,"orderAgentSessionMessages");var xb=["pending","in_progress","completed","blocked"],Ib=50,Sb=80,vb=500,Rb=2e3;var Nb="session-state",vs="__stndrdsNativeUiPartIds",Rs=1,Es="Native agent UI part IDs metadata is invalid";function se(){throw new chunk72TQRSNX_js.h(Es,[])}chunkDPD6ZWL2_js.a(se,"invalidNativePartIds");function qi(e){if(e===null||typeof e!="object"||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}chunkDPD6ZWL2_js.a(qi,"isPlainRecord");function Ds(e,t){if(e.type==="text"||e.type==="reasoning")return `${e.type}:${t}`;if(e.type==="tool")return `tool:${e.toolCallId}`}chunkDPD6ZWL2_js.a(Ds,"nativeAgentUIPartIdMetadataKey");function kb(e){let t=e.metadata?.[vs];qi(t)||se(),(Object.keys(t).length!==2||t.schemaVersion!==Rs||!qi(t.partIds))&&se();let r=new Map;for(let[s,l]of e.parts.entries()){let p=Ds(l,s);if(!p||r.has(p)){p&&se();continue}r.set(p,l);}let n=Object.entries(t.partIds);n.length!==r.size&&se();let o=new Map,a={};for(let[s,l]of n){let p=r.get(s);p&&typeof l=="string"&&l.length>0||se();let I=o.get(l);I&&(p.type==="tool"||I!==p.type)&&se(),p.type==="tool"&&l!==p.toolCallId&&se(),o.set(l,p.type),a[s]=l;}return a}chunkDPD6ZWL2_js.a(kb,"parseNativeAgentUIPartIdsMetadata");var Pb=16e3,Fb=3200,Vb=6400,jb=16e3,Mb=65536,Lb=15e3,Bb=1e4,Ub=5e3,$b="google/gemini-3.5-transcribe-live",qb={maxDurationMs:3e5,dailyDurationMs:36e5,monthlyDurationMs:72e6,tenantMonthlyBudgetMicrousd:5e7,globalMonthlyBudgetMicrousd:5e7,estimatedMicrousdPerSecond:150,reservationMultiplier:2};var Gb=["web","presentation","document","spreadsheet","image","code","other"],Wb=["ephemeral","conversation","persistent"],Kb=["source","preview","entrypoint","asset"];var zi=5;function Qb(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"?"message"in e&&typeof e.message=="string"?e.message:JSON.stringify(e):String(e)}chunkDPD6ZWL2_js.a(Qb,"getErrorMessage");function eg(e){return typeof e=="object"&&e!==null&&"slots"in e&&"steps"in e&&"name"in e&&typeof e.name=="string"&&Array.isArray(e.slots)&&Array.isArray(e.steps)}chunkDPD6ZWL2_js.a(eg,"isFormDefinition");var zt=["relation","multiRelation","formula","rollup","document","richtext","user"];function Gi(e){return e.type==="slot"}chunkDPD6ZWL2_js.a(Gi,"isFormSlotFieldRef");function Gt(e){return e.type==="free"}chunkDPD6ZWL2_js.a(Gt,"isFormFreeFieldRef");function ng(e){return e.fieldRequired!==void 0?e.fieldRequired:e.slotMode==="create"&&e.attributeRequired===true}chunkDPD6ZWL2_js.a(ng,"resolveFieldRequired");function Wi(e){return e.additionalSlotIds?.length?[e.slotId,...e.additionalSlotIds]:[e.slotId]}chunkDPD6ZWL2_js.a(Wi,"getSlotFieldTargets");function Cs(e){return Gi(e)?`${e.slotId}.${e.attribute}`:`free.${e.attribute.name}`}chunkDPD6ZWL2_js.a(Cs,"formFieldKey");function Ns(e){return Gi(e)?e.attribute:e.attribute.name}chunkDPD6ZWL2_js.a(Ns,"formFieldFlatKey");function ig(e,t){return e[Cs(t)]??e[Ns(t)]}chunkDPD6ZWL2_js.a(ig,"readFormFieldValue");function We(e){return e.type==="fields"}chunkDPD6ZWL2_js.a(We,"isFormFieldsRow");function sg(e){return e.type==="heading"}chunkDPD6ZWL2_js.a(sg,"isFormHeadingRow");function ug(e){return e.type==="separator"}chunkDPD6ZWL2_js.a(ug,"isFormSeparatorRow");function lg(e){return e.type==="text"}chunkDPD6ZWL2_js.a(lg,"isFormTextRow");var Wt=class Wt{async autocomplete(){return await Promise.resolve([])}async reverse(){return await Promise.resolve(null)}async geocode(){return await Promise.resolve(null)}};chunkDPD6ZWL2_js.a(Wt,"NoopGeocodingAdapter");var Ki=Wt;var Kt=["read","create","update","delete","manage"];function gg(e){return e.length===0?"none":e.length===1&&e[0]==="read"?"read-only":e.length===Kt.length&&Kt.every(t=>e.includes(t))?"full":"custom"}chunkDPD6ZWL2_js.a(gg,"actionsToAccessLevel");function yg(e){switch(e){case "full":return [...Kt];case "read-only":return ["read"];case "none":return []}}chunkDPD6ZWL2_js.a(yg,"accessLevelToActions");function Yi(e){let t=e.properties;if(!t)return [];if(Array.isArray(t))return t;let r=t;return Array.isArray(r.definitions)?r.definitions:[]}chunkDPD6ZWL2_js.a(Yi,"resolvePropertyDefinitions");function Tg(e){return e.type==="select"||e.type==="status"||e.type==="multiselect"}chunkDPD6ZWL2_js.a(Tg,"hasOptions");var ks="Notetaker",Ig={systemPrompt:null,meetingRecordingPolicy:"none",meetingBotDisplayName:ks};var vg=["active","suspended"],Rg=["plan","manual","auto"];function Dg(e){return `${e.object}:${e.name}:${e.type}`}chunkDPD6ZWL2_js.a(Dg,"viewStateKey");function Ke(e){return e.type==="detail"}chunkDPD6ZWL2_js.a(Ke,"isDetailView");function Hi(e){return e.type==="list"}chunkDPD6ZWL2_js.a(Hi,"isListView");function Os(e){return e.type==="fields"}chunkDPD6ZWL2_js.a(Os,"isFieldGroup");var _g=["square","landscape","portrait"];var Qi=["none","estimated","exact"];function _s(e){if(typeof e=="string"&&Qi.includes(e))return e;throw new chunk72TQRSNX_js.h(`countMode must be one of: ${Qi.join(", ")} (received: ${String(e)})`,[])}chunkDPD6ZWL2_js.a(_s,"parseCountMode");function Vg(e){return e===void 0?void 0:_s(e)}chunkDPD6ZWL2_js.a(Vg,"parseOptionalCountMode");var jg=1e4;var Bg=["storage.bytes","members.seats"];function Ps(e){return e==null?true:typeof e!="object"?false:Object.keys(e).length===0}chunkDPD6ZWL2_js.a(Ps,"isEmptyObject");function Ji(e){return e!=null&&typeof e=="object"&&Object.keys(e).length>0}chunkDPD6ZWL2_js.a(Ji,"isNotEmpty");function Fs(e){return Ji(e)?e:void 0}chunkDPD6ZWL2_js.a(Fs,"toUndefinedIfEmpty");function Vs(e){if(e<=0)return {value:0,unitIndex:0};let t=1e3,r=Math.min(4,Math.floor(Math.log(e)/Math.log(t)));return {value:Number.parseFloat((e/t**r).toFixed(1)),unitIndex:r}}chunkDPD6ZWL2_js.a(Vs,"computeByteMagnitude");var js=["B","KB","MB","GB","TB"];function _y(e){let{value:t,unitIndex:r}=Vs(e);return `${t} ${js[r]}`}chunkDPD6ZWL2_js.a(_y,"formatByteSize");function Ms(e){return e.displayAttributes!==void 0?[...e.displayAttributes]:[...new Set([e.cardUserAttribute,e.cardDateAttribute].filter(t=>t!==void 0))]}chunkDPD6ZWL2_js.a(Ms,"getListViewDisplayAttributeNames");var My={ATTACHMENTS:"attachments"};function Ly(e){return e.type==="document"}chunkDPD6ZWL2_js.a(Ly,"isDocumentAttribute");function By(e,t){if(!t||t.length===0)return true;let r=e.name.toLowerCase();return t.some(n=>n.endsWith("/*")?e.mimeType.startsWith(n.slice(0,-1)):n.startsWith(".")?r.endsWith(n.toLowerCase()):e.mimeType===n)}chunkDPD6ZWL2_js.a(By,"matchesAccepts");var Xi=Object.freeze(["text","number","checkbox","date","phone","currency","status","select","multiselect","location"]);function Ye(e){let t=[];for(let r of e){let n=r.build();if(!Xi.includes(n.type))throw new Error(`Property type "${n.type}" is not supported in .qualifyWith()`);t.push(n);}return {definitions:t}}chunkDPD6ZWL2_js.a(Ye,"buildPropertySchema");var Gy="__";function Wy(e){let t=e.indexOf("__");return t<=0||t+2>=e.length?{kind:"scalar",attribute:e}:{kind:"qualified",root:e.slice(0,t),property:e.slice(t+2)}}chunkDPD6ZWL2_js.a(Wy,"parseQualifiedAttribute");function Ky(e,t){return `${e}__${t}`}chunkDPD6ZWL2_js.a(Ky,"buildQualifiedAttribute");function Z(e){return typeof e=="object"&&e!==null&&typeof e.start=="string"}chunkDPD6ZWL2_js.a(Z,"isDateRangeValue");function Ls(e,t){return chunk5QAE5NPN_js.a(e)?null:Z(e)?t.endDate?{start:e.start,end:e.end??null}:e.start:typeof e=="string"?t.endDate?{start:e,end:null}:e:null}chunkDPD6ZWL2_js.a(Ls,"normalizeDateValue");function fe(e){return typeof e=="string"&&e!==""?e:Z(e)&&e.start!==""?e.start:null}chunkDPD6ZWL2_js.a(fe,"dateValueStart");var He="\u2014";function Bs(e){return String(e)}chunkDPD6ZWL2_js.a(Bs,"formatText");function Us(e){return e?"Yes":"No"}chunkDPD6ZWL2_js.a(Us,"formatCheckbox");function $s(e,t){if(typeof e!="number")return String(e);if(t.renderAs==="rating")return `${e}/${t.max??5}`;let r=t.decimals;return t.unit==="integer"?e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}):t.unit==="percentage"?(e/100).toLocaleString(void 0,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}):e.toLocaleString(void 0,{minimumFractionDigits:r,maximumFractionDigits:r})}chunkDPD6ZWL2_js.a($s,"formatNumber");function qs(e,t){if(typeof e!="object"||e===null)return String(e);let r=e;return "value"in r&&"code"in r?`${r.value.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} ${r.code}`:String(e)}chunkDPD6ZWL2_js.a(qs,"formatCurrency");function Yt(e){if(Z(e)){let t=Yt(e.start);return e.end?`${t} \u2192 ${Yt(e.end)}`:t}if(e instanceof Date)return e.toISOString().split("T")[0];if(typeof e=="string"){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t.toISOString().split("T")[0]}return String(e)}chunkDPD6ZWL2_js.a(Yt,"formatDate");function zs(e){if(typeof e!="object"||e===null)return String(e);let t=e;return "phoneNumber"in t?t.phoneNumber?t.countryCode?chunkGXSNLYRR_js.c(t):t.phoneNumber:"":String(e)}chunkDPD6ZWL2_js.a(zs,"formatPhone");function Gs(e,t="full"){if(typeof e!="object"||e===null)return "";let r=e,n=[];switch(t){case "country":r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "state":r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "city":r.city&&n.push(r.city),r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "coordinates":r.latitude!==void 0&&r.longitude!==void 0&&n.push(`${r.latitude}, ${r.longitude}`);break;case "address":r.address&&n.push(r.address),r.city&&n.push(r.city),r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;default:r.address&&n.push(r.address),r.address2&&n.push(r.address2),r.city&&n.push(r.city),r.state&&n.push(r.state),r.postalCode&&n.push(r.postalCode),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break}return n.join(", ")}chunkDPD6ZWL2_js.a(Gs,"formatLocationValue");function Ws(e,t){return typeof e!="object"||e===null?String(e):Gs(e,t.granularity??"full")||He}chunkDPD6ZWL2_js.a(Ws,"formatLocation");function Ks(e,t){return typeof e!="string"?String(e):t.options?.find(n=>n.value===e)?.label??String(e)}chunkDPD6ZWL2_js.a(Ks,"formatSelect");function Ys(e,t){return Array.isArray(e)?t.options?e.map(n=>t.options.find(o=>o.value===n)?.label).filter(Boolean).join(", "):e.join(", "):String(e)}chunkDPD6ZWL2_js.a(Ys,"formatMultiselect");function Zi(e,t){if(chunk5QAE5NPN_js.a(e))return He;switch(t.type){case "text":return Bs(e);case "checkbox":return Us(e);case "number":return $s(e,t);case "currency":return qs(e);case "date":return Yt(e);case "phone":return zs(e);case "location":return Ws(e,t);case "select":case "status":return Ks(e,t);case "multiselect":return Ys(e,t);case "user":case "relation":return Array.isArray(e)?e.join(", "):String(e);default:return Array.isArray(e)?e.join(", "):String(e)}}chunkDPD6ZWL2_js.a(Zi,"formatAttributeValue");var Qs=["UPPER","LOWER","capitalize","trim"],Js=["prefix","suffix","wrap","default"],Qe=[...Qs,...Js],be=Jt.z.string().min(1,"labelExpression cannot be empty").refine(e=>Je(e),{message:"labelExpression must contain at least one {{ attribute }} interpolation"}).refine(e=>!/\{\{\s*\}\}/.test(e),{message:"labelExpression contains empty {{ }} interpolation"}).refine(e=>{let t=/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g,r;for(;(r=t.exec(e))!==null;){let n=r[1];if(!Qe.includes(n))return false}return true},{message:`Invalid pipe name. Valid pipes: ${Qe.join(", ")}`});function Xs(e){let t=be.safeParse(e);return t.success?{success:true,attributes:oo(e)}:{success:false,error:t.error.issues[0]?.message??"Invalid labelExpression"}}chunkDPD6ZWL2_js.a(Xs,"validateLabelExpression");var eo={UPPER:chunkDPD6ZWL2_js.a(e=>String(e).toUpperCase(),"UPPER"),LOWER:chunkDPD6ZWL2_js.a(e=>String(e).toLowerCase(),"LOWER"),capitalize:chunkDPD6ZWL2_js.a(e=>String(e).replace(/(^|\s)\S/g,t=>t.toUpperCase()),"capitalize"),trim:chunkDPD6ZWL2_js.a(e=>String(e).trim(),"trim")},to={prefix:chunkDPD6ZWL2_js.a((e,t="")=>e?`${t}${e}`:"","prefix"),suffix:chunkDPD6ZWL2_js.a((e,t="")=>e?`${e}${t}`:"","suffix"),wrap:chunkDPD6ZWL2_js.a((e,t="",r="")=>e?`${t}${e}${r}`:"","wrap"),default:chunkDPD6ZWL2_js.a((e,t="")=>e||t,"default")};function Zs(e,t){let r=e;for(let n of t){let{name:o,args:a}=no(n),s=eo[o];if(s)r!==""&&(r=s(r));else {let l=to[o];l&&(r=l(r,...a));}}return r}chunkDPD6ZWL2_js.a(Zs,"applyPipes");function eu(e,t){return t.split(".").reduce((r,n)=>{if(!(r==null||typeof r!="object"))return r[n]},e)}chunkDPD6ZWL2_js.a(eu,"getValue");var ro="(Untitled)";function no(e){let t=e.match(/^(\w+)(?::(.*))?$/);if(!t)return {name:e,args:[]};let r=t[1],n=t[2];if(!n)return {name:r,args:[]};let o=[],a=/["']([^"']*?)["']/g,s;for(;(s=a.exec(n))!==null;)o.push(s[1]);return {name:r,args:o}}chunkDPD6ZWL2_js.a(no,"parsePipeExpression");function Ht(e,t,r=ro){return e.replace(/\{\{\s*([^}]+)\s*\}\}/g,(o,a)=>{let s=a.split("||").map(j=>j.trim()),p=s[s.length-1].split("|").map(j=>j.trim());s[s.length-1]=p[0];let I=p.slice(1).filter(Boolean),X=s.filter(Boolean),B="";for(let j of X){let Y=io(eu(t,j));if(Y!==""){B=Y;break}}if(chunk5QAE5NPN_js.a(B)&&I.length===0)return "";for(let j of I){let{name:Y,args:es}=no(j),si=eo[Y];if(si)B!==""&&(B=si(B));else {let ui=to[Y];ui&&(B=ui(B,...es));}}return B}).trim()||r}chunkDPD6ZWL2_js.a(Ht,"renderLabelExpression");function io(e){if(e==null||typeof e=="function")return "";if(typeof e!="object")return String(e);if(Array.isArray(e))return e.map(io).filter(Boolean).join(",");let t=e.toString;return typeof t=="function"&&t!==Object.prototype.toString?String(e):""}chunkDPD6ZWL2_js.a(io,"toText");function Je(e){return /\{\{\s*\S+.*\}\}/.test(e)}chunkDPD6ZWL2_js.a(Je,"isLabelExpression");function oo(e){let t=[],r=/\{\{\s*([^}]+)\s*\}\}/g,n;for(;(n=r.exec(e))!==null;){let a=n[1].trim().split("||").map(l=>l.trim()),s=a[a.length-1];a[a.length-1]=s.split("|")[0].trim();for(let l of a){if(!l)continue;let p=l.split(".")[0];p&&!t.includes(p)&&t.push(p);}}return t}chunkDPD6ZWL2_js.a(oo,"extractAttributeNames");var tu=/^\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}$/;function ao(e){let t=e.trim().match(tu);return t?t[1]:null}chunkDPD6ZWL2_js.a(ao,"getSingleAttributeFromExpression");function ru(e,t){let r=ao(e);if(r===null)return null;let n=t.find(o=>o.name===r);return !n||n.type!=="text"||chunkSDOYGWU4_js.j(n).authoring.readOnly?null:n}chunkDPD6ZWL2_js.a(ru,"getEditableLabelAttribute");var nu=/\{\{\s*props\./;function iu(e,t,r){if(!nu.test(e))return e;let n={},o=new Map(r?.map(s=>[s.name,s]));if(t)for(let[s,l]of Object.entries(t)){if(l==null)continue;let p=o.get(s);if(p){let I=Zi(l,p);n[s]=I===He?"":I;}else n[s]=l;}return Ht(e,{props:n},"").replace(/\(\s*\)/g,"").replace(/\[\s*\]/g,"").replace(/\s*[-—|:]\s*$/g,"").replace(/\s{2,}/g," ").trim()}chunkDPD6ZWL2_js.a(iu,"applyRelationProps");function ou(e){if(e?.type==="relation")return e.properties?.definitions}chunkDPD6ZWL2_js.a(ou,"relationPropertyDefs");function au(e){if(e?.type==="relation"||e?.type==="document")return e.properties?.definitions}chunkDPD6ZWL2_js.a(au,"qualifiedPropertyDefs");function so(e){if(chunk5QAE5NPN_js.a(e))return [];if(typeof e=="string")return [{id:e}];if(Array.isArray(e))return e.flatMap(t=>so(t));if(typeof e=="object"&&"id"in e){let t=e;if(typeof t.id=="string")return [{id:t.id,props:t.props}]}return []}chunkDPD6ZWL2_js.a(so,"extractValueRefs");function su(e){let t=[e.firstName,e.lastName].map(r=>r?.trim()).filter(Boolean).join(" ");return t!==""?t:e.email?.split("@")[0]??""}chunkDPD6ZWL2_js.a(su,"getUserDisplayName");var uu=/\p{L}|\p{N}/u;function lu(e,t){let r=e?.trim()??"";if(r==="")return t;let n=r.split(/\s+/),a=(n.length===1?r.split("@")[0].split(/[._-]/):n).map(s=>{let l=s.match(uu)?.[0];return l===void 0?"":[...l.toUpperCase()][0]??""}).filter(Boolean).slice(0,2).join("");return a===""?t:a}chunkDPD6ZWL2_js.a(lu,"deriveInitials");var uo="__creatorRootActorId";function du(e){let t=e.metadata?.[uo];return typeof t=="string"&&t.length>0?t:e.createdBy}chunkDPD6ZWL2_js.a(du,"getRecordCreatorPrincipalId");function ge(e,t){return e?.includes("*")===true||e?.includes(t)===true}chunkDPD6ZWL2_js.a(ge,"includesAction");function cu(e){return {canRead:ge(e,"read"),canCreate:ge(e,"create"),canUpdate:ge(e,"update"),canDelete:ge(e,"delete"),canManage:ge(e,"manage")}}chunkDPD6ZWL2_js.a(cu,"buildPermissionFlags");var wh=new Set(["id","name","label","type","required","system","unique","order"]);var M={PEOPLE:"people",WORKSPACE:"workspace",ARCHITECT:"architect",FEATURE_FLAGS:"feature-flags",FILES:"files",VIEWS:"views",FORMS:"forms",DOCUMENTS:"documents",AUDIT:"audit",API_KEYS:"api-keys",CONNECTORS:"connectors",ENV_VARS:"env-vars",SESSION:"session"},Ih=[M.PEOPLE,M.WORKSPACE,M.ARCHITECT,M.FEATURE_FLAGS,M.FILES,M.VIEWS,M.FORMS,M.DOCUMENTS,M.AUDIT,M.API_KEYS,M.CONNECTORS,M.ENV_VARS,M.SESSION],Sh={people:"People",workspace:"Workspace",architect:"Architect","feature-flags":"Feature flags",files:"Files",views:"Views",forms:"Forms",documents:"Documents",audit:"Audit","api-keys":"API keys",connectors:"Connected accounts","env-vars":"Environment variables",session:"Agent sessions"},pu={OWNER:"owner",MEMBER:"member",AGENT_DEFAULT:"agent_default",REFLEX_DEFAULT:"reflex_default"},vh={owner:"Owner",member:"Member",agent_default:"Agent Default",reflex_default:"Reflex Default"},Rh={owner:"Full access to all platform features and data",member:"Can view, create, edit and delete business data",agent_default:"Default role for AI agents \u2014 CRUD on records plus documents and files",reflex_default:"Default role for reflexes \u2014 no data access; each reflex is granted exactly what its rehearsal showed it uses"},Qt=["read","create","update","delete","manage"],mu=["read","create","delete"],Eh={owner:{system:[{target:"*",actions:Qt}],object:[{target:"*",actions:Qt}]},member:{system:[{target:"people",actions:["read"]},{target:"workspace",actions:["read"]},{target:"connectors",actions:mu},{target:"files",actions:["read","create","update"]}],object:[{target:"*",actions:Qt}]},agent_default:{system:[{target:"documents",actions:["read","create","update"]},{target:"files",actions:["read","create","update"]},{target:"env-vars",actions:["read"]},{target:"session",actions:["observe"]}],object:[{target:"*",actions:["read","create","update","delete"]}]},reflex_default:{system:[],object:[]}};function Dh(e){return Object.values(pu).includes(e)}chunkDPD6ZWL2_js.a(Dh,"isDefaultRole");var bu=new Set(constants.ICONS),co=/^[a-zA-Z_][a-zA-Z0-9_]*$/,gu=/^[a-z][a-z0-9-]*$/,ye=63,lo=128,Xe=Jt__default.default.string().min(1,"Object name cannot be empty").max(63,"Object name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
1
+ 'use strict';var chunkLQYUPOWB_js=require('./chunk-LQYUPOWB.js'),chunkVJYVPQ5E_js=require('./chunk-VJYVPQ5E.js'),chunk47EGJRW7_js=require('./chunk-47EGJRW7.js'),chunk5QAE5NPN_js=require('./chunk-5QAE5NPN.js');require('./chunk-LWSOKXPF.js'),require('./chunk-XXTKNIBK.js'),require('./chunk-JOS2XMXY.js');var chunk47KVYDKG_js=require('./chunk-47KVYDKG.js'),chunkKLR22JMC_js=require('./chunk-KLR22JMC.js'),chunkGXSNLYRR_js=require('./chunk-GXSNLYRR.js');require('./chunk-UXISKZ5Y.js'),require('./chunk-XUAP7KWK.js'),require('./chunk-JVLH3DVZ.js'),require('./chunk-LSCBR4VS.js'),require('./chunk-23KPS33D.js');var chunk72TQRSNX_js=require('./chunk-72TQRSNX.js'),chunkXHEBV2HE_js=require('./chunk-XHEBV2HE.js'),chunkSLYRQ72J_js=require('./chunk-SLYRQ72J.js'),chunkJFSQ24XR_js=require('./chunk-JFSQ24XR.js'),chunkDPD6ZWL2_js=require('./chunk-DPD6ZWL2.js'),constants=require('@stndrds/constants'),Xt=require('zod');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Xt__default=/*#__PURE__*/_interopDefault(Xt);/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
+ var Oi=["fyi","task","question","handoff","system"],ki=["low","normal","high","urgent"],_i=["public","internal","sensitive"],Pi=["unread","read","archived","snoozed"],Fi=["none","pending","processing","completed","dismissed","expired","failed"],hs="agent.session.waiting_human",As="agent.task.assigned",Ts="agent.question.requested",Jf=[hs,As,Ts];var Zf=["name","type"],eb=["required","hidden","archived","deprecated","defaultValue","config","order","unique"],tb=["label","description","placeholder","icon"];var Vi=["text","richtext","number","checkbox","date","phone","currency","status","location","select","multiselect","user","relation","formula","rollup","document"],We="*";function ib(e){return e.type!=="relation"||!Array.isArray(e.targets)?[]:e.targets.map(t=>t.object).filter(t=>t!==We)}chunkDPD6ZWL2_js.a(ib,"relationTargetsOf");function ji(e){return e.targets.length===1&&e.targets[0].object===We}chunkDPD6ZWL2_js.a(ji,"isUniversalRelation");function ob(e){return e.bilateral!==void 0}chunkDPD6ZWL2_js.a(ob,"isBilateralRelation");function ab(e){return "many"}chunkDPD6ZWL2_js.a(ab,"inferInverseCardinality");function sb(e){return chunkVJYVPQ5E_js.n(e)}chunkDPD6ZWL2_js.a(sb,"isAttributeSortable");var db=["record","object","attribute","view","user","role","settings","file","agent","schema_source"],cb=["record.created","record.updated","record.deleted","record.restored","record.purged","object.created","object.updated","object.deleted","attribute.created","attribute.updated","attribute.deleted","view.created","view.updated","view.deleted","schema_source.applied","schema_source.removed","user.created","user.invited","user.updated","user.deleted","user.login","user.logout","role.created","role.updated","role.deleted","role.assigned","role.revoked","settings.updated","file.uploaded","file.updated","file.deleted"];function fb(e){return e.phase==="terminal"}chunkDPD6ZWL2_js.a(fb,"isTerminalState");function bb(e){switch(e.phase){case "running":return "active";case "queued":return "idle";case "parked":if(e.parkedOn===void 0)throw new chunk72TQRSNX_js.b("parked state without parkedOn",chunk72TQRSNX_js.a.INVARIANT_VIOLATION);return e.parkedOn==="agents"?"waiting_agents":"waiting_human";case "terminal":if(e.outcome===void 0)throw new chunk72TQRSNX_js.b("terminal state without outcome",chunk72TQRSNX_js.a.INVARIANT_VIOLATION);return e.outcome}}chunkDPD6ZWL2_js.a(bb,"sessionStateToLegacyStatus");function gb(e){switch(e){case "active":return {phase:"running"};case "idle":return {phase:"queued"};case "waiting_human":return {phase:"parked",parkedOn:"human",humanRequestIds:[]};case "waiting_agents":return {phase:"parked",parkedOn:"agents"};default:return {phase:"terminal",outcome:e}}}chunkDPD6ZWL2_js.a(gb,"legacyStatusToSessionState");var ws=["completed","failed","cancelled","timeout","expired"];function yb(e){return ws.includes(e)}chunkDPD6ZWL2_js.a(yb,"isTerminalSessionStatus");var xs=["idle","completed","waiting_human","waiting_agents","cancelled","failed","timeout"];function hb(e){return xs.includes(e)}chunkDPD6ZWL2_js.a(hb,"isClaimableSessionStatus");var Mi=Object.freeze({mutation:"ask",destructive:"ask",outward:"ask"}),Ab=["active","completed","abandoned"],Li=["openai","anthropic","google","spacexai","deepseek","moonshotai","alibaba","mistral","minimax","meta","zai"],Bi=["standard","fast"],Ui=["none","minimal","low","medium","high","xhigh"];function Tb(e){return e.label?.trim()||e.name}chunkDPD6ZWL2_js.a(Tb,"agentDisplayName");var $i=["approval-requested","approval-responded","approval-dispatched"],Is=["streaming","running",...$i];function wb(e){return Is.includes(e)}chunkDPD6ZWL2_js.a(wb,"isOpenToolPartState");function xb(e){return $i.includes(e)}chunkDPD6ZWL2_js.a(xb,"isToolApprovalState");var zt=["CREDITS_EXHAUSTED"];function Ib(e){return typeof e=="string"&&zt.includes(e)}chunkDPD6ZWL2_js.a(Ib,"isSystemPartCode");function Ss(e,t){let r=e.createdAt.getTime()-t.createdAt.getTime();return r===0?e.id.localeCompare(t.id):r}chunkDPD6ZWL2_js.a(Ss,"compareAgentSessionMessages");function Sb(e){return [...e].sort(Ss)}chunkDPD6ZWL2_js.a(Sb,"orderAgentSessionMessages");var vb=["pending","in_progress","completed","blocked"],Rb=50,Eb=80,Db=500,Cb=2e3;var _b="session-state",vs="__stndrdsNativeUiPartIds",Rs=1,Es="Native agent UI part IDs metadata is invalid";function se(){throw new chunk72TQRSNX_js.h(Es,[])}chunkDPD6ZWL2_js.a(se,"invalidNativePartIds");function qi(e){if(e===null||typeof e!="object"||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}chunkDPD6ZWL2_js.a(qi,"isPlainRecord");function Ds(e,t){if(e.type==="text"||e.type==="reasoning")return `${e.type}:${t}`;if(e.type==="tool")return `tool:${e.toolCallId}`}chunkDPD6ZWL2_js.a(Ds,"nativeAgentUIPartIdMetadataKey");function Pb(e){let t=e.metadata?.[vs];qi(t)||se(),(Object.keys(t).length!==2||t.schemaVersion!==Rs||!qi(t.partIds))&&se();let r=new Map;for(let[s,l]of e.parts.entries()){let p=Ds(l,s);if(!p||r.has(p)){p&&se();continue}r.set(p,l);}let n=Object.entries(t.partIds);n.length!==r.size&&se();let o=new Map,a={};for(let[s,l]of n){let p=r.get(s);p&&typeof l=="string"&&l.length>0||se();let I=o.get(l);I&&(p.type==="tool"||I!==p.type)&&se(),p.type==="tool"&&l!==p.toolCallId&&se(),o.set(l,p.type),a[s]=l;}return a}chunkDPD6ZWL2_js.a(Pb,"parseNativeAgentUIPartIdsMetadata");var jb=16e3,Mb=3200,Lb=6400,Bb=16e3,Ub=65536,$b=15e3,qb=1e4,zb=5e3,Gb="google/gemini-3.5-transcribe-live",Wb={maxDurationMs:3e5,dailyDurationMs:36e5,monthlyDurationMs:72e6,tenantMonthlyBudgetMicrousd:5e7,globalMonthlyBudgetMicrousd:5e7,estimatedMicrousdPerSecond:150,reservationMultiplier:2};var Yb=["web","presentation","document","spreadsheet","image","code","other"],Hb=["ephemeral","conversation","persistent"],Qb=["source","preview","entrypoint","asset"];var zi=5;function Zb(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"?"message"in e&&typeof e.message=="string"?e.message:JSON.stringify(e):String(e)}chunkDPD6ZWL2_js.a(Zb,"getErrorMessage");function ng(e){return typeof e=="object"&&e!==null&&"slots"in e&&"steps"in e&&"name"in e&&typeof e.name=="string"&&Array.isArray(e.slots)&&Array.isArray(e.steps)}chunkDPD6ZWL2_js.a(ng,"isFormDefinition");var Gt=["relation","multiRelation","formula","rollup","document","richtext","user"];function Gi(e){return e.type==="slot"}chunkDPD6ZWL2_js.a(Gi,"isFormSlotFieldRef");function Wt(e){return e.type==="free"}chunkDPD6ZWL2_js.a(Wt,"isFormFreeFieldRef");function ag(e){return e.fieldRequired!==void 0?e.fieldRequired:e.slotMode==="create"&&e.attributeRequired===true}chunkDPD6ZWL2_js.a(ag,"resolveFieldRequired");function Wi(e){return e.additionalSlotIds?.length?[e.slotId,...e.additionalSlotIds]:[e.slotId]}chunkDPD6ZWL2_js.a(Wi,"getSlotFieldTargets");function Cs(e){return Gi(e)?`${e.slotId}.${e.attribute}`:`free.${e.attribute.name}`}chunkDPD6ZWL2_js.a(Cs,"formFieldKey");function Ns(e){return Gi(e)?e.attribute:e.attribute.name}chunkDPD6ZWL2_js.a(Ns,"formFieldFlatKey");function sg(e,t){return e[Cs(t)]??e[Ns(t)]}chunkDPD6ZWL2_js.a(sg,"readFormFieldValue");function Ke(e){return e.type==="fields"}chunkDPD6ZWL2_js.a(Ke,"isFormFieldsRow");function dg(e){return e.type==="heading"}chunkDPD6ZWL2_js.a(dg,"isFormHeadingRow");function cg(e){return e.type==="separator"}chunkDPD6ZWL2_js.a(cg,"isFormSeparatorRow");function pg(e){return e.type==="text"}chunkDPD6ZWL2_js.a(pg,"isFormTextRow");var Kt=class Kt{async autocomplete(){return await Promise.resolve([])}async reverse(){return await Promise.resolve(null)}async geocode(){return await Promise.resolve(null)}};chunkDPD6ZWL2_js.a(Kt,"NoopGeocodingAdapter");var Ki=Kt;var Yt=["read","create","update","delete","manage"];function Ag(e){return e.length===0?"none":e.length===1&&e[0]==="read"?"read-only":e.length===Yt.length&&Yt.every(t=>e.includes(t))?"full":"custom"}chunkDPD6ZWL2_js.a(Ag,"actionsToAccessLevel");function Tg(e){switch(e){case "full":return [...Yt];case "read-only":return ["read"];case "none":return []}}chunkDPD6ZWL2_js.a(Tg,"accessLevelToActions");function Yi(e){let t=e.properties;if(!t)return [];if(Array.isArray(t))return t;let r=t;return Array.isArray(r.definitions)?r.definitions:[]}chunkDPD6ZWL2_js.a(Yi,"resolvePropertyDefinitions");function Ig(e){return e.type==="select"||e.type==="status"||e.type==="multiselect"}chunkDPD6ZWL2_js.a(Ig,"hasOptions");var Os="Notetaker",Rg={systemPrompt:null,meetingRecordingPolicy:"none",meetingBotDisplayName:Os};var Dg=["active","suspended"],Cg=["plan","manual","auto"];function Og(e){return `${e.object}:${e.name}:${e.type}`}chunkDPD6ZWL2_js.a(Og,"viewStateKey");function Ye(e){return e.type==="detail"}chunkDPD6ZWL2_js.a(Ye,"isDetailView");function Hi(e){return e.type==="list"}chunkDPD6ZWL2_js.a(Hi,"isListView");function ks(e){return e.type==="fields"}chunkDPD6ZWL2_js.a(ks,"isFieldGroup");var Vg=["square","landscape","portrait"];var Qi=["none","estimated","exact"];function _s(e){if(typeof e=="string"&&Qi.includes(e))return e;throw new chunk72TQRSNX_js.h(`countMode must be one of: ${Qi.join(", ")} (received: ${String(e)})`,[])}chunkDPD6ZWL2_js.a(_s,"parseCountMode");function Lg(e){return e===void 0?void 0:_s(e)}chunkDPD6ZWL2_js.a(Lg,"parseOptionalCountMode");var Bg=1e4;var qg=["storage.bytes","members.seats","data.live_records"];function Ps(e){return e==null?true:typeof e!="object"?false:Object.keys(e).length===0}chunkDPD6ZWL2_js.a(Ps,"isEmptyObject");function Ji(e){return e!=null&&typeof e=="object"&&Object.keys(e).length>0}chunkDPD6ZWL2_js.a(Ji,"isNotEmpty");function Fs(e){return Ji(e)?e:void 0}chunkDPD6ZWL2_js.a(Fs,"toUndefinedIfEmpty");function Vs(e){if(e<=0)return {value:0,unitIndex:0};let t=1e3,r=Math.min(4,Math.floor(Math.log(e)/Math.log(t)));return {value:Number.parseFloat((e/t**r).toFixed(1)),unitIndex:r}}chunkDPD6ZWL2_js.a(Vs,"computeByteMagnitude");var js=["B","KB","MB","GB","TB"];function Vy(e){let{value:t,unitIndex:r}=Vs(e);return `${t} ${js[r]}`}chunkDPD6ZWL2_js.a(Vy,"formatByteSize");function Ms(e){return e.displayAttributes!==void 0?[...e.displayAttributes]:[...new Set([e.cardUserAttribute,e.cardDateAttribute].filter(t=>t!==void 0))]}chunkDPD6ZWL2_js.a(Ms,"getListViewDisplayAttributeNames");var Uy={ATTACHMENTS:"attachments"};function $y(e){return e.type==="document"}chunkDPD6ZWL2_js.a($y,"isDocumentAttribute");function qy(e,t){if(!t||t.length===0)return true;let r=e.name.toLowerCase();return t.some(n=>n.endsWith("/*")?e.mimeType.startsWith(n.slice(0,-1)):n.startsWith(".")?r.endsWith(n.toLowerCase()):e.mimeType===n)}chunkDPD6ZWL2_js.a(qy,"matchesAccepts");var Xi=Object.freeze(["text","number","checkbox","date","phone","currency","status","select","multiselect","location"]);function He(e){let t=[];for(let r of e){let n=r.build();if(!Xi.includes(n.type))throw new Error(`Property type "${n.type}" is not supported in .qualifyWith()`);t.push(n);}return {definitions:t}}chunkDPD6ZWL2_js.a(He,"buildPropertySchema");var Yy="__";function Hy(e){let t=e.indexOf("__");return t<=0||t+2>=e.length?{kind:"scalar",attribute:e}:{kind:"qualified",root:e.slice(0,t),property:e.slice(t+2)}}chunkDPD6ZWL2_js.a(Hy,"parseQualifiedAttribute");function Qy(e,t){return `${e}__${t}`}chunkDPD6ZWL2_js.a(Qy,"buildQualifiedAttribute");function ee(e){return typeof e=="object"&&e!==null&&typeof e.start=="string"}chunkDPD6ZWL2_js.a(ee,"isDateRangeValue");function Ls(e,t){return chunk5QAE5NPN_js.a(e)?null:ee(e)?t.endDate?{start:e.start,end:e.end??null}:e.start:typeof e=="string"?t.endDate?{start:e,end:null}:e:null}chunkDPD6ZWL2_js.a(Ls,"normalizeDateValue");function fe(e){return typeof e=="string"&&e!==""?e:ee(e)&&e.start!==""?e.start:null}chunkDPD6ZWL2_js.a(fe,"dateValueStart");var Qe="\u2014";function Bs(e){return String(e)}chunkDPD6ZWL2_js.a(Bs,"formatText");function Us(e){return e?"Yes":"No"}chunkDPD6ZWL2_js.a(Us,"formatCheckbox");function $s(e,t){if(typeof e!="number")return String(e);if(t.renderAs==="rating")return `${e}/${t.max??5}`;let r=t.decimals;return t.unit==="integer"?e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}):t.unit==="percentage"?(e/100).toLocaleString(void 0,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}):e.toLocaleString(void 0,{minimumFractionDigits:r,maximumFractionDigits:r})}chunkDPD6ZWL2_js.a($s,"formatNumber");function qs(e,t){if(typeof e!="object"||e===null)return String(e);let r=e;return "value"in r&&"code"in r?`${r.value.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} ${r.code}`:String(e)}chunkDPD6ZWL2_js.a(qs,"formatCurrency");function Ht(e){if(ee(e)){let t=Ht(e.start);return e.end?`${t} \u2192 ${Ht(e.end)}`:t}if(e instanceof Date)return e.toISOString().split("T")[0];if(typeof e=="string"){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t.toISOString().split("T")[0]}return String(e)}chunkDPD6ZWL2_js.a(Ht,"formatDate");function zs(e){if(typeof e!="object"||e===null)return String(e);let t=e;return "phoneNumber"in t?t.phoneNumber?t.countryCode?chunkGXSNLYRR_js.c(t):t.phoneNumber:"":String(e)}chunkDPD6ZWL2_js.a(zs,"formatPhone");function Gs(e,t="full"){if(typeof e!="object"||e===null)return "";let r=e,n=[];switch(t){case "country":r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "state":r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "city":r.city&&n.push(r.city),r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "coordinates":r.latitude!==void 0&&r.longitude!==void 0&&n.push(`${r.latitude}, ${r.longitude}`);break;case "address":r.address&&n.push(r.address),r.city&&n.push(r.city),r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;default:r.address&&n.push(r.address),r.address2&&n.push(r.address2),r.city&&n.push(r.city),r.state&&n.push(r.state),r.postalCode&&n.push(r.postalCode),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break}return n.join(", ")}chunkDPD6ZWL2_js.a(Gs,"formatLocationValue");function Ws(e,t){return typeof e!="object"||e===null?String(e):Gs(e,t.granularity??"full")||Qe}chunkDPD6ZWL2_js.a(Ws,"formatLocation");function Ks(e,t){return typeof e!="string"?String(e):t.options?.find(n=>n.value===e)?.label??String(e)}chunkDPD6ZWL2_js.a(Ks,"formatSelect");function Ys(e,t){return Array.isArray(e)?t.options?e.map(n=>t.options.find(o=>o.value===n)?.label).filter(Boolean).join(", "):e.join(", "):String(e)}chunkDPD6ZWL2_js.a(Ys,"formatMultiselect");function Zi(e,t){if(chunk5QAE5NPN_js.a(e))return Qe;switch(t.type){case "text":return Bs(e);case "checkbox":return Us(e);case "number":return $s(e,t);case "currency":return qs(e);case "date":return Ht(e);case "phone":return zs(e);case "location":return Ws(e,t);case "select":case "status":return Ks(e,t);case "multiselect":return Ys(e,t);case "user":case "relation":return Array.isArray(e)?e.join(", "):String(e);default:return Array.isArray(e)?e.join(", "):String(e)}}chunkDPD6ZWL2_js.a(Zi,"formatAttributeValue");var Qs=["UPPER","LOWER","capitalize","trim"],Js=["prefix","suffix","wrap","default"],Je=[...Qs,...Js],be=Xt.z.string().min(1,"labelExpression cannot be empty").refine(e=>Xe(e),{message:"labelExpression must contain at least one {{ attribute }} interpolation"}).refine(e=>!/\{\{\s*\}\}/.test(e),{message:"labelExpression contains empty {{ }} interpolation"}).refine(e=>{let t=/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g,r;for(;(r=t.exec(e))!==null;){let n=r[1];if(!Je.includes(n))return false}return true},{message:`Invalid pipe name. Valid pipes: ${Je.join(", ")}`});function Xs(e){let t=be.safeParse(e);return t.success?{success:true,attributes:oo(e)}:{success:false,error:t.error.issues[0]?.message??"Invalid labelExpression"}}chunkDPD6ZWL2_js.a(Xs,"validateLabelExpression");var eo={UPPER:chunkDPD6ZWL2_js.a(e=>String(e).toUpperCase(),"UPPER"),LOWER:chunkDPD6ZWL2_js.a(e=>String(e).toLowerCase(),"LOWER"),capitalize:chunkDPD6ZWL2_js.a(e=>String(e).replace(/(^|\s)\S/g,t=>t.toUpperCase()),"capitalize"),trim:chunkDPD6ZWL2_js.a(e=>String(e).trim(),"trim")},to={prefix:chunkDPD6ZWL2_js.a((e,t="")=>e?`${t}${e}`:"","prefix"),suffix:chunkDPD6ZWL2_js.a((e,t="")=>e?`${e}${t}`:"","suffix"),wrap:chunkDPD6ZWL2_js.a((e,t="",r="")=>e?`${t}${e}${r}`:"","wrap"),default:chunkDPD6ZWL2_js.a((e,t="")=>e||t,"default")};function Zs(e,t){let r=e;for(let n of t){let{name:o,args:a}=no(n),s=eo[o];if(s)r!==""&&(r=s(r));else {let l=to[o];l&&(r=l(r,...a));}}return r}chunkDPD6ZWL2_js.a(Zs,"applyPipes");function eu(e,t){return t.split(".").reduce((r,n)=>{if(!(r==null||typeof r!="object"))return r[n]},e)}chunkDPD6ZWL2_js.a(eu,"getValue");var ro="(Untitled)";function no(e){let t=e.match(/^(\w+)(?::(.*))?$/);if(!t)return {name:e,args:[]};let r=t[1],n=t[2];if(!n)return {name:r,args:[]};let o=[],a=/["']([^"']*?)["']/g,s;for(;(s=a.exec(n))!==null;)o.push(s[1]);return {name:r,args:o}}chunkDPD6ZWL2_js.a(no,"parsePipeExpression");function Qt(e,t,r=ro){return e.replace(/\{\{\s*([^}]+)\s*\}\}/g,(o,a)=>{let s=a.split("||").map(j=>j.trim()),p=s[s.length-1].split("|").map(j=>j.trim());s[s.length-1]=p[0];let I=p.slice(1).filter(Boolean),Z=s.filter(Boolean),B="";for(let j of Z){let H=io(eu(t,j));if(H!==""){B=H;break}}if(chunk5QAE5NPN_js.a(B)&&I.length===0)return "";for(let j of I){let{name:H,args:es}=no(j),si=eo[H];if(si)B!==""&&(B=si(B));else {let ui=to[H];ui&&(B=ui(B,...es));}}return B}).trim()||r}chunkDPD6ZWL2_js.a(Qt,"renderLabelExpression");function io(e){if(e==null||typeof e=="function")return "";if(typeof e!="object")return String(e);if(Array.isArray(e))return e.map(io).filter(Boolean).join(",");let t=e.toString;return typeof t=="function"&&t!==Object.prototype.toString?String(e):""}chunkDPD6ZWL2_js.a(io,"toText");function Xe(e){return /\{\{\s*\S+.*\}\}/.test(e)}chunkDPD6ZWL2_js.a(Xe,"isLabelExpression");function oo(e){let t=[],r=/\{\{\s*([^}]+)\s*\}\}/g,n;for(;(n=r.exec(e))!==null;){let a=n[1].trim().split("||").map(l=>l.trim()),s=a[a.length-1];a[a.length-1]=s.split("|")[0].trim();for(let l of a){if(!l)continue;let p=l.split(".")[0];p&&!t.includes(p)&&t.push(p);}}return t}chunkDPD6ZWL2_js.a(oo,"extractAttributeNames");var tu=/^\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}$/;function ao(e){let t=e.trim().match(tu);return t?t[1]:null}chunkDPD6ZWL2_js.a(ao,"getSingleAttributeFromExpression");function ru(e,t){let r=ao(e);if(r===null)return null;let n=t.find(o=>o.name===r);return !n||n.type!=="text"||chunkVJYVPQ5E_js.j(n).authoring.readOnly?null:n}chunkDPD6ZWL2_js.a(ru,"getEditableLabelAttribute");var nu=/\{\{\s*props\./;function iu(e,t,r){if(!nu.test(e))return e;let n={},o=new Map(r?.map(s=>[s.name,s]));if(t)for(let[s,l]of Object.entries(t)){if(l==null)continue;let p=o.get(s);if(p){let I=Zi(l,p);n[s]=I===Qe?"":I;}else n[s]=l;}return Qt(e,{props:n},"").replace(/\(\s*\)/g,"").replace(/\[\s*\]/g,"").replace(/\s*[-—|:]\s*$/g,"").replace(/\s{2,}/g," ").trim()}chunkDPD6ZWL2_js.a(iu,"applyRelationProps");function ou(e){if(e?.type==="relation")return e.properties?.definitions}chunkDPD6ZWL2_js.a(ou,"relationPropertyDefs");function au(e){if(e?.type==="relation"||e?.type==="document")return e.properties?.definitions}chunkDPD6ZWL2_js.a(au,"qualifiedPropertyDefs");function so(e){if(chunk5QAE5NPN_js.a(e))return [];if(typeof e=="string")return [{id:e}];if(Array.isArray(e))return e.flatMap(t=>so(t));if(typeof e=="object"&&"id"in e){let t=e;if(typeof t.id=="string")return [{id:t.id,props:t.props}]}return []}chunkDPD6ZWL2_js.a(so,"extractValueRefs");function su(e){let t=[e.firstName,e.lastName].map(r=>r?.trim()).filter(Boolean).join(" ");return t!==""?t:e.email?.split("@")[0]??""}chunkDPD6ZWL2_js.a(su,"getUserDisplayName");var uu=/\p{L}|\p{N}/u;function lu(e,t){let r=e?.trim()??"";if(r==="")return t;let n=r.split(/\s+/),a=(n.length===1?r.split("@")[0].split(/[._-]/):n).map(s=>{let l=s.match(uu)?.[0];return l===void 0?"":[...l.toUpperCase()][0]??""}).filter(Boolean).slice(0,2).join("");return a===""?t:a}chunkDPD6ZWL2_js.a(lu,"deriveInitials");var uo="__creatorRootActorId";function du(e){let t=e.metadata?.[uo];return typeof t=="string"&&t.length>0?t:e.createdBy}chunkDPD6ZWL2_js.a(du,"getRecordCreatorPrincipalId");function ge(e,t){return e?.includes("*")===true||e?.includes(t)===true}chunkDPD6ZWL2_js.a(ge,"includesAction");function cu(e){return {canRead:ge(e,"read"),canCreate:ge(e,"create"),canUpdate:ge(e,"update"),canDelete:ge(e,"delete"),canManage:ge(e,"manage")}}chunkDPD6ZWL2_js.a(cu,"buildPermissionFlags");var Sh=new Set(["id","name","label","type","required","system","unique","order"]);var M={PEOPLE:"people",WORKSPACE:"workspace",ARCHITECT:"architect",FEATURE_FLAGS:"feature-flags",FILES:"files",VIEWS:"views",FORMS:"forms",DOCUMENTS:"documents",AUDIT:"audit",API_KEYS:"api-keys",CONNECTORS:"connectors",ENV_VARS:"env-vars",SESSION:"session"},Rh=[M.PEOPLE,M.WORKSPACE,M.ARCHITECT,M.FEATURE_FLAGS,M.FILES,M.VIEWS,M.FORMS,M.DOCUMENTS,M.AUDIT,M.API_KEYS,M.CONNECTORS,M.ENV_VARS,M.SESSION],Eh={people:"People",workspace:"Workspace",architect:"Architect","feature-flags":"Feature flags",files:"Files",views:"Views",forms:"Forms",documents:"Documents",audit:"Audit","api-keys":"API keys",connectors:"Connected accounts","env-vars":"Environment variables",session:"Agent sessions"},pu={OWNER:"owner",MEMBER:"member",AGENT_DEFAULT:"agent_default",REFLEX_DEFAULT:"reflex_default"},Dh={owner:"Owner",member:"Member",agent_default:"Agent Default",reflex_default:"Reflex Default"},Ch={owner:"Full access to all platform features and data",member:"Can view, create, edit and delete business data",agent_default:"Default role for AI agents \u2014 CRUD on records plus documents and files",reflex_default:"Default role for reflexes \u2014 no data access; each reflex is granted exactly what its rehearsal showed it uses"},Jt=["read","create","update","delete","manage"],mu=["read","create","delete"],Nh={owner:{system:[{target:"*",actions:Jt}],object:[{target:"*",actions:Jt}]},member:{system:[{target:"people",actions:["read"]},{target:"workspace",actions:["read"]},{target:"connectors",actions:mu},{target:"files",actions:["read","create","update"]}],object:[{target:"*",actions:Jt}]},agent_default:{system:[{target:"documents",actions:["read","create","update"]},{target:"files",actions:["read","create","update"]},{target:"env-vars",actions:["read"]},{target:"session",actions:["observe"]}],object:[{target:"*",actions:["read","create","update","delete"]}]},reflex_default:{system:[],object:[]}};function Oh(e){return Object.values(pu).includes(e)}chunkDPD6ZWL2_js.a(Oh,"isDefaultRole");var bu=new Set(constants.ICONS),co=/^[a-zA-Z_][a-zA-Z0-9_]*$/,gu=/^[a-z][a-z0-9-]*$/,ye=63,lo=128,Ze=Xt__default.default.string().min(1,"Object name cannot be empty").max(63,"Object name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
3
3
  Name must be in kebab-case (slug format):
4
4
  \u2705 Valid: 'products', 'user-profiles', 'order-items'
5
- \u274C Invalid: 'Products', 'userProfiles', 'user_profiles'`});function De(e){try{Xe.parse(e);}catch(t){throw t instanceof Jt__default.default.ZodError?new chunk72TQRSNX_js.b(t.issues[0].message,chunk72TQRSNX_js.a.INVALID_OBJECT_NAME):t}}chunkDPD6ZWL2_js.a(De,"validateObjectName");function Ze(e){if(!e||e.length===0)throw new chunk72TQRSNX_js.h("View name cannot be empty",[{path:["name"],message:"View name cannot be empty"}]);if(e.length>ye)throw new chunk72TQRSNX_js.h("View name is too long",[{path:["name"],message:`View name is too long (max ${ye} characters)`}]);if(!gu.test(e))throw new chunk72TQRSNX_js.h("Invalid view name format",[{path:["name"],message:"View name must be in kebab-case (e.g., 'detail', 'list-view')"}])}chunkDPD6ZWL2_js.a(Ze,"validateViewName");function ue(e,t,r){let n=new Set;for(let o of e){let a=t(o);if(n.has(a))throw r(a);n.add(a);}}chunkDPD6ZWL2_js.a(ue,"assertUniqueBy");var po=Jt__default.default.string().min(1,"Attribute name cannot be empty").max(ye,`Attribute name is too long (max ${ye} characters)`).regex(co,{message:`Invalid attribute name format.
5
+ \u274C Invalid: 'Products', 'userProfiles', 'user_profiles'`});function De(e){try{Ze.parse(e);}catch(t){throw t instanceof Xt__default.default.ZodError?new chunk72TQRSNX_js.b(t.issues[0].message,chunk72TQRSNX_js.a.INVALID_OBJECT_NAME):t}}chunkDPD6ZWL2_js.a(De,"validateObjectName");function et(e){if(!e||e.length===0)throw new chunk72TQRSNX_js.h("View name cannot be empty",[{path:["name"],message:"View name cannot be empty"}]);if(e.length>ye)throw new chunk72TQRSNX_js.h("View name is too long",[{path:["name"],message:`View name is too long (max ${ye} characters)`}]);if(!gu.test(e))throw new chunk72TQRSNX_js.h("Invalid view name format",[{path:["name"],message:"View name must be in kebab-case (e.g., 'detail', 'list-view')"}])}chunkDPD6ZWL2_js.a(et,"validateViewName");function ue(e,t,r){let n=new Set;for(let o of e){let a=t(o);if(n.has(a))throw r(a);n.add(a);}}chunkDPD6ZWL2_js.a(ue,"assertUniqueBy");var po=Xt__default.default.string().min(1,"Attribute name cannot be empty").max(ye,`Attribute name is too long (max ${ye} characters)`).regex(co,{message:`Invalid attribute name format.
6
6
  Name must be a valid variable identifier:
7
7
  \u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
8
- \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!chunkSDOYGWU4_js.z.includes(e),{message:"This is a reserved attribute name"});function Ce(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute name cannot be empty");if(e.length>ye)throw new Error(`[AttributeBuilder] Attribute name is too long (max ${ye} characters)`);if(!co.test(e))throw new Error(`[AttributeBuilder] Invalid attribute name format.
8
+ \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!chunkVJYVPQ5E_js.z.includes(e),{message:"This is a reserved attribute name"});function Ce(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute name cannot be empty");if(e.length>ye)throw new Error(`[AttributeBuilder] Attribute name is too long (max ${ye} characters)`);if(!co.test(e))throw new Error(`[AttributeBuilder] Invalid attribute name format.
9
9
  Name must be a valid variable identifier:
10
10
  \u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
11
- \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(chunkSDOYGWU4_js.z.includes(e))throw new Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.
12
- Reserved names: ${chunkSDOYGWU4_js.z.join(", ")}`)}chunkDPD6ZWL2_js.a(Ce,"validateAttributeName");function mo(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute label cannot be empty");if(e.length>lo)throw new Error(`[AttributeBuilder] Attribute label is too long (max ${lo} characters)`)}chunkDPD6ZWL2_js.a(mo,"validateLabel");function fo(e,t){if(!bu.has(e))throw new Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.
13
- Icon must be one of the predefined icons from @stndrds/constants.`)}chunkDPD6ZWL2_js.a(fo,"validateIconName");function le(e,t){let r=new Set;for(let n of t){if(!n.value?.trim())throw new Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!n.label?.trim())throw new Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has an empty or missing label.`);if(r.has(n.value))throw new Error(`[AttributeBuilder] Duplicate option value "${n.value}" in "${e}".`);r.add(n.value);}for(let n of t){if(n.inverse===void 0)continue;let o=t.find(a=>a.value===n.inverse);if(!o)throw new Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has inverse "${n.inverse}" which does not match any option value.`);if(o.inverse!==n.value)throw new Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${n.value}" points to "${n.inverse}", but "${n.inverse}" points to "${o.inverse??"(none)"}". Inverse pairs must be symmetric.`)}}chunkDPD6ZWL2_js.a(le,"validateOptions");var bo={maxConcurrentRuns:3,retryPolicy:{maxRetries:3,backoffMs:1e3,backoffMultiplier:2},timeoutMs:3e5},Zt=class Zt{constructor(t){if(!t.name||t.name.trim().length===0)throw new chunk72TQRSNX_js.h("Agent name is required",[]);this.bp={name:t.name,system:true,visibility:"workspace",triggers:[]};}description(t){return this.bp.description=t,this}label(t){return this.bp.label=t,this}icon(t){return this.bp.icon=t,this}systemPrompt(t){return this.bp.systemPrompt=t,this}model(t,r,n){return this.bp.model={provider:t,model:r,...n},this}tools(t){return this.bp.tools=[...t],this}schedule(t){return this.bp.schedule={...t,enabled:t.enabled??true},this}config(t){let r=this.bp.config??bo,n=t.inference===void 0?r.inference:{...r.inference,...t.inference};return this.bp.config={...r,...t,...n===void 0?{}:{inference:n}},this}delegation(t){return Object.assign(this.bp,t),this}mcpServers(t){return this.bp.mcpServers=Array.isArray(t)?[...t]:t,this}approval(t){return this.bp.approval={...Mi,...this.bp.approval,...t},this}visibility(t){return this.bp.visibility=t,this}requiresPermission(t,r){return this.bp.requiredPermission={resource:t,action:r},this}trigger(t,r,n){return this.bp.triggers.push({name:t,eventType:r,...n,enabled:n?.enabled??true}),this}runtime(){return this.bp.system=false,this}build(){if(!this.bp.systemPrompt)throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": systemPrompt is required`,[]);if(!this.bp.model)throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": model is required`,[]);if(this.bp.system&&this.bp.visibility==="private")throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": system agents must use workspace visibility`,[]);return ue(this.bp.triggers,t=>t.name,t=>new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": duplicate trigger name "${t}"`,[])),{...this.bp,visibility:this.bp.visibility??"workspace",config:this.bp.config??bo,systemPrompt:this.bp.systemPrompt,model:this.bp.model}}};chunkDPD6ZWL2_js.a(Zt,"AgentBuilder");var Xt=Zt;function Bh(e){return new Xt(e)}chunkDPD6ZWL2_js.a(Bh,"agent");var yu="@stndrds/schema";function et(e){return {version:1,vendor:yu,validate:chunkDPD6ZWL2_js.a(t=>{let r=e.safeParse(t);return r.success?{value:r.data}:{issues:r.error.issues.map(n=>({message:n.message,path:n.path}))}},"validate")}}chunkDPD6ZWL2_js.a(et,"createStandardSchemaProps");function qh(e){return typeof e=="object"&&e!==null&&"~standard"in e&&typeof e["~standard"]=="object"&&e["~standard"].version===1}chunkDPD6ZWL2_js.a(qh,"isStandardSchema");var yr=class yr{get"~standard"(){let t=chunk5QAE5NPN_js.c(this.build());return et(t)}constructor(t,r,n){Ce(r),mo(n),this.attr={name:r,label:n,type:t,required:false,system:true};}setRequired(t){this.attr.required=t;}asRequiredState(){return this}asPhantomState(){return this}runtime(){return this.attr.system=false,this}hidden(){return this.attr.hidden=true,this}placeholder(t){return this.attr.placeholder=t,this}description(t){return this.attr.description=t,this}icon(t){return fo(t,`attribute "${this.attr.name}"`),this.attr.icon=t,this}order(t){return this.attr.order=t,this}defaultValue(t){return ("defaultValue"in this.attr||!["formula","rollup"].includes(this.attr.type))&&(this.attr.defaultValue=t),this}metadata(t){return this.attr.metadata=t,this}build(){return this.attr}};chunkDPD6ZWL2_js.a(yr,"BaseAttributeBuilder");var R=yr,hr=class hr extends R{constructor(t,r){super("text",t,r);}minLength(t){return this.attr.minLength=t,this}maxLength(t){return this.attr.maxLength=t,this}pattern(t){return this.attr.pattern=t,this.attr.format=void 0,this}multiline(t=true){return this.attr.multiline=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}email(){return this.attr.format="email",this.attr.pattern=void 0,this}url(){return this.attr.format="url",this.attr.pattern=void 0,this}slug(){return this.attr.format="slug",this.attr.pattern=void 0,this}};chunkDPD6ZWL2_js.a(hr,"TextAttributeBuilder");var er=hr;function f(e){return new er(e.name,e.label)}chunkDPD6ZWL2_js.a(f,"text");var Ar=class Ar extends R{constructor(t,r){super("richtext",t,r);}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Ar,"RichtextAttributeBuilder");var tr=Ar;function he(e){return new tr(e.name,e.label)}chunkDPD6ZWL2_js.a(he,"richtext");var Tr=class Tr extends R{constructor(t,r){super("number",t,r);}min(t){return this.attr.min=t,this}max(t){return this.attr.max=t,this}integer(){return this.attr.unit="integer",this.attr.decimals=0,this}decimal(t=2){return this.attr.unit="decimal",this.attr.decimals=t,this}percentage(){return this.attr.unit="percentage",this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Tr,"NumberAttributeBuilder");var rr=Tr;function rt(e){return new rr(e.name,e.label)}chunkDPD6ZWL2_js.a(rt,"number");var wr=class wr extends R{constructor(t,r){super("checkbox",t,r);}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(wr,"CheckboxAttributeBuilder");var nr=wr;function go(e){return new nr(e.name,e.label)}chunkDPD6ZWL2_js.a(go,"checkbox");var xr=class xr extends R{constructor(t,r){super("date",t,r);}format(t){return this.attr.dateFormat=t,this}minDate(t){return this.attr.minDate=t,this}maxDate(t){return this.attr.maxDate=t,this}endDate(){return this.attr.endDate=true,this.asPhantomState()}includeTime(){return this.attr.includeTime=true,this}timeFormat(t){return this.attr.timeFormat=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(xr,"DateAttributeBuilder");var ir=xr;function U(e){return new ir(e.name,e.label)}chunkDPD6ZWL2_js.a(U,"date");var Ir=class Ir extends R{constructor(t,r){super("phone",t,r);}defaultCountry(t){return this.attr.defaultCountryCode=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Ir,"PhoneAttributeBuilder");var or=Ir;function Xh(e){return new or(e.name,e.label)}chunkDPD6ZWL2_js.a(Xh,"phone");var Sr=class Sr extends R{constructor(t,r){super("currency",t,r);}defaultCurrency(t){return this.attr.defaultCurrency=t,this}allowedCurrencies(t){return this.attr.allowedCurrencies=t,this}allowNegative(t=true){return this.attr.allowNegative=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Sr,"CurrencyAttributeBuilder");var ar=Sr;function Zh(e){return new ar(e.name,e.label)}chunkDPD6ZWL2_js.a(Zh,"currency");var vr=class vr extends R{constructor(t,r){super("status",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(vr,"StatusAttributeBuilder");var sr=vr;function eA(e){return new sr(e.name,e.label)}chunkDPD6ZWL2_js.a(eA,"status");var Rr=class Rr extends R{constructor(t,r){super("select",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Rr,"SelectAttributeBuilder");var ur=Rr;function q(e){return new ur(e.name,e.label)}chunkDPD6ZWL2_js.a(q,"select");var Er=class Er extends R{constructor(t,r){super("multiselect",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Er,"MultiselectAttributeBuilder");var lr=Er;function tA(e){return new lr(e.name,e.label)}chunkDPD6ZWL2_js.a(tA,"multiselect");var Dr=class Dr extends R{constructor(t,r){super("location",t,r);}granularity(t){return this.attr.granularity=t,this}defaultCountry(t){return this.attr.defaultCountry=t,this}allowedCountries(t){return this.attr.allowedCountries=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Dr,"LocationAttributeBuilder");var dr=Dr;function rA(e){return new dr(e.name,e.label)}chunkDPD6ZWL2_js.a(rA,"location");var Cr=class Cr extends R{constructor(t,r){super("user",t,r),this.attr.types=["user","agent"];}types(t){let r=[...new Set(t)];if(r.length===0)throw new Error("[AttributeBuilder] user.types must contain at least one type.");return this.attr.types=r,this}multiple(){return this.attr.multiple=true,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Cr,"UserAttributeBuilder");var cr=Cr;function nA(e){return new cr(e.name,e.label)}chunkDPD6ZWL2_js.a(nA,"user");var Nr=class Nr extends R{to(t,r){let n={object:t,...r};return this.attr.targets?.push(n),this}toAny(){return this.attr.targets=[{object:$t}],this}qualifyWith(...t){let r=this.attr.targets;if(!r||r.length===0)throw new Error('.qualifyWith() must be called AFTER .to(). Example: relation({ name: "companies" }).to("companies").qualifyWith(...)');return this.attr.properties=Ye(t),this}bilateral(t){let r=this.attr.targets;if(!r||r.length===0)throw new Error('.bilateral() must be called AFTER .to(). Example: relation({ name: "company" }).to("companies").bilateral({ ... })');if(r.length>1)throw new Error("Bilateral relations are not supported for polymorphic relations (multiple .to() targets).");if(ji(this.attr))throw new Error("Bilateral relations are not supported for universal relations (.toAny()).");return this.attr.bilateral=t,this}};chunkDPD6ZWL2_js.a(Nr,"BaseRelationAttributeBuilder");var tt=Nr,kr=class kr extends tt{constructor(t,r){super("relation",t,r),this.attr.cardinality="one",this.attr.targets=[];}many(){let t=new mr(this.attr.name,this.attr.label??"",{targets:this.attr.targets,isRequired:this.attr.required});return this.attr.system===false&&t.runtime(),this.attr.hidden&&t.hidden(),this.attr.placeholder&&t.placeholder(this.attr.placeholder),this.attr.description&&t.description(this.attr.description),this.attr.icon&&t.icon(this.attr.icon),this.attr.order!==void 0&&t.order(this.attr.order),this.attr.metadata&&t.metadata(this.attr.metadata),t}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(kr,"SingleRelationAttributeBuilder");var pr=kr,Or=class Or extends tt{constructor(t,r,n){super("relation",t,r),this.attr.cardinality="many",this.attr.targets=n?.targets??[],this.attr.defaultValue=[],n?.isRequired&&this.setRequired(true);}maxItems(t){return this.attr.maxItems=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Or,"MultiRelationAttributeBuilder");var mr=Or;function Ae(e){return new pr(e.name,e.label)}chunkDPD6ZWL2_js.a(Ae,"relation");var _r=class _r extends R{constructor(t,r){super("formula",t,r),this.attr.required=false;}expression(t){return this.attr.expression=t,this}returns(t){return this.attr.returnType=t,this}decimals(t){return this.attr.decimals=t,this}required(){throw new Error("Formula attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.")}optional(){return this}};chunkDPD6ZWL2_js.a(_r,"FormulaAttributeBuilder");var fr=_r;function iA(e){return new fr(e.name,e.label)}chunkDPD6ZWL2_js.a(iA,"formula");var Pr=class Pr extends R{constructor(t,r){super("rollup",t,r),this.attr.required=false;}from(t){return this.attr.relationAttribute=t,this}aggregate(t){return this.attr.targetAttribute=t,this}using(t){return this.attr.function=t,this}decimals(t){return this.attr.decimals=t,this}path(t){return this.attr.relationPath=t,this}targetType(t){return this.attr.targetAttributeType=t,this}targetOptions(t){return this.attr.targetAttributeOptions=t,this}targetCurrency(t){return this.attr.targetCurrencyCode=t,this}build(){let t=this.attr.function,r=this.attr.targetAttributeType;if(t==="original"&&r!==void 0&&r!=="select"&&r!=="status"&&r!=="multiselect"){let n=this.attr.relationAttribute??"relation",o=this.attr.targetAttribute??"field";throw new chunk72TQRSNX_js.b(`Rollup "${this.attr.name}": .using("original") only supports a "select", "status", or "multiselect" target, but .targetType("${r}") was given. To surface a plain ${r} value from a related record, use a formula instead \u2014 e.g. formula({ name: "${this.attr.name}", label: "\u2026" }).expression("${n}.${o}").`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}return super.build()}required(){throw new Error("Rollup attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.")}optional(){return this}};chunkDPD6ZWL2_js.a(Pr,"RollupAttributeBuilder");var br=Pr;function oA(e){return new br(e.name,e.label)}chunkDPD6ZWL2_js.a(oA,"rollup");var Fr=class Fr extends R{constructor(t,r){super("document",t,r);}accepts(t){return this.attr.accepts=t,this}maxFileSize(t){return this.attr.maxFileSize=t,this}qualifyWith(...t){return this.attr.properties=Ye(t),this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Fr,"DocumentAttributeBuilder");var gr=Fr;function yo(e){return new gr(e.name,e.label)}chunkDPD6ZWL2_js.a(yo,"document");function Ao(e,t,r){let n=Array.isArray(e)?e:[e],[o,...a]=n;return {type:"slot",slotId:o,additionalSlotIds:a.length>0?a:void 0,attribute:t,label:r?.label,required:r?.required,tooltip:r?.tooltip}}chunkDPD6ZWL2_js.a(Ao,"buildSlotFieldRef");var Lr=class Lr{constructor(t,r,n){this._finalized=false;this.stepBuilder=t,this.rowData={id:r,order:n,type:"fields",fields:[]};}field(t,r,n){return this.rowData.fields.push(Ao(t,r,n)),this}freeField(t,r){let o={type:"free",attribute:t.build(),label:r?.label,required:r?.required,prefillExpression:r?.prefillExpression};return this.rowData.fields.push(o),this}row(t){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).row(t)}heading(t,r){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).heading(t,r)}separator(){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).separator()}text(t){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).text(t)}endRow(){return this._finalized?this.stepBuilder:(this._finalized=true,this.stepBuilder._finalizeRow(this.rowData))}};chunkDPD6ZWL2_js.a(Lr,"FormRowBuilder");var Vr=Lr,Br=class Br{constructor(t,r,n){this.rowOrder=0;this.formBuilder=t,this.stepData={id:r,label:n,rows:[]};}description(t){return this.stepData.description=t,this}field(t,r,n){this.rowOrder++;let o=`row-${this.stepData.id}-${this.rowOrder}`,a=Ao(t,r,n),s={id:o,order:this.rowOrder,type:"fields",fields:[a]};return this.stepData.rows.push(s),this}freeField(t,r){this.rowOrder++;let n=`row-${this.stepData.id}-${this.rowOrder}`,a={type:"free",attribute:t.build(),label:r?.label,required:r?.required,prefillExpression:r?.prefillExpression},s={id:n,order:this.rowOrder,type:"fields",fields:[a]};return this.stepData.rows.push(s),this}row(t){return this.rowOrder++,new Vr(this,t,this.rowOrder)}heading(t,r){this.rowOrder++;let n={id:`heading-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"heading",content:t,level:r};return this.stepData.rows.push(n),this}separator(){this.rowOrder++;let t={id:`sep-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"separator"};return this.stepData.rows.push(t),this}text(t){this.rowOrder++;let r={id:`text-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"text",content:t};return this.stepData.rows.push(r),this}step(t,r){return this.formBuilder._finalizeStep(this.stepData).step(t,r)}build(){return this.formBuilder._finalizeStep(this.stepData).build()}_finalizeRow(t){return t.fields.length>0&&this.stepData.rows.push(t),this}_getData(){return this.stepData}};chunkDPD6ZWL2_js.a(Br,"FormStepBuilder");var jr=Br,Ur=class Ur{constructor(t,r){this.data={slots:[],steps:[],status:"draft",version:1};this.validateName(t),this.data.name=t,this.data.label=r;}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}status(t){return this.data.status=t,this}metadata(t){return this.data.metadata=t,this}slot(t,r,n){if(this.data.slots.some(a=>a.id===t))throw new Error(`[FormBuilder] Duplicate slot id: "${t}"`);let o={id:t,objectName:r,label:n.label,mode:n.mode??"create",color:n.color,icon:n.icon};return this.data.slots.push(o),this}step(t,r){if(this.data.steps.some(n=>n.id===t))throw new Error(`[FormBuilder] Duplicate step id: "${t}"`);return new jr(this,t,r)}build(){return this.validateRequiredData(),this.validateSlotReferences(),this.validateFreeFields(),this.validatePrefillExpressions(),this.data}_finalizeStep(t){return this.data.steps.push(t),this}validateName(t){let r=Jt.z.string().min(1,"Form name cannot be empty").max(63,"Form name is too long (max 63 characters)").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Invalid form name format. Name must be in kebab-case: 'client-onboarding', 'contact-creation'"});try{r.parse(t);}catch(n){throw n instanceof Jt.z.ZodError?new Error(`[FormBuilder] ${n.issues[0].message}`):n}}validateRequiredData(){if(this.data.slots.length===0)throw new Error("[FormBuilder] At least one slot is required. Use .slot() to add slots.");if(this.data.steps.length===0)throw new Error("[FormBuilder] At least one step is required. Use .step() to add steps.")}validateSlotReferences(){let t=new Map(this.data.slots.map(r=>[r.id,r.objectName]));for(let r of this.data.steps)for(let n of r.rows)if(We(n))for(let o of n.fields){if(o.type!=="slot")continue;let a=Wi(o);for(let l of a)if(!t.has(l))throw new Error(`[FormBuilder] Step "${r.id}" references unknown slot "${l}". Declare it with .slot("${l}", ...) first.`);let s=new Set(a.map(l=>t.get(l)));if(s.size>1)throw new Error(`[FormBuilder] Step "${r.id}" field on attribute "${o.attribute}" targets slots of different objects (${[...s].join(", ")}). A multi-slot field must target slots of the same object.`)}}validatePrefillExpressions(){let t=[...Qe,"join"];for(let r of this.data.steps)for(let n of r.rows)if(We(n))for(let o of n.fields){if(!Gt(o)||!o.prefillExpression)continue;let a=o.prefillExpression,s=`prefillExpression on free field "${o.attribute.name}" in step "${r.id}"`;if(!Je(a))throw new Error(`[FormBuilder] ${s} must contain at least one {{ attribute }} interpolation.`);if(/\{\{\s*\}\}/.test(a))throw new Error(`[FormBuilder] ${s} contains empty {{ }} interpolation.`);for(let l of a.matchAll(/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g)){let p=l[1];if(!t.includes(p))throw new Error(`[FormBuilder] ${s} uses invalid pipe "${p}". Valid pipes: ${t.join(", ")}`)}}}validateFreeFields(){let t=new Set(zt);for(let r of this.data.steps)for(let n of r.rows)if(We(n)){for(let o of n.fields)if(Gt(o)){let a=o.attribute.type;if(t.has(a))throw new Error(`[FormBuilder] Free field in step "${r.id}" uses forbidden attribute type "${a}". Forbidden types: ${zt.join(", ")}`)}}}};chunkDPD6ZWL2_js.a(Ur,"FormBuilder");var Mr=Ur;function pA(e,t){return new Mr(e,t)}chunkDPD6ZWL2_js.a(pA,"form");function hu(e){return {text:"toString",richtext:"toString",number:"toNumber",currency:"toNumber",date:"toDate",checkbox:"toBoolean"}[e]}chunkDPD6ZWL2_js.a(hu,"resolveBuiltInTransform");var $r=class $r{constructor(t){this.operations=[];this.touchedAttributes=new Set;this.version=t;}assertNotTouched(t,r){if(this.touchedAttributes.has(t))throw new Error(`[MigrationBuilder] Conflicting operations on attribute "${t}": it was already modified earlier in this migration (attempted: ${r}).`)}renameAttribute(t,r){return this.assertNotTouched(t,"rename_attribute"),this.touchedAttributes.add(t),this.operations.push({type:"rename_attribute",from:t,to:r}),this}changeType(t,r,n,o){this.assertNotTouched(t,"change_type"),this.touchedAttributes.add(t);let a=o?.transform?hu(n):void 0;return this.operations.push({type:"change_type",name:t,from:r,to:n,transform:a}),this}removeAttribute(t){return this.assertNotTouched(t,"remove_attribute"),this.touchedAttributes.add(t),this.operations.push({type:"remove_attribute",name:t,backup_config:{}}),this}addAttribute(t){return this.assertNotTouched(t.name,"add_attribute"),this.touchedAttributes.add(t.name),this.operations.push({type:"add_attribute",attribute:t}),this}updateConfig(t,r){return this.assertNotTouched(t,"update_config"),this.touchedAttributes.add(t),this.operations.push({type:"update_config",name:t,from:{},to:r}),this}build(){return {version:this.version,operations:[...this.operations]}}};chunkDPD6ZWL2_js.a($r,"MigrationBuilder");var nt=$r;function Au(e){let{name:t,labelExpression:r,embeddingExpression:n}=e;if(!r)throw new chunk72TQRSNX_js.b(`Object "${t}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,chunk72TQRSNX_js.a.VALIDATION_FAILED);let o=be.safeParse(r);if(!o.success){let a=o.error.issues[0]?.message??"Invalid labelExpression";throw new chunk72TQRSNX_js.b(`Invalid labelExpression for "${t}": ${a}`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}if(n!==void 0){let a=be.safeParse(n);if(!a.success){let s=a.error.issues[0]?.message??"Invalid embeddingExpression";throw new chunk72TQRSNX_js.b(`Invalid embeddingExpression for "${t}": ${s}`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}}}chunkDPD6ZWL2_js.a(Au,"validateObjectExpressions");var zr=class zr{constructor(t){this._migrations=[];this._sealed=false;this._toleratedAttributes=[];this.validateName(t.name),this.obj={name:t.name,label:t.label,attributes:[],system:true},t.id&&(this.obj.id=t.id);}get"~standard"(){let t=chunk5QAE5NPN_js.e(this.build());return et(t)}description(t){return this.obj.description=t,this}pluralLabel(t){return this._pluralLabel=t,this}icon(t){return this.obj.icon=t,this}runtime(){return this.obj.system=false,this}sealed(){return this._sealed=true,this}tolerate(t){return this._toleratedAttributes=[...this._toleratedAttributes,...t],this}attribute(t){return this.pushAttributes([t]),this}attributes(t){return this.pushAttributes(t),this}pushAttributes(t){let r=t.map(n=>"build"in n&&typeof n.build=="function"?n.build():n);ue([...this.obj.attributes,...r],n=>n.name,n=>new chunk72TQRSNX_js.r("attribute",n,`Object "${this.obj.name}": duplicate attribute name "${n}"`)),this.obj.attributes.push(...r);}metadata(t){return this.obj.metadata={...this.obj.metadata,...t},this}order(t){return this.obj.metadata={...this.obj.metadata,order:t},this}hidden(){return this.obj.metadata={...this.obj.metadata,hidden:true},this}labelExpression(t){return this._labelExpression=t,this}embeddingExpression(t){return this._embeddingExpression=t,this}documentLayout(t){if(t.presets)for(let r of t.presets)To(r.id,r.structure,1);return this.obj.documentLayout=t,this}migration(t,r){if(t<2)throw new Error(`[ObjectBuilder] Migration version must be >= 2 (version 1 is implicit). Got: ${t}`);if(this._migrations.some(a=>a.version===t))throw new Error(`[ObjectBuilder] Duplicate migration version: ${t}`);let o=new nt(t);return r(o),this._migrations.push(o.build()),this}build(){if(!this.obj.name)throw new Error("[ObjectBuilder] Missing required field: name");if(!this.obj.label)throw new Error("[ObjectBuilder] Missing required field: label");Au({name:this.obj.name,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression});let t=[...this._migrations].sort((n,o)=>n.version-o.version);for(let n=0;n<t.length;n++){let o=n+2;if(t[n].version!==o)throw new Error(`[ObjectBuilder] Migration versions must be sequential starting at 2. Expected version ${o}, got ${t[n].version}.`)}let r=t.length>0?t[t.length-1].version:1;return {...this.obj,pluralLabel:this._pluralLabel,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression,schema_version:r,migrations:t,sealed:this._sealed,toleratedAttributes:this._toleratedAttributes}}validateName(t){t!==void 0&&De(t);}};chunkDPD6ZWL2_js.a(zr,"ObjectBuilder");var qr=zr;function z(e){return new qr(e)}chunkDPD6ZWL2_js.a(z,"object");function To(e,t,r){let n=chunkDPD6ZWL2_js.a((a,s)=>{throw new chunk72TQRSNX_js.h(a,[{path:["documentLayout","presets",e],message:s}])},"fail");r>5&&n(`Preset structure exceeds max depth of ${5}`,"Preset structure too deep");let o=new Set;for(let a of t){let s=a.title.trim();s.length===0&&n("Folder preset node title is required","Empty folder title"),s.includes("/")&&n("Folder preset node title cannot contain /",`Folder title contains /: "${s}"`),o.has(s)&&n("Folder preset sibling titles must be unique",`Duplicate folder title: "${s}"`),o.add(s),a.children&&a.children.length>0&&To(e,a.children,r+1);}}chunkDPD6ZWL2_js.a(To,"validatePresetStructure");var en=class en{constructor(t,r){this.data={type:"fields",fields:[]};this.data.id=t,this.data.label=r;}description(t){return this.data.description=t,this}collapsible(t=false){return this.data.collapsible=true,this.data.collapsed=t,this}order(t){return this.data.order=t,this}fields(...t){for(let r of t)this.data.fields?.push({attribute:r});return this}field(t,r){return this.data.fields?.push({attribute:t,...r}),this}attributeGroup(t,r){return this.data.fields?.push({attributeGroup:t,...r}),this}build(){if(!this.data.id)throw new Error("[GroupBuilder] id is required");if(!this.data.label)throw new Error("[GroupBuilder] label is required");if(!this.data.fields||this.data.fields.length===0)throw new Error("[GroupBuilder] At least one field is required");return this.data}};chunkDPD6ZWL2_js.a(en,"GroupBuilder");var ot=en,tn=class tn{constructor(t,r){this.view=t,this.tabData=r;}columns(...t){return this.tabData.columns=t,this}create(t){return this.tabData.allowCreate=true,t?.mode&&(this.tabData.createMode=t.mode),this}createMode(t){return this.tabData.createMode=t,this}edit(){return this.tabData.allowEdit=true,this}delete(){return this.tabData.allowDelete=true,this}crud(){return this.tabData.allowCreate=true,this.tabData.allowEdit=true,this.tabData.allowDelete=true,this}filters(t){return this.tabData.filters=t,this}sorts(t){return this.tabData.sorts=t,this}sort(t,r="asc"){return this.tabData.sorts||(this.tabData.sorts=[]),this.tabData.sorts.push({attribute:t,direction:r}),this}tab(t,r){return this.finalize(),new Q(this.view,t,r)}done(){return this.finalize(),this.view}build(){return this.finalize(),this.view.build()}finalize(){if(!this.tabData.columns||this.tabData.columns.length===0)throw new Error(`[TableTabConfig] columns() is required for tab "${this.tabData.name}"`);this.view._addTab(this.tabData);}};chunkDPD6ZWL2_js.a(tn,"TableTabConfig");var at=tn,rn=class rn{constructor(t,r,n){this.view=t,this.tabData={...r,type:"custom",component:n};}props(t){return this.tabData.props=t,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(rn,"CustomTabConfig");var Gr=rn,nn=class nn{constructor(t,r,n){this.view=t,this.tabData={...r,type:"richtext",attribute:n};}titleAttribute(t){return this.tabData.titleAttribute=t,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(nn,"RichtextTabConfig");var Wr=nn,on=class on{constructor(t,r){this.view=t,this.tabData={...r,type:"activity"};}limit(t){return this.tabData.limit=t,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(on,"ActivityTabConfig");var Kr=on,an=class an{constructor(t,r,n){this.view=t,this.tabData={...r,type:n,emailAttributeIds:[]};}emailAttributes(...t){return this.tabData.emailAttributeIds=t,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(an,"AddressMatchedTabConfig");var st=an,sn=class sn extends st{constructor(t,r){super(t,r,"emails");}};chunkDPD6ZWL2_js.a(sn,"EmailsTabConfig");var Yr=sn,un=class un extends st{constructor(t,r){super(t,r,"meetings");}};chunkDPD6ZWL2_js.a(un,"MeetingsTabConfig");var Hr=un,ln=class ln{constructor(t,r){this.view=t,this.tabData={...r,type:"documents",allowUpload:true,allowRemove:true,hideAttachments:false};}disableUpload(){return this.tabData.allowUpload=false,this}disableRemove(){return this.tabData.allowRemove=false,this}hideAttachments(){return this.tabData.hideAttachments=true,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(ln,"DocumentsTabConfig");var Qr=ln,dn=class dn{constructor(t,r,n){this.view=t,this.base={id:r,name:r,label:n};}icon(t){return this.base.icon=t,this}order(t){return this.base.order=t,this}form(...t){if(t.length===0)throw new Error(`[TabBuilder] form() requires at least one group for tab "${this.base.name}"`);let r={...this.base,type:"form",groups:t.map(n=>n instanceof ot?n.build():n)};return this.view._addTab(r)}table(t){return new at(this.view,{...this.base,type:"table",source:{type:"relation",attribute:t},columns:[]})}tableFrom(t,r){return new at(this.view,{...this.base,type:"table",source:{type:"inverse",object:t,attribute:r},columns:[]})}custom(t){return new Gr(this.view,this.base,t)}richtext(t){return new Wr(this.view,this.base,t)}activity(){return new Kr(this.view,this.base)}documents(){return new Qr(this.view,this.base)}emails(){return new Yr(this.view,this.base)}meetings(){return new Hr(this.view,this.base)}forms(t){let r={...this.base,type:"forms",...t};return this.view._addTab(r)}};chunkDPD6ZWL2_js.a(dn,"TabBuilder");var Q=dn,cn=class cn{constructor(t,r){Ze(t),this.data={name:t,label:r,tabs:[]};}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}for(t){return this.data.object=t,this}default(){return this.data.default=true,this}metadata(t){return this.data.metadata=t,this}sidePanel(t){return this.data.sidePanel=t,this}tab(t,r){return new Q(this,t,r)}addTab(t){return this.data.tabs.push(t),this}_addTab(t){return this.data.tabs.push(t),this}build(){if(!this.data.object)throw new Error("[DetailViewBuilder] for() is required - specify the target object");if(this.data.tabs.length===0)throw new Error("[DetailViewBuilder] At least one tab is required");ue(this.data.tabs,r=>r.name,r=>new Error(`[DetailViewBuilder] Duplicate tab name "${r}"`));let t={tabs:this.data.tabs,sidePanel:this.data.sidePanel};return {name:this.data.name,label:this.data.label,description:this.data.description,icon:this.data.icon,object:this.data.object,type:"detail",config:t,default:this.data.default,metadata:this.data.metadata}}};chunkDPD6ZWL2_js.a(cn,"DetailViewBuilder");var Jr=cn;function ee(e,t){return new Jr(e,t)}chunkDPD6ZWL2_js.a(ee,"detailView");function it(e){if(Array.isArray(e))return e.map(it).find(r=>r!==void 0);if(e===null||typeof e!="object")return;let t=e;return t.attribute==="visibility"||t.attribute==="ownedBy"?t.attribute:it(t.rules)??it(t.groups)}chunkDPD6ZWL2_js.a(it,"findProtectedTabFilterAttribute");var pn=class pn{constructor(t,r){Ze(t),this.data={name:t,label:r,tabs:[]};}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}for(t){return this.data.object=t,this}default(){return this.data.default=true,this}metadata(t){return this.data.metadata=t,this}baseFilter(t){return this.data.defaultFilters=t,this}allowPresentationCustomization(){return this.data.allowPresentationCustomization=true,this}tab(t,r){return new Zr(this,t,r)}_addTab(t){return this.data.tabs.push(t),this}build(){if(!this.data.object)throw new Error("[ListViewBuilder] for() is required - specify the target object");if(this.data.tabs.length===0)throw new Error("[ListViewBuilder] At least one tab is required");if(ue(this.data.tabs,n=>n.id,n=>new Error(`[ListViewBuilder] Duplicate tab id "${n}"`)),this.data.tabs.filter(n=>n.default).length>1)throw new Error("[ListViewBuilder] Only one tab can be marked as default");for(let n of this.data.tabs){if(n.layout==="table"&&n.columns.length===0)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" must have at least one column`,[]);if(n.layout==="kanban"&&!n.groupByAttribute)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Kanban tab "${n.id}" requires a groupByAttribute`,[]);if(n.descriptionAttribute!==void 0&&n.descriptionAttribute.length===0)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" requires a nonempty description attribute name`,[]);if(n.displayAttributes!==void 0){let o=chunkSDOYGWU4_js.Y.safeParse(n.displayAttributes);if(!o.success)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" has invalid display attributes`,o.error.issues.map(a=>({path:["tabs",n.id,"displayAttributes",...a.path.map(String)],message:a.message})))}}let r={allowPresentationCustomization:this.data.allowPresentationCustomization,defaultFilters:this.data.defaultFilters?{id:chunkLQYUPOWB_js.d(),combinator:this.data.defaultFilters.combinator,rules:this.data.defaultFilters.rules}:void 0,tabs:this.data.tabs.map(n=>{let o={id:n.id,label:n.label,icon:n.icon,default:n.default,visibility:n.visibility,columns:n.columns,descriptionAttribute:n.descriptionAttribute,displayAttributes:n.displayAttributes,filters:n.filters?{id:chunkLQYUPOWB_js.d(),combinator:n.filters.combinator,rules:n.filters.rules}:void 0,sorts:n.sorts,createMode:n.createMode};return n.layout==="kanban"?{...o,layout:"kanban",groupByAttribute:n.groupByAttribute,cardUserAttribute:n.cardUserAttribute,cardDateAttribute:n.cardDateAttribute,kanbanColumnOrder:n.kanbanColumnOrder,kanbanColumnVisibility:n.kanbanColumnVisibility,kanbanPinnedColumns:n.kanbanPinnedColumns}:{...o,layout:n.layout,columnSizing:n.columnSizing}})};return {name:this.data.name,label:this.data.label,description:this.data.description,icon:this.data.icon,object:this.data.object,type:"list",config:r,default:this.data.default,metadata:this.data.metadata}}};chunkDPD6ZWL2_js.a(pn,"ListViewBuilder");var Xr=pn,ut=class ut{constructor(t,r,n){this.view=t,this.tabData={id:r,label:n,visibility:"all",layout:"table",columns:[]};}icon(t){return this.tabData.icon=t,this}default(){return this.tabData.default=true,this}visibility(t){return this.tabData.visibility=t,this}table(){return this.tabData.layout="table",this}list(){return this.tabData.layout="list",this}descriptionAttribute(t){return this.tabData.descriptionAttribute=t,this}displayAttributes(...t){return this.tabData.displayAttributes=t,this}kanban(t){return this.tabData.layout="kanban",this.tabData.groupByAttribute=t,this}cardUserAttribute(t){return this.tabData.cardUserAttribute=t,this}cardDateAttribute(t){return this.tabData.cardDateAttribute=t,this}kanbanColumnOrder(t){return this.tabData.kanbanColumnOrder=t,this}kanbanColumnVisibility(t){return this.tabData.kanbanColumnVisibility=t,this}kanbanPinnedColumns(t){return this.tabData.kanbanPinnedColumns=t,this}createMode(t){return this.tabData.createMode=t,this}columns(...t){return this.tabData.columns=t,this}columnWidth(t,r){return this.tabData.columnSizing||(this.tabData.columnSizing={}),this.tabData.columnSizing[t]=r,this}filter(t){let r=it(t);if(r){let n=`Tab filters cannot target "${r}". Use .visibility("private")`;throw new chunk72TQRSNX_js.h(n,[{path:["filters"],message:n}])}return this.tabData.filters=t,this}sort(t,r="asc"){return this.tabData.sorts||(this.tabData.sorts=[]),this.tabData.sorts.push({attribute:t,direction:r}),this}sorts(t){return this.tabData.sorts=t,this}tab(t,r){return this.view._addTab(this.tabData),new ut(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(ut,"ListViewTabConfigBuilder");var Zr=ut;function G(e,t){return new Xr(e,t)}chunkDPD6ZWL2_js.a(G,"listView");function CA(e,t){return new ot(e,t)}chunkDPD6ZWL2_js.a(CA,"group");function Tu(e){if(!/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z]$/.test(e))throw new Error(`Invalid flag name "${e}". Flag names must be kebab-case (e.g., "architect-mode", "ai-features").`)}chunkDPD6ZWL2_js.a(Tu,"validateFlagName");var yn=class yn{constructor(t,r,n){Tu(t),this.flag={name:t,valueType:r,defaultValue:n,allowedLevels:["global","tenant","user"]};}label(t){return this.flag.label=t,this}description(t){return this.flag.description=t,this}category(t){return this.flag.category=t,this}system(){return this.flag.system=true,this}tenantScoped(){return this.flag.allowedLevels=["global","tenant"],this}globalOnly(){return this.flag.allowedLevels=["global"],this}allowedLevels(t){return this.flag.allowedLevels=[...t],this}build(){if(!this.flag.label?.trim())throw new Error(`Flag "${this.flag.name}" must have a label. Use .label("Human-readable label").`);return {...this.flag,allowedLevels:[...this.flag.allowedLevels||[]]}}};chunkDPD6ZWL2_js.a(yn,"BaseFlagBuilder");var Te=yn,hn=class hn extends Te{constructor(t){super(t,"boolean",false);}defaultValue(t){return this.flag.defaultValue=t,this}enabledByDefault(){return this.flag.defaultValue=true,this}};chunkDPD6ZWL2_js.a(hn,"BooleanFlagBuilder");var mn=hn,An=class An extends Te{constructor(t){super(t,"string","");}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(An,"StringFlagBuilder");var fn=An,Tn=class Tn extends Te{constructor(t){super(t,"number",0);}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(Tn,"NumberFlagBuilder");var bn=Tn,wn=class wn extends Te{constructor(t,r){super(t,"json",r);}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(wn,"JsonFlagBuilder");var gn=wn;function wu(e){return new mn(e)}chunkDPD6ZWL2_js.a(wu,"booleanFlag");function xu(e){return new fn(e)}chunkDPD6ZWL2_js.a(xu,"stringFlag");function Iu(e){return new bn(e)}chunkDPD6ZWL2_js.a(Iu,"numberFlag");function Su(e,t){return new gn(e,t)}chunkDPD6ZWL2_js.a(Su,"jsonFlag");function xn(e){return new chunk72TQRSNX_js.r("feature flag",e,`Flag "${e}" is already registered. Each flag name must be unique.`)}chunkDPD6ZWL2_js.a(xn,"duplicateFlagError");function In(e){return {...e,allowedLevels:[...e.allowedLevels]}}chunkDPD6ZWL2_js.a(In,"cloneFlagDefinition");var Sn=class Sn{constructor(){this.flags=new Map;}register(t){if(this.flags.has(t.name))throw xn(t.name);this.flags.set(t.name,In(t));}registerAll(t){let r=new Set;for(let n of t){if(this.flags.has(n.name)||r.has(n.name))throw xn(n.name);r.add(n.name);}for(let n of t)this.register(n);}get(t){let r=this.flags.get(t);return r?In(r):void 0}getOrThrow(t){let r=this.get(t);if(!r)throw new chunk72TQRSNX_js.c("Feature flag",t,void 0,`Flag "${t}" is not registered. Available flags: ${this.listNames().join(", ")}`);return r}has(t){return this.flags.has(t)}list(){return Array.from(this.flags.values(),In)}listNames(){return Array.from(this.flags.keys())}unregister(t){return this.flags.delete(t)}clear(){this.flags.clear();}get size(){return this.flags.size}};chunkDPD6ZWL2_js.a(Sn,"FlagRegistry");var Ne=Sn,vu=new Ne;function Ru(){return new Ne}chunkDPD6ZWL2_js.a(Ru,"createFlagRegistry");function lt(){return {global:new Map,tenant:new Map,user:new Map}}chunkDPD6ZWL2_js.a(lt,"emptyOverrides");function Eu(e,t){return e.expiresAt===void 0||e.expiresAt.getTime()>t}chunkDPD6ZWL2_js.a(Eu,"isActiveOverride");function vn(e,t){let r=new Map;for(let n of e){if(!Eu(n,t))continue;let o=n.flagName;r.has(o)||r.set(o,n);}return r}chunkDPD6ZWL2_js.a(vn,"indexOverrides");var Rn=class Rn{constructor(t){this.repository=t.repository,this.registry=t.registry,this.staticDefaults=new Map(t.staticDefaults?.map(r=>[r.name,r.value])??[]);}async resolveAll(t={}){let r=this.collectFlagNames(),n=this.repository&&r.size>0?await this.getAllOverrides(t,[...r]):lt();return this.resolveNames(r,n,t)}resolveAllStatic(){return this.resolveNames(this.collectFlagNames(),lt(),{})}collectFlagNames(){let t=new Set;for(let r of this.registry.listNames())t.add(r);for(let r of this.staticDefaults.keys())t.add(r);return t}resolveNames(t,r,n){let o=new Map;for(let a of t)o.set(a,this.resolveValue(a,r,n));return o}async resolve(t,r={}){let n=this.repository?await this.getAllOverrides(r,[t]):lt();return this.resolveWithSource(t,n,r)}async isEnabled(t,r={}){return (await this.resolve(t,r)).value===true}async getValue(t,r={}){return (await this.resolve(t,r)).value}async setOverride(t,r,n,o={}){if(!this.repository)throw new chunk72TQRSNX_js.b("Cannot set override: no FeatureFlagsRepository configured. Add featureFlags to your DatabaseAdapter to enable runtime overrides.",chunk72TQRSNX_js.a.CONFIGURATION_REQUIRED);let a=this.registry.get(t);if(a&&!a.allowedLevels.includes(r)){let s=`Flag "${t}" does not allow ${r}-level overrides. Allowed levels: ${a.allowedLevels.join(", ")}`;throw new chunk72TQRSNX_js.h(s,[{path:["level"],message:s}])}if(a?.system){let s=`Flag "${t}" is a system flag and cannot be overridden via API.`;throw new chunk72TQRSNX_js.h(s,[{path:["flagName"],message:s}])}await this.repository.setOverride({flagName:t,level:r,value:n,targetId:o.targetId,expiresAt:o.expiresAt,createdBy:o.createdBy});}async deleteOverride(t,r,n){if(!this.repository)throw new chunk72TQRSNX_js.b("Cannot delete override: no FeatureFlagsRepository configured.",chunk72TQRSNX_js.a.CONFIGURATION_REQUIRED);await this.repository.deleteOverride(t,r,n);}async getAllOverrides(t,r){if(!this.repository)return lt();let[n,o,a]=await Promise.all([this.repository.getOverrides({level:"global",flagNames:r}),t.tenantId?this.repository.getOverrides({level:"tenant",targetId:t.tenantId,flagNames:r}):Promise.resolve([]),t.userId?this.repository.getOverrides({level:"user",targetId:t.userId,flagNames:r}):Promise.resolve([])]),s=Date.now();return {global:vn(n,s),tenant:vn(o,s),user:vn(a,s)}}resolveValue(t,r,n){return this.resolveWithSource(t,r,n).value}resolveWithSource(t,r,n){let o=this.registry.get(t),a=o?.allowedLevels??["global","tenant","user"];if(n.userId&&a.includes("user")){let s=r.user.get(t);if(s)return {name:t,value:s.value,source:"user",sourceId:n.userId}}if(n.tenantId&&a.includes("tenant")){let s=r.tenant.get(t);if(s)return {name:t,value:s.value,source:"tenant",sourceId:n.tenantId}}if(a.includes("global")){let s=r.global.get(t);if(s)return {name:t,value:s.value,source:"global"}}return this.staticDefaults.has(t)?{name:t,value:this.staticDefaults.get(t),source:"default"}:{name:t,value:o?.defaultValue??void 0,source:"default"}}};chunkDPD6ZWL2_js.a(Rn,"FlagService");var dt=Rn;function Du(e){return new dt(e)}chunkDPD6ZWL2_js.a(Du,"createFlagService");function En(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(En,"cloneObjectDefinition");var Cn=class Cn{constructor(){this.objects=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r){let o="build"in n&&typeof n.build=="function"?n.build():n;this.validateAndRegister(o);}return this}validateAndRegister(t){if(!t.system){let r=`[NativeObjectRegistry] Cannot register object "${t.name}" (id: ${t.id}): missing system flag.
11
+ \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(chunkVJYVPQ5E_js.z.includes(e))throw new Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.
12
+ Reserved names: ${chunkVJYVPQ5E_js.z.join(", ")}`)}chunkDPD6ZWL2_js.a(Ce,"validateAttributeName");function mo(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute label cannot be empty");if(e.length>lo)throw new Error(`[AttributeBuilder] Attribute label is too long (max ${lo} characters)`)}chunkDPD6ZWL2_js.a(mo,"validateLabel");function fo(e,t){if(!bu.has(e))throw new Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.
13
+ Icon must be one of the predefined icons from @stndrds/constants.`)}chunkDPD6ZWL2_js.a(fo,"validateIconName");function le(e,t){let r=new Set;for(let n of t){if(!n.value?.trim())throw new Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!n.label?.trim())throw new Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has an empty or missing label.`);if(r.has(n.value))throw new Error(`[AttributeBuilder] Duplicate option value "${n.value}" in "${e}".`);r.add(n.value);}for(let n of t){if(n.inverse===void 0)continue;let o=t.find(a=>a.value===n.inverse);if(!o)throw new Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has inverse "${n.inverse}" which does not match any option value.`);if(o.inverse!==n.value)throw new Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${n.value}" points to "${n.inverse}", but "${n.inverse}" points to "${o.inverse??"(none)"}". Inverse pairs must be symmetric.`)}}chunkDPD6ZWL2_js.a(le,"validateOptions");var bo={maxConcurrentRuns:3,retryPolicy:{maxRetries:3,backoffMs:1e3,backoffMultiplier:2},timeoutMs:3e5},er=class er{constructor(t){if(!t.name||t.name.trim().length===0)throw new chunk72TQRSNX_js.h("Agent name is required",[]);this.bp={name:t.name,system:true,visibility:"workspace",triggers:[]};}description(t){return this.bp.description=t,this}label(t){return this.bp.label=t,this}icon(t){return this.bp.icon=t,this}systemPrompt(t){return this.bp.systemPrompt=t,this}model(t,r,n){return this.bp.model={provider:t,model:r,...n},this}tools(t){return this.bp.tools=[...t],this}schedule(t){return this.bp.schedule={...t,enabled:t.enabled??true},this}config(t){let r=this.bp.config??bo,n=t.inference===void 0?r.inference:{...r.inference,...t.inference};return this.bp.config={...r,...t,...n===void 0?{}:{inference:n}},this}delegation(t){return Object.assign(this.bp,t),this}mcpServers(t){return this.bp.mcpServers=Array.isArray(t)?[...t]:t,this}approval(t){return this.bp.approval={...Mi,...this.bp.approval,...t},this}visibility(t){return this.bp.visibility=t,this}requiresPermission(t,r){return this.bp.requiredPermission={resource:t,action:r},this}trigger(t,r,n){return this.bp.triggers.push({name:t,eventType:r,...n,enabled:n?.enabled??true}),this}runtime(){return this.bp.system=false,this}build(){if(!this.bp.systemPrompt)throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": systemPrompt is required`,[]);if(!this.bp.model)throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": model is required`,[]);if(this.bp.system&&this.bp.visibility==="private")throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": system agents must use workspace visibility`,[]);return ue(this.bp.triggers,t=>t.name,t=>new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": duplicate trigger name "${t}"`,[])),{...this.bp,visibility:this.bp.visibility??"workspace",config:this.bp.config??bo,systemPrompt:this.bp.systemPrompt,model:this.bp.model}}};chunkDPD6ZWL2_js.a(er,"AgentBuilder");var Zt=er;function qh(e){return new Zt(e)}chunkDPD6ZWL2_js.a(qh,"agent");var yu="@stndrds/schema";function tt(e){return {version:1,vendor:yu,validate:chunkDPD6ZWL2_js.a(t=>{let r=e.safeParse(t);return r.success?{value:r.data}:{issues:r.error.issues.map(n=>({message:n.message,path:n.path}))}},"validate")}}chunkDPD6ZWL2_js.a(tt,"createStandardSchemaProps");function Wh(e){return typeof e=="object"&&e!==null&&"~standard"in e&&typeof e["~standard"]=="object"&&e["~standard"].version===1}chunkDPD6ZWL2_js.a(Wh,"isStandardSchema");var hr=class hr{get"~standard"(){let t=chunk5QAE5NPN_js.c(this.build());return tt(t)}constructor(t,r,n){Ce(r),mo(n),this.attr={name:r,label:n,type:t,required:false,system:true};}setRequired(t){this.attr.required=t;}asRequiredState(){return this}asPhantomState(){return this}runtime(){return this.attr.system=false,this}hidden(){return this.attr.hidden=true,this}placeholder(t){return this.attr.placeholder=t,this}description(t){return this.attr.description=t,this}icon(t){return fo(t,`attribute "${this.attr.name}"`),this.attr.icon=t,this}order(t){return this.attr.order=t,this}defaultValue(t){return ("defaultValue"in this.attr||!["formula","rollup"].includes(this.attr.type))&&(this.attr.defaultValue=t),this}metadata(t){return this.attr.metadata=t,this}build(){return this.attr}};chunkDPD6ZWL2_js.a(hr,"BaseAttributeBuilder");var R=hr,Ar=class Ar extends R{constructor(t,r){super("text",t,r);}minLength(t){return this.attr.minLength=t,this}maxLength(t){return this.attr.maxLength=t,this}pattern(t){return this.attr.pattern=t,this.attr.format=void 0,this}multiline(t=true){return this.attr.multiline=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}email(){return this.attr.format="email",this.attr.pattern=void 0,this}url(){return this.attr.format="url",this.attr.pattern=void 0,this}slug(){return this.attr.format="slug",this.attr.pattern=void 0,this}};chunkDPD6ZWL2_js.a(Ar,"TextAttributeBuilder");var tr=Ar;function f(e){return new tr(e.name,e.label)}chunkDPD6ZWL2_js.a(f,"text");var Tr=class Tr extends R{constructor(t,r){super("richtext",t,r);}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Tr,"RichtextAttributeBuilder");var rr=Tr;function he(e){return new rr(e.name,e.label)}chunkDPD6ZWL2_js.a(he,"richtext");var wr=class wr extends R{constructor(t,r){super("number",t,r);}min(t){return this.attr.min=t,this}max(t){return this.attr.max=t,this}integer(){return this.attr.unit="integer",this.attr.decimals=0,this}decimal(t=2){return this.attr.unit="decimal",this.attr.decimals=t,this}percentage(){return this.attr.unit="percentage",this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(wr,"NumberAttributeBuilder");var nr=wr;function nt(e){return new nr(e.name,e.label)}chunkDPD6ZWL2_js.a(nt,"number");var xr=class xr extends R{constructor(t,r){super("checkbox",t,r);}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(xr,"CheckboxAttributeBuilder");var ir=xr;function go(e){return new ir(e.name,e.label)}chunkDPD6ZWL2_js.a(go,"checkbox");var Ir=class Ir extends R{constructor(t,r){super("date",t,r);}format(t){return this.attr.dateFormat=t,this}minDate(t){return this.attr.minDate=t,this}maxDate(t){return this.attr.maxDate=t,this}endDate(){return this.attr.endDate=true,this.asPhantomState()}includeTime(){return this.attr.includeTime=true,this}timeFormat(t){return this.attr.timeFormat=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Ir,"DateAttributeBuilder");var or=Ir;function U(e){return new or(e.name,e.label)}chunkDPD6ZWL2_js.a(U,"date");var Sr=class Sr extends R{constructor(t,r){super("phone",t,r);}defaultCountry(t){return this.attr.defaultCountryCode=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Sr,"PhoneAttributeBuilder");var ar=Sr;function tA(e){return new ar(e.name,e.label)}chunkDPD6ZWL2_js.a(tA,"phone");var vr=class vr extends R{constructor(t,r){super("currency",t,r);}defaultCurrency(t){return this.attr.defaultCurrency=t,this}allowedCurrencies(t){return this.attr.allowedCurrencies=t,this}allowNegative(t=true){return this.attr.allowNegative=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(vr,"CurrencyAttributeBuilder");var sr=vr;function rA(e){return new sr(e.name,e.label)}chunkDPD6ZWL2_js.a(rA,"currency");var Rr=class Rr extends R{constructor(t,r){super("status",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Rr,"StatusAttributeBuilder");var ur=Rr;function nA(e){return new ur(e.name,e.label)}chunkDPD6ZWL2_js.a(nA,"status");var Er=class Er extends R{constructor(t,r){super("select",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Er,"SelectAttributeBuilder");var lr=Er;function q(e){return new lr(e.name,e.label)}chunkDPD6ZWL2_js.a(q,"select");var Dr=class Dr extends R{constructor(t,r){super("multiselect",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Dr,"MultiselectAttributeBuilder");var dr=Dr;function iA(e){return new dr(e.name,e.label)}chunkDPD6ZWL2_js.a(iA,"multiselect");var Cr=class Cr extends R{constructor(t,r){super("location",t,r);}granularity(t){return this.attr.granularity=t,this}defaultCountry(t){return this.attr.defaultCountry=t,this}allowedCountries(t){return this.attr.allowedCountries=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Cr,"LocationAttributeBuilder");var cr=Cr;function oA(e){return new cr(e.name,e.label)}chunkDPD6ZWL2_js.a(oA,"location");var Nr=class Nr extends R{constructor(t,r){super("user",t,r),this.attr.types=["user","agent"];}types(t){let r=[...new Set(t)];if(r.length===0)throw new Error("[AttributeBuilder] user.types must contain at least one type.");return this.attr.types=r,this}multiple(){return this.attr.multiple=true,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Nr,"UserAttributeBuilder");var pr=Nr;function aA(e){return new pr(e.name,e.label)}chunkDPD6ZWL2_js.a(aA,"user");var Or=class Or extends R{to(t,r){let n={object:t,...r};return this.attr.targets?.push(n),this}toAny(){return this.attr.targets=[{object:We}],this}qualifyWith(...t){let r=this.attr.targets;if(!r||r.length===0)throw new Error('.qualifyWith() must be called AFTER .to(). Example: relation({ name: "companies" }).to("companies").qualifyWith(...)');return this.attr.properties=He(t),this}bilateral(t){let r=this.attr.targets;if(!r||r.length===0)throw new Error('.bilateral() must be called AFTER .to(). Example: relation({ name: "company" }).to("companies").bilateral({ ... })');if(r.length>1)throw new Error("Bilateral relations are not supported for polymorphic relations (multiple .to() targets).");if(ji(this.attr))throw new Error("Bilateral relations are not supported for universal relations (.toAny()).");return this.attr.bilateral=t,this}};chunkDPD6ZWL2_js.a(Or,"BaseRelationAttributeBuilder");var rt=Or,kr=class kr extends rt{constructor(t,r){super("relation",t,r),this.attr.cardinality="one",this.attr.targets=[];}many(){let t=new fr(this.attr.name,this.attr.label??"",{targets:this.attr.targets,isRequired:this.attr.required});return this.attr.system===false&&t.runtime(),this.attr.hidden&&t.hidden(),this.attr.placeholder&&t.placeholder(this.attr.placeholder),this.attr.description&&t.description(this.attr.description),this.attr.icon&&t.icon(this.attr.icon),this.attr.order!==void 0&&t.order(this.attr.order),this.attr.metadata&&t.metadata(this.attr.metadata),t}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(kr,"SingleRelationAttributeBuilder");var mr=kr,_r=class _r extends rt{constructor(t,r,n){super("relation",t,r),this.attr.cardinality="many",this.attr.targets=n?.targets??[],this.attr.defaultValue=[],n?.isRequired&&this.setRequired(true);}maxItems(t){return this.attr.maxItems=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(_r,"MultiRelationAttributeBuilder");var fr=_r;function Ae(e){return new mr(e.name,e.label)}chunkDPD6ZWL2_js.a(Ae,"relation");var Pr=class Pr extends R{constructor(t,r){super("formula",t,r),this.attr.required=false;}expression(t){return this.attr.expression=t,this}returns(t){return this.attr.returnType=t,this}decimals(t){return this.attr.decimals=t,this}required(){throw new Error("Formula attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.")}optional(){return this}};chunkDPD6ZWL2_js.a(Pr,"FormulaAttributeBuilder");var br=Pr;function sA(e){return new br(e.name,e.label)}chunkDPD6ZWL2_js.a(sA,"formula");var Fr=class Fr extends R{constructor(t,r){super("rollup",t,r),this.attr.required=false;}from(t){return this.attr.relationAttribute=t,this}aggregate(t){return this.attr.targetAttribute=t,this}using(t){return this.attr.function=t,this}decimals(t){return this.attr.decimals=t,this}path(t){return this.attr.relationPath=t,this}targetType(t){return this.attr.targetAttributeType=t,this}targetOptions(t){return this.attr.targetAttributeOptions=t,this}targetCurrency(t){return this.attr.targetCurrencyCode=t,this}build(){let t=this.attr.function,r=this.attr.targetAttributeType;if(t==="original"&&r!==void 0&&r!=="select"&&r!=="status"&&r!=="multiselect"){let n=this.attr.relationAttribute??"relation",o=this.attr.targetAttribute??"field";throw new chunk72TQRSNX_js.b(`Rollup "${this.attr.name}": .using("original") only supports a "select", "status", or "multiselect" target, but .targetType("${r}") was given. To surface a plain ${r} value from a related record, use a formula instead \u2014 e.g. formula({ name: "${this.attr.name}", label: "\u2026" }).expression("${n}.${o}").`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}return super.build()}required(){throw new Error("Rollup attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.")}optional(){return this}};chunkDPD6ZWL2_js.a(Fr,"RollupAttributeBuilder");var gr=Fr;function uA(e){return new gr(e.name,e.label)}chunkDPD6ZWL2_js.a(uA,"rollup");var Vr=class Vr extends R{constructor(t,r){super("document",t,r);}accepts(t){return this.attr.accepts=t,this}maxFileSize(t){return this.attr.maxFileSize=t,this}qualifyWith(...t){return this.attr.properties=He(t),this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Vr,"DocumentAttributeBuilder");var yr=Vr;function yo(e){return new yr(e.name,e.label)}chunkDPD6ZWL2_js.a(yo,"document");function Ao(e,t,r){let n=Array.isArray(e)?e:[e],[o,...a]=n;return {type:"slot",slotId:o,additionalSlotIds:a.length>0?a:void 0,attribute:t,label:r?.label,required:r?.required,tooltip:r?.tooltip}}chunkDPD6ZWL2_js.a(Ao,"buildSlotFieldRef");var Br=class Br{constructor(t,r,n){this._finalized=false;this.stepBuilder=t,this.rowData={id:r,order:n,type:"fields",fields:[]};}field(t,r,n){return this.rowData.fields.push(Ao(t,r,n)),this}freeField(t,r){let o={type:"free",attribute:t.build(),label:r?.label,required:r?.required,prefillExpression:r?.prefillExpression};return this.rowData.fields.push(o),this}row(t){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).row(t)}heading(t,r){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).heading(t,r)}separator(){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).separator()}text(t){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).text(t)}endRow(){return this._finalized?this.stepBuilder:(this._finalized=true,this.stepBuilder._finalizeRow(this.rowData))}};chunkDPD6ZWL2_js.a(Br,"FormRowBuilder");var jr=Br,Ur=class Ur{constructor(t,r,n){this.rowOrder=0;this.formBuilder=t,this.stepData={id:r,label:n,rows:[]};}description(t){return this.stepData.description=t,this}field(t,r,n){this.rowOrder++;let o=`row-${this.stepData.id}-${this.rowOrder}`,a=Ao(t,r,n),s={id:o,order:this.rowOrder,type:"fields",fields:[a]};return this.stepData.rows.push(s),this}freeField(t,r){this.rowOrder++;let n=`row-${this.stepData.id}-${this.rowOrder}`,a={type:"free",attribute:t.build(),label:r?.label,required:r?.required,prefillExpression:r?.prefillExpression},s={id:n,order:this.rowOrder,type:"fields",fields:[a]};return this.stepData.rows.push(s),this}row(t){return this.rowOrder++,new jr(this,t,this.rowOrder)}heading(t,r){this.rowOrder++;let n={id:`heading-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"heading",content:t,level:r};return this.stepData.rows.push(n),this}separator(){this.rowOrder++;let t={id:`sep-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"separator"};return this.stepData.rows.push(t),this}text(t){this.rowOrder++;let r={id:`text-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"text",content:t};return this.stepData.rows.push(r),this}step(t,r){return this.formBuilder._finalizeStep(this.stepData).step(t,r)}build(){return this.formBuilder._finalizeStep(this.stepData).build()}_finalizeRow(t){return t.fields.length>0&&this.stepData.rows.push(t),this}_getData(){return this.stepData}};chunkDPD6ZWL2_js.a(Ur,"FormStepBuilder");var Mr=Ur,$r=class $r{constructor(t,r){this.data={slots:[],steps:[],status:"draft",version:1};this.validateName(t),this.data.name=t,this.data.label=r;}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}status(t){return this.data.status=t,this}metadata(t){return this.data.metadata=t,this}slot(t,r,n){if(this.data.slots.some(a=>a.id===t))throw new Error(`[FormBuilder] Duplicate slot id: "${t}"`);let o={id:t,objectName:r,label:n.label,mode:n.mode??"create",color:n.color,icon:n.icon};return this.data.slots.push(o),this}step(t,r){if(this.data.steps.some(n=>n.id===t))throw new Error(`[FormBuilder] Duplicate step id: "${t}"`);return new Mr(this,t,r)}build(){return this.validateRequiredData(),this.validateSlotReferences(),this.validateFreeFields(),this.validatePrefillExpressions(),this.data}_finalizeStep(t){return this.data.steps.push(t),this}validateName(t){let r=Xt.z.string().min(1,"Form name cannot be empty").max(63,"Form name is too long (max 63 characters)").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Invalid form name format. Name must be in kebab-case: 'client-onboarding', 'contact-creation'"});try{r.parse(t);}catch(n){throw n instanceof Xt.z.ZodError?new Error(`[FormBuilder] ${n.issues[0].message}`):n}}validateRequiredData(){if(this.data.slots.length===0)throw new Error("[FormBuilder] At least one slot is required. Use .slot() to add slots.");if(this.data.steps.length===0)throw new Error("[FormBuilder] At least one step is required. Use .step() to add steps.")}validateSlotReferences(){let t=new Map(this.data.slots.map(r=>[r.id,r.objectName]));for(let r of this.data.steps)for(let n of r.rows)if(Ke(n))for(let o of n.fields){if(o.type!=="slot")continue;let a=Wi(o);for(let l of a)if(!t.has(l))throw new Error(`[FormBuilder] Step "${r.id}" references unknown slot "${l}". Declare it with .slot("${l}", ...) first.`);let s=new Set(a.map(l=>t.get(l)));if(s.size>1)throw new Error(`[FormBuilder] Step "${r.id}" field on attribute "${o.attribute}" targets slots of different objects (${[...s].join(", ")}). A multi-slot field must target slots of the same object.`)}}validatePrefillExpressions(){let t=[...Je,"join"];for(let r of this.data.steps)for(let n of r.rows)if(Ke(n))for(let o of n.fields){if(!Wt(o)||!o.prefillExpression)continue;let a=o.prefillExpression,s=`prefillExpression on free field "${o.attribute.name}" in step "${r.id}"`;if(!Xe(a))throw new Error(`[FormBuilder] ${s} must contain at least one {{ attribute }} interpolation.`);if(/\{\{\s*\}\}/.test(a))throw new Error(`[FormBuilder] ${s} contains empty {{ }} interpolation.`);for(let l of a.matchAll(/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g)){let p=l[1];if(!t.includes(p))throw new Error(`[FormBuilder] ${s} uses invalid pipe "${p}". Valid pipes: ${t.join(", ")}`)}}}validateFreeFields(){let t=new Set(Gt);for(let r of this.data.steps)for(let n of r.rows)if(Ke(n)){for(let o of n.fields)if(Wt(o)){let a=o.attribute.type;if(t.has(a))throw new Error(`[FormBuilder] Free field in step "${r.id}" uses forbidden attribute type "${a}". Forbidden types: ${Gt.join(", ")}`)}}}};chunkDPD6ZWL2_js.a($r,"FormBuilder");var Lr=$r;function bA(e,t){return new Lr(e,t)}chunkDPD6ZWL2_js.a(bA,"form");function hu(e){return {text:"toString",richtext:"toString",number:"toNumber",currency:"toNumber",date:"toDate",checkbox:"toBoolean"}[e]}chunkDPD6ZWL2_js.a(hu,"resolveBuiltInTransform");var qr=class qr{constructor(t){this.operations=[];this.touchedAttributes=new Set;this.version=t;}assertNotTouched(t,r){if(this.touchedAttributes.has(t))throw new Error(`[MigrationBuilder] Conflicting operations on attribute "${t}": it was already modified earlier in this migration (attempted: ${r}).`)}renameAttribute(t,r){return this.assertNotTouched(t,"rename_attribute"),this.touchedAttributes.add(t),this.operations.push({type:"rename_attribute",from:t,to:r}),this}changeType(t,r,n,o){this.assertNotTouched(t,"change_type"),this.touchedAttributes.add(t);let a=o?.transform?hu(n):void 0;return this.operations.push({type:"change_type",name:t,from:r,to:n,transform:a}),this}removeAttribute(t){return this.assertNotTouched(t,"remove_attribute"),this.touchedAttributes.add(t),this.operations.push({type:"remove_attribute",name:t,backup_config:{}}),this}addAttribute(t){return this.assertNotTouched(t.name,"add_attribute"),this.touchedAttributes.add(t.name),this.operations.push({type:"add_attribute",attribute:t}),this}updateConfig(t,r){return this.assertNotTouched(t,"update_config"),this.touchedAttributes.add(t),this.operations.push({type:"update_config",name:t,from:{},to:r}),this}build(){return {version:this.version,operations:[...this.operations]}}};chunkDPD6ZWL2_js.a(qr,"MigrationBuilder");var it=qr;function Au(e){let{name:t,labelExpression:r,embeddingExpression:n}=e;if(!r)throw new chunk72TQRSNX_js.b(`Object "${t}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,chunk72TQRSNX_js.a.VALIDATION_FAILED);let o=be.safeParse(r);if(!o.success){let a=o.error.issues[0]?.message??"Invalid labelExpression";throw new chunk72TQRSNX_js.b(`Invalid labelExpression for "${t}": ${a}`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}if(n!==void 0){let a=be.safeParse(n);if(!a.success){let s=a.error.issues[0]?.message??"Invalid embeddingExpression";throw new chunk72TQRSNX_js.b(`Invalid embeddingExpression for "${t}": ${s}`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}}}chunkDPD6ZWL2_js.a(Au,"validateObjectExpressions");var Gr=class Gr{constructor(t){this._migrations=[];this._sealed=false;this._toleratedAttributes=[];this.validateName(t.name),this.obj={name:t.name,label:t.label,attributes:[],system:true},t.id&&(this.obj.id=t.id);}get"~standard"(){let t=chunk5QAE5NPN_js.e(this.build());return tt(t)}description(t){return this.obj.description=t,this}pluralLabel(t){return this._pluralLabel=t,this}icon(t){return this.obj.icon=t,this}runtime(){return this.obj.system=false,this}sealed(){return this._sealed=true,this}tolerate(t){return this._toleratedAttributes=[...this._toleratedAttributes,...t],this}attribute(t){return this.pushAttributes([t]),this}attributes(t){return this.pushAttributes(t),this}pushAttributes(t){let r=t.map(n=>"build"in n&&typeof n.build=="function"?n.build():n);ue([...this.obj.attributes,...r],n=>n.name,n=>new chunk72TQRSNX_js.r("attribute",n,`Object "${this.obj.name}": duplicate attribute name "${n}"`)),this.obj.attributes.push(...r);}metadata(t){return this.obj.metadata={...this.obj.metadata,...t},this}order(t){return this.obj.metadata={...this.obj.metadata,order:t},this}hidden(){return this.obj.metadata={...this.obj.metadata,hidden:true},this}labelExpression(t){return this._labelExpression=t,this}embeddingExpression(t){return this._embeddingExpression=t,this}documentLayout(t){if(t.presets)for(let r of t.presets)To(r.id,r.structure,1);return this.obj.documentLayout=t,this}migration(t,r){if(t<2)throw new Error(`[ObjectBuilder] Migration version must be >= 2 (version 1 is implicit). Got: ${t}`);if(this._migrations.some(a=>a.version===t))throw new Error(`[ObjectBuilder] Duplicate migration version: ${t}`);let o=new it(t);return r(o),this._migrations.push(o.build()),this}build(){if(!this.obj.name)throw new Error("[ObjectBuilder] Missing required field: name");if(!this.obj.label)throw new Error("[ObjectBuilder] Missing required field: label");Au({name:this.obj.name,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression});let t=[...this._migrations].sort((n,o)=>n.version-o.version);for(let n=0;n<t.length;n++){let o=n+2;if(t[n].version!==o)throw new Error(`[ObjectBuilder] Migration versions must be sequential starting at 2. Expected version ${o}, got ${t[n].version}.`)}let r=t.length>0?t[t.length-1].version:1;return {...this.obj,pluralLabel:this._pluralLabel,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression,schema_version:r,migrations:t,sealed:this._sealed,toleratedAttributes:this._toleratedAttributes}}validateName(t){t!==void 0&&De(t);}};chunkDPD6ZWL2_js.a(Gr,"ObjectBuilder");var zr=Gr;function z(e){return new zr(e)}chunkDPD6ZWL2_js.a(z,"object");function To(e,t,r){let n=chunkDPD6ZWL2_js.a((a,s)=>{throw new chunk72TQRSNX_js.h(a,[{path:["documentLayout","presets",e],message:s}])},"fail");r>5&&n(`Preset structure exceeds max depth of ${5}`,"Preset structure too deep");let o=new Set;for(let a of t){let s=a.title.trim();s.length===0&&n("Folder preset node title is required","Empty folder title"),s.includes("/")&&n("Folder preset node title cannot contain /",`Folder title contains /: "${s}"`),o.has(s)&&n("Folder preset sibling titles must be unique",`Duplicate folder title: "${s}"`),o.add(s),a.children&&a.children.length>0&&To(e,a.children,r+1);}}chunkDPD6ZWL2_js.a(To,"validatePresetStructure");var tn=class tn{constructor(t,r){this.data={type:"fields",fields:[]};this.data.id=t,this.data.label=r;}description(t){return this.data.description=t,this}collapsible(t=false){return this.data.collapsible=true,this.data.collapsed=t,this}order(t){return this.data.order=t,this}fields(...t){for(let r of t)this.data.fields?.push({attribute:r});return this}field(t,r){return this.data.fields?.push({attribute:t,...r}),this}attributeGroup(t,r){return this.data.fields?.push({attributeGroup:t,...r}),this}build(){if(!this.data.id)throw new Error("[GroupBuilder] id is required");if(!this.data.label)throw new Error("[GroupBuilder] label is required");if(!this.data.fields||this.data.fields.length===0)throw new Error("[GroupBuilder] At least one field is required");return this.data}};chunkDPD6ZWL2_js.a(tn,"GroupBuilder");var at=tn,rn=class rn{constructor(t,r){this.view=t,this.tabData=r;}columns(...t){return this.tabData.columns=t,this}create(t){return this.tabData.allowCreate=true,t?.mode&&(this.tabData.createMode=t.mode),this}createMode(t){return this.tabData.createMode=t,this}edit(){return this.tabData.allowEdit=true,this}delete(){return this.tabData.allowDelete=true,this}crud(){return this.tabData.allowCreate=true,this.tabData.allowEdit=true,this.tabData.allowDelete=true,this}filters(t){return this.tabData.filters=t,this}sorts(t){return this.tabData.sorts=t,this}sort(t,r="asc"){return this.tabData.sorts||(this.tabData.sorts=[]),this.tabData.sorts.push({attribute:t,direction:r}),this}tab(t,r){return this.finalize(),new J(this.view,t,r)}done(){return this.finalize(),this.view}build(){return this.finalize(),this.view.build()}finalize(){if(!this.tabData.columns||this.tabData.columns.length===0)throw new Error(`[TableTabConfig] columns() is required for tab "${this.tabData.name}"`);this.view._addTab(this.tabData);}};chunkDPD6ZWL2_js.a(rn,"TableTabConfig");var st=rn,nn=class nn{constructor(t,r,n){this.view=t,this.tabData={...r,type:"custom",component:n};}props(t){return this.tabData.props=t,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(nn,"CustomTabConfig");var Wr=nn,on=class on{constructor(t,r,n){this.view=t,this.tabData={...r,type:"richtext",attribute:n};}titleAttribute(t){return this.tabData.titleAttribute=t,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(on,"RichtextTabConfig");var Kr=on,an=class an{constructor(t,r){this.view=t,this.tabData={...r,type:"activity"};}limit(t){return this.tabData.limit=t,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(an,"ActivityTabConfig");var Yr=an,sn=class sn{constructor(t,r,n){this.view=t,this.tabData={...r,type:n,emailAttributeIds:[]};}emailAttributes(...t){return this.tabData.emailAttributeIds=t,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(sn,"AddressMatchedTabConfig");var ut=sn,un=class un extends ut{constructor(t,r){super(t,r,"emails");}};chunkDPD6ZWL2_js.a(un,"EmailsTabConfig");var Hr=un,ln=class ln extends ut{constructor(t,r){super(t,r,"meetings");}};chunkDPD6ZWL2_js.a(ln,"MeetingsTabConfig");var Qr=ln,dn=class dn{constructor(t,r){this.view=t,this.tabData={...r,type:"documents",allowUpload:true,allowRemove:true,hideAttachments:false};}disableUpload(){return this.tabData.allowUpload=false,this}disableRemove(){return this.tabData.allowRemove=false,this}hideAttachments(){return this.tabData.hideAttachments=true,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(dn,"DocumentsTabConfig");var Jr=dn,cn=class cn{constructor(t,r,n){this.view=t,this.base={id:r,name:r,label:n};}icon(t){return this.base.icon=t,this}order(t){return this.base.order=t,this}form(...t){if(t.length===0)throw new Error(`[TabBuilder] form() requires at least one group for tab "${this.base.name}"`);let r={...this.base,type:"form",groups:t.map(n=>n instanceof at?n.build():n)};return this.view._addTab(r)}table(t){return new st(this.view,{...this.base,type:"table",source:{type:"relation",attribute:t},columns:[]})}tableFrom(t,r){return new st(this.view,{...this.base,type:"table",source:{type:"inverse",object:t,attribute:r},columns:[]})}custom(t){return new Wr(this.view,this.base,t)}richtext(t){return new Kr(this.view,this.base,t)}activity(){return new Yr(this.view,this.base)}documents(){return new Jr(this.view,this.base)}emails(){return new Hr(this.view,this.base)}meetings(){return new Qr(this.view,this.base)}forms(t){let r={...this.base,type:"forms",...t};return this.view._addTab(r)}};chunkDPD6ZWL2_js.a(cn,"TabBuilder");var J=cn,pn=class pn{constructor(t,r){et(t),this.data={name:t,label:r,tabs:[]};}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}for(t){return this.data.object=t,this}default(){return this.data.default=true,this}metadata(t){return this.data.metadata=t,this}sidePanel(t){return this.data.sidePanel=t,this}readOnly(){return this.data.readOnly=true,this}tab(t,r){return new J(this,t,r)}addTab(t){return this.data.tabs.push(t),this}_addTab(t){return this.data.tabs.push(t),this}build(){if(!this.data.object)throw new Error("[DetailViewBuilder] for() is required - specify the target object");if(this.data.tabs.length===0)throw new Error("[DetailViewBuilder] At least one tab is required");ue(this.data.tabs,r=>r.name,r=>new Error(`[DetailViewBuilder] Duplicate tab name "${r}"`));let t={tabs:this.data.tabs,sidePanel:this.data.sidePanel,...this.data.readOnly?{readOnly:true}:{}};return {name:this.data.name,label:this.data.label,description:this.data.description,icon:this.data.icon,object:this.data.object,type:"detail",config:t,default:this.data.default,metadata:this.data.metadata}}};chunkDPD6ZWL2_js.a(pn,"DetailViewBuilder");var Xr=pn;function G(e,t){return new Xr(e,t)}chunkDPD6ZWL2_js.a(G,"detailView");function ot(e){if(Array.isArray(e))return e.map(ot).find(r=>r!==void 0);if(e===null||typeof e!="object")return;let t=e;return t.attribute==="visibility"||t.attribute==="ownedBy"?t.attribute:ot(t.rules)??ot(t.groups)}chunkDPD6ZWL2_js.a(ot,"findProtectedTabFilterAttribute");var mn=class mn{constructor(t,r){et(t),this.data={name:t,label:r,tabs:[]};}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}for(t){return this.data.object=t,this}default(){return this.data.default=true,this}metadata(t){return this.data.metadata=t,this}baseFilter(t){return this.data.defaultFilters=t,this}allowPresentationCustomization(){return this.data.allowPresentationCustomization=true,this}tab(t,r){return new en(this,t,r)}_addTab(t){return this.data.tabs.push(t),this}build(){if(!this.data.object)throw new Error("[ListViewBuilder] for() is required - specify the target object");if(this.data.tabs.length===0)throw new Error("[ListViewBuilder] At least one tab is required");if(ue(this.data.tabs,n=>n.id,n=>new Error(`[ListViewBuilder] Duplicate tab id "${n}"`)),this.data.tabs.filter(n=>n.default).length>1)throw new Error("[ListViewBuilder] Only one tab can be marked as default");for(let n of this.data.tabs){if(n.layout==="table"&&n.columns.length===0)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" must have at least one column`,[]);if(n.layout==="kanban"&&!n.groupByAttribute)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Kanban tab "${n.id}" requires a groupByAttribute`,[]);if(n.descriptionAttribute!==void 0&&n.descriptionAttribute.length===0)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" requires a nonempty description attribute name`,[]);if(n.displayAttributes!==void 0){let o=chunkVJYVPQ5E_js.Y.safeParse(n.displayAttributes);if(!o.success)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" has invalid display attributes`,o.error.issues.map(a=>({path:["tabs",n.id,"displayAttributes",...a.path.map(String)],message:a.message})))}}let r={allowPresentationCustomization:this.data.allowPresentationCustomization,defaultFilters:this.data.defaultFilters?{id:chunkLQYUPOWB_js.d(),combinator:this.data.defaultFilters.combinator,rules:this.data.defaultFilters.rules}:void 0,tabs:this.data.tabs.map(n=>{let o={id:n.id,label:n.label,icon:n.icon,default:n.default,visibility:n.visibility,columns:n.columns,descriptionAttribute:n.descriptionAttribute,displayAttributes:n.displayAttributes,filters:n.filters?{id:chunkLQYUPOWB_js.d(),combinator:n.filters.combinator,rules:n.filters.rules}:void 0,sorts:n.sorts,readOnly:n.readOnly,createMode:n.createMode};return n.layout==="kanban"?{...o,layout:"kanban",groupByAttribute:n.groupByAttribute,cardUserAttribute:n.cardUserAttribute,cardDateAttribute:n.cardDateAttribute,kanbanColumnOrder:n.kanbanColumnOrder,kanbanColumnVisibility:n.kanbanColumnVisibility,kanbanPinnedColumns:n.kanbanPinnedColumns}:{...o,layout:n.layout,columnSizing:n.columnSizing}})};return {name:this.data.name,label:this.data.label,description:this.data.description,icon:this.data.icon,object:this.data.object,type:"list",config:r,default:this.data.default,metadata:this.data.metadata}}};chunkDPD6ZWL2_js.a(mn,"ListViewBuilder");var Zr=mn,lt=class lt{constructor(t,r,n){this.view=t,this.tabData={id:r,label:n,visibility:"all",layout:"table",columns:[]};}icon(t){return this.tabData.icon=t,this}default(){return this.tabData.default=true,this}readOnly(){return this.tabData.readOnly=true,this}visibility(t){return this.tabData.visibility=t,this}table(){return this.tabData.layout="table",this}list(){return this.tabData.layout="list",this}descriptionAttribute(t){return this.tabData.descriptionAttribute=t,this}displayAttributes(...t){return this.tabData.displayAttributes=t,this}kanban(t){return this.tabData.layout="kanban",this.tabData.groupByAttribute=t,this}cardUserAttribute(t){return this.tabData.cardUserAttribute=t,this}cardDateAttribute(t){return this.tabData.cardDateAttribute=t,this}kanbanColumnOrder(t){return this.tabData.kanbanColumnOrder=t,this}kanbanColumnVisibility(t){return this.tabData.kanbanColumnVisibility=t,this}kanbanPinnedColumns(t){return this.tabData.kanbanPinnedColumns=t,this}createMode(t){return this.tabData.createMode=t,this}columns(...t){return this.tabData.columns=t,this}columnWidth(t,r){return this.tabData.columnSizing||(this.tabData.columnSizing={}),this.tabData.columnSizing[t]=r,this}filter(t){let r=ot(t);if(r){let n=`Tab filters cannot target "${r}". Use .visibility("private")`;throw new chunk72TQRSNX_js.h(n,[{path:["filters"],message:n}])}return this.tabData.filters=t,this}sort(t,r="asc"){return this.tabData.sorts||(this.tabData.sorts=[]),this.tabData.sorts.push({attribute:t,direction:r}),this}sorts(t){return this.tabData.sorts=t,this}tab(t,r){return this.view._addTab(this.tabData),new lt(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(lt,"ListViewTabConfigBuilder");var en=lt;function W(e,t){return new Zr(e,t)}chunkDPD6ZWL2_js.a(W,"listView");function kA(e,t){return new at(e,t)}chunkDPD6ZWL2_js.a(kA,"group");function Tu(e){if(!/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z]$/.test(e))throw new Error(`Invalid flag name "${e}". Flag names must be kebab-case (e.g., "architect-mode", "ai-features").`)}chunkDPD6ZWL2_js.a(Tu,"validateFlagName");var hn=class hn{constructor(t,r,n){Tu(t),this.flag={name:t,valueType:r,defaultValue:n,allowedLevels:["global","tenant","user"]};}label(t){return this.flag.label=t,this}description(t){return this.flag.description=t,this}category(t){return this.flag.category=t,this}system(){return this.flag.system=true,this}tenantScoped(){return this.flag.allowedLevels=["global","tenant"],this}globalOnly(){return this.flag.allowedLevels=["global"],this}allowedLevels(t){return this.flag.allowedLevels=[...t],this}build(){if(!this.flag.label?.trim())throw new Error(`Flag "${this.flag.name}" must have a label. Use .label("Human-readable label").`);return {...this.flag,allowedLevels:[...this.flag.allowedLevels||[]]}}};chunkDPD6ZWL2_js.a(hn,"BaseFlagBuilder");var Te=hn,An=class An extends Te{constructor(t){super(t,"boolean",false);}defaultValue(t){return this.flag.defaultValue=t,this}enabledByDefault(){return this.flag.defaultValue=true,this}};chunkDPD6ZWL2_js.a(An,"BooleanFlagBuilder");var fn=An,Tn=class Tn extends Te{constructor(t){super(t,"string","");}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(Tn,"StringFlagBuilder");var bn=Tn,wn=class wn extends Te{constructor(t){super(t,"number",0);}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(wn,"NumberFlagBuilder");var gn=wn,xn=class xn extends Te{constructor(t,r){super(t,"json",r);}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(xn,"JsonFlagBuilder");var yn=xn;function wu(e){return new fn(e)}chunkDPD6ZWL2_js.a(wu,"booleanFlag");function xu(e){return new bn(e)}chunkDPD6ZWL2_js.a(xu,"stringFlag");function Iu(e){return new gn(e)}chunkDPD6ZWL2_js.a(Iu,"numberFlag");function Su(e,t){return new yn(e,t)}chunkDPD6ZWL2_js.a(Su,"jsonFlag");function In(e){return new chunk72TQRSNX_js.r("feature flag",e,`Flag "${e}" is already registered. Each flag name must be unique.`)}chunkDPD6ZWL2_js.a(In,"duplicateFlagError");function Sn(e){return {...e,allowedLevels:[...e.allowedLevels]}}chunkDPD6ZWL2_js.a(Sn,"cloneFlagDefinition");var vn=class vn{constructor(){this.flags=new Map;}register(t){if(this.flags.has(t.name))throw In(t.name);this.flags.set(t.name,Sn(t));}registerAll(t){let r=new Set;for(let n of t){if(this.flags.has(n.name)||r.has(n.name))throw In(n.name);r.add(n.name);}for(let n of t)this.register(n);}get(t){let r=this.flags.get(t);return r?Sn(r):void 0}getOrThrow(t){let r=this.get(t);if(!r)throw new chunk72TQRSNX_js.c("Feature flag",t,void 0,`Flag "${t}" is not registered. Available flags: ${this.listNames().join(", ")}`);return r}has(t){return this.flags.has(t)}list(){return Array.from(this.flags.values(),Sn)}listNames(){return Array.from(this.flags.keys())}unregister(t){return this.flags.delete(t)}clear(){this.flags.clear();}get size(){return this.flags.size}};chunkDPD6ZWL2_js.a(vn,"FlagRegistry");var Ne=vn,vu=new Ne;function Ru(){return new Ne}chunkDPD6ZWL2_js.a(Ru,"createFlagRegistry");function dt(){return {global:new Map,tenant:new Map,user:new Map}}chunkDPD6ZWL2_js.a(dt,"emptyOverrides");function Eu(e,t){return e.expiresAt===void 0||e.expiresAt.getTime()>t}chunkDPD6ZWL2_js.a(Eu,"isActiveOverride");function Rn(e,t){let r=new Map;for(let n of e){if(!Eu(n,t))continue;let o=n.flagName;r.has(o)||r.set(o,n);}return r}chunkDPD6ZWL2_js.a(Rn,"indexOverrides");var En=class En{constructor(t){this.repository=t.repository,this.registry=t.registry,this.staticDefaults=new Map(t.staticDefaults?.map(r=>[r.name,r.value])??[]);}async resolveAll(t={}){let r=this.collectFlagNames(),n=this.repository&&r.size>0?await this.getAllOverrides(t,[...r]):dt();return this.resolveNames(r,n,t)}resolveAllStatic(){return this.resolveNames(this.collectFlagNames(),dt(),{})}collectFlagNames(){let t=new Set;for(let r of this.registry.listNames())t.add(r);for(let r of this.staticDefaults.keys())t.add(r);return t}resolveNames(t,r,n){let o=new Map;for(let a of t)o.set(a,this.resolveValue(a,r,n));return o}async resolve(t,r={}){let n=this.repository?await this.getAllOverrides(r,[t]):dt();return this.resolveWithSource(t,n,r)}async isEnabled(t,r={}){return (await this.resolve(t,r)).value===true}async getValue(t,r={}){return (await this.resolve(t,r)).value}async setOverride(t,r,n,o={}){if(!this.repository)throw new chunk72TQRSNX_js.b("Cannot set override: no FeatureFlagsRepository configured. Add featureFlags to your DatabaseAdapter to enable runtime overrides.",chunk72TQRSNX_js.a.CONFIGURATION_REQUIRED);let a=this.registry.get(t);if(a&&!a.allowedLevels.includes(r)){let s=`Flag "${t}" does not allow ${r}-level overrides. Allowed levels: ${a.allowedLevels.join(", ")}`;throw new chunk72TQRSNX_js.h(s,[{path:["level"],message:s}])}if(a?.system){let s=`Flag "${t}" is a system flag and cannot be overridden via API.`;throw new chunk72TQRSNX_js.h(s,[{path:["flagName"],message:s}])}await this.repository.setOverride({flagName:t,level:r,value:n,targetId:o.targetId,expiresAt:o.expiresAt,createdBy:o.createdBy});}async deleteOverride(t,r,n){if(!this.repository)throw new chunk72TQRSNX_js.b("Cannot delete override: no FeatureFlagsRepository configured.",chunk72TQRSNX_js.a.CONFIGURATION_REQUIRED);await this.repository.deleteOverride(t,r,n);}async getAllOverrides(t,r){if(!this.repository)return dt();let[n,o,a]=await Promise.all([this.repository.getOverrides({level:"global",flagNames:r}),t.tenantId?this.repository.getOverrides({level:"tenant",targetId:t.tenantId,flagNames:r}):Promise.resolve([]),t.userId?this.repository.getOverrides({level:"user",targetId:t.userId,flagNames:r}):Promise.resolve([])]),s=Date.now();return {global:Rn(n,s),tenant:Rn(o,s),user:Rn(a,s)}}resolveValue(t,r,n){return this.resolveWithSource(t,r,n).value}resolveWithSource(t,r,n){let o=this.registry.get(t),a=o?.allowedLevels??["global","tenant","user"];if(n.userId&&a.includes("user")){let s=r.user.get(t);if(s)return {name:t,value:s.value,source:"user",sourceId:n.userId}}if(n.tenantId&&a.includes("tenant")){let s=r.tenant.get(t);if(s)return {name:t,value:s.value,source:"tenant",sourceId:n.tenantId}}if(a.includes("global")){let s=r.global.get(t);if(s)return {name:t,value:s.value,source:"global"}}return this.staticDefaults.has(t)?{name:t,value:this.staticDefaults.get(t),source:"default"}:{name:t,value:o?.defaultValue??void 0,source:"default"}}};chunkDPD6ZWL2_js.a(En,"FlagService");var ct=En;function Du(e){return new ct(e)}chunkDPD6ZWL2_js.a(Du,"createFlagService");function Dn(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(Dn,"cloneObjectDefinition");var Nn=class Nn{constructor(){this.objects=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r){let o="build"in n&&typeof n.build=="function"?n.build():n;this.validateAndRegister(o);}return this}validateAndRegister(t){if(!t.system){let r=`[NativeObjectRegistry] Cannot register object "${t.name}" (id: ${t.id}): missing system flag.
14
14
  Native objects must have system=true. Did you call .runtime() on the builder? Remove that call \u2014 objects are system:true by default.`;throw new chunk72TQRSNX_js.h(r,[])}if(this.objects.has(t.name)){let r=this.objects.get(t.name),n=`[NativeObjectRegistry] Duplicate object name "${t.name}":
15
15
  - Existing: "${r?.label}" (id: ${r?.id})
16
16
  - New: "${t.label}" (id: ${t.id})
17
- Please use unique names for each native object.`;throw new chunk72TQRSNX_js.r("object",t.name,n)}this.objects.set(t.name,En(t));}getByName(t){let r=this.objects.get(t);return r?En(r):void 0}getByNameOrThrow(t){let r=this.getByName(t);if(!r){let n=`[NativeObjectRegistry] Native object "${t}" not found.
18
- Available objects: ${this.listNames().join(", ")}`;throw new chunk72TQRSNX_js.c("Native object",t,chunk72TQRSNX_js.a.OBJECT_NOT_FOUND,n)}return r}getAll(){return Array.from(this.objects.values(),En)}listNames(){return Array.from(this.objects.keys())}has(t){return this.objects.has(t)}get size(){return this.objects.size}clear(){this.objects.clear();}summary(){let t=this.getAll();return [`[NativeObjectRegistry] ${this.size} native object(s) registered:`,...t.map(r=>` - ${r.name}: "${r.label}" (${r.attributes.length} attributes)`)].join(`
19
- `)}debug(t){let r=this.summary();return t?.(r),r}};chunkDPD6ZWL2_js.a(Cn,"NativeObjectRegistryClass");var Dn=Cn,XA=new Dn;function P(e){return {...e,system:true}}chunkDPD6ZWL2_js.a(P,"markSystemView");var wo=`## Overview
17
+ Please use unique names for each native object.`;throw new chunk72TQRSNX_js.r("object",t.name,n)}this.objects.set(t.name,Dn(t));}getByName(t){let r=this.objects.get(t);return r?Dn(r):void 0}getByNameOrThrow(t){let r=this.getByName(t);if(!r){let n=`[NativeObjectRegistry] Native object "${t}" not found.
18
+ Available objects: ${this.listNames().join(", ")}`;throw new chunk72TQRSNX_js.c("Native object",t,chunk72TQRSNX_js.a.OBJECT_NOT_FOUND,n)}return r}getAll(){return Array.from(this.objects.values(),Dn)}listNames(){return Array.from(this.objects.keys())}has(t){return this.objects.has(t)}get size(){return this.objects.size}clear(){this.objects.clear();}summary(){let t=this.getAll();return [`[NativeObjectRegistry] ${this.size} native object(s) registered:`,...t.map(r=>` - ${r.name}: "${r.label}" (${r.attributes.length} attributes)`)].join(`
19
+ `)}debug(t){let r=this.summary();return t?.(r),r}};chunkDPD6ZWL2_js.a(Nn,"NativeObjectRegistryClass");var Cn=Nn,tT=new Cn;function O(e){return {...e,system:true}}chunkDPD6ZWL2_js.a(O,"markSystemView");var wo=`## Overview
20
20
 
21
21
  Describe in one or two sentences what this skill does and the outcome it produces. The agent reads this page when it uses the skill \u2014 write instructions for the agent, not documentation for people.
22
22
 
@@ -47,14 +47,14 @@ Show at least one concrete example of the skill applied well.
47
47
 
48
48
  - Never \u2026
49
49
  - Do not \u2026
50
- `,ku=z({name:"skill",label:"Skill"}).sealed().icon("book-open").order(Number.MAX_SAFE_INTEGER).pluralLabel("Skills").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
50
+ `,Ou=z({name:"skill",label:"Skill"}).sealed().icon("book-open").order(Number.MAX_SAFE_INTEGER).pluralLabel("Skills").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
51
51
  {{ description }}
52
- {{ content }}`).attribute(f({name:"name",label:"Name"}).maxLength(constants.SKILL_NAME_MAX_LENGTH).required()).attribute(f({name:"description",label:"Description"}).multiline().maxLength(constants.SKILL_DESCRIPTION_MAX_LENGTH).required().placeholder('What this skill does and when to use it \u2014 e.g. "Drafts replies to customer complaints. Use when asked to answer an unhappy customer."')).attribute(he({name:"content",label:"Content"}).defaultValue(wo)).build(),Ou=P(ee("skill-detail","Skill").for("skill").default().sidePanel({attributes:["name","description"]}).tab("content","Content").richtext("content").titleAttribute("name").done().tab("files","Files").documents().done().tab("activity","Activity").activity().done().build()),_u=P(G("skill-list","Skills").for("skill").default().allowPresentationCustomization().tab("workspace","Skills").default().icon("list").visibility("workspace").list().columns("name","description").descriptionAttribute("description").displayAttributes("createdBy","updatedAt").sort("name","asc").tab("mine","My skills").icon("lock").visibility("private").list().columns("name","description").descriptionAttribute("description").displayAttributes("createdBy","updatedAt").sort("name","asc").build());var Vu=z({name:"memory",label:"Memory"}).sealed().icon("database").order(Number.MAX_SAFE_INTEGER).pluralLabel("Memories").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
52
+ {{ content }}`).attribute(f({name:"name",label:"Name"}).maxLength(constants.SKILL_NAME_MAX_LENGTH).required()).attribute(f({name:"description",label:"Description"}).multiline().maxLength(constants.SKILL_DESCRIPTION_MAX_LENGTH).required().placeholder('What this skill does and when to use it \u2014 e.g. "Drafts replies to customer complaints. Use when asked to answer an unhappy customer."')).attribute(he({name:"content",label:"Content"}).defaultValue(wo)).build(),ku=O(G("skill-detail","Skill").for("skill").default().sidePanel({attributes:["name","description"]}).tab("content","Content").richtext("content").titleAttribute("name").done().tab("files","Files").documents().done().tab("activity","Activity").activity().done().build()),_u=O(W("skill-list","Skills").for("skill").default().allowPresentationCustomization().tab("workspace","Skills").default().icon("list").visibility("workspace").list().columns("name","description").descriptionAttribute("description").displayAttributes("createdBy","updatedAt").sort("name","asc").tab("mine","My skills").icon("lock").visibility("private").list().columns("name","description").descriptionAttribute("description").displayAttributes("createdBy","updatedAt").sort("name","asc").build());var Vu=z({name:"memory",label:"Memory"}).sealed().icon("database").order(Number.MAX_SAFE_INTEGER).pluralLabel("Memories").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
53
53
  {{ description }}
54
- {{ content }}`).migration(2,e=>e.changeType("content","text","richtext")).attribute(f({name:"name",label:"Name"}).maxLength(constants.MEMORY_NAME_MAX_LENGTH).required()).attribute(f({name:"description",label:"Description"}).multiline().maxLength(constants.MEMORY_DESCRIPTION_MAX_LENGTH).required()).attribute(he({name:"content",label:"Content"})).attribute(q({name:"kind",label:"Kind"}).options([{value:"fact",label:"Fact"},{value:"preference",label:"Preference"},{value:"feedback",label:"Feedback"},{value:"reference",label:"Reference"}])).attribute(Ae({name:"subjects",label:"Subjects"}).toAny().many()).attribute(Ae({name:"links",label:"Links"}).to("memory").many()).attribute(q({name:"source",label:"Source"}).options([{value:"explicit",label:"Saved by an agent"},{value:"extracted",label:"Extracted from a session"},{value:"corroborated",label:"Corroborated across users"},{value:"curated",label:"Curated by Dreamer"}])).attribute(U({name:"validFrom",label:"Valid from"}).includeTime()).attribute(U({name:"invalidAt",label:"Invalid at"}).includeTime()).attribute(Ae({name:"supersededBy",label:"Superseded by"}).to("memory")).attribute(f({name:"provenance",label:"Provenance"}).multiline()).attribute(q({name:"reviewState",label:"Review state"}).options([{value:"needs_review",label:"Needs review"},{value:"skill_candidate",label:"Skill candidate"}])).attribute(f({name:"reviewReason",label:"Review reason"}).multiline()).attribute(U({name:"curatedAt",label:"Curated at"}).includeTime()).attribute(U({name:"reviewAfter",label:"Review after"}).includeTime()).attribute(f({name:"curationFingerprint",label:"Curation fingerprint"})).build(),xo={combinator:"and",rules:[{attribute:"invalidAt",operator:"is_empty",value:null},{attribute:"reviewState",operator:"is_empty",value:null}]},ju=P(ee("memory-detail","Memory").for("memory").default().sidePanel({attributes:["description","kind","source","provenance","reviewState","reviewReason","validFrom","invalidAt","supersededBy","curatedAt","reviewAfter","subjects","links"]}).tab("content","Content").richtext("content").titleAttribute("name").build()),Mu=P(G("memory-list","Memories").for("memory").default().allowPresentationCustomization().tab("workspace","Memories").default().icon("list").visibility("workspace").list().columns("name","kind","description","createdAt").descriptionAttribute("description").displayAttributes("kind","subjects","createdAt").filter(xo).sort("name","asc").tab("mine","My memories").icon("lock").visibility("private").list().columns("name","kind","description","createdAt").descriptionAttribute("description").displayAttributes("kind","subjects","createdAt").filter(xo).sort("name","asc").tab("review","To review").icon("question-circle").table().columns("name","reviewState","reviewReason","updatedAt").filter({combinator:"and",rules:[{attribute:"invalidAt",operator:"is_empty",value:null},{attribute:"reviewState",operator:"is_not_empty",value:null}]}).sort("updatedAt","desc").tab("history","History").icon("archive").table().columns("name","kind","invalidAt","supersededBy").filter({combinator:"and",rules:[{attribute:"invalidAt",operator:"is_not_empty",value:null}]}).sort("invalidAt","desc").build());var ct="drives",Lu=z({name:ct,label:"Drive"}).sealed().icon("folder").hidden().pluralLabel("Drives").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
55
- {{ description }}`).attribute(f({name:"name",label:"Name"}).required()).attribute(f({name:"description",label:"Description"}).multiline()).build(),Bu=P(ee("drive-detail","Drive").for(ct).default().sidePanel({attributes:["description"]}).tab("documents","Documents").documents().build()),Uu=P(G("drive-list","Drives").for(ct).default().tab("workspace","Shared").default().icon("users").visibility("workspace").table().columns("name","description","updatedAt").sort("name","asc").tab("mine","My drives").icon("lock").visibility("private").table().columns("name","description","updatedAt").sort("name","asc").build());var Nn="artifact",$u=z({name:Nn,label:"Artifact"}).sealed().hidden().icon("package").pluralLabel("Artifacts").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
56
- {{ description }}`).attribute(f({name:"name",label:"Name"}).required()).attribute(f({name:"description",label:"Description"}).multiline()).attribute(q({name:"kind",label:"Kind"}).options([{value:"web",label:"Web",color:"blue"},{value:"presentation",label:"Presentation",color:"purple"},{value:"document",label:"Document",color:"sky"},{value:"spreadsheet",label:"Spreadsheet",color:"green"},{value:"image",label:"Image",color:"pink"},{value:"code",label:"Code",color:"slate"},{value:"other",label:"Other",color:"gray"}]).required()).attribute(q({name:"retention",label:"Retention"}).options([{value:"ephemeral",label:"Ephemeral",color:"gray"},{value:"conversation",label:"Conversation",color:"blue"},{value:"persistent",label:"Persistent",color:"green"}]).defaultValue("conversation").required()).attribute(rt({name:"currentRevision",label:"Current revision"}).integer().min(1)).attribute(U({name:"expiresAt",label:"Expires at"}).includeTime().hidden()).attribute(f({name:"sourceSessionId",label:"Source session"}).hidden()).attribute(f({name:"sourceMessageId",label:"Source message"}).hidden()).attribute(f({name:"initialToolCallId",label:"Initial tool call"}).hidden()).attribute(yo({name:"versions",label:"Versions"}).qualifyWith(rt({name:"revision",label:"Revision"}).integer().min(1).required(),f({name:"toolCallId",label:"Tool call"}).hidden(),f({name:"sourceFileId",label:"Source file"}).hidden(),f({name:"previewFileId",label:"Preview file"}).hidden(),f({name:"fileIds",label:"File manifest"}).hidden(),f({name:"entrypoint",label:"Entrypoint"}).hidden(),f({name:"sourceMessageId",label:"Source message"}).hidden(),f({name:"artifactName",label:"Artifact name"}).hidden(),f({name:"artifactDescription",label:"Artifact description"}).hidden(),f({name:"artifactKind",label:"Artifact kind"}).hidden(),f({name:"displayMode",label:"Display mode"}).hidden(),f({name:"displayInteraction",label:"Display interaction"}).hidden(),f({name:"displaySize",label:"Display size"}).hidden(),rt({name:"displayAspectRatio",label:"Display aspect ratio"}).hidden())).build(),qu=P(G("artifact-list","Artifacts").for(Nn).default().allowPresentationCustomization().tab("all","Artifacts").default().icon("list").list().columns("name","kind","currentRevision","updatedAt").descriptionAttribute("description").displayAttributes("kind","currentRevision","versions").sort("updatedAt","desc").build());var pt="meeting",T={title:"title",description:"description",location:"location",startsAt:"startsAt",endsAt:"endsAt",isAllDay:"isAllDay",status:"status",organizerAddress:"organizerAddress",organizerName:"organizerName",conferenceProvider:"conferenceProvider",conferenceJoinUrl:"conferenceJoinUrl",htmlLink:"htmlLink",participants:"participants",providerEventId:"providerEventId",icalUid:"icalUid",recurringEventId:"recurringEventId",connectionId:"connectionId",recordingOverride:"recordingOverride",endedAnnouncedAt:"endedAnnouncedAt",linkedRecords:"linkedRecords"},So="meeting-list",vo="calendar-sync",Ro="meeting-detail",Io=[T.title,T.startsAt,T.endsAt,T.status],zu=z({name:pt,label:"Meeting"}).sealed().hidden().metadata({platformOwned:{editable:[T.linkedRecords],source:vo}}).icon("calendar").pluralLabel("Meetings").labelExpression("{{ title }}").embeddingExpression(`{{ title }}
54
+ {{ content }}`).migration(2,e=>e.changeType("content","text","richtext")).attribute(f({name:"name",label:"Name"}).maxLength(constants.MEMORY_NAME_MAX_LENGTH).required()).attribute(f({name:"description",label:"Description"}).multiline().maxLength(constants.MEMORY_DESCRIPTION_MAX_LENGTH).required()).attribute(he({name:"content",label:"Content"})).attribute(q({name:"kind",label:"Kind"}).options([{value:"fact",label:"Fact"},{value:"preference",label:"Preference"},{value:"feedback",label:"Feedback"},{value:"reference",label:"Reference"}])).attribute(Ae({name:"subjects",label:"Subjects"}).toAny().many()).attribute(Ae({name:"links",label:"Links"}).to("memory").many()).attribute(q({name:"source",label:"Source"}).options([{value:"explicit",label:"Saved by an agent"},{value:"extracted",label:"Extracted from a session"},{value:"corroborated",label:"Corroborated across users"},{value:"curated",label:"Curated by Dreamer"}])).attribute(U({name:"validFrom",label:"Valid from"}).includeTime()).attribute(U({name:"invalidAt",label:"Invalid at"}).includeTime()).attribute(Ae({name:"supersededBy",label:"Superseded by"}).to("memory")).attribute(f({name:"provenance",label:"Provenance"}).multiline()).attribute(q({name:"reviewState",label:"Review state"}).options([{value:"needs_review",label:"Needs review"},{value:"skill_candidate",label:"Skill candidate"}])).attribute(f({name:"reviewReason",label:"Review reason"}).multiline()).attribute(U({name:"curatedAt",label:"Curated at"}).includeTime()).attribute(U({name:"reviewAfter",label:"Review after"}).includeTime()).attribute(f({name:"curationFingerprint",label:"Curation fingerprint"})).build(),xo={combinator:"and",rules:[{attribute:"invalidAt",operator:"is_empty",value:null},{attribute:"reviewState",operator:"is_empty",value:null}]},ju=O(G("memory-detail","Memory").for("memory").default().sidePanel({attributes:["description","kind","source","provenance","reviewState","reviewReason","validFrom","invalidAt","supersededBy","curatedAt","reviewAfter","subjects","links"]}).tab("content","Content").richtext("content").titleAttribute("name").build()),Mu=O(W("memory-list","Memories").for("memory").default().allowPresentationCustomization().tab("workspace","Memories").default().icon("list").visibility("workspace").list().columns("name","kind","description","createdAt").descriptionAttribute("description").displayAttributes("kind","subjects","createdAt").filter(xo).sort("name","asc").tab("mine","My memories").icon("lock").visibility("private").list().columns("name","kind","description","createdAt").descriptionAttribute("description").displayAttributes("kind","subjects","createdAt").filter(xo).sort("name","asc").tab("review","To review").icon("question-circle").table().columns("name","reviewState","reviewReason","updatedAt").filter({combinator:"and",rules:[{attribute:"invalidAt",operator:"is_empty",value:null},{attribute:"reviewState",operator:"is_not_empty",value:null}]}).sort("updatedAt","desc").tab("history","History").icon("archive").table().columns("name","kind","invalidAt","supersededBy").filter({combinator:"and",rules:[{attribute:"invalidAt",operator:"is_not_empty",value:null}]}).sort("invalidAt","desc").build());var pt="drives",Lu=z({name:pt,label:"Drive"}).sealed().icon("folder").hidden().pluralLabel("Drives").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
55
+ {{ description }}`).attribute(f({name:"name",label:"Name"}).required()).attribute(f({name:"description",label:"Description"}).multiline()).build(),Bu=O(G("drive-detail","Drive").for(pt).default().sidePanel({attributes:["description"]}).tab("documents","Documents").documents().build()),Uu=O(W("drive-list","Drives").for(pt).default().tab("workspace","Shared").default().icon("users").visibility("workspace").table().columns("name","description","updatedAt").sort("name","asc").tab("mine","My drives").icon("lock").visibility("private").table().columns("name","description","updatedAt").sort("name","asc").build());var mt="artifact",$u=z({name:mt,label:"Artifact"}).sealed().icon("package").pluralLabel("Artifacts").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
56
+ {{ description }}`).attribute(f({name:"name",label:"Name"}).required()).attribute(f({name:"description",label:"Description"}).multiline()).attribute(q({name:"kind",label:"Kind"}).options([{value:"web",label:"Web",color:"blue"},{value:"presentation",label:"Presentation",color:"purple"},{value:"document",label:"Document",color:"sky"},{value:"spreadsheet",label:"Spreadsheet",color:"green"},{value:"image",label:"Image",color:"pink"},{value:"code",label:"Code",color:"slate"},{value:"other",label:"Other",color:"gray"}]).required()).attribute(q({name:"retention",label:"Retention"}).options([{value:"ephemeral",label:"Ephemeral",color:"gray"},{value:"conversation",label:"Conversation",color:"blue"},{value:"persistent",label:"Persistent",color:"green"}]).defaultValue("conversation").required()).attribute(nt({name:"currentRevision",label:"Current revision"}).integer().min(1)).attribute(U({name:"expiresAt",label:"Expires at"}).includeTime().hidden()).attribute(f({name:"sourceSessionId",label:"Source session"}).hidden()).attribute(f({name:"sourceMessageId",label:"Source message"}).hidden()).attribute(f({name:"initialToolCallId",label:"Initial tool call"}).hidden()).attribute(yo({name:"versions",label:"Versions"}).qualifyWith(nt({name:"revision",label:"Revision"}).integer().min(1).required(),f({name:"toolCallId",label:"Tool call"}).hidden(),f({name:"sourceFileId",label:"Source file"}).hidden(),f({name:"previewFileId",label:"Preview file"}).hidden(),f({name:"fileIds",label:"File manifest"}).hidden(),f({name:"entrypoint",label:"Entrypoint"}).hidden(),f({name:"sourceMessageId",label:"Source message"}).hidden(),f({name:"artifactName",label:"Artifact name"}).hidden(),f({name:"artifactDescription",label:"Artifact description"}).hidden(),f({name:"artifactKind",label:"Artifact kind"}).hidden(),f({name:"displayMode",label:"Display mode"}).hidden(),f({name:"displayInteraction",label:"Display interaction"}).hidden(),f({name:"displaySize",label:"Display size"}).hidden(),nt({name:"displayAspectRatio",label:"Display aspect ratio"}).hidden())).build(),qu=O(G("artifact-detail","Artifact").for(mt).default().readOnly().sidePanel({attributes:["description","kind","retention","currentRevision","createdBy","updatedAt"]}).tab("preview","Preview").custom("ArtifactPreview").done().tab("versions","Versions").documents().disableUpload().disableRemove().hideAttachments().done().tab("activity","Activity").activity().done().build());function zu(){let e=W("artifact-list","Artifacts").for(mt).default().allowPresentationCustomization().tab("mine","My artifacts").default().icon("lock").visibility("private").readOnly().list().columns("name","kind","currentRevision","updatedAt").descriptionAttribute("description").displayAttributes("kind","currentRevision","updatedAt").sort("updatedAt","desc").tab("workspace","Workspace").icon("list").visibility("workspace").readOnly().list().columns("name","kind","currentRevision","updatedAt").descriptionAttribute("description").displayAttributes("kind","currentRevision","updatedAt").sort("updatedAt","desc").build();return {...e,config:{...e.config,tabs:e.config.tabs.map(t=>({...t,default:t.default??false}))}}}chunkDPD6ZWL2_js.a(zu,"buildArtifactListView");var Gu=O(zu());var ft="meeting",T={title:"title",description:"description",location:"location",startsAt:"startsAt",endsAt:"endsAt",isAllDay:"isAllDay",status:"status",organizerAddress:"organizerAddress",organizerName:"organizerName",conferenceProvider:"conferenceProvider",conferenceJoinUrl:"conferenceJoinUrl",htmlLink:"htmlLink",participants:"participants",providerEventId:"providerEventId",icalUid:"icalUid",recurringEventId:"recurringEventId",connectionId:"connectionId",recordingOverride:"recordingOverride",endedAnnouncedAt:"endedAnnouncedAt",linkedRecords:"linkedRecords"},So="meeting-list",vo="calendar-sync",Ro="meeting-detail",Io=[T.title,T.startsAt,T.endsAt,T.status],Wu=z({name:ft,label:"Meeting"}).sealed().hidden().metadata({platformOwned:{editable:[T.linkedRecords],source:vo}}).icon("calendar").pluralLabel("Meetings").labelExpression("{{ title }}").embeddingExpression(`{{ title }}
57
57
  {{ description }}
58
- {{ participants }}`).attribute(f({name:T.title,label:"Title"}).required()).attribute(he({name:T.description,label:"Description"})).attribute(f({name:T.location,label:"Location"})).attribute(U({name:T.startsAt,label:"Starts at"}).includeTime()).attribute(U({name:T.endsAt,label:"Ends at"}).includeTime()).attribute(go({name:T.isAllDay,label:"All day"})).attribute(q({name:T.status,label:"Status"}).options([{value:"confirmed",label:"Confirmed"},{value:"tentative",label:"Tentative"},{value:"cancelled",label:"Cancelled"}])).attribute(f({name:T.organizerAddress,label:"Organizer address"}).email()).attribute(f({name:T.organizerName,label:"Organizer"})).attribute(f({name:T.conferenceProvider,label:"Conference provider"})).attribute(f({name:T.conferenceJoinUrl,label:"Join link"}).url()).attribute(f({name:T.htmlLink,label:"Open in calendar"}).url()).attribute(f({name:T.participants,label:"Participants"}).multiline()).attribute(f({name:T.providerEventId,label:"Provider event id"}).hidden()).attribute(f({name:T.icalUid,label:"iCal UID"}).hidden()).attribute(f({name:T.recurringEventId,label:"Recurring event id"}).hidden()).attribute(f({name:T.connectionId,label:"Connection id"}).hidden()).attribute(q({name:T.recordingOverride,label:"Recording"}).options([{value:"force",label:"Force"},{value:"skip",label:"Skip"}]).hidden()).attribute(U({name:T.endedAnnouncedAt,label:"Ended announced at"}).includeTime().hidden()).attribute(Ae({name:T.linkedRecords,label:"Linked records"}).toAny().many().qualifyWith(f({name:"source",label:"Source"}).hidden())).build(),Gu=P(ee(Ro,"Meeting").for(pt).default().sidePanel({attributes:[T.startsAt,T.endsAt,T.linkedRecords]}).tab("description","Description").richtext(T.description).titleAttribute(T.title).build()),Wu=P(G(So,"Meetings").for(pt).default().tab("workspace","Shared").default().icon("users").visibility("workspace").table().columns(...Io).sort(T.startsAt,"desc").tab("mine","My meetings").icon("lock").visibility("private").table().columns(...Io).sort(T.startsAt,"desc").build());function ke(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(ke,"cloneViewDefinition");var On=class On{constructor(){this.views=new Map;this.byObject=new Map;this.byObjectAndType=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r)this.registerSingle(n);return this}registerSingle(t){let r=this.makeKey(t.object,t.name,t.type);if(this.views.has(r)){let l=`[ViewRegistry] Duplicate view: "${t.name}" (${t.type}) for object "${t.object}"`;throw new chunk72TQRSNX_js.r("view",r,l)}let n=ke(t);this.views.set(r,n);let o=this.byObject.get(n.object)??[];o.push(n),this.byObject.set(n.object,o);let a=`${n.object}:${n.type}`,s=this.byObjectAndType.get(a)??[];s.push(n),this.byObjectAndType.set(a,s);}getByObjectName(t){return Array.from(this.byObject.get(t)??[],ke)}getByObjectNameAndType(t,r){return Array.from(this.byObjectAndType.get(`${t}:${r}`)??[],ke)}get(t,r,n){if(n){let a=this.views.get(this.makeKey(t,r,n));return a?ke(a):void 0}return this.getByObjectName(t).find(a=>a.name===r)}getOrThrow(t,r,n){let o=this.get(t,r,n);if(!o){let s=this.getByObjectName(t).map(p=>`${p.name} (${p.type})`).join(", ")||"(none)",l=`[ViewRegistry] View "${r}" not found for object "${t}".
59
- Available views: ${s}`;throw new chunk72TQRSNX_js.c("View",`${t}:${r}`,void 0,l)}return o}getAll(){return Array.from(this.views.values(),ke)}has(t,r,n){return n?this.views.has(this.makeKey(t,r,n)):this.getByObjectName(t).some(a=>a.name===r)}hasObject(t){return this.byObject.has(t)}get size(){return this.views.size}listObjectNames(){return Array.from(this.byObject.keys())}getDefault(t,r){let n=this.getByObjectNameAndType(t,r);return n.find(o=>o.default)??n[0]}clear(){this.views.clear(),this.byObject.clear(),this.byObjectAndType.clear();}summary(){let t=[];t.push(`[ViewRegistry] ${this.size} view(s) registered:`);for(let r of this.listObjectNames()){let o=this.getByObjectName(r).map(a=>{let s=[];a.default&&s.push("default");let l=s.length>0?` (${s.join(", ")})`:"";return `${a.name}:${a.type}${l}`});t.push(` ${r}: ${o.join(", ")}`);}return t.join(`
60
- `)}debug(t){let r=this.summary();return t?.(r),r}makeKey(t,r,n){return `${t}:${r}:${n}`}};chunkDPD6ZWL2_js.a(On,"ViewRegistry");var kn=On,Ku=new kn;function Eo(e,t=[]){return e.filter(r=>!(!chunkSDOYGWU4_js.j(r).lifecycle.visibleInRuntime||r.system||t.includes(r.name)))}chunkDPD6ZWL2_js.a(Eo,"getRuntimeAttributes");function Do(e){return [...e].sort((t,r)=>{let n=t.order??999,o=r.order??999;return n!==o?n-o:t.name.localeCompare(r.name)})}chunkDPD6ZWL2_js.a(Do,"sortAttributes");function Yu(e){if(e.type==="text"&&e.multiline)return 12;switch(e.type){case "richtext":case "location":return 12;case "checkbox":return 4;default:return 6}}chunkDPD6ZWL2_js.a(Yu,"getDefaultFieldSpan");function Hu(e){return {attribute:e.name,span:Yu(e)}}chunkDPD6ZWL2_js.a(Hu,"attributeToField");function _n(e,t={}){let{includeActivityTab:r=true,includeDocumentsTab:n=true,excludeAttributes:o=[]}=t,a=Eo(e.attributes,o),p=[{id:"form",name:"form",label:"Details",type:"form",groups:[{id:"general",label:"General",type:"fields",fields:Do(a.filter(ae=>chunkSDOYGWU4_js.j(ae).presentation.formField)).map(Hu),order:0}],order:0}],I=1,X=e.attributes.some(ae=>ae.type==="document");n&&X&&p.push({id:"documents",name:"documents",label:"Documents",type:"documents",order:I++,allowUpload:true,allowRemove:true}),r&&p.push({id:"activity",name:"activity",label:"Activity",type:"activity",order:I++});let B={tabs:p};return {name:"default",label:"Default View",object:e.name,type:"detail",config:B,default:true}}chunkDPD6ZWL2_js.a(_n,"generateDefaultDetailView");function Pn(e,t={}){let{excludeAttributes:r=[],maxListColumns:n=5}=t,o=Eo(e.attributes,r),l={tabs:[{id:"all",label:"All",default:true,visibility:"workspace",layout:"table",columns:Do(o.filter(p=>chunkSDOYGWU4_js.j(p).presentation.defaultColumn)).slice(0,n).map(p=>p.name)}]};return {name:"default",label:"All Records",object:e.name,type:"list",config:l,default:true}}chunkDPD6ZWL2_js.a(Pn,"generateDefaultListView");function Qu(e,t){let{preserveCustomTabs:r=true,preserveTableTabs:n=true}=t,o=[];for(let a of e.config.tabs)r&&a.type==="custom"&&o.push(a),n&&a.type==="table"&&o.push(a);return o}chunkDPD6ZWL2_js.a(Qu,"getPreservedDetailTabs");function Ju(e,t){if(t.length===0)return e;let r=e.find(s=>s.type==="form"),n=e.filter(s=>s.type!=="form"),o=[];r&&o.push(r);let a=1;for(let s of t)o.push({...s,order:a++});for(let s of n)o.push({...s,order:a++});return o}chunkDPD6ZWL2_js.a(Ju,"mergeDetailTabs");function Xu(e,t,r){let{preserveMetadata:n=true,...o}=r,a=_n(t,o),s=Qu(e,r),l=Ju(a.config.tabs,s),p={...a.config,tabs:l},I={...a,config:p};return n&&(I.id=e.id,I.name=e.name,I.label=e.label,I.description=e.description,I.icon=e.icon),I}chunkDPD6ZWL2_js.a(Xu,"resetDetailViewToDefault");function Zu(e,t,r){let{preserveMetadata:n=true,...o}=r,s={...Pn(t,o)};return n&&(s.id=e.id,s.name=e.name,s.label=e.label,s.description=e.description,s.icon=e.icon),s}chunkDPD6ZWL2_js.a(Zu,"resetListViewToDefault");function el(e,t,r={}){if(Ke(e))return Xu(e,t,r);if(Hi(e))return Zu(e,t,r);throw new Error(`Reset not supported for view type: ${e.type}`)}chunkDPD6ZWL2_js.a(el,"resetViewToDefault");function NT(e,t){if(t){let r=e.tabs.find(n=>n.id===t);if(r)return r}return e.tabs.find(r=>r.default)??e.tabs[0]}chunkDPD6ZWL2_js.a(NT,"getActiveTab");function Fn(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(Fn,"cloneFormDefinition");var Vn=class Vn{constructor(){this.forms=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r){if(this.forms.has(n.name))throw new chunk72TQRSNX_js.r("form",n.name,`[FormRegistry] Duplicate form: "${n.name}"`);this.forms.set(n.name,Fn(n));}return this}get(t){let r=this.forms.get(t);return r?Fn(r):void 0}getAll(){return Array.from(this.forms.values(),Fn)}listNames(){return Array.from(this.forms.keys())}};chunkDPD6ZWL2_js.a(Vn,"FormRegistry");var Oe=Vn;var Co=new Oe;function UT(e,t){return `${e}:${t}`}chunkDPD6ZWL2_js.a(UT,"formatAgentStreamFrameId");function $T(e){let t=e.lastIndexOf(":");if(t<=0)return null;let r=e.slice(0,t),n=Number(e.slice(t+1));return !Number.isInteger(n)||n<=0?null:{streamId:r,sequence:n}}chunkDPD6ZWL2_js.a($T,"parseAgentStreamFrameId");var GT=204800,WT=256;function Mn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Mn,"isRecord");function Ln(e,t){let r=Object.keys(e);return r.length===t.length&&r.every(n=>t.includes(n))}chunkDPD6ZWL2_js.a(Ln,"hasExactKeys");function jn(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}chunkDPD6ZWL2_js.a(jn,"isPositiveInteger");function No(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0}chunkDPD6ZWL2_js.a(No,"isNonNegativeInteger");function tl(e){return Mn(e)&&Ln(e,["kind","startOffset","endOffset"])?(e.kind==="text"||e.kind==="reasoning")&&No(e.startOffset)&&No(e.endOffset)&&e.endOffset>=e.startOffset:false}chunkDPD6ZWL2_js.a(tl,"isContentRange");function rl(e){if(!Mn(e))return false;let t=e.content===void 0?["sequence","chunk"]:["sequence","content","chunk"];return Ln(e,t)&&jn(e.sequence)&&e.chunk!==void 0&&(e.content===void 0||tl(e.content))}chunkDPD6ZWL2_js.a(rl,"isBatchItem");function nl(e){try{return new TextEncoder().encode(JSON.stringify(e)).byteLength}catch{return}}chunkDPD6ZWL2_js.a(nl,"encodedSize");function KT(e){if(!(Mn(e)&&Ln(e,["schemaVersion","batchId","tenantId","sessionId","streamId","sequenceStart","sequenceEnd","items"]))||e.schemaVersion!==1||typeof e.batchId!="string"||e.batchId.trim()===""||typeof e.tenantId!="string"||e.tenantId.trim()===""||typeof e.sessionId!="string"||e.sessionId.trim()===""||typeof e.streamId!="string"||e.streamId.trim()===""||!jn(e.sequenceStart)||!jn(e.sequenceEnd)||!Array.isArray(e.items)||e.items.length===0||e.items.length>256||!e.items.every(rl))return false;let t=0;for(let n of e.items){if(n.sequence<=t)return false;t=n.sequence;}if(e.items[0]?.sequence!==e.sequenceStart||e.items.at(-1)?.sequence!==e.sequenceEnd)return false;let r=nl(e);return r!==void 0&&r<=204800}chunkDPD6ZWL2_js.a(KT,"isAgentUIMessageBatch");function QT(e){switch(e.kind){case "workspace":return `workspace:${encodeURIComponent(e.tenantId)}`;case "object":return `object:${encodeURIComponent(e.objectId)}`;case "record":return `record:${encodeURIComponent(e.objectId)}:${encodeURIComponent(e.recordId)}`;case "view":return `view:${encodeURIComponent(e.viewId)}`;case "user":return `user:${encodeURIComponent(e.actorId)}`;case "conversation":return `conversation:${encodeURIComponent(e.sessionId)}`;case "architect-draft":return `architect-draft:${encodeURIComponent(e.actorId)}`}}chunkDPD6ZWL2_js.a(QT,"liveChannelKey");function te(e){try{return decodeURIComponent(e)}catch{return null}}chunkDPD6ZWL2_js.a(te,"decodeLiveChannelPart");function ko(e){let t=e.split(":");if(t[0]==="workspace"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"workspace",tenantId:r}:null}if(t[0]==="object"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"object",objectId:r}:null}if(t[0]==="record"&&t.length===3&&t[1]&&t[2]){let r=te(t[1]),n=te(t[2]);return r&&n?{kind:"record",objectId:r,recordId:n}:null}if(t[0]==="view"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"view",viewId:r}:null}if(t[0]==="user"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"user",actorId:r}:null}if(t[0]==="architect-draft"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"architect-draft",actorId:r}:null}if(t[0]==="conversation"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"conversation",sessionId:r}:null}return null}chunkDPD6ZWL2_js.a(ko,"parseLiveChannelKey");var il={"record.patch":true,"record.deleted":true,"record.removed":true,"record.created":true,"view.projection.stale":true,"agent.session.patch":true,"notification.created":true,"notification.recipient.patch":true,"notification.count.patch":true,"notification.inbox.archived":true,"reflex.state.changed":true,"reflex.run.completed":true,"reflex.authoring.progress":true,"architect.draft.updated":true,"meeting.recording.patch":true,"wallet.state":true,"channel.revoked":true},ol=Object.keys(il),al=["membership-unknown","sort-unknown","permissions-changed"],sl=["permission-revoked","workspace-left","object-deleted"],ul=["inboxState","workState","lockedAt","lockedByActorId","readAt","archivedAt","snoozedUntil","completedAt","dismissedAt","updatedAt"],ll=["type","objectId","recordId","recordVersion"],dl=["type","objectId","recordId","recordVersion","record"],cl=["id","objectId","visibility","ownedBy","label","values","metadata","createdAt","updatedAt","createdBy","lastUpdatedBy","schemaVersion"],pl=["type","targetActorId","archivedCount","version","updatedAt"];function ml(e){return typeof e=="string"&&ol.includes(e)}chunkDPD6ZWL2_js.a(ml,"isLiveEventType");function ew(e){return C(e)&&ml(e.type)?fl(e.type,e):false}chunkDPD6ZWL2_js.a(ew,"isLiveEventPayload");function fl(e,t){if(!C(t))return false;switch(e){case "record.patch":return wl(t);case "record.deleted":return xl(t);case "record.removed":return Il(t);case "record.created":return vl(t);case "view.projection.stale":return Rl(t);case "agent.session.patch":return El(t);case "notification.created":return kl(t);case "notification.recipient.patch":return Ol(t);case "notification.count.patch":return _l(t);case "notification.inbox.archived":return Pl(t);case "reflex.state.changed":return Bl(t);case "reflex.run.completed":return Ul(t);case "reflex.authoring.progress":return $l(t);case "architect.draft.updated":return Ll(t);case "meeting.recording.patch":return zl(t);case "wallet.state":return Kl(t);case "channel.revoked":return Yl(t);default:return false}}chunkDPD6ZWL2_js.a(fl,"isLiveEventPayloadForType");function C(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(C,"isRecord");function F(e){return typeof e=="string"}chunkDPD6ZWL2_js.a(F,"isString");function Oo(e){return F(e)&&e.length>0}chunkDPD6ZWL2_js.a(Oo,"isNonEmptyString");function mt(e){return e===null||F(e)}chunkDPD6ZWL2_js.a(mt,"isNullableString");function bl(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}chunkDPD6ZWL2_js.a(bl,"isVersion");function W(e){if(!F(e))return false;let t=Date.parse(e);return Number.isFinite(t)&&new Date(t).toISOString()===e}chunkDPD6ZWL2_js.a(W,"isIsoDateString");function we(e){return e===null||W(e)}chunkDPD6ZWL2_js.a(we,"isNullableIsoDateString");function x(e,t){return F(e[t])}chunkDPD6ZWL2_js.a(x,"hasString");function re(e,t){return Oo(e[t])}chunkDPD6ZWL2_js.a(re,"hasNonEmptyString");function N(e,t){return bl(e[t])}chunkDPD6ZWL2_js.a(N,"hasVersion");function k(e,t){return W(e[t])}chunkDPD6ZWL2_js.a(k,"hasIsoDateString");function w(e,t,r){return !Object.hasOwn(e,t)||r(e[t])}chunkDPD6ZWL2_js.a(w,"hasOptional");function ft(e,t){return Object.keys(e).every(r=>t.includes(r))}chunkDPD6ZWL2_js.a(ft,"hasOnlyKeys");function O(e,t){return typeof e=="string"&&t.includes(e)}chunkDPD6ZWL2_js.a(O,"isOneOf");function gl(e){return O(e,ki)}chunkDPD6ZWL2_js.a(gl,"isNotificationKind");function yl(e){return O(e,Oi)}chunkDPD6ZWL2_js.a(yl,"isNotificationPriority");function hl(e){return O(e,_i)}chunkDPD6ZWL2_js.a(hl,"isNotificationSensitivity");function _o(e){return O(e,Pi)}chunkDPD6ZWL2_js.a(_o,"isNotificationInboxState");function Po(e){return O(e,Fi)}chunkDPD6ZWL2_js.a(Po,"isNotificationWorkState");function Al(e){return C(e)&&x(e,"type")&&x(e,"id")}chunkDPD6ZWL2_js.a(Al,"isNotificationSubject");function Tl(e){return C(e)&&x(e,"fieldKey")&&Object.hasOwn(e,"value")&&N(e,"version")}chunkDPD6ZWL2_js.a(Tl,"isRecordFieldPatch");function wl(e){return e.type==="record.patch"&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&w(e,"label",F)&&w(e,"metadata",C)&&w(e,"fieldsWithheld",t=>t===true)&&Array.isArray(e.fieldPatches)&&e.fieldPatches.every(Tl)&&x(e,"updatedAt")}chunkDPD6ZWL2_js.a(wl,"isRecordPatchPayload");function xl(e){return e.type==="record.deleted"&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&x(e,"deletedAt")}chunkDPD6ZWL2_js.a(xl,"isRecordDeletedPayload");function Il(e){return e.type==="record.removed"&&ft(e,ll)&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")}chunkDPD6ZWL2_js.a(Il,"isRecordRemovedPayload");function Sl(e){return C(e)&&ft(e,cl)&&x(e,"id")&&x(e,"objectId")&&O(e.visibility,["workspace","private"])&&mt(e.ownedBy)&&(e.visibility==="workspace"&&e.ownedBy===null||e.visibility==="private"&&Oo(e.ownedBy))&&x(e,"label")&&C(e.values)&&w(e,"metadata",C)&&k(e,"createdAt")&&k(e,"updatedAt")&&w(e,"createdBy",F)&&w(e,"lastUpdatedBy",F)&&N(e,"schemaVersion")}chunkDPD6ZWL2_js.a(Sl,"isRecordLiveSnapshot");function vl(e){return e.type==="record.created"&&ft(e,dl)&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&Sl(e.record)&&e.record.id===e.recordId&&e.record.objectId===e.objectId}chunkDPD6ZWL2_js.a(vl,"isRecordCreatedPayload");function Rl(e){return e.type==="view.projection.stale"&&x(e,"viewId")&&O(e.reason,al)}chunkDPD6ZWL2_js.a(Rl,"isViewProjectionStalePayload");function El(e){return e.type==="agent.session.patch"&&x(e,"sessionId")&&C(e.patch)&&N(e,"version")&&x(e,"updatedAt")}chunkDPD6ZWL2_js.a(El,"isAgentSessionPatchPayload");function Dl(e){return C(e)&&x(e,"id")&&x(e,"tenantId")&&w(e,"senderActorId",F)&&w(e,"rootActorId",F)&&w(e,"triggeredByActorId",F)&&gl(e.kind)&&x(e,"type")&&w(e,"subject",Al)&&x(e,"title")&&w(e,"summary",F)&&C(e.payload)&&yl(e.priority)&&hl(e.sensitivity)&&w(e,"threadKey",F)&&w(e,"idempotencyKey",F)&&w(e,"expiresAt",W)&&k(e,"createdAt")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Dl,"isLiveNotification");function Cl(e){return C(e)&&x(e,"id")&&x(e,"tenantId")&&x(e,"notificationId")&&x(e,"recipientActorId")&&_o(e.inboxState)&&Po(e.workState)&&w(e,"lockedAt",W)&&w(e,"lockedByActorId",F)&&w(e,"readAt",W)&&w(e,"archivedAt",W)&&w(e,"snoozedUntil",W)&&w(e,"completedAt",W)&&w(e,"dismissedAt",W)&&k(e,"createdAt")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Cl,"isLiveNotificationRecipient");function Nl(e){return C(e)?Object.keys(e).every(t=>ul.includes(t))&&w(e,"inboxState",_o)&&w(e,"workState",Po)&&w(e,"lockedAt",we)&&w(e,"lockedByActorId",mt)&&w(e,"readAt",we)&&w(e,"archivedAt",we)&&w(e,"snoozedUntil",we)&&w(e,"completedAt",we)&&w(e,"dismissedAt",we)&&w(e,"updatedAt",W):false}chunkDPD6ZWL2_js.a(Nl,"isNotificationRecipientPatch");function kl(e){let t=Dl(e.notification)?e.notification:null;return e.type==="notification.created"&&t!==null&&Array.isArray(e.recipients)&&e.recipients.length>0&&e.recipients.every(r=>Cl(r)&&r.notificationId===t.id)&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(kl,"isNotificationCreatedPayload");function Ol(e){return e.type==="notification.recipient.patch"&&x(e,"recipientId")&&x(e,"recipientActorId")&&Nl(e.patch)&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Ol,"isNotificationRecipientPatchPayload");function _l(e){return e.type==="notification.count.patch"&&x(e,"targetActorId")&&N(e,"unread")&&N(e,"pendingWork")&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(_l,"isNotificationCountPatchPayload");function Pl(e){return e.type==="notification.inbox.archived"&&ft(e,pl)&&re(e,"targetActorId")&&N(e,"archivedCount")&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Pl,"isNotificationInboxArchivedPayload");var Fl=["armed","disarmed"],Vl=["authoring","compiling","replaying","promoted","failed"],jl=["promoted","lkg"],Ml=["composing","published","discarded"];function Ll(e){if(e.type!=="architect.draft.updated"||!C(e.draft))return false;let t=e.draft;return re(t,"id")&&re(t,"actorId")&&mt(t.agentSessionId)&&Array.isArray(t.operations)&&t.operations.every(C)&&C(t.baselines)&&O(t.status,Ml)}chunkDPD6ZWL2_js.a(Ll,"isArchitectDraftUpdatedPayload");function Bl(e){return e.type==="reflex.state.changed"&&re(e,"reflexId")&&O(e.state,Fl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Bl,"isReflexStateChangedPayload");function Ul(e){return e.type==="reflex.run.completed"&&re(e,"reflexId")&&re(e,"runId")&&O(e.served,jl)&&N(e,"version")&&N(e,"wallMs")&&k(e,"completedAt")}chunkDPD6ZWL2_js.a(Ul,"isReflexRunCompletedPayload");function $l(e){return e.type==="reflex.authoring.progress"&&re(e,"reflexId")&&O(e.status,Vl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a($l,"isReflexAuthoringProgressPayload");var ql=["none","scheduled","recording","completed","failed"];function zl(e){return e.type==="meeting.recording.patch"&&re(e,"meetingId")&&O(e.status,ql)&&mt(e.failureReason)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(zl,"isMeetingRecordingPatchPayload");var Gl=["ok","low","exhausted","paused"],Wl=["metering-only","contract","wallet"];function Kl(e){return e.type==="wallet.state"&&O(e.status,Gl)&&O(e.mode,Wl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Kl,"isWalletStatePayload");function Yl(e){return e.type==="channel.revoked"&&x(e,"channel")&&O(e.reason,sl)}chunkDPD6ZWL2_js.a(Yl,"isChannelRevokedPayload");function Bn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Bn,"isRecord");function Hl(e){let{channel:t}=e;return typeof t=="string"&&ko(t)?t:null}chunkDPD6ZWL2_js.a(Hl,"payloadChannel");function iw(e){return Bn(e)?Hl(e):null}chunkDPD6ZWL2_js.a(iw,"getLiveProtocolPayloadChannel");function ow(e){return Bn(e)?typeof e.id=="string"&&e.id.length>0&&typeof e.channel=="string"&&typeof e.type=="string"&&typeof e.tenantId=="string"&&e.tenantId.length>0&&typeof e.occurredAt=="string"&&Bn(e.payload):false}chunkDPD6ZWL2_js.a(ow,"isLiveEventEnvelope");var uw=["if","concat","sum","avg","count","min","max","earliest","latest","unique","first","percent_empty","percent_not_empty","count_empty","count_not_empty","count_unique"],_e={if:{name:"if",returnType:"branch",minArgs:3,maxArgs:3},concat:{name:"concat",returnType:{kind:"scalar",type:"text"},minArgs:1},sum:{name:"sum",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},avg:{name:"avg",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count:{name:"count",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},min:{name:"min",returnType:"source_item",minArgs:1,maxArgs:1},max:{name:"max",returnType:"source_item",minArgs:1,maxArgs:1},earliest:{name:"earliest",returnType:{kind:"scalar",type:"date"},minArgs:1,maxArgs:1},latest:{name:"latest",returnType:{kind:"scalar",type:"date"},minArgs:1,maxArgs:1},unique:{name:"unique",returnType:"argument",minArgs:1,maxArgs:1},first:{name:"first",returnType:"source_item",minArgs:1,maxArgs:1},percent_empty:{name:"percent_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},percent_not_empty:{name:"percent_not_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_empty:{name:"count_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_not_empty:{name:"count_not_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_unique:{name:"count_unique",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1}};function bt(e){return Object.hasOwn(_e,e)}chunkDPD6ZWL2_js.a(bt,"isComputedFunctionName");var zn=class zn extends Error{constructor(t){super(t),this.name="ComputedFormulaCompileError";}};chunkDPD6ZWL2_js.a(zn,"ComputedFormulaCompileError");var b=zn;function Bo(e){let t=Ql(e.expression),r=gt(t,e.schema),n=hd(r.valueType);if(n!==e.returnType)throw new b(`Computed formula "${e.attributeName}" returns "${n}", expected "${e.returnType}"`);if(Uo(e.returnType)&&r.optionsSource===void 0)throw new b(`Computed formula "${e.attributeName}" returns "${e.returnType}" without optionsSource`);let o=r.optionsSource===void 0?[]:[{kind:"options",source:r.optionsSource}],a=qn([...r.dependencies,...o]);return {kind:"formula",attributeName:e.attributeName,expression:e.expression,returnType:e.returnType,valueType:r.valueType,dependencies:a,ast:t,...r.optionsSource?{optionsSource:r.optionsSource}:{},...r.targetAttributeType?{targetAttributeType:r.targetAttributeType}:{},dependenciesHash:Ad({expression:e.expression,returnType:e.returnType,dependencies:a})}}chunkDPD6ZWL2_js.a(Bo,"compileComputedFormula");function mw(e){let t=new Map(e.map(o=>[o.attributeName,o])),r=new Set,n=chunkDPD6ZWL2_js.a((o,a)=>{let s=a.indexOf(o);if(s!==-1){let I=[...a.slice(s),o];throw new b(`Computed field cycle detected: ${I.join(" -> ")}`)}if(r.has(o))return;let l=t.get(o);if(l===void 0)return;let p=[...a,o];for(let I of l.dependencies)I.kind==="computed"&&n(I.attributeName,p);r.add(o);},"visit");for(let o of e)n(o.attributeName,[]);}chunkDPD6ZWL2_js.a(mw,"assertAcyclicComputedDependencies");function Ql(e){try{return chunk47EGJRW7_js.e(e)}catch(t){throw t instanceof Error?new b(t.message):t}}chunkDPD6ZWL2_js.a(Ql,"parseCompileFormula");function gt(e,t){switch(e.kind){case "literal":return {valueType:Jl(e.value),dependencies:[],...typeof e.value=="string"?{literalString:e.value}:{}};case "path":return Xl(e.parts,t);case "call":return id(e.functionName,e.args,t);case "binary":return ld(e.operator,gt(e.left,t),gt(e.right,t));default:return e}}chunkDPD6ZWL2_js.a(gt,"inferNode");function Jl(e){switch(typeof e){case "string":return {kind:"scalar",type:"text"};case "number":return {kind:"scalar",type:"number"};case "boolean":return {kind:"scalar",type:"boolean"};case "object":return {kind:"scalar",type:"text"};default:return e}}chunkDPD6ZWL2_js.a(Jl,"literalToValueType");function Xl(e,t){if(e.length===1){let r=e[0],n=Un(t,r);if(n===void 0)throw new b(`Unknown attribute "${r}" on object "${t.objectName}"`);return n.type==="relation"?{valueType:td(),dependencies:[{kind:"relation",relationName:n.name,cardinality:Fo(n)}],targetAttributeType:n.type}:{valueType:Vo(n),dependencies:[ed(n)],optionsSource:jo(t.objectName,n),targetAttributeType:n.type}}if(e.length===2){let[r,n]=e,o=Un(t,r);if(o===void 0)throw new b(`Unknown attribute "${r}" on object "${t.objectName}"`);if(o.type!=="relation")throw new b(`Attribute "${r}" on object "${t.objectName}" is not a relation`);let a=Zl(o);if(a===void 0)throw new b(`Relation "${r}" on object "${t.objectName}" is missing targetObjectName`);let s=t.relatedObjects?.[a];if(s===void 0)throw new b(`Unknown related object "${a}"`);let l=Un(s,n);if(l===void 0)throw new b(`Unknown attribute "${n}" on object "${s.objectName}"`);let p=Vo(l);return {valueType:o.cardinality==="many"?nd(p):p,dependencies:[{kind:"relation",relationName:r,targetAttributeName:n,cardinality:Fo(o)}],optionsSource:jo(s.objectName,l),targetAttributeType:l.type}}throw new b("Computed paths support at most one relation hop")}chunkDPD6ZWL2_js.a(Xl,"inferPath");function Un(e,t){return e.attributes.find(r=>r.name===t)}chunkDPD6ZWL2_js.a(Un,"findAttribute");function Zl(e){if(e.targetObjectName!==void 0)return e.targetObjectName;if(e.targets?.length===1){let[t]=e.targets;return t?.object==="*"?void 0:t?.object}}chunkDPD6ZWL2_js.a(Zl,"getRelationTargetObjectName");function Fo(e){return e.cardinality??"one"}chunkDPD6ZWL2_js.a(Fo,"relationCardinality");function ed(e){return e.type==="formula"||e.type==="rollup"?{kind:"computed",attributeName:e.name}:{kind:"local",attributeName:e.name}}chunkDPD6ZWL2_js.a(ed,"localDependencyFor");function Vo(e){if(e.type==="formula"||e.type==="rollup"){if(e.returnType===void 0)throw new b(`Computed attribute "${e.name}" is missing returnType`);return rd(e.returnType)}switch(e.type){case "number":case "currency":return {kind:"scalar",type:"number"};case "checkbox":return {kind:"scalar",type:"boolean"};case "date":return {kind:"scalar",type:"date"};case "select":case "status":return {kind:"scalar",type:"select"};case "multiselect":return {kind:"collection",itemType:"select"};case "text":case "richtext":case "phone":case "user":case "location":case "relation":case "document":return {kind:"scalar",type:"text"};default:return e.type}}chunkDPD6ZWL2_js.a(Vo,"attributeToValueType");function td(){return {kind:"collection",itemType:"text"}}chunkDPD6ZWL2_js.a(td,"relationToValueType");function rd(e){return e==="multiselect"?{kind:"collection",itemType:"select"}:{kind:"scalar",type:e}}chunkDPD6ZWL2_js.a(rd,"returnTypeToValueType");function nd(e){return e.kind==="collection"?e:{kind:"collection",itemType:e.type}}chunkDPD6ZWL2_js.a(nd,"asCollectionValueType");function jo(e,t){if(t.type==="formula"||t.type==="rollup")return Uo(t.returnType)?t.optionsSource:void 0;if(!(t.type!=="select"&&t.type!=="status"&&t.type!=="multiselect"))return t.optionsSource??{objectName:e,attributeName:t.name,...t.id?{attributeId:t.id}:{}}}chunkDPD6ZWL2_js.a(jo,"optionsSourceForAttribute");function id(e,t,r){if(!bt(e))throw new b(`Unknown computed function "${e}"`);let n=_e[e];if(t.length<n.minArgs||n.maxArgs!==void 0&&t.length>n.maxArgs){let a=n.maxArgs===void 0||n.maxArgs===n.minArgs?String(n.minArgs):`${n.minArgs}-${n.maxArgs}`;throw new b(`Function "${e}" expects ${a} arguments, received ${t.length}`)}let o=t.map(a=>gt(a,r));return od(e,o)}chunkDPD6ZWL2_js.a(id,"inferCall");function od(e,t){let r=qn(t.flatMap(n=>n.dependencies));switch(e){case "if":return ad(t,r);case "concat":return dd(t,`Function "${e}" does not accept collection values`),{valueType:{kind:"scalar",type:"text"},dependencies:r};case "sum":case "avg":return Mo(e,t[0],"number"),{valueType:{kind:"scalar",type:"number"},dependencies:r};case "count":case "count_empty":case "count_not_empty":case "count_unique":case "percent_empty":case "percent_not_empty":return pd(e,t[0]),{valueType:{kind:"scalar",type:"number"},dependencies:r};case "min":case "max":return cd(e,t[0]),{valueType:md(t[0]),dependencies:r,optionsSource:t[0].optionsSource,targetAttributeType:t[0].targetAttributeType};case "earliest":case "latest":return Mo(e,t[0],"date"),{valueType:{kind:"scalar",type:"date"},dependencies:r,targetAttributeType:t[0].targetAttributeType};case "unique":return sd(t[0],r);case "first":return ud(t[0],r);default:return e}}chunkDPD6ZWL2_js.a(od,"inferFunctionReturn");function ad(e,t){$n(e[0].valueType,"boolean",'Function "if" condition must be boolean');let r=e[1],n=e[2],o=bd(r,n),a=gd(r,n);if(o===void 0)throw new b('Function "if" branches must return the same type');return {valueType:o,dependencies:t,...a?{optionsSource:a}:{},targetAttributeType:r.targetAttributeType??n.targetAttributeType}}chunkDPD6ZWL2_js.a(ad,"inferIfFunction");function sd(e,t){if(e.valueType.kind!=="collection"||e.valueType.itemType!=="select")throw new b('Function "unique" expects a select collection');return {valueType:{kind:"collection",itemType:"select"},dependencies:t,optionsSource:e.optionsSource,targetAttributeType:e.targetAttributeType}}chunkDPD6ZWL2_js.a(sd,"inferUniqueFunction");function ud(e,t){if(e.valueType.kind!=="collection")throw new b('Function "first" expects a collection');return {valueType:{kind:"scalar",type:e.valueType.itemType},dependencies:t,optionsSource:e.optionsSource,targetAttributeType:e.targetAttributeType}}chunkDPD6ZWL2_js.a(ud,"inferFirstFunction");function ld(e,t,r){let n=qn([...t.dependencies,...r.dependencies]),o=e==="+"||e==="-"||e==="*"||e==="/";if(t.valueType.kind==="collection"||r.valueType.kind==="collection")throw new b(`Cannot use collection values with ${o?"arithmetic":"comparison"} operator "${e}"`);if(o)return e==="+"&&(t.valueType.type==="text"||r.valueType.type==="text")?{valueType:{kind:"scalar",type:"text"},dependencies:n}:($n(t.valueType,"number",`Operator "${e}" expects number operands`),$n(r.valueType,"number",`Operator "${e}" expects number operands`),{valueType:{kind:"scalar",type:"number"},dependencies:n});if(e==="=="||e==="!="){if(t.valueType.type!==r.valueType.type)throw new b(`Operator "${e}" expects operands with the same scalar type`);return {valueType:{kind:"scalar",type:"boolean"},dependencies:n}}if((t.valueType.type!=="number"||r.valueType.type!=="number")&&(t.valueType.type!=="date"||r.valueType.type!=="date"))throw new b(`Operator "${e}" expects number or date operands of the same type`);return {valueType:{kind:"scalar",type:"boolean"},dependencies:n}}chunkDPD6ZWL2_js.a(ld,"inferBinary");function dd(e,t){for(let r of e)if(r.valueType.kind==="collection")throw new b(t)}chunkDPD6ZWL2_js.a(dd,"ensureNoCollections");function Mo(e,t,r){if((t.valueType.kind==="collection"?t.valueType.itemType:t.valueType.type)!==r)throw new b(`Function "${e}" expects ${r} values`)}chunkDPD6ZWL2_js.a(Mo,"ensureCollectionOrScalarType");function cd(e,t){if(t.valueType.kind!=="collection")throw new b(`Function "${e}" expects a collection`);let r=t.valueType.itemType;if(r!=="number"&&r!=="date")throw new b(`Function "${e}" expects number or date values`)}chunkDPD6ZWL2_js.a(cd,"ensureMinMaxSource");function pd(e,t){if(t.valueType.kind!=="collection")throw new b(`Function "${e}" expects a collection`)}chunkDPD6ZWL2_js.a(pd,"ensureCollectionSource");function $n(e,t,r){if(e.kind!=="scalar"||e.type!==t)throw new b(r)}chunkDPD6ZWL2_js.a($n,"ensureScalarType");function md(e){return e.valueType.kind==="scalar"?e.valueType:{kind:"scalar",type:e.valueType.itemType}}chunkDPD6ZWL2_js.a(md,"sourceItemValueType");function fd(e,t){return e.kind==="scalar"?t.kind==="scalar"&&e.type===t.type:t.kind==="collection"&&e.itemType===t.itemType}chunkDPD6ZWL2_js.a(fd,"sameValueType");function bd(e,t){if(fd(e.valueType,t.valueType)||Lo(e,t))return e.valueType;if(Lo(t,e))return t.valueType}chunkDPD6ZWL2_js.a(bd,"resolveIfBranchValueType");function Lo(e,t){return e.valueType.kind==="scalar"&&e.valueType.type==="select"&&t.valueType.kind==="scalar"&&t.valueType.type==="text"&&t.literalString!==void 0}chunkDPD6ZWL2_js.a(Lo,"isSelectScalarWithStringLiteral");function gd(e,t){let r=e.optionsSource,n=t.optionsSource;if(r!==void 0&&n!==void 0&&!yd(r,n))throw new b('Function "if" branches use incompatible options sources');return r??n}chunkDPD6ZWL2_js.a(gd,"resolveIfOptionsSource");function yd(e,t){return e.objectName===t.objectName&&e.attributeName===t.attributeName&&e.attributeId===t.attributeId}chunkDPD6ZWL2_js.a(yd,"sameOptionsSource");function Uo(e){return e==="select"||e==="multiselect"}chunkDPD6ZWL2_js.a(Uo,"isSelectLikeReturnType");function hd(e){if(e.kind==="scalar")return e.type;if(e.itemType==="select")return "multiselect";throw new b(`Collection item type "${e.itemType}" cannot be used as a computed return type`)}chunkDPD6ZWL2_js.a(hd,"valueTypeToReturnType");function qn(e){let t=new Set,r=[];for(let n of e){let o=JSON.stringify(Pe(n));t.has(o)||(t.add(o),r.push(n));}return r}chunkDPD6ZWL2_js.a(qn,"uniqueDependencies");function Ad(e){let t=e.dependencies.map(r=>Pe(r)).sort((r,n)=>$o(JSON.stringify(r),JSON.stringify(n)));return JSON.stringify(Pe({expression:e.expression,returnType:e.returnType,dependencies:t}))}chunkDPD6ZWL2_js.a(Ad,"createDependenciesHash");function Pe(e){return Array.isArray(e)?e.map(t=>Pe(t)):e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>$o(t,r)).map(([t,r])=>[t,Pe(r)])):e}chunkDPD6ZWL2_js.a(Pe,"stableNormalize");function $o(e,t){return e<t?-1:e>t?1:0}chunkDPD6ZWL2_js.a($o,"compareStrings");function Td(e){return e.function==="count"?`count(${e.relationAttribute})`:`${Id(e.function)}(${e.relationAttribute}.${e.targetAttribute})`}chunkDPD6ZWL2_js.a(Td,"rollupToFormulaExpression");function wd(e,t){if(e.function==="count")return "number";let r=Sd(e,t);switch(e.function){case "countValues":case "countEmpty":case "percentEmpty":case "percentNotEmpty":case "countUniqueValues":return "number";case "sum":case "avg":return "number";case "earliest":case "latest":return "date";case "original":if(!Rd(r.type))throw new b('Rollup "original" requires a select, status, or multiselect target');return "multiselect";default:return e.function}}chunkDPD6ZWL2_js.a(wd,"inferRollupReturnType");function yw(e,t){let r=Td(e),n=wd(e,t);return {...Bo({attributeName:e.name,expression:r,returnType:n,schema:xd(e,t)}),kind:"rollup"}}chunkDPD6ZWL2_js.a(yw,"compileRollupAttribute");function xd(e,t){return {...t,attributes:t.attributes.map(r=>r.name===e.relationAttribute&&r.type==="relation"?{...r,cardinality:"many"}:r)}}chunkDPD6ZWL2_js.a(xd,"schemaWithRollupRelationAsMany");function Id(e){switch(e){case "sum":case "avg":case "earliest":case "latest":return e;case "original":return "unique";case "countValues":return "count_not_empty";case "countEmpty":return "count_empty";case "percentEmpty":return "percent_empty";case "percentNotEmpty":return "percent_not_empty";case "countUniqueValues":return "count_unique";default:return e}}chunkDPD6ZWL2_js.a(Id,"rollupFunctionToFormulaFunction");function Sd(e,t){let r=qo(t,e.relationAttribute);if(r===void 0)throw new b(`Unknown relation attribute "${e.relationAttribute}" on object "${t.objectName}"`);if(r.type!=="relation")throw new b(`Attribute "${e.relationAttribute}" on object "${t.objectName}" is not a relation`);let n=vd(r);if(n===void 0)throw new b(`Relation "${e.relationAttribute}" on object "${t.objectName}" is missing targetObjectName`);let o=t.relatedObjects?.[n];if(o===void 0)throw new b(`Unknown related object "${n}"`);let a=qo(o,e.targetAttribute);if(a===void 0)throw new b(`Unknown attribute "${e.targetAttribute}" on object "${o.objectName}"`);return a}chunkDPD6ZWL2_js.a(Sd,"findRollupTargetAttribute");function qo(e,t){return e.attributes.find(r=>r.name===t)}chunkDPD6ZWL2_js.a(qo,"findAttribute");function vd(e){if(e.targetObjectName!==void 0)return e.targetObjectName;if(e.targets?.length===1){let[t]=e.targets;return t?.object==="*"?void 0:t?.object}}chunkDPD6ZWL2_js.a(vd,"getRelationTargetObjectName");function Rd(e){return e==="select"||e==="status"||e==="multiselect"}chunkDPD6ZWL2_js.a(Rd,"isSelectLikeAttributeType");function J(e,t){switch(e.kind){case "literal":return e.value;case "path":return Dd(t,e.parts);case "binary":return Cd(e.operator,J(e.left,t),J(e.right,t));case "call":return Ed(e.functionName,e.args,t);default:return e}}chunkDPD6ZWL2_js.a(J,"evaluateAst");function Ed(e,t,r){if(kd(e),Od(e,t.length),e==="if"){let n=J(t[0],r);return n===null?null:J(n?t[1]:t[2],r)}return _d(e,t.map(n=>J(n,r)))}chunkDPD6ZWL2_js.a(Ed,"evaluateCallNode");function Dd(e,t){return t.reduce((r,n)=>Ho(r,n),e)}chunkDPD6ZWL2_js.a(Dd,"resolvePath");function Ho(e,t){if(Array.isArray(e))return e.map(n=>Ho(n,t));if(!Yo(e))return null;if(Object.hasOwn(e,t))return e[t]??null;let r=e.values;return Yo(r)&&Object.hasOwn(r,t)?r[t]??null:null}chunkDPD6ZWL2_js.a(Ho,"resolvePathPart");function Cd(e,t,r){switch(e){case "+":return Nd(t,r);case "-":return ht(t,r,(n,o)=>n-o);case "*":return ht(t,r,(n,o)=>n*o);case "/":return ht(t,r,(n,o)=>n/o);case ">":return yt(t,r,n=>n>0);case "<":return yt(t,r,n=>n<0);case ">=":return yt(t,r,n=>n>=0);case "<=":return yt(t,r,n=>n<=0);case "==":return zo(t,r);case "!=":{let n=zo(t,r);return n===null?null:!n}default:return e}}chunkDPD6ZWL2_js.a(Cd,"evaluateBinary");function Nd(e,t){return typeof e=="string"||typeof t=="string"?`${e??""}${t??""}`:ht(e,t,(r,n)=>r+n)}chunkDPD6ZWL2_js.a(Nd,"add");function yt(e,t,r){let n=Qo(e,t);return n===null?null:r(n)}chunkDPD6ZWL2_js.a(yt,"compareWith");function Qo(e,t){if(!xe([e,t]))return null;let r=Ie(e),n=Ie(t);if(r!==null&&n!==null)return r-n;let o=Kn(e),a=Kn(t);return o&&a?o.getTime()-a.getTime():null}chunkDPD6ZWL2_js.a(Qo,"compare");function zo(e,t){return e===t?true:e==null||t===null||t===void 0?false:xe([e,t])?Qo(e,t)===0:null}chunkDPD6ZWL2_js.a(zo,"equalScalar");function kd(e){if(!bt(e))throw new Error(`Unknown computed function "${e}"`)}chunkDPD6ZWL2_js.a(kd,"assertComputedFunctionName");function Od(e,t){let{minArgs:r,maxArgs:n}=_e[e];if(t>=r&&t<=(n??Number.POSITIVE_INFINITY))return;let o=n===void 0?`at least ${r}`:`between ${r} and ${n}`;throw new Error(`Function "${e}" expects ${o} arguments, received ${t}`)}chunkDPD6ZWL2_js.a(Od,"validateArity");function _d(e,t){switch(e){case "concat":return t.filter(r=>r!=null).map(String).join("");case "sum":return xe(t)?Gn(t).reduce((r,n)=>r+n,0):null;case "avg":{if(!xe(t))return null;let r=Gn(t);return r.length>0?r.reduce((n,o)=>n+o,0)/r.length:null}case "count":return de(t[0]).length;case "min":return Go(t,"min");case "max":return Go(t,"max");case "earliest":return Wn(t,"min");case "latest":return Wn(t,"max");case "unique":return Ko(de(t[0]));case "first":return de(t[0]).find(r=>r!=null)??null;case "percent_empty":return Wo(t[0],true);case "percent_not_empty":return Wo(t[0],false);case "count_empty":return de(t[0]).filter(chunk5QAE5NPN_js.a).length;case "count_not_empty":return de(t[0]).filter(r=>!chunk5QAE5NPN_js.a(r)).length;case "count_unique":return Ko(de(t[0])).length;default:return e}}chunkDPD6ZWL2_js.a(_d,"evaluateCall");function Gn(e){return At(e).map(Ie).filter(t=>t!==null)}chunkDPD6ZWL2_js.a(Gn,"numericValues");function xe(e){let t=new Set;for(let r of At(e))Yn(r)&&t.add(Jo(r));return t.size<=1}chunkDPD6ZWL2_js.a(xe,"areCommensurable");function Jo(e){return e.code.toUpperCase()}chunkDPD6ZWL2_js.a(Jo,"currencyCode");function ht(e,t,r){if(!xe([e,t]))return null;let n=Ie(e),o=Ie(t);if(n===null||o===null)return null;let a=r(n,o);return Number.isFinite(a)?a:null}chunkDPD6ZWL2_js.a(ht,"numericBinary");function Go(e,t){if(!xe(e))return null;let r=Gn(e);return r.length>0?t==="min"?Math.min(...r):Math.max(...r):Wn(e,t)}chunkDPD6ZWL2_js.a(Go,"minMax");function Wn(e,t){let r=At(e).map(Kn).filter(a=>a!==null);if(r.length===0)return null;let n=r.map(a=>a.getTime()),o=t==="min"?Math.min(...n):Math.max(...n);return new Date(o).toISOString()}chunkDPD6ZWL2_js.a(Wn,"dateMinMax");function Wo(e,t){let r=de(e);return r.length===0?0:r.filter(o=>chunk5QAE5NPN_js.a(o)===t).length/r.length}chunkDPD6ZWL2_js.a(Wo,"percentByEmptyState");function Ko(e){let t=new Set,r=[];for(let n of e){if(chunk5QAE5NPN_js.a(n))continue;let o=Pd(n);t.has(o)||(t.add(o),r.push(n));}return r}chunkDPD6ZWL2_js.a(Ko,"uniqueNonEmpty");function de(e){return e==null?[]:Array.isArray(e)?At(e):[e]}chunkDPD6ZWL2_js.a(de,"collectionItems");function At(e){return e.flat(Number.POSITIVE_INFINITY)}chunkDPD6ZWL2_js.a(At,"flatten");function Ie(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return Yn(e)&&Number.isFinite(e.value)?e.value:null}chunkDPD6ZWL2_js.a(Ie,"toFiniteNumber");function Yn(e){return typeof e=="object"&&e!==null&&typeof e.value=="number"&&typeof e.code=="string"}chunkDPD6ZWL2_js.a(Yn,"isCurrencyValue");function Kn(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e!="string"){let r=fe(e);if(r===null)return null;let n=new Date(r);return Number.isNaN(n.getTime())?null:n}let t=new Date(e);return Number.isNaN(t.getTime())?null:t}chunkDPD6ZWL2_js.a(Kn,"toDate");function Pd(e){if(Yn(e))return `currency:${Jo(e)}:${e.value}`;let t=Ie(e);return t!==null?`number:${t}`:e instanceof Date?`date:${e.toISOString()}`:`${typeof e}:${JSON.stringify(e)}`}chunkDPD6ZWL2_js.a(Pd,"uniqueKey");function Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Yo,"isPlainRecord");function Fd(e,t,r){if(e==null)return null;let n=chunkDPD6ZWL2_js.a(o=>typeof o=="string"||typeof o=="number"||typeof o=="boolean"||o instanceof Date?String(o):null,"stringifyScalar");switch(t){case "number":{let o=typeof e=="number"?e:Number(e);return Number.isNaN(o)?null:r!==void 0?Number(o.toFixed(r)):o}case "boolean":return !!e;case "date":return e instanceof Date?e.toISOString():typeof e=="string"?e:null;case "text":return String(e);case "select":if(Array.isArray(e)){for(let o of e){if(o==null)continue;let a=n(o);if(a!==null)return a}return null}return n(e);case "multiselect":return Array.isArray(e)?e.flatMap(o=>{if(o==null)return [];let a=n(o);return a===null?[]:[a]}):n(e)===null?[]:[String(e)];default:{let o=t;throw new Error(`Unsupported computed return type: ${o}`)}}}chunkDPD6ZWL2_js.a(Fd,"formatComputedResult");function Sw(e,t){return J(e,t)}chunkDPD6ZWL2_js.a(Sw,"evaluateComputedAst");function vw(e,t){return J(chunk47EGJRW7_js.e(e),t)}chunkDPD6ZWL2_js.a(vw,"evaluateComputedFormula");function Rw(e,t,r,n){try{let o=J(chunk47EGJRW7_js.e(e),t);return {value:r?Fd(o,r,n):o}}catch(o){return {value:null,error:o instanceof Error?o.message:String(o)}}}chunkDPD6ZWL2_js.a(Rw,"evaluateComputedFormulaWithResult");var Cw=[{name:"if",signature:"if(condition, then, else)",description:"Conditional value",category:"logic",example:"if(amount > 100, 'big', 'small')"},{name:"concat",signature:"concat(a, b, ...)",description:"Join values into text",category:"text",example:"concat(firstName, ' ', lastName)"},{name:"sum",signature:"sum(collection)",description:"Total of values",category:"number",example:"sum(orders.amount)"},{name:"avg",signature:"avg(collection)",description:"Average of values",category:"number",example:"avg(orders.amount)"},{name:"min",signature:"min(collection)",description:"Smallest value",category:"number",example:"min(orders.amount)"},{name:"max",signature:"max(collection)",description:"Largest value",category:"number",example:"max(orders.amount)"},{name:"count",signature:"count(collection)",description:"Number of items",category:"collection",example:"count(orders)"},{name:"count_empty",signature:"count_empty(collection)",description:"Items with no value",category:"collection",example:"count_empty(orders.note)"},{name:"count_not_empty",signature:"count_not_empty(collection)",description:"Items with a value",category:"collection",example:"count_not_empty(orders.note)"},{name:"count_unique",signature:"count_unique(collection)",description:"Distinct values",category:"collection",example:"count_unique(orders.status)"},{name:"percent_empty",signature:"percent_empty(collection)",description:"Fraction with no value",category:"collection",example:"percent_empty(orders.note)"},{name:"percent_not_empty",signature:"percent_not_empty(collection)",description:"Fraction with a value",category:"collection",example:"percent_not_empty(orders.note)"},{name:"unique",signature:"unique(collection)",description:"Distinct values as a list",category:"collection",example:"unique(orders.status)"},{name:"first",signature:"first(collection)",description:"First non-empty value",category:"collection",example:"first(orders.status)"},{name:"earliest",signature:"earliest(collection)",description:"Earliest date",category:"date",example:"earliest(orders.closeDate)"},{name:"latest",signature:"latest(collection)",description:"Latest date",category:"date",example:"latest(orders.closeDate)"}];var Xo=chunkDPD6ZWL2_js.a(e=>chunk5QAE5NPN_js.a(e)||Array.isArray(e)&&e.length===0,"isEmpty"),V=chunkDPD6ZWL2_js.a(e=>e==null?"":String(e),"toStr"),xt=chunkDPD6ZWL2_js.a(e=>{if(chunk5QAE5NPN_js.a(e))return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},"toNum"),It=chunkDPD6ZWL2_js.a(e=>{if(e==null)return null;let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t},"toDate"),Tt=chunkDPD6ZWL2_js.a(e=>Array.isArray(e)?e:e==null?[]:[e],"toArr"),Vd=chunkDPD6ZWL2_js.a((e,t,r)=>{let n=xt(e),o=xt(t);return n!==null&&o!==null&&r(n,o)},"compareNumbers"),jd=chunkDPD6ZWL2_js.a((e,t,r)=>{let n=It(e),o=It(t);return n!==null&&o!==null&&r(n.getTime(),o.getTime())},"compareDates"),Zo=chunkDPD6ZWL2_js.a((e,t,r)=>{if(r.type==="number"||r.type==="currency"){let n=xt(e),o=xt(t);if(n!==null&&o!==null)return n===o}return V(e)===V(t)},"equalsForAttr");function _w(e,t){return e?e==="checkbox":typeof t=="boolean"}chunkDPD6ZWL2_js.a(_w,"isCheckboxEquality");var wt=chunkDPD6ZWL2_js.a(e=>({appliesTo:["number","currency","date","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((t,r,n)=>n.type==="date"?jd(t,r,e):Vd(t,r,e),"evaluateInMemory")}),"orderingSpec"),St={is:{appliesTo:["text","phone","number","currency","checkbox","status","select","date","user","relation","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t,r)=>r.type==="checkbox"?e===true==(t===true):Zo(e,t,r),"evaluateInMemory")},is_not:{appliesTo:["text","phone","number","currency","status","select","date","user","relation","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t,r)=>!Zo(e,t,r),"evaluateInMemory")},contains:{appliesTo:["text","phone","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().includes(V(t).toLowerCase()),"evaluateInMemory")},not_contains:{appliesTo:["text","phone","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>!V(e).toLowerCase().includes(V(t).toLowerCase()),"evaluateInMemory")},starts_with:{appliesTo:["text","phone"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().startsWith(V(t).toLowerCase()),"evaluateInMemory")},ends_with:{appliesTo:["text"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().endsWith(V(t).toLowerCase()),"evaluateInMemory")},is_empty:{appliesTo:["text","richtext","number","phone","currency","status","select","date","multiselect","location","user","relation","formula","document"],evaluateInMemory:chunkDPD6ZWL2_js.a(e=>Xo(e),"evaluateInMemory")},is_not_empty:{appliesTo:["text","richtext","number","phone","currency","status","select","date","multiselect","location","user","relation","formula","document"],evaluateInMemory:chunkDPD6ZWL2_js.a(e=>!Xo(e),"evaluateInMemory")},less_than:wt((e,t)=>e<t),greater_than:wt((e,t)=>e>t),less_or_equal:wt((e,t)=>e<=t),greater_or_equal:wt((e,t)=>e>=t),is_within:{appliesTo:["date"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=It(e),n=chunkSDOYGWU4_js.Q(t);return r&&n?r.getTime()>=n.startMs&&r.getTime()<n.endMs:false},"evaluateInMemory")},on_day_month:{appliesTo:["date"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=It(e);if(!r)return false;let n=t;return r.getMonth()+1===n.month&&r.getDate()===n.day},"evaluateInMemory")},any_of:{appliesTo:["status","select","multiselect","user","relation"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=Tt(t).map(V);return Tt(e).map(V).some(o=>r.includes(o))},"evaluateInMemory")},none_of:{appliesTo:["status","select","multiselect","user","relation"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=Tt(t).map(V);return !Tt(e).map(V).some(o=>r.includes(o))},"evaluateInMemory")}};var Md=chunkDPD6ZWL2_js.a((e,t)=>({id:`system:${e}`,name:e,label:e,type:t,system:true}),"systemAttribute"),Ld=[...Object.entries(chunkSDOYGWU4_js.T).map(([e,t])=>Md(e,t))];function zw(e,t,r){let n=t;return Bd(e,{...t.values,id:t.id,objectId:t.objectId,objectName:n.objectName,tenantId:n.tenantId,label:t.label,createdAt:t.createdAt,updatedAt:t.updatedAt,createdBy:t.createdBy,lastUpdatedBy:t.lastUpdatedBy,deletedAt:t.deletedAt,deletedBy:t.deletedBy,visibility:t.visibility,ownedBy:t.ownedBy},[...r,...Ld])}chunkDPD6ZWL2_js.a(zw,"evaluateRecordFilterState");function Bd(e,t,r){if(e.rules.length===0)return true;let n=new Map(r.map(a=>[a.name,a])),o=e.combinator==="or"?"some":"every";return e.rules[o](a=>Ud(a,t,n))}chunkDPD6ZWL2_js.a(Bd,"evaluateFilterState");function Ud(e,t,r){let n=r.get(e.attribute);if(!n)return false;if(e.property&&n.type==="location"){if(!(chunkSDOYGWU4_js.g(e.property)&&chunkSDOYGWU4_js.h(e.operator)))return false;let l=St[e.operator];if(!l)return false;let p=t[e.attribute],I=typeof p=="object"&&p!==null?p[e.property]:void 0;return Hn(l,"text",e.operator,I,e.value,n)}if(e.property){let l=Yi(n).find(j=>j.name===e.property);if(!l)return false;let p=chunkSDOYGWU4_js.I(e.operator),I=St[p];if(!I?.appliesTo.includes(l.type))return false;let X=t[e.attribute],ae=(Array.isArray(X)?X:X==null?[]:[X]).some(j=>{if(typeof j!="object"||j===null)return false;let Y=j.props;return typeof Y!="object"||Y===null?false:Hn(I,l.type,p,Y[e.property],e.value,l)});return (e.quantifier??chunkSDOYGWU4_js.H(e.operator))==="none"?!ae:ae}let o=St[e.operator];if(!o||!o.appliesTo.includes(n.type))return false;let a=t[e.attribute],s=n.type==="relation"||n.type==="document"||n.type==="user"?zd(a):a;return Hn(o,n.type,e.operator,s,e.value,n)}chunkDPD6ZWL2_js.a(Ud,"evaluateRule");function Hn(e,t,r,n,o,a){let[s,l]=$d(t,r,n,o);return t==="phone"&&l===""&&r==="contains"?false:t==="phone"&&l===""&&r==="not_contains"?true:e.evaluateInMemory(s,l,a)}chunkDPD6ZWL2_js.a(Hn,"evaluateNormalizedComparands");function $d(e,t,r,n){return e==="date"&&(t==="is"||t==="is_not")?[ea(r),ea(n)]:e==="phone"?qd(r,n):[ta(e,r),ta(e,n)]}chunkDPD6ZWL2_js.a($d,"normalizeOperatorComparands");function ea(e){let t=Z(e)?fe(e):e;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.toISOString().slice(0,10);if(typeof t!="string"||t==="")return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t))return t;let r=new Date(t);return Number.isNaN(r.getTime())?null:r.toISOString().slice(0,10)}chunkDPD6ZWL2_js.a(ea,"normalizeUtcCalendarDay");function qd(e,t){let r=typeof t=="object"&&t!==null?t:{},n=typeof r.countryCode=="string"?r.countryCode:void 0,o=chunkDPD6ZWL2_js.a(a=>{let s=typeof a=="object"&&a!==null?a:{phoneNumber:a};if(typeof s.phoneNumber!="string")return null;if(!n)return chunkGXSNLYRR_js.a(s.phoneNumber);let l=typeof s.countryCode=="string"?s.countryCode:n;return `${l}:${chunkGXSNLYRR_js.b(s.phoneNumber,l)}`},"normalizeOne");return [o(e),o(t)]}chunkDPD6ZWL2_js.a(qd,"normalizePhoneComparands");function ta(e,t){return e==="currency"?chunkSDOYGWU4_js.F(t):e==="date"?Z(t)?fe(t):t instanceof Date?Number.isNaN(t.getTime())?null:t.toISOString():t:t}chunkDPD6ZWL2_js.a(ta,"normalizeComparableValue");function zd(e){let t=chunkDPD6ZWL2_js.a(r=>typeof r!="object"||r===null?r:r.id,"normalizeOne");return Array.isArray(e)?e.map(t):t(e)}chunkDPD6ZWL2_js.a(zd,"normalizeReferenceIds");var ra="today";function vt(e,t){return new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}chunkDPD6ZWL2_js.a(vt,"dateInTimezone");function Gd(e,t){if(!("defaultValue"in e))return;let{defaultValue:r}=e;return e.type!=="date"||r!==ra?r:e.includeTime?t.now.toISOString():vt(t.now,t.timezone)}chunkDPD6ZWL2_js.a(Gd,"resolveAttributeDefaultValue");function Xw(e,t,r){if(e.combinator==="or"&&e.rules.length>1)return {};let n=new Map(t.map(a=>[a.name,a])),o={};for(let a of e.rules){if(a.property!==void 0||Object.hasOwn(o,a.attribute))continue;let s=n.get(a.attribute);if(!s)continue;let l=Wd(a,r);l!==void 0&&(o[a.attribute]=chunkSDOYGWU4_js.j(s).storage.cardinality==="many"?[l]:l);}return o}chunkDPD6ZWL2_js.a(Xw,"deriveCreateDefaultsFromFilters");function Wd(e,t){if(e.operator==="is")return chunkSDOYGWU4_js.B(e.value)?na(e.value,t):e.value===null||Array.isArray(e.value)?void 0:e.value;if(e.operator==="any_of"){if(!Array.isArray(e.value)||e.value.length!==1)return;let r=e.value[0];return chunkSDOYGWU4_js.B(r)?na(r,t):r}}chunkDPD6ZWL2_js.a(Wd,"extractDeterministicValue");function na(e,t){if(t){if(e.dynamic==="actor")return t.userId;if(e.anchor==="today")return vt(t.now,t.timezone);if(e.anchor==="now")return t.now.toISOString()}}chunkDPD6ZWL2_js.a(na,"resolveDynamicValue");var tx={status:"connector_status",error:"connector_error",provider:"connector_provider"};var Kd=(t=>(t.Desktop="desktop",t))(Kd||{});var ix=["force","skip"],ox=["none","all","external_only"],ax="x-fake-signature",sx={override:null,status:"none",failureReason:null,botId:null};var Yd=/^Session \d+$/;function ia(e){let t=e.replace(/\s+/g," ").trim().replace(/[.!?]+$/,"");return t?t.length>60?`${t.slice(0,59).trimEnd()}...`:t:"New conversation"}chunkDPD6ZWL2_js.a(ia,"buildAgentFallbackTitle");function Hd(e){let t=e.generated?.trim();return t&&!Yd.test(t)?t:e.firstUserText?ia(e.firstUserText):e.emptyLabel}chunkDPD6ZWL2_js.a(Hd,"conversationDisplayTitle");var Qn=/^[a-z0-9][a-z0-9-]{0,62}$/;function Qd(e){if(!Qn.test(e))throw new chunk72TQRSNX_js.h(`Invalid schema source id "${e}": expected a lowercase slug matching ${Qn}`,[])}chunkDPD6ZWL2_js.a(Qd,"assertSchemaSourceId");function Jd(e){return {label:e.label,description:e.description??null,icon:e.icon??null,config:e.config,default:e.default??false,metadata:e.metadata??null}}chunkDPD6ZWL2_js.a(Jd,"viewSyncPayload");function gx(e){let{attributeRemovals:t,objectRemovals:r,renames:n}=e.destructive;return t.length>0||r.length>0||n.length>0}chunkDPD6ZWL2_js.a(gx,"hasDestructiveEntries");var $={objectAdditions:20,totalMutations:500,serializedBytes:512*1024};function Xn(e){return e instanceof Error?e.message:String(e)}chunkDPD6ZWL2_js.a(Xn,"errorMessage");var Xd=Jt.z.enum(["text","richtext","number","checkbox","date","phone","currency","status","location","select","multiselect","user","relation","formula","rollup","document"]).describe('The attribute\'s data type. Determines which keys `config` accepts and requires: `status`/`select`/`multiselect` need a non-empty `options` array (each `status` option carrying its own `group`); `relation` needs `targets` (non-empty) and `cardinality` ("one" or "many"); `formula` needs `expression` and `returnType`; `rollup` needs `targetAttribute` and `function`. Every other type accepts only the shared presentation keys (`placeholder`, `defaultValue`, `icon`, ...) plus a few type-specific optionals (e.g. `number.decimals`, `date.dateFormat`). An attribute\'s type can never be changed later through this tool \u2014 only through a code migration \u2014 so pick it correctly now.');var ca=Jt.z.string().min(1).superRefine((e,t)=>{try{Ce(e);}catch(r){t.addIssue({code:Jt.z.ZodIssueCode.custom,message:Xn(r)});}}).describe('The attribute\'s machine name \u2014 the record\'s field key, and what `{{ name }}` refers to in a labelExpression. Must be a valid identifier: starts with a letter or underscore, then only letters/digits/underscores ("montantHt", "first_name", "FIRST_NAME" are valid; "first-name", "first name", "123name" are not). Max 63 characters. Cannot be a name reserved by the record shape itself (id, createdAt, updatedAt, createdBy, lastUpdatedBy, objectId, label, embeddingText, values, metadata, deletedAt, deletedBy, schemaVersion).'),Zd=Jt.z.string().min(1).superRefine((e,t)=>{chunkSDOYGWU4_js.A.includes(e)&&t.addIssue({code:Jt.z.ZodIssueCode.custom,message:`"${e}" is a reserved object name (${chunkSDOYGWU4_js.A.join(", ")}) and cannot be used for a new object.`});try{De(e);}catch(r){t.addIssue({code:Jt.z.ZodIssueCode.custom,message:Xn(r)});}}).describe(`The new object's machine name: kebab-case slug, lowercase letters/digits/hyphens only, starting with a letter ("products", "user-profiles", "order-items" are valid; "Products", "userProfiles", "user_profiles" are not). Max 63 characters. Cannot be a name the platform reserves for its own system objects, and cannot already exist.`);function pa(e){return e.superRefine((t,r)=>{try{let n=chunk47EGJRW7_js.n(t.type,{...t.config??{},description:t.description}),o=Object.keys(t.config??{}).filter(a=>!Object.hasOwn(n,a));o.length>0&&r.addIssue({code:"unrecognized_keys",keys:o,path:["config"],message:`Unrecognized attribute config key${o.length===1?"":"s"}: ${o.join(", ")}`});}catch(n){if(n instanceof chunk72TQRSNX_js.h){for(let o of n.errors)r.addIssue({code:Jt.z.ZodIssueCode.custom,path:["config",...o.path.map(a=>/^\d+$/.test(a)?Number(a):a)],message:`Config for type "${t.type}" is invalid or incomplete: ${o.message}`});return}r.addIssue({code:Jt.z.ZodIssueCode.custom,path:["config"],message:`Config for type "${t.type}" is invalid or incomplete: ${Xn(n)}`});}})}chunkDPD6ZWL2_js.a(pa,"withConfigCheck");var ma=Jt.z.object({objectName:Jt.z.string().min(1).describe("Name of the existing (or, elsewhere in the same plan, newly created) object this attribute is added to. Ignored for an attribute declared inline in `additive.objects[].attributes` \u2014 there the parent object's own `name` is used instead."),name:ca,label:Jt.z.string().min(1).max(128).describe("Human-readable display label shown in the UI. 1-128 characters, cannot be empty."),type:Xd,config:Jt.z.record(Jt.z.string(),Jt.z.unknown()).optional().describe('Type-specific configuration; required keys depend on `type` (see `type`\'s description). Shared optional keys on every type: `placeholder`, `defaultValue`, `icon`, `order`, `hidden`, `archived`, `deprecated`, `metadata`. Per-type keys: `text` \u2014 `multiline`, `minLength`, `maxLength`, `pattern`, `format` ("email"|"url"|"slug"); `number` \u2014 `renderAs` ("number"|"rating"), `min`, `max`, `unit`, `decimals`; `date` \u2014 `dateFormat`, `minDate`, `maxDate`, `includeTime`, `endDate`, `timeFormat` ("12h"|"24h"); `phone` \u2014 `defaultCountryCode` (3-letter); `currency` \u2014 `defaultCurrency`, `allowedCurrencies`, `allowNegative`; `status`/`select`/`multiselect` \u2014 `options` (REQUIRED, non-empty array of `{ value, label, color }`, unique `value`s; for `status` every OPTION also carries `group` as idle|in_progress|finished \u2014 `group` belongs on each option, never on `config` itself; select/multiselect accept `renderAs: "badges"`); `location` \u2014 `granularity`, `defaultCountry`, `allowedCountries`; `user` \u2014 `types` ("user"|"agent"), `multiple`; `relation` \u2014 `targets` (REQUIRED, non-empty array of `{ object }`) and `cardinality` (REQUIRED, "one"|"many"); `formula` \u2014 `expression` (REQUIRED formula string) and `returnType` (REQUIRED); `rollup` \u2014 `targetAttribute` (REQUIRED) and `function` (REQUIRED, e.g. "sum"|"avg"|"count"); `document` \u2014 `properties`, `accepts`, `maxFileSize`. Omit entirely for `richtext`/`checkbox`, which take no type-specific keys.'),required:Jt.z.boolean().optional().describe("Whether the attribute must have a value on every record. Defaults to false (optional)."),description:Jt.z.string().optional().describe("Help text shown under the field in the UI. Not the same as the plan's `summary`.")}).strict(),ec=pa(ma),tc=pa(ma.omit({objectName:true})),rc=Jt.z.object({name:Zd,label:Jt.z.string().min(1).describe('Human-readable singular display label (e.g. "Devis").'),pluralLabel:Jt.z.string().optional().describe('Human-readable plural display label (e.g. "Devis"/"Invoices"). Defaults from `label` if omitted.'),description:Jt.z.string().optional().describe("Help text describing what this object represents."),icon:chunk47EGJRW7_js.c.describe("Required icon name for the object. Must be a catalogue value \u2014 call `search_icons` and use a name it returns verbatim. A name that is not in the catalogue is rejected without any hint as to what would have worked, so never guess one."),labelExpression:be.describe('Template used to render a human-readable label for every record of this object \u2014 e.g. shown in relations, search results, and breadcrumbs. MUST contain at least one `{{ attributeName }}` interpolation referencing an attribute this object will actually have (either declared in this same `attributes` array, or an existing attribute if this is an update) \u2014 a plain string with no `{{ }}` at all (e.g. "Devis") is rejected. Interpolations cannot be empty (`{{ }}` is rejected) and only these pipes are allowed: UPPER, LOWER, capitalize, trim, prefix:"...", suffix:"...", wrap:"..." "...", default:"...". `{{ a || b }}` falls back to `b` when `a` is empty. Examples: "{{ firstName }} {{ lastName }}", "{{ numero | UPPER }}", "{{ name || reference }}".'),attributes:Jt.z.array(tc).default([]).describe("Attributes to create on this new object, inline. Same rules as a standalone entry in `additive.attributes`, minus `objectName` (implied by this object). At least one attribute referenced by `labelExpression` should be included here.")}).strict(),fa=Jt.z.object({attributeRemovals:Jt.z.array(Jt.z.object({objectName:Jt.z.string().min(1).describe("Object the attribute is removed from."),attributeName:Jt.z.string().min(1).describe("Attribute to delete, together with every record's stored value for it. Must not be a system (code-declared) attribute, and must not be referenced by the object's own `labelExpression` or `embeddingExpression` \u2014 update those first.")}).strict()).default([]).describe("Attributes to permanently delete. Irreversible: record values for the attribute are purged."),objectRemovals:Jt.z.array(Jt.z.object({objectName:Jt.z.string().min(1).describe("Object to delete entirely, together with all its records. Must not be a system (code-declared) object, and must not still be targeted by a `relation` attribute on another object \u2014 retarget or remove that relation first.")}).strict()).default([]).describe("Objects to permanently delete, records included. Irreversible."),renames:Jt.z.array(Jt.z.object({objectName:Jt.z.string().min(1).describe("Object the renamed attribute belongs to."),from:Jt.z.string().min(1).describe("Current attribute name. Must already exist and not be a system attribute."),to:ca.describe("New attribute name \u2014 same identifier rules as any attribute `name` (see `name` on a planned attribute), and must not collide with another name already on the object, including one added elsewhere in this same plan.")}).strict()).default([]).describe("Attribute renames. Every reference to the old name (labelExpression, views, formulas) must be updated separately \u2014 a rename does not follow references automatically.")}).strict().default({attributeRemovals:[],objectRemovals:[],renames:[]}),ba=Jt.z.string().min(1).describe("ONE sentence naming the intent of the change \u2014 what it is for, not what it contains. The human approving it has already watched every entry land in the preview window and can read every row of the plan itself, so a recap tells them nothing they do not have. A second sentence is warranted only when `destructive` is non-empty: say plainly what will be lost (e.g. 'deletes the \"ancienMontant\" column and its data on every devis'). Never restate the plan \u2014 explain intent."),oa="The COMPLETE config this view should end up with \u2014 not a patch. Copy the baseline returned by get_default_view and edit it, preserving every tab and setting you are not changing: anything you omit is dropped. To change the columns shown, set `tabs[].columns` (an array of attribute names) \u2014 there is no top-level `columns` on either view type. For a detail view's side panel, set `sidePanel.attributes`. Every attribute name listed must already exist on the object, or be created earlier in this same plan. ONE EXCEPTION to omit-is-dropped: a tab with `type: \"custom\"` renders a component belonging to the application, which you cannot describe or recreate. Copy every such tab through from the baseline exactly as it came, `name`, `component` and `props` untouched \u2014 dropping one, inventing one, or altering any of those three is rejected rather than applied (`name` is the tab's address in links, not its wording). Its `label` and `icon` you may change.",aa="Opaque token returned by get_default_view alongside the baseline you edited. REQUIRED when the object already exists \u2014 it proves you authored against the baseline that is still current. Must be OMITTED when this plan creates the object, which has no baseline yet.",sa=Jt.z.string().min(1).describe("Name of the object whose default view of this type is replaced. Not a view name \u2014 a plan can only replace an object's deterministic default view, never create a view or target a non-default one."),nc=Jt.z.discriminatedUnion("viewType",[Jt.z.object({objectName:sa,viewType:Jt.z.literal("list").describe("Targets the object's default list view (the grid)."),canonicalConfig:chunkSDOYGWU4_js.ka.describe(oa),baselineToken:Jt.z.string().min(1).optional().describe(aa)}).strict(),Jt.z.object({objectName:sa,viewType:Jt.z.literal("detail").describe("Targets the object's default detail view (the single-record view)."),canonicalConfig:chunkSDOYGWU4_js.la.describe(oa),baselineToken:Jt.z.string().min(1).optional().describe(aa)}).strict()]);var ua=Jt.z.string().regex(/^[0-9a-f]{64}$/,"Expected a lowercase SHA-256 hash"),la={baseConfigHash:ua.nullable(),targetConfigHash:ua,baselineOrigin:Jt.z.enum(["persisted","generated","absent"])},ic=Jt.z.discriminatedUnion("viewType",[Jt.z.object({objectName:Jt.z.string().min(1),viewType:Jt.z.literal("list"),canonicalConfig:chunkSDOYGWU4_js.ka,...la}).strict(),Jt.z.object({objectName:Jt.z.string().min(1),viewType:Jt.z.literal("detail"),canonicalConfig:chunkSDOYGWU4_js.la,...la}).strict()]).superRefine((e,t)=>{let r=e.baselineOrigin!=="absent";r!==(e.baseConfigHash!==null)&&t.addIssue({code:"custom",path:["baseConfigHash"],message:r?`A ${e.baselineOrigin} baseline requires baseConfigHash`:"An absent baseline requires baseConfigHash to be null"});});function ga(e){return Jt.z.object({objects:Jt.z.array(rc).default([]).describe("New objects to create, with their attributes inline."),attributes:Jt.z.array(ec).default([]).describe("Attributes to add to existing or same-plan objects."),viewUpdates:Jt.z.array(e).default([]).describe("Complete target configs for deterministic default views; never view names.")}).strict().default({objects:[],attributes:[],viewUpdates:[]})}chunkDPD6ZWL2_js.a(ga,"buildAdditiveSchema");function Jn(e,t=[],r=new WeakSet){if(e===null||typeof e=="string"||typeof e=="boolean")return null;if(typeof e=="number")return Number.isFinite(e)?null:{path:t,message:"Plan input contains a non-finite number"};if(typeof e!="object")return {path:t,message:"Plan input must contain only JSON-safe values"};if(r.has(e))return {path:t,message:"Plan input cannot contain circular references"};if(Array.isArray(e)){r.add(e);for(let s of Reflect.ownKeys(e))if(s!=="length"&&(typeof s=="symbol"||!/^(0|[1-9]\d*)$/.test(s)))return r.delete(e),{path:[...t,s],message:"Plan input arrays cannot contain non-index JSON properties"};for(let s=0;s<e.length;s++){if(!Object.hasOwn(e,s))return r.delete(e),{path:[...t,s],message:"Plan input cannot contain sparse arrays"};let l=Jn(e[s],[...t,s],r);if(l)return r.delete(e),l}return r.delete(e),null}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return {path:t,message:"Plan input must contain only plain JSON objects"};r.add(e);let o=e,a=Reflect.ownKeys(o);for(let s of a){let l=Object.getOwnPropertyDescriptor(o,s);if(typeof s=="symbol"||!(l?.enumerable&&"value"in l))return r.delete(e),{path:[...t,s],message:"Plan input objects must contain enumerable JSON data properties only"}}for(let s of a.sort()){let l=Jn(o[s],[...t,s],r);if(l)return r.delete(e),l}return r.delete(e),null}chunkDPD6ZWL2_js.a(Jn,"findJsonSafetyIssue");function oc(e){let t=[];return e.additive.objects.forEach((r,n)=>{t.push(["additive","objects",n]),r.attributes.forEach((o,a)=>{t.push(["additive","objects",n,"attributes",a]);});}),e.additive.attributes.forEach((r,n)=>{t.push(["additive","attributes",n]);}),e.additive.viewUpdates.forEach((r,n)=>{t.push(["additive","viewUpdates",n]);}),e.destructive.attributeRemovals.forEach((r,n)=>{t.push(["destructive","attributeRemovals",n]);}),e.destructive.objectRemovals.forEach((r,n)=>{t.push(["destructive","objectRemovals",n]);}),e.destructive.renames.forEach((r,n)=>{t.push(["destructive","renames",n]);}),t}chunkDPD6ZWL2_js.a(oc,"mutationPaths");function ya(e,t){e.additive.objects.length>$.objectAdditions&&t.addIssue({code:"too_big",origin:"array",maximum:$.objectAdditions,inclusive:true,path:["additive","objects",$.objectAdditions],message:`A schema plan can add at most ${$.objectAdditions} objects`});let r=oc(e);r.length>$.totalMutations&&t.addIssue({code:"too_big",origin:"array",maximum:$.totalMutations,inclusive:true,path:r[$.totalMutations],message:`A schema plan can contain at most ${$.totalMutations} mutations; received ${r.length}`});}chunkDPD6ZWL2_js.a(ya,"addPlanLimitIssues");function ha(e,t){let r=Jn(e);if(r)return t.addIssue({code:"custom",path:r.path,message:r.message}),Jt.z.NEVER;let n=new TextEncoder().encode(chunkLQYUPOWB_js.a(e)).byteLength;return n>$.serializedBytes?(t.addIssue({code:"too_big",origin:"string",maximum:$.serializedBytes,inclusive:true,path:[],message:`A schema plan can serialize to at most ${$.serializedBytes} UTF-8 bytes; received ${n}`}),Jt.z.NEVER):e}chunkDPD6ZWL2_js.a(ha,"boundSerializedPlanInput");var ac=ga(nc),sc=ga(ic),da=Jt.z.object({schemaPlanVersion:Jt.z.literal(2).describe("Required proposal contract version."),summary:ba,additive:ac,destructive:fa}).strict().superRefine((e,t)=>{let r=new Set(e.additive.objects.map(n=>n.name));e.additive.viewUpdates.forEach((n,o)=>{let a=["additive","viewUpdates",o,"baselineToken"];if(r.has(n.objectName)){n.baselineToken!==void 0&&t.addIssue({code:"custom",path:a,message:"A view target for an object added by this plan must not include baselineToken"});return}n.baselineToken===void 0&&t.addIssue({code:"custom",path:a,message:"A view target for an existing object requires baselineToken"});}),ya(e,t);}),Dx=Object.assign(Jt.z.preprocess(ha,da),{shape:da.shape}),uc=Jt.z.object({schemaPlanVersion:Jt.z.literal(2),summary:ba,additive:sc,destructive:fa}).strict().superRefine(ya),Cx=Jt.z.preprocess(ha,uc);var A=Jt.z.number().finite().nonnegative(),Ta=Jt.z.enum(Li),Zn=Jt.z.enum(Bi),ei=Jt.z.enum(Ui),wa=Jt.z.object({provider:Ta,model:Jt.z.string().min(1)}).strict(),Fx=Jt.z.object({speed:Zn.optional(),reasoning:ei.optional()}).strict(),xa=Jt.z.string().regex(/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9._-]*$/),lc=Jt.z.object({model:wa.optional(),speed:Zn.optional(),reasoning:ei.optional(),imageModel:xa.optional()}).strict(),Vx=lc.refine(e=>e.model!==void 0||e.speed!==void 0||e.reasoning!==void 0||e.imageModel!==void 0,{message:"At least one inference override is required"}),jx=Jt.z.object({model:wa.nullable().optional(),speed:Zn.nullable().optional(),reasoning:ei.nullable().optional(),imageModel:xa.nullable().optional()}).strict().refine(e=>Object.keys(e).length>0&&Object.values(e).every(t=>t!==void 0),{message:"At least one inference override is required"}),Ia=Jt.z.object({label:Jt.z.string(),denied:Jt.z.boolean().optional(),deletion:Jt.z.object({target:Jt.z.string().optional(),count:A.optional(),restorableDays:A.optional()}).strict().optional(),counts:Jt.z.record(Jt.z.string(),A).optional(),warnings:Jt.z.array(Jt.z.string()).optional()}).strict(),dc=Jt.z.union([Jt.z.object({type:Jt.z.literal("text"),text:Jt.z.string()}).strict(),Jt.z.object({type:Jt.z.literal("reasoning"),text:Jt.z.string()}).strict(),Jt.z.object({type:Jt.z.literal("system"),code:Jt.z.enum(qt)}).strict(),Jt.z.object({type:Jt.z.literal("error"),error:Jt.z.string(),errorClass:Jt.z.string().optional()}).strict(),Jt.z.object({type:Jt.z.literal("tool"),toolCallId:Jt.z.string(),name:Jt.z.string(),args:Jt.z.record(Jt.z.string(),Jt.z.unknown()),result:Jt.z.unknown().optional(),error:Jt.z.string().optional(),errorCode:Jt.z.enum(["output_limit_reached","interrupted"]).optional(),state:Jt.z.enum(["streaming","running","completed","error","approval-requested","approval-responded","approval-dispatched"]),durationMs:A.optional(),approvalId:Jt.z.string().optional(),approvalImpact:Ia.optional(),approved:Jt.z.boolean().optional(),approvalReason:Jt.z.string().optional(),approvalRelaxableByAuto:Jt.z.boolean().optional()}).strict(),Jt.z.object({type:Jt.z.literal("file"),fileId:Jt.z.string(),name:Jt.z.string(),mimeType:Jt.z.string()}).strict(),Jt.z.object({type:Jt.z.literal("compaction"),state:Jt.z.literal("in-progress"),reason:Jt.z.enum(["preflight_threshold","overflow_recovery"]),estimatedTokens:A.optional(),reportedTokens:A.optional()}).strict(),Jt.z.object({type:Jt.z.literal("compaction"),state:Jt.z.literal("completed"),tokensBefore:A,tokensAfter:A,tokensSaved:A,strategy:Jt.z.enum(["no-op","summary","truncation"]),durationMs:A,summary:Jt.z.string().optional()}).strict(),Jt.z.object({type:Jt.z.literal("compaction"),state:Jt.z.literal("failed"),reason:Jt.z.string(),durationMs:A.optional()}).strict()]),cc=Jt.z.object({id:Jt.z.string(),name:Jt.z.string(),mimeType:Jt.z.string(),size:A}).strict(),pc=Jt.z.object({id:Jt.z.string(),type:Jt.z.string().transform(e=>e),entityId:Jt.z.string(),label:Jt.z.string(),objectName:Jt.z.string().optional(),startIndex:A,endIndex:A}).strict(),mc=Jt.z.object({provider:Ta,model:Jt.z.string(),maxTokens:A.optional(),contextWindow:A.optional()}).strict(),fc=Jt.z.union([Jt.z.date(),Jt.z.string().datetime({offset:true}).transform(e=>new Date(e))]),Aa=Jt.z.object({id:Jt.z.string(),sessionId:Jt.z.string(),tenantId:Jt.z.string().optional(),runId:Jt.z.string().optional(),role:Jt.z.enum(["user","assistant","system","tool"]),parts:Jt.z.array(dc),attachments:Jt.z.array(cc).optional(),mentions:Jt.z.array(pc).optional(),model:mc.optional(),tokenUsage:Jt.z.object({input:A,output:A}).strict().optional(),metadata:Jt.z.record(Jt.z.string(),Jt.z.unknown()).optional(),createdAt:fc}).strict(),bc=Jt.z.object({id:Jt.z.string(),description:Jt.z.string(),status:Jt.z.enum(["pending","in_progress","completed","blocked"]),result:Jt.z.string().optional(),updatedAt:A.optional()}).strict(),gc=Jt.z.object({id:Jt.z.string(),sessionId:Jt.z.string(),status:Jt.z.enum(["active","completed","abandoned"]),todos:Jt.z.array(bc),version:A,createdAt:Jt.z.string(),updatedAt:Jt.z.string(),completedAt:Jt.z.string().optional()}).strict(),Sa={"session-named":Jt.z.object({name:Jt.z.string()}).strict(),"compaction-start":Jt.z.object({reason:Jt.z.enum(["preflight_threshold","overflow_recovery"]),estimatedTokens:A.optional(),reportedTokens:A.optional()}).strict(),"compaction-end":Jt.z.object({tokensBefore:A,tokensAfter:A,tokensSaved:A,strategy:Jt.z.enum(["no-op","summary","truncation"]),durationMs:A,summary:Jt.z.string().optional()}).strict(),"compaction-failed":Jt.z.object({reason:Jt.z.string()}).strict(),usage:Jt.z.object({messageId:Jt.z.string().min(1).optional(),inputTokens:A,outputTokens:A,totalTokens:A,cacheReadTokens:A.optional(),cacheCreationTokens:A.optional(),contextWindow:A,residentTokens:A,utilization:Jt.z.number().finite().min(0).max(1),costUsd:A.optional()}).strict(),"message-persisted":Jt.z.object({message:Aa}).strict(),"message-updated":Jt.z.object({message:Aa}).strict(),"todo-plan-update":Jt.z.object({plan:gc}).strict(),"approval-context":Jt.z.object({approvalId:Jt.z.string(),toolCallId:Jt.z.string(),impact:Ia.optional(),relaxableByAuto:Jt.z.boolean().optional()}).strict(),"session-state":Jt.z.object({state:Jt.z.object({phase:Jt.z.enum(["queued","running","parked","terminal"]),parkedOn:Jt.z.enum(["human","agents"]).optional(),humanRequestIds:Jt.z.array(Jt.z.string()).optional(),outcome:Jt.z.enum(["completed","failed","cancelled","timeout","expired"]).optional()}).strict(),version:Jt.z.number().int().positive(),updatedAt:Jt.z.string().datetime({offset:true})}).strict()};function yc(e){return e in Sa}chunkDPD6ZWL2_js.a(yc,"isAgentUIDataName");function hc(e){return new chunk72TQRSNX_js.h("Invalid agent UI message chunk",e.map(t=>({path:t.path.map(String),message:t.message,code:t.code})))}chunkDPD6ZWL2_js.a(hc,"agentUIValidationError");function Ac(e){if(typeof e!="object"||e===null||typeof e.type!="string")throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:"Expected UI message chunk type",code:"invalid_type"}]);let t=e.type;if(!t.startsWith("data-"))throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:"Expected agent data chunk type",code:"invalid_value"}]);let r=t.slice(5);if(!yc(r))throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:`Unknown agent UI data type: ${r}`,code:"invalid_value"}]);let n=Jt.z.object({type:Jt.z.literal(`data-${r}`),id:Jt.z.string().optional(),data:Sa[r],transient:Jt.z.boolean().optional()}).strict().safeParse(e);if(!n.success)throw hc(n.error.issues);return n.data}chunkDPD6ZWL2_js.a(Ac,"assertCustomAgentUIMessageChunk");function Mx(e,t,r){return Ac({type:`data-${e}`,...r?.id!==void 0?{id:r.id}:{},data:t,...r?.transient!==void 0?{transient:r.transient}:{}})}chunkDPD6ZWL2_js.a(Mx,"agentDataChunk");function Rt(e){return e}chunkDPD6ZWL2_js.a(Rt,"defineOperation");function y(e,t,r){let n=t==="atomic"?"none":t==="local"?"if-not-visible":"follow";return o=>{let a=r?.(o);return {impact:t,navigation:n,focus:{...e(o),...a===void 0?{}:{propertyPath:a}}}}}chunkDPD6ZWL2_js.a(y,"definePresentation");var ti={id:Jt.z.string().min(1)},v={...ti,viewId:Jt.z.string().min(1)};function S(e,t,r){if(!e.views.some(n=>n.id===t))throw new chunk72TQRSNX_js.h(`View "${t}" is not in the draftable state`,[]);return {...e,views:e.views.map(n=>n.id===t?r(n):n)}}chunkDPD6ZWL2_js.a(S,"mapView");function Ra(e,t,r){let n=[...e],[o]=n.splice(t,1);return n.splice(r,0,o),n}chunkDPD6ZWL2_js.a(Ra,"moveWithin");function Fe(e,t,r){if(t.length!==e.length)throw new chunk72TQRSNX_js.h(`${r} order lists ${t.length} ids for ${e.length} items`,[]);return t.map(n=>{let o=e.find(a=>a.id===n);if(!o)throw new chunk72TQRSNX_js.h(`${r} "${n}" is not in this collection`,[]);return o})}chunkDPD6ZWL2_js.a(Fe,"reorderById");function ne(e,t,r){let n=e.tabs.find(o=>o.id===t);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t}" is not in view "${e.id}"`,[]);if(n.type!=="form")throw new chunk72TQRSNX_js.h(`Tab "${t}" is not a form tab`,[]);return {...e,tabs:e.tabs.map(o=>o.id===t?r(n):o)}}chunkDPD6ZWL2_js.a(ne,"mapFormTab");function Ct(e,t){let r=e.groups.find(n=>n.id===t);if(!r)throw new chunk72TQRSNX_js.h(`Group "${t}" is not in tab "${e.id}"`,[]);return r}chunkDPD6ZWL2_js.a(Ct,"requireGroup");function ri(e,t){for(let r of e.groups){let n=r.fields.find(o=>o.id===t);if(n)return {group:r,field:n}}throw new chunk72TQRSNX_js.h(`Field slot "${t}" is not in tab "${e.id}"`,[])}chunkDPD6ZWL2_js.a(ri,"locateField");function Et(e){return {viewId:e.viewId}}chunkDPD6ZWL2_js.a(Et,"viewFocus");function Dt(e){return {viewId:e.viewId,tabId:e.tabId}}chunkDPD6ZWL2_js.a(Dt,"tabFocus");function Ea(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.groupId}}chunkDPD6ZWL2_js.a(Ea,"groupFocus");function Da(e){return {viewId:e.viewId,tabId:e.tabId,fieldId:e.fieldId}}chunkDPD6ZWL2_js.a(Da,"fieldFocus");function Ca(e){return {viewId:e.viewId,tabId:e.tab.id}}chunkDPD6ZWL2_js.a(Ca,"addTabFocus");function Na(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.group.id}}chunkDPD6ZWL2_js.a(Na,"addGroupFocus");function ka(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.groupId,fieldId:e.field.id}}chunkDPD6ZWL2_js.a(ka,"addFieldFocus");function Oa(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.toGroupId,fieldId:e.fieldId}}chunkDPD6ZWL2_js.a(Oa,"moveFieldFocus");function Ve(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(Ve,"firstChangedProperty");var Tc=chunkSDOYGWU4_js.ia,wc=chunkSDOYGWU4_js.da,xc=chunkSDOYGWU4_js.ca,Ic=Jt.z.object({...v,type:Jt.z.literal("add_tab"),tab:Tc}),Sc={type:"add_tab",schema:Ic,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(r.tabs.some(n=>n.id===t.tab.id))throw new chunk72TQRSNX_js.h(`Tab "${t.tab.id}" already exists in view "${t.viewId}"`,[]);return {...r,tabs:[...r.tabs,t.tab]}}),"apply"),focus:Ca,presentation:y(Ca,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'onglet \xAB ${e.tab.label} \xBB`,"describe")},vc=Jt.z.object({...v,type:Jt.z.literal("remove_tab"),tabId:Jt.z.string().min(1)}),Rc={type:"remove_tab",schema:vc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(!r.tabs.some(n=>n.id===t.tabId))throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,tabs:r.tabs.filter(n=>n.id!==t.tabId)}}),"apply"),focus:Dt,presentation:y(Dt,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'onglet ${e.tabId}`,"describe")},Ma=Jt.z.object({label:Jt.z.string().min(1).optional(),icon:chunk47EGJRW7_js.c.optional(),order:Jt.z.number().int().optional()}),Ec=Object.keys(Ma.shape),Dc=Jt.z.object({...v,type:Jt.z.literal("update_tab"),tabId:Jt.z.string().min(1),changes:Ma.refine(e=>Object.keys(e).length>0,"update_tab needs at least one change")}),_a=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTabFocus"),Cc={type:"update_tab",schema:Dc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(!r.tabs.some(n=>n.id===t.tabId))throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,tabs:r.tabs.map(n=>n.id===t.tabId?{...n,...t.changes}:n)}}),"apply"),focus:_a,presentation:y(_a,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'onglet en \xAB ${e.changes.label} \xBB`:`Modifie l'onglet ${e.tabId}`,"describe")},Nc=Jt.z.object({...v,type:Jt.z.literal("reorder_tabs"),tabOrder:Jt.z.array(Jt.z.string().min(1))}),kc={type:"reorder_tabs",schema:Nc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,tabs:Fe(r.tabs,t.tabOrder,"Tab")})),"apply"),focus:Et,presentation:y(Et,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les onglets","describe")},Oc=Jt.z.object({...v,type:Jt.z.literal("add_group"),tabId:Jt.z.string().min(1),group:wc}),_c={type:"add_group",schema:Oc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{if(n.groups.some(o=>o.id===t.group.id))throw new chunk72TQRSNX_js.h(`Group "${t.group.id}" already exists in tab "${t.tabId}"`,[]);return {...n,groups:[...n.groups,t.group]}})),"apply"),focus:Na,presentation:y(Na,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute le groupe \xAB ${e.group.label} \xBB`,"describe")},Pc=Jt.z.object({...v,type:Jt.z.literal("remove_group"),tabId:Jt.z.string().min(1),groupId:Jt.z.string().min(1)}),Fc={type:"remove_group",schema:Pc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(Ct(n,t.groupId),{...n,groups:n.groups.filter(o=>o.id!==t.groupId)}))),"apply"),focus:Ea,presentation:y(Ea,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime le groupe ${e.groupId}`,"describe")},Vc=Jt.z.object({...v,type:Jt.z.literal("update_group"),tabId:Jt.z.string().min(1),groupId:Jt.z.string().min(1),changes:Jt.z.object({label:Jt.z.string().min(1).optional(),description:Jt.z.string().optional(),collapsible:Jt.z.boolean().optional(),collapsed:Jt.z.boolean().optional(),order:Jt.z.number().int().optional()}).refine(e=>Object.keys(e).length>0,"update_group needs at least one change")}),Pa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId,groupId:e.groupId}),"updateGroupFocus"),jc={type:"update_group",schema:Vc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(Ct(n,t.groupId),{...n,groups:n.groups.map(o=>o.id===t.groupId?{...o,...t.changes}:o)}))),"apply"),focus:Pa,presentation:y(Pa,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme le groupe en \xAB ${e.changes.label} \xBB`:"Modifie le groupe","describe")},Mc=Jt.z.object({...v,type:Jt.z.literal("reorder_groups"),tabId:Jt.z.string().min(1),groupOrder:Jt.z.array(Jt.z.string().min(1))}),Lc={type:"reorder_groups",schema:Mc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>({...n,groups:Fe(n.groups,t.groupOrder,"Group")}))),"apply"),focus:Dt,presentation:y(Dt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les groupes","describe")},Bc=Jt.z.object({...v,type:Jt.z.literal("add_field"),tabId:Jt.z.string().min(1),groupId:Jt.z.string().min(1),field:xc,index:Jt.z.number().int().min(0).optional()}),Uc={type:"add_field",schema:Bc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{if(Ct(n,t.groupId),n.groups.some(o=>o.fields.some(a=>a.id===t.field.id)))throw new chunk72TQRSNX_js.h(`Field slot "${t.field.id}" already exists in tab "${t.tabId}"`,[]);return {...n,groups:n.groups.map(o=>{if(o.id!==t.groupId)return o;let a=t.index??o.fields.length;return {...o,fields:[...o.fields.slice(0,a),t.field,...o.fields.slice(a)]}})}})),"apply"),focus:ka,presentation:y(ka,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute le champ ${e.field.attribute??e.field.id}`,"describe")},$c=Jt.z.object({...v,type:Jt.z.literal("remove_field"),tabId:Jt.z.string().min(1),fieldId:Jt.z.string().min(1)}),qc={type:"remove_field",schema:$c,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{let{group:o}=ri(n,t.fieldId);return {...n,groups:n.groups.map(a=>a.id===o.id?{...a,fields:a.fields.filter(s=>s.id!==t.fieldId)}:a)}})),"apply"),focus:Da,presentation:y(Da,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Retire le champ ${e.fieldId}`,"describe")},zc=Jt.z.object({...v,type:Jt.z.literal("move_field"),tabId:Jt.z.string().min(1),fieldId:Jt.z.string().min(1),toGroupId:Jt.z.string().min(1),toIndex:Jt.z.number().int().min(0)}),Gc={type:"move_field",schema:zc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{let{group:o,field:a}=ri(n,t.fieldId),s=Ct(n,t.toGroupId);if(o.id===s.id){let l=o.fields.findIndex(p=>p.id===t.fieldId);return {...n,groups:n.groups.map(p=>p.id===o.id?{...p,fields:Ra(p.fields,l,t.toIndex)}:p)}}return {...n,groups:n.groups.map(l=>l.id===o.id?{...l,fields:l.fields.filter(p=>p.id!==t.fieldId)}:l.id===s.id?{...l,fields:[...l.fields.slice(0,t.toIndex),a,...l.fields.slice(t.toIndex)]}:l)}})),"apply"),focus:Oa,presentation:y(Oa,"local"),describe:chunkDPD6ZWL2_js.a(e=>`D\xE9place le champ ${e.fieldId} vers le groupe ${e.toGroupId}`,"describe")},Wc=Jt.z.object({...v,type:Jt.z.literal("update_field"),tabId:Jt.z.string().min(1),fieldId:Jt.z.string().min(1),changes:Jt.z.object({label:Jt.z.string().optional(),readOnly:Jt.z.boolean().optional(),span:Jt.z.number().int().min(1).max(12).optional()}).refine(e=>Object.keys(e).length>0,"update_field needs at least one change")}),Fa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId,fieldId:e.fieldId}),"updateFieldFocus"),Kc={type:"update_field",schema:Wc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(ri(n,t.fieldId),{...n,groups:n.groups.map(o=>({...o,fields:o.fields.map(a=>a.id===t.fieldId?{...a,...t.changes}:a)}))}))),"apply"),focus:Fa,presentation:y(Fa,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>`Modifie le champ ${e.fieldId}`,"describe")},La=Jt.z.object({source:chunkSDOYGWU4_js.ga.optional(),columns:chunkSDOYGWU4_js.X.optional(),filters:chunkSDOYGWU4_js._.nullable().optional(),sorts:chunkSDOYGWU4_js.Z.nullable().optional(),allowCreate:Jt.z.boolean().optional(),allowEdit:Jt.z.boolean().optional(),allowDelete:Jt.z.boolean().optional(),createMode:Jt.z.enum(["redirect","inline","peek"]).optional()}),Yc=Object.keys(La.shape),Ba=Jt.z.object({emailAttributeIds:Jt.z.array(Jt.z.string().min(1)).optional(),attribute:Jt.z.string().min(1).optional(),titleAttribute:Jt.z.string().min(1).nullable().optional(),component:Jt.z.string().nullable().optional(),props:Jt.z.record(Jt.z.string(),Jt.z.unknown()).nullable().optional()}),Hc=Object.keys(Ba.shape),Qc={emailAttributeIds:["emails","meetings"],attribute:["richtext"],titleAttribute:["richtext"],component:["custom"],props:["custom"]},Jc=Jt.z.object({...v,type:Jt.z.literal("update_tab_config"),tabId:Jt.z.string().min(1),changes:Ba.refine(e=>Object.keys(e).length>0,"update_tab_config needs at least one change")}),Va=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTabConfigFocus"),Xc={type:"update_tab_config",schema:Jc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.tabs.find(o=>o.id===t.tabId);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${r.id}"`,[]);for(let o of Object.keys(t.changes)){let a=Qc[o];if(a&&!a.includes(n.type))throw new chunk72TQRSNX_js.h(`"${o}" is not a setting of a "${n.type}" tab`,[])}return {...r,tabs:r.tabs.map(o=>o.id===t.tabId?{...o,...t.changes}:o)}}),"apply"),focus:Va,presentation:y(Va,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>`Configure ${Object.keys(e.changes).join(", ")} sur l'onglet ${e.tabId}`,"describe")},Zc=Jt.z.object({...v,type:Jt.z.literal("update_table_tab"),tabId:Jt.z.string().min(1),changes:La.refine(e=>Object.keys(e).length>0,"update_table_tab needs at least one change")}),ja=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTableTabFocus"),ep={type:"update_table_tab",schema:Zc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.tabs.find(l=>l.id===t.tabId);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${r.id}"`,[]);if(n.type!=="table")throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not a table tab`,[]);let o=Object.entries(t.changes),a=Object.fromEntries(o.filter(([,l])=>l!==null)),s=new Set(o.filter(([,l])=>l===null).map(([l])=>l));return {...r,tabs:r.tabs.map(l=>l.id===t.tabId?Object.fromEntries(Object.entries({...l,...a}).filter(([p])=>!s.has(p))):l)}}),"apply"),focus:ja,presentation:y(ja,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.columns?`Affiche ${e.changes.columns.length} colonne(s) dans l'onglet ${e.tabId}`:`Modifie l'onglet ${e.tabId}`,"describe")},tp=Jt.z.object({...v,type:Jt.z.literal("set_side_panel"),sidePanel:Jt.z.object({attributes:Jt.z.array(Jt.z.string().min(1)),width:Jt.z.number().int().min(1).optional()}).nullable()}),rp={type:"set_side_panel",schema:tp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,config:{...r.config,sidePanel:t.sidePanel??void 0}})),"apply"),focus:Et,presentation:y(Et,"atomic",()=>["config","sidePanel"]),describe:chunkDPD6ZWL2_js.a(e=>e.sidePanel?"Active le panneau lat\xE9ral":"Retire le panneau lat\xE9ral","describe")},Ua=[Sc,Rc,Cc,kc,_c,Fc,jc,Lc,Uc,qc,Gc,Kc,ep,Xc,rp];var je={...v,tabId:Jt.z.string().min(1)};function Nt(e){return {viewId:e.viewId}}chunkDPD6ZWL2_js.a(Nt,"viewFocus");function ie(e){return {viewId:e.viewId,tabId:e.tabId}}chunkDPD6ZWL2_js.a(ie,"tabFocus");function $a(e){return {viewId:e.viewId,tabId:e.tab.id}}chunkDPD6ZWL2_js.a($a,"addTabFocus");function np(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(np,"firstChangedProperty");function za(e){let t={...e};for(let r of chunkSDOYGWU4_js.qa)delete t[r];return t}chunkDPD6ZWL2_js.a(za,"withoutKanbanKeys");function Ga(e){let t={...e};for(let r of chunkSDOYGWU4_js.pa)delete t[r];return t}chunkDPD6ZWL2_js.a(Ga,"withoutTableKeys");function ip(e,t,r,n){let o=chunkSDOYGWU4_js.ja.safeParse(t);if(!o.success){if(!chunkSDOYGWU4_js.ja.safeParse(e).success)return t;let a=o.error.issues.map(s=>s.path.length?`${s.path.join(".")}: ${s.message}`:s.message).join(", ");throw new chunk72TQRSNX_js.h(`List tab "${n}" in view "${r}" would no longer be publishable: ${a}`,[])}return t}chunkDPD6ZWL2_js.a(ip,"assertStillPublishableTab");function kt(e,t,r,n){return S(e,t,o=>{let a=o.config.tabs??[];if(!a.some(s=>s.id===r))throw new chunk72TQRSNX_js.h(`List tab "${r}" is not in view "${t}"`,[]);return {...o,config:{...o.config,tabs:a.map(s=>s.id===r?ip(s,n(s),t,r):s)}}})}chunkDPD6ZWL2_js.a(kt,"mapListTab");var op=chunkSDOYGWU4_js.ja,Wa=chunkSDOYGWU4_js.$,ap=chunkSDOYGWU4_js.Z;function K(e,t,r,n){let o=Jt.z.object({...je,type:Jt.z.literal(e),value:r});return {type:e,schema:o,apply:chunkDPD6ZWL2_js.a((a,s)=>kt(a,s.viewId,s.tabId,l=>{if(s.value===null){let{[t]:p,...I}=l;return I}return {...l,[t]:s.value}}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>[String(t)]),describe:chunkDPD6ZWL2_js.a(a=>n(a.value),"describe")}}chunkDPD6ZWL2_js.a(K,"setOnTab");var sp=Jt.z.object({...v,type:Jt.z.literal("add_list_tab"),tab:op}),up={type:"add_list_tab",schema:sp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.config.tabs??[];if(n.some(o=>o.id===t.tab.id))throw new chunk72TQRSNX_js.h(`List tab "${t.tab.id}" already exists in view "${t.viewId}"`,[]);return {...r,config:{...r.config,tabs:[...n,t.tab]}}}),"apply"),focus:$a,presentation:y($a,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'onglet \xAB ${e.tab.label} \xBB`,"describe")},lp=Jt.z.object({...je,type:Jt.z.literal("remove_list_tab")}),dp={type:"remove_list_tab",schema:lp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.config.tabs??[];if(!n.some(o=>o.id===t.tabId))throw new chunk72TQRSNX_js.h(`List tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,config:{...r.config,tabs:n.filter(o=>o.id!==t.tabId)}}}),"apply"),focus:ie,presentation:y(ie,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'onglet ${e.tabId}`,"describe")},cp=Jt.z.object({...je,type:Jt.z.literal("update_list_tab"),changes:Jt.z.object({label:Jt.z.string().min(1).optional(),icon:chunk47EGJRW7_js.c.optional(),default:Jt.z.boolean().optional(),visibility:Jt.z.enum(chunkSDOYGWU4_js.w).optional()}).refine(e=>Object.keys(e).length>0,"update_list_tab needs at least one change")}),qa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateListTabFocus"),pp={type:"update_list_tab",schema:cp,apply:chunkDPD6ZWL2_js.a((e,t)=>kt(e,t.viewId,t.tabId,r=>({...r,...t.changes})),"apply"),focus:qa,presentation:y(qa,"atomic",np),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'onglet en \xAB ${e.changes.label} \xBB`:`Modifie l'onglet ${e.tabId}`,"describe")},mp=Jt.z.object({...v,type:Jt.z.literal("reorder_list_tabs"),tabOrder:Jt.z.array(Jt.z.string().min(1))}),fp={type:"reorder_list_tabs",schema:mp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,config:{...r.config,tabs:Fe(r.config.tabs??[],t.tabOrder,"List tab")}})),"apply"),focus:Nt,presentation:y(Nt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les onglets","describe")},bp=K("set_columns","columns",Jt.z.array(Jt.z.string().min(1)),e=>`Affiche ${Array.isArray(e)?e.length:0} colonne(s)`),gp=K("set_column_sizing","columnSizing",Jt.z.record(Jt.z.string(),Jt.z.number().int().positive()),()=>"Ajuste la largeur des colonnes"),yp=Jt.z.object({...je,type:Jt.z.literal("set_layout"),value:Jt.z.enum(["table","list","kanban"])}),hp={type:"set_layout",schema:yp,apply:chunkDPD6ZWL2_js.a((e,t)=>kt(e,t.viewId,t.tabId,r=>{if(t.value!=="kanban")return {...za(r),layout:t.value};if(r.groupByAttribute===void 0)throw new chunk72TQRSNX_js.h(`List tab "${t.tabId}" cannot switch to kanban without a group attribute \u2014 use set_group_by, which switches the layout itself`,[]);return {...Ga(r),layout:"kanban"}}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>["layout"]),describe:chunkDPD6ZWL2_js.a(e=>`Passe en affichage ${e.value}`,"describe")},Ap=Jt.z.object({...je,type:Jt.z.literal("set_group_by"),value:Jt.z.string().min(1).nullable()}),Tp={type:"set_group_by",schema:Ap,apply:chunkDPD6ZWL2_js.a((e,t)=>kt(e,t.viewId,t.tabId,r=>t.value===null?{...za(r),layout:"table"}:{...Ga(r),layout:"kanban",groupByAttribute:t.value}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>["groupByAttribute"]),describe:chunkDPD6ZWL2_js.a(e=>e.value?`Regroupe par ${e.value} en kanban`:"Retire le regroupement, retour en table","describe")},wp=K("set_filters","filters",Wa.nullable(),e=>e?"Modifie les filtres":"Retire les filtres"),xp=K("set_sorts","sorts",ap.nullable(),e=>e?"Modifie le tri":"Retire le tri"),Ip=K("set_create_mode","createMode",Jt.z.enum(["redirect","inline","peek"]),e=>`Cr\xE9ation en mode ${e}`),Sp=K("set_read_only","readOnly",Jt.z.boolean(),e=>e?"Passe l'onglet en lecture seule":"Rend l'onglet modifiable"),vp=K("set_card_user_attribute","cardUserAttribute",Jt.z.string().min(1).nullable(),e=>e?`Affiche ${e} sur les cartes`:"Retire l'utilisateur des cartes"),Rp=K("set_card_date_attribute","cardDateAttribute",Jt.z.string().min(1).nullable(),e=>e?`Affiche ${e} sur les cartes`:"Retire la date des cartes"),Ep=K("set_description_attribute","descriptionAttribute",Jt.z.string().min(1).nullable(),e=>e?`Affiche ${e} en description`:"Retire la description"),Dp=K("set_display_attributes","displayAttributes",chunkSDOYGWU4_js.Y.nullable(),e=>`Affiche ${Array.isArray(e)?e.length:0} attribut(s)`),Cp=Jt.z.object({...v,type:Jt.z.literal("set_default_filters"),filters:Wa.nullable()}),Np={type:"set_default_filters",schema:Cp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(t.filters===null){let{defaultFilters:n,...o}=r.config;return {...r,config:o}}return {...r,config:{...r.config,defaultFilters:t.filters}}}),"apply"),focus:Nt,presentation:y(Nt,"atomic",()=>["config","defaultFilters"]),describe:chunkDPD6ZWL2_js.a(e=>e.filters?"Modifie les filtres de la vue":"Retire les filtres de la vue","describe")},Ka=[Np,up,dp,pp,fp,bp,gp,hp,Tp,wp,xp,Ip,Sp,vp,Rp,Ep,Dp];function kp(e){return {id:e.id??e.name,name:e.name,label:e.label,...e.icon===void 0?{}:{icon:e.icon}}}chunkDPD6ZWL2_js.a(kp,"toDraftableObject");function Op(e){let t=e.id??e.name;return (e.attributes??[]).map(r=>_p(r,t))}chunkDPD6ZWL2_js.a(Op,"toDraftableAttributes");function ni(e){return {id:e.id,name:e.name,label:e.label,type:e.attributeType,...e.config}}chunkDPD6ZWL2_js.a(ni,"toAttribute");function _p(e,t){let{id:r,name:n,label:o,type:a,...s}=e;return {id:e.id??e.name,objectId:t,name:e.name,label:e.label??e.name,attributeType:e.type,config:s}}chunkDPD6ZWL2_js.a(_p,"toDraftableAttribute");function Pt(e,t){if(!e.objects.some(r=>r.id===t))throw new chunk72TQRSNX_js.h(`Object "${t}" is not in the draftable state`,[])}chunkDPD6ZWL2_js.a(Pt,"requireObject");function Ot(e){return {objectId:e.objectId}}chunkDPD6ZWL2_js.a(Ot,"objectFocus");function _t(e){return {objectId:e.objectId,recordId:e.recordId}}chunkDPD6ZWL2_js.a(_t,"recordFocus");function Se(e){return {objectId:e.objectId,attributeId:e.attributeId}}chunkDPD6ZWL2_js.a(Se,"attributeFocus");function Pp(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(Pp,"firstChangedProperty");var oe={...ti,objectId:Jt.z.string().uuid()},Fp=Jt.z.object({...oe,type:Jt.z.literal("add_object"),name:Xe,label:Jt.z.string().min(1),icon:Jt.z.string().min(1).optional()}),Vp={type:"add_object",schema:Fp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(e.objects.some(n=>n.name===t.name))throw new chunk72TQRSNX_js.h(`Object "${t.name}" already exists`,[]);if(e.objects.some(n=>n.id===t.objectId))throw new chunk72TQRSNX_js.h(`Object id "${t.objectId}" is already taken`,[]);let r={id:t.objectId,name:t.name,label:t.label,...t.icon===void 0?{}:{icon:t.icon}};return {...e,objects:[...e.objects,r]}},"apply"),focus:Ot,presentation:y(Ot,"structural"),describe:chunkDPD6ZWL2_js.a(e=>`Cr\xE9e l'objet \xAB ${e.label} \xBB`,"describe")},jp=Jt.z.object({...oe,type:Jt.z.literal("update_object"),changes:Jt.z.object({label:Jt.z.string().min(1).optional(),icon:Jt.z.string().min(1).optional()}).refine(e=>Object.keys(e).length>0,"update_object needs at least one change")}),Ya=chunkDPD6ZWL2_js.a(e=>({objectId:e.objectId}),"updateObjectFocus"),Mp={type:"update_object",schema:jp,apply:chunkDPD6ZWL2_js.a((e,t)=>(Pt(e,t.objectId),{...e,objects:e.objects.map(r=>r.id===t.objectId?{...r,...t.changes}:r)}),"apply"),focus:Ya,presentation:y(Ya,"atomic",Pp),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'objet en \xAB ${e.changes.label} \xBB`:"Modifie l'objet","describe")},Lp=Jt.z.object({...oe,type:Jt.z.literal("remove_object")}),Bp={type:"remove_object",schema:Lp,apply:chunkDPD6ZWL2_js.a((e,t)=>{Pt(e,t.objectId);let r=e.objects.find(n=>n.id===t.objectId)?.name;return {...e,objects:e.objects.filter(n=>n.id!==t.objectId),attributes:e.attributes.filter(n=>n.objectId!==t.objectId),sampleRecords:e.sampleRecords.filter(n=>n.objectId!==t.objectId),views:e.views.filter(n=>n.objectName!==r)}},"apply"),focus:Ot,presentation:y(Ot,"structural"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'objet ${e.objectId}`,"describe")},Me=Vi.filter(e=>e!=="formula"&&e!=="rollup"),Up=Jt.z.object({...oe,type:Jt.z.literal("add_attribute"),attributeId:Jt.z.string().min(1),name:po,label:Jt.z.string().min(1),attributeType:Jt.z.enum(Me),config:Jt.z.record(Jt.z.string(),Jt.z.unknown()).optional()}).superRefine((e,t)=>{try{chunk47EGJRW7_js.n(e.attributeType,e.config??{});}catch(r){if(r instanceof chunk72TQRSNX_js.h){for(let n of r.errors)t.addIssue({code:"custom",message:n.message,path:["config",...n.path??[]]});return}throw r}}),$p={type:"add_attribute",schema:Up,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(Pt(e,t.objectId),e.attributes.some(n=>n.objectId===t.objectId&&n.name===t.name))throw new chunk72TQRSNX_js.h(`Attribute "${t.name}" already exists on object "${t.objectId}"`,[]);let r={id:t.attributeId,objectId:t.objectId,name:t.name,label:t.label,attributeType:t.attributeType,...t.config===void 0?{}:{config:t.config}};for(let n of e.sampleRecords)n.objectId===t.objectId&&Ha(n.id,r,n.values);return {...e,attributes:[...e.attributes,r]}},"apply"),focus:Se,presentation:y(Se,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'attribut \xAB ${e.label} \xBB`,"describe")},qp=Jt.z.object({...oe,type:Jt.z.literal("update_attribute"),attributeId:Jt.z.string().min(1),changes:Jt.z.object({label:Jt.z.string().min(1).optional()}).refine(e=>Object.keys(e).length>0,"update_attribute needs at least one change")}),zp={type:"update_attribute",schema:qp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(!e.attributes.some(r=>r.id===t.attributeId))throw new chunk72TQRSNX_js.h(`Attribute "${t.attributeId}" is not in the draftable state`,[]);return {...e,attributes:e.attributes.map(r=>r.id===t.attributeId?{...r,...t.changes}:r)}},"apply"),focus:Se,presentation:y(Se,"atomic"),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'attribut en \xAB ${e.changes.label} \xBB`:"Modifie l'attribut","describe")},Gp=Jt.z.object({...oe,type:Jt.z.literal("remove_attribute"),attributeId:Jt.z.string().min(1)}),Wp={type:"remove_attribute",schema:Gp,apply:chunkDPD6ZWL2_js.a((e,t)=>{let r=e.attributes.find(o=>o.id===t.attributeId);if(!r)throw new chunk72TQRSNX_js.h(`Attribute "${t.attributeId}" is not in the draftable state`,[]);let n=e.sampleRecords.find(o=>o.objectId===r.objectId&&r.name in o.values);if(n)throw new chunk72TQRSNX_js.h(`Attribute "${r.name}" is still used by sample record "${n.id}"`,[]);return {...e,attributes:e.attributes.filter(o=>o.id!==t.attributeId)}},"apply"),focus:Se,presentation:y(Se,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'attribut ${e.attributeId}`,"describe")};function Kp(e,t,r,n){let o=ni(r);try{chunk5QAE5NPN_js.c(o);}catch{return}let a=chunk5QAE5NPN_js.g(o,n);if(a.success)return;let s=a.errors??[],l=s.map(p=>p.message).join(", ");throw new chunk72TQRSNX_js.h(`Sample record "${e}" has an invalid value for "${t}": ${l}`,s.map(p=>({path:p.path,message:p.message})))}chunkDPD6ZWL2_js.a(Kp,"assertSampleValue");function Ha(e,t,r){if(t.config?.required===true&&t.config?.defaultValue===void 0&&!(t.name in r&&r[t.name]!==void 0))throw new chunk72TQRSNX_js.h(`Sample record "${e}" is missing a value for required attribute "${t.name}"`,[])}chunkDPD6ZWL2_js.a(Ha,"assertRequiredCovered");var Yp=Jt.z.object({...oe,type:Jt.z.literal("add_sample_record"),recordId:Jt.z.string().uuid(),values:Jt.z.record(Jt.z.string(),Jt.z.unknown())}),Hp={type:"add_sample_record",schema:Yp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(Pt(e,t.objectId),e.sampleRecords.some(n=>n.id===t.recordId))throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" already exists`,[]);let r=new Map(e.attributes.filter(n=>n.objectId===t.objectId).map(n=>[n.name,n]));for(let[n,o]of Object.entries(t.values)){let a=r.get(n);if(!a)throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" uses unknown attribute "${n}"`,[]);Kp(t.recordId,n,a,o);}for(let n of r.values())Ha(t.recordId,n,t.values);return {...e,sampleRecords:[...e.sampleRecords,{id:t.recordId,objectId:t.objectId,values:t.values}]}},"apply"),focus:_t,presentation:y(_t,"local"),describe:chunkDPD6ZWL2_js.a(()=>"Ajoute un exemple","describe")},Qp=Jt.z.object({...oe,type:Jt.z.literal("remove_sample_record"),recordId:Jt.z.string().min(1)}),Jp={type:"remove_sample_record",schema:Qp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(!e.sampleRecords.some(r=>r.id===t.recordId&&r.objectId===t.objectId))throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" is not in object "${t.objectId}"`,[]);return {...e,sampleRecords:e.sampleRecords.filter(r=>r.id!==t.recordId)}},"apply"),focus:_t,presentation:y(_t,"local"),describe:chunkDPD6ZWL2_js.a(()=>"Retire un exemple","describe")},Qa=[Vp,Mp,Bp,$p,zp,Wp,Hp,Jp];function Xp(){let e=new Map;for(let t of [...Qa,...Ua,...Ka]){if(e.has(t.type))throw new chunk72TQRSNX_js.r("architect operation",t.type);e.set(t.type,t);}return e}chunkDPD6ZWL2_js.a(Xp,"build");var ce=Xp(),ii=[...ce.keys()];function Le(e){let t=ce.get(e.type);if(!t)throw new chunk72TQRSNX_js.h(`Operation "${e.id}" has unknown type "${e.type}"`,[]);return t}chunkDPD6ZWL2_js.a(Le,"defOf");function oi(e,t){return t.reduce((r,n)=>Le(n).apply(r,n),e)}chunkDPD6ZWL2_js.a(oi,"applyOperations");function Zp(e){return Le(e).focus(e)}chunkDPD6ZWL2_js.a(Zp,"focusOf");function em(e,t){return e.map(r=>Le(r).describe(r,t))}chunkDPD6ZWL2_js.a(em,"describeOperations");function tm(e){if(typeof e!="object"||e===null||!("type"in e))throw new chunk72TQRSNX_js.h("An operation must be an object carrying a type",[]);let t=e.type;if(typeof t!="string")throw new chunk72TQRSNX_js.h("An operation's type must be a string",[]);let r=ce.get(t);if(!r)throw new chunk72TQRSNX_js.h(`Unknown operation type "${t}"`,[]);let n=r.schema.safeParse(e);if(!n.success)throw new chunk72TQRSNX_js.h(`Operation "${t}" is invalid: ${n.error.issues.map(o=>`${o.path.join(".")} ${o.message}`).join("; ")}`,[]);return n.data}chunkDPD6ZWL2_js.a(tm,"parseOperation");function Ja(e){return Jt.z.toJSONSchema(e,{io:"input"})}chunkDPD6ZWL2_js.a(Ja,"toJsonSchema");function nm(e){let t=ce.get(e);if(!t)throw new chunk72TQRSNX_js.h(`Unknown operation type "${e}"`,[]);return Ja(t.schema)}chunkDPD6ZWL2_js.a(nm,"describeOperationInput");function im(e){let t=Me.find(r=>r===e);if(!t)throw new chunk72TQRSNX_js.h(`Unknown attribute type "${e}"`,[]);return Ja(chunk47EGJRW7_js.m(t))}chunkDPD6ZWL2_js.a(im,"describeAttributeConfig");function om(){return {operations:[...ii],attributeTypes:[...Me]}}chunkDPD6ZWL2_js.a(om,"listDescribableNames");function Xa(e,t,r){let n=`fld_${e}_${t}`;return r===0?n:`${n}_${r}`}chunkDPD6ZWL2_js.a(Xa,"makeFieldId");function am(e,t){return e.attributeGroup?e.attributeGroup.id:e.attribute?e.attribute:`slot${t}`}chunkDPD6ZWL2_js.a(am,"seedOf");function sm(e){let t=new Map,r=e.fields.map((n,o)=>{if(n.id)return n;let a=am(n,o),s=t.get(a)??0;return t.set(a,s+1),{...n,id:Xa(e.id,a,s)}});return {...e,fields:r}}chunkDPD6ZWL2_js.a(sm,"withIds");function um(e){return e.map(t=>t.type==="form"?{...t,groups:t.groups.map(sm)}:t)}chunkDPD6ZWL2_js.a(um,"ensureFieldIds");function ai(e){return Le(e).presentation(e)}chunkDPD6ZWL2_js.a(ai,"presentationOf");function lm(e){let t=e.map(ai);return new Set(t.map(({focus:n})=>n.viewId??n.objectId).filter(n=>n!==void 0)).size>1||t.some(({impact:n})=>n==="structural")?"structural":t.some(({impact:n})=>n==="local")?"local":"atomic"}chunkDPD6ZWL2_js.a(lm,"episodeImpactOf");function dm(e,t){return e.config.tabs?.find(r=>r.id===t)}chunkDPD6ZWL2_js.a(dm,"listTabOf");function Za(e,t){let r=t.viewId?e.views.find(o=>o.id===t.viewId):void 0,n=t.tabId?r?.tabs.find(o=>o.id===t.tabId):void 0;if(t.attributeId)return e.attributes.find(o=>o.id===t.attributeId);if(t.fieldId){if(n?.type!=="form")return;for(let o of n.groups){let a=o.fields.find(s=>s.id===t.fieldId);if(a)return a}return}if(t.groupId)return n?.type!=="form"?void 0:n.groups.find(o=>o.id===t.groupId);if(t.tabId)return r?n??dm(r,t.tabId):void 0;if(t.recordId)return e.sampleRecords.find(o=>o.id===t.recordId);if(r)return r;if(t.objectId)return e.objects.find(o=>o.id===t.objectId)}chunkDPD6ZWL2_js.a(Za,"snapshotArchitectTarget");function cm(e,t){let r=e;return t.map(n=>{let o=ai(n),a=Za(r,o.focus);r=oi(r,[n]);let s=Za(r,o.focus);return {operationId:n.id,operationType:n.type,presentation:o,before:a,after:s}})}chunkDPD6ZWL2_js.a(cm,"deriveArchitectChanges");function pm(e){return {id:e.id??"",objectName:e.object,type:e.type,label:e.label,tabs:Ke(e)?e.config.tabs??[]:[],config:e.config}}chunkDPD6ZWL2_js.a(pm,"toDraftableView");function mm(e,t){return e.type==="detail"?{...e,label:t.label,config:{...t.config,tabs:t.tabs}}:{...e,label:t.label,config:t.config}}chunkDPD6ZWL2_js.a(mm,"fromDraftableView");Object.defineProperty(exports,"asTenantId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.b}});Object.defineProperty(exports,"asUserId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.c}});Object.defineProperty(exports,"canonicalStringify",{enumerable:true,get:function(){return chunkLQYUPOWB_js.a}});Object.defineProperty(exports,"deepEqual",{enumerable:true,get:function(){return chunkLQYUPOWB_js.f}});Object.defineProperty(exports,"generateId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.d}});Object.defineProperty(exports,"indexBy",{enumerable:true,get:function(){return chunkLQYUPOWB_js.e}});Object.defineProperty(exports,"ATTRIBUTE_FILTER_OPERATORS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.i}});Object.defineProperty(exports,"LIST_TAB_KANBAN_KEYS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.qa}});Object.defineProperty(exports,"LIST_TAB_TABLE_KEYS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.pa}});Object.defineProperty(exports,"LIST_VIEW_TAB_VISIBILITIES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.w}});Object.defineProperty(exports,"LOCATION_FILTER_PROPERTIES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.f}});Object.defineProperty(exports,"NO_VALUE_OPERATORS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.s}});Object.defineProperty(exports,"OPERATORS_BY_TYPE",{enumerable:true,get:function(){return chunkSDOYGWU4_js.r}});Object.defineProperty(exports,"REMOVED_OPERATOR_REPLACEMENTS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.U}});Object.defineProperty(exports,"RESERVED_ATTRIBUTE_NAMES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.z}});Object.defineProperty(exports,"RESERVED_OBJECT_NAMES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.A}});Object.defineProperty(exports,"RESOURCE_VISIBILITIES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.v}});Object.defineProperty(exports,"SYNONYM_ALIASES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.M}});Object.defineProperty(exports,"SYSTEM_ATTRIBUTES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.c}});Object.defineProperty(exports,"SYSTEM_ATTRIBUTE_I18N_KEYS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.a}});Object.defineProperty(exports,"SYSTEM_FIELD_NAMES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.y}});Object.defineProperty(exports,"SYSTEM_FILTER_ATTRIBUTE_TYPES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.T}});Object.defineProperty(exports,"canonicalizeFilterValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.L}});Object.defineProperty(exports,"collectQualifiedRuleIssues",{enumerable:true,get:function(){return chunkSDOYGWU4_js.V}});Object.defineProperty(exports,"columnsSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.X}});Object.defineProperty(exports,"currentActor",{enumerable:true,get:function(){return chunkSDOYGWU4_js.C}});Object.defineProperty(exports,"detailTabDraftSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ia}});Object.defineProperty(exports,"detailTabSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ha}});Object.defineProperty(exports,"detailViewConfigSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.la}});Object.defineProperty(exports,"displayAttributesSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.Y}});Object.defineProperty(exports,"extractCurrencyFilterValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.F}});Object.defineProperty(exports,"extractFilterValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.G}});Object.defineProperty(exports,"fieldSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ba}});Object.defineProperty(exports,"fieldShape",{enumerable:true,get:function(){return chunkSDOYGWU4_js.aa}});Object.defineProperty(exports,"fieldSlotSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ca}});Object.defineProperty(exports,"filterGroupSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.$}});Object.defineProperty(exports,"filterStateSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js._}});Object.defineProperty(exports,"getAttributeCapabilities",{enumerable:true,get:function(){return chunkSDOYGWU4_js.j}});Object.defineProperty(exports,"getAttributeFilterOperators",{enumerable:true,get:function(){return chunkSDOYGWU4_js.k}});Object.defineProperty(exports,"getOperatorPolarity",{enumerable:true,get:function(){return chunkSDOYGWU4_js.H}});Object.defineProperty(exports,"getRollupFilterOperators",{enumerable:true,get:function(){return chunkSDOYGWU4_js.u}});Object.defineProperty(exports,"getSystemAttributeI18nKey",{enumerable:true,get:function(){return chunkSDOYGWU4_js.b}});Object.defineProperty(exports,"getSystemAttributeList",{enumerable:true,get:function(){return chunkSDOYGWU4_js.d}});Object.defineProperty(exports,"groupWriteSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.da}});Object.defineProperty(exports,"inverseSourceSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.fa}});Object.defineProperty(exports,"isAttributeFilterable",{enumerable:true,get:function(){return chunkSDOYGWU4_js.l}});Object.defineProperty(exports,"isAttributeGroupable",{enumerable:true,get:function(){return chunkSDOYGWU4_js.o}});Object.defineProperty(exports,"isAttributeKanbanGroupable",{enumerable:true,get:function(){return chunkSDOYGWU4_js.p}});Object.defineProperty(exports,"isAttributeSearchable",{enumerable:true,get:function(){return chunkSDOYGWU4_js.m}});Object.defineProperty(exports,"isDynamicValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.B}});Object.defineProperty(exports,"isLocationFilterProperty",{enumerable:true,get:function(){return chunkSDOYGWU4_js.g}});Object.defineProperty(exports,"isLocationPartOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.h}});Object.defineProperty(exports,"isManagedSystemAttribute",{enumerable:true,get:function(){return chunkSDOYGWU4_js.e}});Object.defineProperty(exports,"isNoValueOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.t}});Object.defineProperty(exports,"isRelativeDateValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.P}});Object.defineProperty(exports,"isSetMembershipOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.K}});Object.defineProperty(exports,"listViewConfigSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ka}});Object.defineProperty(exports,"listViewTabSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ja}});Object.defineProperty(exports,"normalizeFilterRule",{enumerable:true,get:function(){return chunkSDOYGWU4_js.O}});Object.defineProperty(exports,"normalizeForEdgeRpc",{enumerable:true,get:function(){return chunkSDOYGWU4_js.I}});Object.defineProperty(exports,"normalizeOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.N}});Object.defineProperty(exports,"now",{enumerable:true,get:function(){return chunkSDOYGWU4_js.E}});Object.defineProperty(exports,"parseResourceVisibility",{enumerable:true,get:function(){return chunkSDOYGWU4_js.x}});Object.defineProperty(exports,"parseViewConfig",{enumerable:true,get:function(){return chunkSDOYGWU4_js.oa}});Object.defineProperty(exports,"relationSourceSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ea}});Object.defineProperty(exports,"resolveEffectiveFilterType",{enumerable:true,get:function(){return chunkSDOYGWU4_js.q}});Object.defineProperty(exports,"resolveIsWithinBounds",{enumerable:true,get:function(){return chunkSDOYGWU4_js.Q}});Object.defineProperty(exports,"resolveUtcDayBounds",{enumerable:true,get:function(){return chunkSDOYGWU4_js.R}});Object.defineProperty(exports,"sortsSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.Z}});Object.defineProperty(exports,"tableSourceSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ga}});Object.defineProperty(exports,"toMultiValueOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.J}});Object.defineProperty(exports,"toUtcDayString",{enumerable:true,get:function(){return chunkSDOYGWU4_js.S}});Object.defineProperty(exports,"today",{enumerable:true,get:function(){return chunkSDOYGWU4_js.D}});Object.defineProperty(exports,"validateQualifiedRule",{enumerable:true,get:function(){return chunkSDOYGWU4_js.W}});Object.defineProperty(exports,"viewConfigByTypeSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.na}});Object.defineProperty(exports,"viewTypeSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ma}});Object.defineProperty(exports,"ComputedFormulaParseError",{enumerable:true,get:function(){return chunk47EGJRW7_js.d}});Object.defineProperty(exports,"SCHEMA_LIMITS",{enumerable:true,get:function(){return chunk47EGJRW7_js.a}});Object.defineProperty(exports,"colorIdSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.b}});Object.defineProperty(exports,"iconNameSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.c}});Object.defineProperty(exports,"multiselectOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.h}});Object.defineProperty(exports,"parseAttributeConfig",{enumerable:true,get:function(){return chunk47EGJRW7_js.l}});Object.defineProperty(exports,"parseAttributeConfigForCreate",{enumerable:true,get:function(){return chunk47EGJRW7_js.n}});Object.defineProperty(exports,"parseAttributeConfigForUpdate",{enumerable:true,get:function(){return chunk47EGJRW7_js.o}});Object.defineProperty(exports,"parseComputedFormula",{enumerable:true,get:function(){return chunk47EGJRW7_js.e}});Object.defineProperty(exports,"selectOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.g}});Object.defineProperty(exports,"statusGroupSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.f}});Object.defineProperty(exports,"statusOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.i}});Object.defineProperty(exports,"createFormAttributeValidator",{enumerable:true,get:function(){return chunk5QAE5NPN_js.d}});Object.defineProperty(exports,"isNullishOrEmptyString",{enumerable:true,get:function(){return chunk5QAE5NPN_js.a}});Object.defineProperty(exports,"isValuePresent",{enumerable:true,get:function(){return chunk5QAE5NPN_js.b}});Object.defineProperty(exports,"rejectUnknownAttributesOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.l}});Object.defineProperty(exports,"validateDraft",{enumerable:true,get:function(){return chunk5QAE5NPN_js.j}});Object.defineProperty(exports,"validateDraftOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.k}});Object.defineProperty(exports,"validateObject",{enumerable:true,get:function(){return chunk5QAE5NPN_js.h}});Object.defineProperty(exports,"validateObjectOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.i}});Object.defineProperty(exports,"createCheckboxValidator",{enumerable:true,get:function(){return chunk47KVYDKG_js.a}});Object.defineProperty(exports,"createDateValidator",{enumerable:true,get:function(){return chunkKLR22JMC_js.a}});Object.defineProperty(exports,"AccessDeniedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.B}});Object.defineProperty(exports,"AttributeInUseError",{enumerable:true,get:function(){return chunk72TQRSNX_js.H}});Object.defineProperty(exports,"AttributeNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.e}});Object.defineProperty(exports,"ChangeTypeNotSupportedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.q}});Object.defineProperty(exports,"ConcurrentModificationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.z}});Object.defineProperty(exports,"DestructiveSyncNotAllowedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.o}});Object.defineProperty(exports,"DuplicateError",{enumerable:true,get:function(){return chunk72TQRSNX_js.r}});Object.defineProperty(exports,"ForbiddenError",{enumerable:true,get:function(){return chunk72TQRSNX_js.w}});Object.defineProperty(exports,"MemoryNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.F}});Object.defineProperty(exports,"MigrationTimeoutError",{enumerable:true,get:function(){return chunk72TQRSNX_js.p}});Object.defineProperty(exports,"NotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.c}});Object.defineProperty(exports,"NotImplementedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.E}});Object.defineProperty(exports,"ObjectNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.d}});Object.defineProperty(exports,"ObjectReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.I}});Object.defineProperty(exports,"OrphanSystemAttributeError",{enumerable:true,get:function(){return chunk72TQRSNX_js.n}});Object.defineProperty(exports,"ProtectedResourceError",{enumerable:true,get:function(){return chunk72TQRSNX_js.i}});Object.defineProperty(exports,"ProtectedRoleError",{enumerable:true,get:function(){return chunk72TQRSNX_js.x}});Object.defineProperty(exports,"RecordNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.f}});Object.defineProperty(exports,"RecordReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.G}});Object.defineProperty(exports,"RepositoryError",{enumerable:true,get:function(){return chunk72TQRSNX_js.C}});Object.defineProperty(exports,"RoleNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.y}});Object.defineProperty(exports,"SchemaError",{enumerable:true,get:function(){return chunk72TQRSNX_js.b}});Object.defineProperty(exports,"SchemaErrorCode",{enumerable:true,get:function(){return chunk72TQRSNX_js.a}});Object.defineProperty(exports,"SchemaPlanNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.g}});Object.defineProperty(exports,"SearchBackendError",{enumerable:true,get:function(){return chunk72TQRSNX_js.D}});Object.defineProperty(exports,"StorageError",{enumerable:true,get:function(){return chunk72TQRSNX_js.A}});Object.defineProperty(exports,"SyncCascadeError",{enumerable:true,get:function(){return chunk72TQRSNX_js.m}});Object.defineProperty(exports,"SyncConflictError",{enumerable:true,get:function(){return chunk72TQRSNX_js.l}});Object.defineProperty(exports,"SyncError",{enumerable:true,get:function(){return chunk72TQRSNX_js.j}});Object.defineProperty(exports,"SystemEntityImmutableError",{enumerable:true,get:function(){return chunk72TQRSNX_js.k}});Object.defineProperty(exports,"ValidationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.h}});Object.defineProperty(exports,"isAttributeInUseError",{enumerable:true,get:function(){return chunk72TQRSNX_js.K}});Object.defineProperty(exports,"isNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.t}});Object.defineProperty(exports,"isObjectReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.L}});Object.defineProperty(exports,"isProtectedResourceError",{enumerable:true,get:function(){return chunk72TQRSNX_js.v}});Object.defineProperty(exports,"isRecordReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.J}});Object.defineProperty(exports,"isSchemaError",{enumerable:true,get:function(){return chunk72TQRSNX_js.s}});Object.defineProperty(exports,"isValidationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.u}});Object.defineProperty(exports,"TEXT_FORMAT_PATTERNS",{enumerable:true,get:function(){return chunkXHEBV2HE_js.a}});Object.defineProperty(exports,"createTextValidator",{enumerable:true,get:function(){return chunkXHEBV2HE_js.c}});Object.defineProperty(exports,"resolveTextPattern",{enumerable:true,get:function(){return chunkXHEBV2HE_js.b}});Object.defineProperty(exports,"createNumberValidator",{enumerable:true,get:function(){return chunkSLYRQ72J_js.a}});Object.defineProperty(exports,"DEFAULT_VALIDATION_MESSAGES",{enumerable:true,get:function(){return chunkJFSQ24XR_js.a}});Object.defineProperty(exports,"formatZodErrors",{enumerable:true,get:function(){return chunkJFSQ24XR_js.b}});exports.AGENT_UI_BATCH_MAX_BYTES=GT;exports.AGENT_UI_BATCH_MAX_ITEMS=WT;exports.ALLOWED_PROPERTY_TYPES=Xi;exports.ALL_ACTIONS=Kt;exports.ALL_OPERATION_TYPES=ii;exports.ALL_SYSTEM_RESOURCES=Ih;exports.ARTIFACT_FILE_ROLES=Kb;exports.ARTIFACT_KINDS=Gb;exports.ARTIFACT_LIST_VIEW=qu;exports.ARTIFACT_OBJECT=$u;exports.ARTIFACT_OBJECT_NAME=Nn;exports.ARTIFACT_RETENTIONS=Wb;exports.ATTRIBUTE_TYPES=Vi;exports.AUDIT_ACTIONS=ub;exports.AUDIT_RESOURCE_TYPES=sb;exports.ActivityTabConfig=Kr;exports.AgentBuilder=Xt;exports.BEHAVIOR_PROPERTIES=Xf;exports.BYTE_UNIT_LABELS=js;exports.CLAIMABLE_SESSION_STATUSES=xs;exports.COMPUTED_FUNCTIONS=_e;exports.COMPUTED_FUNCTION_METADATA=Cw;exports.COMPUTED_FUNCTION_NAMES=uw;exports.CONNECTOR_CALLBACK_PARAM=tx;exports.COUNT_MODES=Qi;exports.ComputedFormulaCompileError=b;exports.CustomTabConfig=Gr;exports.DB_COLUMN_FIELDS=wh;exports.DEFAULT_AGENT_EXECUTION_CONFIG=bo;exports.DEFAULT_APPROVAL_POLICY=Mi;exports.DEFAULT_DICTATION_LIMITS=qb;exports.DEFAULT_LABEL_FALLBACK=ro;exports.DEFAULT_MEETING_BOT_DISPLAY_NAME=ks;exports.DEFAULT_ROLES=pu;exports.DEFAULT_ROLE_DESCRIPTIONS=Rh;exports.DEFAULT_ROLE_LABELS=vh;exports.DEFAULT_ROLE_PERMISSIONS=Eh;exports.DEFAULT_TENANT_SETTINGS=Ig;exports.DICTATION_FINALIZATION_TIMEOUT_MS=Ub;exports.DICTATION_FRAME_BYTES=Fb;exports.DICTATION_MAX_BUFFER_BYTES=jb;exports.DICTATION_MAX_FRAME_BYTES=Vb;exports.DICTATION_MAX_TRANSCRIPT_BYTES=Mb;exports.DICTATION_MODEL_ID=$b;exports.DICTATION_PREPARATION_TIMEOUT_MS=Bb;exports.DICTATION_SAMPLE_RATE=Pb;exports.DICTATION_TICKET_TTL_MS=Lb;exports.DOCUMENT_SYSTEM_ATTRIBUTES=My;exports.DRAFTABLE_ATTRIBUTE_TYPES=Me;exports.DRIVE_LIST_VIEW=Uu;exports.DRIVE_OBJECT=Lu;exports.DRIVE_OBJECT_NAME=ct;exports.DRIVE_VIEW=Bu;exports.DetailViewBuilder=Jr;exports.DocumentsTabConfig=Qr;exports.EMPTY_VALUE_PLACEHOLDER=He;exports.ESTIMATED_COUNT_CAP=jg;exports.EmailsTabConfig=Yr;exports.FAKE_MEETING_BOT_SIGNATURE_HEADER=ax;exports.FORM_FORBIDDEN_ATTRIBUTE_TYPES=zt;exports.FlagRegistry=Ne;exports.FlagService=dt;exports.FormBuilder=Mr;exports.FormRegistry=Oe;exports.FormRowBuilder=Vr;exports.FormStepBuilder=jr;exports.GroupBuilder=ot;exports.IDENTITY_PROPERTIES=Jf;exports.IMAGE_FORMATS=_g;exports.INFERENCE_REASONING_OPTIONS=Ui;exports.INFERENCE_SPEEDS=Bi;exports.LIVE_EVENT_TYPES=ol;exports.ListViewBuilder=Xr;exports.ListViewTabConfigBuilder=Zr;exports.MAX_PRESET_DEPTH=zi;exports.MAX_TODOS=Ib;exports.MAX_TODO_DESCRIPTION_CHARS=vb;exports.MAX_TODO_ID_CHARS=Sb;exports.MAX_TODO_RESULT_CHARS=Rb;exports.MEETING_ATTRIBUTES=T;exports.MEETING_DETAIL_VIEW_ID=Ro;exports.MEETING_LIST_VIEW=Wu;exports.MEETING_LIST_VIEW_ID=So;exports.MEETING_OBJECT=zu;exports.MEETING_OBJECT_NAME=pt;exports.MEETING_VIEW=Gu;exports.MEETING_WRITE_SOURCE=vo;exports.MEMORY_LIST_VIEW=Mu;exports.MEMORY_OBJECT=Vu;exports.MEMORY_VIEW=ju;exports.McpOAuthCompletionMode=Kd;exports.MeetingsTabConfig=Hr;exports.NATIVE_AGENT_UI_PART_IDS_METADATA_KEY=vs;exports.NATIVE_AGENT_UI_PART_IDS_METADATA_SCHEMA_VERSION=Rs;exports.NOTIFICATION_INBOX_STATES=Pi;exports.NOTIFICATION_KINDS=ki;exports.NOTIFICATION_PRIORITIES=Oi;exports.NOTIFICATION_SENSITIVITIES=_i;exports.NOTIFICATION_TYPES_V1=Hf;exports.NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED=Ts;exports.NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN=hs;exports.NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED=As;exports.NOTIFICATION_WORK_STATES=Fi;exports.NO_RECORDING=sx;exports.NoopGeocodingAdapter=Ki;exports.OBJECT_NAME_SCHEMA=Xe;exports.OPEN_TOOL_PART_STATES=Is;exports.OPERATION_REGISTRY=ce;exports.OPERATOR_SPECS=St;exports.ObjectBuilder=qr;exports.PRESENTATION_PROPERTIES=Zf;exports.PROVIDER_NAMES=Li;exports.QUALIFIED_SEPARATOR=Gy;exports.QUOTA_KEYS=Bg;exports.RECORDING_OVERRIDES=ix;exports.RECORDING_POLICIES=ox;exports.RECORD_CREATOR_ROOT_ACTOR_METADATA_KEY=uo;exports.RELATION_TARGET_ANY=$t;exports.RichtextTabConfig=Wr;exports.SCHEMA_PLAN_LIMITS=$;exports.SCHEMA_SOURCE_ID_PATTERN=Qn;exports.SESSION_STATE_STREAM_ID=Nb;exports.SESSION_TERMINAL_STATUSES=ws;exports.SKILL_CONTENT_TEMPLATE=wo;exports.SKILL_LIST_VIEW=_u;exports.SKILL_OBJECT=ku;exports.SKILL_VIEW=Ou;exports.STANDARD_SCHEMA_VENDOR=yu;exports.SYSTEM_PART_CODES=qt;exports.SYSTEM_RESOURCES=M;exports.SYSTEM_RESOURCE_LABELS=Sh;exports.TODAY_DEFAULT=ra;exports.TODO_PLAN_STATUSES=gb;exports.TODO_STATUSES=xb;exports.TOOL_APPROVAL_STATES=$i;exports.TabBuilder=Q;exports.TableTabConfig=at;exports.UPDATE_TABLE_TAB_CHANGE_KEYS=Yc;exports.UPDATE_TAB_CHANGE_KEYS=Ec;exports.UPDATE_TAB_CONFIG_CHANGE_KEYS=Hc;exports.USER_STATUSES=vg;exports.USER_WORK_POSTURES=Rg;exports.accessLevelToActions=yg;exports.actionsToAccessLevel=gg;exports.agent=Bh;exports.agentDataChunk=Mx;exports.agentDisplayName=yb;exports.agentInferencePreferencesSchema=Fx;exports.agentMessageAttachmentSchema=cc;exports.agentMessagePartSchema=dc;exports.agentSessionInferenceOverridesInputSchema=lc;exports.agentSessionInferenceOverridesSchema=Vx;exports.agentSessionMessageSchema=Aa;exports.agentUIValidationError=hc;exports.applyOperations=oi;exports.applyPipes=Zs;exports.applyRelationProps=iu;exports.assertAcyclicComputedDependencies=mw;exports.assertCustomAgentUIMessageChunk=Ac;exports.assertSchemaSourceId=Qd;exports.booleanFlag=wu;exports.buildAgentFallbackTitle=ia;exports.buildPermissionFlags=cu;exports.buildPropertySchema=Ye;exports.buildQualifiedAttribute=Ky;exports.checkbox=go;exports.compareAgentSessionMessages=Ss;exports.compileComputedFormula=Bo;exports.compileRollupAttribute=yw;exports.computeByteMagnitude=Vs;exports.conversationDisplayTitle=Hd;exports.createFlagRegistry=Ru;exports.createFlagService=Du;exports.createStandardSchemaProps=et;exports.currency=Zh;exports.customDataChunkSchemas=Sa;exports.date=U;exports.dateInTimezone=vt;exports.dateValueStart=fe;exports.defineOperation=Rt;exports.definePresentation=y;exports.deriveArchitectChanges=cm;exports.deriveCreateDefaultsFromFilters=Xw;exports.deriveInitials=lu;exports.describeAttributeConfig=im;exports.describeOperationInput=nm;exports.describeOperations=em;exports.destructiveSchema=fa;exports.detailView=ee;exports.document=yo;exports.durableDateSchema=fc;exports.ensureFieldIds=um;exports.episodeImpactOf=lm;exports.evaluateComputedAst=Sw;exports.evaluateComputedFormula=vw;exports.evaluateComputedFormulaWithResult=Rw;exports.evaluateFilterState=Bd;exports.evaluateRecordFilterState=zw;exports.extractAttributeNames=oo;exports.extractValueRefs=so;exports.flagRegistry=vu;exports.focusOf=Zp;exports.form=pA;exports.formFieldFlatKey=Ns;exports.formFieldKey=Cs;exports.formRegistry=Co;exports.formatAgentStreamFrameId=UT;exports.formatAttributeValue=Zi;exports.formatByteSize=_y;exports.formatComputedResult=Fd;exports.formatLocationValue=Gs;exports.formula=iA;exports.fromDraftableView=mm;exports.generateDefaultDetailView=_n;exports.generateDefaultListView=Pn;exports.getActiveTab=NT;exports.getEditableLabelAttribute=ru;exports.getErrorMessage=Qb;exports.getListViewDisplayAttributeNames=Ms;exports.getLiveProtocolPayloadChannel=iw;exports.getRecordCreatorPrincipalId=du;exports.getSingleAttributeFromExpression=ao;exports.getSlotFieldTargets=Wi;exports.getUserDisplayName=su;exports.group=CA;exports.hasDestructiveEntries=gx;exports.hasOptions=Tg;exports.imageModelIdSchema=xa;exports.includesAction=ge;exports.inferInverseCardinality=nb;exports.inferRollupReturnType=wd;exports.inferenceReasoningSchema=ei;exports.inferenceSpeedSchema=Zn;exports.isAgentUIDataName=yc;exports.isAgentUIMessageBatch=KT;exports.isAttributeSortable=ib;exports.isBilateralRelation=rb;exports.isCheckboxEquality=_w;exports.isClaimableSessionStatus=bb;exports.isComputedFunctionName=bt;exports.isDateRangeValue=Z;exports.isDefaultRole=Dh;exports.isDetailView=Ke;exports.isDocumentAttribute=Ly;exports.isEmptyObject=Ps;exports.isFieldGroup=Os;exports.isFormDefinition=eg;exports.isFormFieldsRow=We;exports.isFormFreeFieldRef=Gt;exports.isFormHeadingRow=sg;exports.isFormSeparatorRow=ug;exports.isFormSlotFieldRef=Gi;exports.isFormTextRow=lg;exports.isLabelExpression=Je;exports.isListView=Hi;exports.isLiveEventEnvelope=ow;exports.isLiveEventPayload=ew;exports.isLiveEventPayloadForType=fl;exports.isLiveEventType=ml;exports.isNotEmpty=Ji;exports.isOpenToolPartState=hb;exports.isPlainRecord=Yo;exports.isStandardSchema=qh;exports.isSystemPartCode=Tb;exports.isTerminalSessionStatus=fb;exports.isTerminalState=cb;exports.isToolApprovalState=Ab;exports.isUniversalRelation=ji;exports.jsonFlag=Su;exports.legacyStatusToSessionState=mb;exports.listDescribableNames=om;exports.listView=G;exports.liveChannelKey=QT;exports.location=rA;exports.makeFieldId=Xa;exports.matchesAccepts=By;exports.mentionReferenceSchema=pc;exports.modelDefinitionSchema=mc;exports.modelReferenceSchema=wa;exports.multiselect=tA;exports.nativeAgentUIPartIdMetadataKey=Ds;exports.normalizeDateValue=Ls;exports.number=rt;exports.numberFlag=Iu;exports.object=z;exports.orderAgentSessionMessages=wb;exports.parseAgentStreamFrameId=$T;exports.parseCountMode=_s;exports.parseLiveChannelKey=ko;exports.parseNativeAgentUIPartIdsMetadata=kb;exports.parseOperation=tm;exports.parseOptionalCountMode=Vg;exports.parseQualifiedAttribute=Wy;exports.persistedDefaultViewTargetSchema=ic;exports.persistedSchemaPlanSchema=Cx;exports.phone=Xh;exports.plannedAttributeSchema=ec;exports.plannedInlineAttributeSchema=tc;exports.plannedObjectSchema=rc;exports.presentationOf=ai;exports.proposedDefaultViewTargetSchema=nc;exports.providerNameSchema=Ta;exports.qualifiedPropertyDefs=au;exports.readFormFieldValue=ig;exports.registry=XA;exports.relation=Ae;exports.relationPropertyDefs=ou;exports.renderLabelExpression=Ht;exports.resetViewToDefault=el;exports.resolveAttributeDefaultValue=Gd;exports.resolveFieldRequired=ng;exports.resolvePropertyDefinitions=Yi;exports.richtext=he;exports.rollup=oA;exports.rollupToFormulaExpression=Td;exports.schemaPlanSchema=Dx;exports.select=q;exports.sessionInferencePatchSchema=jx;exports.sessionStateToLegacyStatus=pb;exports.status=eA;exports.stringFlag=xu;exports.text=f;exports.toAttribute=ni;exports.toDraftableAttributes=Op;exports.toDraftableObject=kp;exports.toDraftableView=pm;exports.toUndefinedIfEmpty=Fs;exports.todoItemSchema=bc;exports.todoPlanSchema=gc;exports.toolImpactSchema=Ia;exports.user=nA;exports.validateAttributeName=Ce;exports.validateLabelExpression=Xs;exports.validateObjectExpressions=Au;exports.validateObjectName=De;exports.validateViewName=Ze;exports.viewRegistry=Ku;exports.viewStateKey=Dg;exports.viewSyncPayload=Jd;
58
+ {{ participants }}`).attribute(f({name:T.title,label:"Title"}).required()).attribute(he({name:T.description,label:"Description"})).attribute(f({name:T.location,label:"Location"})).attribute(U({name:T.startsAt,label:"Starts at"}).includeTime()).attribute(U({name:T.endsAt,label:"Ends at"}).includeTime()).attribute(go({name:T.isAllDay,label:"All day"})).attribute(q({name:T.status,label:"Status"}).options([{value:"confirmed",label:"Confirmed"},{value:"tentative",label:"Tentative"},{value:"cancelled",label:"Cancelled"}])).attribute(f({name:T.organizerAddress,label:"Organizer address"}).email()).attribute(f({name:T.organizerName,label:"Organizer"})).attribute(f({name:T.conferenceProvider,label:"Conference provider"})).attribute(f({name:T.conferenceJoinUrl,label:"Join link"}).url()).attribute(f({name:T.htmlLink,label:"Open in calendar"}).url()).attribute(f({name:T.participants,label:"Participants"}).multiline()).attribute(f({name:T.providerEventId,label:"Provider event id"}).hidden()).attribute(f({name:T.icalUid,label:"iCal UID"}).hidden()).attribute(f({name:T.recurringEventId,label:"Recurring event id"}).hidden()).attribute(f({name:T.connectionId,label:"Connection id"}).hidden()).attribute(q({name:T.recordingOverride,label:"Recording"}).options([{value:"force",label:"Force"},{value:"skip",label:"Skip"}]).hidden()).attribute(U({name:T.endedAnnouncedAt,label:"Ended announced at"}).includeTime().hidden()).attribute(Ae({name:T.linkedRecords,label:"Linked records"}).toAny().many().qualifyWith(f({name:"source",label:"Source"}).hidden())).build(),Ku=O(G(Ro,"Meeting").for(ft).default().sidePanel({attributes:[T.startsAt,T.endsAt,T.linkedRecords]}).tab("description","Description").richtext(T.description).titleAttribute(T.title).build()),Yu=O(W(So,"Meetings").for(ft).default().tab("workspace","Shared").default().icon("users").visibility("workspace").table().columns(...Io).sort(T.startsAt,"desc").tab("mine","My meetings").icon("lock").visibility("private").table().columns(...Io).sort(T.startsAt,"desc").build());function Oe(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(Oe,"cloneViewDefinition");var kn=class kn{constructor(){this.views=new Map;this.byObject=new Map;this.byObjectAndType=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r)this.registerSingle(n);return this}registerSingle(t){let r=this.makeKey(t.object,t.name,t.type);if(this.views.has(r)){let l=`[ViewRegistry] Duplicate view: "${t.name}" (${t.type}) for object "${t.object}"`;throw new chunk72TQRSNX_js.r("view",r,l)}let n=Oe(t);this.views.set(r,n);let o=this.byObject.get(n.object)??[];o.push(n),this.byObject.set(n.object,o);let a=`${n.object}:${n.type}`,s=this.byObjectAndType.get(a)??[];s.push(n),this.byObjectAndType.set(a,s);}getByObjectName(t){return Array.from(this.byObject.get(t)??[],Oe)}getByObjectNameAndType(t,r){return Array.from(this.byObjectAndType.get(`${t}:${r}`)??[],Oe)}get(t,r,n){if(n){let a=this.views.get(this.makeKey(t,r,n));return a?Oe(a):void 0}return this.getByObjectName(t).find(a=>a.name===r)}getOrThrow(t,r,n){let o=this.get(t,r,n);if(!o){let s=this.getByObjectName(t).map(p=>`${p.name} (${p.type})`).join(", ")||"(none)",l=`[ViewRegistry] View "${r}" not found for object "${t}".
59
+ Available views: ${s}`;throw new chunk72TQRSNX_js.c("View",`${t}:${r}`,void 0,l)}return o}getAll(){return Array.from(this.views.values(),Oe)}has(t,r,n){return n?this.views.has(this.makeKey(t,r,n)):this.getByObjectName(t).some(a=>a.name===r)}hasObject(t){return this.byObject.has(t)}get size(){return this.views.size}listObjectNames(){return Array.from(this.byObject.keys())}getDefault(t,r){let n=this.getByObjectNameAndType(t,r);return n.find(o=>o.default)??n[0]}clear(){this.views.clear(),this.byObject.clear(),this.byObjectAndType.clear();}summary(){let t=[];t.push(`[ViewRegistry] ${this.size} view(s) registered:`);for(let r of this.listObjectNames()){let o=this.getByObjectName(r).map(a=>{let s=[];a.default&&s.push("default");let l=s.length>0?` (${s.join(", ")})`:"";return `${a.name}:${a.type}${l}`});t.push(` ${r}: ${o.join(", ")}`);}return t.join(`
60
+ `)}debug(t){let r=this.summary();return t?.(r),r}makeKey(t,r,n){return `${t}:${r}:${n}`}};chunkDPD6ZWL2_js.a(kn,"ViewRegistry");var On=kn,Hu=new On;function Eo(e,t=[]){return e.filter(r=>!(!chunkVJYVPQ5E_js.j(r).lifecycle.visibleInRuntime||r.system||t.includes(r.name)))}chunkDPD6ZWL2_js.a(Eo,"getRuntimeAttributes");function Do(e){return [...e].sort((t,r)=>{let n=t.order??999,o=r.order??999;return n!==o?n-o:t.name.localeCompare(r.name)})}chunkDPD6ZWL2_js.a(Do,"sortAttributes");function Qu(e){if(e.type==="text"&&e.multiline)return 12;switch(e.type){case "richtext":case "location":return 12;case "checkbox":return 4;default:return 6}}chunkDPD6ZWL2_js.a(Qu,"getDefaultFieldSpan");function Ju(e){return {attribute:e.name,span:Qu(e)}}chunkDPD6ZWL2_js.a(Ju,"attributeToField");function _n(e,t={}){let{includeActivityTab:r=true,includeDocumentsTab:n=true,excludeAttributes:o=[]}=t,a=Eo(e.attributes,o),p=[{id:"form",name:"form",label:"Details",type:"form",groups:[{id:"general",label:"General",type:"fields",fields:Do(a.filter(ae=>chunkVJYVPQ5E_js.j(ae).presentation.formField)).map(Ju),order:0}],order:0}],I=1,Z=e.attributes.some(ae=>ae.type==="document");n&&Z&&p.push({id:"documents",name:"documents",label:"Documents",type:"documents",order:I++,allowUpload:true,allowRemove:true}),r&&p.push({id:"activity",name:"activity",label:"Activity",type:"activity",order:I++});let B={tabs:p};return {name:"default",label:"Default View",object:e.name,type:"detail",config:B,default:true}}chunkDPD6ZWL2_js.a(_n,"generateDefaultDetailView");function Pn(e,t={}){let{excludeAttributes:r=[],maxListColumns:n=5}=t,o=Eo(e.attributes,r),l={tabs:[{id:"all",label:"All",default:true,visibility:"workspace",layout:"table",columns:Do(o.filter(p=>chunkVJYVPQ5E_js.j(p).presentation.defaultColumn)).slice(0,n).map(p=>p.name)}]};return {name:"default",label:"All Records",object:e.name,type:"list",config:l,default:true}}chunkDPD6ZWL2_js.a(Pn,"generateDefaultListView");function Xu(e,t){let{preserveCustomTabs:r=true,preserveTableTabs:n=true}=t,o=[];for(let a of e.config.tabs)r&&a.type==="custom"&&o.push(a),n&&a.type==="table"&&o.push(a);return o}chunkDPD6ZWL2_js.a(Xu,"getPreservedDetailTabs");function Zu(e,t){if(t.length===0)return e;let r=e.find(s=>s.type==="form"),n=e.filter(s=>s.type!=="form"),o=[];r&&o.push(r);let a=1;for(let s of t)o.push({...s,order:a++});for(let s of n)o.push({...s,order:a++});return o}chunkDPD6ZWL2_js.a(Zu,"mergeDetailTabs");function el(e,t,r){let{preserveMetadata:n=true,...o}=r,a=_n(t,o),s=Xu(e,r),l=Zu(a.config.tabs,s),p={...a.config,tabs:l},I={...a,config:p};return n&&(I.id=e.id,I.name=e.name,I.label=e.label,I.description=e.description,I.icon=e.icon),I}chunkDPD6ZWL2_js.a(el,"resetDetailViewToDefault");function tl(e,t,r){let{preserveMetadata:n=true,...o}=r,s={...Pn(t,o)};return n&&(s.id=e.id,s.name=e.name,s.label=e.label,s.description=e.description,s.icon=e.icon),s}chunkDPD6ZWL2_js.a(tl,"resetListViewToDefault");function rl(e,t,r={}){if(Ye(e))return el(e,t,r);if(Hi(e))return tl(e,t,r);throw new Error(`Reset not supported for view type: ${e.type}`)}chunkDPD6ZWL2_js.a(rl,"resetViewToDefault");function PT(e,t){if(t){let r=e.tabs.find(n=>n.id===t);if(r)return r}return e.tabs.find(r=>r.default)??e.tabs[0]}chunkDPD6ZWL2_js.a(PT,"getActiveTab");function Fn(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(Fn,"cloneFormDefinition");var Vn=class Vn{constructor(){this.forms=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r){if(this.forms.has(n.name))throw new chunk72TQRSNX_js.r("form",n.name,`[FormRegistry] Duplicate form: "${n.name}"`);this.forms.set(n.name,Fn(n));}return this}get(t){let r=this.forms.get(t);return r?Fn(r):void 0}getAll(){return Array.from(this.forms.values(),Fn)}listNames(){return Array.from(this.forms.keys())}};chunkDPD6ZWL2_js.a(Vn,"FormRegistry");var ke=Vn;var Co=new ke;function GT(e,t){return `${e}:${t}`}chunkDPD6ZWL2_js.a(GT,"formatAgentStreamFrameId");function WT(e){let t=e.lastIndexOf(":");if(t<=0)return null;let r=e.slice(0,t),n=Number(e.slice(t+1));return !Number.isInteger(n)||n<=0?null:{streamId:r,sequence:n}}chunkDPD6ZWL2_js.a(WT,"parseAgentStreamFrameId");var HT=204800,QT=256;function Mn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Mn,"isRecord");function Ln(e,t){let r=Object.keys(e);return r.length===t.length&&r.every(n=>t.includes(n))}chunkDPD6ZWL2_js.a(Ln,"hasExactKeys");function jn(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}chunkDPD6ZWL2_js.a(jn,"isPositiveInteger");function No(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0}chunkDPD6ZWL2_js.a(No,"isNonNegativeInteger");function nl(e){return Mn(e)&&Ln(e,["kind","startOffset","endOffset"])?(e.kind==="text"||e.kind==="reasoning")&&No(e.startOffset)&&No(e.endOffset)&&e.endOffset>=e.startOffset:false}chunkDPD6ZWL2_js.a(nl,"isContentRange");function il(e){if(!Mn(e))return false;let t=e.content===void 0?["sequence","chunk"]:["sequence","content","chunk"];return Ln(e,t)&&jn(e.sequence)&&e.chunk!==void 0&&(e.content===void 0||nl(e.content))}chunkDPD6ZWL2_js.a(il,"isBatchItem");function ol(e){try{return new TextEncoder().encode(JSON.stringify(e)).byteLength}catch{return}}chunkDPD6ZWL2_js.a(ol,"encodedSize");function JT(e){if(!(Mn(e)&&Ln(e,["schemaVersion","batchId","tenantId","sessionId","streamId","sequenceStart","sequenceEnd","items"]))||e.schemaVersion!==1||typeof e.batchId!="string"||e.batchId.trim()===""||typeof e.tenantId!="string"||e.tenantId.trim()===""||typeof e.sessionId!="string"||e.sessionId.trim()===""||typeof e.streamId!="string"||e.streamId.trim()===""||!jn(e.sequenceStart)||!jn(e.sequenceEnd)||!Array.isArray(e.items)||e.items.length===0||e.items.length>256||!e.items.every(il))return false;let t=0;for(let n of e.items){if(n.sequence<=t)return false;t=n.sequence;}if(e.items[0]?.sequence!==e.sequenceStart||e.items.at(-1)?.sequence!==e.sequenceEnd)return false;let r=ol(e);return r!==void 0&&r<=204800}chunkDPD6ZWL2_js.a(JT,"isAgentUIMessageBatch");function ew(e){switch(e.kind){case "workspace":return `workspace:${encodeURIComponent(e.tenantId)}`;case "object":return `object:${encodeURIComponent(e.objectId)}`;case "record":return `record:${encodeURIComponent(e.objectId)}:${encodeURIComponent(e.recordId)}`;case "view":return `view:${encodeURIComponent(e.viewId)}`;case "user":return `user:${encodeURIComponent(e.actorId)}`;case "conversation":return `conversation:${encodeURIComponent(e.sessionId)}`;case "architect-draft":return `architect-draft:${encodeURIComponent(e.actorId)}`}}chunkDPD6ZWL2_js.a(ew,"liveChannelKey");function te(e){try{return decodeURIComponent(e)}catch{return null}}chunkDPD6ZWL2_js.a(te,"decodeLiveChannelPart");function Oo(e){let t=e.split(":");if(t[0]==="workspace"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"workspace",tenantId:r}:null}if(t[0]==="object"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"object",objectId:r}:null}if(t[0]==="record"&&t.length===3&&t[1]&&t[2]){let r=te(t[1]),n=te(t[2]);return r&&n?{kind:"record",objectId:r,recordId:n}:null}if(t[0]==="view"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"view",viewId:r}:null}if(t[0]==="user"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"user",actorId:r}:null}if(t[0]==="architect-draft"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"architect-draft",actorId:r}:null}if(t[0]==="conversation"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"conversation",sessionId:r}:null}return null}chunkDPD6ZWL2_js.a(Oo,"parseLiveChannelKey");var al={"record.patch":true,"record.deleted":true,"record.removed":true,"record.created":true,"view.projection.stale":true,"agent.session.patch":true,"notification.created":true,"notification.recipient.patch":true,"notification.count.patch":true,"notification.inbox.archived":true,"reflex.state.changed":true,"reflex.run.completed":true,"reflex.authoring.progress":true,"architect.draft.updated":true,"meeting.recording.patch":true,"wallet.state":true,"channel.revoked":true},sl=Object.keys(al),ul=["membership-unknown","sort-unknown","permissions-changed"],ll=["permission-revoked","workspace-left","object-deleted"],dl=["inboxState","workState","lockedAt","lockedByActorId","readAt","archivedAt","snoozedUntil","completedAt","dismissedAt","updatedAt"],cl=["type","objectId","recordId","recordVersion"],pl=["type","objectId","recordId","recordVersion","record"],ml=["id","objectId","visibility","ownedBy","label","values","metadata","createdAt","updatedAt","createdBy","lastUpdatedBy","schemaVersion"],fl=["type","targetActorId","archivedCount","version","updatedAt"];function bl(e){return typeof e=="string"&&sl.includes(e)}chunkDPD6ZWL2_js.a(bl,"isLiveEventType");function iw(e){return C(e)&&bl(e.type)?gl(e.type,e):false}chunkDPD6ZWL2_js.a(iw,"isLiveEventPayload");function gl(e,t){if(!C(t))return false;switch(e){case "record.patch":return Il(t);case "record.deleted":return Sl(t);case "record.removed":return vl(t);case "record.created":return El(t);case "view.projection.stale":return Dl(t);case "agent.session.patch":return Cl(t);case "notification.created":return _l(t);case "notification.recipient.patch":return Pl(t);case "notification.count.patch":return Fl(t);case "notification.inbox.archived":return Vl(t);case "reflex.state.changed":return $l(t);case "reflex.run.completed":return ql(t);case "reflex.authoring.progress":return zl(t);case "architect.draft.updated":return Ul(t);case "meeting.recording.patch":return Wl(t);case "wallet.state":return Hl(t);case "channel.revoked":return Ql(t);default:return false}}chunkDPD6ZWL2_js.a(gl,"isLiveEventPayloadForType");function C(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(C,"isRecord");function F(e){return typeof e=="string"}chunkDPD6ZWL2_js.a(F,"isString");function ko(e){return F(e)&&e.length>0}chunkDPD6ZWL2_js.a(ko,"isNonEmptyString");function bt(e){return e===null||F(e)}chunkDPD6ZWL2_js.a(bt,"isNullableString");function yl(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}chunkDPD6ZWL2_js.a(yl,"isVersion");function K(e){if(!F(e))return false;let t=Date.parse(e);return Number.isFinite(t)&&new Date(t).toISOString()===e}chunkDPD6ZWL2_js.a(K,"isIsoDateString");function we(e){return e===null||K(e)}chunkDPD6ZWL2_js.a(we,"isNullableIsoDateString");function x(e,t){return F(e[t])}chunkDPD6ZWL2_js.a(x,"hasString");function re(e,t){return ko(e[t])}chunkDPD6ZWL2_js.a(re,"hasNonEmptyString");function N(e,t){return yl(e[t])}chunkDPD6ZWL2_js.a(N,"hasVersion");function k(e,t){return K(e[t])}chunkDPD6ZWL2_js.a(k,"hasIsoDateString");function w(e,t,r){return !Object.hasOwn(e,t)||r(e[t])}chunkDPD6ZWL2_js.a(w,"hasOptional");function gt(e,t){return Object.keys(e).every(r=>t.includes(r))}chunkDPD6ZWL2_js.a(gt,"hasOnlyKeys");function _(e,t){return typeof e=="string"&&t.includes(e)}chunkDPD6ZWL2_js.a(_,"isOneOf");function hl(e){return _(e,Oi)}chunkDPD6ZWL2_js.a(hl,"isNotificationKind");function Al(e){return _(e,ki)}chunkDPD6ZWL2_js.a(Al,"isNotificationPriority");function Tl(e){return _(e,_i)}chunkDPD6ZWL2_js.a(Tl,"isNotificationSensitivity");function _o(e){return _(e,Pi)}chunkDPD6ZWL2_js.a(_o,"isNotificationInboxState");function Po(e){return _(e,Fi)}chunkDPD6ZWL2_js.a(Po,"isNotificationWorkState");function wl(e){return C(e)&&x(e,"type")&&x(e,"id")}chunkDPD6ZWL2_js.a(wl,"isNotificationSubject");function xl(e){return C(e)&&x(e,"fieldKey")&&Object.hasOwn(e,"value")&&N(e,"version")}chunkDPD6ZWL2_js.a(xl,"isRecordFieldPatch");function Il(e){return e.type==="record.patch"&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&w(e,"label",F)&&w(e,"metadata",C)&&w(e,"fieldsWithheld",t=>t===true)&&Array.isArray(e.fieldPatches)&&e.fieldPatches.every(xl)&&x(e,"updatedAt")}chunkDPD6ZWL2_js.a(Il,"isRecordPatchPayload");function Sl(e){return e.type==="record.deleted"&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&x(e,"deletedAt")}chunkDPD6ZWL2_js.a(Sl,"isRecordDeletedPayload");function vl(e){return e.type==="record.removed"&&gt(e,cl)&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")}chunkDPD6ZWL2_js.a(vl,"isRecordRemovedPayload");function Rl(e){return C(e)&&gt(e,ml)&&x(e,"id")&&x(e,"objectId")&&_(e.visibility,["workspace","private"])&&bt(e.ownedBy)&&(e.visibility==="workspace"&&e.ownedBy===null||e.visibility==="private"&&ko(e.ownedBy))&&x(e,"label")&&C(e.values)&&w(e,"metadata",C)&&k(e,"createdAt")&&k(e,"updatedAt")&&w(e,"createdBy",F)&&w(e,"lastUpdatedBy",F)&&N(e,"schemaVersion")}chunkDPD6ZWL2_js.a(Rl,"isRecordLiveSnapshot");function El(e){return e.type==="record.created"&&gt(e,pl)&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&Rl(e.record)&&e.record.id===e.recordId&&e.record.objectId===e.objectId}chunkDPD6ZWL2_js.a(El,"isRecordCreatedPayload");function Dl(e){return e.type==="view.projection.stale"&&x(e,"viewId")&&_(e.reason,ul)}chunkDPD6ZWL2_js.a(Dl,"isViewProjectionStalePayload");function Cl(e){return e.type==="agent.session.patch"&&x(e,"sessionId")&&C(e.patch)&&N(e,"version")&&x(e,"updatedAt")}chunkDPD6ZWL2_js.a(Cl,"isAgentSessionPatchPayload");function Nl(e){return C(e)&&x(e,"id")&&x(e,"tenantId")&&w(e,"senderActorId",F)&&w(e,"rootActorId",F)&&w(e,"triggeredByActorId",F)&&hl(e.kind)&&x(e,"type")&&w(e,"subject",wl)&&x(e,"title")&&w(e,"summary",F)&&C(e.payload)&&Al(e.priority)&&Tl(e.sensitivity)&&w(e,"threadKey",F)&&w(e,"idempotencyKey",F)&&w(e,"expiresAt",K)&&k(e,"createdAt")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Nl,"isLiveNotification");function Ol(e){return C(e)&&x(e,"id")&&x(e,"tenantId")&&x(e,"notificationId")&&x(e,"recipientActorId")&&_o(e.inboxState)&&Po(e.workState)&&w(e,"lockedAt",K)&&w(e,"lockedByActorId",F)&&w(e,"readAt",K)&&w(e,"archivedAt",K)&&w(e,"snoozedUntil",K)&&w(e,"completedAt",K)&&w(e,"dismissedAt",K)&&k(e,"createdAt")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Ol,"isLiveNotificationRecipient");function kl(e){return C(e)?Object.keys(e).every(t=>dl.includes(t))&&w(e,"inboxState",_o)&&w(e,"workState",Po)&&w(e,"lockedAt",we)&&w(e,"lockedByActorId",bt)&&w(e,"readAt",we)&&w(e,"archivedAt",we)&&w(e,"snoozedUntil",we)&&w(e,"completedAt",we)&&w(e,"dismissedAt",we)&&w(e,"updatedAt",K):false}chunkDPD6ZWL2_js.a(kl,"isNotificationRecipientPatch");function _l(e){let t=Nl(e.notification)?e.notification:null;return e.type==="notification.created"&&t!==null&&Array.isArray(e.recipients)&&e.recipients.length>0&&e.recipients.every(r=>Ol(r)&&r.notificationId===t.id)&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(_l,"isNotificationCreatedPayload");function Pl(e){return e.type==="notification.recipient.patch"&&x(e,"recipientId")&&x(e,"recipientActorId")&&kl(e.patch)&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Pl,"isNotificationRecipientPatchPayload");function Fl(e){return e.type==="notification.count.patch"&&x(e,"targetActorId")&&N(e,"unread")&&N(e,"pendingWork")&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Fl,"isNotificationCountPatchPayload");function Vl(e){return e.type==="notification.inbox.archived"&&gt(e,fl)&&re(e,"targetActorId")&&N(e,"archivedCount")&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Vl,"isNotificationInboxArchivedPayload");var jl=["armed","disarmed"],Ml=["authoring","compiling","replaying","promoted","failed"],Ll=["promoted","lkg"],Bl=["composing","published","discarded"];function Ul(e){if(e.type!=="architect.draft.updated"||!C(e.draft))return false;let t=e.draft;return re(t,"id")&&re(t,"actorId")&&bt(t.agentSessionId)&&Array.isArray(t.operations)&&t.operations.every(C)&&C(t.baselines)&&_(t.status,Bl)}chunkDPD6ZWL2_js.a(Ul,"isArchitectDraftUpdatedPayload");function $l(e){return e.type==="reflex.state.changed"&&re(e,"reflexId")&&_(e.state,jl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a($l,"isReflexStateChangedPayload");function ql(e){return e.type==="reflex.run.completed"&&re(e,"reflexId")&&re(e,"runId")&&_(e.served,Ll)&&N(e,"version")&&N(e,"wallMs")&&k(e,"completedAt")}chunkDPD6ZWL2_js.a(ql,"isReflexRunCompletedPayload");function zl(e){return e.type==="reflex.authoring.progress"&&re(e,"reflexId")&&_(e.status,Ml)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(zl,"isReflexAuthoringProgressPayload");var Gl=["none","scheduled","recording","completed","failed"];function Wl(e){return e.type==="meeting.recording.patch"&&re(e,"meetingId")&&_(e.status,Gl)&&bt(e.failureReason)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Wl,"isMeetingRecordingPatchPayload");var Kl=["ok","low","exhausted","paused"],Yl=["metering-only","contract","wallet"];function Hl(e){return e.type==="wallet.state"&&_(e.status,Kl)&&_(e.mode,Yl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Hl,"isWalletStatePayload");function Ql(e){return e.type==="channel.revoked"&&x(e,"channel")&&_(e.reason,ll)}chunkDPD6ZWL2_js.a(Ql,"isChannelRevokedPayload");function Bn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Bn,"isRecord");function Jl(e){let{channel:t}=e;return typeof t=="string"&&Oo(t)?t:null}chunkDPD6ZWL2_js.a(Jl,"payloadChannel");function uw(e){return Bn(e)?Jl(e):null}chunkDPD6ZWL2_js.a(uw,"getLiveProtocolPayloadChannel");function lw(e){return Bn(e)?typeof e.id=="string"&&e.id.length>0&&typeof e.channel=="string"&&typeof e.type=="string"&&typeof e.tenantId=="string"&&e.tenantId.length>0&&typeof e.occurredAt=="string"&&Bn(e.payload):false}chunkDPD6ZWL2_js.a(lw,"isLiveEventEnvelope");var pw=["if","concat","sum","avg","count","min","max","earliest","latest","unique","first","percent_empty","percent_not_empty","count_empty","count_not_empty","count_unique"],_e={if:{name:"if",returnType:"branch",minArgs:3,maxArgs:3},concat:{name:"concat",returnType:{kind:"scalar",type:"text"},minArgs:1},sum:{name:"sum",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},avg:{name:"avg",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count:{name:"count",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},min:{name:"min",returnType:"source_item",minArgs:1,maxArgs:1},max:{name:"max",returnType:"source_item",minArgs:1,maxArgs:1},earliest:{name:"earliest",returnType:{kind:"scalar",type:"date"},minArgs:1,maxArgs:1},latest:{name:"latest",returnType:{kind:"scalar",type:"date"},minArgs:1,maxArgs:1},unique:{name:"unique",returnType:"argument",minArgs:1,maxArgs:1},first:{name:"first",returnType:"source_item",minArgs:1,maxArgs:1},percent_empty:{name:"percent_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},percent_not_empty:{name:"percent_not_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_empty:{name:"count_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_not_empty:{name:"count_not_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_unique:{name:"count_unique",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1}};function yt(e){return Object.hasOwn(_e,e)}chunkDPD6ZWL2_js.a(yt,"isComputedFunctionName");var zn=class zn extends Error{constructor(t){super(t),this.name="ComputedFormulaCompileError";}};chunkDPD6ZWL2_js.a(zn,"ComputedFormulaCompileError");var b=zn;function Bo(e){let t=Xl(e.expression),r=ht(t,e.schema),n=Td(r.valueType);if(n!==e.returnType)throw new b(`Computed formula "${e.attributeName}" returns "${n}", expected "${e.returnType}"`);if(Uo(e.returnType)&&r.optionsSource===void 0)throw new b(`Computed formula "${e.attributeName}" returns "${e.returnType}" without optionsSource`);let o=r.optionsSource===void 0?[]:[{kind:"options",source:r.optionsSource}],a=qn([...r.dependencies,...o]);return {kind:"formula",attributeName:e.attributeName,expression:e.expression,returnType:e.returnType,valueType:r.valueType,dependencies:a,ast:t,...r.optionsSource?{optionsSource:r.optionsSource}:{},...r.targetAttributeType?{targetAttributeType:r.targetAttributeType}:{},dependenciesHash:wd({expression:e.expression,returnType:e.returnType,dependencies:a})}}chunkDPD6ZWL2_js.a(Bo,"compileComputedFormula");function yw(e){let t=new Map(e.map(o=>[o.attributeName,o])),r=new Set,n=chunkDPD6ZWL2_js.a((o,a)=>{let s=a.indexOf(o);if(s!==-1){let I=[...a.slice(s),o];throw new b(`Computed field cycle detected: ${I.join(" -> ")}`)}if(r.has(o))return;let l=t.get(o);if(l===void 0)return;let p=[...a,o];for(let I of l.dependencies)I.kind==="computed"&&n(I.attributeName,p);r.add(o);},"visit");for(let o of e)n(o.attributeName,[]);}chunkDPD6ZWL2_js.a(yw,"assertAcyclicComputedDependencies");function Xl(e){try{return chunk47EGJRW7_js.e(e)}catch(t){throw t instanceof Error?new b(t.message):t}}chunkDPD6ZWL2_js.a(Xl,"parseCompileFormula");function ht(e,t){switch(e.kind){case "literal":return {valueType:Zl(e.value),dependencies:[],...typeof e.value=="string"?{literalString:e.value}:{}};case "path":return ed(e.parts,t);case "call":return ad(e.functionName,e.args,t);case "binary":return cd(e.operator,ht(e.left,t),ht(e.right,t));default:return e}}chunkDPD6ZWL2_js.a(ht,"inferNode");function Zl(e){switch(typeof e){case "string":return {kind:"scalar",type:"text"};case "number":return {kind:"scalar",type:"number"};case "boolean":return {kind:"scalar",type:"boolean"};case "object":return {kind:"scalar",type:"text"};default:return e}}chunkDPD6ZWL2_js.a(Zl,"literalToValueType");function ed(e,t){if(e.length===1){let r=e[0],n=Un(t,r);if(n===void 0)throw new b(`Unknown attribute "${r}" on object "${t.objectName}"`);return n.type==="relation"?{valueType:nd(),dependencies:[{kind:"relation",relationName:n.name,cardinality:Fo(n)}],targetAttributeType:n.type}:{valueType:Vo(n),dependencies:[rd(n)],optionsSource:jo(t.objectName,n),targetAttributeType:n.type}}if(e.length===2){let[r,n]=e,o=Un(t,r);if(o===void 0)throw new b(`Unknown attribute "${r}" on object "${t.objectName}"`);if(o.type!=="relation")throw new b(`Attribute "${r}" on object "${t.objectName}" is not a relation`);let a=td(o);if(a===void 0)throw new b(`Relation "${r}" on object "${t.objectName}" is missing targetObjectName`);let s=t.relatedObjects?.[a];if(s===void 0)throw new b(`Unknown related object "${a}"`);let l=Un(s,n);if(l===void 0)throw new b(`Unknown attribute "${n}" on object "${s.objectName}"`);let p=Vo(l);return {valueType:o.cardinality==="many"?od(p):p,dependencies:[{kind:"relation",relationName:r,targetAttributeName:n,cardinality:Fo(o)}],optionsSource:jo(s.objectName,l),targetAttributeType:l.type}}throw new b("Computed paths support at most one relation hop")}chunkDPD6ZWL2_js.a(ed,"inferPath");function Un(e,t){return e.attributes.find(r=>r.name===t)}chunkDPD6ZWL2_js.a(Un,"findAttribute");function td(e){if(e.targetObjectName!==void 0)return e.targetObjectName;if(e.targets?.length===1){let[t]=e.targets;return t?.object==="*"?void 0:t?.object}}chunkDPD6ZWL2_js.a(td,"getRelationTargetObjectName");function Fo(e){return e.cardinality??"one"}chunkDPD6ZWL2_js.a(Fo,"relationCardinality");function rd(e){return e.type==="formula"||e.type==="rollup"?{kind:"computed",attributeName:e.name}:{kind:"local",attributeName:e.name}}chunkDPD6ZWL2_js.a(rd,"localDependencyFor");function Vo(e){if(e.type==="formula"||e.type==="rollup"){if(e.returnType===void 0)throw new b(`Computed attribute "${e.name}" is missing returnType`);return id(e.returnType)}switch(e.type){case "number":case "currency":return {kind:"scalar",type:"number"};case "checkbox":return {kind:"scalar",type:"boolean"};case "date":return {kind:"scalar",type:"date"};case "select":case "status":return {kind:"scalar",type:"select"};case "multiselect":return {kind:"collection",itemType:"select"};case "text":case "richtext":case "phone":case "user":case "location":case "relation":case "document":return {kind:"scalar",type:"text"};default:return e.type}}chunkDPD6ZWL2_js.a(Vo,"attributeToValueType");function nd(){return {kind:"collection",itemType:"text"}}chunkDPD6ZWL2_js.a(nd,"relationToValueType");function id(e){return e==="multiselect"?{kind:"collection",itemType:"select"}:{kind:"scalar",type:e}}chunkDPD6ZWL2_js.a(id,"returnTypeToValueType");function od(e){return e.kind==="collection"?e:{kind:"collection",itemType:e.type}}chunkDPD6ZWL2_js.a(od,"asCollectionValueType");function jo(e,t){if(t.type==="formula"||t.type==="rollup")return Uo(t.returnType)?t.optionsSource:void 0;if(!(t.type!=="select"&&t.type!=="status"&&t.type!=="multiselect"))return t.optionsSource??{objectName:e,attributeName:t.name,...t.id?{attributeId:t.id}:{}}}chunkDPD6ZWL2_js.a(jo,"optionsSourceForAttribute");function ad(e,t,r){if(!yt(e))throw new b(`Unknown computed function "${e}"`);let n=_e[e];if(t.length<n.minArgs||n.maxArgs!==void 0&&t.length>n.maxArgs){let a=n.maxArgs===void 0||n.maxArgs===n.minArgs?String(n.minArgs):`${n.minArgs}-${n.maxArgs}`;throw new b(`Function "${e}" expects ${a} arguments, received ${t.length}`)}let o=t.map(a=>ht(a,r));return sd(e,o)}chunkDPD6ZWL2_js.a(ad,"inferCall");function sd(e,t){let r=qn(t.flatMap(n=>n.dependencies));switch(e){case "if":return ud(t,r);case "concat":return pd(t,`Function "${e}" does not accept collection values`),{valueType:{kind:"scalar",type:"text"},dependencies:r};case "sum":case "avg":return Mo(e,t[0],"number"),{valueType:{kind:"scalar",type:"number"},dependencies:r};case "count":case "count_empty":case "count_not_empty":case "count_unique":case "percent_empty":case "percent_not_empty":return fd(e,t[0]),{valueType:{kind:"scalar",type:"number"},dependencies:r};case "min":case "max":return md(e,t[0]),{valueType:bd(t[0]),dependencies:r,optionsSource:t[0].optionsSource,targetAttributeType:t[0].targetAttributeType};case "earliest":case "latest":return Mo(e,t[0],"date"),{valueType:{kind:"scalar",type:"date"},dependencies:r,targetAttributeType:t[0].targetAttributeType};case "unique":return ld(t[0],r);case "first":return dd(t[0],r);default:return e}}chunkDPD6ZWL2_js.a(sd,"inferFunctionReturn");function ud(e,t){$n(e[0].valueType,"boolean",'Function "if" condition must be boolean');let r=e[1],n=e[2],o=yd(r,n),a=hd(r,n);if(o===void 0)throw new b('Function "if" branches must return the same type');return {valueType:o,dependencies:t,...a?{optionsSource:a}:{},targetAttributeType:r.targetAttributeType??n.targetAttributeType}}chunkDPD6ZWL2_js.a(ud,"inferIfFunction");function ld(e,t){if(e.valueType.kind!=="collection"||e.valueType.itemType!=="select")throw new b('Function "unique" expects a select collection');return {valueType:{kind:"collection",itemType:"select"},dependencies:t,optionsSource:e.optionsSource,targetAttributeType:e.targetAttributeType}}chunkDPD6ZWL2_js.a(ld,"inferUniqueFunction");function dd(e,t){if(e.valueType.kind!=="collection")throw new b('Function "first" expects a collection');return {valueType:{kind:"scalar",type:e.valueType.itemType},dependencies:t,optionsSource:e.optionsSource,targetAttributeType:e.targetAttributeType}}chunkDPD6ZWL2_js.a(dd,"inferFirstFunction");function cd(e,t,r){let n=qn([...t.dependencies,...r.dependencies]),o=e==="+"||e==="-"||e==="*"||e==="/";if(t.valueType.kind==="collection"||r.valueType.kind==="collection")throw new b(`Cannot use collection values with ${o?"arithmetic":"comparison"} operator "${e}"`);if(o)return e==="+"&&(t.valueType.type==="text"||r.valueType.type==="text")?{valueType:{kind:"scalar",type:"text"},dependencies:n}:($n(t.valueType,"number",`Operator "${e}" expects number operands`),$n(r.valueType,"number",`Operator "${e}" expects number operands`),{valueType:{kind:"scalar",type:"number"},dependencies:n});if(e==="=="||e==="!="){if(t.valueType.type!==r.valueType.type)throw new b(`Operator "${e}" expects operands with the same scalar type`);return {valueType:{kind:"scalar",type:"boolean"},dependencies:n}}if((t.valueType.type!=="number"||r.valueType.type!=="number")&&(t.valueType.type!=="date"||r.valueType.type!=="date"))throw new b(`Operator "${e}" expects number or date operands of the same type`);return {valueType:{kind:"scalar",type:"boolean"},dependencies:n}}chunkDPD6ZWL2_js.a(cd,"inferBinary");function pd(e,t){for(let r of e)if(r.valueType.kind==="collection")throw new b(t)}chunkDPD6ZWL2_js.a(pd,"ensureNoCollections");function Mo(e,t,r){if((t.valueType.kind==="collection"?t.valueType.itemType:t.valueType.type)!==r)throw new b(`Function "${e}" expects ${r} values`)}chunkDPD6ZWL2_js.a(Mo,"ensureCollectionOrScalarType");function md(e,t){if(t.valueType.kind!=="collection")throw new b(`Function "${e}" expects a collection`);let r=t.valueType.itemType;if(r!=="number"&&r!=="date")throw new b(`Function "${e}" expects number or date values`)}chunkDPD6ZWL2_js.a(md,"ensureMinMaxSource");function fd(e,t){if(t.valueType.kind!=="collection")throw new b(`Function "${e}" expects a collection`)}chunkDPD6ZWL2_js.a(fd,"ensureCollectionSource");function $n(e,t,r){if(e.kind!=="scalar"||e.type!==t)throw new b(r)}chunkDPD6ZWL2_js.a($n,"ensureScalarType");function bd(e){return e.valueType.kind==="scalar"?e.valueType:{kind:"scalar",type:e.valueType.itemType}}chunkDPD6ZWL2_js.a(bd,"sourceItemValueType");function gd(e,t){return e.kind==="scalar"?t.kind==="scalar"&&e.type===t.type:t.kind==="collection"&&e.itemType===t.itemType}chunkDPD6ZWL2_js.a(gd,"sameValueType");function yd(e,t){if(gd(e.valueType,t.valueType)||Lo(e,t))return e.valueType;if(Lo(t,e))return t.valueType}chunkDPD6ZWL2_js.a(yd,"resolveIfBranchValueType");function Lo(e,t){return e.valueType.kind==="scalar"&&e.valueType.type==="select"&&t.valueType.kind==="scalar"&&t.valueType.type==="text"&&t.literalString!==void 0}chunkDPD6ZWL2_js.a(Lo,"isSelectScalarWithStringLiteral");function hd(e,t){let r=e.optionsSource,n=t.optionsSource;if(r!==void 0&&n!==void 0&&!Ad(r,n))throw new b('Function "if" branches use incompatible options sources');return r??n}chunkDPD6ZWL2_js.a(hd,"resolveIfOptionsSource");function Ad(e,t){return e.objectName===t.objectName&&e.attributeName===t.attributeName&&e.attributeId===t.attributeId}chunkDPD6ZWL2_js.a(Ad,"sameOptionsSource");function Uo(e){return e==="select"||e==="multiselect"}chunkDPD6ZWL2_js.a(Uo,"isSelectLikeReturnType");function Td(e){if(e.kind==="scalar")return e.type;if(e.itemType==="select")return "multiselect";throw new b(`Collection item type "${e.itemType}" cannot be used as a computed return type`)}chunkDPD6ZWL2_js.a(Td,"valueTypeToReturnType");function qn(e){let t=new Set,r=[];for(let n of e){let o=JSON.stringify(Pe(n));t.has(o)||(t.add(o),r.push(n));}return r}chunkDPD6ZWL2_js.a(qn,"uniqueDependencies");function wd(e){let t=e.dependencies.map(r=>Pe(r)).sort((r,n)=>$o(JSON.stringify(r),JSON.stringify(n)));return JSON.stringify(Pe({expression:e.expression,returnType:e.returnType,dependencies:t}))}chunkDPD6ZWL2_js.a(wd,"createDependenciesHash");function Pe(e){return Array.isArray(e)?e.map(t=>Pe(t)):e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>$o(t,r)).map(([t,r])=>[t,Pe(r)])):e}chunkDPD6ZWL2_js.a(Pe,"stableNormalize");function $o(e,t){return e<t?-1:e>t?1:0}chunkDPD6ZWL2_js.a($o,"compareStrings");function xd(e){return e.function==="count"?`count(${e.relationAttribute})`:`${vd(e.function)}(${e.relationAttribute}.${e.targetAttribute})`}chunkDPD6ZWL2_js.a(xd,"rollupToFormulaExpression");function Id(e,t){if(e.function==="count")return "number";let r=Rd(e,t);switch(e.function){case "countValues":case "countEmpty":case "percentEmpty":case "percentNotEmpty":case "countUniqueValues":return "number";case "sum":case "avg":return "number";case "earliest":case "latest":return "date";case "original":if(!Dd(r.type))throw new b('Rollup "original" requires a select, status, or multiselect target');return "multiselect";default:return e.function}}chunkDPD6ZWL2_js.a(Id,"inferRollupReturnType");function ww(e,t){let r=xd(e),n=Id(e,t);return {...Bo({attributeName:e.name,expression:r,returnType:n,schema:Sd(e,t)}),kind:"rollup"}}chunkDPD6ZWL2_js.a(ww,"compileRollupAttribute");function Sd(e,t){return {...t,attributes:t.attributes.map(r=>r.name===e.relationAttribute&&r.type==="relation"?{...r,cardinality:"many"}:r)}}chunkDPD6ZWL2_js.a(Sd,"schemaWithRollupRelationAsMany");function vd(e){switch(e){case "sum":case "avg":case "earliest":case "latest":return e;case "original":return "unique";case "countValues":return "count_not_empty";case "countEmpty":return "count_empty";case "percentEmpty":return "percent_empty";case "percentNotEmpty":return "percent_not_empty";case "countUniqueValues":return "count_unique";default:return e}}chunkDPD6ZWL2_js.a(vd,"rollupFunctionToFormulaFunction");function Rd(e,t){let r=qo(t,e.relationAttribute);if(r===void 0)throw new b(`Unknown relation attribute "${e.relationAttribute}" on object "${t.objectName}"`);if(r.type!=="relation")throw new b(`Attribute "${e.relationAttribute}" on object "${t.objectName}" is not a relation`);let n=Ed(r);if(n===void 0)throw new b(`Relation "${e.relationAttribute}" on object "${t.objectName}" is missing targetObjectName`);let o=t.relatedObjects?.[n];if(o===void 0)throw new b(`Unknown related object "${n}"`);let a=qo(o,e.targetAttribute);if(a===void 0)throw new b(`Unknown attribute "${e.targetAttribute}" on object "${o.objectName}"`);return a}chunkDPD6ZWL2_js.a(Rd,"findRollupTargetAttribute");function qo(e,t){return e.attributes.find(r=>r.name===t)}chunkDPD6ZWL2_js.a(qo,"findAttribute");function Ed(e){if(e.targetObjectName!==void 0)return e.targetObjectName;if(e.targets?.length===1){let[t]=e.targets;return t?.object==="*"?void 0:t?.object}}chunkDPD6ZWL2_js.a(Ed,"getRelationTargetObjectName");function Dd(e){return e==="select"||e==="status"||e==="multiselect"}chunkDPD6ZWL2_js.a(Dd,"isSelectLikeAttributeType");function X(e,t){switch(e.kind){case "literal":return e.value;case "path":return Nd(t,e.parts);case "binary":return Od(e.operator,X(e.left,t),X(e.right,t));case "call":return Cd(e.functionName,e.args,t);default:return e}}chunkDPD6ZWL2_js.a(X,"evaluateAst");function Cd(e,t,r){if(_d(e),Pd(e,t.length),e==="if"){let n=X(t[0],r);return n===null?null:X(n?t[1]:t[2],r)}return Fd(e,t.map(n=>X(n,r)))}chunkDPD6ZWL2_js.a(Cd,"evaluateCallNode");function Nd(e,t){return t.reduce((r,n)=>Ho(r,n),e)}chunkDPD6ZWL2_js.a(Nd,"resolvePath");function Ho(e,t){if(Array.isArray(e))return e.map(n=>Ho(n,t));if(!Yo(e))return null;if(Object.hasOwn(e,t))return e[t]??null;let r=e.values;return Yo(r)&&Object.hasOwn(r,t)?r[t]??null:null}chunkDPD6ZWL2_js.a(Ho,"resolvePathPart");function Od(e,t,r){switch(e){case "+":return kd(t,r);case "-":return Tt(t,r,(n,o)=>n-o);case "*":return Tt(t,r,(n,o)=>n*o);case "/":return Tt(t,r,(n,o)=>n/o);case ">":return At(t,r,n=>n>0);case "<":return At(t,r,n=>n<0);case ">=":return At(t,r,n=>n>=0);case "<=":return At(t,r,n=>n<=0);case "==":return zo(t,r);case "!=":{let n=zo(t,r);return n===null?null:!n}default:return e}}chunkDPD6ZWL2_js.a(Od,"evaluateBinary");function kd(e,t){return typeof e=="string"||typeof t=="string"?`${e??""}${t??""}`:Tt(e,t,(r,n)=>r+n)}chunkDPD6ZWL2_js.a(kd,"add");function At(e,t,r){let n=Qo(e,t);return n===null?null:r(n)}chunkDPD6ZWL2_js.a(At,"compareWith");function Qo(e,t){if(!xe([e,t]))return null;let r=Ie(e),n=Ie(t);if(r!==null&&n!==null)return r-n;let o=Kn(e),a=Kn(t);return o&&a?o.getTime()-a.getTime():null}chunkDPD6ZWL2_js.a(Qo,"compare");function zo(e,t){return e===t?true:e==null||t===null||t===void 0?false:xe([e,t])?Qo(e,t)===0:null}chunkDPD6ZWL2_js.a(zo,"equalScalar");function _d(e){if(!yt(e))throw new Error(`Unknown computed function "${e}"`)}chunkDPD6ZWL2_js.a(_d,"assertComputedFunctionName");function Pd(e,t){let{minArgs:r,maxArgs:n}=_e[e];if(t>=r&&t<=(n??Number.POSITIVE_INFINITY))return;let o=n===void 0?`at least ${r}`:`between ${r} and ${n}`;throw new Error(`Function "${e}" expects ${o} arguments, received ${t}`)}chunkDPD6ZWL2_js.a(Pd,"validateArity");function Fd(e,t){switch(e){case "concat":return t.filter(r=>r!=null).map(String).join("");case "sum":return xe(t)?Gn(t).reduce((r,n)=>r+n,0):null;case "avg":{if(!xe(t))return null;let r=Gn(t);return r.length>0?r.reduce((n,o)=>n+o,0)/r.length:null}case "count":return de(t[0]).length;case "min":return Go(t,"min");case "max":return Go(t,"max");case "earliest":return Wn(t,"min");case "latest":return Wn(t,"max");case "unique":return Ko(de(t[0]));case "first":return de(t[0]).find(r=>r!=null)??null;case "percent_empty":return Wo(t[0],true);case "percent_not_empty":return Wo(t[0],false);case "count_empty":return de(t[0]).filter(chunk5QAE5NPN_js.a).length;case "count_not_empty":return de(t[0]).filter(r=>!chunk5QAE5NPN_js.a(r)).length;case "count_unique":return Ko(de(t[0])).length;default:return e}}chunkDPD6ZWL2_js.a(Fd,"evaluateCall");function Gn(e){return wt(e).map(Ie).filter(t=>t!==null)}chunkDPD6ZWL2_js.a(Gn,"numericValues");function xe(e){let t=new Set;for(let r of wt(e))Yn(r)&&t.add(Jo(r));return t.size<=1}chunkDPD6ZWL2_js.a(xe,"areCommensurable");function Jo(e){return e.code.toUpperCase()}chunkDPD6ZWL2_js.a(Jo,"currencyCode");function Tt(e,t,r){if(!xe([e,t]))return null;let n=Ie(e),o=Ie(t);if(n===null||o===null)return null;let a=r(n,o);return Number.isFinite(a)?a:null}chunkDPD6ZWL2_js.a(Tt,"numericBinary");function Go(e,t){if(!xe(e))return null;let r=Gn(e);return r.length>0?t==="min"?Math.min(...r):Math.max(...r):Wn(e,t)}chunkDPD6ZWL2_js.a(Go,"minMax");function Wn(e,t){let r=wt(e).map(Kn).filter(a=>a!==null);if(r.length===0)return null;let n=r.map(a=>a.getTime()),o=t==="min"?Math.min(...n):Math.max(...n);return new Date(o).toISOString()}chunkDPD6ZWL2_js.a(Wn,"dateMinMax");function Wo(e,t){let r=de(e);return r.length===0?0:r.filter(o=>chunk5QAE5NPN_js.a(o)===t).length/r.length}chunkDPD6ZWL2_js.a(Wo,"percentByEmptyState");function Ko(e){let t=new Set,r=[];for(let n of e){if(chunk5QAE5NPN_js.a(n))continue;let o=Vd(n);t.has(o)||(t.add(o),r.push(n));}return r}chunkDPD6ZWL2_js.a(Ko,"uniqueNonEmpty");function de(e){return e==null?[]:Array.isArray(e)?wt(e):[e]}chunkDPD6ZWL2_js.a(de,"collectionItems");function wt(e){return e.flat(Number.POSITIVE_INFINITY)}chunkDPD6ZWL2_js.a(wt,"flatten");function Ie(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return Yn(e)&&Number.isFinite(e.value)?e.value:null}chunkDPD6ZWL2_js.a(Ie,"toFiniteNumber");function Yn(e){return typeof e=="object"&&e!==null&&typeof e.value=="number"&&typeof e.code=="string"}chunkDPD6ZWL2_js.a(Yn,"isCurrencyValue");function Kn(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e!="string"){let r=fe(e);if(r===null)return null;let n=new Date(r);return Number.isNaN(n.getTime())?null:n}let t=new Date(e);return Number.isNaN(t.getTime())?null:t}chunkDPD6ZWL2_js.a(Kn,"toDate");function Vd(e){if(Yn(e))return `currency:${Jo(e)}:${e.value}`;let t=Ie(e);return t!==null?`number:${t}`:e instanceof Date?`date:${e.toISOString()}`:`${typeof e}:${JSON.stringify(e)}`}chunkDPD6ZWL2_js.a(Vd,"uniqueKey");function Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Yo,"isPlainRecord");function jd(e,t,r){if(e==null)return null;let n=chunkDPD6ZWL2_js.a(o=>typeof o=="string"||typeof o=="number"||typeof o=="boolean"||o instanceof Date?String(o):null,"stringifyScalar");switch(t){case "number":{let o=typeof e=="number"?e:Number(e);return Number.isNaN(o)?null:r!==void 0?Number(o.toFixed(r)):o}case "boolean":return !!e;case "date":return e instanceof Date?e.toISOString():typeof e=="string"?e:null;case "text":return String(e);case "select":if(Array.isArray(e)){for(let o of e){if(o==null)continue;let a=n(o);if(a!==null)return a}return null}return n(e);case "multiselect":return Array.isArray(e)?e.flatMap(o=>{if(o==null)return [];let a=n(o);return a===null?[]:[a]}):n(e)===null?[]:[String(e)];default:{let o=t;throw new Error(`Unsupported computed return type: ${o}`)}}}chunkDPD6ZWL2_js.a(jd,"formatComputedResult");function Dw(e,t){return X(e,t)}chunkDPD6ZWL2_js.a(Dw,"evaluateComputedAst");function Cw(e,t){return X(chunk47EGJRW7_js.e(e),t)}chunkDPD6ZWL2_js.a(Cw,"evaluateComputedFormula");function Nw(e,t,r,n){try{let o=X(chunk47EGJRW7_js.e(e),t);return {value:r?jd(o,r,n):o}}catch(o){return {value:null,error:o instanceof Error?o.message:String(o)}}}chunkDPD6ZWL2_js.a(Nw,"evaluateComputedFormulaWithResult");var _w=[{name:"if",signature:"if(condition, then, else)",description:"Conditional value",category:"logic",example:"if(amount > 100, 'big', 'small')"},{name:"concat",signature:"concat(a, b, ...)",description:"Join values into text",category:"text",example:"concat(firstName, ' ', lastName)"},{name:"sum",signature:"sum(collection)",description:"Total of values",category:"number",example:"sum(orders.amount)"},{name:"avg",signature:"avg(collection)",description:"Average of values",category:"number",example:"avg(orders.amount)"},{name:"min",signature:"min(collection)",description:"Smallest value",category:"number",example:"min(orders.amount)"},{name:"max",signature:"max(collection)",description:"Largest value",category:"number",example:"max(orders.amount)"},{name:"count",signature:"count(collection)",description:"Number of items",category:"collection",example:"count(orders)"},{name:"count_empty",signature:"count_empty(collection)",description:"Items with no value",category:"collection",example:"count_empty(orders.note)"},{name:"count_not_empty",signature:"count_not_empty(collection)",description:"Items with a value",category:"collection",example:"count_not_empty(orders.note)"},{name:"count_unique",signature:"count_unique(collection)",description:"Distinct values",category:"collection",example:"count_unique(orders.status)"},{name:"percent_empty",signature:"percent_empty(collection)",description:"Fraction with no value",category:"collection",example:"percent_empty(orders.note)"},{name:"percent_not_empty",signature:"percent_not_empty(collection)",description:"Fraction with a value",category:"collection",example:"percent_not_empty(orders.note)"},{name:"unique",signature:"unique(collection)",description:"Distinct values as a list",category:"collection",example:"unique(orders.status)"},{name:"first",signature:"first(collection)",description:"First non-empty value",category:"collection",example:"first(orders.status)"},{name:"earliest",signature:"earliest(collection)",description:"Earliest date",category:"date",example:"earliest(orders.closeDate)"},{name:"latest",signature:"latest(collection)",description:"Latest date",category:"date",example:"latest(orders.closeDate)"}];var Xo=chunkDPD6ZWL2_js.a(e=>chunk5QAE5NPN_js.a(e)||Array.isArray(e)&&e.length===0,"isEmpty"),V=chunkDPD6ZWL2_js.a(e=>e==null?"":String(e),"toStr"),St=chunkDPD6ZWL2_js.a(e=>{if(chunk5QAE5NPN_js.a(e))return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},"toNum"),vt=chunkDPD6ZWL2_js.a(e=>{if(e==null)return null;let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t},"toDate"),xt=chunkDPD6ZWL2_js.a(e=>Array.isArray(e)?e:e==null?[]:[e],"toArr"),Md=chunkDPD6ZWL2_js.a((e,t,r)=>{let n=St(e),o=St(t);return n!==null&&o!==null&&r(n,o)},"compareNumbers"),Ld=chunkDPD6ZWL2_js.a((e,t,r)=>{let n=vt(e),o=vt(t);return n!==null&&o!==null&&r(n.getTime(),o.getTime())},"compareDates"),Zo=chunkDPD6ZWL2_js.a((e,t,r)=>{if(r.type==="number"||r.type==="currency"){let n=St(e),o=St(t);if(n!==null&&o!==null)return n===o}return V(e)===V(t)},"equalsForAttr");function jw(e,t){return e?e==="checkbox":typeof t=="boolean"}chunkDPD6ZWL2_js.a(jw,"isCheckboxEquality");var It=chunkDPD6ZWL2_js.a(e=>({appliesTo:["number","currency","date","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((t,r,n)=>n.type==="date"?Ld(t,r,e):Md(t,r,e),"evaluateInMemory")}),"orderingSpec"),Rt={is:{appliesTo:["text","phone","number","currency","checkbox","status","select","date","user","relation","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t,r)=>r.type==="checkbox"?e===true==(t===true):Zo(e,t,r),"evaluateInMemory")},is_not:{appliesTo:["text","phone","number","currency","status","select","date","user","relation","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t,r)=>!Zo(e,t,r),"evaluateInMemory")},contains:{appliesTo:["text","phone","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().includes(V(t).toLowerCase()),"evaluateInMemory")},not_contains:{appliesTo:["text","phone","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>!V(e).toLowerCase().includes(V(t).toLowerCase()),"evaluateInMemory")},starts_with:{appliesTo:["text","phone"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().startsWith(V(t).toLowerCase()),"evaluateInMemory")},ends_with:{appliesTo:["text"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().endsWith(V(t).toLowerCase()),"evaluateInMemory")},is_empty:{appliesTo:["text","richtext","number","phone","currency","status","select","date","multiselect","location","user","relation","formula","document"],evaluateInMemory:chunkDPD6ZWL2_js.a(e=>Xo(e),"evaluateInMemory")},is_not_empty:{appliesTo:["text","richtext","number","phone","currency","status","select","date","multiselect","location","user","relation","formula","document"],evaluateInMemory:chunkDPD6ZWL2_js.a(e=>!Xo(e),"evaluateInMemory")},less_than:It((e,t)=>e<t),greater_than:It((e,t)=>e>t),less_or_equal:It((e,t)=>e<=t),greater_or_equal:It((e,t)=>e>=t),is_within:{appliesTo:["date"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=vt(e),n=chunkVJYVPQ5E_js.Q(t);return r&&n?r.getTime()>=n.startMs&&r.getTime()<n.endMs:false},"evaluateInMemory")},on_day_month:{appliesTo:["date"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=vt(e);if(!r)return false;let n=t;return r.getMonth()+1===n.month&&r.getDate()===n.day},"evaluateInMemory")},any_of:{appliesTo:["status","select","multiselect","user","relation"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=xt(t).map(V);return xt(e).map(V).some(o=>r.includes(o))},"evaluateInMemory")},none_of:{appliesTo:["status","select","multiselect","user","relation"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=xt(t).map(V);return !xt(e).map(V).some(o=>r.includes(o))},"evaluateInMemory")}};var Bd=chunkDPD6ZWL2_js.a((e,t)=>({id:`system:${e}`,name:e,label:e,type:t,system:true}),"systemAttribute"),Ud=[...Object.entries(chunkVJYVPQ5E_js.T).map(([e,t])=>Bd(e,t))];function Yw(e,t,r){let n=t;return $d(e,{...t.values,id:t.id,objectId:t.objectId,objectName:n.objectName,tenantId:n.tenantId,label:t.label,createdAt:t.createdAt,updatedAt:t.updatedAt,createdBy:t.createdBy,lastUpdatedBy:t.lastUpdatedBy,deletedAt:t.deletedAt,deletedBy:t.deletedBy,visibility:t.visibility,ownedBy:t.ownedBy},[...r,...Ud])}chunkDPD6ZWL2_js.a(Yw,"evaluateRecordFilterState");function $d(e,t,r){if(e.rules.length===0)return true;let n=new Map(r.map(a=>[a.name,a])),o=e.combinator==="or"?"some":"every";return e.rules[o](a=>qd(a,t,n))}chunkDPD6ZWL2_js.a($d,"evaluateFilterState");function qd(e,t,r){let n=r.get(e.attribute);if(!n)return false;if(e.property&&n.type==="location"){if(!(chunkVJYVPQ5E_js.g(e.property)&&chunkVJYVPQ5E_js.h(e.operator)))return false;let l=Rt[e.operator];if(!l)return false;let p=t[e.attribute],I=typeof p=="object"&&p!==null?p[e.property]:void 0;return Hn(l,"text",e.operator,I,e.value,n)}if(e.property){let l=Yi(n).find(j=>j.name===e.property);if(!l)return false;let p=chunkVJYVPQ5E_js.I(e.operator),I=Rt[p];if(!I?.appliesTo.includes(l.type))return false;let Z=t[e.attribute],ae=(Array.isArray(Z)?Z:Z==null?[]:[Z]).some(j=>{if(typeof j!="object"||j===null)return false;let H=j.props;return typeof H!="object"||H===null?false:Hn(I,l.type,p,H[e.property],e.value,l)});return (e.quantifier??chunkVJYVPQ5E_js.H(e.operator))==="none"?!ae:ae}let o=Rt[e.operator];if(!o||!o.appliesTo.includes(n.type))return false;let a=t[e.attribute],s=n.type==="relation"||n.type==="document"||n.type==="user"?Wd(a):a;return Hn(o,n.type,e.operator,s,e.value,n)}chunkDPD6ZWL2_js.a(qd,"evaluateRule");function Hn(e,t,r,n,o,a){let[s,l]=zd(t,r,n,o);return t==="phone"&&l===""&&r==="contains"?false:t==="phone"&&l===""&&r==="not_contains"?true:e.evaluateInMemory(s,l,a)}chunkDPD6ZWL2_js.a(Hn,"evaluateNormalizedComparands");function zd(e,t,r,n){return e==="date"&&(t==="is"||t==="is_not")?[ea(r),ea(n)]:e==="phone"?Gd(r,n):[ta(e,r),ta(e,n)]}chunkDPD6ZWL2_js.a(zd,"normalizeOperatorComparands");function ea(e){let t=ee(e)?fe(e):e;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.toISOString().slice(0,10);if(typeof t!="string"||t==="")return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t))return t;let r=new Date(t);return Number.isNaN(r.getTime())?null:r.toISOString().slice(0,10)}chunkDPD6ZWL2_js.a(ea,"normalizeUtcCalendarDay");function Gd(e,t){let r=typeof t=="object"&&t!==null?t:{},n=typeof r.countryCode=="string"?r.countryCode:void 0,o=chunkDPD6ZWL2_js.a(a=>{let s=typeof a=="object"&&a!==null?a:{phoneNumber:a};if(typeof s.phoneNumber!="string")return null;if(!n)return chunkGXSNLYRR_js.a(s.phoneNumber);let l=typeof s.countryCode=="string"?s.countryCode:n;return `${l}:${chunkGXSNLYRR_js.b(s.phoneNumber,l)}`},"normalizeOne");return [o(e),o(t)]}chunkDPD6ZWL2_js.a(Gd,"normalizePhoneComparands");function ta(e,t){return e==="currency"?chunkVJYVPQ5E_js.F(t):e==="date"?ee(t)?fe(t):t instanceof Date?Number.isNaN(t.getTime())?null:t.toISOString():t:t}chunkDPD6ZWL2_js.a(ta,"normalizeComparableValue");function Wd(e){let t=chunkDPD6ZWL2_js.a(r=>typeof r!="object"||r===null?r:r.id,"normalizeOne");return Array.isArray(e)?e.map(t):t(e)}chunkDPD6ZWL2_js.a(Wd,"normalizeReferenceIds");var ra="today";function Et(e,t){return new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}chunkDPD6ZWL2_js.a(Et,"dateInTimezone");function Kd(e,t){if(!("defaultValue"in e))return;let{defaultValue:r}=e;return e.type!=="date"||r!==ra?r:e.includeTime?t.now.toISOString():Et(t.now,t.timezone)}chunkDPD6ZWL2_js.a(Kd,"resolveAttributeDefaultValue");function rx(e,t,r){if(e.combinator==="or"&&e.rules.length>1)return {};let n=new Map(t.map(a=>[a.name,a])),o={};for(let a of e.rules){if(a.property!==void 0||Object.hasOwn(o,a.attribute))continue;let s=n.get(a.attribute);if(!s)continue;let l=Yd(a,r);l!==void 0&&(o[a.attribute]=chunkVJYVPQ5E_js.j(s).storage.cardinality==="many"?[l]:l);}return o}chunkDPD6ZWL2_js.a(rx,"deriveCreateDefaultsFromFilters");function Yd(e,t){if(e.operator==="is")return chunkVJYVPQ5E_js.B(e.value)?na(e.value,t):e.value===null||Array.isArray(e.value)?void 0:e.value;if(e.operator==="any_of"){if(!Array.isArray(e.value)||e.value.length!==1)return;let r=e.value[0];return chunkVJYVPQ5E_js.B(r)?na(r,t):r}}chunkDPD6ZWL2_js.a(Yd,"extractDeterministicValue");function na(e,t){if(t){if(e.dynamic==="actor")return t.userId;if(e.anchor==="today")return Et(t.now,t.timezone);if(e.anchor==="now")return t.now.toISOString()}}chunkDPD6ZWL2_js.a(na,"resolveDynamicValue");var ox={status:"connector_status",error:"connector_error",provider:"connector_provider"};var Hd=(t=>(t.Desktop="desktop",t))(Hd||{});var ux=["force","skip"],lx=["none","all","external_only"],dx="x-fake-signature",cx={override:null,status:"none",failureReason:null,botId:null};var Qd=/^Session \d+$/;function ia(e){let t=e.replace(/\s+/g," ").trim().replace(/[.!?]+$/,"");return t?t.length>60?`${t.slice(0,59).trimEnd()}...`:t:"New conversation"}chunkDPD6ZWL2_js.a(ia,"buildAgentFallbackTitle");function Jd(e){let t=e.generated?.trim();return t&&!Qd.test(t)?t:e.firstUserText?ia(e.firstUserText):e.emptyLabel}chunkDPD6ZWL2_js.a(Jd,"conversationDisplayTitle");var Qn=/^[a-z0-9][a-z0-9-]{0,62}$/;function Xd(e){if(!Qn.test(e))throw new chunk72TQRSNX_js.h(`Invalid schema source id "${e}": expected a lowercase slug matching ${Qn}`,[])}chunkDPD6ZWL2_js.a(Xd,"assertSchemaSourceId");function Zd(e){return {label:e.label,description:e.description??null,icon:e.icon??null,config:e.config,default:e.default??false,metadata:e.metadata??null}}chunkDPD6ZWL2_js.a(Zd,"viewSyncPayload");function Tx(e){let{attributeRemovals:t,objectRemovals:r,renames:n}=e.destructive;return t.length>0||r.length>0||n.length>0}chunkDPD6ZWL2_js.a(Tx,"hasDestructiveEntries");var $={objectAdditions:20,totalMutations:500,serializedBytes:512*1024};function Xn(e){return e instanceof Error?e.message:String(e)}chunkDPD6ZWL2_js.a(Xn,"errorMessage");var ec=Xt.z.enum(["text","richtext","number","checkbox","date","phone","currency","status","location","select","multiselect","user","relation","formula","rollup","document"]).describe('The attribute\'s data type. Determines which keys `config` accepts and requires: `status`/`select`/`multiselect` need a non-empty `options` array (each `status` option carrying its own `group`); `relation` needs `targets` (non-empty) and `cardinality` ("one" or "many"); `formula` needs `expression` and `returnType`; `rollup` needs `targetAttribute` and `function`. Every other type accepts only the shared presentation keys (`placeholder`, `defaultValue`, `icon`, ...) plus a few type-specific optionals (e.g. `number.decimals`, `date.dateFormat`). An attribute\'s type can never be changed later through this tool \u2014 only through a code migration \u2014 so pick it correctly now.');var ca=Xt.z.string().min(1).superRefine((e,t)=>{try{Ce(e);}catch(r){t.addIssue({code:Xt.z.ZodIssueCode.custom,message:Xn(r)});}}).describe('The attribute\'s machine name \u2014 the record\'s field key, and what `{{ name }}` refers to in a labelExpression. Must be a valid identifier: starts with a letter or underscore, then only letters/digits/underscores ("montantHt", "first_name", "FIRST_NAME" are valid; "first-name", "first name", "123name" are not). Max 63 characters. Cannot be a name reserved by the record shape itself (id, createdAt, updatedAt, createdBy, lastUpdatedBy, objectId, label, embeddingText, values, metadata, deletedAt, deletedBy, schemaVersion).'),tc=Xt.z.string().min(1).superRefine((e,t)=>{chunkVJYVPQ5E_js.A.includes(e)&&t.addIssue({code:Xt.z.ZodIssueCode.custom,message:`"${e}" is a reserved object name (${chunkVJYVPQ5E_js.A.join(", ")}) and cannot be used for a new object.`});try{De(e);}catch(r){t.addIssue({code:Xt.z.ZodIssueCode.custom,message:Xn(r)});}}).describe(`The new object's machine name: kebab-case slug, lowercase letters/digits/hyphens only, starting with a letter ("products", "user-profiles", "order-items" are valid; "Products", "userProfiles", "user_profiles" are not). Max 63 characters. Cannot be a name the platform reserves for its own system objects, and cannot already exist.`);function pa(e){return e.superRefine((t,r)=>{try{let n=chunk47EGJRW7_js.n(t.type,{...t.config??{},description:t.description}),o=Object.keys(t.config??{}).filter(a=>!Object.hasOwn(n,a));o.length>0&&r.addIssue({code:"unrecognized_keys",keys:o,path:["config"],message:`Unrecognized attribute config key${o.length===1?"":"s"}: ${o.join(", ")}`});}catch(n){if(n instanceof chunk72TQRSNX_js.h){for(let o of n.errors)r.addIssue({code:Xt.z.ZodIssueCode.custom,path:["config",...o.path.map(a=>/^\d+$/.test(a)?Number(a):a)],message:`Config for type "${t.type}" is invalid or incomplete: ${o.message}`});return}r.addIssue({code:Xt.z.ZodIssueCode.custom,path:["config"],message:`Config for type "${t.type}" is invalid or incomplete: ${Xn(n)}`});}})}chunkDPD6ZWL2_js.a(pa,"withConfigCheck");var ma=Xt.z.object({objectName:Xt.z.string().min(1).describe("Name of the existing (or, elsewhere in the same plan, newly created) object this attribute is added to. Ignored for an attribute declared inline in `additive.objects[].attributes` \u2014 there the parent object's own `name` is used instead."),name:ca,label:Xt.z.string().min(1).max(128).describe("Human-readable display label shown in the UI. 1-128 characters, cannot be empty."),type:ec,config:Xt.z.record(Xt.z.string(),Xt.z.unknown()).optional().describe('Type-specific configuration; required keys depend on `type` (see `type`\'s description). Shared optional keys on every type: `placeholder`, `defaultValue`, `icon`, `order`, `hidden`, `archived`, `deprecated`, `metadata`. Per-type keys: `text` \u2014 `multiline`, `minLength`, `maxLength`, `pattern`, `format` ("email"|"url"|"slug"); `number` \u2014 `renderAs` ("number"|"rating"), `min`, `max`, `unit`, `decimals`; `date` \u2014 `dateFormat`, `minDate`, `maxDate`, `includeTime`, `endDate`, `timeFormat` ("12h"|"24h"); `phone` \u2014 `defaultCountryCode` (3-letter); `currency` \u2014 `defaultCurrency`, `allowedCurrencies`, `allowNegative`; `status`/`select`/`multiselect` \u2014 `options` (REQUIRED, non-empty array of `{ value, label, color }`, unique `value`s; for `status` every OPTION also carries `group` as idle|in_progress|finished \u2014 `group` belongs on each option, never on `config` itself; select/multiselect accept `renderAs: "badges"`); `location` \u2014 `granularity`, `defaultCountry`, `allowedCountries`; `user` \u2014 `types` ("user"|"agent"), `multiple`; `relation` \u2014 `targets` (REQUIRED, non-empty array of `{ object }`) and `cardinality` (REQUIRED, "one"|"many"); `formula` \u2014 `expression` (REQUIRED formula string) and `returnType` (REQUIRED); `rollup` \u2014 `targetAttribute` (REQUIRED) and `function` (REQUIRED, e.g. "sum"|"avg"|"count"); `document` \u2014 `properties`, `accepts`, `maxFileSize`. Omit entirely for `richtext`/`checkbox`, which take no type-specific keys.'),required:Xt.z.boolean().optional().describe("Whether the attribute must have a value on every record. Defaults to false (optional)."),description:Xt.z.string().optional().describe("Help text shown under the field in the UI. Not the same as the plan's `summary`.")}).strict(),rc=pa(ma),nc=pa(ma.omit({objectName:true})),ic=Xt.z.object({name:tc,label:Xt.z.string().min(1).describe('Human-readable singular display label (e.g. "Devis").'),pluralLabel:Xt.z.string().optional().describe('Human-readable plural display label (e.g. "Devis"/"Invoices"). Defaults from `label` if omitted.'),description:Xt.z.string().optional().describe("Help text describing what this object represents."),icon:chunk47EGJRW7_js.c.describe("Required icon name for the object. Must be a catalogue value \u2014 call `search_icons` and use a name it returns verbatim. A name that is not in the catalogue is rejected without any hint as to what would have worked, so never guess one."),labelExpression:be.describe('Template used to render a human-readable label for every record of this object \u2014 e.g. shown in relations, search results, and breadcrumbs. MUST contain at least one `{{ attributeName }}` interpolation referencing an attribute this object will actually have (either declared in this same `attributes` array, or an existing attribute if this is an update) \u2014 a plain string with no `{{ }}` at all (e.g. "Devis") is rejected. Interpolations cannot be empty (`{{ }}` is rejected) and only these pipes are allowed: UPPER, LOWER, capitalize, trim, prefix:"...", suffix:"...", wrap:"..." "...", default:"...". `{{ a || b }}` falls back to `b` when `a` is empty. Examples: "{{ firstName }} {{ lastName }}", "{{ numero | UPPER }}", "{{ name || reference }}".'),attributes:Xt.z.array(nc).default([]).describe("Attributes to create on this new object, inline. Same rules as a standalone entry in `additive.attributes`, minus `objectName` (implied by this object). At least one attribute referenced by `labelExpression` should be included here.")}).strict(),fa=Xt.z.object({attributeRemovals:Xt.z.array(Xt.z.object({objectName:Xt.z.string().min(1).describe("Object the attribute is removed from."),attributeName:Xt.z.string().min(1).describe("Attribute to delete, together with every record's stored value for it. Must not be a system (code-declared) attribute, and must not be referenced by the object's own `labelExpression` or `embeddingExpression` \u2014 update those first.")}).strict()).default([]).describe("Attributes to permanently delete. Irreversible: record values for the attribute are purged."),objectRemovals:Xt.z.array(Xt.z.object({objectName:Xt.z.string().min(1).describe("Object to delete entirely, together with all its records. Must not be a system (code-declared) object, and must not still be targeted by a `relation` attribute on another object \u2014 retarget or remove that relation first.")}).strict()).default([]).describe("Objects to permanently delete, records included. Irreversible."),renames:Xt.z.array(Xt.z.object({objectName:Xt.z.string().min(1).describe("Object the renamed attribute belongs to."),from:Xt.z.string().min(1).describe("Current attribute name. Must already exist and not be a system attribute."),to:ca.describe("New attribute name \u2014 same identifier rules as any attribute `name` (see `name` on a planned attribute), and must not collide with another name already on the object, including one added elsewhere in this same plan.")}).strict()).default([]).describe("Attribute renames. Every reference to the old name (labelExpression, views, formulas) must be updated separately \u2014 a rename does not follow references automatically.")}).strict().default({attributeRemovals:[],objectRemovals:[],renames:[]}),ba=Xt.z.string().min(1).describe("ONE sentence naming the intent of the change \u2014 what it is for, not what it contains. The human approving it has already watched every entry land in the preview window and can read every row of the plan itself, so a recap tells them nothing they do not have. A second sentence is warranted only when `destructive` is non-empty: say plainly what will be lost (e.g. 'deletes the \"ancienMontant\" column and its data on every devis'). Never restate the plan \u2014 explain intent."),oa="The COMPLETE config this view should end up with \u2014 not a patch. Copy the baseline returned by get_default_view and edit it, preserving every tab and setting you are not changing: anything you omit is dropped. To change the columns shown, set `tabs[].columns` (an array of attribute names) \u2014 there is no top-level `columns` on either view type. For a detail view's side panel, set `sidePanel.attributes`. Every attribute name listed must already exist on the object, or be created earlier in this same plan. ONE EXCEPTION to omit-is-dropped: a tab with `type: \"custom\"` renders a component belonging to the application, which you cannot describe or recreate. Copy every such tab through from the baseline exactly as it came, `name`, `component` and `props` untouched \u2014 dropping one, inventing one, or altering any of those three is rejected rather than applied (`name` is the tab's address in links, not its wording). Its `label` and `icon` you may change.",aa="Opaque token returned by get_default_view alongside the baseline you edited. REQUIRED when the object already exists \u2014 it proves you authored against the baseline that is still current. Must be OMITTED when this plan creates the object, which has no baseline yet.",sa=Xt.z.string().min(1).describe("Name of the object whose default view of this type is replaced. Not a view name \u2014 a plan can only replace an object's deterministic default view, never create a view or target a non-default one."),oc=Xt.z.discriminatedUnion("viewType",[Xt.z.object({objectName:sa,viewType:Xt.z.literal("list").describe("Targets the object's default list view (the grid)."),canonicalConfig:chunkVJYVPQ5E_js.ka.describe(oa),baselineToken:Xt.z.string().min(1).optional().describe(aa)}).strict(),Xt.z.object({objectName:sa,viewType:Xt.z.literal("detail").describe("Targets the object's default detail view (the single-record view)."),canonicalConfig:chunkVJYVPQ5E_js.la.describe(oa),baselineToken:Xt.z.string().min(1).optional().describe(aa)}).strict()]);var ua=Xt.z.string().regex(/^[0-9a-f]{64}$/,"Expected a lowercase SHA-256 hash"),la={baseConfigHash:ua.nullable(),targetConfigHash:ua,baselineOrigin:Xt.z.enum(["persisted","generated","absent"])},ac=Xt.z.discriminatedUnion("viewType",[Xt.z.object({objectName:Xt.z.string().min(1),viewType:Xt.z.literal("list"),canonicalConfig:chunkVJYVPQ5E_js.ka,...la}).strict(),Xt.z.object({objectName:Xt.z.string().min(1),viewType:Xt.z.literal("detail"),canonicalConfig:chunkVJYVPQ5E_js.la,...la}).strict()]).superRefine((e,t)=>{let r=e.baselineOrigin!=="absent";r!==(e.baseConfigHash!==null)&&t.addIssue({code:"custom",path:["baseConfigHash"],message:r?`A ${e.baselineOrigin} baseline requires baseConfigHash`:"An absent baseline requires baseConfigHash to be null"});});function ga(e){return Xt.z.object({objects:Xt.z.array(ic).default([]).describe("New objects to create, with their attributes inline."),attributes:Xt.z.array(rc).default([]).describe("Attributes to add to existing or same-plan objects."),viewUpdates:Xt.z.array(e).default([]).describe("Complete target configs for deterministic default views; never view names.")}).strict().default({objects:[],attributes:[],viewUpdates:[]})}chunkDPD6ZWL2_js.a(ga,"buildAdditiveSchema");function Jn(e,t=[],r=new WeakSet){if(e===null||typeof e=="string"||typeof e=="boolean")return null;if(typeof e=="number")return Number.isFinite(e)?null:{path:t,message:"Plan input contains a non-finite number"};if(typeof e!="object")return {path:t,message:"Plan input must contain only JSON-safe values"};if(r.has(e))return {path:t,message:"Plan input cannot contain circular references"};if(Array.isArray(e)){r.add(e);for(let s of Reflect.ownKeys(e))if(s!=="length"&&(typeof s=="symbol"||!/^(0|[1-9]\d*)$/.test(s)))return r.delete(e),{path:[...t,s],message:"Plan input arrays cannot contain non-index JSON properties"};for(let s=0;s<e.length;s++){if(!Object.hasOwn(e,s))return r.delete(e),{path:[...t,s],message:"Plan input cannot contain sparse arrays"};let l=Jn(e[s],[...t,s],r);if(l)return r.delete(e),l}return r.delete(e),null}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return {path:t,message:"Plan input must contain only plain JSON objects"};r.add(e);let o=e,a=Reflect.ownKeys(o);for(let s of a){let l=Object.getOwnPropertyDescriptor(o,s);if(typeof s=="symbol"||!(l?.enumerable&&"value"in l))return r.delete(e),{path:[...t,s],message:"Plan input objects must contain enumerable JSON data properties only"}}for(let s of a.sort()){let l=Jn(o[s],[...t,s],r);if(l)return r.delete(e),l}return r.delete(e),null}chunkDPD6ZWL2_js.a(Jn,"findJsonSafetyIssue");function sc(e){let t=[];return e.additive.objects.forEach((r,n)=>{t.push(["additive","objects",n]),r.attributes.forEach((o,a)=>{t.push(["additive","objects",n,"attributes",a]);});}),e.additive.attributes.forEach((r,n)=>{t.push(["additive","attributes",n]);}),e.additive.viewUpdates.forEach((r,n)=>{t.push(["additive","viewUpdates",n]);}),e.destructive.attributeRemovals.forEach((r,n)=>{t.push(["destructive","attributeRemovals",n]);}),e.destructive.objectRemovals.forEach((r,n)=>{t.push(["destructive","objectRemovals",n]);}),e.destructive.renames.forEach((r,n)=>{t.push(["destructive","renames",n]);}),t}chunkDPD6ZWL2_js.a(sc,"mutationPaths");function ya(e,t){e.additive.objects.length>$.objectAdditions&&t.addIssue({code:"too_big",origin:"array",maximum:$.objectAdditions,inclusive:true,path:["additive","objects",$.objectAdditions],message:`A schema plan can add at most ${$.objectAdditions} objects`});let r=sc(e);r.length>$.totalMutations&&t.addIssue({code:"too_big",origin:"array",maximum:$.totalMutations,inclusive:true,path:r[$.totalMutations],message:`A schema plan can contain at most ${$.totalMutations} mutations; received ${r.length}`});}chunkDPD6ZWL2_js.a(ya,"addPlanLimitIssues");function ha(e,t){let r=Jn(e);if(r)return t.addIssue({code:"custom",path:r.path,message:r.message}),Xt.z.NEVER;let n=new TextEncoder().encode(chunkLQYUPOWB_js.a(e)).byteLength;return n>$.serializedBytes?(t.addIssue({code:"too_big",origin:"string",maximum:$.serializedBytes,inclusive:true,path:[],message:`A schema plan can serialize to at most ${$.serializedBytes} UTF-8 bytes; received ${n}`}),Xt.z.NEVER):e}chunkDPD6ZWL2_js.a(ha,"boundSerializedPlanInput");var uc=ga(oc),lc=ga(ac),da=Xt.z.object({schemaPlanVersion:Xt.z.literal(2).describe("Required proposal contract version."),summary:ba,additive:uc,destructive:fa}).strict().superRefine((e,t)=>{let r=new Set(e.additive.objects.map(n=>n.name));e.additive.viewUpdates.forEach((n,o)=>{let a=["additive","viewUpdates",o,"baselineToken"];if(r.has(n.objectName)){n.baselineToken!==void 0&&t.addIssue({code:"custom",path:a,message:"A view target for an object added by this plan must not include baselineToken"});return}n.baselineToken===void 0&&t.addIssue({code:"custom",path:a,message:"A view target for an existing object requires baselineToken"});}),ya(e,t);}),kx=Object.assign(Xt.z.preprocess(ha,da),{shape:da.shape}),dc=Xt.z.object({schemaPlanVersion:Xt.z.literal(2),summary:ba,additive:lc,destructive:fa}).strict().superRefine(ya),_x=Xt.z.preprocess(ha,dc);var A=Xt.z.number().finite().nonnegative(),Ta=Xt.z.enum(Li),Zn=Xt.z.enum(Bi),ei=Xt.z.enum(Ui),wa=Xt.z.object({provider:Ta,model:Xt.z.string().min(1)}).strict(),Lx=Xt.z.object({speed:Zn.optional(),reasoning:ei.optional()}).strict(),xa=Xt.z.string().regex(/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9._-]*$/),cc=Xt.z.object({model:wa.optional(),speed:Zn.optional(),reasoning:ei.optional(),imageModel:xa.optional()}).strict(),Bx=cc.refine(e=>e.model!==void 0||e.speed!==void 0||e.reasoning!==void 0||e.imageModel!==void 0,{message:"At least one inference override is required"}),Ux=Xt.z.object({model:wa.nullable().optional(),speed:Zn.nullable().optional(),reasoning:ei.nullable().optional(),imageModel:xa.nullable().optional()}).strict().refine(e=>Object.keys(e).length>0&&Object.values(e).every(t=>t!==void 0),{message:"At least one inference override is required"}),Ia=Xt.z.object({label:Xt.z.string(),denied:Xt.z.boolean().optional(),deletion:Xt.z.object({target:Xt.z.string().optional(),count:A.optional(),restorableDays:A.optional()}).strict().optional(),counts:Xt.z.record(Xt.z.string(),A).optional(),warnings:Xt.z.array(Xt.z.string()).optional()}).strict(),pc=Xt.z.union([Xt.z.object({type:Xt.z.literal("text"),text:Xt.z.string()}).strict(),Xt.z.object({type:Xt.z.literal("reasoning"),text:Xt.z.string()}).strict(),Xt.z.object({type:Xt.z.literal("system"),code:Xt.z.enum(zt)}).strict(),Xt.z.object({type:Xt.z.literal("error"),error:Xt.z.string(),errorClass:Xt.z.string().optional()}).strict(),Xt.z.object({type:Xt.z.literal("tool"),toolCallId:Xt.z.string(),name:Xt.z.string(),args:Xt.z.record(Xt.z.string(),Xt.z.unknown()),result:Xt.z.unknown().optional(),error:Xt.z.string().optional(),errorCode:Xt.z.enum(["output_limit_reached","interrupted"]).optional(),state:Xt.z.enum(["streaming","running","completed","error","approval-requested","approval-responded","approval-dispatched"]),durationMs:A.optional(),approvalId:Xt.z.string().optional(),approvalImpact:Ia.optional(),approved:Xt.z.boolean().optional(),approvalReason:Xt.z.string().optional(),approvalRelaxableByAuto:Xt.z.boolean().optional()}).strict(),Xt.z.object({type:Xt.z.literal("file"),fileId:Xt.z.string(),name:Xt.z.string(),mimeType:Xt.z.string()}).strict(),Xt.z.object({type:Xt.z.literal("compaction"),state:Xt.z.literal("in-progress"),reason:Xt.z.enum(["preflight_threshold","overflow_recovery"]),estimatedTokens:A.optional(),reportedTokens:A.optional()}).strict(),Xt.z.object({type:Xt.z.literal("compaction"),state:Xt.z.literal("completed"),tokensBefore:A,tokensAfter:A,tokensSaved:A,strategy:Xt.z.enum(["no-op","summary","truncation"]),durationMs:A,summary:Xt.z.string().optional()}).strict(),Xt.z.object({type:Xt.z.literal("compaction"),state:Xt.z.literal("failed"),reason:Xt.z.string(),durationMs:A.optional()}).strict()]),mc=Xt.z.object({id:Xt.z.string(),name:Xt.z.string(),mimeType:Xt.z.string(),size:A}).strict(),fc=Xt.z.object({id:Xt.z.string(),type:Xt.z.string().transform(e=>e),entityId:Xt.z.string(),label:Xt.z.string(),objectName:Xt.z.string().optional(),startIndex:A,endIndex:A}).strict(),bc=Xt.z.object({provider:Ta,model:Xt.z.string(),maxTokens:A.optional(),contextWindow:A.optional()}).strict(),gc=Xt.z.union([Xt.z.date(),Xt.z.string().datetime({offset:true}).transform(e=>new Date(e))]),Aa=Xt.z.object({id:Xt.z.string(),sessionId:Xt.z.string(),tenantId:Xt.z.string().optional(),runId:Xt.z.string().optional(),role:Xt.z.enum(["user","assistant","system","tool"]),parts:Xt.z.array(pc),attachments:Xt.z.array(mc).optional(),mentions:Xt.z.array(fc).optional(),model:bc.optional(),tokenUsage:Xt.z.object({input:A,output:A}).strict().optional(),metadata:Xt.z.record(Xt.z.string(),Xt.z.unknown()).optional(),createdAt:gc}).strict(),yc=Xt.z.object({id:Xt.z.string(),description:Xt.z.string(),status:Xt.z.enum(["pending","in_progress","completed","blocked"]),result:Xt.z.string().optional(),updatedAt:A.optional()}).strict(),hc=Xt.z.object({id:Xt.z.string(),sessionId:Xt.z.string(),status:Xt.z.enum(["active","completed","abandoned"]),todos:Xt.z.array(yc),version:A,createdAt:Xt.z.string(),updatedAt:Xt.z.string(),completedAt:Xt.z.string().optional()}).strict(),Sa={"session-named":Xt.z.object({name:Xt.z.string()}).strict(),"compaction-start":Xt.z.object({reason:Xt.z.enum(["preflight_threshold","overflow_recovery"]),estimatedTokens:A.optional(),reportedTokens:A.optional()}).strict(),"compaction-end":Xt.z.object({tokensBefore:A,tokensAfter:A,tokensSaved:A,strategy:Xt.z.enum(["no-op","summary","truncation"]),durationMs:A,summary:Xt.z.string().optional()}).strict(),"compaction-failed":Xt.z.object({reason:Xt.z.string()}).strict(),usage:Xt.z.object({messageId:Xt.z.string().min(1).optional(),inputTokens:A,outputTokens:A,totalTokens:A,cacheReadTokens:A.optional(),cacheCreationTokens:A.optional(),contextWindow:A,residentTokens:A,utilization:Xt.z.number().finite().min(0).max(1),costUsd:A.optional()}).strict(),"message-persisted":Xt.z.object({message:Aa}).strict(),"message-updated":Xt.z.object({message:Aa}).strict(),"todo-plan-update":Xt.z.object({plan:hc}).strict(),"approval-context":Xt.z.object({approvalId:Xt.z.string(),toolCallId:Xt.z.string(),impact:Ia.optional(),relaxableByAuto:Xt.z.boolean().optional()}).strict(),"session-state":Xt.z.object({state:Xt.z.object({phase:Xt.z.enum(["queued","running","parked","terminal"]),parkedOn:Xt.z.enum(["human","agents"]).optional(),humanRequestIds:Xt.z.array(Xt.z.string()).optional(),outcome:Xt.z.enum(["completed","failed","cancelled","timeout","expired"]).optional()}).strict(),version:Xt.z.number().int().positive(),updatedAt:Xt.z.string().datetime({offset:true})}).strict()};function Ac(e){return e in Sa}chunkDPD6ZWL2_js.a(Ac,"isAgentUIDataName");function Tc(e){return new chunk72TQRSNX_js.h("Invalid agent UI message chunk",e.map(t=>({path:t.path.map(String),message:t.message,code:t.code})))}chunkDPD6ZWL2_js.a(Tc,"agentUIValidationError");function wc(e){if(typeof e!="object"||e===null||typeof e.type!="string")throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:"Expected UI message chunk type",code:"invalid_type"}]);let t=e.type;if(!t.startsWith("data-"))throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:"Expected agent data chunk type",code:"invalid_value"}]);let r=t.slice(5);if(!Ac(r))throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:`Unknown agent UI data type: ${r}`,code:"invalid_value"}]);let n=Xt.z.object({type:Xt.z.literal(`data-${r}`),id:Xt.z.string().optional(),data:Sa[r],transient:Xt.z.boolean().optional()}).strict().safeParse(e);if(!n.success)throw Tc(n.error.issues);return n.data}chunkDPD6ZWL2_js.a(wc,"assertCustomAgentUIMessageChunk");function $x(e,t,r){return wc({type:`data-${e}`,...r?.id!==void 0?{id:r.id}:{},data:t,...r?.transient!==void 0?{transient:r.transient}:{}})}chunkDPD6ZWL2_js.a($x,"agentDataChunk");function Dt(e){return e}chunkDPD6ZWL2_js.a(Dt,"defineOperation");function y(e,t,r){let n=t==="atomic"?"none":t==="local"?"if-not-visible":"follow";return o=>{let a=r?.(o);return {impact:t,navigation:n,focus:{...e(o),...a===void 0?{}:{propertyPath:a}}}}}chunkDPD6ZWL2_js.a(y,"definePresentation");var ti={id:Xt.z.string().min(1)},v={...ti,viewId:Xt.z.string().min(1)};function S(e,t,r){if(!e.views.some(n=>n.id===t))throw new chunk72TQRSNX_js.h(`View "${t}" is not in the draftable state`,[]);return {...e,views:e.views.map(n=>n.id===t?r(n):n)}}chunkDPD6ZWL2_js.a(S,"mapView");function Ra(e,t,r){let n=[...e],[o]=n.splice(t,1);return n.splice(r,0,o),n}chunkDPD6ZWL2_js.a(Ra,"moveWithin");function Fe(e,t,r){if(t.length!==e.length)throw new chunk72TQRSNX_js.h(`${r} order lists ${t.length} ids for ${e.length} items`,[]);return t.map(n=>{let o=e.find(a=>a.id===n);if(!o)throw new chunk72TQRSNX_js.h(`${r} "${n}" is not in this collection`,[]);return o})}chunkDPD6ZWL2_js.a(Fe,"reorderById");function ne(e,t,r){let n=e.tabs.find(o=>o.id===t);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t}" is not in view "${e.id}"`,[]);if(n.type!=="form")throw new chunk72TQRSNX_js.h(`Tab "${t}" is not a form tab`,[]);return {...e,tabs:e.tabs.map(o=>o.id===t?r(n):o)}}chunkDPD6ZWL2_js.a(ne,"mapFormTab");function Ot(e,t){let r=e.groups.find(n=>n.id===t);if(!r)throw new chunk72TQRSNX_js.h(`Group "${t}" is not in tab "${e.id}"`,[]);return r}chunkDPD6ZWL2_js.a(Ot,"requireGroup");function ri(e,t){for(let r of e.groups){let n=r.fields.find(o=>o.id===t);if(n)return {group:r,field:n}}throw new chunk72TQRSNX_js.h(`Field slot "${t}" is not in tab "${e.id}"`,[])}chunkDPD6ZWL2_js.a(ri,"locateField");function Ct(e){return {viewId:e.viewId}}chunkDPD6ZWL2_js.a(Ct,"viewFocus");function Nt(e){return {viewId:e.viewId,tabId:e.tabId}}chunkDPD6ZWL2_js.a(Nt,"tabFocus");function Ea(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.groupId}}chunkDPD6ZWL2_js.a(Ea,"groupFocus");function Da(e){return {viewId:e.viewId,tabId:e.tabId,fieldId:e.fieldId}}chunkDPD6ZWL2_js.a(Da,"fieldFocus");function Ca(e){return {viewId:e.viewId,tabId:e.tab.id}}chunkDPD6ZWL2_js.a(Ca,"addTabFocus");function Na(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.group.id}}chunkDPD6ZWL2_js.a(Na,"addGroupFocus");function Oa(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.groupId,fieldId:e.field.id}}chunkDPD6ZWL2_js.a(Oa,"addFieldFocus");function ka(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.toGroupId,fieldId:e.fieldId}}chunkDPD6ZWL2_js.a(ka,"moveFieldFocus");function Ve(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(Ve,"firstChangedProperty");var xc=chunkVJYVPQ5E_js.ia,Ic=chunkVJYVPQ5E_js.da,Sc=chunkVJYVPQ5E_js.ca,vc=Xt.z.object({...v,type:Xt.z.literal("add_tab"),tab:xc}),Rc={type:"add_tab",schema:vc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(r.tabs.some(n=>n.id===t.tab.id))throw new chunk72TQRSNX_js.h(`Tab "${t.tab.id}" already exists in view "${t.viewId}"`,[]);return {...r,tabs:[...r.tabs,t.tab]}}),"apply"),focus:Ca,presentation:y(Ca,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'onglet \xAB ${e.tab.label} \xBB`,"describe")},Ec=Xt.z.object({...v,type:Xt.z.literal("remove_tab"),tabId:Xt.z.string().min(1)}),Dc={type:"remove_tab",schema:Ec,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(!r.tabs.some(n=>n.id===t.tabId))throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,tabs:r.tabs.filter(n=>n.id!==t.tabId)}}),"apply"),focus:Nt,presentation:y(Nt,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'onglet ${e.tabId}`,"describe")},Ma=Xt.z.object({label:Xt.z.string().min(1).optional(),icon:chunk47EGJRW7_js.c.optional(),order:Xt.z.number().int().optional()}),Cc=Object.keys(Ma.shape),Nc=Xt.z.object({...v,type:Xt.z.literal("update_tab"),tabId:Xt.z.string().min(1),changes:Ma.refine(e=>Object.keys(e).length>0,"update_tab needs at least one change")}),_a=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTabFocus"),Oc={type:"update_tab",schema:Nc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(!r.tabs.some(n=>n.id===t.tabId))throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,tabs:r.tabs.map(n=>n.id===t.tabId?{...n,...t.changes}:n)}}),"apply"),focus:_a,presentation:y(_a,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'onglet en \xAB ${e.changes.label} \xBB`:`Modifie l'onglet ${e.tabId}`,"describe")},kc=Xt.z.object({...v,type:Xt.z.literal("reorder_tabs"),tabOrder:Xt.z.array(Xt.z.string().min(1))}),_c={type:"reorder_tabs",schema:kc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,tabs:Fe(r.tabs,t.tabOrder,"Tab")})),"apply"),focus:Ct,presentation:y(Ct,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les onglets","describe")},Pc=Xt.z.object({...v,type:Xt.z.literal("add_group"),tabId:Xt.z.string().min(1),group:Ic}),Fc={type:"add_group",schema:Pc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{if(n.groups.some(o=>o.id===t.group.id))throw new chunk72TQRSNX_js.h(`Group "${t.group.id}" already exists in tab "${t.tabId}"`,[]);return {...n,groups:[...n.groups,t.group]}})),"apply"),focus:Na,presentation:y(Na,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute le groupe \xAB ${e.group.label} \xBB`,"describe")},Vc=Xt.z.object({...v,type:Xt.z.literal("remove_group"),tabId:Xt.z.string().min(1),groupId:Xt.z.string().min(1)}),jc={type:"remove_group",schema:Vc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(Ot(n,t.groupId),{...n,groups:n.groups.filter(o=>o.id!==t.groupId)}))),"apply"),focus:Ea,presentation:y(Ea,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime le groupe ${e.groupId}`,"describe")},Mc=Xt.z.object({...v,type:Xt.z.literal("update_group"),tabId:Xt.z.string().min(1),groupId:Xt.z.string().min(1),changes:Xt.z.object({label:Xt.z.string().min(1).optional(),description:Xt.z.string().optional(),collapsible:Xt.z.boolean().optional(),collapsed:Xt.z.boolean().optional(),order:Xt.z.number().int().optional()}).refine(e=>Object.keys(e).length>0,"update_group needs at least one change")}),Pa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId,groupId:e.groupId}),"updateGroupFocus"),Lc={type:"update_group",schema:Mc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(Ot(n,t.groupId),{...n,groups:n.groups.map(o=>o.id===t.groupId?{...o,...t.changes}:o)}))),"apply"),focus:Pa,presentation:y(Pa,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme le groupe en \xAB ${e.changes.label} \xBB`:"Modifie le groupe","describe")},Bc=Xt.z.object({...v,type:Xt.z.literal("reorder_groups"),tabId:Xt.z.string().min(1),groupOrder:Xt.z.array(Xt.z.string().min(1))}),Uc={type:"reorder_groups",schema:Bc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>({...n,groups:Fe(n.groups,t.groupOrder,"Group")}))),"apply"),focus:Nt,presentation:y(Nt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les groupes","describe")},$c=Xt.z.object({...v,type:Xt.z.literal("add_field"),tabId:Xt.z.string().min(1),groupId:Xt.z.string().min(1),field:Sc,index:Xt.z.number().int().min(0).optional()}),qc={type:"add_field",schema:$c,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{if(Ot(n,t.groupId),n.groups.some(o=>o.fields.some(a=>a.id===t.field.id)))throw new chunk72TQRSNX_js.h(`Field slot "${t.field.id}" already exists in tab "${t.tabId}"`,[]);return {...n,groups:n.groups.map(o=>{if(o.id!==t.groupId)return o;let a=t.index??o.fields.length;return {...o,fields:[...o.fields.slice(0,a),t.field,...o.fields.slice(a)]}})}})),"apply"),focus:Oa,presentation:y(Oa,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute le champ ${e.field.attribute??e.field.id}`,"describe")},zc=Xt.z.object({...v,type:Xt.z.literal("remove_field"),tabId:Xt.z.string().min(1),fieldId:Xt.z.string().min(1)}),Gc={type:"remove_field",schema:zc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{let{group:o}=ri(n,t.fieldId);return {...n,groups:n.groups.map(a=>a.id===o.id?{...a,fields:a.fields.filter(s=>s.id!==t.fieldId)}:a)}})),"apply"),focus:Da,presentation:y(Da,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Retire le champ ${e.fieldId}`,"describe")},Wc=Xt.z.object({...v,type:Xt.z.literal("move_field"),tabId:Xt.z.string().min(1),fieldId:Xt.z.string().min(1),toGroupId:Xt.z.string().min(1),toIndex:Xt.z.number().int().min(0)}),Kc={type:"move_field",schema:Wc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{let{group:o,field:a}=ri(n,t.fieldId),s=Ot(n,t.toGroupId);if(o.id===s.id){let l=o.fields.findIndex(p=>p.id===t.fieldId);return {...n,groups:n.groups.map(p=>p.id===o.id?{...p,fields:Ra(p.fields,l,t.toIndex)}:p)}}return {...n,groups:n.groups.map(l=>l.id===o.id?{...l,fields:l.fields.filter(p=>p.id!==t.fieldId)}:l.id===s.id?{...l,fields:[...l.fields.slice(0,t.toIndex),a,...l.fields.slice(t.toIndex)]}:l)}})),"apply"),focus:ka,presentation:y(ka,"local"),describe:chunkDPD6ZWL2_js.a(e=>`D\xE9place le champ ${e.fieldId} vers le groupe ${e.toGroupId}`,"describe")},Yc=Xt.z.object({...v,type:Xt.z.literal("update_field"),tabId:Xt.z.string().min(1),fieldId:Xt.z.string().min(1),changes:Xt.z.object({label:Xt.z.string().optional(),readOnly:Xt.z.boolean().optional(),span:Xt.z.number().int().min(1).max(12).optional()}).refine(e=>Object.keys(e).length>0,"update_field needs at least one change")}),Fa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId,fieldId:e.fieldId}),"updateFieldFocus"),Hc={type:"update_field",schema:Yc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(ri(n,t.fieldId),{...n,groups:n.groups.map(o=>({...o,fields:o.fields.map(a=>a.id===t.fieldId?{...a,...t.changes}:a)}))}))),"apply"),focus:Fa,presentation:y(Fa,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>`Modifie le champ ${e.fieldId}`,"describe")},La=Xt.z.object({source:chunkVJYVPQ5E_js.ga.optional(),columns:chunkVJYVPQ5E_js.X.optional(),filters:chunkVJYVPQ5E_js._.nullable().optional(),sorts:chunkVJYVPQ5E_js.Z.nullable().optional(),allowCreate:Xt.z.boolean().optional(),allowEdit:Xt.z.boolean().optional(),allowDelete:Xt.z.boolean().optional(),createMode:Xt.z.enum(["redirect","inline","peek"]).optional()}),Qc=Object.keys(La.shape),Ba=Xt.z.object({emailAttributeIds:Xt.z.array(Xt.z.string().min(1)).optional(),attribute:Xt.z.string().min(1).optional(),titleAttribute:Xt.z.string().min(1).nullable().optional(),component:Xt.z.string().nullable().optional(),props:Xt.z.record(Xt.z.string(),Xt.z.unknown()).nullable().optional()}),Jc=Object.keys(Ba.shape),Xc={emailAttributeIds:["emails","meetings"],attribute:["richtext"],titleAttribute:["richtext"],component:["custom"],props:["custom"]},Zc=Xt.z.object({...v,type:Xt.z.literal("update_tab_config"),tabId:Xt.z.string().min(1),changes:Ba.refine(e=>Object.keys(e).length>0,"update_tab_config needs at least one change")}),Va=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTabConfigFocus"),ep={type:"update_tab_config",schema:Zc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.tabs.find(o=>o.id===t.tabId);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${r.id}"`,[]);for(let o of Object.keys(t.changes)){let a=Xc[o];if(a&&!a.includes(n.type))throw new chunk72TQRSNX_js.h(`"${o}" is not a setting of a "${n.type}" tab`,[])}return {...r,tabs:r.tabs.map(o=>o.id===t.tabId?{...o,...t.changes}:o)}}),"apply"),focus:Va,presentation:y(Va,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>`Configure ${Object.keys(e.changes).join(", ")} sur l'onglet ${e.tabId}`,"describe")},tp=Xt.z.object({...v,type:Xt.z.literal("update_table_tab"),tabId:Xt.z.string().min(1),changes:La.refine(e=>Object.keys(e).length>0,"update_table_tab needs at least one change")}),ja=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTableTabFocus"),rp={type:"update_table_tab",schema:tp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.tabs.find(l=>l.id===t.tabId);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${r.id}"`,[]);if(n.type!=="table")throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not a table tab`,[]);let o=Object.entries(t.changes),a=Object.fromEntries(o.filter(([,l])=>l!==null)),s=new Set(o.filter(([,l])=>l===null).map(([l])=>l));return {...r,tabs:r.tabs.map(l=>l.id===t.tabId?Object.fromEntries(Object.entries({...l,...a}).filter(([p])=>!s.has(p))):l)}}),"apply"),focus:ja,presentation:y(ja,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.columns?`Affiche ${e.changes.columns.length} colonne(s) dans l'onglet ${e.tabId}`:`Modifie l'onglet ${e.tabId}`,"describe")},np=Xt.z.object({...v,type:Xt.z.literal("set_side_panel"),sidePanel:Xt.z.object({attributes:Xt.z.array(Xt.z.string().min(1)),width:Xt.z.number().int().min(1).optional()}).nullable()}),ip={type:"set_side_panel",schema:np,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,config:{...r.config,sidePanel:t.sidePanel??void 0}})),"apply"),focus:Ct,presentation:y(Ct,"atomic",()=>["config","sidePanel"]),describe:chunkDPD6ZWL2_js.a(e=>e.sidePanel?"Active le panneau lat\xE9ral":"Retire le panneau lat\xE9ral","describe")},Ua=[Rc,Dc,Oc,_c,Fc,jc,Lc,Uc,qc,Gc,Kc,Hc,rp,ep,ip];var je={...v,tabId:Xt.z.string().min(1)};function kt(e){return {viewId:e.viewId}}chunkDPD6ZWL2_js.a(kt,"viewFocus");function ie(e){return {viewId:e.viewId,tabId:e.tabId}}chunkDPD6ZWL2_js.a(ie,"tabFocus");function $a(e){return {viewId:e.viewId,tabId:e.tab.id}}chunkDPD6ZWL2_js.a($a,"addTabFocus");function op(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(op,"firstChangedProperty");function za(e){let t={...e};for(let r of chunkVJYVPQ5E_js.qa)delete t[r];return t}chunkDPD6ZWL2_js.a(za,"withoutKanbanKeys");function Ga(e){let t={...e};for(let r of chunkVJYVPQ5E_js.pa)delete t[r];return t}chunkDPD6ZWL2_js.a(Ga,"withoutTableKeys");function ap(e,t,r,n){let o=chunkVJYVPQ5E_js.ja.safeParse(t);if(!o.success){if(!chunkVJYVPQ5E_js.ja.safeParse(e).success)return t;let a=o.error.issues.map(s=>s.path.length?`${s.path.join(".")}: ${s.message}`:s.message).join(", ");throw new chunk72TQRSNX_js.h(`List tab "${n}" in view "${r}" would no longer be publishable: ${a}`,[])}return t}chunkDPD6ZWL2_js.a(ap,"assertStillPublishableTab");function _t(e,t,r,n){return S(e,t,o=>{let a=o.config.tabs??[];if(!a.some(s=>s.id===r))throw new chunk72TQRSNX_js.h(`List tab "${r}" is not in view "${t}"`,[]);return {...o,config:{...o.config,tabs:a.map(s=>s.id===r?ap(s,n(s),t,r):s)}}})}chunkDPD6ZWL2_js.a(_t,"mapListTab");var sp=chunkVJYVPQ5E_js.ja,Wa=chunkVJYVPQ5E_js.$,up=chunkVJYVPQ5E_js.Z;function Y(e,t,r,n){let o=Xt.z.object({...je,type:Xt.z.literal(e),value:r});return {type:e,schema:o,apply:chunkDPD6ZWL2_js.a((a,s)=>_t(a,s.viewId,s.tabId,l=>{if(s.value===null){let{[t]:p,...I}=l;return I}return {...l,[t]:s.value}}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>[String(t)]),describe:chunkDPD6ZWL2_js.a(a=>n(a.value),"describe")}}chunkDPD6ZWL2_js.a(Y,"setOnTab");var lp=Xt.z.object({...v,type:Xt.z.literal("add_list_tab"),tab:sp}),dp={type:"add_list_tab",schema:lp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.config.tabs??[];if(n.some(o=>o.id===t.tab.id))throw new chunk72TQRSNX_js.h(`List tab "${t.tab.id}" already exists in view "${t.viewId}"`,[]);return {...r,config:{...r.config,tabs:[...n,t.tab]}}}),"apply"),focus:$a,presentation:y($a,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'onglet \xAB ${e.tab.label} \xBB`,"describe")},cp=Xt.z.object({...je,type:Xt.z.literal("remove_list_tab")}),pp={type:"remove_list_tab",schema:cp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.config.tabs??[];if(!n.some(o=>o.id===t.tabId))throw new chunk72TQRSNX_js.h(`List tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,config:{...r.config,tabs:n.filter(o=>o.id!==t.tabId)}}}),"apply"),focus:ie,presentation:y(ie,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'onglet ${e.tabId}`,"describe")},mp=Xt.z.object({...je,type:Xt.z.literal("update_list_tab"),changes:Xt.z.object({label:Xt.z.string().min(1).optional(),icon:chunk47EGJRW7_js.c.optional(),default:Xt.z.boolean().optional(),visibility:Xt.z.enum(chunkVJYVPQ5E_js.w).optional()}).refine(e=>Object.keys(e).length>0,"update_list_tab needs at least one change")}),qa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateListTabFocus"),fp={type:"update_list_tab",schema:mp,apply:chunkDPD6ZWL2_js.a((e,t)=>_t(e,t.viewId,t.tabId,r=>({...r,...t.changes})),"apply"),focus:qa,presentation:y(qa,"atomic",op),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'onglet en \xAB ${e.changes.label} \xBB`:`Modifie l'onglet ${e.tabId}`,"describe")},bp=Xt.z.object({...v,type:Xt.z.literal("reorder_list_tabs"),tabOrder:Xt.z.array(Xt.z.string().min(1))}),gp={type:"reorder_list_tabs",schema:bp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,config:{...r.config,tabs:Fe(r.config.tabs??[],t.tabOrder,"List tab")}})),"apply"),focus:kt,presentation:y(kt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les onglets","describe")},yp=Y("set_columns","columns",Xt.z.array(Xt.z.string().min(1)),e=>`Affiche ${Array.isArray(e)?e.length:0} colonne(s)`),hp=Y("set_column_sizing","columnSizing",Xt.z.record(Xt.z.string(),Xt.z.number().int().positive()),()=>"Ajuste la largeur des colonnes"),Ap=Xt.z.object({...je,type:Xt.z.literal("set_layout"),value:Xt.z.enum(["table","list","kanban"])}),Tp={type:"set_layout",schema:Ap,apply:chunkDPD6ZWL2_js.a((e,t)=>_t(e,t.viewId,t.tabId,r=>{if(t.value!=="kanban")return {...za(r),layout:t.value};if(r.groupByAttribute===void 0)throw new chunk72TQRSNX_js.h(`List tab "${t.tabId}" cannot switch to kanban without a group attribute \u2014 use set_group_by, which switches the layout itself`,[]);return {...Ga(r),layout:"kanban"}}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>["layout"]),describe:chunkDPD6ZWL2_js.a(e=>`Passe en affichage ${e.value}`,"describe")},wp=Xt.z.object({...je,type:Xt.z.literal("set_group_by"),value:Xt.z.string().min(1).nullable()}),xp={type:"set_group_by",schema:wp,apply:chunkDPD6ZWL2_js.a((e,t)=>_t(e,t.viewId,t.tabId,r=>t.value===null?{...za(r),layout:"table"}:{...Ga(r),layout:"kanban",groupByAttribute:t.value}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>["groupByAttribute"]),describe:chunkDPD6ZWL2_js.a(e=>e.value?`Regroupe par ${e.value} en kanban`:"Retire le regroupement, retour en table","describe")},Ip=Y("set_filters","filters",Wa.nullable(),e=>e?"Modifie les filtres":"Retire les filtres"),Sp=Y("set_sorts","sorts",up.nullable(),e=>e?"Modifie le tri":"Retire le tri"),vp=Y("set_create_mode","createMode",Xt.z.enum(["redirect","inline","peek"]),e=>`Cr\xE9ation en mode ${e}`),Rp=Y("set_read_only","readOnly",Xt.z.boolean(),e=>e?"Passe l'onglet en lecture seule":"Rend l'onglet modifiable"),Ep=Y("set_card_user_attribute","cardUserAttribute",Xt.z.string().min(1).nullable(),e=>e?`Affiche ${e} sur les cartes`:"Retire l'utilisateur des cartes"),Dp=Y("set_card_date_attribute","cardDateAttribute",Xt.z.string().min(1).nullable(),e=>e?`Affiche ${e} sur les cartes`:"Retire la date des cartes"),Cp=Y("set_description_attribute","descriptionAttribute",Xt.z.string().min(1).nullable(),e=>e?`Affiche ${e} en description`:"Retire la description"),Np=Y("set_display_attributes","displayAttributes",chunkVJYVPQ5E_js.Y.nullable(),e=>`Affiche ${Array.isArray(e)?e.length:0} attribut(s)`),Op=Xt.z.object({...v,type:Xt.z.literal("set_default_filters"),filters:Wa.nullable()}),kp={type:"set_default_filters",schema:Op,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(t.filters===null){let{defaultFilters:n,...o}=r.config;return {...r,config:o}}return {...r,config:{...r.config,defaultFilters:t.filters}}}),"apply"),focus:kt,presentation:y(kt,"atomic",()=>["config","defaultFilters"]),describe:chunkDPD6ZWL2_js.a(e=>e.filters?"Modifie les filtres de la vue":"Retire les filtres de la vue","describe")},Ka=[kp,dp,pp,fp,gp,yp,hp,Tp,xp,Ip,Sp,vp,Rp,Ep,Dp,Cp,Np];function _p(e){return {id:e.id??e.name,name:e.name,label:e.label,...e.icon===void 0?{}:{icon:e.icon}}}chunkDPD6ZWL2_js.a(_p,"toDraftableObject");function Pp(e){let t=e.id??e.name;return (e.attributes??[]).map(r=>Fp(r,t))}chunkDPD6ZWL2_js.a(Pp,"toDraftableAttributes");function ni(e){return {id:e.id,name:e.name,label:e.label,type:e.attributeType,...e.config}}chunkDPD6ZWL2_js.a(ni,"toAttribute");function Fp(e,t){let{id:r,name:n,label:o,type:a,...s}=e;return {id:e.id??e.name,objectId:t,name:e.name,label:e.label??e.name,attributeType:e.type,config:s}}chunkDPD6ZWL2_js.a(Fp,"toDraftableAttribute");function Vt(e,t){if(!e.objects.some(r=>r.id===t))throw new chunk72TQRSNX_js.h(`Object "${t}" is not in the draftable state`,[])}chunkDPD6ZWL2_js.a(Vt,"requireObject");function Pt(e){return {objectId:e.objectId}}chunkDPD6ZWL2_js.a(Pt,"objectFocus");function Ft(e){return {objectId:e.objectId,recordId:e.recordId}}chunkDPD6ZWL2_js.a(Ft,"recordFocus");function Se(e){return {objectId:e.objectId,attributeId:e.attributeId}}chunkDPD6ZWL2_js.a(Se,"attributeFocus");function Vp(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(Vp,"firstChangedProperty");var oe={...ti,objectId:Xt.z.string().uuid()},jp=Xt.z.object({...oe,type:Xt.z.literal("add_object"),name:Ze,label:Xt.z.string().min(1),icon:Xt.z.string().min(1).optional()}),Mp={type:"add_object",schema:jp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(e.objects.some(n=>n.name===t.name))throw new chunk72TQRSNX_js.h(`Object "${t.name}" already exists`,[]);if(e.objects.some(n=>n.id===t.objectId))throw new chunk72TQRSNX_js.h(`Object id "${t.objectId}" is already taken`,[]);let r={id:t.objectId,name:t.name,label:t.label,...t.icon===void 0?{}:{icon:t.icon}};return {...e,objects:[...e.objects,r]}},"apply"),focus:Pt,presentation:y(Pt,"structural"),describe:chunkDPD6ZWL2_js.a(e=>`Cr\xE9e l'objet \xAB ${e.label} \xBB`,"describe")},Lp=Xt.z.object({...oe,type:Xt.z.literal("update_object"),changes:Xt.z.object({label:Xt.z.string().min(1).optional(),icon:Xt.z.string().min(1).optional()}).refine(e=>Object.keys(e).length>0,"update_object needs at least one change")}),Ya=chunkDPD6ZWL2_js.a(e=>({objectId:e.objectId}),"updateObjectFocus"),Bp={type:"update_object",schema:Lp,apply:chunkDPD6ZWL2_js.a((e,t)=>(Vt(e,t.objectId),{...e,objects:e.objects.map(r=>r.id===t.objectId?{...r,...t.changes}:r)}),"apply"),focus:Ya,presentation:y(Ya,"atomic",Vp),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'objet en \xAB ${e.changes.label} \xBB`:"Modifie l'objet","describe")},Up=Xt.z.object({...oe,type:Xt.z.literal("remove_object")}),$p={type:"remove_object",schema:Up,apply:chunkDPD6ZWL2_js.a((e,t)=>{Vt(e,t.objectId);let r=e.objects.find(n=>n.id===t.objectId)?.name;return {...e,objects:e.objects.filter(n=>n.id!==t.objectId),attributes:e.attributes.filter(n=>n.objectId!==t.objectId),sampleRecords:e.sampleRecords.filter(n=>n.objectId!==t.objectId),views:e.views.filter(n=>n.objectName!==r)}},"apply"),focus:Pt,presentation:y(Pt,"structural"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'objet ${e.objectId}`,"describe")},Me=Vi.filter(e=>e!=="formula"&&e!=="rollup"),qp=Xt.z.object({...oe,type:Xt.z.literal("add_attribute"),attributeId:Xt.z.string().min(1),name:po,label:Xt.z.string().min(1),attributeType:Xt.z.enum(Me),config:Xt.z.record(Xt.z.string(),Xt.z.unknown()).optional()}).superRefine((e,t)=>{try{chunk47EGJRW7_js.n(e.attributeType,e.config??{});}catch(r){if(r instanceof chunk72TQRSNX_js.h){for(let n of r.errors)t.addIssue({code:"custom",message:n.message,path:["config",...n.path??[]]});return}throw r}}),zp={type:"add_attribute",schema:qp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(Vt(e,t.objectId),e.attributes.some(n=>n.objectId===t.objectId&&n.name===t.name))throw new chunk72TQRSNX_js.h(`Attribute "${t.name}" already exists on object "${t.objectId}"`,[]);let r={id:t.attributeId,objectId:t.objectId,name:t.name,label:t.label,attributeType:t.attributeType,...t.config===void 0?{}:{config:t.config}};for(let n of e.sampleRecords)n.objectId===t.objectId&&Ha(n.id,r,n.values);return {...e,attributes:[...e.attributes,r]}},"apply"),focus:Se,presentation:y(Se,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'attribut \xAB ${e.label} \xBB`,"describe")},Gp=Xt.z.object({...oe,type:Xt.z.literal("update_attribute"),attributeId:Xt.z.string().min(1),changes:Xt.z.object({label:Xt.z.string().min(1).optional()}).refine(e=>Object.keys(e).length>0,"update_attribute needs at least one change")}),Wp={type:"update_attribute",schema:Gp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(!e.attributes.some(r=>r.id===t.attributeId))throw new chunk72TQRSNX_js.h(`Attribute "${t.attributeId}" is not in the draftable state`,[]);return {...e,attributes:e.attributes.map(r=>r.id===t.attributeId?{...r,...t.changes}:r)}},"apply"),focus:Se,presentation:y(Se,"atomic"),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'attribut en \xAB ${e.changes.label} \xBB`:"Modifie l'attribut","describe")},Kp=Xt.z.object({...oe,type:Xt.z.literal("remove_attribute"),attributeId:Xt.z.string().min(1)}),Yp={type:"remove_attribute",schema:Kp,apply:chunkDPD6ZWL2_js.a((e,t)=>{let r=e.attributes.find(o=>o.id===t.attributeId);if(!r)throw new chunk72TQRSNX_js.h(`Attribute "${t.attributeId}" is not in the draftable state`,[]);let n=e.sampleRecords.find(o=>o.objectId===r.objectId&&r.name in o.values);if(n)throw new chunk72TQRSNX_js.h(`Attribute "${r.name}" is still used by sample record "${n.id}"`,[]);return {...e,attributes:e.attributes.filter(o=>o.id!==t.attributeId)}},"apply"),focus:Se,presentation:y(Se,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'attribut ${e.attributeId}`,"describe")};function Hp(e,t,r,n){let o=ni(r);try{chunk5QAE5NPN_js.c(o);}catch{return}let a=chunk5QAE5NPN_js.g(o,n);if(a.success)return;let s=a.errors??[],l=s.map(p=>p.message).join(", ");throw new chunk72TQRSNX_js.h(`Sample record "${e}" has an invalid value for "${t}": ${l}`,s.map(p=>({path:p.path,message:p.message})))}chunkDPD6ZWL2_js.a(Hp,"assertSampleValue");function Ha(e,t,r){if(t.config?.required===true&&t.config?.defaultValue===void 0&&!(t.name in r&&r[t.name]!==void 0))throw new chunk72TQRSNX_js.h(`Sample record "${e}" is missing a value for required attribute "${t.name}"`,[])}chunkDPD6ZWL2_js.a(Ha,"assertRequiredCovered");var Qp=Xt.z.object({...oe,type:Xt.z.literal("add_sample_record"),recordId:Xt.z.string().uuid(),values:Xt.z.record(Xt.z.string(),Xt.z.unknown())}),Jp={type:"add_sample_record",schema:Qp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(Vt(e,t.objectId),e.sampleRecords.some(n=>n.id===t.recordId))throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" already exists`,[]);let r=new Map(e.attributes.filter(n=>n.objectId===t.objectId).map(n=>[n.name,n]));for(let[n,o]of Object.entries(t.values)){let a=r.get(n);if(!a)throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" uses unknown attribute "${n}"`,[]);Hp(t.recordId,n,a,o);}for(let n of r.values())Ha(t.recordId,n,t.values);return {...e,sampleRecords:[...e.sampleRecords,{id:t.recordId,objectId:t.objectId,values:t.values}]}},"apply"),focus:Ft,presentation:y(Ft,"local"),describe:chunkDPD6ZWL2_js.a(()=>"Ajoute un exemple","describe")},Xp=Xt.z.object({...oe,type:Xt.z.literal("remove_sample_record"),recordId:Xt.z.string().min(1)}),Zp={type:"remove_sample_record",schema:Xp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(!e.sampleRecords.some(r=>r.id===t.recordId&&r.objectId===t.objectId))throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" is not in object "${t.objectId}"`,[]);return {...e,sampleRecords:e.sampleRecords.filter(r=>r.id!==t.recordId)}},"apply"),focus:Ft,presentation:y(Ft,"local"),describe:chunkDPD6ZWL2_js.a(()=>"Retire un exemple","describe")},Qa=[Mp,Bp,$p,zp,Wp,Yp,Jp,Zp];function em(){let e=new Map;for(let t of [...Qa,...Ua,...Ka]){if(e.has(t.type))throw new chunk72TQRSNX_js.r("architect operation",t.type);e.set(t.type,t);}return e}chunkDPD6ZWL2_js.a(em,"build");var ce=em(),ii=[...ce.keys()];function Le(e){let t=ce.get(e.type);if(!t)throw new chunk72TQRSNX_js.h(`Operation "${e.id}" has unknown type "${e.type}"`,[]);return t}chunkDPD6ZWL2_js.a(Le,"defOf");function oi(e,t){return t.reduce((r,n)=>Le(n).apply(r,n),e)}chunkDPD6ZWL2_js.a(oi,"applyOperations");function tm(e){return Le(e).focus(e)}chunkDPD6ZWL2_js.a(tm,"focusOf");function rm(e,t){return e.map(r=>Le(r).describe(r,t))}chunkDPD6ZWL2_js.a(rm,"describeOperations");function nm(e){if(typeof e!="object"||e===null||!("type"in e))throw new chunk72TQRSNX_js.h("An operation must be an object carrying a type",[]);let t=e.type;if(typeof t!="string")throw new chunk72TQRSNX_js.h("An operation's type must be a string",[]);let r=ce.get(t);if(!r)throw new chunk72TQRSNX_js.h(`Unknown operation type "${t}"`,[]);let n=r.schema.safeParse(e);if(!n.success)throw new chunk72TQRSNX_js.h(`Operation "${t}" is invalid: ${n.error.issues.map(o=>`${o.path.join(".")} ${o.message}`).join("; ")}`,[]);return n.data}chunkDPD6ZWL2_js.a(nm,"parseOperation");function Ja(e){return Xt.z.toJSONSchema(e,{io:"input"})}chunkDPD6ZWL2_js.a(Ja,"toJsonSchema");function om(e){let t=ce.get(e);if(!t)throw new chunk72TQRSNX_js.h(`Unknown operation type "${e}"`,[]);return Ja(t.schema)}chunkDPD6ZWL2_js.a(om,"describeOperationInput");function am(e){let t=Me.find(r=>r===e);if(!t)throw new chunk72TQRSNX_js.h(`Unknown attribute type "${e}"`,[]);return Ja(chunk47EGJRW7_js.m(t))}chunkDPD6ZWL2_js.a(am,"describeAttributeConfig");function sm(){return {operations:[...ii],attributeTypes:[...Me]}}chunkDPD6ZWL2_js.a(sm,"listDescribableNames");function Xa(e,t,r){let n=`fld_${e}_${t}`;return r===0?n:`${n}_${r}`}chunkDPD6ZWL2_js.a(Xa,"makeFieldId");function um(e,t){return e.attributeGroup?e.attributeGroup.id:e.attribute?e.attribute:`slot${t}`}chunkDPD6ZWL2_js.a(um,"seedOf");function lm(e){let t=new Map,r=e.fields.map((n,o)=>{if(n.id)return n;let a=um(n,o),s=t.get(a)??0;return t.set(a,s+1),{...n,id:Xa(e.id,a,s)}});return {...e,fields:r}}chunkDPD6ZWL2_js.a(lm,"withIds");function dm(e){return e.map(t=>t.type==="form"?{...t,groups:t.groups.map(lm)}:t)}chunkDPD6ZWL2_js.a(dm,"ensureFieldIds");function ai(e){return Le(e).presentation(e)}chunkDPD6ZWL2_js.a(ai,"presentationOf");function cm(e){let t=e.map(ai);return new Set(t.map(({focus:n})=>n.viewId??n.objectId).filter(n=>n!==void 0)).size>1||t.some(({impact:n})=>n==="structural")?"structural":t.some(({impact:n})=>n==="local")?"local":"atomic"}chunkDPD6ZWL2_js.a(cm,"episodeImpactOf");function pm(e,t){return e.config.tabs?.find(r=>r.id===t)}chunkDPD6ZWL2_js.a(pm,"listTabOf");function Za(e,t){let r=t.viewId?e.views.find(o=>o.id===t.viewId):void 0,n=t.tabId?r?.tabs.find(o=>o.id===t.tabId):void 0;if(t.attributeId)return e.attributes.find(o=>o.id===t.attributeId);if(t.fieldId){if(n?.type!=="form")return;for(let o of n.groups){let a=o.fields.find(s=>s.id===t.fieldId);if(a)return a}return}if(t.groupId)return n?.type!=="form"?void 0:n.groups.find(o=>o.id===t.groupId);if(t.tabId)return r?n??pm(r,t.tabId):void 0;if(t.recordId)return e.sampleRecords.find(o=>o.id===t.recordId);if(r)return r;if(t.objectId)return e.objects.find(o=>o.id===t.objectId)}chunkDPD6ZWL2_js.a(Za,"snapshotArchitectTarget");function mm(e,t){let r=e;return t.map(n=>{let o=ai(n),a=Za(r,o.focus);r=oi(r,[n]);let s=Za(r,o.focus);return {operationId:n.id,operationType:n.type,presentation:o,before:a,after:s}})}chunkDPD6ZWL2_js.a(mm,"deriveArchitectChanges");function fm(e){return {id:e.id??"",objectName:e.object,type:e.type,label:e.label,tabs:Ye(e)?e.config.tabs??[]:[],config:e.config}}chunkDPD6ZWL2_js.a(fm,"toDraftableView");function bm(e,t){return e.type==="detail"?{...e,label:t.label,config:{...t.config,tabs:t.tabs}}:{...e,label:t.label,config:t.config}}chunkDPD6ZWL2_js.a(bm,"fromDraftableView");Object.defineProperty(exports,"asTenantId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.b}});Object.defineProperty(exports,"asUserId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.c}});Object.defineProperty(exports,"canonicalStringify",{enumerable:true,get:function(){return chunkLQYUPOWB_js.a}});Object.defineProperty(exports,"deepEqual",{enumerable:true,get:function(){return chunkLQYUPOWB_js.f}});Object.defineProperty(exports,"generateId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.d}});Object.defineProperty(exports,"indexBy",{enumerable:true,get:function(){return chunkLQYUPOWB_js.e}});Object.defineProperty(exports,"ATTRIBUTE_FILTER_OPERATORS",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.i}});Object.defineProperty(exports,"LIST_TAB_KANBAN_KEYS",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.qa}});Object.defineProperty(exports,"LIST_TAB_TABLE_KEYS",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.pa}});Object.defineProperty(exports,"LIST_VIEW_TAB_VISIBILITIES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.w}});Object.defineProperty(exports,"LOCATION_FILTER_PROPERTIES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.f}});Object.defineProperty(exports,"NO_VALUE_OPERATORS",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.s}});Object.defineProperty(exports,"OPERATORS_BY_TYPE",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.r}});Object.defineProperty(exports,"REMOVED_OPERATOR_REPLACEMENTS",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.U}});Object.defineProperty(exports,"RESERVED_ATTRIBUTE_NAMES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.z}});Object.defineProperty(exports,"RESERVED_OBJECT_NAMES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.A}});Object.defineProperty(exports,"RESOURCE_VISIBILITIES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.v}});Object.defineProperty(exports,"SYNONYM_ALIASES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.M}});Object.defineProperty(exports,"SYSTEM_ATTRIBUTES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.c}});Object.defineProperty(exports,"SYSTEM_ATTRIBUTE_I18N_KEYS",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.a}});Object.defineProperty(exports,"SYSTEM_FIELD_NAMES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.y}});Object.defineProperty(exports,"SYSTEM_FILTER_ATTRIBUTE_TYPES",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.T}});Object.defineProperty(exports,"canonicalizeFilterValue",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.L}});Object.defineProperty(exports,"collectQualifiedRuleIssues",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.V}});Object.defineProperty(exports,"columnsSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.X}});Object.defineProperty(exports,"currentActor",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.C}});Object.defineProperty(exports,"detailTabDraftSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ia}});Object.defineProperty(exports,"detailTabSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ha}});Object.defineProperty(exports,"detailViewConfigSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.la}});Object.defineProperty(exports,"displayAttributesSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.Y}});Object.defineProperty(exports,"extractCurrencyFilterValue",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.F}});Object.defineProperty(exports,"extractFilterValue",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.G}});Object.defineProperty(exports,"fieldSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ba}});Object.defineProperty(exports,"fieldShape",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.aa}});Object.defineProperty(exports,"fieldSlotSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ca}});Object.defineProperty(exports,"filterGroupSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.$}});Object.defineProperty(exports,"filterStateSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js._}});Object.defineProperty(exports,"getAttributeCapabilities",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.j}});Object.defineProperty(exports,"getAttributeFilterOperators",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.k}});Object.defineProperty(exports,"getOperatorPolarity",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.H}});Object.defineProperty(exports,"getRollupFilterOperators",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.u}});Object.defineProperty(exports,"getSystemAttributeI18nKey",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.b}});Object.defineProperty(exports,"getSystemAttributeList",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.d}});Object.defineProperty(exports,"groupWriteSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.da}});Object.defineProperty(exports,"inverseSourceSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.fa}});Object.defineProperty(exports,"isAttributeFilterable",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.l}});Object.defineProperty(exports,"isAttributeGroupable",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.o}});Object.defineProperty(exports,"isAttributeKanbanGroupable",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.p}});Object.defineProperty(exports,"isAttributeSearchable",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.m}});Object.defineProperty(exports,"isDynamicValue",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.B}});Object.defineProperty(exports,"isLocationFilterProperty",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.g}});Object.defineProperty(exports,"isLocationPartOperator",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.h}});Object.defineProperty(exports,"isManagedSystemAttribute",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.e}});Object.defineProperty(exports,"isNoValueOperator",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.t}});Object.defineProperty(exports,"isRelativeDateValue",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.P}});Object.defineProperty(exports,"isSetMembershipOperator",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.K}});Object.defineProperty(exports,"listViewConfigSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ka}});Object.defineProperty(exports,"listViewTabSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ja}});Object.defineProperty(exports,"normalizeFilterRule",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.O}});Object.defineProperty(exports,"normalizeForEdgeRpc",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.I}});Object.defineProperty(exports,"normalizeOperator",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.N}});Object.defineProperty(exports,"now",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.E}});Object.defineProperty(exports,"parseResourceVisibility",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.x}});Object.defineProperty(exports,"parseViewConfig",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.oa}});Object.defineProperty(exports,"relationSourceSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ea}});Object.defineProperty(exports,"resolveEffectiveFilterType",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.q}});Object.defineProperty(exports,"resolveIsWithinBounds",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.Q}});Object.defineProperty(exports,"resolveUtcDayBounds",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.R}});Object.defineProperty(exports,"sortsSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.Z}});Object.defineProperty(exports,"tableSourceSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ga}});Object.defineProperty(exports,"toMultiValueOperator",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.J}});Object.defineProperty(exports,"toUtcDayString",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.S}});Object.defineProperty(exports,"today",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.D}});Object.defineProperty(exports,"validateQualifiedRule",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.W}});Object.defineProperty(exports,"viewConfigByTypeSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.na}});Object.defineProperty(exports,"viewTypeSchema",{enumerable:true,get:function(){return chunkVJYVPQ5E_js.ma}});Object.defineProperty(exports,"ComputedFormulaParseError",{enumerable:true,get:function(){return chunk47EGJRW7_js.d}});Object.defineProperty(exports,"SCHEMA_LIMITS",{enumerable:true,get:function(){return chunk47EGJRW7_js.a}});Object.defineProperty(exports,"colorIdSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.b}});Object.defineProperty(exports,"iconNameSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.c}});Object.defineProperty(exports,"multiselectOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.h}});Object.defineProperty(exports,"parseAttributeConfig",{enumerable:true,get:function(){return chunk47EGJRW7_js.l}});Object.defineProperty(exports,"parseAttributeConfigForCreate",{enumerable:true,get:function(){return chunk47EGJRW7_js.n}});Object.defineProperty(exports,"parseAttributeConfigForUpdate",{enumerable:true,get:function(){return chunk47EGJRW7_js.o}});Object.defineProperty(exports,"parseComputedFormula",{enumerable:true,get:function(){return chunk47EGJRW7_js.e}});Object.defineProperty(exports,"selectOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.g}});Object.defineProperty(exports,"statusGroupSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.f}});Object.defineProperty(exports,"statusOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.i}});Object.defineProperty(exports,"createFormAttributeValidator",{enumerable:true,get:function(){return chunk5QAE5NPN_js.d}});Object.defineProperty(exports,"isNullishOrEmptyString",{enumerable:true,get:function(){return chunk5QAE5NPN_js.a}});Object.defineProperty(exports,"isValuePresent",{enumerable:true,get:function(){return chunk5QAE5NPN_js.b}});Object.defineProperty(exports,"rejectUnknownAttributesOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.l}});Object.defineProperty(exports,"validateDraft",{enumerable:true,get:function(){return chunk5QAE5NPN_js.j}});Object.defineProperty(exports,"validateDraftOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.k}});Object.defineProperty(exports,"validateObject",{enumerable:true,get:function(){return chunk5QAE5NPN_js.h}});Object.defineProperty(exports,"validateObjectOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.i}});Object.defineProperty(exports,"createCheckboxValidator",{enumerable:true,get:function(){return chunk47KVYDKG_js.a}});Object.defineProperty(exports,"createDateValidator",{enumerable:true,get:function(){return chunkKLR22JMC_js.a}});Object.defineProperty(exports,"AccessDeniedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.B}});Object.defineProperty(exports,"AttributeInUseError",{enumerable:true,get:function(){return chunk72TQRSNX_js.H}});Object.defineProperty(exports,"AttributeNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.e}});Object.defineProperty(exports,"ChangeTypeNotSupportedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.q}});Object.defineProperty(exports,"ConcurrentModificationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.z}});Object.defineProperty(exports,"DestructiveSyncNotAllowedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.o}});Object.defineProperty(exports,"DuplicateError",{enumerable:true,get:function(){return chunk72TQRSNX_js.r}});Object.defineProperty(exports,"ForbiddenError",{enumerable:true,get:function(){return chunk72TQRSNX_js.w}});Object.defineProperty(exports,"MemoryNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.F}});Object.defineProperty(exports,"MigrationTimeoutError",{enumerable:true,get:function(){return chunk72TQRSNX_js.p}});Object.defineProperty(exports,"NotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.c}});Object.defineProperty(exports,"NotImplementedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.E}});Object.defineProperty(exports,"ObjectNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.d}});Object.defineProperty(exports,"ObjectReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.I}});Object.defineProperty(exports,"OrphanSystemAttributeError",{enumerable:true,get:function(){return chunk72TQRSNX_js.n}});Object.defineProperty(exports,"ProtectedResourceError",{enumerable:true,get:function(){return chunk72TQRSNX_js.i}});Object.defineProperty(exports,"ProtectedRoleError",{enumerable:true,get:function(){return chunk72TQRSNX_js.x}});Object.defineProperty(exports,"RecordNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.f}});Object.defineProperty(exports,"RecordReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.G}});Object.defineProperty(exports,"RepositoryError",{enumerable:true,get:function(){return chunk72TQRSNX_js.C}});Object.defineProperty(exports,"RoleNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.y}});Object.defineProperty(exports,"SchemaError",{enumerable:true,get:function(){return chunk72TQRSNX_js.b}});Object.defineProperty(exports,"SchemaErrorCode",{enumerable:true,get:function(){return chunk72TQRSNX_js.a}});Object.defineProperty(exports,"SchemaPlanNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.g}});Object.defineProperty(exports,"SearchBackendError",{enumerable:true,get:function(){return chunk72TQRSNX_js.D}});Object.defineProperty(exports,"StorageError",{enumerable:true,get:function(){return chunk72TQRSNX_js.A}});Object.defineProperty(exports,"SyncCascadeError",{enumerable:true,get:function(){return chunk72TQRSNX_js.m}});Object.defineProperty(exports,"SyncConflictError",{enumerable:true,get:function(){return chunk72TQRSNX_js.l}});Object.defineProperty(exports,"SyncError",{enumerable:true,get:function(){return chunk72TQRSNX_js.j}});Object.defineProperty(exports,"SystemEntityImmutableError",{enumerable:true,get:function(){return chunk72TQRSNX_js.k}});Object.defineProperty(exports,"ValidationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.h}});Object.defineProperty(exports,"isAttributeInUseError",{enumerable:true,get:function(){return chunk72TQRSNX_js.K}});Object.defineProperty(exports,"isNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.t}});Object.defineProperty(exports,"isObjectReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.L}});Object.defineProperty(exports,"isProtectedResourceError",{enumerable:true,get:function(){return chunk72TQRSNX_js.v}});Object.defineProperty(exports,"isRecordReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.J}});Object.defineProperty(exports,"isSchemaError",{enumerable:true,get:function(){return chunk72TQRSNX_js.s}});Object.defineProperty(exports,"isValidationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.u}});Object.defineProperty(exports,"TEXT_FORMAT_PATTERNS",{enumerable:true,get:function(){return chunkXHEBV2HE_js.a}});Object.defineProperty(exports,"createTextValidator",{enumerable:true,get:function(){return chunkXHEBV2HE_js.c}});Object.defineProperty(exports,"resolveTextPattern",{enumerable:true,get:function(){return chunkXHEBV2HE_js.b}});Object.defineProperty(exports,"createNumberValidator",{enumerable:true,get:function(){return chunkSLYRQ72J_js.a}});Object.defineProperty(exports,"DEFAULT_VALIDATION_MESSAGES",{enumerable:true,get:function(){return chunkJFSQ24XR_js.a}});Object.defineProperty(exports,"formatZodErrors",{enumerable:true,get:function(){return chunkJFSQ24XR_js.b}});exports.AGENT_UI_BATCH_MAX_BYTES=HT;exports.AGENT_UI_BATCH_MAX_ITEMS=QT;exports.ALLOWED_PROPERTY_TYPES=Xi;exports.ALL_ACTIONS=Yt;exports.ALL_OPERATION_TYPES=ii;exports.ALL_SYSTEM_RESOURCES=Rh;exports.ARTIFACT_FILE_ROLES=Qb;exports.ARTIFACT_KINDS=Yb;exports.ARTIFACT_LIST_VIEW=Gu;exports.ARTIFACT_OBJECT=$u;exports.ARTIFACT_OBJECT_NAME=mt;exports.ARTIFACT_RETENTIONS=Hb;exports.ARTIFACT_VIEW=qu;exports.ATTRIBUTE_TYPES=Vi;exports.AUDIT_ACTIONS=cb;exports.AUDIT_RESOURCE_TYPES=db;exports.ActivityTabConfig=Yr;exports.AgentBuilder=Zt;exports.BEHAVIOR_PROPERTIES=eb;exports.BYTE_UNIT_LABELS=js;exports.CLAIMABLE_SESSION_STATUSES=xs;exports.COMPUTED_FUNCTIONS=_e;exports.COMPUTED_FUNCTION_METADATA=_w;exports.COMPUTED_FUNCTION_NAMES=pw;exports.CONNECTOR_CALLBACK_PARAM=ox;exports.COUNT_MODES=Qi;exports.ComputedFormulaCompileError=b;exports.CustomTabConfig=Wr;exports.DB_COLUMN_FIELDS=Sh;exports.DEFAULT_AGENT_EXECUTION_CONFIG=bo;exports.DEFAULT_APPROVAL_POLICY=Mi;exports.DEFAULT_DICTATION_LIMITS=Wb;exports.DEFAULT_LABEL_FALLBACK=ro;exports.DEFAULT_MEETING_BOT_DISPLAY_NAME=Os;exports.DEFAULT_ROLES=pu;exports.DEFAULT_ROLE_DESCRIPTIONS=Ch;exports.DEFAULT_ROLE_LABELS=Dh;exports.DEFAULT_ROLE_PERMISSIONS=Nh;exports.DEFAULT_TENANT_SETTINGS=Rg;exports.DICTATION_FINALIZATION_TIMEOUT_MS=zb;exports.DICTATION_FRAME_BYTES=Mb;exports.DICTATION_MAX_BUFFER_BYTES=Bb;exports.DICTATION_MAX_FRAME_BYTES=Lb;exports.DICTATION_MAX_TRANSCRIPT_BYTES=Ub;exports.DICTATION_MODEL_ID=Gb;exports.DICTATION_PREPARATION_TIMEOUT_MS=qb;exports.DICTATION_SAMPLE_RATE=jb;exports.DICTATION_TICKET_TTL_MS=$b;exports.DOCUMENT_SYSTEM_ATTRIBUTES=Uy;exports.DRAFTABLE_ATTRIBUTE_TYPES=Me;exports.DRIVE_LIST_VIEW=Uu;exports.DRIVE_OBJECT=Lu;exports.DRIVE_OBJECT_NAME=pt;exports.DRIVE_VIEW=Bu;exports.DetailViewBuilder=Xr;exports.DocumentsTabConfig=Jr;exports.EMPTY_VALUE_PLACEHOLDER=Qe;exports.ESTIMATED_COUNT_CAP=Bg;exports.EmailsTabConfig=Hr;exports.FAKE_MEETING_BOT_SIGNATURE_HEADER=dx;exports.FORM_FORBIDDEN_ATTRIBUTE_TYPES=Gt;exports.FlagRegistry=Ne;exports.FlagService=ct;exports.FormBuilder=Lr;exports.FormRegistry=ke;exports.FormRowBuilder=jr;exports.FormStepBuilder=Mr;exports.GroupBuilder=at;exports.IDENTITY_PROPERTIES=Zf;exports.IMAGE_FORMATS=Vg;exports.INFERENCE_REASONING_OPTIONS=Ui;exports.INFERENCE_SPEEDS=Bi;exports.LIVE_EVENT_TYPES=sl;exports.ListViewBuilder=Zr;exports.ListViewTabConfigBuilder=en;exports.MAX_PRESET_DEPTH=zi;exports.MAX_TODOS=Rb;exports.MAX_TODO_DESCRIPTION_CHARS=Db;exports.MAX_TODO_ID_CHARS=Eb;exports.MAX_TODO_RESULT_CHARS=Cb;exports.MEETING_ATTRIBUTES=T;exports.MEETING_DETAIL_VIEW_ID=Ro;exports.MEETING_LIST_VIEW=Yu;exports.MEETING_LIST_VIEW_ID=So;exports.MEETING_OBJECT=Wu;exports.MEETING_OBJECT_NAME=ft;exports.MEETING_VIEW=Ku;exports.MEETING_WRITE_SOURCE=vo;exports.MEMORY_LIST_VIEW=Mu;exports.MEMORY_OBJECT=Vu;exports.MEMORY_VIEW=ju;exports.McpOAuthCompletionMode=Hd;exports.MeetingsTabConfig=Qr;exports.NATIVE_AGENT_UI_PART_IDS_METADATA_KEY=vs;exports.NATIVE_AGENT_UI_PART_IDS_METADATA_SCHEMA_VERSION=Rs;exports.NOTIFICATION_INBOX_STATES=Pi;exports.NOTIFICATION_KINDS=Oi;exports.NOTIFICATION_PRIORITIES=ki;exports.NOTIFICATION_SENSITIVITIES=_i;exports.NOTIFICATION_TYPES_V1=Jf;exports.NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED=Ts;exports.NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN=hs;exports.NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED=As;exports.NOTIFICATION_WORK_STATES=Fi;exports.NO_RECORDING=cx;exports.NoopGeocodingAdapter=Ki;exports.OBJECT_NAME_SCHEMA=Ze;exports.OPEN_TOOL_PART_STATES=Is;exports.OPERATION_REGISTRY=ce;exports.OPERATOR_SPECS=Rt;exports.ObjectBuilder=zr;exports.PRESENTATION_PROPERTIES=tb;exports.PROVIDER_NAMES=Li;exports.QUALIFIED_SEPARATOR=Yy;exports.QUOTA_KEYS=qg;exports.RECORDING_OVERRIDES=ux;exports.RECORDING_POLICIES=lx;exports.RECORD_CREATOR_ROOT_ACTOR_METADATA_KEY=uo;exports.RELATION_TARGET_ANY=We;exports.RichtextTabConfig=Kr;exports.SCHEMA_PLAN_LIMITS=$;exports.SCHEMA_SOURCE_ID_PATTERN=Qn;exports.SESSION_STATE_STREAM_ID=_b;exports.SESSION_TERMINAL_STATUSES=ws;exports.SKILL_CONTENT_TEMPLATE=wo;exports.SKILL_LIST_VIEW=_u;exports.SKILL_OBJECT=Ou;exports.SKILL_VIEW=ku;exports.STANDARD_SCHEMA_VENDOR=yu;exports.SYSTEM_PART_CODES=zt;exports.SYSTEM_RESOURCES=M;exports.SYSTEM_RESOURCE_LABELS=Eh;exports.TODAY_DEFAULT=ra;exports.TODO_PLAN_STATUSES=Ab;exports.TODO_STATUSES=vb;exports.TOOL_APPROVAL_STATES=$i;exports.TabBuilder=J;exports.TableTabConfig=st;exports.UPDATE_TABLE_TAB_CHANGE_KEYS=Qc;exports.UPDATE_TAB_CHANGE_KEYS=Cc;exports.UPDATE_TAB_CONFIG_CHANGE_KEYS=Jc;exports.USER_STATUSES=Dg;exports.USER_WORK_POSTURES=Cg;exports.accessLevelToActions=Tg;exports.actionsToAccessLevel=Ag;exports.agent=qh;exports.agentDataChunk=$x;exports.agentDisplayName=Tb;exports.agentInferencePreferencesSchema=Lx;exports.agentMessageAttachmentSchema=mc;exports.agentMessagePartSchema=pc;exports.agentSessionInferenceOverridesInputSchema=cc;exports.agentSessionInferenceOverridesSchema=Bx;exports.agentSessionMessageSchema=Aa;exports.agentUIValidationError=Tc;exports.applyOperations=oi;exports.applyPipes=Zs;exports.applyRelationProps=iu;exports.assertAcyclicComputedDependencies=yw;exports.assertCustomAgentUIMessageChunk=wc;exports.assertSchemaSourceId=Xd;exports.booleanFlag=wu;exports.buildAgentFallbackTitle=ia;exports.buildPermissionFlags=cu;exports.buildPropertySchema=He;exports.buildQualifiedAttribute=Qy;exports.checkbox=go;exports.compareAgentSessionMessages=Ss;exports.compileComputedFormula=Bo;exports.compileRollupAttribute=ww;exports.computeByteMagnitude=Vs;exports.conversationDisplayTitle=Jd;exports.createFlagRegistry=Ru;exports.createFlagService=Du;exports.createStandardSchemaProps=tt;exports.currency=rA;exports.customDataChunkSchemas=Sa;exports.date=U;exports.dateInTimezone=Et;exports.dateValueStart=fe;exports.defineOperation=Dt;exports.definePresentation=y;exports.deriveArchitectChanges=mm;exports.deriveCreateDefaultsFromFilters=rx;exports.deriveInitials=lu;exports.describeAttributeConfig=am;exports.describeOperationInput=om;exports.describeOperations=rm;exports.destructiveSchema=fa;exports.detailView=G;exports.document=yo;exports.durableDateSchema=gc;exports.ensureFieldIds=dm;exports.episodeImpactOf=cm;exports.evaluateComputedAst=Dw;exports.evaluateComputedFormula=Cw;exports.evaluateComputedFormulaWithResult=Nw;exports.evaluateFilterState=$d;exports.evaluateRecordFilterState=Yw;exports.extractAttributeNames=oo;exports.extractValueRefs=so;exports.flagRegistry=vu;exports.focusOf=tm;exports.form=bA;exports.formFieldFlatKey=Ns;exports.formFieldKey=Cs;exports.formRegistry=Co;exports.formatAgentStreamFrameId=GT;exports.formatAttributeValue=Zi;exports.formatByteSize=Vy;exports.formatComputedResult=jd;exports.formatLocationValue=Gs;exports.formula=sA;exports.fromDraftableView=bm;exports.generateDefaultDetailView=_n;exports.generateDefaultListView=Pn;exports.getActiveTab=PT;exports.getEditableLabelAttribute=ru;exports.getErrorMessage=Zb;exports.getListViewDisplayAttributeNames=Ms;exports.getLiveProtocolPayloadChannel=uw;exports.getRecordCreatorPrincipalId=du;exports.getSingleAttributeFromExpression=ao;exports.getSlotFieldTargets=Wi;exports.getUserDisplayName=su;exports.group=kA;exports.hasDestructiveEntries=Tx;exports.hasOptions=Ig;exports.imageModelIdSchema=xa;exports.includesAction=ge;exports.inferInverseCardinality=ab;exports.inferRollupReturnType=Id;exports.inferenceReasoningSchema=ei;exports.inferenceSpeedSchema=Zn;exports.isAgentUIDataName=Ac;exports.isAgentUIMessageBatch=JT;exports.isAttributeSortable=sb;exports.isBilateralRelation=ob;exports.isCheckboxEquality=jw;exports.isClaimableSessionStatus=hb;exports.isComputedFunctionName=yt;exports.isDateRangeValue=ee;exports.isDefaultRole=Oh;exports.isDetailView=Ye;exports.isDocumentAttribute=$y;exports.isEmptyObject=Ps;exports.isFieldGroup=ks;exports.isFormDefinition=ng;exports.isFormFieldsRow=Ke;exports.isFormFreeFieldRef=Wt;exports.isFormHeadingRow=dg;exports.isFormSeparatorRow=cg;exports.isFormSlotFieldRef=Gi;exports.isFormTextRow=pg;exports.isLabelExpression=Xe;exports.isListView=Hi;exports.isLiveEventEnvelope=lw;exports.isLiveEventPayload=iw;exports.isLiveEventPayloadForType=gl;exports.isLiveEventType=bl;exports.isNotEmpty=Ji;exports.isOpenToolPartState=wb;exports.isPlainRecord=Yo;exports.isStandardSchema=Wh;exports.isSystemPartCode=Ib;exports.isTerminalSessionStatus=yb;exports.isTerminalState=fb;exports.isToolApprovalState=xb;exports.isUniversalRelation=ji;exports.jsonFlag=Su;exports.legacyStatusToSessionState=gb;exports.listDescribableNames=sm;exports.listView=W;exports.liveChannelKey=ew;exports.location=oA;exports.makeFieldId=Xa;exports.matchesAccepts=qy;exports.mentionReferenceSchema=fc;exports.modelDefinitionSchema=bc;exports.modelReferenceSchema=wa;exports.multiselect=iA;exports.nativeAgentUIPartIdMetadataKey=Ds;exports.normalizeDateValue=Ls;exports.number=nt;exports.numberFlag=Iu;exports.object=z;exports.orderAgentSessionMessages=Sb;exports.parseAgentStreamFrameId=WT;exports.parseCountMode=_s;exports.parseLiveChannelKey=Oo;exports.parseNativeAgentUIPartIdsMetadata=Pb;exports.parseOperation=nm;exports.parseOptionalCountMode=Lg;exports.parseQualifiedAttribute=Hy;exports.persistedDefaultViewTargetSchema=ac;exports.persistedSchemaPlanSchema=_x;exports.phone=tA;exports.plannedAttributeSchema=rc;exports.plannedInlineAttributeSchema=nc;exports.plannedObjectSchema=ic;exports.presentationOf=ai;exports.proposedDefaultViewTargetSchema=oc;exports.providerNameSchema=Ta;exports.qualifiedPropertyDefs=au;exports.readFormFieldValue=sg;exports.registry=tT;exports.relation=Ae;exports.relationPropertyDefs=ou;exports.relationTargetsOf=ib;exports.renderLabelExpression=Qt;exports.resetViewToDefault=rl;exports.resolveAttributeDefaultValue=Kd;exports.resolveFieldRequired=ag;exports.resolvePropertyDefinitions=Yi;exports.richtext=he;exports.rollup=uA;exports.rollupToFormulaExpression=xd;exports.schemaPlanSchema=kx;exports.select=q;exports.sessionInferencePatchSchema=Ux;exports.sessionStateToLegacyStatus=bb;exports.status=nA;exports.stringFlag=xu;exports.text=f;exports.toAttribute=ni;exports.toDraftableAttributes=Pp;exports.toDraftableObject=_p;exports.toDraftableView=fm;exports.toUndefinedIfEmpty=Fs;exports.todoItemSchema=yc;exports.todoPlanSchema=hc;exports.toolImpactSchema=Ia;exports.user=aA;exports.validateAttributeName=Ce;exports.validateLabelExpression=Xs;exports.validateObjectExpressions=Au;exports.validateObjectName=De;exports.validateViewName=et;exports.viewRegistry=Hu;exports.viewStateKey=Og;exports.viewSyncPayload=Zd;