// @bun
var{defineProperty:C,getOwnPropertyNames:E,getOwnPropertyDescriptor:F}=Object,G=Object.prototype.hasOwnProperty;function H(q){return this[q]}var L=(q)=>{var w=(D??=new WeakMap).get(q),z;if(w)return w;if(w=C({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function"){for(var B of E(q))if(!G.call(w,B))C(w,B,{get:H.bind(q,B),enumerable:!(z=F(q,B))||z.enumerable})}return D.set(q,w),w},D;var I=(q)=>q;function J(q,w){this[q]=I.bind(null,w)}var M=(q,w)=>{for(var z in w)C(q,z,{get:w[z],enumerable:!0,configurable:!0,set:J.bind(w,z)})};var N=(q,w)=>()=>(q&&(w=q(q=0)),w);function Q(q){return typeof q==="object"&&q!==null&&"key"in q&&typeof q.key==="string"&&q.key.length>0&&"version"in q&&typeof q.version==="string"&&q.version.length>0}function T(q){if(typeof q!=="object"||q===null)return!1;if(!("key"in q))return!1;if(typeof q.key!=="string"||q.key.length===0)return!1;if("version"in q&&q.version!=null)return typeof q.version==="string";return!0}function U(q){return typeof q==="object"&&q!==null&&"key"in q&&typeof q.key==="string"&&q.key.length>0}function W(q,w){if(!q||q.trim().length===0)throw Error("Spec key cannot be empty");if(!w||w.trim().length===0)throw Error("Spec version cannot be empty");return{key:q.trim(),version:w.trim()}}function X(q,w){if(!q||q.trim().length===0)throw Error("Spec key cannot be empty");let z={key:q.trim()};if(w!=null&&w.trim().length>0)z.version=w.trim();return z}function Y(q){if(!q||q.trim().length===0)throw Error("Spec key cannot be empty");return{key:q.trim()}}function Z(q){return`${q.key}.v${q.version}`}function _(q){let w=q.match(/^(.+)\.v(\d+\.\d+\.\d+(?:-.+)?)$/);if(!w)return;let z=w[1],B=w[2];if(!z||!B)return;return{key:z,version:B}}export{_ as parseVersionedRefKey,Q as isVersionedSpecRef,U as isSpecKeyRef,T as isOptionalVersionedSpecRef,Z as formatVersionedRefKey,W as createVersionedRef,X as createOptionalRef,Y as createKeyRef};
