@stndrds/schema 1.0.0-alpha.315 → 1.0.0-alpha.317

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 (67) hide show
  1. package/dist/{all-BGyE2RCe.d.ts → all-BsINIhT4.d.ts} +993 -618
  2. package/dist/{all--LbSrtzk.d.mts → all-Js3OaRJY.d.mts} +993 -618
  3. package/dist/{attributes-cBtnsK8O.d.mts → attributes-2ELU4S-n.d.mts} +2 -2
  4. package/dist/{attributes-cBtnsK8O.d.ts → attributes-2ELU4S-n.d.ts} +2 -2
  5. package/dist/chunk-3VONXKAN.js +2 -0
  6. package/dist/{chunk-D6LPMF5N.mjs → chunk-B2W4ZEO2.mjs} +1 -1
  7. package/dist/{chunk-WKDJGNVI.js → chunk-HS7IRPL2.js} +1 -1
  8. package/dist/chunk-MMOW6WTJ.mjs +2 -0
  9. package/dist/exceptions.d.mts +1 -1
  10. package/dist/exceptions.d.ts +1 -1
  11. package/dist/{objects-iPrveCDN.d.ts → helpers-CAOdIXNe.d.ts} +74 -2
  12. package/dist/{objects-kXaFEi-P.d.mts → helpers-CJpLZ8jG.d.mts} +74 -2
  13. package/dist/index-C6-AlR2_.d.mts +184 -0
  14. package/dist/index-iKNo_z7O.d.ts +184 -0
  15. package/dist/index.d.mts +4872 -3918
  16. package/dist/index.d.ts +4872 -3918
  17. package/dist/index.js +20 -20
  18. package/dist/index.mjs +20 -20
  19. package/dist/{types-DgPbxSij.d.mts → types-DFs7mc3G.d.mts} +1 -1
  20. package/dist/{types-CT0s-S_Y.d.ts → types-DjTB_kVH.d.ts} +1 -1
  21. package/dist/utils.d.mts +1 -1
  22. package/dist/utils.d.ts +1 -1
  23. package/dist/validation/all.d.mts +5 -6
  24. package/dist/validation/all.d.ts +5 -6
  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 +2 -3
  46. package/dist/validation/config/index.d.ts +2 -3
  47. package/dist/validation/config/index.js +1 -1
  48. package/dist/validation/config/index.mjs +1 -1
  49. package/dist/validation/core/index.d.mts +3 -3
  50. package/dist/validation/core/index.d.ts +3 -3
  51. package/dist/validation/object/index.d.mts +4 -4
  52. package/dist/validation/object/index.d.ts +4 -4
  53. package/dist/validation/primitives/checkbox.d.mts +2 -2
  54. package/dist/validation/primitives/checkbox.d.ts +2 -2
  55. package/dist/validation/primitives/date.d.mts +2 -2
  56. package/dist/validation/primitives/date.d.ts +2 -2
  57. package/dist/validation/primitives/number.d.mts +2 -2
  58. package/dist/validation/primitives/number.d.ts +2 -2
  59. package/dist/validation/primitives/text.d.mts +2 -2
  60. package/dist/validation/primitives/text.d.ts +2 -2
  61. package/package.json +2 -2
  62. package/dist/chunk-JRBNMHMY.js +0 -2
  63. package/dist/chunk-YFW2M45I.mjs +0 -2
  64. package/dist/helpers-BOtvDGN6.d.ts +0 -76
  65. package/dist/helpers-DrbRe4Xl.d.mts +0 -76
  66. package/dist/index-XQ-3wEYg.d.ts +0 -872
  67. package/dist/index-p0utq5vG.d.mts +0 -872
