"use strict";var x=Object.defineProperty;var _=(e,t,r)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var b=(e,t,r)=>_(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./index-CYxQwEdX.cjs"),O=require("./index-YsO0EMN8.cjs"),L=require("./change-C-YELKx6.cjs"),A=require("./scale-Dj7-5FQQ.cjs"),u=require("./index-h-QAL9T1.cjs"),l=require("zod"),M=require("./debounce.cjs"),P=require("./deep.cjs"),s=require("./series-CAP8K7YO.cjs"),Z=require("./identity.cjs"),C=require("./types-zRwnQ1hc.cjs"),j=require("./bounds-DzCDHgdE.cjs"),D=require("./observe.cjs"),E=require("./record.cjs"),G=require("./external-B3XSLDq5.cjs"),V=require("./search.cjs"),W=require("./box-BpSX4si6.cjs"),H=require("./dimensions-zMcb9pMk.cjs"),I=require("./direction-D7qoo_GJ.cjs"),Q=require("./location-DLP2ZS0o.cjs"),U=require("./position-JCN6-sJC.cjs"),B=require("./spatial-BOhaO8xN.cjs"),J=require("./xy-LADI2wVU.cjs"),k=require("./toArray.cjs"),K=require("./unique.cjs"),w=require("./url.cjs"),$=require("./worker.cjs"),F=require("./zodutil-BRjUdYAv.cjs"),d=class d extends Number{};b(d,"Absolute",255),b(d,"Default",1),b(d,"z",l.z.union([l.z.instanceof(d),l.z.number().int().min(0).max(255).transform(t=>new d(t)),l.z.instanceof(Number).transform(t=>new d(t))]));let h=d;const z=l.z.object({name:l.z.string(),key:l.z.string()}),X=e=>l.z.object({subject:z,resource:e,authority:h.z}),Y=(...e)=>t=>t.filter(r=>{let o=!1;return r.to!=null&&(o=e.includes(r.to.resource)),r.from!=null&&!o&&(o=e.includes(r.from.resource)),o}),ee=Object.freeze(Object.defineProperty({__proto__:null,Authority:h,filterTransfersByChannelKey:Y,stateZ:X,subjectZ:z},Symbol.toStringTag,{value:"Module"})),m=class m extends Error{constructor(){super(m.MESSAGE)}matches(t){return typeof t=="string"?t.includes(m.MESSAGE):t instanceof m||t.message.includes(m.MESSAGE)}};b(m,"MESSAGE","canceled");let T=m;const re=new T,te=Object.freeze(Object.defineProperty({__proto__:null,CANCELED:re},Symbol.toStringTag,{value:"Module"})),ne=e=>e?-1:1,q=l.z.string().regex(/^\d+\.\d+\.\d+$/),y=(e,t,r={})=>{r.checkMajor??(r.checkMajor=!0),r.checkMinor??(r.checkMinor=!0),r.checkPatch??(r.checkPatch=!0);const o=q.parse(e),c=q.parse(t),[f,g,p]=o.split(".").map(Number),[i,n,a]=c.split(".").map(Number);if(r.checkMajor){if(fi)return u.GREATER_THAN}if(r.checkMinor){if(gn)return u.GREATER_THAN}if(r.checkPatch){if(pa)return u.GREATER_THAN}return u.EQUAL},oe=(e,t,r={})=>u.isEqualTo(y(e,t,r)),R=(e,t,r={})=>u.isGreaterThan(y(e,t,r)),ie=(e,t,r={})=>u.isLessThan(y(e,t,r)),se=({name:e,migrate:t})=>r=>{try{const o=t(r);return console.log(`${e} migrated: ${r.version} -> ${o.version}`),o}catch(o){throw console.log(`${e} failed to migrate from ${r.version}`),console.error(o),o}},ce=({name:e,migrations:t,targetSchema:r,defaultVersion:o,def:c})=>{const f=Object.keys(t).sort(y).pop();if(f==null)return n=>{if(n.version??(n.version=o),n.version!==c.version)return console.log(`${e} version ${n.version} is newer than latest version of ${c.version}. Returning default instead. `),c;try{return r!=null?r.parse(n):n}catch(a){return console.log(`${e} failed to parse default. Exiting with default`),console.error(a),c}};const g=Object.keys(t).length;let p=!1;const i=n=>{try{if(g===0||R(n.version,f))return console.log(p?`${e} ${n.version} now up to date`:`${e} version ${n.version} is up to date with target version ${c.version}`),n;const a=n.version,S=t[a],v=S(n);return p=!0,i(v)}catch(a){return console.log(`${e} failed to migrate from ${n.version} to ${f}`),console.error(a),c}};return n=>{try{if(n.version==null)if(o!=null)console.log(`${e} version is null. Setting version to default of ${o}`),n.version=o;else return console.log(`${e} version is null and no default version set. Exiting with default`),c;return i(n)}catch(a){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(a),c}}},ae=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:y,createMigration:se,migrator:ce,semVerNewer:R,semVerOlder:ie,semVerZ:q,versionsEqual:oe},Symbol.toStringTag,{value:"Module"})),ue=e=>{if(e===void 0||typeof e=="string"||typeof e=="number")return e;if(e.toString===void 0)throw new Error("invalid renderer");return e.toString()},le=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e,de=(e,t="")=>{const r=e.length;return r===0?t:r===1?e[0]:r===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[r-1]}`},fe=e=>{const t=e.split(" "),r=new Set,o=t.map(i=>i.charAt(0).toLowerCase()).join("");r.add(o),r.add(o.replace(/(.)(.)/g,"$1_$2"));const c=/\d+/g;e.match(c)&&t.forEach((i,n)=>{if(c.test(i)){const a=t.map((S,v)=>v!==n?S.charAt(0).toLowerCase():S).join("");r.add(a),r.add(a.replace(/(.)(.)/g,"$1_$2"))}});const g=t.map(i=>(i.length>3?i.substring(0,3):i).toLowerCase());return r.add(g.join("")),r.add(g.join("_")),Array.from(r).filter(i=>i.length>=2&&i.length<=12)},ge=Object.freeze(Object.defineProperty({__proto__:null,generateShortIdentifiers:fe,naturalLanguageJoin:de},Symbol.toStringTag,{value:"Module"}));exports.binary=N.encoder;exports.caseconv=O.caseconv;exports.change=L.change;exports.clamp=A.clamp;exports.scale=A.scale;exports.compare=u.compare;exports.isStringer=u.isStringer;exports.primitiveIsZero=u.primitiveIsZero;exports.debounce=M.debounce;exports.throttle=M.throttle;exports.deep=P.deep;exports.DataType=s.DataType;exports.Density=s.Density;exports.MultiSeries=s.MultiSeries;exports.Rate=s.Rate;exports.Series=s.Series;exports.Size=s.Size;exports.TimeRange=s.TimeRange;exports.TimeSpan=s.TimeSpan;exports.TimeStamp=s.TimeStamp;exports.addSamples=s.addSamples;exports.convertDataType=s.convertDataType;exports.id=s.id;exports.isCrudeSeries=s.isCrudeSeries;exports.isTelemValue=s.isTelemValue;exports.typedArrayZ=s.typedArrayZ;exports.isObject=Z.isObject;exports.kv=C.types;exports.bounds=j.bounds;exports.math=j.math;exports.observe=D.observe;exports.getEntries=E.getEntries;exports.mapValues=E.mapValues;exports.unknownRecordZ=E.unknownRecordZ;exports.runtime=G.external;exports.Search=V.Search;exports.box=W.box;exports.dimensions=H.dimensions;exports.direction=I.direction;exports.location=Q.location;exports.position=U.position;exports.spatial=B.spatial;exports.xy=J.xy;exports.nullToArr=k.nullToArr;exports.toArray=k.toArray;exports.unique=K.unique;exports.URL=w.URL;exports.buildQueryString=w.buildQueryString;exports.RoutedWorker=$.RoutedWorker;exports.TypedWorker=$.TypedWorker;exports.createMockWorkers=$.createMockWorkers;exports.zodutil=F.zodutil;exports.control=ee;exports.convertRenderV=ue;exports.errors=te;exports.invert=ne;exports.migrate=ae;exports.shallowCopy=le;exports.strings=ge;