var{defineProperty:x,getOwnPropertyNames:C,getOwnPropertyDescriptor:E}=Object,F=Object.prototype.hasOwnProperty;function G(b){return this[b]}var L=(b)=>{var j=(B??=new WeakMap).get(b),q;if(j)return j;if(j=x({},"__esModule",{value:!0}),b&&typeof b==="object"||typeof b==="function"){for(var w of C(b))if(!F.call(j,w))x(j,w,{get:G.bind(b,w),enumerable:!(q=E(b,w))||q.enumerable})}return B.set(b,j),j},B;var H=(b)=>b;function I(b,j){this[b]=H.bind(null,j)}var O=(b,j)=>{for(var q in j)x(b,q,{get:j[q],enumerable:!0,configurable:!0,set:I.bind(j,q)})};var P=(b,j)=>()=>(b&&(j=b(b=0)),j);function J(b){return typeof b==="object"&&b!==null&&"kind"in b&&b.kind==="resource_ref"}function K(b){if(!b)return"unknown";if(typeof b==="string")return b;if(typeof b==="object"){if("config"in b&&b.config?.name)return b.config.name;if("name"in b&&typeof b.name==="string")return b.name}return"unknown"}function A(b){if(!b)return null;if(J(b))return{name:`ResourceRef<${b.graphQLType}>`,description:`Reference to ${b.graphQLType} resource (${b.uriTemplate})`,fields:{}};if("config"in b&&b.config){let j=b.config;return{name:j.name,description:j.description,fields:Object.fromEntries(Object.entries(j.fields).map(([q,w])=>[q,{typeName:K(w.type),isOptional:w.isOptional,isArray:w.isArray}]))}}return{name:"unknown",fields:{}}}function U(b){if(!b)return null;return{meta:{key:b.meta.key,version:b.meta.version,stability:b.meta.stability,owners:b.meta.owners,tags:b.meta.tags,description:b.meta.description,goal:b.meta.goal,context:b.meta.context},io:{input:A(b.io.input),output:A(b.io.output)},policy:b.policy?{auth:b.policy.auth}:void 0}}function V(b){if(!b)return null;return{meta:{key:b.meta.key,version:b.meta.version,stability:b.meta.stability,owners:b.meta.owners,tags:b.meta.tags,description:b.meta.description},payload:A(b.payload)}}function W(b){if(!b)return null;return{meta:{key:b.meta.key,version:b.meta.version,stability:b.meta.stability,owners:b.meta.owners,tags:b.meta.tags,description:b.meta.description,goal:b.meta.goal,context:b.meta.context},source:{type:b.source.type,framework:b.source.type==="component"?b.source.framework:void 0,componentKey:b.source.type==="component"?b.source.componentKey:void 0},targets:b.targets}}function X(b){if(!b)return null;return{meta:{key:b.meta.key,version:b.meta.version,stability:b.meta.stability,owners:b.meta.owners,tags:b.meta.tags,description:b.meta.description,title:b.meta.title},source:b.source,view:b.view}}function Y(b){if(!b)return null;return{meta:{key:b.meta.key,version:b.meta.version,stability:b.meta.stability,owners:b.meta.owners,tags:b.meta.tags,description:b.meta.description,title:b.meta.title},fields:b.fields,actions:b.actions}}export{A as serializeSchemaModel,W as serializePresentationSpec,U as serializeOperationSpec,Y as serializeFormSpec,V as serializeEventSpec,X as serializeDataViewSpec};