@@ -75,7 +75,7 @@ type SchemaOperation = {
75
75
  } | {
76
76
  type: "remove_attribute";
77
77
  name: string;
78
- backup_config: Attribute;
78
+ backup_config?: Attribute;
79
79
  } | {
80
80
  type: "rename_attribute";
81
81
  from: string;
@@ -1360,4 +1360,4 @@ declare function isAttributeSortable(attr: {
1360
1360
  type: AttributeType;
1361
1361
  }): boolean;
1362
1362
 
1363
- export { type ComputedFieldKind as $, type Attribute as A, type BilateralConfig as B, type CheckboxAttribute as C, type DateAttribute as D, type RelationTarget as E, type FormulaAttribute as F, type RollupFunction as G, type UserReferenceType as H, ATTRIBUTE_TYPES as I, AccessDeniedError as J, type AttributeGroup as K, type LocationAttribute as L, type MultiselectAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, AttributeInUseError as Q, type RichtextAttribute as R, type SelectAttribute as S, type TextAttribute as T, type UserAttribute as U, ValidationError as V, AttributeNotFoundError as W, type AttributeUsage as X, type BaseAttribute as Y, type BuiltInTransform as Z, ChangeTypeNotSupportedError as _, type CurrencyAttribute as a, isSchemaError as a$, type ComputedFormulaBinaryNode as a0, type ComputedFormulaBinaryOperator as a1, type ComputedFormulaCallNode as a2, type ComputedFormulaLiteralNode as a3, ComputedFormulaParseError as a4, type ComputedFormulaPathNode as a5, ConcurrentModificationError as a6, type DateFormat as a7, type DateValue as a8, DestructiveSyncNotAllowedError as a9, type SchemaOperation as aA, SchemaPlanNotFoundError as aB, SearchBackendError as aC, type StatusGroup as aD, StorageError as aE, type StorageOperation as aF, SyncCascadeError as aG, SyncConflictError as aH, SyncError as aI, SystemEntityImmutableError as aJ, type UserId as aK, type ValidationErrorDetail as aL, asTenantId as aM, asUserId as aN, canonicalStringify as aO, deepEqual as aP, generateId as aQ, hasOptions as aR, indexBy as aS, inferInverseCardinality as aT, isAttributeInUseError as aU, isAttributeSortable as aV, isBilateralRelation as aW, isNotFoundError as aX, isObjectReferencedError as aY, isProtectedResourceError as aZ, isRecordReferencedError as a_, DuplicateError as aa, ForbiddenError as ab, MemoryNotFoundError as ac, MigrationTimeoutError as ad, NonJsonValueError as ae, NotFoundError as af, NotImplementedError as ag, type NumberUnit as ah, ObjectNotFoundError as ai, ObjectReferencedError as aj, type OptionPropertyAttribute as ak, OrphanSystemAttributeError as al, type PropertyType as am, ProtectedResourceError as an, ProtectedRoleError as ao, RELATION_TARGET_ANY as ap, RecordNotFoundError as aq, type RecordReference as ar, RecordReferencedError as as, RepositoryError as at, type RepositoryOperation as au, ReservedObjectNameError as av, type RichTextAttribute as aw, RoleNotFoundError as ax, SchemaError as ay, SchemaErrorCode as az, type StatusAttribute as b, isUniversalRelation as b0, isValidationError as b1, parseComputedFormula as b2, relationTargetsOf as b3, resolvePropertyDefinitions as b4, sameStableValue as b5, serializeCanonicalJson as b6, serializeStableJson as b7, type MultiRelationAttribute as c, type RelationAttribute as d, type SingleRelationAttribute as e, type RollupAttribute as f, type Uuid as g, type MigrationDefinition as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type TenantId as p, type LocationGranularity as q, type Location as r, type DateRangeValue as s, type DocumentAttribute as t, type Phone as u, type Currency as v, type PropertySchema as w, type TimeFormat as x, type PropertyAttribute as y, type FormulaReturnType as z };
1363
+ export { type ComputedFieldKind as $, type Attribute as A, type BilateralConfig as B, type CheckboxAttribute as C, type DateAttribute as D, type RelationTarget as E, type FormulaAttribute as F, type RollupFunction as G, type UserReferenceType as H, ATTRIBUTE_TYPES as I, AccessDeniedError as J, type AttributeGroup as K, type LocationAttribute as L, type MultiselectAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, AttributeInUseError as Q, type RichtextAttribute as R, type SelectAttribute as S, type TextAttribute as T, type UserAttribute as U, ValidationError as V, AttributeNotFoundError as W, type AttributeUsage as X, type BaseAttribute as Y, type BuiltInTransform as Z, ChangeTypeNotSupportedError as _, type CurrencyAttribute as a, isSchemaError as a$, type ComputedFormulaBinaryNode as a0, type ComputedFormulaBinaryOperator as a1, type ComputedFormulaCallNode as a2, type ComputedFormulaLiteralNode as a3, ComputedFormulaParseError as a4, type ComputedFormulaPathNode as a5, ConcurrentModificationError as a6, type DateFormat as a7, type DateValue as a8, DestructiveSyncNotAllowedError as a9, type SchemaOperation as aA, SchemaPlanNotFoundError as aB, SearchBackendError as aC, type StatusGroup as aD, StorageError as aE, type StorageOperation as aF, SyncCascadeError as aG, SyncConflictError as aH, SyncError as aI, SystemEntityImmutableError as aJ, type UserId as aK, type ValidationErrorDetail as aL, asTenantId as aM, asUserId as aN, canonicalStringify as aO, deepEqual as aP, generateId as aQ, hasOptions as aR, indexBy as aS, inferInverseCardinality as aT, isAttributeInUseError as aU, isAttributeSortable as aV, isBilateralRelation as aW, isNotFoundError as aX, isObjectReferencedError as aY, isProtectedResourceError as aZ, isRecordReferencedError as a_, DuplicateError as aa, ForbiddenError as ab, MemoryNotFoundError as ac, MigrationTimeoutError as ad, NonJsonValueError as ae, NotFoundError as af, NotImplementedError as ag, type NumberUnit as ah, ObjectNotFoundError as ai, ObjectReferencedError as aj, type OptionPropertyAttribute as ak, OrphanSystemAttributeError as al, type PropertyType as am, ProtectedResourceError as an, ProtectedRoleError as ao, RELATION_TARGET_ANY as ap, RecordNotFoundError as aq, type RecordReference as ar, RecordReferencedError as as, RepositoryError as at, type RepositoryOperation as au, ReservedObjectNameError as av, type RichTextAttribute as aw, RoleNotFoundError as ax, SchemaError as ay, SchemaErrorCode as az, type StatusAttribute as b, isUniversalRelation as b0, isValidationError as b1, parseComputedFormula as b2, relationTargetsOf as b3, resolvePropertyDefinitions as b4, sameStableValue as b5, serializeCanonicalJson as b6, serializeStableJson as b7, type MultiRelationAttribute as c, type RelationAttribute as d, type SingleRelationAttribute as e, type RollupAttribute as f, type Uuid as g, type MigrationDefinition as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type PropertySchema as p, type TenantId as q, type LocationGranularity as r, type Location as s, type DateRangeValue as t, type DocumentAttribute as u, type Phone as v, type Currency as w, type PropertyAttribute as x, type TimeFormat as y, type FormulaReturnType as z };
@@ -75,7 +75,7 @@ type SchemaOperation = {
75
75
  } | {
76
76
  type: "remove_attribute";
77
77
  name: string;
78
- backup_config: Attribute;
78
+ backup_config?: Attribute;
79
79
  } | {
80
80
  type: "rename_attribute";
81
81
  from: string;
@@ -1360,4 +1360,4 @@ declare function isAttributeSortable(attr: {
1360
1360
  type: AttributeType;
1361
1361
  }): boolean;
1362
1362
 
1363
- export { type ComputedFieldKind as $, type Attribute as A, type BilateralConfig as B, type CheckboxAttribute as C, type DateAttribute as D, type RelationTarget as E, type FormulaAttribute as F, type RollupFunction as G, type UserReferenceType as H, ATTRIBUTE_TYPES as I, AccessDeniedError as J, type AttributeGroup as K, type LocationAttribute as L, type MultiselectAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, AttributeInUseError as Q, type RichtextAttribute as R, type SelectAttribute as S, type TextAttribute as T, type UserAttribute as U, ValidationError as V, AttributeNotFoundError as W, type AttributeUsage as X, type BaseAttribute as Y, type BuiltInTransform as Z, ChangeTypeNotSupportedError as _, type CurrencyAttribute as a, isSchemaError as a$, type ComputedFormulaBinaryNode as a0, type ComputedFormulaBinaryOperator as a1, type ComputedFormulaCallNode as a2, type ComputedFormulaLiteralNode as a3, ComputedFormulaParseError as a4, type ComputedFormulaPathNode as a5, ConcurrentModificationError as a6, type DateFormat as a7, type DateValue as a8, DestructiveSyncNotAllowedError as a9, type SchemaOperation as aA, SchemaPlanNotFoundError as aB, SearchBackendError as aC, type StatusGroup as aD, StorageError as aE, type StorageOperation as aF, SyncCascadeError as aG, SyncConflictError as aH, SyncError as aI, SystemEntityImmutableError as aJ, type UserId as aK, type ValidationErrorDetail as aL, asTenantId as aM, asUserId as aN, canonicalStringify as aO, deepEqual as aP, generateId as aQ, hasOptions as aR, indexBy as aS, inferInverseCardinality as aT, isAttributeInUseError as aU, isAttributeSortable as aV, isBilateralRelation as aW, isNotFoundError as aX, isObjectReferencedError as aY, isProtectedResourceError as aZ, isRecordReferencedError as a_, DuplicateError as aa, ForbiddenError as ab, MemoryNotFoundError as ac, MigrationTimeoutError as ad, NonJsonValueError as ae, NotFoundError as af, NotImplementedError as ag, type NumberUnit as ah, ObjectNotFoundError as ai, ObjectReferencedError as aj, type OptionPropertyAttribute as ak, OrphanSystemAttributeError as al, type PropertyType as am, ProtectedResourceError as an, ProtectedRoleError as ao, RELATION_TARGET_ANY as ap, RecordNotFoundError as aq, type RecordReference as ar, RecordReferencedError as as, RepositoryError as at, type RepositoryOperation as au, ReservedObjectNameError as av, type RichTextAttribute as aw, RoleNotFoundError as ax, SchemaError as ay, SchemaErrorCode as az, type StatusAttribute as b, isUniversalRelation as b0, isValidationError as b1, parseComputedFormula as b2, relationTargetsOf as b3, resolvePropertyDefinitions as b4, sameStableValue as b5, serializeCanonicalJson as b6, serializeStableJson as b7, type MultiRelationAttribute as c, type RelationAttribute as d, type SingleRelationAttribute as e, type RollupAttribute as f, type Uuid as g, type MigrationDefinition as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type TenantId as p, type LocationGranularity as q, type Location as r, type DateRangeValue as s, type DocumentAttribute as t, type Phone as u, type Currency as v, type PropertySchema as w, type TimeFormat as x, type PropertyAttribute as y, type FormulaReturnType as z };
1363
+ export { type ComputedFieldKind as $, type Attribute as A, type BilateralConfig as B, type CheckboxAttribute as C, type DateAttribute as D, type RelationTarget as E, type FormulaAttribute as F, type RollupFunction as G, type UserReferenceType as H, ATTRIBUTE_TYPES as I, AccessDeniedError as J, type AttributeGroup as K, type LocationAttribute as L, type MultiselectAttribute as M, type NumberAttribute as N, type Option as O, type PhoneAttribute as P, AttributeInUseError as Q, type RichtextAttribute as R, type SelectAttribute as S, type TextAttribute as T, type UserAttribute as U, ValidationError as V, AttributeNotFoundError as W, type AttributeUsage as X, type BaseAttribute as Y, type BuiltInTransform as Z, ChangeTypeNotSupportedError as _, type CurrencyAttribute as a, isSchemaError as a$, type ComputedFormulaBinaryNode as a0, type ComputedFormulaBinaryOperator as a1, type ComputedFormulaCallNode as a2, type ComputedFormulaLiteralNode as a3, ComputedFormulaParseError as a4, type ComputedFormulaPathNode as a5, ConcurrentModificationError as a6, type DateFormat as a7, type DateValue as a8, DestructiveSyncNotAllowedError as a9, type SchemaOperation as aA, SchemaPlanNotFoundError as aB, SearchBackendError as aC, type StatusGroup as aD, StorageError as aE, type StorageOperation as aF, SyncCascadeError as aG, SyncConflictError as aH, SyncError as aI, SystemEntityImmutableError as aJ, type UserId as aK, type ValidationErrorDetail as aL, asTenantId as aM, asUserId as aN, canonicalStringify as aO, deepEqual as aP, generateId as aQ, hasOptions as aR, indexBy as aS, inferInverseCardinality as aT, isAttributeInUseError as aU, isAttributeSortable as aV, isBilateralRelation as aW, isNotFoundError as aX, isObjectReferencedError as aY, isProtectedResourceError as aZ, isRecordReferencedError as a_, DuplicateError as aa, ForbiddenError as ab, MemoryNotFoundError as ac, MigrationTimeoutError as ad, NonJsonValueError as ae, NotFoundError as af, NotImplementedError as ag, type NumberUnit as ah, ObjectNotFoundError as ai, ObjectReferencedError as aj, type OptionPropertyAttribute as ak, OrphanSystemAttributeError as al, type PropertyType as am, ProtectedResourceError as an, ProtectedRoleError as ao, RELATION_TARGET_ANY as ap, RecordNotFoundError as aq, type RecordReference as ar, RecordReferencedError as as, RepositoryError as at, type RepositoryOperation as au, ReservedObjectNameError as av, type RichTextAttribute as aw, RoleNotFoundError as ax, SchemaError as ay, SchemaErrorCode as az, type StatusAttribute as b, isUniversalRelation as b0, isValidationError as b1, parseComputedFormula as b2, relationTargetsOf as b3, resolvePropertyDefinitions as b4, sameStableValue as b5, serializeCanonicalJson as b6, serializeStableJson as b7, type MultiRelationAttribute as c, type RelationAttribute as d, type SingleRelationAttribute as e, type RollupAttribute as f, type Uuid as g, type MigrationDefinition as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type PropertySchema as p, type TenantId as q, type LocationGranularity as r, type Location as s, type DateRangeValue as t, type DocumentAttribute as u, type Phone as v, type Currency as w, type PropertyAttribute as x, type TimeFormat as y, type FormulaReturnType as z };
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkHS7IRPL2_js=require('./chunk-HS7IRPL2.js'),chunkJSKLP4GI_js=require('./chunk-JSKLP4GI.js'),chunkDPD6ZWL2_js=require('./chunk-DPD6ZWL2.js'),zod=require('zod');/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
+ var Rt={createdAt:"createdAt",updatedAt:"updatedAt",createdBy:"createdBy",lastUpdatedBy:"lastUpdatedBy",attachments:"attachments"};function Le(t){return Rt[t]}chunkDPD6ZWL2_js.a(Le,"getSystemAttributeI18nKey");var Tt={createdAt:{id:"system:createdAt",name:"createdAt",label:"Created time",type:"date",required:false,system:true,icon:"clock-circle",description:"When this record was created"},updatedAt:{id:"system:updatedAt",name:"updatedAt",label:"Last edited time",type:"date",required:false,system:true,icon:"clock-circle",description:"When this record was last modified"},createdBy:{id:"system:createdBy",name:"createdBy",label:"Created by",type:"user",required:false,system:true,multiple:false,icon:"user",description:"Actor who created this record"},lastUpdatedBy:{id:"system:lastUpdatedBy",name:"lastUpdatedBy",label:"Last edited by",type:"user",required:false,system:true,multiple:false,icon:"user",description:"Actor who last modified this record"},attachments:{id:"system:attachments",name:"attachments",label:"Attachments",type:"document",required:false,system:true,hidden:true,icon:"paperclip",description:"Free-form document attachments"}};function Be(){return Object.values(Tt)}chunkDPD6ZWL2_js.a(Be,"getSystemAttributeList");function J(t){return t.id?.startsWith("system:")??false}chunkDPD6ZWL2_js.a(J,"isManagedSystemAttribute");var G=["is","is_not","contains","not_contains","starts_with","ends_with","is_empty","is_not_empty"],z=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","is_empty","is_not_empty"],Ot=["is"],xt=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","is_within","on_day_month","is_empty","is_not_empty"],W=["is","is_not","any_of","none_of","is_empty","is_not_empty"],Ft=["any_of","none_of","is_empty","is_not_empty"],K=["is","is_not","any_of","none_of","is_empty","is_not_empty"],wt=["is_empty","is_not_empty"],Ct=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","contains","not_contains","is_empty","is_not_empty"],x=["city","postalCode","country"];function F(t){return x.includes(t)}chunkDPD6ZWL2_js.a(F,"isLocationFilterProperty");function Ye(t){return G.includes(t)}chunkDPD6ZWL2_js.a(Ye,"isLocationPartOperator");var b={text:G,richtext:[],number:z,checkbox:Ot,date:xt,phone:["is","is_not","contains","not_contains","starts_with","is_empty","is_not_empty"],currency:z,status:W,select:W,multiselect:Ft,location:[],user:K,relation:K,formula:Ct,document:wt},It=new Set(["formula","rollup"]),Dt=new Set(["user","relation","document"]),Vt=new Set(["text","richtext","number","select","multiselect","status","date","phone","currency","location","user","relation","document"]),vt=new Set(["text","number","date","phone","currency","select","multiselect"]),Pt=new Set(["text","phone","status","select","multiselect"]),kt=new Set(["text","number","checkbox","date","phone","currency","status","select"]);function g(t){let r=!!(t.hidden||t.archived),n=!t.archived,i=It.has(t.type),a=t.type==="document",s=Dt.has(t.type),l=jt(t),u=r?[]:Nt(t),p=u.length>0&&!r,_=!r&&Pt.has(t.type),h=!r&&kt.has(t.type),A=!r&&zt(t.type),T=!r&&t.type==="status",At=J(t),B=i||a||At,O=!(r||B),St=Ut(t.type)?"forbidden":"allowed",Et=qt(t.type),U=Lt(t),q=vt.has(t.type),$=!!(t.deprecated&&!r),Y=Jt(t);return {lifecycle:{active:n,deprecated:!!t.deprecated,visibleInArchitect:true,visibleInRuntime:!r,warningWhenDeprecated:$},storage:{mode:i?"computed":s?"edge":"value",cardinality:l,edgeBacked:s,preservesExistingValues:!!t.archived,qualifiedProperties:Bt(t.type),polymorphic:Mt(t),maxItems:U},authoring:{editable:O,readOnly:B,directEdit:O&&Y==="inline",required:St,defaultValue:Et,placeholder:q,maxItems:U},presentation:{formField:!r&&Yt(t.type),tableCell:!r&&Q(t.type),defaultColumn:!r&&$t(t.type),compactDisplay:!r,popoverEditor:!r&&Y==="popover",placeholder:q,warningWhenDeprecated:$},query:{filterable:p,searchable:_,sortable:h,groupable:A,kanbanGroupable:T,operators:u},agent:{readable:!r,writable:O&&!a,compactReadable:!r,contentReadable:!r&&Wt(t.type),requiresDedicatedTool:a},exchange:{importable:!r,exportable:!r,schemaExportable:true,metadataExportable:false}}}chunkDPD6ZWL2_js.a(g,"getAttributeCapabilities");function H(t){return g(t).query.operators}chunkDPD6ZWL2_js.a(H,"getAttributeFilterOperators");function Je(t){return g(t).query.filterable}chunkDPD6ZWL2_js.a(Je,"isAttributeFilterable");function ze(t){return g(t).query.searchable}chunkDPD6ZWL2_js.a(ze,"isAttributeSearchable");function We(t){return g(t).query.sortable}chunkDPD6ZWL2_js.a(We,"isAttributeSortable");function Ke(t){return g(t).query.groupable}chunkDPD6ZWL2_js.a(Ke,"isAttributeGroupable");function Ge(t){return g(t).query.kanbanGroupable}chunkDPD6ZWL2_js.a(Ge,"isAttributeKanbanGroupable");function w(t){if(t.type!=="rollup")return t.type;let r=t;if(r.function==="earliest"||r.function==="latest")return "date";if(r.function==="original"){let n=r.targetAttributeType;if(n&&X(n))return n}return "number"}chunkDPD6ZWL2_js.a(w,"resolveEffectiveFilterType");function C(t){let r=w(t);return X(r)?b[r]:b.number}chunkDPD6ZWL2_js.a(C,"getRollupFilterOperators");function Nt(t){return t.type==="rollup"?C(t):b[t.type]??[]}chunkDPD6ZWL2_js.a(Nt,"getRawFilterOperators");function jt(t){return t.type==="multiselect"||t.type==="document"||t.type==="user"&&t.multiple===true||t.type==="relation"&&t.cardinality==="many"?"many":"one"}chunkDPD6ZWL2_js.a(jt,"getAttributeCardinality");function Mt(t){if(t.type!=="relation")return "none";let n=t.targets??[];return n.length===1&&n[0]?.object==="*"?"internal":n.length>1?"code-only":"none"}chunkDPD6ZWL2_js.a(Mt,"getPolymorphicCapability");function Lt(t){return t.type==="multiselect"?true:t.type==="relation"?t.cardinality==="many":false}chunkDPD6ZWL2_js.a(Lt,"supportsMaxItems");function Bt(t){return t==="relation"||t==="document"}chunkDPD6ZWL2_js.a(Bt,"supportsQualifiedProperties");function Ut(t){return t==="checkbox"||t==="formula"||t==="rollup"}chunkDPD6ZWL2_js.a(Ut,"isRequiredForbidden");function qt(t){return t==="checkbox"?"automatic":t==="formula"||t==="rollup"?"forbidden":Vt.has(t)?"static":"forbidden"}chunkDPD6ZWL2_js.a(qt,"getDefaultValueCapability");function $t(t){return Q(t)}chunkDPD6ZWL2_js.a($t,"isDefaultColumnType");function Q(t){return t!=="richtext"&&t!=="document"}chunkDPD6ZWL2_js.a(Q,"isTableCellType");function Yt(t){return t!=="richtext"}chunkDPD6ZWL2_js.a(Yt,"isFormFieldType");function Jt(t){switch(t.type){case "checkbox":return "inline";case "number":return t.renderAs==="rating"?"inline":"default";case "select":case "multiselect":return t.renderAs==="badges"?"inline":"popover";case "status":case "relation":case "user":case "date":return "popover";default:return "default"}}chunkDPD6ZWL2_js.a(Jt,"resolveEditMode");function zt(t){return t==="status"||t==="currency"}chunkDPD6ZWL2_js.a(zt,"isGroupableType");function Wt(t){return t==="richtext"||t==="document"}chunkDPD6ZWL2_js.a(Wt,"isContentReadableType");function X(t){return Object.prototype.hasOwnProperty.call(b,t)}chunkDPD6ZWL2_js.a(X,"hasFilterOperatorEntry");var f=b,Kt=["is_empty","is_not_empty"];function Z(t){return Kt.includes(t)}chunkDPD6ZWL2_js.a(Z,"isNoValueOperator");function Ze(t){return C(t)}chunkDPD6ZWL2_js.a(Ze,"getRollupFilterOperators");function E(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"dynamic"in t}chunkDPD6ZWL2_js.a(E,"isDynamicValue");function rr(){return {dynamic:"actor",ref:"current"}}chunkDPD6ZWL2_js.a(rr,"currentActor");function or(){return {dynamic:"date",anchor:"today"}}chunkDPD6ZWL2_js.a(or,"today");function nr(){return {dynamic:"date",anchor:"now"}}chunkDPD6ZWL2_js.a(nr,"now");function tt(t){if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:null}return null}chunkDPD6ZWL2_js.a(tt,"toAmount");function et(t){return t!==null&&typeof t=="object"?"value"in t?tt(t.value):null:tt(t)}chunkDPD6ZWL2_js.a(et,"extractCurrencyFilterValue");function sr(t){return t==null?null:typeof t=="object"&&"value"in t?t.value??null:t}chunkDPD6ZWL2_js.a(sr,"extractFilterValue");var Gt=new Set(["is_not","not_contains","none_of","is_empty"]),Ht={is_not:"is",not_contains:"contains",none_of:"any_of",is_empty:"is_not_empty"};function pr(t){return Gt.has(t)?"none":"any"}chunkDPD6ZWL2_js.a(pr,"getOperatorPolarity");function cr(t){return Ht[t]??t}chunkDPD6ZWL2_js.a(cr,"normalizeForEdgeRpc");var rt={is:"any_of",is_not:"none_of"};function dr(t){return rt[t]??t}chunkDPD6ZWL2_js.a(dr,"toMultiValueOperator");var Qt=new Set(Object.values(rt).filter(t=>t!==void 0));function ot(t){return Qt.has(t)}chunkDPD6ZWL2_js.a(ot,"isSetMembershipOperator");function nt(t,r){let n=t.value;if(Z(t.operator)||n==null||E(n))return;if(ot(t.operator)){Array.isArray(n)||(t.value=[n]);return}if(r!=="currency")return;let i=et(n);if(i!==null){t.value=i;return}if(!Xt(n))return;let a=`Filter on a currency attribute expected a numeric amount, received ${JSON.stringify(n)}`;throw new chunkJSKLP4GI_js.h(a,[{path:["value"],message:a}])}chunkDPD6ZWL2_js.a(nt,"canonicalizeFilterValue");function Xt(t){return typeof t!="object"?true:"value"in t?t.value!=null:false}chunkDPD6ZWL2_js.a(Xt,"hasCurrencyAmount");var Zt={eq:"is",equals:"is",equal:"is","==":"is","=":"is",neq:"is_not",notEqual:"is_not",isNot:"is_not","!=":"is_not","<>":"is_not",lt:"less_than","<":"less_than",gt:"greater_than",">":"greater_than",lte:"less_or_equal","<=":"less_or_equal",gte:"greater_or_equal",">=":"greater_or_equal",in:"any_of",isAnyOf:"any_of",anyOf:"any_of",oneOf:"any_of",notIn:"none_of",not_in:"none_of",isNoneOf:"none_of",noneOf:"none_of",notOneOf:"none_of",startsWith:"starts_with",beginsWith:"starts_with",endsWith:"ends_with",doesNotContain:"not_contains",notContain:"not_contains",isEmpty:"is_empty",isNotEmpty:"is_not_empty"};function I(t){return Zt[t]??t}chunkDPD6ZWL2_js.a(I,"normalizeOperator");function Er(t){let r=I(t.operator);return r===t.operator?t:{...t,operator:r}}chunkDPD6ZWL2_js.a(Er,"normalizeFilterRule");var te=new Set(["days","weeks","months","years"]),ee=new Set(["past","future"]);function D(t){if(typeof t!="object"||t===null)return false;let r=t;return typeof r.amount=="number"&&Number.isFinite(r.amount)&&r.amount>0&&typeof r.unit=="string"&&te.has(r.unit)&&typeof r.direction=="string"&&ee.has(r.direction)}chunkDPD6ZWL2_js.a(D,"isRelativeDateValue");function at(t){return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}chunkDPD6ZWL2_js.a(at,"utcDayStart");function it(t,r,n){if(n==="days")return t+r*864e5;if(n==="weeks")return t+r*7*864e5;let i=new Date(t),a=i.getUTCFullYear()+(n==="years"?r:0),s=i.getUTCMonth()+(n==="months"?r:0),l=new Date(Date.UTC(a,s+1,0)).getUTCDate();return Date.UTC(a,s,Math.min(i.getUTCDate(),l))}chunkDPD6ZWL2_js.a(it,"shiftUtcDay");function Or(t,r=new Date){if(!D(t))return null;let n=at(r),i=Math.trunc(t.amount),a=t.direction==="past"?{startMs:it(n,-i,t.unit),endMs:n+864e5}:{startMs:n,endMs:it(n,i,t.unit)+864e5};return Number.isFinite(a.startMs)&&Number.isFinite(a.endMs)?a:null}chunkDPD6ZWL2_js.a(Or,"resolveIsWithinBounds");function xr(t){if(!Number.isFinite(t))return null;let r=at(new Date(t));return Number.isFinite(r)?{startMs:r,endMs:r+864e5}:null}chunkDPD6ZWL2_js.a(xr,"resolveUtcDayBounds");function Fr(t){return new Date(t).toISOString().slice(0,10)}chunkDPD6ZWL2_js.a(Fr,"toUtcDayString");var re=new Set(["relation","document","user"]),V=["is","is_not","any_of","none_of","is_empty","is_not_empty"],oe={id:V,objectId:V,tenantId:V,label:f.text,createdAt:f.date,updatedAt:f.date,deletedAt:f.date,createdBy:f.user,lastUpdatedBy:f.user},ne={id:"text",objectId:"text",objectName:"text",tenantId:"text",label:"text",createdAt:"date",updatedAt:"date",deletedAt:"date",deletedBy:"user",createdBy:"user",lastUpdatedBy:"user",visibility:"select",ownedBy:"user"},k={before:'"less_than"',after:'"greater_than"',on_or_before:'"less_or_equal"',on_or_after:'"greater_or_equal"',is_checked:'"is" with value true',is_not_checked:'"is" with value false',day_month_eq:'"on_day_month"'},ie=new Set(Object.entries(b).filter(([,t])=>t.includes("any_of")&&!t.includes("contains")).map(([t])=>t)),ae={contains:"any_of",not_contains:"none_of"};function v(t,r){let n=k[t];if(n){let s=`Unknown filter operator "${t}" \u2014 use ${n}`;throw new chunkJSKLP4GI_js.h(s,[{path:["operator"],message:s}])}let i=I(t),a=ae[i];if(a&&ie.has(r)){let s=`Operator "${i}" is not valid for type "${r}" \u2014 use "${a}"`;throw new chunkJSKLP4GI_js.h(s,[{path:["operator"],message:s}])}return i}chunkDPD6ZWL2_js.a(v,"resolveCanonicalOperator");function st(t,r,n){let i=v(t,r),a=f[r];if(!a?.includes(i)){let s=a?.length?a.join(", "):"(no operators registered for this type)",l=`Operator "${t}" is not valid for ${n} type "${r}". Valid operators: ${s}.`;throw new chunkJSKLP4GI_js.h(l,[{path:["operator"],message:l}])}return i}chunkDPD6ZWL2_js.a(st,"assertOperatorForType");function se(t){if(t.operator==="is_within"&&!D(t.value)){let r='Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }';throw new chunkJSKLP4GI_js.h(r,[{path:["value"],message:r}])}}chunkDPD6ZWL2_js.a(se,"assertRelativeDateValue");function R(t,r,n){t.operator=r,nt(t,n),se(t);}chunkDPD6ZWL2_js.a(R,"applyCanonicalForm");function lt(t,r){if(!E(t.value))return;let n=t.value;if(n.dynamic==="actor"&&r!=="user"){let i=`actor token (@me) is only valid on user attributes, not "${r}"`;throw new chunkJSKLP4GI_js.h(i,[{path:["value"],message:i}])}if(n.dynamic==="date"&&r!=="date"){let i=`date token (@today/@now) is only valid on date attributes, not "${r}"`;throw new chunkJSKLP4GI_js.h(i,[{path:["value"],message:i}])}}chunkDPD6ZWL2_js.a(lt,"assertDynamicValueForAttribute");var P=x.map(t=>`"${t}"`).join(", ");function le(t){return t==="location"?` A location is filtered on one of its parts: set "property" to one of ${P} and use a text operator (e.g. contains).`:""}chunkDPD6ZWL2_js.a(le,"locationPartsHint");function jr(t,r){try{return ue({...t},r),[]}catch(n){if(!(n instanceof chunkJSKLP4GI_js.h))throw n;return n.errors.map(i=>({...i,path:[...i.path]}))}}chunkDPD6ZWL2_js.a(jr,"collectQualifiedRuleIssues");function ue(t,r){let n=r.attributes.find(u=>u.name===t.attribute),i=oe[t.attribute];if(!(n||i)){let[u,...p]=t.attribute.split("."),h=(p.length>0?r.attributes.find(T=>T.name===u):void 0)?.type==="location"?` Dotted paths are not supported \u2014 set "attribute" to "${u}" and "property" to ${F(p[0]??"")?`"${p[0]}"`:`one of ${P}`}.`:t.attribute.includes(".")?' Dotted paths are not supported \u2014 filter on the attribute name alone, or use the full-text "query" parameter to match text inside a value.':"",A=`Unknown attribute: ${t.attribute}${h}`;throw new chunkJSKLP4GI_js.h(A,[{path:["attribute"],message:A}])}if(t.quantifier!==void 0&&!t.property){let u='quantifier is only valid on qualified edge rules (set "property")';throw new chunkJSKLP4GI_js.h(u,[{path:["quantifier"],message:u}])}if(!n){if(t.property)throw new chunkJSKLP4GI_js.h(`Cannot qualify system attribute "${t.attribute}"`,[{path:["property"],message:`"${t.attribute}" is a system column, not a reference`}]);let u=ne[t.attribute]??"text",p=v(t.operator,u);if(!i.includes(p)){let _=`Operator "${t.operator}" is not valid for system attribute "${t.attribute}". Valid operators: ${i.join(", ")}.`;throw new chunkJSKLP4GI_js.h(_,[{path:["operator"],message:_}])}R(t,p,u);return}if(!t.property){lt(t,n.type);let u=H(n),p=v(t.operator,n.type);if(!u.includes(p)){let _=u.length?u.join(", "):"(not filterable)",h=`Operator "${t.operator}" is not valid for attribute "${n.name}". Valid operators: ${_}.${le(n.type)}`;throw new chunkJSKLP4GI_js.h(h,[{path:["operator"],message:h}])}R(t,p,w(n));return}if(n.type==="location"){if(t.quantifier!==void 0){let p="quantifier is not valid on a location part \u2014 a location is one value, not a set of edges";throw new chunkJSKLP4GI_js.h(p,[{path:["quantifier"],message:p}])}if(!F(t.property)){let p=`Property "${t.property}" is not a part of location "${t.attribute}". Valid parts: ${P}.`;throw new chunkJSKLP4GI_js.h(p,[{path:["property"],message:p}])}lt(t,"text");let u=st(t.operator,"text","property");R(t,u,"text");return}if(!re.has(n.type))throw new chunkJSKLP4GI_js.h(`Cannot qualify ${n.type} attribute "${t.attribute}"`,[{path:["property"],message:`Attribute "${t.attribute}" is not a reference type`}]);let a=n.properties;if(!a)throw new chunkJSKLP4GI_js.h(`Attribute "${t.attribute}" has no qualifyWith schema`,[{path:["property"],message:`"${t.attribute}" has no qualifyWith`}]);let s=a.definitions.find(u=>u.name===t.property);if(!s)throw new chunkJSKLP4GI_js.h(`Property "${t.property}" not defined on "${t.attribute}".qualifyWith()`,[{path:["property"],message:`Unknown property: ${t.property}`}]);let l=st(t.operator,s.type,"property");R(t,l,s.type);}chunkDPD6ZWL2_js.a(ue,"validateQualifiedRule");var N=["skill","memory","drives","artifact","meeting"];function Br(t){return N.includes(t)}chunkDPD6ZWL2_js.a(Br,"isNativeObjectName");var j=["workspace","private"],ut=["all",...j];function Jr(t){if(typeof t=="string"&&j.includes(t))return t;throw new chunkJSKLP4GI_js.h(`visibility must be one of: ${j.join(", ")} (received: ${String(t)})`,[])}chunkDPD6ZWL2_js.a(Jr,"parseResourceVisibility");var pe=["id","createdAt","updatedAt","createdBy","lastUpdatedBy","visibility","ownedBy"],zr=[...pe,"objectId","label","embeddingText","values","metadata","deletedAt","deletedBy","schemaVersion","owned_by"],Wr=N;var pt=64,ct=1e4;function dt(t){let r=Object.getPrototypeOf(t);return r===Object.prototype||r===null}chunkDPD6ZWL2_js.a(dt,"isPlainJsonObject");function m(t,r,n=[]){t.addIssue({code:"custom",message:r,path:n});}chunkDPD6ZWL2_js.a(m,"addJsonIssue");function de(t,r,n,i){for(let a of Reflect.ownKeys(t))if(a!=="length"){if(a==="__proto__"){m(i,"The __proto__ key is not allowed in custom props",[...r.path,a]);continue}(typeof a=="symbol"||!/^(0|[1-9]\d*)$/.test(a))&&m(i,"Arrays cannot contain non-index JSON properties",[...r.path,a]);}for(let a=t.length-1;a>=0;a--){let s=Object.getOwnPropertyDescriptor(t,String(a)),l=[...r.path,a];if(!(s&&"value"in s)){m(i,"Sparse arrays are not valid JSON values",l);continue}n.push({kind:"enter",value:s.value,path:l,depth:r.depth+1});}}chunkDPD6ZWL2_js.a(de,"pushJsonArrayChildren");function me(t,r,n,i){let a=Reflect.ownKeys(t);for(let s=a.length-1;s>=0;s--){let l=a[s],u=[...r.path,l];if(l==="__proto__"){m(i,"The __proto__ key is not allowed in custom props",u);continue}if(typeof l=="symbol"){m(i,"Symbol keys are not valid JSON keys",u);continue}let p=Object.getOwnPropertyDescriptor(t,l);if(!(p?.enumerable&&"value"in p)){m(i,"Custom props must contain enumerable data properties only",u);continue}n.push({kind:"enter",value:p.value,path:u,depth:r.depth+1});}}chunkDPD6ZWL2_js.a(me,"pushJsonObjectChildren");function ye(t,r){if(t===null||typeof t!="object"){m(r,"Expected a plain JSON object");return}try{if(Array.isArray(t)||!dt(t)){m(r,"Expected a plain JSON object");return}}catch{m(r,"Custom props contain an object that cannot be safely inspected");return}let n=new WeakSet,i=[{kind:"enter",value:t,path:[],depth:0}],a=0;for(;i.length>0;){let s=i.pop();if(!s)break;if(s.kind==="exit"){n.delete(s.value);continue}if(a++,a>ct){m(r,`Custom props cannot exceed ${ct.toLocaleString("en-US")} total JSON nodes`,s.path);return}if(s.depth>pt){m(r,`Custom props cannot exceed depth ${pt}`,s.path);continue}let l=s.value;if(!(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"&&Number.isFinite(l))){if(typeof l!="object"){m(r,"Expected a JSON value",s.path);continue}if(n.has(l)){m(r,"Custom props cannot contain circular references",s.path);continue}try{if(Array.isArray(l)){n.add(l),i.push({kind:"exit",value:l}),de(l,s,i,r);continue}if(!dt(l)){m(r,"Expected an array or plain JSON object",s.path);continue}n.add(l),i.push({kind:"exit",value:l}),me(l,s,i,r);}catch{m(r,"Custom props contain an object that cannot be safely inspected",s.path);}}}}chunkDPD6ZWL2_js.a(ye,"validateJsonProps");var mt=zod.z.unknown().superRefine(ye).transform(t=>t);var io=zod.z.array(zod.z.string()).max(chunkHS7IRPL2_js.c.columnsPerTab),be=zod.z.array(zod.z.string().min(1)).max(chunkHS7IRPL2_js.c.columnsPerTab).refine(t=>new Set(t).size===t.length,{message:"Displayed attribute names must be unique"}),fe=zod.z.object({attribute:zod.z.string(),direction:zod.z.enum(["asc","desc"])}).strict(),_e=zod.z.array(fe).max(chunkHS7IRPL2_js.c.sortsPerTab),he=zod.z.object({amount:zod.z.number(),unit:zod.z.enum(["days","weeks","months","years"]),direction:zod.z.enum(["past","future"])}).strict(),ge=zod.z.object({value:zod.z.number().nullable(),code:zod.z.array(zod.z.string()).optional()}).strict(),Ae=zod.z.object({phoneNumber:zod.z.string().nullable(),countryCode:zod.z.string().optional()}).strict(),Se=zod.z.discriminatedUnion("dynamic",[zod.z.object({dynamic:zod.z.literal("actor"),ref:zod.z.literal("current")}).strict(),zod.z.object({dynamic:zod.z.literal("date"),anchor:zod.z.enum(["today","now"])}).strict()]),Ee=zod.z.object({month:zod.z.number(),day:zod.z.number()}).strict(),Re=zod.z.union([zod.z.string(),zod.z.number(),zod.z.boolean(),zod.z.array(zod.z.string()),he,ge,Ae,Ee,Se,zod.z.null()]),Te=zod.z.enum(["is","is_not","contains","not_contains","starts_with","ends_with","is_empty","is_not_empty","less_than","greater_than","less_or_equal","greater_or_equal","is_within","on_day_month","any_of","none_of"],{error:chunkDPD6ZWL2_js.a(t=>{let r=t.input,n=typeof r=="string"?k[r]:void 0;return n?`Unknown filter operator "${r}" \u2014 use ${n}`:void 0},"error")}),Oe=zod.z.object({attribute:zod.z.string(),property:zod.z.string().optional(),quantifier:zod.z.enum(["any","none"]).optional(),operator:Te,value:Re}).strict(),xe=zod.z.array(Oe).max(chunkHS7IRPL2_js.c.filterRulesPerTab),Fe=zod.z.object({combinator:zod.z.enum(["and","or"]),rules:xe}).strict(),we={span:zod.z.union([zod.z.literal(1),zod.z.literal(2),zod.z.literal(3),zod.z.literal(4),zod.z.literal(5),zod.z.literal(6),zod.z.literal(7),zod.z.literal(8),zod.z.literal(9),zod.z.literal(10),zod.z.literal(11),zod.z.literal(12)]).optional(),label:zod.z.string().optional(),readOnly:zod.z.boolean().optional()},Ce=zod.z.object({attribute:zod.z.string(),...we}).strict(),Ie=zod.z.object({name:zod.z.string(),label:zod.z.string(),description:zod.z.string().optional(),collapsible:zod.z.boolean().optional(),collapsed:zod.z.boolean().optional(),fields:zod.z.array(Ce).max(chunkHS7IRPL2_js.c.fieldsPerGroup)}).strict();function yt(t,r){t.groups.reduce((s,l)=>s+l.fields.length,0)>chunkHS7IRPL2_js.c.fieldsPerFormTab&&r.addIssue({code:"too_big",origin:"array",maximum:chunkHS7IRPL2_js.c.fieldsPerFormTab,inclusive:true,message:`A form content can contain at most ${chunkHS7IRPL2_js.c.fieldsPerFormTab} fields`,path:["groups"]});let i=new Set,a=new Set;t.groups.forEach((s,l)=>{i.has(s.name)&&r.addIssue({code:"custom",message:`Duplicate group name "${s.name}"`,path:["groups",l,"name"]}),i.add(s.name),s.fields.forEach((u,p)=>{a.has(u.attribute)&&r.addIssue({code:"custom",message:`Duplicate field attribute "${u.attribute}"`,path:["groups",l,"fields",p,"attribute"]}),a.add(u.attribute);});});}chunkDPD6ZWL2_js.a(yt,"refineFormContent");var y={name:zod.z.string(),label:zod.z.string().optional(),icon:chunkHS7IRPL2_js.e.optional(),placement:zod.z.enum(["main","aside"])},bt=zod.z.object({object:zod.z.string().optional(),relation:zod.z.string().optional()}).strict().superRefine((t,r)=>{t.object===void 0==(t.relation===void 0)&&r.addIssue({code:"custom",message:"Collection source must define exactly one of object or relation"});}).transform(t=>t.object===void 0?{relation:t.relation}:{object:t.object}),M={...y,type:zod.z.literal("collection"),source:bt,visibility:zod.z.enum(ut).optional(),columns:zod.z.array(zod.z.union([zod.z.string(),zod.z.object({relationProperty:zod.z.string().refine(t=>t.trim().length>0)}).strict()])).max(chunkHS7IRPL2_js.c.columnsPerTab).optional(),descriptionAttribute:zod.z.string().optional(),displayAttributes:be.optional(),filters:Fe.optional(),sorts:_e.optional(),actions:zod.z.enum(["create","update","delete","attach","detach"]).array().optional(),openMode:zod.z.enum(["page","peek"]).optional(),createMode:zod.z.enum(["page","peek","inline"]).optional()},De=zod.z.discriminatedUnion("layout",[zod.z.object({...M,layout:zod.z.literal("table"),columnSizing:zod.z.record(zod.z.string(),zod.z.number()).optional()}).strict(),zod.z.object({...M,layout:zod.z.literal("list"),columnSizing:zod.z.record(zod.z.string(),zod.z.number()).optional()}).strict(),zod.z.object({...M,layout:zod.z.literal("kanban"),groupByAttribute:zod.z.string(),kanbanColumnOrder:zod.z.array(zod.z.string()).optional(),kanbanColumnVisibility:zod.z.record(zod.z.string(),zod.z.boolean()).optional(),kanbanPinnedColumns:zod.z.array(zod.z.string()).optional()}).strict()]),L={...y,type:zod.z.literal("form"),groups:zod.z.array(Ie).max(chunkHS7IRPL2_js.c.groupsPerFormTab),formColumns:zod.z.union([zod.z.literal(1),zod.z.literal(2),zod.z.literal(3)]).optional(),density:zod.z.enum(["compact","comfortable","spacious"]).optional()},Ve=zod.z.object(L).strict().superRefine(yt),ve=zod.z.object({...L,groups:L.groups.min(1,"A published form content requires at least one group")}).strict().superRefine(yt),ft=[De,zod.z.object({...y,type:zod.z.literal("custom"),extension:zod.z.string(),parameters:zod.z.lazy(()=>mt).optional()}).strict(),zod.z.object({...y,type:zod.z.literal("activity")}).strict(),zod.z.object({...y,type:zod.z.literal("richtext"),attribute:zod.z.string(),titleAttribute:zod.z.string().optional()}).strict(),zod.z.object({...y,type:zod.z.literal("documents"),allowUpload:zod.z.boolean().optional(),allowRemove:zod.z.boolean().optional(),hideAttachments:zod.z.boolean().optional(),relations:zod.z.array(zod.z.string()).optional()}).strict(),zod.z.object({...y,type:zod.z.literal("forms"),objectName:zod.z.string().optional()}).strict(),zod.z.object({...y,type:zod.z.literal("emails"),emailAttributes:zod.z.array(zod.z.string()).max(chunkHS7IRPL2_js.c.emailAttributesPerTab)}).strict(),zod.z.object({...y,type:zod.z.literal("meetings"),emailAttributes:zod.z.array(zod.z.string()).max(chunkHS7IRPL2_js.c.emailAttributesPerTab)}).strict()],Pe=zod.z.discriminatedUnion("type",[Ve,...ft]),_t=zod.z.discriminatedUnion("type",[ve,...ft]),ht={object:zod.z.string(),name:zod.z.string(),label:zod.z.string(),description:zod.z.string().optional(),icon:chunkHS7IRPL2_js.e.optional(),context:zod.z.enum(["collection","record"]),default:zod.z.boolean().optional()},ke=zod.z.object({...ht,contents:zod.z.array(Pe).max(chunkHS7IRPL2_js.c.tabsPerView)}).strict(),Ne=zod.z.object({...ht,contents:zod.z.array(_t).max(chunkHS7IRPL2_js.c.tabsPerView)}).strict();function gt(t,r){let n=new Set;t.contents.forEach((i,a)=>{n.has(i.name)&&r.addIssue({code:"custom",message:`Duplicate content name "${i.name}"`,path:["contents",a,"name"]}),n.add(i.name);});}chunkDPD6ZWL2_js.a(gt,"addDuplicateContentNameIssues");var je=ke.superRefine(gt),Me=Ne.superRefine((t,r)=>{gt(t,r),t.contents.some(n=>n.placement==="main")||r.addIssue({code:"custom",message:"A published view requires at least one main content",path:["contents"]});});exports.$=_e;exports.A=pe;exports.B=zr;exports.C=Wr;exports.D=E;exports.E=rr;exports.F=or;exports.G=nr;exports.H=et;exports.I=sr;exports.J=pr;exports.K=cr;exports.L=dr;exports.M=ot;exports.N=nt;exports.O=Zt;exports.P=I;exports.Q=Er;exports.R=D;exports.S=Or;exports.T=xr;exports.U=Fr;exports.V=ne;exports.W=k;exports.X=jr;exports.Y=ue;exports.Z=io;exports._=be;exports.a=Rt;exports.aa=Fe;exports.b=Le;exports.ba=bt;exports.c=Tt;exports.ca=_t;exports.d=Be;exports.da=je;exports.e=J;exports.ea=Me;exports.f=x;exports.g=F;exports.h=Ye;exports.i=b;exports.j=g;exports.k=H;exports.l=Je;exports.m=ze;exports.n=We;exports.o=Ke;exports.p=Ge;exports.q=w;exports.r=f;exports.s=Kt;exports.t=Z;exports.u=Ze;exports.v=N;exports.w=Br;exports.x=j;exports.y=ut;exports.z=Jr;
@@ -1,4 +1,4 @@
1
1
  import {h as h$1}from'./chunk-XRWRECDA.mjs';import {a}from'./chunk-KSPJP74K.mjs';import {z as z$1}from'zod';import {ICONS,COLORS}from'@stndrds/constants';/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
