@stndrds/schema 1.0.0-alpha.318 → 1.0.0-alpha.320

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.
@@ -186,12 +186,21 @@ type ContentPlacement = "main" | "aside";
186
186
  type CollectionAction = "create" | "update" | "delete" | "attach" | "detach";
187
187
  type ContentOpenMode = "page" | "peek";
188
188
  type ContentCreateMode = ContentOpenMode | "inline";
189
- type CollectionContentSource = {
189
+ type CollectionContentSource =
190
+ /** Every record of an object. */
191
+ {
190
192
  object: string;
191
193
  relation?: never;
192
- } | {
194
+ }
195
+ /** The records the host record points at, through its own relation. */
196
+ | {
193
197
  relation: string;
194
198
  object?: never;
199
+ }
200
+ /** The records that point at the host record, through their own relation. */
201
+ | {
202
+ object: string;
203
+ relation: string;
195
204
  };
196
205
  interface ContentField {
197
206
  attribute: string;
@@ -422,6 +431,9 @@ declare const collectionContentSourceSchema: z.ZodPipe<z.ZodObject<{
422
431
  } | {
423
432
  relation: string;
424
433
  object?: never;
434
+ } | {
435
+ object: string;
436
+ relation: string;
425
437
  }, {
426
438
  object?: string | undefined;
427
439
  relation?: string | undefined;
@@ -467,6 +479,9 @@ declare const publishedViewContentDefinitionSchema: z.ZodDiscriminatedUnion<[z.Z
467
479
  } | {
468
480
  relation: string;
469
481
  object?: never;
482
+ } | {
483
+ object: string;
484
+ relation: string;
470
485
  }, {
471
486
  object?: string | undefined;
472
487
  relation?: string | undefined;
@@ -587,6 +602,9 @@ declare const publishedViewContentDefinitionSchema: z.ZodDiscriminatedUnion<[z.Z
587
602
  } | {
588
603
  relation: string;
589
604
  object?: never;
605
+ } | {
606
+ object: string;
607
+ relation: string;
590
608
  }, {
591
609
  object?: string | undefined;
592
610
  relation?: string | undefined;
@@ -710,6 +728,9 @@ declare const publishedViewContentDefinitionSchema: z.ZodDiscriminatedUnion<[z.Z
710
728
  } | {
711
729
  relation: string;
712
730
  object?: never;
731
+ } | {
732
+ object: string;
733
+ relation: string;
713
734
  }, {
714
735
  object?: string | undefined;
715
736
  relation?: string | undefined;
@@ -934,6 +955,9 @@ declare const draftContentViewDefinitionSchema: z.ZodObject<{
934
955
  } | {
935
956
  relation: string;
936
957
  object?: never;
958
+ } | {
959
+ object: string;
960
+ relation: string;
937
961
  }, {
938
962
  object?: string | undefined;
939
963
  relation?: string | undefined;
@@ -1054,6 +1078,9 @@ declare const draftContentViewDefinitionSchema: z.ZodObject<{
1054
1078
  } | {
1055
1079
  relation: string;
1056
1080
  object?: never;
1081
+ } | {
1082
+ object: string;
1083
+ relation: string;
1057
1084
  }, {
1058
1085
  object?: string | undefined;
1059
1086
  relation?: string | undefined;
@@ -1177,6 +1204,9 @@ declare const draftContentViewDefinitionSchema: z.ZodObject<{
1177
1204
  } | {
1178
1205
  relation: string;
1179
1206
  object?: never;
1207
+ } | {
1208
+ object: string;
1209
+ relation: string;
1180
1210
  }, {
1181
1211
  object?: string | undefined;
1182
1212
  relation?: string | undefined;
@@ -1372,4 +1402,4 @@ declare const draftContentViewDefinitionSchema: z.ZodObject<{
1372
1402
  }, z.core.$strict>;
1373
1403
  declare const contentViewDefinitionSchema: z.ZodType<ContentViewDefinition>;
1374
1404
 
1375
- export { iconNameSchema as $, type ActivityContentDefinition as A, SCHEMA_LIMITS as B, type ContentViewDefinition as C, type DocumentsContentDefinition as D, type EdgeQuantifier as E, type FilterState as F, type SortDirection as G, type ViewRead as H, collectionContentSourceSchema as I, colorIdSchema as J, type KanbanCollectionContentDefinition as K, type ListCollectionContentDefinition as L, type MeetingsContentDefinition as M, NO_VALUE_OPERATORS as N, OPERATORS_BY_TYPE as O, type PhoneFilterValue as P, type QueryState as Q, type RichtextContentDefinition as R, type SortRule as S, type TableCollectionContentDefinition as T, columnsSchema as U, type ViewContentDefinition as V, contentViewDefinitionSchema as W, displayAttributesSchema as X, draftContentViewDefinitionSchema as Y, filterStateSchema as Z, getRollupFilterOperators as _, type FilterOperator as a, isNoValueOperator as a0, publishedViewContentDefinitionSchema as a1, sortsSchema as a2, type ContentViewContext as b, type ContentPlacement as c, type ColumnReference as d, type CollectionAction as e, type ContentOpenMode as f, type ContentCreateMode as g, type FormDensity as h, type ContentField as i, type ContentFieldGroup as j, type CollectionContentDefinition as k, type FormContentDefinition as l, type CustomContentDefinition as m, type FilterValue as n, type FilterRule as o, type DynamicValue as p, type RelativeDateValue as q, type CollectionContentSource as r, type CurrencyFilterValue as s, type DayMonthValue as t, type EmailsContentDefinition as u, type ExtendedFilterRule as v, type FilterCombinator as w, type FormsContentDefinition as x, type ListViewLayout as y, type NoValueOperator as z };
1405
+ export { iconNameSchema as $, type ActivityContentDefinition as A, SCHEMA_LIMITS as B, type ContentViewDefinition as C, type DocumentsContentDefinition as D, type EdgeQuantifier as E, type FilterState as F, type SortDirection as G, type ViewRead as H, collectionContentSourceSchema as I, colorIdSchema as J, type KanbanCollectionContentDefinition as K, type ListCollectionContentDefinition as L, type MeetingsContentDefinition as M, NO_VALUE_OPERATORS as N, OPERATORS_BY_TYPE as O, type PhoneFilterValue as P, type QueryState as Q, type RichtextContentDefinition as R, type SortRule as S, type TableCollectionContentDefinition as T, columnsSchema as U, type ViewContentDefinition as V, contentViewDefinitionSchema as W, displayAttributesSchema as X, draftContentViewDefinitionSchema as Y, filterStateSchema as Z, getRollupFilterOperators as _, type FilterOperator as a, isNoValueOperator as a0, publishedViewContentDefinitionSchema as a1, sortsSchema as a2, type ContentViewContext as b, type ContentPlacement as c, type ColumnReference as d, type CollectionAction as e, type ContentOpenMode as f, type ContentCreateMode as g, type FormDensity as h, type ContentField as i, type ContentFieldGroup as j, type CollectionContentDefinition as k, type FormContentDefinition as l, type CustomContentDefinition as m, type CollectionContentSource as n, type FilterValue as o, type FilterRule as p, type DynamicValue as q, type RelativeDateValue as r, type CurrencyFilterValue as s, type DayMonthValue as t, type EmailsContentDefinition as u, type ExtendedFilterRule as v, type FilterCombinator as w, type FormsContentDefinition as x, type ListViewLayout as y, type NoValueOperator as z };
@@ -186,12 +186,21 @@ type ContentPlacement = "main" | "aside";
186
186
  type CollectionAction = "create" | "update" | "delete" | "attach" | "detach";
187
187
  type ContentOpenMode = "page" | "peek";
188
188
  type ContentCreateMode = ContentOpenMode | "inline";
189
- type CollectionContentSource = {
189
+ type CollectionContentSource =
190
+ /** Every record of an object. */
191
+ {
190
192
  object: string;
191
193
  relation?: never;
192
- } | {
194
+ }
195
+ /** The records the host record points at, through its own relation. */
196
+ | {
193
197
  relation: string;
194
198
  object?: never;
199
+ }
200
+ /** The records that point at the host record, through their own relation. */
201
+ | {
202
+ object: string;
203
+ relation: string;
195
204
  };
196
205
  interface ContentField {
197
206
  attribute: string;
@@ -422,6 +431,9 @@ declare const collectionContentSourceSchema: z.ZodPipe<z.ZodObject<{
422
431
  } | {
423
432
  relation: string;
424
433
  object?: never;
434
+ } | {
435
+ object: string;
436
+ relation: string;
425
437
  }, {
426
438
  object?: string | undefined;
427
439
  relation?: string | undefined;
@@ -467,6 +479,9 @@ declare const publishedViewContentDefinitionSchema: z.ZodDiscriminatedUnion<[z.Z
467
479
  } | {
468
480
  relation: string;
469
481
  object?: never;
482
+ } | {
483
+ object: string;
484
+ relation: string;
470
485
  }, {
471
486
  object?: string | undefined;
472
487
  relation?: string | undefined;
@@ -587,6 +602,9 @@ declare const publishedViewContentDefinitionSchema: z.ZodDiscriminatedUnion<[z.Z
587
602
  } | {
588
603
  relation: string;
589
604
  object?: never;
605
+ } | {
606
+ object: string;
607
+ relation: string;
590
608
  }, {
591
609
  object?: string | undefined;
592
610
  relation?: string | undefined;
@@ -710,6 +728,9 @@ declare const publishedViewContentDefinitionSchema: z.ZodDiscriminatedUnion<[z.Z
710
728
  } | {
711
729
  relation: string;
712
730
  object?: never;
731
+ } | {
732
+ object: string;
733
+ relation: string;
713
734
  }, {
714
735
  object?: string | undefined;
715
736
  relation?: string | undefined;
@@ -934,6 +955,9 @@ declare const draftContentViewDefinitionSchema: z.ZodObject<{
934
955
  } | {
935
956
  relation: string;
936
957
  object?: never;
958
+ } | {
959
+ object: string;
960
+ relation: string;
937
961
  }, {
938
962
  object?: string | undefined;
939
963
  relation?: string | undefined;
@@ -1054,6 +1078,9 @@ declare const draftContentViewDefinitionSchema: z.ZodObject<{
1054
1078
  } | {
1055
1079
  relation: string;
1056
1080
  object?: never;
1081
+ } | {
1082
+ object: string;
1083
+ relation: string;
1057
1084
  }, {
1058
1085
  object?: string | undefined;
1059
1086
  relation?: string | undefined;
@@ -1177,6 +1204,9 @@ declare const draftContentViewDefinitionSchema: z.ZodObject<{
1177
1204
  } | {
1178
1205
  relation: string;
1179
1206
  object?: never;
1207
+ } | {
1208
+ object: string;
1209
+ relation: string;
1180
1210
  }, {
1181
1211
  object?: string | undefined;
1182
1212
  relation?: string | undefined;
@@ -1372,4 +1402,4 @@ declare const draftContentViewDefinitionSchema: z.ZodObject<{
1372
1402
  }, z.core.$strict>;
1373
1403
  declare const contentViewDefinitionSchema: z.ZodType<ContentViewDefinition>;
1374
1404
 
1375
- export { iconNameSchema as $, type ActivityContentDefinition as A, SCHEMA_LIMITS as B, type ContentViewDefinition as C, type DocumentsContentDefinition as D, type EdgeQuantifier as E, type FilterState as F, type SortDirection as G, type ViewRead as H, collectionContentSourceSchema as I, colorIdSchema as J, type KanbanCollectionContentDefinition as K, type ListCollectionContentDefinition as L, type MeetingsContentDefinition as M, NO_VALUE_OPERATORS as N, OPERATORS_BY_TYPE as O, type PhoneFilterValue as P, type QueryState as Q, type RichtextContentDefinition as R, type SortRule as S, type TableCollectionContentDefinition as T, columnsSchema as U, type ViewContentDefinition as V, contentViewDefinitionSchema as W, displayAttributesSchema as X, draftContentViewDefinitionSchema as Y, filterStateSchema as Z, getRollupFilterOperators as _, type FilterOperator as a, isNoValueOperator as a0, publishedViewContentDefinitionSchema as a1, sortsSchema as a2, type ContentViewContext as b, type ContentPlacement as c, type ColumnReference as d, type CollectionAction as e, type ContentOpenMode as f, type ContentCreateMode as g, type FormDensity as h, type ContentField as i, type ContentFieldGroup as j, type CollectionContentDefinition as k, type FormContentDefinition as l, type CustomContentDefinition as m, type FilterValue as n, type FilterRule as o, type DynamicValue as p, type RelativeDateValue as q, type CollectionContentSource as r, type CurrencyFilterValue as s, type DayMonthValue as t, type EmailsContentDefinition as u, type ExtendedFilterRule as v, type FilterCombinator as w, type FormsContentDefinition as x, type ListViewLayout as y, type NoValueOperator as z };
1405
+ export { iconNameSchema as $, type ActivityContentDefinition as A, SCHEMA_LIMITS as B, type ContentViewDefinition as C, type DocumentsContentDefinition as D, type EdgeQuantifier as E, type FilterState as F, type SortDirection as G, type ViewRead as H, collectionContentSourceSchema as I, colorIdSchema as J, type KanbanCollectionContentDefinition as K, type ListCollectionContentDefinition as L, type MeetingsContentDefinition as M, NO_VALUE_OPERATORS as N, OPERATORS_BY_TYPE as O, type PhoneFilterValue as P, type QueryState as Q, type RichtextContentDefinition as R, type SortRule as S, type TableCollectionContentDefinition as T, columnsSchema as U, type ViewContentDefinition as V, contentViewDefinitionSchema as W, displayAttributesSchema as X, draftContentViewDefinitionSchema as Y, filterStateSchema as Z, getRollupFilterOperators as _, type FilterOperator as a, isNoValueOperator as a0, publishedViewContentDefinitionSchema as a1, sortsSchema as a2, type ContentViewContext as b, type ContentPlacement as c, type ColumnReference as d, type CollectionAction as e, type ContentOpenMode as f, type ContentCreateMode as g, type FormDensity as h, type ContentField as i, type ContentFieldGroup as j, type CollectionContentDefinition as k, type FormContentDefinition as l, type CustomContentDefinition as m, type CollectionContentSource as n, type FilterValue as o, type FilterRule as p, type DynamicValue as q, type RelativeDateValue as r, type CurrencyFilterValue as s, type DayMonthValue as t, type EmailsContentDefinition as u, type ExtendedFilterRule as v, type FilterCombinator as w, type FormsContentDefinition as x, type ListViewLayout as y, type NoValueOperator as z };
@@ -1,2 +1,2 @@
1
1
  import {a as a$1,c}from'./chunk-QIDZFNGR.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(a$1.columnsPerTab),be=z$1.array(z$1.string().min(1)).max(a$1.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(a$1.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(a$1.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(a$1.fieldsPerGroup)}).strict();function yt(t,r){t.groups.reduce((s,l)=>s+l.fields.length,0)>a$1.fieldsPerFormTab&&r.addIssue({code:"too_big",origin:"array",maximum:a$1.fieldsPerFormTab,inclusive:true,message:`A form content can contain at most ${a$1.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:c.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(a$1.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(a$1.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(a$1.emailAttributesPerTab)}).strict(),z$1.object({...y,type:z$1.literal("meetings"),emailAttributes:z$1.array(z$1.string()).max(a$1.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:c.optional(),context:z$1.enum(["collection","record"]),default:z$1.boolean().optional()},ke=z$1.object({...ht,contents:z$1.array(Pe).max(a$1.tabsPerView)}).strict(),Ne=z$1.object({...ht,contents:z$1.array(_t).max(a$1.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};
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(a$1.columnsPerTab),be=z$1.array(z$1.string().min(1)).max(a$1.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(a$1.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(a$1.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(a$1.fieldsPerGroup)}).strict();function yt(t,r){t.groups.reduce((s,l)=>s+l.fields.length,0)>a$1.fieldsPerFormTab&&r.addIssue({code:"too_big",origin:"array",maximum:a$1.fieldsPerFormTab,inclusive:true,message:`A form content can contain at most ${a$1.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:c.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 an object, a relation, or both"});}).transform(t=>t.relation===void 0?{object:t.object}:t.object===void 0?{relation:t.relation}:{object:t.object,relation:t.relation}),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(a$1.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(a$1.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(a$1.emailAttributesPerTab)}).strict(),z$1.object({...y,type:z$1.literal("meetings"),emailAttributes:z$1.array(z$1.string()).max(a$1.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:c.optional(),context:z$1.enum(["collection","record"]),default:z$1.boolean().optional()},ke=z$1.object({...ht,contents:z$1.array(Pe).max(a$1.tabsPerView)}).strict(),Ne=z$1.object({...ht,contents:z$1.array(_t).max(a$1.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
1
  'use strict';var chunkHRX4YCKZ_js=require('./chunk-HRX4YCKZ.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(chunkHRX4YCKZ_js.a.columnsPerTab),be=zod.z.array(zod.z.string().min(1)).max(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.fieldsPerGroup)}).strict();function yt(t,r){t.groups.reduce((s,l)=>s+l.fields.length,0)>chunkHRX4YCKZ_js.a.fieldsPerFormTab&&r.addIssue({code:"too_big",origin:"array",maximum:chunkHRX4YCKZ_js.a.fieldsPerFormTab,inclusive:true,message:`A form content can contain at most ${chunkHRX4YCKZ_js.a.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:chunkHRX4YCKZ_js.c.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(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.emailAttributesPerTab)}).strict(),zod.z.object({...y,type:zod.z.literal("meetings"),emailAttributes:zod.z.array(zod.z.string()).max(chunkHRX4YCKZ_js.a.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:chunkHRX4YCKZ_js.c.optional(),context:zod.z.enum(["collection","record"]),default:zod.z.boolean().optional()},ke=zod.z.object({...ht,contents:zod.z.array(Pe).max(chunkHRX4YCKZ_js.a.tabsPerView)}).strict(),Ne=zod.z.object({...ht,contents:zod.z.array(_t).max(chunkHRX4YCKZ_js.a.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;
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(chunkHRX4YCKZ_js.a.columnsPerTab),be=zod.z.array(zod.z.string().min(1)).max(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.fieldsPerGroup)}).strict();function yt(t,r){t.groups.reduce((s,l)=>s+l.fields.length,0)>chunkHRX4YCKZ_js.a.fieldsPerFormTab&&r.addIssue({code:"too_big",origin:"array",maximum:chunkHRX4YCKZ_js.a.fieldsPerFormTab,inclusive:true,message:`A form content can contain at most ${chunkHRX4YCKZ_js.a.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:chunkHRX4YCKZ_js.c.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 an object, a relation, or both"});}).transform(t=>t.relation===void 0?{object:t.object}:t.object===void 0?{relation:t.relation}:{object:t.object,relation:t.relation}),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(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.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(chunkHRX4YCKZ_js.a.emailAttributesPerTab)}).strict(),zod.z.object({...y,type:zod.z.literal("meetings"),emailAttributes:zod.z.array(zod.z.string()).max(chunkHRX4YCKZ_js.a.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:chunkHRX4YCKZ_js.c.optional(),context:zod.z.enum(["collection","record"]),default:zod.z.boolean().optional()},ke=zod.z.object({...ht,contents:zod.z.array(Pe).max(chunkHRX4YCKZ_js.a.tabsPerView)}).strict(),Ne=zod.z.object({...ht,contents:zod.z.array(_t).max(chunkHRX4YCKZ_js.a.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;