2
  var f=class f extends Error{constructor(e){super(e),this.name="ComputedFormulaParseError";}};a(f,"ComputedFormulaParseError");var c=f;function I(o){let e=new h(B(o)),n=e.parseExpression();return e.expectEnd(),n}a(I,"parseComputedFormula");function B(o){let e=[],n=0;for(;n<o.length;){let i=o[n];if(i===" "||i===" "||i===`
3
3
  `||i==="\r"){n+=1;continue}if(i==='"'||i==="'"){let s=L(o,n,i);e.push({kind:"string",value:s.value,position:n}),n=s.nextIndex;continue}if(m(i)){let s=V(o,n);e.push({kind:"number",value:s.value,position:n}),n=s.nextIndex;continue}if(M(i)){let s=D(o,n),l=s.value.toLowerCase();l==="true"?e.push({kind:"boolean",value:true,position:n}):l==="false"?e.push({kind:"boolean",value:false,position:n}):l==="null"?e.push({kind:"null",position:n}):e.push({kind:"identifier",value:s.value,position:n}),n=s.nextIndex;continue}let r=o.slice(n,n+2);if(r===">="||r==="<="||r==="=="||r==="!="){e.push({kind:"operator",value:r,position:n}),n+=2;continue}if(i===">"||i==="<"||i==="+"||i==="-"||i==="*"||i==="/"){e.push({kind:"operator",value:i,position:n}),n+=1;continue}if(i==="("||i===")"||i===","||i==="."){e.push({kind:"punctuation",value:i,position:n}),n+=1;continue}throw new c(`Unexpected character "${i}" at position ${n}`)}return e}a(B,"tokenize");function L(o,e,n='"'){let i="",r=e+1;for(;r<o.length;){let s=o[r];if(s===n)return {value:i,nextIndex:r+1};if(s==="\\"){let l=o[r+1];if(l===void 0)throw new c(`Unterminated string literal at position ${r}`);i+=U(l,r),r+=2;continue}i+=s,r+=1;}throw new c(`Unterminated string literal at position ${e}`)}a(L,"scanString");function U(o,e){switch(o){case '"':case "\\":return o;case "n":return `
4
- `;case "r":return "\r";case "t":return " ";default:throw new c(`Unknown escape sequence "\\${o}" at position ${e}`)}}a(U,"decodeEscape");function V(o,e){let n=e;for(;n<o.length&&m(o[n]);)n+=1;if(o[n]==="."){let s=n;if(n+=1,!m(o[n]))throw new c(`Invalid number literal at position ${s}`);for(;n<o.length&&m(o[n]);)n+=1;}let i=o.slice(e,n),r=Number(i);if(!Number.isFinite(r))throw new c(`Invalid number literal "${i}"`);return {value:r,nextIndex:n}}a(V,"scanNumber");function D(o,e){let n=e+1;for(;n<o.length&&G(o[n]);)n+=1;return {value:o.slice(e,n),nextIndex:n}}a(D,"scanIdentifier");function m(o){return o!==void 0&&o>="0"&&o<="9"}a(m,"isDigit");function M(o){return o!==void 0&&/[A-Za-z_]/.test(o)}a(M,"isIdentifierStart");function G(o){return o!==void 0&&/[A-Za-z0-9_]/.test(o)}a(G,"isIdentifierPart");var g=class g{constructor(e){this.tokens=e;this.position=0;}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let e=this.peek();if(e!==void 0)throw new c(`Unexpected token ${q(e)} at position ${e.position}`)}parseBinaryExpression(e){let n=this.parsePrimary();for(;;){let i=this.peek();if(i?.kind!=="operator")return n;let r=H(i.value);if(r<e)return n;let s=i.value;this.consume();let l=this.parseBinaryExpression(r+1);n={kind:"binary",operator:s,left:n,right:l};}}parsePrimary(){let e=this.consume();if(e===void 0)throw new c("Unexpected end of expression");switch(e.kind){case "string":case "number":case "boolean":return {kind:"literal",value:e.value};case "null":return {kind:"literal",value:null};case "identifier":return this.parseIdentifier(e.value);case "punctuation":if(e.value==="("){let n=this.parseExpression();return this.expectPunctuation(")"),n}break;case "operator":if(e.value==="-"){let n=this.consume();if(n?.kind==="number")return {kind:"literal",value:-n.value}}break}throw new c(`Expected literal, path, call, or parenthesized expression at position ${e.position}`)}parseIdentifier(e){if(this.matchPunctuation("(")){let i=[];if(!this.matchPunctuation(")")){do i.push(this.parseExpression());while(this.matchPunctuation(","));this.expectPunctuation(")");}return {kind:"call",functionName:e.toLowerCase(),args:i}}let n=[e];for(;this.matchPunctuation(".");){let i=this.consume();if(i?.kind!=="identifier"){let r=i?.position??this.previousPosition();throw new c(`Expected attribute name after path separator at position ${r}`)}n.push(i.value);}return {kind:"path",parts:n}}expectPunctuation(e){if(!this.matchPunctuation(e)){let i=this.peek()?.position??this.previousPosition();throw new c(`Expected "${e}" at position ${i}`)}}matchPunctuation(e){let n=this.peek();return n?.kind==="punctuation"&&n.value===e?(this.consume(),true):false}peek(){return this.tokens[this.position]}consume(){let e=this.tokens[this.position];return this.position+=1,e}previousPosition(){return this.tokens[this.position-1]?.position??0}};a(g,"Parser");var h=g;function q(o){switch(o.kind){case "identifier":case "number":case "string":case "boolean":case "operator":case "punctuation":return `"${String(o.value)}"`;case "null":return '"null"';default:return o}}a(q,"describeToken");function H(o){switch(o){case "*":case "/":return 3;case "+":case "-":return 2;case ">":case "<":case ">=":case "<=":case "==":case "!=":return 1;default:return o}}a(H,"getOperatorPrecedence");var O={attributesPerObject:300,tabsPerView:24,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20};var J=Object.keys(COLORS),X=new Set(ICONS),b=z$1.enum(J),x=z$1.string().superRefine((o,e)=>{X.has(o)||e.addIssue({code:"custom",message:"Invalid icon name"});}).transform(o=>o);var u=z$1.object({placeholder:z$1.string().optional(),description:z$1.string().optional(),defaultValue:z$1.unknown().optional(),icon:z$1.string().optional(),order:z$1.number().int().optional(),hidden:z$1.boolean().optional(),archived:z$1.boolean().optional(),deprecated:z$1.boolean().optional(),metadata:z$1.record(z$1.string(),z$1.unknown()).optional()}),y=z$1.object({value:z$1.string().min(1),label:z$1.string().min(1),description:z$1.string().optional(),inverse:z$1.string().optional(),archived:z$1.boolean().optional()}),v=z$1.enum(["idle","in_progress","finished"]),w=y.extend({color:b}).strict(),T=w,E=y.extend({color:b,group:v}).strict(),j=y.extend({color:z$1.string().optional(),group:v.optional()}).strict(),k=z$1.array(j).min(1).refine(o=>{let e=o.map(n=>n.value);return new Set(e).size===e.length},{message:"Duplicate option values are not allowed"});function C(o){return z$1.array(o).min(1).max(O.optionsPerAttribute).refine(e=>{let n=e.map(i=>i.value);return new Set(n).size===n.length},{message:"Duplicate option values are not allowed"})}a(C,"writeOptionsArraySchema");var Y=C(w),tt=C(T),et=C(E),nt=z$1.object({object:z$1.string().min(1),displayTemplate:z$1.string().optional(),filter:z$1.record(z$1.string(),z$1.unknown()).optional()}),ot=z$1.object({object:z$1.string().min(1),attribute:z$1.string().min(1),cardinality:z$1.enum(["one","many"]).optional(),storageOwner:z$1.boolean().optional()}),R=z$1.object({objectName:z$1.string().min(1),attributeName:z$1.string().min(1),attributeId:z$1.string().optional()}),it=u.extend({multiline:z$1.boolean().optional(),minLength:z$1.number().int().min(0).optional(),maxLength:z$1.number().int().min(1).optional(),pattern:z$1.string().optional(),format:z$1.enum(["email","url","slug"]).optional()}),rt=u,at=u.extend({renderAs:z$1.enum(["number","rating"]).optional(),min:z$1.number().optional(),max:z$1.number().optional(),unit:z$1.enum(["integer","decimal","percentage"]).optional(),decimals:z$1.number().int().min(0).max(10).optional()}),st=u,ut=u.extend({dateFormat:z$1.enum(["short","long","full","relative"]).optional(),minDate:z$1.string().optional(),maxDate:z$1.string().optional(),includeTime:z$1.boolean().optional(),endDate:z$1.boolean().optional(),timeFormat:z$1.enum(["12h","24h"]).optional()}),ct=u.extend({defaultCountryCode:z$1.string().length(3).optional()}),lt=u.extend({defaultCurrency:z$1.string().length(3).optional(),allowedCurrencies:z$1.array(z$1.string().length(3)).optional(),allowNegative:z$1.boolean().optional()}),pt=u.extend({options:k}),mt=u.extend({granularity:z$1.enum(["full","address","city","state","country","coordinates"]).optional(),defaultCountry:z$1.string().length(3).optional(),allowedCountries:z$1.array(z$1.string().length(3)).optional()}),dt=u.extend({options:k,renderAs:z$1.literal("badges").optional()}),ht=u.extend({options:k,renderAs:z$1.literal("badges").optional()}),ft=u.extend({types:z$1.array(z$1.enum(["user","agent"])).min(1).optional(),multiple:z$1.boolean().optional()}),gt=u.extend({targets:z$1.array(nt).min(1),cardinality:z$1.enum(["one","many"]),maxItems:z$1.number().int().min(1).optional(),bilateral:ot.optional(),properties:z$1.object({definitions:z$1.array(z$1.record(z$1.string(),z$1.unknown()))}).passthrough().optional()}),bt=u.extend({expression:z$1.string().min(1).superRefine((o,e)=>{try{I(o);}catch(n){e.addIssue({code:z$1.ZodIssueCode.custom,message:n instanceof Error?n.message:"Invalid formula expression"});}}),returnType:z$1.enum(["text","number","boolean","date","select","multiselect"]),decimals:z$1.number().int().min(0).max(10).optional(),allowRelations:z$1.boolean().optional(),optionsSource:R.optional()}),xt=u.extend({relationAttribute:z$1.string().min(1).optional(),relationPath:z$1.string().optional(),targetAttribute:z$1.string().min(1),function:z$1.enum(["sum","avg","earliest","latest","count","countValues","countUniqueValues","countEmpty","percentEmpty","percentNotEmpty","original"]),decimals:z$1.number().int().min(0).max(10).optional(),targetAttributeType:z$1.string().optional(),targetAttributeOptions:z$1.array(j).optional(),targetCurrencyCode:z$1.string().length(3).optional(),optionsSource:R.optional()}),yt=z$1.object({definitions:z$1.array(z$1.record(z$1.string(),z$1.unknown()))}).passthrough(),vt=u.extend({properties:yt.optional(),accepts:z$1.array(z$1.string().min(1)).optional(),maxFileSize:z$1.number().int().min(1).optional()}),z={text:it,richtext:rt,number:at,checkbox:st,date:ut,phone:ct,currency:lt,status:pt,location:mt,select:dt,multiselect:ht,user:ft,relation:gt,formula:bt,rollup:xt,document:vt};function d(o){let e=z[o];if(!e)throw new h$1(`Unsupported attribute type: ${o}`,[]);return e}a(d,"getAttributeConfigSchema");function wt(o,e){return d(o).strip().parse(e)}a(wt,"parseAttributeConfig");function $(o){let e=d(o).extend({icon:x.optional()});switch(o){case "select":return e.extend({options:Y});case "multiselect":return e.extend({options:tt});case "status":return e.extend({options:et});default:return e}}a($,"getAttributeConfigWriteSchema");function W(o){return h$1.fromZodErrors(o.map(e=>({path:e.path.map(n=>typeof n=="symbol"?String(n):n),message:e.message})))}a(W,"validationErrorFromIssues");function _(o,e){let n=$(o).strip().safeParse(e);if(!n.success)throw W(n.error.issues);return n.data}a(_,"parseWriteSchema");function kt(o,e){return _(o,e)}a(kt,"parseAttributeConfigForCreate");function Ct(o){if(!Object.prototype.hasOwnProperty.call(o,"icon"))return;let e=x.optional().safeParse(o.icon);if(!e.success)throw h$1.fromZodErrors(e.error.issues.map(n=>({path:["icon",...n.path.map(i=>typeof i=="symbol"?String(i):i)],message:n.message})))}a(Ct,"validatePatchedIcon");function F(o){return o==="select"||o==="multiselect"||o==="status"}a(F,"isSelectLike");function St(o,e){let n=Object.prototype.hasOwnProperty.call(e,"options"),i=Object.prototype.hasOwnProperty.call(e,"icon"),r={...o,...e};if(Ct(e),n){let{icon:A,...Z}=r,P=_(o.type,i?r:Z);return !i&&A!==void 0&&(P.icon=A),P}let s=o.options;F(o.type)&&(r.options=[{value:"__legacy__",label:"__legacy__"}]);let l=d(o.type).strip().safeParse(r);if(!l.success)throw W(l.error.issues);let S=l.data;return F(o.type)&&(S.options=s),S}a(St,"parseAttributeConfigForUpdate");export{O as a,b,x as c,c as d,I as e,v as f,w as g,T as h,E as i,z as j,d as k,wt as l,$ as m,kt as n,St as o};
4
+ `;case "r":return "\r";case "t":return " ";default:throw new c(`Unknown escape sequence "\\${o}" at position ${e}`)}}a(U,"decodeEscape");function V(o,e){let n=e;for(;n<o.length&&m(o[n]);)n+=1;if(o[n]==="."){let s=n;if(n+=1,!m(o[n]))throw new c(`Invalid number literal at position ${s}`);for(;n<o.length&&m(o[n]);)n+=1;}let i=o.slice(e,n),r=Number(i);if(!Number.isFinite(r))throw new c(`Invalid number literal "${i}"`);return {value:r,nextIndex:n}}a(V,"scanNumber");function D(o,e){let n=e+1;for(;n<o.length&&G(o[n]);)n+=1;return {value:o.slice(e,n),nextIndex:n}}a(D,"scanIdentifier");function m(o){return o!==void 0&&o>="0"&&o<="9"}a(m,"isDigit");function M(o){return o!==void 0&&/[A-Za-z_]/.test(o)}a(M,"isIdentifierStart");function G(o){return o!==void 0&&/[A-Za-z0-9_]/.test(o)}a(G,"isIdentifierPart");var g=class g{constructor(e){this.tokens=e;this.position=0;}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let e=this.peek();if(e!==void 0)throw new c(`Unexpected token ${q(e)} at position ${e.position}`)}parseBinaryExpression(e){let n=this.parsePrimary();for(;;){let i=this.peek();if(i?.kind!=="operator")return n;let r=H(i.value);if(r<e)return n;let s=i.value;this.consume();let l=this.parseBinaryExpression(r+1);n={kind:"binary",operator:s,left:n,right:l};}}parsePrimary(){let e=this.consume();if(e===void 0)throw new c("Unexpected end of expression");switch(e.kind){case "string":case "number":case "boolean":return {kind:"literal",value:e.value};case "null":return {kind:"literal",value:null};case "identifier":return this.parseIdentifier(e.value);case "punctuation":if(e.value==="("){let n=this.parseExpression();return this.expectPunctuation(")"),n}break;case "operator":if(e.value==="-"){let n=this.consume();if(n?.kind==="number")return {kind:"literal",value:-n.value}}break}throw new c(`Expected literal, path, call, or parenthesized expression at position ${e.position}`)}parseIdentifier(e){if(this.matchPunctuation("(")){let i=[];if(!this.matchPunctuation(")")){do i.push(this.parseExpression());while(this.matchPunctuation(","));this.expectPunctuation(")");}return {kind:"call",functionName:e.toLowerCase(),args:i}}let n=[e];for(;this.matchPunctuation(".");){let i=this.consume();if(i?.kind!=="identifier"){let r=i?.position??this.previousPosition();throw new c(`Expected attribute name after path separator at position ${r}`)}n.push(i.value);}return {kind:"path",parts:n}}expectPunctuation(e){if(!this.matchPunctuation(e)){let i=this.peek()?.position??this.previousPosition();throw new c(`Expected "${e}" at position ${i}`)}}matchPunctuation(e){let n=this.peek();return n?.kind==="punctuation"&&n.value===e?(this.consume(),true):false}peek(){return this.tokens[this.position]}consume(){let e=this.tokens[this.position];return this.position+=1,e}previousPosition(){return this.tokens[this.position-1]?.position??0}};a(g,"Parser");var h=g;function q(o){switch(o.kind){case "identifier":case "number":case "string":case "boolean":case "operator":case "punctuation":return `"${String(o.value)}"`;case "null":return '"null"';default:return o}}a(q,"describeToken");function H(o){switch(o){case "*":case "/":return 3;case "+":case "-":return 2;case ">":case "<":case ">=":case "<=":case "==":case "!=":return 1;default:return o}}a(H,"getOperatorPrecedence");var O={attributesPerObject:300,tabsPerView:24,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20};var J=Object.keys(COLORS),X=new Set(ICONS),b=z$1.enum(J),x=z$1.string().superRefine((o,e)=>{X.has(o)||e.addIssue({code:"custom",message:"Invalid icon name"});}).transform(o=>o);var u=z$1.object({placeholder:z$1.string().optional(),description:z$1.string().optional(),defaultValue:z$1.unknown().optional(),icon:z$1.string().optional(),order:z$1.number().int().optional(),hidden:z$1.boolean().optional(),archived:z$1.boolean().optional(),deprecated:z$1.boolean().optional(),metadata:z$1.record(z$1.string(),z$1.unknown()).optional()}),y=z$1.object({value:z$1.string().min(1),label:z$1.string().min(1),description:z$1.string().optional(),inverse:z$1.string().optional(),archived:z$1.boolean().optional()}),v=z$1.enum(["idle","in_progress","finished"]),w=y.extend({color:b}).strict(),T=w,E=y.extend({color:b,group:v}).strict(),j=y.extend({color:z$1.string().optional(),group:v.optional()}).strict(),k=z$1.array(j).min(1).refine(o=>{let e=o.map(n=>n.value);return new Set(e).size===e.length},{message:"Duplicate option values are not allowed"});function C(o){return z$1.array(o).min(1).max(O.optionsPerAttribute).refine(e=>{let n=e.map(i=>i.value);return new Set(n).size===n.length},{message:"Duplicate option values are not allowed"})}a(C,"writeOptionsArraySchema");var Y=C(w),tt=C(T),et=C(E),nt=z$1.object({object:z$1.string().min(1),displayTemplate:z$1.string().optional(),filter:z$1.record(z$1.string(),z$1.unknown()).optional()}),ot=z$1.object({object:z$1.string().min(1),attribute:z$1.string().min(1),cardinality:z$1.enum(["one","many"]).optional(),storageOwner:z$1.boolean().optional()}),R=z$1.object({objectName:z$1.string().min(1),attributeName:z$1.string().min(1),attributeId:z$1.string().optional()}),it=u.extend({multiline:z$1.boolean().optional(),minLength:z$1.number().int().min(0).optional(),maxLength:z$1.number().int().min(1).optional(),pattern:z$1.string().optional(),format:z$1.enum(["email","url","slug"]).optional()}),rt=u,at=u.extend({renderAs:z$1.enum(["number","rating"]).optional(),min:z$1.number().optional(),max:z$1.number().optional(),unit:z$1.enum(["integer","decimal","percentage"]).optional(),decimals:z$1.number().int().min(0).max(10).optional()}),st=u,ut=u.extend({dateFormat:z$1.enum(["short","long","full","relative"]).optional(),minDate:z$1.string().optional(),maxDate:z$1.string().optional(),includeTime:z$1.boolean().optional(),endDate:z$1.boolean().optional(),timeFormat:z$1.enum(["12h","24h"]).optional()}),ct=u.extend({defaultCountryCode:z$1.string().length(3).optional()}),lt=u.extend({defaultCurrency:z$1.string().length(3).optional(),allowedCurrencies:z$1.array(z$1.string().length(3)).optional(),allowNegative:z$1.boolean().optional()}),pt=u.extend({options:k}),mt=u.extend({granularity:z$1.enum(["full","address","city","state","country","coordinates"]).optional(),defaultCountry:z$1.string().length(3).optional(),allowedCountries:z$1.array(z$1.string().length(3)).optional()}),dt=u.extend({options:k,renderAs:z$1.literal("badges").optional()}),ht=u.extend({options:k,renderAs:z$1.literal("badges").optional()}),ft=u.extend({types:z$1.array(z$1.enum(["user","agent"])).min(1).optional(),multiple:z$1.boolean().optional()}),gt=u.extend({targets:z$1.array(nt).min(1),cardinality:z$1.enum(["one","many"]),maxItems:z$1.number().int().min(1).optional(),bilateral:ot.optional(),properties:z$1.object({definitions:z$1.array(z$1.record(z$1.string(),z$1.unknown()))}).passthrough().optional()}),bt=u.extend({expression:z$1.string().min(1).superRefine((o,e)=>{try{I(o);}catch(n){e.addIssue({code:z$1.ZodIssueCode.custom,message:n instanceof Error?n.message:"Invalid formula expression"});}}),returnType:z$1.enum(["text","number","boolean","date","select","multiselect"]),decimals:z$1.number().int().min(0).max(10).optional(),allowRelations:z$1.boolean().optional(),optionsSource:R.optional()}),xt=u.extend({relationAttribute:z$1.string().min(1).optional(),relationPath:z$1.string().optional(),targetAttribute:z$1.string().min(1),function:z$1.enum(["sum","avg","earliest","latest","count","countValues","countUniqueValues","countEmpty","percentEmpty","percentNotEmpty","original"]),decimals:z$1.number().int().min(0).max(10).optional(),targetAttributeType:z$1.string().optional(),targetAttributeOptions:z$1.array(j).optional(),targetCurrencyCode:z$1.string().length(3).optional(),optionsSource:R.optional()}),yt=z$1.object({definitions:z$1.array(z$1.record(z$1.string(),z$1.unknown()))}).passthrough(),vt=u.extend({properties:yt.optional(),accepts:z$1.array(z$1.string().min(1)).optional(),maxFileSize:z$1.number().int().min(1).optional()}),z={text:it,richtext:rt,number:at,checkbox:st,date:ut,phone:ct,currency:lt,status:pt,location:mt,select:dt,multiselect:ht,user:ft,relation:gt,formula:bt,rollup:xt,document:vt};function d(o){let e=z[o];if(!e)throw new h$1(`Unsupported attribute type: ${o}`,[]);return e}a(d,"getAttributeConfigSchema");function wt(o,e){return d(o).strip().parse(e)}a(wt,"parseAttributeConfig");function $(o){let e=d(o).extend({icon:x.optional()});switch(o){case "select":return e.extend({options:Y});case "multiselect":return e.extend({options:tt});case "status":return e.extend({options:et});default:return e}}a($,"getAttributeConfigWriteSchema");function W(o){return h$1.fromZodErrors(o.map(e=>({path:e.path.map(n=>typeof n=="symbol"?String(n):n),message:e.message})))}a(W,"validationErrorFromIssues");function _(o,e){let n=$(o).strip().safeParse(e);if(!n.success)throw W(n.error.issues);return n.data}a(_,"parseWriteSchema");function kt(o,e){return _(o,e)}a(kt,"parseAttributeConfigForCreate");function Ct(o){if(!Object.prototype.hasOwnProperty.call(o,"icon"))return;let e=x.optional().safeParse(o.icon);if(!e.success)throw h$1.fromZodErrors(e.error.issues.map(n=>({path:["icon",...n.path.map(i=>typeof i=="symbol"?String(i):i)],message:n.message})))}a(Ct,"validatePatchedIcon");function F(o){return o==="select"||o==="multiselect"||o==="status"}a(F,"isSelectLike");function St(o,e){let n=Object.prototype.hasOwnProperty.call(e,"options"),i=Object.prototype.hasOwnProperty.call(e,"icon"),r={...o,...e};if(Ct(e),n){let{icon:A,...Z}=r,P=_(o.type,i?r:Z);return !i&&A!==void 0&&(P.icon=A),P}let s=o.options;F(o.type)&&(r.options=[{value:"__legacy__",label:"__legacy__"}]);let l=d(o.type).strip().safeParse(r);if(!l.success)throw W(l.error.issues);let S=l.data;return F(o.type)&&(S.options=s),S}a(St,"parseAttributeConfigForUpdate");export{c as a,I as b,O as c,b as d,x as e,v as f,w as g,T as h,E as i,it as j,at as k,st as l,ut as m,ct as n,lt as o,pt as p,mt as q,dt as r,ht as s,z as t,d as u,wt as v,$ as w,kt as x,St as y};
@@ -1,4 +1,4 @@
1
1
  'use strict';var chunkJSKLP4GI_js=require('./chunk-JSKLP4GI.js'),chunkDPD6ZWL2_js=require('./chunk-DPD6ZWL2.js'),zod=require('zod'),constants=require('@stndrds/constants');/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
2
  var f=class f extends Error{constructor(e){super(e),this.name="ComputedFormulaParseError";}};chunkDPD6ZWL2_js.a(f,"ComputedFormulaParseError");var c=f;function I(o){let e=new h(B(o)),n=e.parseExpression();return e.expectEnd(),n}chunkDPD6ZWL2_js.a(I,"parseComputedFormula");function B(o){let e=[],n=0;for(;n<o.length;){let i=o[n];if(i===" "||i===" "||i===`
3
3
  `||i==="\r"){n+=1;continue}if(i==='"'||i==="'"){let s=L(o,n,i);e.push({kind:"string",value:s.value,position:n}),n=s.nextIndex;continue}if(m(i)){let s=V(o,n);e.push({kind:"number",value:s.value,position:n}),n=s.nextIndex;continue}if(M(i)){let s=D(o,n),l=s.value.toLowerCase();l==="true"?e.push({kind:"boolean",value:true,position:n}):l==="false"?e.push({kind:"boolean",value:false,position:n}):l==="null"?e.push({kind:"null",position:n}):e.push({kind:"identifier",value:s.value,position:n}),n=s.nextIndex;continue}let r=o.slice(n,n+2);if(r===">="||r==="<="||r==="=="||r==="!="){e.push({kind:"operator",value:r,position:n}),n+=2;continue}if(i===">"||i==="<"||i==="+"||i==="-"||i==="*"||i==="/"){e.push({kind:"operator",value:i,position:n}),n+=1;continue}if(i==="("||i===")"||i===","||i==="."){e.push({kind:"punctuation",value:i,position:n}),n+=1;continue}throw new c(`Unexpected character "${i}" at position ${n}`)}return e}chunkDPD6ZWL2_js.a(B,"tokenize");function L(o,e,n='"'){let i="",r=e+1;for(;r<o.length;){let s=o[r];if(s===n)return {value:i,nextIndex:r+1};if(s==="\\"){let l=o[r+1];if(l===void 0)throw new c(`Unterminated string literal at position ${r}`);i+=U(l,r),r+=2;continue}i+=s,r+=1;}throw new c(`Unterminated string literal at position ${e}`)}chunkDPD6ZWL2_js.a(L,"scanString");function U(o,e){switch(o){case '"':case "\\":return o;case "n":return `
4
- `;case "r":return "\r";case "t":return " ";default:throw new c(`Unknown escape sequence "\\${o}" at position ${e}`)}}chunkDPD6ZWL2_js.a(U,"decodeEscape");function V(o,e){let n=e;for(;n<o.length&&m(o[n]);)n+=1;if(o[n]==="."){let s=n;if(n+=1,!m(o[n]))throw new c(`Invalid number literal at position ${s}`);for(;n<o.length&&m(o[n]);)n+=1;}let i=o.slice(e,n),r=Number(i);if(!Number.isFinite(r))throw new c(`Invalid number literal "${i}"`);return {value:r,nextIndex:n}}chunkDPD6ZWL2_js.a(V,"scanNumber");function D(o,e){let n=e+1;for(;n<o.length&&G(o[n]);)n+=1;return {value:o.slice(e,n),nextIndex:n}}chunkDPD6ZWL2_js.a(D,"scanIdentifier");function m(o){return o!==void 0&&o>="0"&&o<="9"}chunkDPD6ZWL2_js.a(m,"isDigit");function M(o){return o!==void 0&&/[A-Za-z_]/.test(o)}chunkDPD6ZWL2_js.a(M,"isIdentifierStart");function G(o){return o!==void 0&&/[A-Za-z0-9_]/.test(o)}chunkDPD6ZWL2_js.a(G,"isIdentifierPart");var g=class g{constructor(e){this.tokens=e;this.position=0;}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let e=this.peek();if(e!==void 0)throw new c(`Unexpected token ${q(e)} at position ${e.position}`)}parseBinaryExpression(e){let n=this.parsePrimary();for(;;){let i=this.peek();if(i?.kind!=="operator")return n;let r=H(i.value);if(r<e)return n;let s=i.value;this.consume();let l=this.parseBinaryExpression(r+1);n={kind:"binary",operator:s,left:n,right:l};}}parsePrimary(){let e=this.consume();if(e===void 0)throw new c("Unexpected end of expression");switch(e.kind){case "string":case "number":case "boolean":return {kind:"literal",value:e.value};case "null":return {kind:"literal",value:null};case "identifier":return this.parseIdentifier(e.value);case "punctuation":if(e.value==="("){let n=this.parseExpression();return this.expectPunctuation(")"),n}break;case "operator":if(e.value==="-"){let n=this.consume();if(n?.kind==="number")return {kind:"literal",value:-n.value}}break}throw new c(`Expected literal, path, call, or parenthesized expression at position ${e.position}`)}parseIdentifier(e){if(this.matchPunctuation("(")){let i=[];if(!this.matchPunctuation(")")){do i.push(this.parseExpression());while(this.matchPunctuation(","));this.expectPunctuation(")");}return {kind:"call",functionName:e.toLowerCase(),args:i}}let n=[e];for(;this.matchPunctuation(".");){let i=this.consume();if(i?.kind!=="identifier"){let r=i?.position??this.previousPosition();throw new c(`Expected attribute name after path separator at position ${r}`)}n.push(i.value);}return {kind:"path",parts:n}}expectPunctuation(e){if(!this.matchPunctuation(e)){let i=this.peek()?.position??this.previousPosition();throw new c(`Expected "${e}" at position ${i}`)}}matchPunctuation(e){let n=this.peek();return n?.kind==="punctuation"&&n.value===e?(this.consume(),true):false}peek(){return this.tokens[this.position]}consume(){let e=this.tokens[this.position];return this.position+=1,e}previousPosition(){return this.tokens[this.position-1]?.position??0}};chunkDPD6ZWL2_js.a(g,"Parser");var h=g;function q(o){switch(o.kind){case "identifier":case "number":case "string":case "boolean":case "operator":case "punctuation":return `"${String(o.value)}"`;case "null":return '"null"';default:return o}}chunkDPD6ZWL2_js.a(q,"describeToken");function H(o){switch(o){case "*":case "/":return 3;case "+":case "-":return 2;case ">":case "<":case ">=":case "<=":case "==":case "!=":return 1;default:return o}}chunkDPD6ZWL2_js.a(H,"getOperatorPrecedence");var O={attributesPerObject:300,tabsPerView:24,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20};var J=Object.keys(constants.COLORS),X=new Set(constants.ICONS),b=zod.z.enum(J),x=zod.z.string().superRefine((o,e)=>{X.has(o)||e.addIssue({code:"custom",message:"Invalid icon name"});}).transform(o=>o);var u=zod.z.object({placeholder:zod.z.string().optional(),description:zod.z.string().optional(),defaultValue:zod.z.unknown().optional(),icon:zod.z.string().optional(),order:zod.z.number().int().optional(),hidden:zod.z.boolean().optional(),archived:zod.z.boolean().optional(),deprecated:zod.z.boolean().optional(),metadata:zod.z.record(zod.z.string(),zod.z.unknown()).optional()}),y=zod.z.object({value:zod.z.string().min(1),label:zod.z.string().min(1),description:zod.z.string().optional(),inverse:zod.z.string().optional(),archived:zod.z.boolean().optional()}),v=zod.z.enum(["idle","in_progress","finished"]),w=y.extend({color:b}).strict(),T=w,E=y.extend({color:b,group:v}).strict(),j=y.extend({color:zod.z.string().optional(),group:v.optional()}).strict(),k=zod.z.array(j).min(1).refine(o=>{let e=o.map(n=>n.value);return new Set(e).size===e.length},{message:"Duplicate option values are not allowed"});function C(o){return zod.z.array(o).min(1).max(O.optionsPerAttribute).refine(e=>{let n=e.map(i=>i.value);return new Set(n).size===n.length},{message:"Duplicate option values are not allowed"})}chunkDPD6ZWL2_js.a(C,"writeOptionsArraySchema");var Y=C(w),tt=C(T),et=C(E),nt=zod.z.object({object:zod.z.string().min(1),displayTemplate:zod.z.string().optional(),filter:zod.z.record(zod.z.string(),zod.z.unknown()).optional()}),ot=zod.z.object({object:zod.z.string().min(1),attribute:zod.z.string().min(1),cardinality:zod.z.enum(["one","many"]).optional(),storageOwner:zod.z.boolean().optional()}),R=zod.z.object({objectName:zod.z.string().min(1),attributeName:zod.z.string().min(1),attributeId:zod.z.string().optional()}),it=u.extend({multiline:zod.z.boolean().optional(),minLength:zod.z.number().int().min(0).optional(),maxLength:zod.z.number().int().min(1).optional(),pattern:zod.z.string().optional(),format:zod.z.enum(["email","url","slug"]).optional()}),rt=u,at=u.extend({renderAs:zod.z.enum(["number","rating"]).optional(),min:zod.z.number().optional(),max:zod.z.number().optional(),unit:zod.z.enum(["integer","decimal","percentage"]).optional(),decimals:zod.z.number().int().min(0).max(10).optional()}),st=u,ut=u.extend({dateFormat:zod.z.enum(["short","long","full","relative"]).optional(),minDate:zod.z.string().optional(),maxDate:zod.z.string().optional(),includeTime:zod.z.boolean().optional(),endDate:zod.z.boolean().optional(),timeFormat:zod.z.enum(["12h","24h"]).optional()}),ct=u.extend({defaultCountryCode:zod.z.string().length(3).optional()}),lt=u.extend({defaultCurrency:zod.z.string().length(3).optional(),allowedCurrencies:zod.z.array(zod.z.string().length(3)).optional(),allowNegative:zod.z.boolean().optional()}),pt=u.extend({options:k}),mt=u.extend({granularity:zod.z.enum(["full","address","city","state","country","coordinates"]).optional(),defaultCountry:zod.z.string().length(3).optional(),allowedCountries:zod.z.array(zod.z.string().length(3)).optional()}),dt=u.extend({options:k,renderAs:zod.z.literal("badges").optional()}),ht=u.extend({options:k,renderAs:zod.z.literal("badges").optional()}),ft=u.extend({types:zod.z.array(zod.z.enum(["user","agent"])).min(1).optional(),multiple:zod.z.boolean().optional()}),gt=u.extend({targets:zod.z.array(nt).min(1),cardinality:zod.z.enum(["one","many"]),maxItems:zod.z.number().int().min(1).optional(),bilateral:ot.optional(),properties:zod.z.object({definitions:zod.z.array(zod.z.record(zod.z.string(),zod.z.unknown()))}).passthrough().optional()}),bt=u.extend({expression:zod.z.string().min(1).superRefine((o,e)=>{try{I(o);}catch(n){e.addIssue({code:zod.z.ZodIssueCode.custom,message:n instanceof Error?n.message:"Invalid formula expression"});}}),returnType:zod.z.enum(["text","number","boolean","date","select","multiselect"]),decimals:zod.z.number().int().min(0).max(10).optional(),allowRelations:zod.z.boolean().optional(),optionsSource:R.optional()}),xt=u.extend({relationAttribute:zod.z.string().min(1).optional(),relationPath:zod.z.string().optional(),targetAttribute:zod.z.string().min(1),function:zod.z.enum(["sum","avg","earliest","latest","count","countValues","countUniqueValues","countEmpty","percentEmpty","percentNotEmpty","original"]),decimals:zod.z.number().int().min(0).max(10).optional(),targetAttributeType:zod.z.string().optional(),targetAttributeOptions:zod.z.array(j).optional(),targetCurrencyCode:zod.z.string().length(3).optional(),optionsSource:R.optional()}),yt=zod.z.object({definitions:zod.z.array(zod.z.record(zod.z.string(),zod.z.unknown()))}).passthrough(),vt=u.extend({properties:yt.optional(),accepts:zod.z.array(zod.z.string().min(1)).optional(),maxFileSize:zod.z.number().int().min(1).optional()}),z={text:it,richtext:rt,number:at,checkbox:st,date:ut,phone:ct,currency:lt,status:pt,location:mt,select:dt,multiselect:ht,user:ft,relation:gt,formula:bt,rollup:xt,document:vt};function d(o){let e=z[o];if(!e)throw new chunkJSKLP4GI_js.h(`Unsupported attribute type: ${o}`,[]);return e}chunkDPD6ZWL2_js.a(d,"getAttributeConfigSchema");function wt(o,e){return d(o).strip().parse(e)}chunkDPD6ZWL2_js.a(wt,"parseAttributeConfig");function $(o){let e=d(o).extend({icon:x.optional()});switch(o){case "select":return e.extend({options:Y});case "multiselect":return e.extend({options:tt});case "status":return e.extend({options:et});default:return e}}chunkDPD6ZWL2_js.a($,"getAttributeConfigWriteSchema");function W(o){return chunkJSKLP4GI_js.h.fromZodErrors(o.map(e=>({path:e.path.map(n=>typeof n=="symbol"?String(n):n),message:e.message})))}chunkDPD6ZWL2_js.a(W,"validationErrorFromIssues");function _(o,e){let n=$(o).strip().safeParse(e);if(!n.success)throw W(n.error.issues);return n.data}chunkDPD6ZWL2_js.a(_,"parseWriteSchema");function kt(o,e){return _(o,e)}chunkDPD6ZWL2_js.a(kt,"parseAttributeConfigForCreate");function Ct(o){if(!Object.prototype.hasOwnProperty.call(o,"icon"))return;let e=x.optional().safeParse(o.icon);if(!e.success)throw chunkJSKLP4GI_js.h.fromZodErrors(e.error.issues.map(n=>({path:["icon",...n.path.map(i=>typeof i=="symbol"?String(i):i)],message:n.message})))}chunkDPD6ZWL2_js.a(Ct,"validatePatchedIcon");function F(o){return o==="select"||o==="multiselect"||o==="status"}chunkDPD6ZWL2_js.a(F,"isSelectLike");function St(o,e){let n=Object.prototype.hasOwnProperty.call(e,"options"),i=Object.prototype.hasOwnProperty.call(e,"icon"),r={...o,...e};if(Ct(e),n){let{icon:A,...Z}=r,P=_(o.type,i?r:Z);return !i&&A!==void 0&&(P.icon=A),P}let s=o.options;F(o.type)&&(r.options=[{value:"__legacy__",label:"__legacy__"}]);let l=d(o.type).strip().safeParse(r);if(!l.success)throw W(l.error.issues);let S=l.data;return F(o.type)&&(S.options=s),S}chunkDPD6ZWL2_js.a(St,"parseAttributeConfigForUpdate");exports.a=O;exports.b=b;exports.c=x;exports.d=c;exports.e=I;exports.f=v;exports.g=w;exports.h=T;exports.i=E;exports.j=z;exports.k=d;exports.l=wt;exports.m=$;exports.n=kt;exports.o=St;
4
+ `;case "r":return "\r";case "t":return " ";default:throw new c(`Unknown escape sequence "\\${o}" at position ${e}`)}}chunkDPD6ZWL2_js.a(U,"decodeEscape");function V(o,e){let n=e;for(;n<o.length&&m(o[n]);)n+=1;if(o[n]==="."){let s=n;if(n+=1,!m(o[n]))throw new c(`Invalid number literal at position ${s}`);for(;n<o.length&&m(o[n]);)n+=1;}let i=o.slice(e,n),r=Number(i);if(!Number.isFinite(r))throw new c(`Invalid number literal "${i}"`);return {value:r,nextIndex:n}}chunkDPD6ZWL2_js.a(V,"scanNumber");function D(o,e){let n=e+1;for(;n<o.length&&G(o[n]);)n+=1;return {value:o.slice(e,n),nextIndex:n}}chunkDPD6ZWL2_js.a(D,"scanIdentifier");function m(o){return o!==void 0&&o>="0"&&o<="9"}chunkDPD6ZWL2_js.a(m,"isDigit");function M(o){return o!==void 0&&/[A-Za-z_]/.test(o)}chunkDPD6ZWL2_js.a(M,"isIdentifierStart");function G(o){return o!==void 0&&/[A-Za-z0-9_]/.test(o)}chunkDPD6ZWL2_js.a(G,"isIdentifierPart");var g=class g{constructor(e){this.tokens=e;this.position=0;}parseExpression(){return this.parseBinaryExpression(0)}expectEnd(){let e=this.peek();if(e!==void 0)throw new c(`Unexpected token ${q(e)} at position ${e.position}`)}parseBinaryExpression(e){let n=this.parsePrimary();for(;;){let i=this.peek();if(i?.kind!=="operator")return n;let r=H(i.value);if(r<e)return n;let s=i.value;this.consume();let l=this.parseBinaryExpression(r+1);n={kind:"binary",operator:s,left:n,right:l};}}parsePrimary(){let e=this.consume();if(e===void 0)throw new c("Unexpected end of expression");switch(e.kind){case "string":case "number":case "boolean":return {kind:"literal",value:e.value};case "null":return {kind:"literal",value:null};case "identifier":return this.parseIdentifier(e.value);case "punctuation":if(e.value==="("){let n=this.parseExpression();return this.expectPunctuation(")"),n}break;case "operator":if(e.value==="-"){let n=this.consume();if(n?.kind==="number")return {kind:"literal",value:-n.value}}break}throw new c(`Expected literal, path, call, or parenthesized expression at position ${e.position}`)}parseIdentifier(e){if(this.matchPunctuation("(")){let i=[];if(!this.matchPunctuation(")")){do i.push(this.parseExpression());while(this.matchPunctuation(","));this.expectPunctuation(")");}return {kind:"call",functionName:e.toLowerCase(),args:i}}let n=[e];for(;this.matchPunctuation(".");){let i=this.consume();if(i?.kind!=="identifier"){let r=i?.position??this.previousPosition();throw new c(`Expected attribute name after path separator at position ${r}`)}n.push(i.value);}return {kind:"path",parts:n}}expectPunctuation(e){if(!this.matchPunctuation(e)){let i=this.peek()?.position??this.previousPosition();throw new c(`Expected "${e}" at position ${i}`)}}matchPunctuation(e){let n=this.peek();return n?.kind==="punctuation"&&n.value===e?(this.consume(),true):false}peek(){return this.tokens[this.position]}consume(){let e=this.tokens[this.position];return this.position+=1,e}previousPosition(){return this.tokens[this.position-1]?.position??0}};chunkDPD6ZWL2_js.a(g,"Parser");var h=g;function q(o){switch(o.kind){case "identifier":case "number":case "string":case "boolean":case "operator":case "punctuation":return `"${String(o.value)}"`;case "null":return '"null"';default:return o}}chunkDPD6ZWL2_js.a(q,"describeToken");function H(o){switch(o){case "*":case "/":return 3;case "+":case "-":return 2;case ">":case "<":case ">=":case "<=":case "==":case "!=":return 1;default:return o}}chunkDPD6ZWL2_js.a(H,"getOperatorPrecedence");var O={attributesPerObject:300,tabsPerView:24,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20};var J=Object.keys(constants.COLORS),X=new Set(constants.ICONS),b=zod.z.enum(J),x=zod.z.string().superRefine((o,e)=>{X.has(o)||e.addIssue({code:"custom",message:"Invalid icon name"});}).transform(o=>o);var u=zod.z.object({placeholder:zod.z.string().optional(),description:zod.z.string().optional(),defaultValue:zod.z.unknown().optional(),icon:zod.z.string().optional(),order:zod.z.number().int().optional(),hidden:zod.z.boolean().optional(),archived:zod.z.boolean().optional(),deprecated:zod.z.boolean().optional(),metadata:zod.z.record(zod.z.string(),zod.z.unknown()).optional()}),y=zod.z.object({value:zod.z.string().min(1),label:zod.z.string().min(1),description:zod.z.string().optional(),inverse:zod.z.string().optional(),archived:zod.z.boolean().optional()}),v=zod.z.enum(["idle","in_progress","finished"]),w=y.extend({color:b}).strict(),T=w,E=y.extend({color:b,group:v}).strict(),j=y.extend({color:zod.z.string().optional(),group:v.optional()}).strict(),k=zod.z.array(j).min(1).refine(o=>{let e=o.map(n=>n.value);return new Set(e).size===e.length},{message:"Duplicate option values are not allowed"});function C(o){return zod.z.array(o).min(1).max(O.optionsPerAttribute).refine(e=>{let n=e.map(i=>i.value);return new Set(n).size===n.length},{message:"Duplicate option values are not allowed"})}chunkDPD6ZWL2_js.a(C,"writeOptionsArraySchema");var Y=C(w),tt=C(T),et=C(E),nt=zod.z.object({object:zod.z.string().min(1),displayTemplate:zod.z.string().optional(),filter:zod.z.record(zod.z.string(),zod.z.unknown()).optional()}),ot=zod.z.object({object:zod.z.string().min(1),attribute:zod.z.string().min(1),cardinality:zod.z.enum(["one","many"]).optional(),storageOwner:zod.z.boolean().optional()}),R=zod.z.object({objectName:zod.z.string().min(1),attributeName:zod.z.string().min(1),attributeId:zod.z.string().optional()}),it=u.extend({multiline:zod.z.boolean().optional(),minLength:zod.z.number().int().min(0).optional(),maxLength:zod.z.number().int().min(1).optional(),pattern:zod.z.string().optional(),format:zod.z.enum(["email","url","slug"]).optional()}),rt=u,at=u.extend({renderAs:zod.z.enum(["number","rating"]).optional(),min:zod.z.number().optional(),max:zod.z.number().optional(),unit:zod.z.enum(["integer","decimal","percentage"]).optional(),decimals:zod.z.number().int().min(0).max(10).optional()}),st=u,ut=u.extend({dateFormat:zod.z.enum(["short","long","full","relative"]).optional(),minDate:zod.z.string().optional(),maxDate:zod.z.string().optional(),includeTime:zod.z.boolean().optional(),endDate:zod.z.boolean().optional(),timeFormat:zod.z.enum(["12h","24h"]).optional()}),ct=u.extend({defaultCountryCode:zod.z.string().length(3).optional()}),lt=u.extend({defaultCurrency:zod.z.string().length(3).optional(),allowedCurrencies:zod.z.array(zod.z.string().length(3)).optional(),allowNegative:zod.z.boolean().optional()}),pt=u.extend({options:k}),mt=u.extend({granularity:zod.z.enum(["full","address","city","state","country","coordinates"]).optional(),defaultCountry:zod.z.string().length(3).optional(),allowedCountries:zod.z.array(zod.z.string().length(3)).optional()}),dt=u.extend({options:k,renderAs:zod.z.literal("badges").optional()}),ht=u.extend({options:k,renderAs:zod.z.literal("badges").optional()}),ft=u.extend({types:zod.z.array(zod.z.enum(["user","agent"])).min(1).optional(),multiple:zod.z.boolean().optional()}),gt=u.extend({targets:zod.z.array(nt).min(1),cardinality:zod.z.enum(["one","many"]),maxItems:zod.z.number().int().min(1).optional(),bilateral:ot.optional(),properties:zod.z.object({definitions:zod.z.array(zod.z.record(zod.z.string(),zod.z.unknown()))}).passthrough().optional()}),bt=u.extend({expression:zod.z.string().min(1).superRefine((o,e)=>{try{I(o);}catch(n){e.addIssue({code:zod.z.ZodIssueCode.custom,message:n instanceof Error?n.message:"Invalid formula expression"});}}),returnType:zod.z.enum(["text","number","boolean","date","select","multiselect"]),decimals:zod.z.number().int().min(0).max(10).optional(),allowRelations:zod.z.boolean().optional(),optionsSource:R.optional()}),xt=u.extend({relationAttribute:zod.z.string().min(1).optional(),relationPath:zod.z.string().optional(),targetAttribute:zod.z.string().min(1),function:zod.z.enum(["sum","avg","earliest","latest","count","countValues","countUniqueValues","countEmpty","percentEmpty","percentNotEmpty","original"]),decimals:zod.z.number().int().min(0).max(10).optional(),targetAttributeType:zod.z.string().optional(),targetAttributeOptions:zod.z.array(j).optional(),targetCurrencyCode:zod.z.string().length(3).optional(),optionsSource:R.optional()}),yt=zod.z.object({definitions:zod.z.array(zod.z.record(zod.z.string(),zod.z.unknown()))}).passthrough(),vt=u.extend({properties:yt.optional(),accepts:zod.z.array(zod.z.string().min(1)).optional(),maxFileSize:zod.z.number().int().min(1).optional()}),z={text:it,richtext:rt,number:at,checkbox:st,date:ut,phone:ct,currency:lt,status:pt,location:mt,select:dt,multiselect:ht,user:ft,relation:gt,formula:bt,rollup:xt,document:vt};function d(o){let e=z[o];if(!e)throw new chunkJSKLP4GI_js.h(`Unsupported attribute type: ${o}`,[]);return e}chunkDPD6ZWL2_js.a(d,"getAttributeConfigSchema");function wt(o,e){return d(o).strip().parse(e)}chunkDPD6ZWL2_js.a(wt,"parseAttributeConfig");function $(o){let e=d(o).extend({icon:x.optional()});switch(o){case "select":return e.extend({options:Y});case "multiselect":return e.extend({options:tt});case "status":return e.extend({options:et});default:return e}}chunkDPD6ZWL2_js.a($,"getAttributeConfigWriteSchema");function W(o){return chunkJSKLP4GI_js.h.fromZodErrors(o.map(e=>({path:e.path.map(n=>typeof n=="symbol"?String(n):n),message:e.message})))}chunkDPD6ZWL2_js.a(W,"validationErrorFromIssues");function _(o,e){let n=$(o).strip().safeParse(e);if(!n.success)throw W(n.error.issues);return n.data}chunkDPD6ZWL2_js.a(_,"parseWriteSchema");function kt(o,e){return _(o,e)}chunkDPD6ZWL2_js.a(kt,"parseAttributeConfigForCreate");function Ct(o){if(!Object.prototype.hasOwnProperty.call(o,"icon"))return;let e=x.optional().safeParse(o.icon);if(!e.success)throw chunkJSKLP4GI_js.h.fromZodErrors(e.error.issues.map(n=>({path:["icon",...n.path.map(i=>typeof i=="symbol"?String(i):i)],message:n.message})))}chunkDPD6ZWL2_js.a(Ct,"validatePatchedIcon");function F(o){return o==="select"||o==="multiselect"||o==="status"}chunkDPD6ZWL2_js.a(F,"isSelectLike");function St(o,e){let n=Object.prototype.hasOwnProperty.call(e,"options"),i=Object.prototype.hasOwnProperty.call(e,"icon"),r={...o,...e};if(Ct(e),n){let{icon:A,...Z}=r,P=_(o.type,i?r:Z);return !i&&A!==void 0&&(P.icon=A),P}let s=o.options;F(o.type)&&(r.options=[{value:"__legacy__",label:"__legacy__"}]);let l=d(o.type).strip().safeParse(r);if(!l.success)throw W(l.error.issues);let S=l.data;return F(o.type)&&(S.options=s),S}chunkDPD6ZWL2_js.a(St,"parseAttributeConfigForUpdate");exports.a=c;exports.b=I;exports.c=O;exports.d=b;exports.e=x;exports.f=v;exports.g=w;exports.h=T;exports.i=E;exports.j=it;exports.k=at;exports.l=st;exports.m=ut;exports.n=ct;exports.o=lt;exports.p=pt;exports.q=mt;exports.r=dt;exports.s=ht;exports.t=z;exports.u=d;exports.v=wt;exports.w=$;exports.x=kt;exports.y=St;
@@ -0,0 +1,2 @@
1
+ import {c,e}from'./chunk-B2W4ZEO2.mjs';import {h}from'./chunk-XRWRECDA.mjs';import {a}from'./chunk-KSPJP74K.mjs';import {z as z$1}from'zod';/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
+ var Rt={createdAt:"createdAt",updatedAt:"updatedAt",createdBy:"createdBy",lastUpdatedBy:"lastUpdatedBy",attachments:"attachments"};function Le(t){return Rt[t]}a(Le,"getSystemAttributeI18nKey");var Tt={createdAt:{id:"system:createdAt",name:"createdAt",label:"Created time",type:"date",required:false,system:true,icon:"clock-circle",description:"When this record was created"},updatedAt:{id:"system:updatedAt",name:"updatedAt",label:"Last edited time",type:"date",required:false,system:true,icon:"clock-circle",description:"When this record was last modified"},createdBy:{id:"system:createdBy",name:"createdBy",label:"Created by",type:"user",required:false,system:true,multiple:false,icon:"user",description:"Actor who created this record"},lastUpdatedBy:{id:"system:lastUpdatedBy",name:"lastUpdatedBy",label:"Last edited by",type:"user",required:false,system:true,multiple:false,icon:"user",description:"Actor who last modified this record"},attachments:{id:"system:attachments",name:"attachments",label:"Attachments",type:"document",required:false,system:true,hidden:true,icon:"paperclip",description:"Free-form document attachments"}};function Be(){return Object.values(Tt)}a(Be,"getSystemAttributeList");function J(t){return t.id?.startsWith("system:")??false}a(J,"isManagedSystemAttribute");var G=["is","is_not","contains","not_contains","starts_with","ends_with","is_empty","is_not_empty"],z=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","is_empty","is_not_empty"],Ot=["is"],xt=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","is_within","on_day_month","is_empty","is_not_empty"],W=["is","is_not","any_of","none_of","is_empty","is_not_empty"],Ft=["any_of","none_of","is_empty","is_not_empty"],K=["is","is_not","any_of","none_of","is_empty","is_not_empty"],wt=["is_empty","is_not_empty"],Ct=["is","is_not","less_than","greater_than","less_or_equal","greater_or_equal","contains","not_contains","is_empty","is_not_empty"],x=["city","postalCode","country"];function F(t){return x.includes(t)}a(F,"isLocationFilterProperty");function Ye(t){return G.includes(t)}a(Ye,"isLocationPartOperator");var b={text:G,richtext:[],number:z,checkbox:Ot,date:xt,phone:["is","is_not","contains","not_contains","starts_with","is_empty","is_not_empty"],currency:z,status:W,select:W,multiselect:Ft,location:[],user:K,relation:K,formula:Ct,document:wt},It=new Set(["formula","rollup"]),Dt=new Set(["user","relation","document"]),Vt=new Set(["text","richtext","number","select","multiselect","status","date","phone","currency","location","user","relation","document"]),vt=new Set(["text","number","date","phone","currency","select","multiselect"]),Pt=new Set(["text","phone","status","select","multiselect"]),kt=new Set(["text","number","checkbox","date","phone","currency","status","select"]);function g(t){let r=!!(t.hidden||t.archived),n=!t.archived,i=It.has(t.type),a=t.type==="document",s=Dt.has(t.type),l=jt(t),u=r?[]:Nt(t),p=u.length>0&&!r,_=!r&&Pt.has(t.type),h=!r&&kt.has(t.type),A=!r&&zt(t.type),T=!r&&t.type==="status",At=J(t),B=i||a||At,O=!(r||B),St=Ut(t.type)?"forbidden":"allowed",Et=qt(t.type),U=Lt(t),q=vt.has(t.type),$=!!(t.deprecated&&!r),Y=Jt(t);return {lifecycle:{active:n,deprecated:!!t.deprecated,visibleInArchitect:true,visibleInRuntime:!r,warningWhenDeprecated:$},storage:{mode:i?"computed":s?"edge":"value",cardinality:l,edgeBacked:s,preservesExistingValues:!!t.archived,qualifiedProperties:Bt(t.type),polymorphic:Mt(t),maxItems:U},authoring:{editable:O,readOnly:B,directEdit:O&&Y==="inline",required:St,defaultValue:Et,placeholder:q,maxItems:U},presentation:{formField:!r&&Yt(t.type),tableCell:!r&&Q(t.type),defaultColumn:!r&&$t(t.type),compactDisplay:!r,popoverEditor:!r&&Y==="popover",placeholder:q,warningWhenDeprecated:$},query:{filterable:p,searchable:_,sortable:h,groupable:A,kanbanGroupable:T,operators:u},agent:{readable:!r,writable:O&&!a,compactReadable:!r,contentReadable:!r&&Wt(t.type),requiresDedicatedTool:a},exchange:{importable:!r,exportable:!r,schemaExportable:true,metadataExportable:false}}}a(g,"getAttributeCapabilities");function H(t){return g(t).query.operators}a(H,"getAttributeFilterOperators");function Je(t){return g(t).query.filterable}a(Je,"isAttributeFilterable");function ze(t){return g(t).query.searchable}a(ze,"isAttributeSearchable");function We(t){return g(t).query.sortable}a(We,"isAttributeSortable");function Ke(t){return g(t).query.groupable}a(Ke,"isAttributeGroupable");function Ge(t){return g(t).query.kanbanGroupable}a(Ge,"isAttributeKanbanGroupable");function w(t){if(t.type!=="rollup")return t.type;let r=t;if(r.function==="earliest"||r.function==="latest")return "date";if(r.function==="original"){let n=r.targetAttributeType;if(n&&X(n))return n}return "number"}a(w,"resolveEffectiveFilterType");function C(t){let r=w(t);return X(r)?b[r]:b.number}a(C,"getRollupFilterOperators");function Nt(t){return t.type==="rollup"?C(t):b[t.type]??[]}a(Nt,"getRawFilterOperators");function jt(t){return t.type==="multiselect"||t.type==="document"||t.type==="user"&&t.multiple===true||t.type==="relation"&&t.cardinality==="many"?"many":"one"}a(jt,"getAttributeCardinality");function Mt(t){if(t.type!=="relation")return "none";let n=t.targets??[];return n.length===1&&n[0]?.object==="*"?"internal":n.length>1?"code-only":"none"}a(Mt,"getPolymorphicCapability");function Lt(t){return t.type==="multiselect"?true:t.type==="relation"?t.cardinality==="many":false}a(Lt,"supportsMaxItems");function Bt(t){return t==="relation"||t==="document"}a(Bt,"supportsQualifiedProperties");function Ut(t){return t==="checkbox"||t==="formula"||t==="rollup"}a(Ut,"isRequiredForbidden");function qt(t){return t==="checkbox"?"automatic":t==="formula"||t==="rollup"?"forbidden":Vt.has(t)?"static":"forbidden"}a(qt,"getDefaultValueCapability");function $t(t){return Q(t)}a($t,"isDefaultColumnType");function Q(t){return t!=="richtext"&&t!=="document"}a(Q,"isTableCellType");function Yt(t){return t!=="richtext"}a(Yt,"isFormFieldType");function Jt(t){switch(t.type){case "checkbox":return "inline";case "number":return t.renderAs==="rating"?"inline":"default";case "select":case "multiselect":return t.renderAs==="badges"?"inline":"popover";case "status":case "relation":case "user":case "date":return "popover";default:return "default"}}a(Jt,"resolveEditMode");function zt(t){return t==="status"||t==="currency"}a(zt,"isGroupableType");function Wt(t){return t==="richtext"||t==="document"}a(Wt,"isContentReadableType");function X(t){return Object.prototype.hasOwnProperty.call(b,t)}a(X,"hasFilterOperatorEntry");var f=b,Kt=["is_empty","is_not_empty"];function Z(t){return Kt.includes(t)}a(Z,"isNoValueOperator");function Ze(t){return C(t)}a(Ze,"getRollupFilterOperators");function E(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"dynamic"in t}a(E,"isDynamicValue");function rr(){return {dynamic:"actor",ref:"current"}}a(rr,"currentActor");function or(){return {dynamic:"date",anchor:"today"}}a(or,"today");function nr(){return {dynamic:"date",anchor:"now"}}a(nr,"now");function tt(t){if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:null}return null}a(tt,"toAmount");function et(t){return t!==null&&typeof t=="object"?"value"in t?tt(t.value):null:tt(t)}a(et,"extractCurrencyFilterValue");function sr(t){return t==null?null:typeof t=="object"&&"value"in t?t.value??null:t}a(sr,"extractFilterValue");var Gt=new Set(["is_not","not_contains","none_of","is_empty"]),Ht={is_not:"is",not_contains:"contains",none_of:"any_of",is_empty:"is_not_empty"};function pr(t){return Gt.has(t)?"none":"any"}a(pr,"getOperatorPolarity");function cr(t){return Ht[t]??t}a(cr,"normalizeForEdgeRpc");var rt={is:"any_of",is_not:"none_of"};function dr(t){return rt[t]??t}a(dr,"toMultiValueOperator");var Qt=new Set(Object.values(rt).filter(t=>t!==void 0));function ot(t){return Qt.has(t)}a(ot,"isSetMembershipOperator");function nt(t,r){let n=t.value;if(Z(t.operator)||n==null||E(n))return;if(ot(t.operator)){Array.isArray(n)||(t.value=[n]);return}if(r!=="currency")return;let i=et(n);if(i!==null){t.value=i;return}if(!Xt(n))return;let a=`Filter on a currency attribute expected a numeric amount, received ${JSON.stringify(n)}`;throw new h(a,[{path:["value"],message:a}])}a(nt,"canonicalizeFilterValue");function Xt(t){return typeof t!="object"?true:"value"in t?t.value!=null:false}a(Xt,"hasCurrencyAmount");var Zt={eq:"is",equals:"is",equal:"is","==":"is","=":"is",neq:"is_not",notEqual:"is_not",isNot:"is_not","!=":"is_not","<>":"is_not",lt:"less_than","<":"less_than",gt:"greater_than",">":"greater_than",lte:"less_or_equal","<=":"less_or_equal",gte:"greater_or_equal",">=":"greater_or_equal",in:"any_of",isAnyOf:"any_of",anyOf:"any_of",oneOf:"any_of",notIn:"none_of",not_in:"none_of",isNoneOf:"none_of",noneOf:"none_of",notOneOf:"none_of",startsWith:"starts_with",beginsWith:"starts_with",endsWith:"ends_with",doesNotContain:"not_contains",notContain:"not_contains",isEmpty:"is_empty",isNotEmpty:"is_not_empty"};function I(t){return Zt[t]??t}a(I,"normalizeOperator");function Er(t){let r=I(t.operator);return r===t.operator?t:{...t,operator:r}}a(Er,"normalizeFilterRule");var te=new Set(["days","weeks","months","years"]),ee=new Set(["past","future"]);function D(t){if(typeof t!="object"||t===null)return false;let r=t;return typeof r.amount=="number"&&Number.isFinite(r.amount)&&r.amount>0&&typeof r.unit=="string"&&te.has(r.unit)&&typeof r.direction=="string"&&ee.has(r.direction)}a(D,"isRelativeDateValue");function at(t){return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}a(at,"utcDayStart");function it(t,r,n){if(n==="days")return t+r*864e5;if(n==="weeks")return t+r*7*864e5;let i=new Date(t),a=i.getUTCFullYear()+(n==="years"?r:0),s=i.getUTCMonth()+(n==="months"?r:0),l=new Date(Date.UTC(a,s+1,0)).getUTCDate();return Date.UTC(a,s,Math.min(i.getUTCDate(),l))}a(it,"shiftUtcDay");function Or(t,r=new Date){if(!D(t))return null;let n=at(r),i=Math.trunc(t.amount),a=t.direction==="past"?{startMs:it(n,-i,t.unit),endMs:n+864e5}:{startMs:n,endMs:it(n,i,t.unit)+864e5};return Number.isFinite(a.startMs)&&Number.isFinite(a.endMs)?a:null}a(Or,"resolveIsWithinBounds");function xr(t){if(!Number.isFinite(t))return null;let r=at(new Date(t));return Number.isFinite(r)?{startMs:r,endMs:r+864e5}:null}a(xr,"resolveUtcDayBounds");function Fr(t){return new Date(t).toISOString().slice(0,10)}a(Fr,"toUtcDayString");var re=new Set(["relation","document","user"]),V=["is","is_not","any_of","none_of","is_empty","is_not_empty"],oe={id:V,objectId:V,tenantId:V,label:f.text,createdAt:f.date,updatedAt:f.date,deletedAt:f.date,createdBy:f.user,lastUpdatedBy:f.user},ne={id:"text",objectId:"text",objectName:"text",tenantId:"text",label:"text",createdAt:"date",updatedAt:"date",deletedAt:"date",deletedBy:"user",createdBy:"user",lastUpdatedBy:"user",visibility:"select",ownedBy:"user"},k={before:'"less_than"',after:'"greater_than"',on_or_before:'"less_or_equal"',on_or_after:'"greater_or_equal"',is_checked:'"is" with value true',is_not_checked:'"is" with value false',day_month_eq:'"on_day_month"'},ie=new Set(Object.entries(b).filter(([,t])=>t.includes("any_of")&&!t.includes("contains")).map(([t])=>t)),ae={contains:"any_of",not_contains:"none_of"};function v(t,r){let n=k[t];if(n){let s=`Unknown filter operator "${t}" \u2014 use ${n}`;throw new h(s,[{path:["operator"],message:s}])}let i=I(t),a=ae[i];if(a&&ie.has(r)){let s=`Operator "${i}" is not valid for type "${r}" \u2014 use "${a}"`;throw new h(s,[{path:["operator"],message:s}])}return i}a(v,"resolveCanonicalOperator");function st(t,r,n){let i=v(t,r),a=f[r];if(!a?.includes(i)){let s=a?.length?a.join(", "):"(no operators registered for this type)",l=`Operator "${t}" is not valid for ${n} type "${r}". Valid operators: ${s}.`;throw new h(l,[{path:["operator"],message:l}])}return i}a(st,"assertOperatorForType");function se(t){if(t.operator==="is_within"&&!D(t.value)){let r='Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }';throw new h(r,[{path:["value"],message:r}])}}a(se,"assertRelativeDateValue");function R(t,r,n){t.operator=r,nt(t,n),se(t);}a(R,"applyCanonicalForm");function lt(t,r){if(!E(t.value))return;let n=t.value;if(n.dynamic==="actor"&&r!=="user"){let i=`actor token (@me) is only valid on user attributes, not "${r}"`;throw new h(i,[{path:["value"],message:i}])}if(n.dynamic==="date"&&r!=="date"){let i=`date token (@today/@now) is only valid on date attributes, not "${r}"`;throw new h(i,[{path:["value"],message:i}])}}a(lt,"assertDynamicValueForAttribute");var P=x.map(t=>`"${t}"`).join(", ");function le(t){return t==="location"?` A location is filtered on one of its parts: set "property" to one of ${P} and use a text operator (e.g. contains).`:""}a(le,"locationPartsHint");function jr(t,r){try{return ue({...t},r),[]}catch(n){if(!(n instanceof h))throw n;return n.errors.map(i=>({...i,path:[...i.path]}))}}a(jr,"collectQualifiedRuleIssues");function ue(t,r){let n=r.attributes.find(u=>u.name===t.attribute),i=oe[t.attribute];if(!(n||i)){let[u,...p]=t.attribute.split("."),h$1=(p.length>0?r.attributes.find(T=>T.name===u):void 0)?.type==="location"?` Dotted paths are not supported \u2014 set "attribute" to "${u}" and "property" to ${F(p[0]??"")?`"${p[0]}"`:`one of ${P}`}.`:t.attribute.includes(".")?' Dotted paths are not supported \u2014 filter on the attribute name alone, or use the full-text "query" parameter to match text inside a value.':"",A=`Unknown attribute: ${t.attribute}${h$1}`;throw new h(A,[{path:["attribute"],message:A}])}if(t.quantifier!==void 0&&!t.property){let u='quantifier is only valid on qualified edge rules (set "property")';throw new h(u,[{path:["quantifier"],message:u}])}if(!n){if(t.property)throw new h(`Cannot qualify system attribute "${t.attribute}"`,[{path:["property"],message:`"${t.attribute}" is a system column, not a reference`}]);let u=ne[t.attribute]??"text",p=v(t.operator,u);if(!i.includes(p)){let _=`Operator "${t.operator}" is not valid for system attribute "${t.attribute}". Valid operators: ${i.join(", ")}.`;throw new h(_,[{path:["operator"],message:_}])}R(t,p,u);return}if(!t.property){lt(t,n.type);let u=H(n),p=v(t.operator,n.type);if(!u.includes(p)){let _=u.length?u.join(", "):"(not filterable)",h$1=`Operator "${t.operator}" is not valid for attribute "${n.name}". Valid operators: ${_}.${le(n.type)}`;throw new h(h$1,[{path:["operator"],message:h$1}])}R(t,p,w(n));return}if(n.type==="location"){if(t.quantifier!==void 0){let p="quantifier is not valid on a location part \u2014 a location is one value, not a set of edges";throw new h(p,[{path:["quantifier"],message:p}])}if(!F(t.property)){let p=`Property "${t.property}" is not a part of location "${t.attribute}". Valid parts: ${P}.`;throw new h(p,[{path:["property"],message:p}])}lt(t,"text");let u=st(t.operator,"text","property");R(t,u,"text");return}if(!re.has(n.type))throw new h(`Cannot qualify ${n.type} attribute "${t.attribute}"`,[{path:["property"],message:`Attribute "${t.attribute}" is not a reference type`}]);let a=n.properties;if(!a)throw new h(`Attribute "${t.attribute}" has no qualifyWith schema`,[{path:["property"],message:`"${t.attribute}" has no qualifyWith`}]);let s=a.definitions.find(u=>u.name===t.property);if(!s)throw new h(`Property "${t.property}" not defined on "${t.attribute}".qualifyWith()`,[{path:["property"],message:`Unknown property: ${t.property}`}]);let l=st(t.operator,s.type,"property");R(t,l,s.type);}a(ue,"validateQualifiedRule");var N=["skill","memory","drives","artifact","meeting"];function Br(t){return N.includes(t)}a(Br,"isNativeObjectName");var j=["workspace","private"],ut=["all",...j];function Jr(t){if(typeof t=="string"&&j.includes(t))return t;throw new h(`visibility must be one of: ${j.join(", ")} (received: ${String(t)})`,[])}a(Jr,"parseResourceVisibility");var pe=["id","createdAt","updatedAt","createdBy","lastUpdatedBy","visibility","ownedBy"],zr=[...pe,"objectId","label","embeddingText","values","metadata","deletedAt","deletedBy","schemaVersion","owned_by"],Wr=N;var pt=64,ct=1e4;function dt(t){let r=Object.getPrototypeOf(t);return r===Object.prototype||r===null}a(dt,"isPlainJsonObject");function m(t,r,n=[]){t.addIssue({code:"custom",message:r,path:n});}a(m,"addJsonIssue");function de(t,r,n,i){for(let a of Reflect.ownKeys(t))if(a!=="length"){if(a==="__proto__"){m(i,"The __proto__ key is not allowed in custom props",[...r.path,a]);continue}(typeof a=="symbol"||!/^(0|[1-9]\d*)$/.test(a))&&m(i,"Arrays cannot contain non-index JSON properties",[...r.path,a]);}for(let a=t.length-1;a>=0;a--){let s=Object.getOwnPropertyDescriptor(t,String(a)),l=[...r.path,a];if(!(s&&"value"in s)){m(i,"Sparse arrays are not valid JSON values",l);continue}n.push({kind:"enter",value:s.value,path:l,depth:r.depth+1});}}a(de,"pushJsonArrayChildren");function me(t,r,n,i){let a=Reflect.ownKeys(t);for(let s=a.length-1;s>=0;s--){let l=a[s],u=[...r.path,l];if(l==="__proto__"){m(i,"The __proto__ key is not allowed in custom props",u);continue}if(typeof l=="symbol"){m(i,"Symbol keys are not valid JSON keys",u);continue}let p=Object.getOwnPropertyDescriptor(t,l);if(!(p?.enumerable&&"value"in p)){m(i,"Custom props must contain enumerable data properties only",u);continue}n.push({kind:"enter",value:p.value,path:u,depth:r.depth+1});}}a(me,"pushJsonObjectChildren");function ye(t,r){if(t===null||typeof t!="object"){m(r,"Expected a plain JSON object");return}try{if(Array.isArray(t)||!dt(t)){m(r,"Expected a plain JSON object");return}}catch{m(r,"Custom props contain an object that cannot be safely inspected");return}let n=new WeakSet,i=[{kind:"enter",value:t,path:[],depth:0}],a=0;for(;i.length>0;){let s=i.pop();if(!s)break;if(s.kind==="exit"){n.delete(s.value);continue}if(a++,a>ct){m(r,`Custom props cannot exceed ${ct.toLocaleString("en-US")} total JSON nodes`,s.path);return}if(s.depth>pt){m(r,`Custom props cannot exceed depth ${pt}`,s.path);continue}let l=s.value;if(!(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"&&Number.isFinite(l))){if(typeof l!="object"){m(r,"Expected a JSON value",s.path);continue}if(n.has(l)){m(r,"Custom props cannot contain circular references",s.path);continue}try{if(Array.isArray(l)){n.add(l),i.push({kind:"exit",value:l}),de(l,s,i,r);continue}if(!dt(l)){m(r,"Expected an array or plain JSON object",s.path);continue}n.add(l),i.push({kind:"exit",value:l}),me(l,s,i,r);}catch{m(r,"Custom props contain an object that cannot be safely inspected",s.path);}}}}a(ye,"validateJsonProps");var mt=z$1.unknown().superRefine(ye).transform(t=>t);var io=z$1.array(z$1.string()).max(c.columnsPerTab),be=z$1.array(z$1.string().min(1)).max(c.columnsPerTab).refine(t=>new Set(t).size===t.length,{message:"Displayed attribute names must be unique"}),fe=z$1.object({attribute:z$1.string(),direction:z$1.enum(["asc","desc"])}).strict(),_e=z$1.array(fe).max(c.sortsPerTab),he=z$1.object({amount:z$1.number(),unit:z$1.enum(["days","weeks","months","years"]),direction:z$1.enum(["past","future"])}).strict(),ge=z$1.object({value:z$1.number().nullable(),code:z$1.array(z$1.string()).optional()}).strict(),Ae=z$1.object({phoneNumber:z$1.string().nullable(),countryCode:z$1.string().optional()}).strict(),Se=z$1.discriminatedUnion("dynamic",[z$1.object({dynamic:z$1.literal("actor"),ref:z$1.literal("current")}).strict(),z$1.object({dynamic:z$1.literal("date"),anchor:z$1.enum(["today","now"])}).strict()]),Ee=z$1.object({month:z$1.number(),day:z$1.number()}).strict(),Re=z$1.union([z$1.string(),z$1.number(),z$1.boolean(),z$1.array(z$1.string()),he,ge,Ae,Ee,Se,z$1.null()]),Te=z$1.enum(["is","is_not","contains","not_contains","starts_with","ends_with","is_empty","is_not_empty","less_than","greater_than","less_or_equal","greater_or_equal","is_within","on_day_month","any_of","none_of"],{error:a(t=>{let r=t.input,n=typeof r=="string"?k[r]:void 0;return n?`Unknown filter operator "${r}" \u2014 use ${n}`:void 0},"error")}),Oe=z$1.object({attribute:z$1.string(),property:z$1.string().optional(),quantifier:z$1.enum(["any","none"]).optional(),operator:Te,value:Re}).strict(),xe=z$1.array(Oe).max(c.filterRulesPerTab),Fe=z$1.object({combinator:z$1.enum(["and","or"]),rules:xe}).strict(),we={span:z$1.union([z$1.literal(1),z$1.literal(2),z$1.literal(3),z$1.literal(4),z$1.literal(5),z$1.literal(6),z$1.literal(7),z$1.literal(8),z$1.literal(9),z$1.literal(10),z$1.literal(11),z$1.literal(12)]).optional(),label:z$1.string().optional(),readOnly:z$1.boolean().optional()},Ce=z$1.object({attribute:z$1.string(),...we}).strict(),Ie=z$1.object({name:z$1.string(),label:z$1.string(),description:z$1.string().optional(),collapsible:z$1.boolean().optional(),collapsed:z$1.boolean().optional(),fields:z$1.array(Ce).max(c.fieldsPerGroup)}).strict();function yt(t,r){t.groups.reduce((s,l)=>s+l.fields.length,0)>c.fieldsPerFormTab&&r.addIssue({code:"too_big",origin:"array",maximum:c.fieldsPerFormTab,inclusive:true,message:`A form content can contain at most ${c.fieldsPerFormTab} fields`,path:["groups"]});let i=new Set,a=new Set;t.groups.forEach((s,l)=>{i.has(s.name)&&r.addIssue({code:"custom",message:`Duplicate group name "${s.name}"`,path:["groups",l,"name"]}),i.add(s.name),s.fields.forEach((u,p)=>{a.has(u.attribute)&&r.addIssue({code:"custom",message:`Duplicate field attribute "${u.attribute}"`,path:["groups",l,"fields",p,"attribute"]}),a.add(u.attribute);});});}a(yt,"refineFormContent");var y={name:z$1.string(),label:z$1.string().optional(),icon:e.optional(),placement:z$1.enum(["main","aside"])},bt=z$1.object({object:z$1.string().optional(),relation:z$1.string().optional()}).strict().superRefine((t,r)=>{t.object===void 0==(t.relation===void 0)&&r.addIssue({code:"custom",message:"Collection source must define exactly one of object or relation"});}).transform(t=>t.object===void 0?{relation:t.relation}:{object:t.object}),M={...y,type:z$1.literal("collection"),source:bt,visibility:z$1.enum(ut).optional(),columns:z$1.array(z$1.union([z$1.string(),z$1.object({relationProperty:z$1.string().refine(t=>t.trim().length>0)}).strict()])).max(c.columnsPerTab).optional(),descriptionAttribute:z$1.string().optional(),displayAttributes:be.optional(),filters:Fe.optional(),sorts:_e.optional(),actions:z$1.enum(["create","update","delete","attach","detach"]).array().optional(),openMode:z$1.enum(["page","peek"]).optional(),createMode:z$1.enum(["page","peek","inline"]).optional()},De=z$1.discriminatedUnion("layout",[z$1.object({...M,layout:z$1.literal("table"),columnSizing:z$1.record(z$1.string(),z$1.number()).optional()}).strict(),z$1.object({...M,layout:z$1.literal("list"),columnSizing:z$1.record(z$1.string(),z$1.number()).optional()}).strict(),z$1.object({...M,layout:z$1.literal("kanban"),groupByAttribute:z$1.string(),kanbanColumnOrder:z$1.array(z$1.string()).optional(),kanbanColumnVisibility:z$1.record(z$1.string(),z$1.boolean()).optional(),kanbanPinnedColumns:z$1.array(z$1.string()).optional()}).strict()]),L={...y,type:z$1.literal("form"),groups:z$1.array(Ie).max(c.groupsPerFormTab),formColumns:z$1.union([z$1.literal(1),z$1.literal(2),z$1.literal(3)]).optional(),density:z$1.enum(["compact","comfortable","spacious"]).optional()},Ve=z$1.object(L).strict().superRefine(yt),ve=z$1.object({...L,groups:L.groups.min(1,"A published form content requires at least one group")}).strict().superRefine(yt),ft=[De,z$1.object({...y,type:z$1.literal("custom"),extension:z$1.string(),parameters:z$1.lazy(()=>mt).optional()}).strict(),z$1.object({...y,type:z$1.literal("activity")}).strict(),z$1.object({...y,type:z$1.literal("richtext"),attribute:z$1.string(),titleAttribute:z$1.string().optional()}).strict(),z$1.object({...y,type:z$1.literal("documents"),allowUpload:z$1.boolean().optional(),allowRemove:z$1.boolean().optional(),hideAttachments:z$1.boolean().optional(),relations:z$1.array(z$1.string()).optional()}).strict(),z$1.object({...y,type:z$1.literal("forms"),objectName:z$1.string().optional()}).strict(),z$1.object({...y,type:z$1.literal("emails"),emailAttributes:z$1.array(z$1.string()).max(c.emailAttributesPerTab)}).strict(),z$1.object({...y,type:z$1.literal("meetings"),emailAttributes:z$1.array(z$1.string()).max(c.emailAttributesPerTab)}).strict()],Pe=z$1.discriminatedUnion("type",[Ve,...ft]),_t=z$1.discriminatedUnion("type",[ve,...ft]),ht={object:z$1.string(),name:z$1.string(),label:z$1.string(),description:z$1.string().optional(),icon:e.optional(),context:z$1.enum(["collection","record"]),default:z$1.boolean().optional()},ke=z$1.object({...ht,contents:z$1.array(Pe).max(c.tabsPerView)}).strict(),Ne=z$1.object({...ht,contents:z$1.array(_t).max(c.tabsPerView)}).strict();function gt(t,r){let n=new Set;t.contents.forEach((i,a)=>{n.has(i.name)&&r.addIssue({code:"custom",message:`Duplicate content name "${i.name}"`,path:["contents",a,"name"]}),n.add(i.name);});}a(gt,"addDuplicateContentNameIssues");var je=ke.superRefine(gt),Me=Ne.superRefine((t,r)=>{gt(t,r),t.contents.some(n=>n.placement==="main")||r.addIssue({code:"custom",message:"A published view requires at least one main content",path:["contents"]});});export{_e as $,pe as A,zr as B,Wr as C,E as D,rr as E,or as F,nr as G,et as H,sr as I,pr as J,cr as K,dr as L,ot as M,nt as N,Zt as O,I as P,Er as Q,D as R,Or as S,xr as T,Fr as U,ne as V,k as W,jr as X,ue as Y,io as Z,be as _,Rt as a,Fe as aa,Le as b,bt as ba,Tt as c,_t as ca,Be as d,je as da,J as e,Me as ea,x as f,F as g,Ye as h,b as i,g as j,H as k,Je as l,ze as m,We as n,Ke as o,Ge as p,w as q,f as r,Kt as s,Z as t,Ze as u,N as v,Br as w,j as x,ut as y,Jr as z};
@@ -1,2 +1,2 @@
1
- export { J as AccessDeniedError, Q as AttributeInUseError, W as AttributeNotFoundError, X as AttributeUsage, _ as ChangeTypeNotSupportedError, a6 as ConcurrentModificationError, a9 as DestructiveSyncNotAllowedError, aa as DuplicateError, ab as ForbiddenError, ac as MemoryNotFoundError, ad as MigrationTimeoutError, af as NotFoundError, ag as NotImplementedError, ai as ObjectNotFoundError, aj as ObjectReferencedError, al as OrphanSystemAttributeError, an as ProtectedResourceError, ao as ProtectedRoleError, aq as RecordNotFoundError, ar as RecordReference, as as RecordReferencedError, at as RepositoryError, au as RepositoryOperation, av as ReservedObjectNameError, ax as RoleNotFoundError, ay as SchemaError, az as SchemaErrorCode, aB as SchemaPlanNotFoundError, aC as SearchBackendError, aE as StorageError, aF as StorageOperation, aG as SyncCascadeError, aH as SyncConflictError, aI as SyncError, aJ as SystemEntityImmutableError, V as ValidationError, aL as ValidationErrorDetail, aU as isAttributeInUseError, aX as isNotFoundError, aY as isObjectReferencedError, aZ as isProtectedResourceError, a_ as isRecordReferencedError, a$ as isSchemaError, b1 as isValidationError } from './attributes-cBtnsK8O.mjs';
1
+ export { J as AccessDeniedError, Q as AttributeInUseError, W as AttributeNotFoundError, X as AttributeUsage, _ as ChangeTypeNotSupportedError, a6 as ConcurrentModificationError, a9 as DestructiveSyncNotAllowedError, aa as DuplicateError, ab as ForbiddenError, ac as MemoryNotFoundError, ad as MigrationTimeoutError, af as NotFoundError, ag as NotImplementedError, ai as ObjectNotFoundError, aj as ObjectReferencedError, al as OrphanSystemAttributeError, an as ProtectedResourceError, ao as ProtectedRoleError, aq as RecordNotFoundError, ar as RecordReference, as as RecordReferencedError, at as RepositoryError, au as RepositoryOperation, av as ReservedObjectNameError, ax as RoleNotFoundError, ay as SchemaError, az as SchemaErrorCode, aB as SchemaPlanNotFoundError, aC as SearchBackendError, aE as StorageError, aF as StorageOperation, aG as SyncCascadeError, aH as SyncConflictError, aI as SyncError, aJ as SystemEntityImmutableError, V as ValidationError, aL as ValidationErrorDetail, aU as isAttributeInUseError, aX as isNotFoundError, aY as isObjectReferencedError, aZ as isProtectedResourceError, a_ as isRecordReferencedError, a$ as isSchemaError, b1 as isValidationError } from './attributes-2ELU4S-n.mjs';
2
2
  import '@stndrds/constants';
@@ -1,2 +1,2 @@
1
- export { J as AccessDeniedError, Q as AttributeInUseError, W as AttributeNotFoundError, X as AttributeUsage, _ as ChangeTypeNotSupportedError, a6 as ConcurrentModificationError, a9 as DestructiveSyncNotAllowedError, aa as DuplicateError, ab as ForbiddenError, ac as MemoryNotFoundError, ad as MigrationTimeoutError, af as NotFoundError, ag as NotImplementedError, ai as ObjectNotFoundError, aj as ObjectReferencedError, al as OrphanSystemAttributeError, an as ProtectedResourceError, ao as ProtectedRoleError, aq as RecordNotFoundError, ar as RecordReference, as as RecordReferencedError, at as RepositoryError, au as RepositoryOperation, av as ReservedObjectNameError, ax as RoleNotFoundError, ay as SchemaError, az as SchemaErrorCode, aB as SchemaPlanNotFoundError, aC as SearchBackendError, aE as StorageError, aF as StorageOperation, aG as SyncCascadeError, aH as SyncConflictError, aI as SyncError, aJ as SystemEntityImmutableError, V as ValidationError, aL as ValidationErrorDetail, aU as isAttributeInUseError, aX as isNotFoundError, aY as isObjectReferencedError, aZ as isProtectedResourceError, a_ as isRecordReferencedError, a$ as isSchemaError, b1 as isValidationError } from './attributes-cBtnsK8O.js';
1
+ export { J as AccessDeniedError, Q as AttributeInUseError, W as AttributeNotFoundError, X as AttributeUsage, _ as ChangeTypeNotSupportedError, a6 as ConcurrentModificationError, a9 as DestructiveSyncNotAllowedError, aa as DuplicateError, ab as ForbiddenError, ac as MemoryNotFoundError, ad as MigrationTimeoutError, af as NotFoundError, ag as NotImplementedError, ai as ObjectNotFoundError, aj as ObjectReferencedError, al as OrphanSystemAttributeError, an as ProtectedResourceError, ao as ProtectedRoleError, aq as RecordNotFoundError, ar as RecordReference, as as RecordReferencedError, at as RepositoryError, au as RepositoryOperation, av as ReservedObjectNameError, ax as RoleNotFoundError, ay as SchemaError, az as SchemaErrorCode, aB as SchemaPlanNotFoundError, aC as SearchBackendError, aE as StorageError, aF as StorageOperation, aG as SyncCascadeError, aH as SyncConflictError, aI as SyncError, aJ as SystemEntityImmutableError, V as ValidationError, aL as ValidationErrorDetail, aU as isAttributeInUseError, aX as isNotFoundError, aY as isObjectReferencedError, aZ as isProtectedResourceError, a_ as isRecordReferencedError, a$ as isSchemaError, b1 as isValidationError } from './attributes-2ELU4S-n.js';
2
2
  import '@stndrds/constants';
@@ -1,5 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { g as Uuid, A as Attribute, h as MigrationDefinition } from './attributes-2ELU4S-n.js';
3
+ import { V as ValidationMessages, a as ValidationResult } from './types-DjTB_kVH.js';
1
4
  import { IconName } from '@stndrds/constants';
2
- import { g as Uuid, A as Attribute, h as MigrationDefinition } from './attributes-cBtnsK8O.js';
3
5
 
4
6
  interface DocumentLayout {
5
7
  /** Named sub-folders auto-created at the top of the record's drive when first used via attach --variant. */
@@ -246,4 +248,74 @@ type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
246
248
  declare const RESERVED_OBJECT_NAMES: readonly ["skill", "memory", "drives", "artifact", "meeting"];
247
249
  type ReservedObjectName = (typeof RESERVED_OBJECT_NAMES)[number];
248
250
 
249
- export { type DocumentLayout as D, type FolderPreset as F, type ListViewTabVisibility as L, MAX_PRESET_DEPTH as M, type ObjectDefinition as O, type PresetNode as P, type ResourceVisibility as R, SYSTEM_FIELD_NAMES as S, type Timestamps as T, type ObjectRecord as a, type DocumentLayoutVariant as b, LIST_VIEW_TAB_VISIBILITIES as c, type ObjectAttribute as d, RESERVED_ATTRIBUTE_NAMES as e, RESERVED_OBJECT_NAMES as f, RESOURCE_VISIBILITIES as g, type ReservedAttributeName as h, type ReservedObjectName as i, type SystemFieldName as j, parseResourceVisibility as p };
251
+ /**
252
+ * Create a Zod schema for any attribute type.
253
+ * Returns a strict validator that does NOT handle optional fields.
254
+ * Use createFormAttributeValidator for form validation with optional support.
255
+ *
256
+ * @param attr - The attribute to create a validator for
257
+ * @param messages - Custom validation messages for i18n support
258
+ */
259
+ declare function createAttributeValidator(attr: Attribute, messages?: ValidationMessages): z.ZodTypeAny;
260
+ /**
261
+ * Create a Zod schema for form validation.
262
+ * - Normalizes empty values (empty strings, empty objects) to null for optional fields
263
+ * - Accepts custom messages for i18n support
264
+ *
265
+ * Use this in UI forms where optional fields may have null/undefined values.
266
+ *
267
+ * @param attr - The attribute to create a validator for
268
+ * @param messages - Custom validation messages for i18n support
269
+ */
270
+ declare function createFormAttributeValidator(attr: Attribute, messages?: ValidationMessages): z.ZodTypeAny;
271
+
272
+ /**
273
+ * Validate data against an attribute schema
274
+ */
275
+ declare function validateAttribute(attr: Attribute, value: unknown): ValidationResult;
276
+ /**
277
+ * Validate data against an object schema
278
+ */
279
+ declare function validateObject(objectDef: ObjectDefinition, data: Record<string, unknown>): ValidationResult;
280
+ /**
281
+ * Validate and throw if invalid.
282
+ *
283
+ * Throws `ValidationError` (code `SCHEMA_VALIDATION_FAILED`) on failure so HTTP
284
+ * adapters can map it to 400. Generic `Error` would bubble up to a 500.
285
+ */
286
+ declare function validateObjectOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): Record<string, unknown>;
287
+ /**
288
+ * Validate data in draft mode.
289
+ * - All attributes are treated as optional (no required validation)
290
+ * - Provided values are still validated for format/type correctness
291
+ */
292
+ declare function validateDraft(objectDef: ObjectDefinition, data: Record<string, unknown>): ValidationResult;
293
+ /**
294
+ * Validate draft data and throw if format validation fails.
295
+ *
296
+ * Same contract as `validateObjectOrThrow` but skips `required()` checks.
297
+ * Throws `ValidationError` so HTTP adapters map it to 400.
298
+ */
299
+ declare function validateDraftOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): Record<string, unknown>;
300
+ /**
301
+ * Throw a `ValidationError` when `data` contains keys that do not correspond
302
+ * to any attribute declared on `objectDef`.
303
+ *
304
+ * Call this on **client-supplied input** before Zod validation so the error
305
+ * message clearly names every offending key. Do NOT call on merged data that
306
+ * includes existing record values — older records may legitimately carry stale
307
+ * keys that predate this guard (see issue #658).
308
+ *
309
+ * Maps to HTTP 400 via `SchemaExceptionFilter` (code SCHEMA_VALIDATION_FAILED).
310
+ */
311
+ declare function rejectUnknownAttributesOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): void;
312
+ /**
313
+ * Get the list of required attributes that are missing values.
314
+ */
315
+ declare function getMissingRequiredAttributes(objectDef: ObjectDefinition, data: Record<string, unknown>): Attribute[];
316
+ /**
317
+ * Check if a record is complete (all required attributes have valid values).
318
+ */
319
+ declare function isRecordComplete(objectDef: ObjectDefinition, data: Record<string, unknown>): boolean;
320
+
321
+ export { type DocumentLayout as D, type FolderPreset as F, type ListViewTabVisibility as L, MAX_PRESET_DEPTH as M, type ObjectDefinition as O, type PresetNode as P, type ResourceVisibility as R, SYSTEM_FIELD_NAMES as S, type Timestamps as T, createFormAttributeValidator as a, validateDraft as b, createAttributeValidator as c, validateDraftOrThrow as d, validateObject as e, validateObjectOrThrow as f, getMissingRequiredAttributes as g, type ObjectRecord as h, isRecordComplete as i, type DocumentLayoutVariant as j, LIST_VIEW_TAB_VISIBILITIES as k, type ObjectAttribute as l, RESERVED_ATTRIBUTE_NAMES as m, RESERVED_OBJECT_NAMES as n, RESOURCE_VISIBILITIES as o, type ReservedAttributeName as p, type ReservedObjectName as q, rejectUnknownAttributesOrThrow as r, type SystemFieldName as s, parseResourceVisibility as t, validateAttribute as v };
@@ -1,5 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { g as Uuid, A as Attribute, h as MigrationDefinition } from './attributes-2ELU4S-n.mjs';
3
+ import { V as ValidationMessages, a as ValidationResult } from './types-DFs7mc3G.mjs';
1
4
  import { IconName } from '@stndrds/constants';
2
- import { g as Uuid, A as Attribute, h as MigrationDefinition } from './attributes-cBtnsK8O.mjs';
3
5
 
4
6
  interface DocumentLayout {
5
7
  /** Named sub-folders auto-created at the top of the record's drive when first used via attach --variant. */
@@ -246,4 +248,74 @@ type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
246
248
  declare const RESERVED_OBJECT_NAMES: readonly ["skill", "memory", "drives", "artifact", "meeting"];
247
249
  type ReservedObjectName = (typeof RESERVED_OBJECT_NAMES)[number];
248
250
 
249
- export { type DocumentLayout as D, type FolderPreset as F, type ListViewTabVisibility as L, MAX_PRESET_DEPTH as M, type ObjectDefinition as O, type PresetNode as P, type ResourceVisibility as R, SYSTEM_FIELD_NAMES as S, type Timestamps as T, type ObjectRecord as a, type DocumentLayoutVariant as b, LIST_VIEW_TAB_VISIBILITIES as c, type ObjectAttribute as d, RESERVED_ATTRIBUTE_NAMES as e, RESERVED_OBJECT_NAMES as f, RESOURCE_VISIBILITIES as g, type ReservedAttributeName as h, type ReservedObjectName as i, type SystemFieldName as j, parseResourceVisibility as p };
251
+ /**
252
+ * Create a Zod schema for any attribute type.
253
+ * Returns a strict validator that does NOT handle optional fields.
254
+ * Use createFormAttributeValidator for form validation with optional support.
255
+ *
256
+ * @param attr - The attribute to create a validator for
257
+ * @param messages - Custom validation messages for i18n support
258
+ */
259
+ declare function createAttributeValidator(attr: Attribute, messages?: ValidationMessages): z.ZodTypeAny;
260
+ /**
261
+ * Create a Zod schema for form validation.
262
+ * - Normalizes empty values (empty strings, empty objects) to null for optional fields
263
+ * - Accepts custom messages for i18n support
264
+ *
265
+ * Use this in UI forms where optional fields may have null/undefined values.
266
+ *
267
+ * @param attr - The attribute to create a validator for
268
+ * @param messages - Custom validation messages for i18n support
269
+ */
270
+ declare function createFormAttributeValidator(attr: Attribute, messages?: ValidationMessages): z.ZodTypeAny;
271
+
272
+ /**
273
+ * Validate data against an attribute schema
274
+ */
275
+ declare function validateAttribute(attr: Attribute, value: unknown): ValidationResult;
276
+ /**
277
+ * Validate data against an object schema
278
+ */
279
+ declare function validateObject(objectDef: ObjectDefinition, data: Record<string, unknown>): ValidationResult;
280
+ /**
281
+ * Validate and throw if invalid.
282
+ *
283
+ * Throws `ValidationError` (code `SCHEMA_VALIDATION_FAILED`) on failure so HTTP
284
+ * adapters can map it to 400. Generic `Error` would bubble up to a 500.
285
+ */
286
+ declare function validateObjectOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): Record<string, unknown>;
287
+ /**
288
+ * Validate data in draft mode.
289
+ * - All attributes are treated as optional (no required validation)
290
+ * - Provided values are still validated for format/type correctness
291
+ */
292
+ declare function validateDraft(objectDef: ObjectDefinition, data: Record<string, unknown>): ValidationResult;
293
+ /**
294
+ * Validate draft data and throw if format validation fails.
295
+ *
296
+ * Same contract as `validateObjectOrThrow` but skips `required()` checks.
297
+ * Throws `ValidationError` so HTTP adapters map it to 400.
298
+ */
299
+ declare function validateDraftOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): Record<string, unknown>;
300
+ /**
301
+ * Throw a `ValidationError` when `data` contains keys that do not correspond
302
+ * to any attribute declared on `objectDef`.
303
+ *
304
+ * Call this on **client-supplied input** before Zod validation so the error
305
+ * message clearly names every offending key. Do NOT call on merged data that
306
+ * includes existing record values — older records may legitimately carry stale
307
+ * keys that predate this guard (see issue #658).
308
+ *
309
+ * Maps to HTTP 400 via `SchemaExceptionFilter` (code SCHEMA_VALIDATION_FAILED).
310
+ */
311
+ declare function rejectUnknownAttributesOrThrow(objectDef: ObjectDefinition, data: Record<string, unknown>): void;
312
+ /**
313
+ * Get the list of required attributes that are missing values.
314
+ */
315
+ declare function getMissingRequiredAttributes(objectDef: ObjectDefinition, data: Record<string, unknown>): Attribute[];
316
+ /**
317
+ * Check if a record is complete (all required attributes have valid values).
318
+ */
319
+ declare function isRecordComplete(objectDef: ObjectDefinition, data: Record<string, unknown>): boolean;
320
+
321
+ export { type DocumentLayout as D, type FolderPreset as F, type ListViewTabVisibility as L, MAX_PRESET_DEPTH as M, type ObjectDefinition as O, type PresetNode as P, type ResourceVisibility as R, SYSTEM_FIELD_NAMES as S, type Timestamps as T, createFormAttributeValidator as a, validateDraft as b, createAttributeValidator as c, validateDraftOrThrow as d, validateObject as e, validateObjectOrThrow as f, getMissingRequiredAttributes as g, type ObjectRecord as h, isRecordComplete as i, type DocumentLayoutVariant as j, LIST_VIEW_TAB_VISIBILITIES as k, type ObjectAttribute as l, RESERVED_ATTRIBUTE_NAMES as m, RESERVED_OBJECT_NAMES as n, RESOURCE_VISIBILITIES as o, type ReservedAttributeName as p, type ReservedObjectName as q, rejectUnknownAttributesOrThrow as r, type SystemFieldName as s, parseResourceVisibility as t, validateAttribute as v };