@asymmetric-effort/specifyjs 1.0.2 → 1.1.0

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.
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-UJTLBTMV.js";
22
22
  import {
23
23
  secureFetch
24
- } from "./chunk-LCSK4XUC.js";
24
+ } from "./chunk-RH3DFT32.js";
25
25
  import {
26
26
  useCallback,
27
27
  useContext,
@@ -1,7 +1,7 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
2
  import {
3
3
  assertSecureUrl
4
- } from "./chunk-LCSK4XUC.js";
4
+ } from "./chunk-RH3DFT32.js";
5
5
 
6
6
  // src/telemetry/metrics.ts
7
7
  var MAX_DATA_POINTS = 1e4;
@@ -1,6 +1,12 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
2
 
3
3
  // src/shared/secure-fetch.ts
4
+ var IPV4_LOOPBACK = /^127\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
5
+ function isLoopbackIPv4(hostname) {
6
+ const m = IPV4_LOOPBACK.exec(hostname);
7
+ if (!m) return false;
8
+ return Number(m[1]) <= 255 && Number(m[2]) <= 255 && Number(m[3]) <= 255;
9
+ }
4
10
  function assertSecureUrl(url) {
5
11
  if (url.startsWith("//")) {
6
12
  throw new Error(
@@ -28,7 +34,7 @@ function assertSecureUrl(url) {
28
34
  return;
29
35
  }
30
36
  const hostname = parsed.hostname.toLowerCase();
31
- if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "0.0.0.0" || hostname.startsWith("127.")) {
37
+ if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "0.0.0.0" || isLoopbackIPv4(hostname)) {
32
38
  return;
33
39
  }
34
40
  if (hostname.endsWith(".localhost")) {
@@ -4,8 +4,8 @@ import {
4
4
  exportToEndpoint,
5
5
  formatOtlpMetrics,
6
6
  formatOtlpTraces
7
- } from "./chunk-6IZ45RD4.js";
8
- import "./chunk-LCSK4XUC.js";
7
+ } from "./chunk-PJZGQ4ZR.js";
8
+ import "./chunk-RH3DFT32.js";
9
9
  import "./chunk-FDNBPWUH.js";
10
10
  export {
11
11
  createMeterProvider,
@@ -1,7 +1,7 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
2
  import {
3
3
  assertSecureUrl
4
- } from "../chunks/chunk-LCSK4XUC.js";
4
+ } from "../chunks/chunk-RH3DFT32.js";
5
5
  import {
6
6
  useCallback,
7
7
  useEffect,
@@ -1,14 +1,14 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
2
  import {
3
3
  createContext
4
- } from "./chunks/chunk-MWYZOVHI.js";
4
+ } from "./chunks/chunk-PGUFCUSX.js";
5
5
  import "./chunks/chunk-7OC7LXZ7.js";
6
6
  import "./chunks/chunk-SRUWIDIG.js";
7
7
  import {
8
8
  createElement
9
9
  } from "./chunks/chunk-NKW7RJR3.js";
10
10
  import "./chunks/chunk-UJTLBTMV.js";
11
- import "./chunks/chunk-LCSK4XUC.js";
11
+ import "./chunks/chunk-RH3DFT32.js";
12
12
  import {
13
13
  useCallback,
14
14
  useContext,
package/dist/esm/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  useNavigate,
25
25
  useParams,
26
26
  useRouter
27
- } from "./chunks/chunk-MWYZOVHI.js";
27
+ } from "./chunks/chunk-PGUFCUSX.js";
28
28
  import {
29
29
  getComponentTypeTable,
30
30
  resolveComponentId,
@@ -43,7 +43,7 @@ import "./chunks/chunk-UJTLBTMV.js";
43
43
  import {
44
44
  assertSecureUrl,
45
45
  secureFetch
46
- } from "./chunks/chunk-LCSK4XUC.js";
46
+ } from "./chunks/chunk-RH3DFT32.js";
47
47
  import {
48
48
  useCallback,
49
49
  useContext,
@@ -4,8 +4,8 @@ import {
4
4
  exportToEndpoint,
5
5
  formatOtlpMetrics,
6
6
  formatOtlpTraces
7
- } from "../chunks/chunk-6IZ45RD4.js";
8
- import "../chunks/chunk-LCSK4XUC.js";
7
+ } from "../chunks/chunk-PJZGQ4ZR.js";
8
+ import "../chunks/chunk-RH3DFT32.js";
9
9
  import {
10
10
  useEffect,
11
11
  useRef
@@ -151,7 +151,7 @@ function createTracer(config) {
151
151
  if (buffer.length === 0) return;
152
152
  const toExport = buffer.splice(0, buffer.length);
153
153
  if (config.endpoint) {
154
- const { formatOtlpTraces: formatOtlpTraces2, exportToEndpoint: exportToEndpoint2 } = await import("../chunks/metrics-J42I3W3C.js");
154
+ const { formatOtlpTraces: formatOtlpTraces2, exportToEndpoint: exportToEndpoint2 } = await import("../chunks/metrics-KVVTHW65.js");
155
155
  const body = formatOtlpTraces2(toExport, config.serviceName, config.serviceVersion);
156
156
  await exportToEndpoint2(config.endpoint, config.headers ?? {}, body);
157
157
  }
@@ -1,2 +1,2 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
- "use strict";var O=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var ne=(e,t)=>{for(var n in t)O(e,n,{get:t[n],enumerable:!0})},re=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ee(t))!te.call(e,r)&&r!==n&&O(e,r,{get:()=>t[r],enumerable:!(o=Y(t,r))||o.enumerable});return e};var oe=e=>re(O({},"__esModule",{value:!0}),e);var fe={};ne(fe,{RestError:()=>v,createGraphQLClient:()=>B,createGrpcWebClient:()=>j,createRestClient:()=>F,defineMessage:()=>N,gql:()=>_,useMutation:()=>K,useProto:()=>J,useQuery:()=>X,useRest:()=>W});module.exports=oe(fe);var H=null;function G(){if(H===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return H}function w(e){return G().useState(e)}function S(e,t){return G().useEffect(e,t)}function k(e,t){return G().useCallback(e,t)}function x(e){return G().useRef(e)}function L(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))return;if(e.startsWith("data:")){if(e.length>1024*1024)throw new Error("[SpecifyJS] secureFetch: data: URI exceeds 1MB limit");return}let t;try{t=new URL(e,typeof window<"u"?window.location.href:void 0)}catch{throw new Error(`[SpecifyJS] secureFetch: unable to validate URL "${e}". Provide a valid absolute HTTPS URL or a relative path.`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase();if(!(n==="localhost"||n==="127.0.0.1"||n==="[::1]"||n==="0.0.0.0"||n.startsWith("127.")))throw n.endsWith(".localhost")?new Error(`[SpecifyJS] SSRF protection: "${e}" uses a .localhost subdomain which resolves to the loopback interface. Use exact "localhost" instead.`):new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}var v=class extends Error{constructor(t,n,o,r,u){super(t),this.name="RestError",this.status=n,this.statusText=o,this.data=r,this.config=u}};function se(e){let t={};return e.forEach((n,o)=>{t[o]=n}),t}function ie(e,t){let n=e.endsWith("/")?e.slice(0,-1):e,o=t.startsWith("/")?t:"/"+t;return n+o}function F(e){let{baseURL:t,headers:n={},timeout:o,interceptors:r={}}=e,u=r.request??[],c=r.response??[],f=r.error??[];async function h(l,a,s,p){let i={url:ie(t,a),method:l,headers:{...n,...p?.headers??{}},body:s,signal:p?.signal,timeout:p?.timeout??o};s!=null&&!i.headers["Content-Type"]&&(i.headers["Content-Type"]="application/json");for(let R of u)i=await R(i);let g,d;if(i.timeout&&i.timeout>0&&(d=new AbortController,g=setTimeout(()=>{d.abort()},i.timeout),i.signal)){let R=i.signal;R.aborted?d.abort():R.addEventListener("abort",()=>{d.abort()})}let T=d?d.signal:i.signal,y={method:i.method,headers:i.headers,signal:T};s!=null&&(y.body=JSON.stringify(s));let m;try{L(i.url),m=await fetch(i.url,y)}catch(R){g!==void 0&&clearTimeout(g);let z=R instanceof DOMException&&R.name==="AbortError"?`Request timeout after ${i.timeout}ms`:R instanceof Error?R.message:"Network error",A=new v(z,0,"",null,i);for(let Z of f)A=await Z(A);throw A}g!==void 0&&clearTimeout(g);let E=m.headers.get("content-type")??"",b;if(E.includes("application/json"))b=await m.json();else{let R=await m.text();try{b=JSON.parse(R)}catch{b=R}}let C=se(m.headers);if(!m.ok){let R=new v(`Request failed with status ${m.status}`,m.status,m.statusText,b,i);for(let M of f)R=await M(R);throw R}let P={data:b,status:m.status,headers:C,ok:m.ok};for(let R of c)P=R(P);return P}return{get(l,a){return h("GET",l,void 0,a)},post(l,a,s){return h("POST",l,a,s)},put(l,a,s){return h("PUT",l,a,s)},patch(l,a,s){return h("PATCH",l,a,s)},delete(l,a){return h("DELETE",l,void 0,a)}}}function W(e,t,n){let o=n?.method??"GET",r=n?.body,u=n?.deps??[],c=n?.enabled??!0,[f,h]=w(null),[l,a]=w(c),[s,p]=w(null),i=x(null),g=x(!0),d=k(()=>{if(!c){a(!1);return}i.current&&i.current.abort();let y=new AbortController;i.current=y,a(!0),p(null);let m={signal:y.signal},E,b=o.toUpperCase();b==="POST"?E=e.post(t,r,m):b==="PUT"?E=e.put(t,r,m):b==="PATCH"?E=e.patch(t,r,m):b==="DELETE"?E=e.delete(t,m):E=e.get(t,m),E.then(C=>{g.current&&!y.signal.aborted&&(h(C.data),a(!1))}).catch(C=>{g.current&&!y.signal.aborted&&(p(C instanceof v?C:new v(C instanceof Error?C.message:"Unknown error",0,"",null,{url:t,method:b,headers:{}})),a(!1))})},[e,t,o,r,c,...u]);S(()=>(g.current=!0,d(),()=>{g.current=!1,i.current&&i.current.abort()}),[d]);let T=k(()=>{d()},[d]);return{data:f,loading:l,error:s,refetch:T}}function q(e){let t=[],n=e>>>0;for(;n>127;)t.push(n&127|128),n>>>=7;return t.push(n&127),t}function U(e,t){let n=0,o=0,r=t;for(;r<e.length;){let u=e[r];if(n|=(u&127)<<o,r++,(u&128)===0)return[n>>>0,r];if(o+=7,o>=35)throw new Error("Varint too long")}throw new Error("Unexpected end of data while decoding varint")}var I=0,Q=1,D=2;function ae(e){switch(e){case"int32":case"uint32":case"bool":case"enum":return I;case"float64":return Q;case"string":case"bytes":return D}}function $(e,t){return q(e<<3|t)}function V(e,t){switch(e){case"int32":return q(t|0);case"uint32":return q(t>>>0);case"bool":return q(t?1:0);case"enum":return q(t>>>0);case"float64":{let n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!0),Array.from(new Uint8Array(n))}case"string":{let n=new TextEncoder().encode(t);return[...q(n.length),...n]}case"bytes":{let n=t;return[...q(n.length),...n]}}}function ue(e,t,n,o){switch(t){case I:{let[r,u]=U(n,o);switch(e){case"bool":return[r!==0,u];case"int32":return[r|0,u];case"uint32":case"enum":return[r>>>0,u];default:return[r,u]}}case Q:{if(o+8>n.length)throw new Error("Unexpected end of data while decoding 64-bit value");let r=new ArrayBuffer(8),u=new Uint8Array(r);for(let f=0;f<8;f++)u[f]=n[o+f]??0;return[new DataView(r).getFloat64(0,!0),o+8]}case D:{let[r,u]=U(n,o);if(u+r>n.length)throw new Error("Unexpected end of data while decoding length-delimited value");let c=n.slice(u,u+r);return e==="string"?[new TextDecoder().decode(c),u+r]:[c,u+r]}default:throw new Error(`Unknown wire type: ${t}`)}}function N(e,t){let n=new Map;for(let[u,c]of Object.entries(t))n.set(c.tag,{fieldName:u,descriptor:c});function o(u){let c=[],f=u;for(let[h,l]of Object.entries(t)){let a=f[h];if(a==null)continue;let s=ae(l.type);if(l.repeated){let p=a;for(let i of p)c.push(...$(l.tag,s)),c.push(...V(l.type,i))}else c.push(...$(l.tag,s)),c.push(...V(l.type,a))}return new Uint8Array(c)}function r(u){let c={};for(let[h,l]of Object.entries(t))l.repeated&&(c[h]=[]);let f=0;for(;f<u.length;){let[h,l]=U(u,f),a=h>>>3,s=h&7;f=l;let p=n.get(a);if(!p){f=ce(s,u,f);continue}let[i,g]=ue(p.descriptor.type,s,u,f);f=g,p.descriptor.repeated?c[p.fieldName].push(i):c[p.fieldName]=i}return c}return{name:e,fields:t,encode:o,decode:r}}function ce(e,t,n){switch(e){case I:{let[,o]=U(t,n);return o}case Q:return n+8;case D:{let[o,r]=U(t,n);return r+o}default:throw new Error(`Cannot skip unknown wire type: ${e}`)}}function le(e,t=0){let n=new Uint8Array(5+e.length);return n[0]=t,new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(1,e.length,!1),n.set(e,5),n}function pe(e){if(e.length<5)throw new Error("gRPC-Web frame too short");let t=e[0]??0,o=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(1,!1);if(e.length<5+o)throw new Error("gRPC-Web frame data incomplete");let r=e.slice(5,5+o);return[t,r,5+o]}function j(e){let{baseURL:t,headers:n}=e;async function o(r,u,c,f,h){let l=c.encode(h),a=le(l),s=`${t.replace(/\/+$/,"")}/${r}/${u}`,p={"Content-Type":"application/grpc-web+proto",Accept:"application/grpc-web+proto","X-Grpc-Web":"1",...n};L(s);let i=await fetch(s,{method:"POST",headers:p,body:a.buffer});if(!i.ok)throw new Error(`gRPC-Web request failed: ${i.status} ${i.statusText}`);let g=new Uint8Array(await i.arrayBuffer()),d=0;for(;d<g.length;){let[T,y,m]=pe(g.subarray(d));if(d+=m,(T&128)===0)return f.decode(y)}throw new Error("No data frame found in gRPC-Web response")}return{unary:o}}function J(e,t,n,o,r,u,c){let[f,h]=w(null),[l,a]=w(!1),[s,p]=w(null),i=x(!0),g=x(u);g.current=u;let d=c?.enabled!==!1,T=k(()=>{d&&(a(!0),p(null),e.unary(t,n,o,r,g.current).then(y=>{i.current&&(h(y),a(!1))}).catch(y=>{i.current&&(p(y instanceof Error?y:new Error(String(y))),a(!1))}))},[e,t,n,o,r,d]);return S(()=>(i.current=!0,T(),()=>{i.current=!1}),[T]),{data:f,loading:l,error:s,refetch:T}}function _(e,...t){let n="";for(let o=0;o<e.length;o++)if(n+=e[o],o<t.length){let r=String(t[o]);if(/[{}():]/.test(r))throw new Error(`[SpecifyJS] gql: Interpolated value "${r}" contains GraphQL metacharacters ({, }, (, ), :). Use the variables parameter instead of string interpolation to prevent injection.`);n+=r}return n.replace(/\s+/g," ").trim()}function B(e){let{url:t,headers:n,credentials:o,cache:r=!1}=e,u=100,c=new Map;function f(a,s){return JSON.stringify({query:a,variables:s})}async function h(a,s){let p={"Content-Type":"application/json",...n},i=JSON.stringify({query:a,variables:s});L(t);let g=await fetch(t,{method:"POST",headers:p,credentials:o,body:i});if(!g.ok)throw new Error(`GraphQL request failed with status ${g.status}`);let d=await g.json();return{data:d.data??null,errors:d.errors??null,...d.extensions!==void 0?{extensions:d.extensions}:{}}}return{async query(a,s){if(r){let p=f(a,s),i=c.get(p);if(i)return i;let g=await h(a,s);if(c.size>=u){let d=c.keys().next().value;d!==void 0&&c.delete(d)}return c.set(p,g),g}return h(a,s)},async mutate(a,s){return h(a,s)},clearCache(){c.clear()},invalidate(a){for(let s of c.keys())try{JSON.parse(s).query===a&&c.delete(s)}catch{}}}}function X(e,t,n){let o=n?.variables,r=n?.deps,u=n?.enabled??!0,[c,f]=w(null),[h,l]=w(u),[a,s]=w(null),p=x(0),i=k(()=>{if(!u)return;let d=++p.current;l(!0),s(null),e.query(t,o).then(T=>{p.current===d&&(f(T.data),s(T.errors),l(!1))}).catch(T=>{p.current===d&&(s([{message:T instanceof Error?T.message:String(T)}]),l(!1))})},[e,t,o,u]),g=r?[i,...r]:[i];return S(()=>{i()},g),{data:c,loading:h,error:a,refetch:i}}function K(e,t){let[n,o]=w(null),[r,u]=w(!1),[c,f]=w(null),h=async a=>{u(!0),f(null);try{let s=await e.mutate(t,a);return o(s.data),f(s.errors),u(!1),s}catch(s){let p=[{message:s instanceof Error?s.message:String(s)}];return f(p),u(!1),{data:null,errors:p,extensions:void 0}}};return[k(((...a)=>h(a[0])),[e,t]),{data:n,loading:r,error:c}]}
2
+ "use strict";var O=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var ne=(e,t)=>{for(var n in t)O(e,n,{get:t[n],enumerable:!0})},re=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ee(t))!te.call(e,r)&&r!==n&&O(e,r,{get:()=>t[r],enumerable:!(o=Y(t,r))||o.enumerable});return e};var oe=e=>re(O({},"__esModule",{value:!0}),e);var ge={};ne(ge,{RestError:()=>v,createGraphQLClient:()=>B,createGrpcWebClient:()=>j,createRestClient:()=>F,defineMessage:()=>N,gql:()=>_,useMutation:()=>X,useProto:()=>J,useQuery:()=>K,useRest:()=>W});module.exports=oe(ge);var H=null;function P(){if(H===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return H}function w(e){return P().useState(e)}function S(e,t){return P().useEffect(e,t)}function k(e,t){return P().useCallback(e,t)}function x(e){return P().useRef(e)}var se=/^127\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;function ie(e){let t=se.exec(e);return t?Number(t[1])<=255&&Number(t[2])<=255&&Number(t[3])<=255:!1}function L(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))return;if(e.startsWith("data:")){if(e.length>1024*1024)throw new Error("[SpecifyJS] secureFetch: data: URI exceeds 1MB limit");return}let t;try{t=new URL(e,typeof window<"u"?window.location.href:void 0)}catch{throw new Error(`[SpecifyJS] secureFetch: unable to validate URL "${e}". Provide a valid absolute HTTPS URL or a relative path.`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase();if(!(n==="localhost"||n==="127.0.0.1"||n==="[::1]"||n==="0.0.0.0"||ie(n)))throw n.endsWith(".localhost")?new Error(`[SpecifyJS] SSRF protection: "${e}" uses a .localhost subdomain which resolves to the loopback interface. Use exact "localhost" instead.`):new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}var v=class extends Error{constructor(t,n,o,r,u){super(t),this.name="RestError",this.status=n,this.statusText=o,this.data=r,this.config=u}};function ae(e){let t={};return e.forEach((n,o)=>{t[o]=n}),t}function ue(e,t){let n=e.endsWith("/")?e.slice(0,-1):e,o=t.startsWith("/")?t:"/"+t;return n+o}function F(e){let{baseURL:t,headers:n={},timeout:o,interceptors:r={}}=e,u=r.request??[],c=r.response??[],f=r.error??[];async function h(l,a,s,p){let i={url:ue(t,a),method:l,headers:{...n,...p?.headers??{}},body:s,signal:p?.signal,timeout:p?.timeout??o};s!=null&&!i.headers["Content-Type"]&&(i.headers["Content-Type"]="application/json");for(let R of u)i=await R(i);let g,d;if(i.timeout&&i.timeout>0&&(d=new AbortController,g=setTimeout(()=>{d.abort()},i.timeout),i.signal)){let R=i.signal;R.aborted?d.abort():R.addEventListener("abort",()=>{d.abort()})}let T=d?d.signal:i.signal,y={method:i.method,headers:i.headers,signal:T};s!=null&&(y.body=JSON.stringify(s));let m;try{L(i.url),m=await fetch(i.url,y)}catch(R){g!==void 0&&clearTimeout(g);let z=R instanceof DOMException&&R.name==="AbortError"?`Request timeout after ${i.timeout}ms`:R instanceof Error?R.message:"Network error",A=new v(z,0,"",null,i);for(let Z of f)A=await Z(A);throw A}g!==void 0&&clearTimeout(g);let E=m.headers.get("content-type")??"",b;if(E.includes("application/json"))b=await m.json();else{let R=await m.text();try{b=JSON.parse(R)}catch{b=R}}let C=ae(m.headers);if(!m.ok){let R=new v(`Request failed with status ${m.status}`,m.status,m.statusText,b,i);for(let M of f)R=await M(R);throw R}let G={data:b,status:m.status,headers:C,ok:m.ok};for(let R of c)G=R(G);return G}return{get(l,a){return h("GET",l,void 0,a)},post(l,a,s){return h("POST",l,a,s)},put(l,a,s){return h("PUT",l,a,s)},patch(l,a,s){return h("PATCH",l,a,s)},delete(l,a){return h("DELETE",l,void 0,a)}}}function W(e,t,n){let o=n?.method??"GET",r=n?.body,u=n?.deps??[],c=n?.enabled??!0,[f,h]=w(null),[l,a]=w(c),[s,p]=w(null),i=x(null),g=x(!0),d=k(()=>{if(!c){a(!1);return}i.current&&i.current.abort();let y=new AbortController;i.current=y,a(!0),p(null);let m={signal:y.signal},E,b=o.toUpperCase();b==="POST"?E=e.post(t,r,m):b==="PUT"?E=e.put(t,r,m):b==="PATCH"?E=e.patch(t,r,m):b==="DELETE"?E=e.delete(t,m):E=e.get(t,m),E.then(C=>{g.current&&!y.signal.aborted&&(h(C.data),a(!1))}).catch(C=>{g.current&&!y.signal.aborted&&(p(C instanceof v?C:new v(C instanceof Error?C.message:"Unknown error",0,"",null,{url:t,method:b,headers:{}})),a(!1))})},[e,t,o,r,c,...u]);S(()=>(g.current=!0,d(),()=>{g.current=!1,i.current&&i.current.abort()}),[d]);let T=k(()=>{d()},[d]);return{data:f,loading:l,error:s,refetch:T}}function q(e){let t=[],n=e>>>0;for(;n>127;)t.push(n&127|128),n>>>=7;return t.push(n&127),t}function U(e,t){let n=0,o=0,r=t;for(;r<e.length;){let u=e[r];if(n|=(u&127)<<o,r++,(u&128)===0)return[n>>>0,r];if(o+=7,o>=35)throw new Error("Varint too long")}throw new Error("Unexpected end of data while decoding varint")}var I=0,Q=1,D=2;function ce(e){switch(e){case"int32":case"uint32":case"bool":case"enum":return I;case"float64":return Q;case"string":case"bytes":return D}}function $(e,t){return q(e<<3|t)}function V(e,t){switch(e){case"int32":return q(t|0);case"uint32":return q(t>>>0);case"bool":return q(t?1:0);case"enum":return q(t>>>0);case"float64":{let n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!0),Array.from(new Uint8Array(n))}case"string":{let n=new TextEncoder().encode(t);return[...q(n.length),...n]}case"bytes":{let n=t;return[...q(n.length),...n]}}}function le(e,t,n,o){switch(t){case I:{let[r,u]=U(n,o);switch(e){case"bool":return[r!==0,u];case"int32":return[r|0,u];case"uint32":case"enum":return[r>>>0,u];default:return[r,u]}}case Q:{if(o+8>n.length)throw new Error("Unexpected end of data while decoding 64-bit value");let r=new ArrayBuffer(8),u=new Uint8Array(r);for(let f=0;f<8;f++)u[f]=n[o+f]??0;return[new DataView(r).getFloat64(0,!0),o+8]}case D:{let[r,u]=U(n,o);if(u+r>n.length)throw new Error("Unexpected end of data while decoding length-delimited value");let c=n.slice(u,u+r);return e==="string"?[new TextDecoder().decode(c),u+r]:[c,u+r]}default:throw new Error(`Unknown wire type: ${t}`)}}function N(e,t){let n=new Map;for(let[u,c]of Object.entries(t))n.set(c.tag,{fieldName:u,descriptor:c});function o(u){let c=[],f=u;for(let[h,l]of Object.entries(t)){let a=f[h];if(a==null)continue;let s=ce(l.type);if(l.repeated){let p=a;for(let i of p)c.push(...$(l.tag,s)),c.push(...V(l.type,i))}else c.push(...$(l.tag,s)),c.push(...V(l.type,a))}return new Uint8Array(c)}function r(u){let c={};for(let[h,l]of Object.entries(t))l.repeated&&(c[h]=[]);let f=0;for(;f<u.length;){let[h,l]=U(u,f),a=h>>>3,s=h&7;f=l;let p=n.get(a);if(!p){f=pe(s,u,f);continue}let[i,g]=le(p.descriptor.type,s,u,f);f=g,p.descriptor.repeated?c[p.fieldName].push(i):c[p.fieldName]=i}return c}return{name:e,fields:t,encode:o,decode:r}}function pe(e,t,n){switch(e){case I:{let[,o]=U(t,n);return o}case Q:return n+8;case D:{let[o,r]=U(t,n);return r+o}default:throw new Error(`Cannot skip unknown wire type: ${e}`)}}function fe(e,t=0){let n=new Uint8Array(5+e.length);return n[0]=t,new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(1,e.length,!1),n.set(e,5),n}function de(e){if(e.length<5)throw new Error("gRPC-Web frame too short");let t=e[0]??0,o=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(1,!1);if(e.length<5+o)throw new Error("gRPC-Web frame data incomplete");let r=e.slice(5,5+o);return[t,r,5+o]}function j(e){let{baseURL:t,headers:n}=e;async function o(r,u,c,f,h){let l=c.encode(h),a=fe(l),s=`${t.replace(/\/+$/,"")}/${r}/${u}`,p={"Content-Type":"application/grpc-web+proto",Accept:"application/grpc-web+proto","X-Grpc-Web":"1",...n};L(s);let i=await fetch(s,{method:"POST",headers:p,body:a.buffer});if(!i.ok)throw new Error(`gRPC-Web request failed: ${i.status} ${i.statusText}`);let g=new Uint8Array(await i.arrayBuffer()),d=0;for(;d<g.length;){let[T,y,m]=de(g.subarray(d));if(d+=m,(T&128)===0)return f.decode(y)}throw new Error("No data frame found in gRPC-Web response")}return{unary:o}}function J(e,t,n,o,r,u,c){let[f,h]=w(null),[l,a]=w(!1),[s,p]=w(null),i=x(!0),g=x(u);g.current=u;let d=c?.enabled!==!1,T=k(()=>{d&&(a(!0),p(null),e.unary(t,n,o,r,g.current).then(y=>{i.current&&(h(y),a(!1))}).catch(y=>{i.current&&(p(y instanceof Error?y:new Error(String(y))),a(!1))}))},[e,t,n,o,r,d]);return S(()=>(i.current=!0,T(),()=>{i.current=!1}),[T]),{data:f,loading:l,error:s,refetch:T}}function _(e,...t){let n="";for(let o=0;o<e.length;o++)if(n+=e[o],o<t.length){let r=String(t[o]);if(/[{}():]/.test(r))throw new Error(`[SpecifyJS] gql: Interpolated value "${r}" contains GraphQL metacharacters ({, }, (, ), :). Use the variables parameter instead of string interpolation to prevent injection.`);n+=r}return n.replace(/\s+/g," ").trim()}function B(e){let{url:t,headers:n,credentials:o,cache:r=!1}=e,u=100,c=new Map;function f(a,s){return JSON.stringify({query:a,variables:s})}async function h(a,s){let p={"Content-Type":"application/json",...n},i=JSON.stringify({query:a,variables:s});L(t);let g=await fetch(t,{method:"POST",headers:p,credentials:o,body:i});if(!g.ok)throw new Error(`GraphQL request failed with status ${g.status}`);let d=await g.json();return{data:d.data??null,errors:d.errors??null,...d.extensions!==void 0?{extensions:d.extensions}:{}}}return{async query(a,s){if(r){let p=f(a,s),i=c.get(p);if(i)return i;let g=await h(a,s);if(c.size>=u){let d=c.keys().next().value;d!==void 0&&c.delete(d)}return c.set(p,g),g}return h(a,s)},async mutate(a,s){return h(a,s)},clearCache(){c.clear()},invalidate(a){for(let s of c.keys())try{JSON.parse(s).query===a&&c.delete(s)}catch{}}}}function K(e,t,n){let o=n?.variables,r=n?.deps,u=n?.enabled??!0,[c,f]=w(null),[h,l]=w(u),[a,s]=w(null),p=x(0),i=k(()=>{if(!u)return;let d=++p.current;l(!0),s(null),e.query(t,o).then(T=>{p.current===d&&(f(T.data),s(T.errors),l(!1))}).catch(T=>{p.current===d&&(s([{message:T instanceof Error?T.message:String(T)}]),l(!1))})},[e,t,o,u]),g=r?[i,...r]:[i];return S(()=>{i()},g),{data:c,loading:h,error:a,refetch:i}}function X(e,t){let[n,o]=w(null),[r,u]=w(!1),[c,f]=w(null),h=async a=>{u(!0),f(null);try{let s=await e.mutate(t,a);return o(s.data),f(s.errors),u(!1),s}catch(s){let p=[{message:s instanceof Error?s.message:String(s)}];return f(p),u(!1),{data:null,errors:p,extensions:void 0}}};return[k(((...a)=>h(a[0])),[e,t]),{data:n,loading:r,error:c}]}
@@ -1,7 +1,7 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
2
  import {
3
3
  assertSecureUrl
4
- } from "./esm/chunks/chunk-LCSK4XUC.js";
4
+ } from "./esm/chunks/chunk-RH3DFT32.js";
5
5
  import {
6
6
  useCallback,
7
7
  useEffect,
@@ -1,14 +1,14 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
2
  import {
3
3
  createContext
4
- } from "./esm/chunks/chunk-MWYZOVHI.js";
4
+ } from "./esm/chunks/chunk-PGUFCUSX.js";
5
5
  import "./esm/chunks/chunk-7OC7LXZ7.js";
6
6
  import "./esm/chunks/chunk-SRUWIDIG.js";
7
7
  import {
8
8
  createElement
9
9
  } from "./esm/chunks/chunk-NKW7RJR3.js";
10
10
  import "./esm/chunks/chunk-UJTLBTMV.js";
11
- import "./esm/chunks/chunk-LCSK4XUC.js";
11
+ import "./esm/chunks/chunk-RH3DFT32.js";
12
12
  import {
13
13
  useCallback,
14
14
  useContext,
@@ -1,2 +1,2 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
- "use strict";var v=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var P=(e,n)=>()=>(e&&(n=e(e=0)),n);var C=(e,n)=>{for(var t in n)v(e,t,{get:n[t],enumerable:!0})},G=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of F(n))!J.call(e,o)&&o!==t&&v(e,o,{get:()=>n[o],enumerable:!(r=j(n,o))||r.enumerable});return e};var W=e=>G(v({},"__esModule",{value:!0}),e);function A(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))return;if(e.startsWith("data:")){if(e.length>1024*1024)throw new Error("[SpecifyJS] secureFetch: data: URI exceeds 1MB limit");return}let n;try{n=new URL(e,typeof window<"u"?window.location.href:void 0)}catch{throw new Error(`[SpecifyJS] secureFetch: unable to validate URL "${e}". Provide a valid absolute HTTPS URL or a relative path.`)}if(n.protocol==="https:")return;let t=n.hostname.toLowerCase();if(!(t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t==="0.0.0.0"||t.startsWith("127.")))throw t.endsWith(".localhost")?new Error(`[SpecifyJS] SSRF protection: "${e}" uses a .localhost subdomain which resolves to the loopback interface. Use exact "localhost" instead.`):new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}var D=P(()=>{"use strict"});var U={};C(U,{createMeterProvider:()=>I,exportToEndpoint:()=>S,formatOtlpMetrics:()=>y,formatOtlpTraces:()=>x});function b(e,n,t){e.length>=H&&e.splice(0,Math.floor(H/2)),e.push({value:n,attributes:t?{...t}:{},timestamp:performance.now()})}function K(e,n){let t=[];return{name:e,description:n?.description??"",add(r,o){r<0||b(t,r,o)},get dataPoints(){return t}}}function X(e,n){let t=[];return{name:e,description:n?.description??"",record(r,o){b(t,r,o)},get dataPoints(){return t}}}function B(e,n){let t=[];return{name:e,description:n?.description??"",set(r,o){b(t,r,o)},get dataPoints(){return t}}}function I(e){let n=[],t;e.exportInterval&&e.exportInterval>0&&(t=setInterval(()=>{r.flush()},e.exportInterval),typeof t=="object"&&"unref"in t&&t.unref());let r={config:e,get instruments(){return n},counter(o,s){let i=K(o,s);return n.push(i),i},histogram(o,s){let i=X(o,s);return n.push(i),i},gauge(o,s){let i=B(o,s);return n.push(i),i},async flush(){if(!e.endpoint)return;let o=y(n,e.serviceName);await S(e.endpoint,e.headers??{},o)}};return r}function l(e){return Object.entries(e).map(([n,t])=>typeof t=="string"?{key:n,value:{stringValue:t}}:typeof t=="boolean"?{key:n,value:{boolValue:t}}:{key:n,value:{intValue:t}})}function g(e){return String(Math.round(e*1e6))}function y(e,n){let t=e.map(r=>{let o=r.dataPoints.map(i=>({attributes:l(i.attributes),timeUnixNano:g(i.timestamp),asDouble:i.value})),s;return"add"in r?s={sum:{dataPoints:o,isMonotonic:!0,aggregationTemporality:2}}:"record"in r?s={histogram:{dataPoints:o,aggregationTemporality:2}}:s={gauge:{dataPoints:o}},{name:r.name,description:r.description,...s}});return{resourceMetrics:[{resource:{attributes:l({"service.name":n??"unknown"})},scopeMetrics:[{scope:{name:"specifyjs-telemetry",version:"1.0.0"},metrics:t}]}]}}function x(e,n,t){let r={"service.name":n??"unknown"};t&&(r["service.version"]=t);let o={internal:1,server:2,client:3,producer:4,consumer:5},s={unset:0,ok:1,error:2},i=e.map(a=>({traceId:a.traceId,spanId:a.spanId,parentSpanId:a.parentSpanId??"",name:a.name,kind:o[a.kind]??1,startTimeUnixNano:g(a.startTime),endTimeUnixNano:a.endTime!==void 0?g(a.endTime):"0",attributes:l(a.attributes),status:{code:s[a.status.code]??0,message:a.status.message??""},events:a.events.map(u=>({name:u.name,timeUnixNano:g(u.timestamp),attributes:u.attributes?l(u.attributes):[]}))}));return{resourceSpans:[{resource:{attributes:l(r)},scopeSpans:[{scope:{name:"specifyjs-telemetry",version:"1.0.0"},spans:i}]}]}}async function S(e,n,t){try{A(e),await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(t)})}catch{}}var H,R=P(()=>{"use strict";D();H=1e4});var Z={};C(Z,{createMeterProvider:()=>I,createTracer:()=>$,endSpan:()=>d,exportToEndpoint:()=>S,formatOtlpMetrics:()=>y,formatOtlpTraces:()=>x,formatTraceparent:()=>N,generateSpanId:()=>k,generateTraceId:()=>w,parseTraceparent:()=>q,startSpan:()=>E,useTracing:()=>_});module.exports=W(Z);var M=null;function O(){if(M===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return M}function h(e,n){return O().useEffect(e,n)}function T(e){return O().useRef(e)}function L(e){let n=new Uint8Array(e);try{crypto.getRandomValues(n)}catch{for(let t=0;t<e;t++)n[t]=Math.floor(Math.random()*256)}return n}function V(e){let n="";for(let t=0;t<e.length;t++)n+=(e[t]??0).toString(16).padStart(2,"0");return n}function w(){return V(L(16))}function k(){return V(L(8))}var z=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;function q(e){let n=z.exec(e.trim());if(!n)return null;let t=n[2],r=n[3],o=n[4];return/^0+$/.test(t)||/^0+$/.test(r)?null:{traceId:t,spanId:r,traceFlags:o}}function N(e){return`00-${e.traceId}-${e.spanId}-${e.traceFlags}`}function E(e,n){return{traceId:n?.traceId??w(),spanId:k(),parentSpanId:n?.parentSpanId,name:e,kind:n?.kind??"internal",startTime:performance.now(),status:{code:"unset"},attributes:n?.attributes?{...n.attributes}:{},events:[]}}function d(e){e.endTime=performance.now()}function $(e){let n=e.batchSize??1e3,t=[],r=[];function o(a){r.length>=n&&r.splice(0,Math.floor(n/2)),r.push(a)}let s;e.flushInterval&&e.flushInterval>0&&(s=setInterval(()=>{i.flush()},e.flushInterval),typeof s=="object"&&"unref"in s&&s.unref());let i={config:e,get pendingSpans(){return r},activeSpan(){return t.length>0?t[t.length-1]:void 0},startSpan(a,u){let f=i.activeSpan(),p=E(a,{kind:u?.kind,attributes:u?.attributes,traceId:u?.traceId??f?.traceId,parentSpanId:u?.parentSpanId??f?.spanId});return t.push(p),p},withSpan(a,u){t.includes(a)||t.push(a);let p=()=>{for(let c=t.length-1;c>=0;c--)t[c]===a&&t.splice(c,1)};try{let c=u();return c&&typeof c.then=="function"?c.then(m=>(d(a),o(a),p(),m),m=>{throw a.status={code:"error",message:String(m)},d(a),o(a),p(),m}):(d(a),o(a),p(),c)}catch(c){throw a.status={code:"error",message:String(c)},d(a),o(a),p(),c}},async flush(){if(r.length===0)return;let a=r.splice(0,r.length);if(e.endpoint){let{formatOtlpTraces:u,exportToEndpoint:f}=await Promise.resolve().then(()=>(R(),U)),p=u(a,e.serviceName,e.serviceVersion);await f(e.endpoint,e.headers??{},p)}}};return i}function _(e,n){let t=T(null);h(()=>{let r=e.startSpan(n,{kind:"internal"});return r.events.push({name:"mount",timestamp:performance.now()}),t.current=r,()=>{t.current&&(t.current.events.push({name:"unmount",timestamp:performance.now()}),d(t.current))}},[])}R();
2
+ "use strict";var v=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var E=(e,t)=>()=>(e&&(t=e(e=0)),t);var C=(e,t)=>{for(var n in t)v(e,n,{get:t[n],enumerable:!0})},G=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of F(t))!J.call(e,o)&&o!==n&&v(e,o,{get:()=>t[o],enumerable:!(r=j(t,o))||r.enumerable});return e};var K=e=>G(v({},"__esModule",{value:!0}),e);function B(e){let t=W.exec(e);return t?Number(t[1])<=255&&Number(t[2])<=255&&Number(t[3])<=255:!1}function A(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))return;if(e.startsWith("data:")){if(e.length>1024*1024)throw new Error("[SpecifyJS] secureFetch: data: URI exceeds 1MB limit");return}let t;try{t=new URL(e,typeof window<"u"?window.location.href:void 0)}catch{throw new Error(`[SpecifyJS] secureFetch: unable to validate URL "${e}". Provide a valid absolute HTTPS URL or a relative path.`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase();if(!(n==="localhost"||n==="127.0.0.1"||n==="[::1]"||n==="0.0.0.0"||B(n)))throw n.endsWith(".localhost")?new Error(`[SpecifyJS] SSRF protection: "${e}" uses a .localhost subdomain which resolves to the loopback interface. Use exact "localhost" instead.`):new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}var W,D=E(()=>{"use strict";W=/^127\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/});var U={};C(U,{createMeterProvider:()=>I,exportToEndpoint:()=>S,formatOtlpMetrics:()=>y,formatOtlpTraces:()=>x});function b(e,t,n){e.length>=H&&e.splice(0,Math.floor(H/2)),e.push({value:t,attributes:n?{...n}:{},timestamp:performance.now()})}function X(e,t){let n=[];return{name:e,description:t?.description??"",add(r,o){r<0||b(n,r,o)},get dataPoints(){return n}}}function z(e,t){let n=[];return{name:e,description:t?.description??"",record(r,o){b(n,r,o)},get dataPoints(){return n}}}function Z(e,t){let n=[];return{name:e,description:t?.description??"",set(r,o){b(n,r,o)},get dataPoints(){return n}}}function I(e){let t=[],n;e.exportInterval&&e.exportInterval>0&&(n=setInterval(()=>{r.flush()},e.exportInterval),typeof n=="object"&&"unref"in n&&n.unref());let r={config:e,get instruments(){return t},counter(o,s){let i=X(o,s);return t.push(i),i},histogram(o,s){let i=z(o,s);return t.push(i),i},gauge(o,s){let i=Z(o,s);return t.push(i),i},async flush(){if(!e.endpoint)return;let o=y(t,e.serviceName);await S(e.endpoint,e.headers??{},o)}};return r}function l(e){return Object.entries(e).map(([t,n])=>typeof n=="string"?{key:t,value:{stringValue:n}}:typeof n=="boolean"?{key:t,value:{boolValue:n}}:{key:t,value:{intValue:n}})}function g(e){return String(Math.round(e*1e6))}function y(e,t){let n=e.map(r=>{let o=r.dataPoints.map(i=>({attributes:l(i.attributes),timeUnixNano:g(i.timestamp),asDouble:i.value})),s;return"add"in r?s={sum:{dataPoints:o,isMonotonic:!0,aggregationTemporality:2}}:"record"in r?s={histogram:{dataPoints:o,aggregationTemporality:2}}:s={gauge:{dataPoints:o}},{name:r.name,description:r.description,...s}});return{resourceMetrics:[{resource:{attributes:l({"service.name":t??"unknown"})},scopeMetrics:[{scope:{name:"specifyjs-telemetry",version:"1.0.0"},metrics:n}]}]}}function x(e,t,n){let r={"service.name":t??"unknown"};n&&(r["service.version"]=n);let o={internal:1,server:2,client:3,producer:4,consumer:5},s={unset:0,ok:1,error:2},i=e.map(a=>({traceId:a.traceId,spanId:a.spanId,parentSpanId:a.parentSpanId??"",name:a.name,kind:o[a.kind]??1,startTimeUnixNano:g(a.startTime),endTimeUnixNano:a.endTime!==void 0?g(a.endTime):"0",attributes:l(a.attributes),status:{code:s[a.status.code]??0,message:a.status.message??""},events:a.events.map(u=>({name:u.name,timeUnixNano:g(u.timestamp),attributes:u.attributes?l(u.attributes):[]}))}));return{resourceSpans:[{resource:{attributes:l(r)},scopeSpans:[{scope:{name:"specifyjs-telemetry",version:"1.0.0"},spans:i}]}]}}async function S(e,t,n){try{A(e),await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify(n)})}catch{}}var H,R=E(()=>{"use strict";D();H=1e4});var Y={};C(Y,{createMeterProvider:()=>I,createTracer:()=>q,endSpan:()=>d,exportToEndpoint:()=>S,formatOtlpMetrics:()=>y,formatOtlpTraces:()=>x,formatTraceparent:()=>$,generateSpanId:()=>P,generateTraceId:()=>w,parseTraceparent:()=>V,startSpan:()=>k,useTracing:()=>_});module.exports=K(Y);var M=null;function O(){if(M===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return M}function h(e,t){return O().useEffect(e,t)}function T(e){return O().useRef(e)}function L(e){let t=new Uint8Array(e);try{crypto.getRandomValues(t)}catch{for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256)}return t}function N(e){let t="";for(let n=0;n<e.length;n++)t+=(e[n]??0).toString(16).padStart(2,"0");return t}function w(){return N(L(16))}function P(){return N(L(8))}var Q=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;function V(e){let t=Q.exec(e.trim());if(!t)return null;let n=t[2],r=t[3],o=t[4];return/^0+$/.test(n)||/^0+$/.test(r)?null:{traceId:n,spanId:r,traceFlags:o}}function $(e){return`00-${e.traceId}-${e.spanId}-${e.traceFlags}`}function k(e,t){return{traceId:t?.traceId??w(),spanId:P(),parentSpanId:t?.parentSpanId,name:e,kind:t?.kind??"internal",startTime:performance.now(),status:{code:"unset"},attributes:t?.attributes?{...t.attributes}:{},events:[]}}function d(e){e.endTime=performance.now()}function q(e){let t=e.batchSize??1e3,n=[],r=[];function o(a){r.length>=t&&r.splice(0,Math.floor(t/2)),r.push(a)}let s;e.flushInterval&&e.flushInterval>0&&(s=setInterval(()=>{i.flush()},e.flushInterval),typeof s=="object"&&"unref"in s&&s.unref());let i={config:e,get pendingSpans(){return r},activeSpan(){return n.length>0?n[n.length-1]:void 0},startSpan(a,u){let f=i.activeSpan(),p=k(a,{kind:u?.kind,attributes:u?.attributes,traceId:u?.traceId??f?.traceId,parentSpanId:u?.parentSpanId??f?.spanId});return n.push(p),p},withSpan(a,u){n.includes(a)||n.push(a);let p=()=>{for(let c=n.length-1;c>=0;c--)n[c]===a&&n.splice(c,1)};try{let c=u();return c&&typeof c.then=="function"?c.then(m=>(d(a),o(a),p(),m),m=>{throw a.status={code:"error",message:String(m)},d(a),o(a),p(),m}):(d(a),o(a),p(),c)}catch(c){throw a.status={code:"error",message:String(c)},d(a),o(a),p(),c}},async flush(){if(r.length===0)return;let a=r.splice(0,r.length);if(e.endpoint){let{formatOtlpTraces:u,exportToEndpoint:f}=await Promise.resolve().then(()=>(R(),U)),p=u(a,e.serviceName,e.serviceVersion);await f(e.endpoint,e.headers??{},p)}}};return i}function _(e,t){let n=T(null);h(()=>{let r=e.startSpan(t,{kind:"internal"});return r.events.push({name:"mount",timestamp:performance.now()}),n.current=r,()=>{n.current&&(n.current.events.push({name:"unmount",timestamp:performance.now()}),d(n.current))}},[])}R();
@@ -4,8 +4,8 @@ import {
4
4
  exportToEndpoint,
5
5
  formatOtlpMetrics,
6
6
  formatOtlpTraces
7
- } from "./esm/chunks/chunk-6IZ45RD4.js";
8
- import "./esm/chunks/chunk-LCSK4XUC.js";
7
+ } from "./esm/chunks/chunk-PJZGQ4ZR.js";
8
+ import "./esm/chunks/chunk-RH3DFT32.js";
9
9
  import {
10
10
  useEffect,
11
11
  useRef
@@ -151,7 +151,7 @@ function createTracer(config) {
151
151
  if (buffer.length === 0) return;
152
152
  const toExport = buffer.splice(0, buffer.length);
153
153
  if (config.endpoint) {
154
- const { formatOtlpTraces: formatOtlpTraces2, exportToEndpoint: exportToEndpoint2 } = await import("../chunks/metrics-J42I3W3C.js");
154
+ const { formatOtlpTraces: formatOtlpTraces2, exportToEndpoint: exportToEndpoint2 } = await import("../chunks/metrics-KVVTHW65.js");
155
155
  const body = formatOtlpTraces2(toExport, config.serviceName, config.serviceVersion);
156
156
  await exportToEndpoint2(config.endpoint, config.headers ?? {}, body);
157
157
  }
@@ -1,2 +1,2 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
- "use strict";var U=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var Xe=(e,t)=>{for(var n in t)U(e,n,{get:t[n],enumerable:!0})},Ze=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ge(t))!Je.call(e,r)&&r!==n&&U(e,r,{get:()=>t[r],enumerable:!(o=ze(t,r))||o.enumerable});return e};var Qe=e=>Ze(U({},"__esModule",{value:!0}),e);var ut={};Xe(ut,{Children:()=>he,Component:()=>P,ErrorBoundary:()=>L,FeatureFlagProvider:()=>X,FeatureGate:()=>Z,Fragment:()=>ce,Link:()=>j,Profiler:()=>Le,PureComponent:()=>k,Route:()=>A,Router:()=>Y,StrictMode:()=>Ne,Suspense:()=>_e,act:()=>He,assertSecureUrl:()=>G,cloneElement:()=>ye,createContext:()=>w,createElement:()=>d,createFactory:()=>ue,createRef:()=>le,forwardRef:()=>fe,getComponentTypeTable:()=>We,h:()=>d,isValidElement:()=>R,lazy:()=>me,matchPath:()=>E,memo:()=>de,resolveComponentId:()=>Ke,secureFetch:()=>M,setComponentIdsEnabled:()=>Be,startTransition:()=>Ae,useCallback:()=>x,useContext:()=>l,useDebugValue:()=>ve,useDeferredValue:()=>Re,useEffect:()=>S,useFeatureFlags:()=>Q,useHead:()=>$,useId:()=>we,useImperativeHandle:()=>ge,useInsertionEffect:()=>Te,useLayoutEffect:()=>Ee,useMemo:()=>b,useNavigate:()=>B,useParams:()=>q,useReducer:()=>Ce,useRef:()=>F,useRouter:()=>H,useState:()=>g,useSyncExternalStore:()=>ke,useTransition:()=>be});module.exports=Qe(ut);var v=Symbol.for("spec.element"),ee=Symbol.for("spec.fragment"),lt=Symbol.for("spec.portal"),te=Symbol.for("spec.provider"),ne=Symbol.for("spec.consumer"),oe=Symbol.for("spec.forward_ref"),re=Symbol.for("spec.memo"),se=Symbol.for("spec.lazy"),ae=Symbol.for("spec.suspense"),ie=Symbol.for("spec.strict_mode"),pe=Symbol.for("spec.profiler");function d(e,t,...n){let o=null,r=null,a={};if(t!=null){t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(r=t.ref);for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&s!=="key"&&s!=="ref"&&s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(a[s]=t[s])}if(n.length===1?a.children=n[0]:n.length>1&&(a.children=n),typeof e=="function"&&e.defaultProps){let s=e.defaultProps;for(let i of Object.keys(s))i!=="__proto__"&&i!=="constructor"&&a[i]===void 0&&(a[i]=s[i])}return{$$typeof:v,type:e,props:a,key:o,ref:r}}function ue(e){return(t,...n)=>d(e,t??null,...n)}var ce=ee;function w(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:te,_context:t},o={$$typeof:ne,_context:t};return t.Provider=n,t.Consumer=o,t}function le(){return{current:null}}function fe(e){return{$$typeof:oe,render:e,displayName:e.displayName||e.name||"ForwardRef"}}function de(e,t){return{$$typeof:re,type:e,compare:t||null,displayName:e.displayName||e.name||"Memo"}}function me(e){let t={_status:"pending",_result:void 0};return{$$typeof:se,_payload:t,_init:()=>{if(t._status==="resolved")return t._result;if(t._status==="rejected")throw t._result;let o=e();throw t._status="pending",o.then(r=>{t._status="resolved",t._result=r.default},r=>{t._status="rejected",t._result=r}),o},displayName:"Lazy"}}function R(e){return typeof e=="object"&&e!==null&&e.$$typeof===v}function ye(e,t,...n){if(!R(e))throw new Error("cloneElement: argument must be a valid SpecifyJS element");let o=e.key,r=e.ref,a={...e.props};if(t!=null){t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(r=t.ref);for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&s!=="key"&&s!=="ref"&&s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(a[s]=t[s])}return n.length===1?a.children=n[0]:n.length>1&&(a.children=n),{$$typeof:v,type:e.type,props:a,key:o,ref:r}}function N(e){let t=[],n=[e];for(;n.length>0;){let o=n.pop();if(Array.isArray(o))for(let r=o.length-1;r>=0;r--)n.push(o[r]);else t.push(o)}return t}function et(e,t){let n=N(e),o=[];for(let r=0;r<n.length;r++){let a=n[r];a==null||typeof a=="boolean"||o.push(t(a,r))}return o}function tt(e,t){let n=N(e),o=0;for(let r of n)r==null||typeof r=="boolean"||t(r,o++)}function nt(e){let t=N(e),n=0;for(let o of t)o!=null&&typeof o!="boolean"&&n++;return n}function ot(e){if(!R(e))throw new Error("Children.only: expected a single SpecifyJS element child");return e}function rt(e){return N(e).filter(n=>n!=null&&typeof n!="boolean")}var he={map:et,forEach:tt,count:nt,only:ot,toArray:rt};var P=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};P.prototype.isSpecComponent=!0;var k=class extends P{shouldComponentUpdate(t,n){return!xe(this.props,t)||!xe(this.state,n)}};k.prototype.isPureSpecComponent=!0;function xe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;let r=e,a=t;for(let s of n)if(!Object.prototype.hasOwnProperty.call(a,s)||!Object.is(r[s],a[s]))return!1;return!0}var L=class extends P{static getDerivedStateFromError(t){return{hasError:!0,error:t}}constructor(t){super(t),this.state={hasError:!1,error:null}}componentDidCatch(t,n){this.props.onError?.(t,n)}render(){return this.state.hasError?this.props.fallback??null:this.props.children??null}};function $(e){let t=F(e);t.current=e;let n=JSON.stringify([e.title,e.description,e.keywords,e.author,e.canonical,e.og,e.twitter,e.httpEquiv,e.meta]);S(()=>{let o=t.current,r=[],a=document.title;if(o.title&&(document.title=o.title,r.push(()=>{document.title=a})),o.description&&r.push(C("name","description",o.description)),o.keywords&&r.push(C("name","keywords",o.keywords)),o.author&&r.push(C("name","author",o.author)),o.canonical){let s=document.createElement("link");s.rel="canonical",s.href=o.canonical,document.head.appendChild(s),r.push(()=>s.remove())}if(o.og)for(let[s,i]of Object.entries(o.og))r.push(C("property",`og:${s}`,i));if(o.twitter)for(let[s,i]of Object.entries(o.twitter))r.push(C("name",`twitter:${s}`,i));if(o.httpEquiv){let s={csp:"Content-Security-Policy",referrer:"Referrer-Policy",contentType:"X-Content-Type-Options",frameOptions:"X-Frame-Options",cacheControl:"Cache-Control"};for(let[i,u]of Object.entries(o.httpEquiv)){if(u===void 0)continue;let p=s[i]??i;r.push(st(p,u))}}if(o.meta)for(let s of o.meta)s.name?r.push(C("name",s.name,s.content)):s.property&&r.push(C("property",s.property,s.content));return()=>{for(let s of r)s()}},[n])}function Pe(e){return e.replace(/["\\]/g,"\\$&")}function C(e,t,n){let o=`meta[${e}="${Pe(t)}"]`,r=document.querySelector(o),a=r!==null,s=r?.content;return r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.content=n,()=>{a&&s!==void 0?r.content=s:a||r.remove()}}function st(e,t){let n=`meta[http-equiv="${Pe(e)}"]`,o=document.querySelector(n),r=o!==null,a=o?.content;return o||(o=document.createElement("meta"),o.setAttribute("http-equiv",e),document.head.appendChild(o)),o.content=t,()=>{r&&a!==void 0?o.content=a:r||o.remove()}}var Se=null;function c(){if(Se===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Se}function g(e){return c().useState(e)}function S(e,t){return c().useEffect(e,t)}function l(e){return c().useContext(e)}function Ce(e,t,n){return c().useReducer(e,t,n)}function x(e,t){return c().useCallback(e,t)}function b(e,t){return c().useMemo(e,t)}function F(e){return c().useRef(e)}function ge(e,t,n){return c().useImperativeHandle(e,t,n)}function Ee(e,t){return c().useLayoutEffect(e,t)}function ve(e,t){return c().useDebugValue(e,t)}function we(){return c().useId()}function Re(e){return c().useDeferredValue(e)}function be(){return c().useTransition()}function ke(e,t,n){return c().useSyncExternalStore(e,t,n)}function Te(e,t){return c().useInsertionEffect(e,t)}var _e=ae;var Ne=ie;var Le=pe;var m=w({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Fe(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Ie={pathname:Fe(),hash:typeof window<"u"?window.location.hash:""},V=new Set;function Me(){Ie={pathname:Fe(),hash:typeof window<"u"?window.location.hash:""};for(let e of V)e()}typeof window<"u"&&window.addEventListener("hashchange",Me);function Oe(e){return V.add(e),()=>{V.delete(e)}}function I(){return Ie}function De(e,t){let n=e.startsWith("#")?e:"#"+e;if(t?.replace){let o=window.location.pathname+window.location.search+n;window.history.replaceState(null,"",o)}else window.location.hash=n;Me()}function Y(e){let[t,n]=g(()=>I().pathname);S(()=>(n(I().pathname),Oe(()=>{n(I().pathname)})),[]);let o=x((...a)=>{De(a[0],a[1])},[]),r=b(()=>({pathname:t,params:{},navigate:o,basePath:""}),[t,o]);return d(m.Provider,{value:r},e.children)}function Ue(e){let t=e.length;for(;t>1&&e.charCodeAt(t-1)===47;)t--;return t===e.length?e:e.slice(0,t)}function E(e,t,n){let o=n?.exact??!1,r=e==="/"?"/":Ue(e),a=t==="/"?"/":Ue(t);if(r==="/"){let h=a==="/";return o&&!h?null:{params:{},isExact:h,path:e,url:"/"}}let s=r.split("/").filter(Boolean),i=a.split("/").filter(Boolean),u=s[s.length-1]==="*";if(!u&&o&&i.length!==s.length||!u&&i.length<s.length)return null;let p={},y=[];for(let h=0;h<s.length;h++){let T=s[h];if(T==="*"){let D=i.slice(h).join("/");return p["*"]=D,{params:p,isExact:!0,path:e,url:"/"+i.join("/")}}if(h>=i.length)return null;let _=i[h];if(T.startsWith(":")){let D=T.slice(1);p[D]=decodeURIComponent(_),y.push(_);continue}if(T.toLowerCase()!==_.toLowerCase())return null;y.push(_)}let f="/"+y.join("/"),O=i.length===s.length;return o&&!O?null:{params:p,isExact:O,path:e,url:f}}function A(e){let t=l(m),n=t.basePath+e.path,o=E(n,t.pathname,{exact:e.exact??!1}),r=b(()=>({pathname:t.pathname,params:{...t.params,...o?o.params:{}},navigate:t.navigate,basePath:o?o.url:t.basePath}),[t.pathname,t.navigate,t.params,t.basePath,o]);if(!o)return null;for(let s of Object.keys(t.params))s in r.params||(r.params[s]=t.params[s]);let a=e.component?d(e.component,{...r.params}):e.children;return d(m.Provider,{value:r},a)}function j(e){let{to:t,className:n,activeClassName:o,exact:r,children:a,...s}=e,i=l(m),u=E(t,i.pathname,{exact:r??!1})!==null,p=x(((...f)=>{f[0].preventDefault(),i.navigate(t)}),[t,i.navigate]),y=[n,u?o:null].filter(Boolean).join(" ")||void 0;return d("a",{...s,href:"#"+t,onClick:p,className:y},a)}function H(){return l(m)}function q(){return l(m).params}function B(){return l(m).navigate}var $e=8;function Ve(){let e=$e;return $e=e===8?16:8,e}var K=4,W=!1;var Ye=[];function Ae(e){let t=K,n=W;K=Ve(),W=!0;try{e()}finally{K=t,W=n,it()}}function it(){let e=Ye;Ye=[];for(let t of e)t()}var je=[];function z(){let e=je;je=[];for(let t of e)t()}function He(e){let t=e();z(),t&&typeof t.then=="function"&&t.then(()=>{z()})}function G(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))return;if(e.startsWith("data:")){if(e.length>1024*1024)throw new Error("[SpecifyJS] secureFetch: data: URI exceeds 1MB limit");return}let t;try{t=new URL(e,typeof window<"u"?window.location.href:void 0)}catch{throw new Error(`[SpecifyJS] secureFetch: unable to validate URL "${e}". Provide a valid absolute HTTPS URL or a relative path.`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase();if(!(n==="localhost"||n==="127.0.0.1"||n==="[::1]"||n==="0.0.0.0"||n.startsWith("127.")))throw n.endsWith(".localhost")?new Error(`[SpecifyJS] SSRF protection: "${e}" uses a .localhost subdomain which resolves to the loopback interface. Use exact "localhost" instead.`):new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}function M(e,t){let n=typeof e=="string"?e:e instanceof URL?e.href:e.url;return G(n),fetch(e,{redirect:"error",...t})}var qe=new Map;var pt=!0;function Be(e){pt=e}function Ke(e){let t=e.match(/^s-(\d+)-(\d+)$/);if(!t||!t[1]||!t[2])return null;let n=parseInt(t[1],10),o=parseInt(t[2],10);for(let r of qe.values())if(r.index===n)return{typeName:r.name,typeIndex:n,instanceId:o};return null}function We(){return qe}var J=w({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function X(e){let[t,n]=g(()=>({...e.defaults})),[o,r]=g(!!e.url);S(()=>{if(!e.url)return;let u=!1;return r(!0),M(e.url).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.json()}).then(p=>{if(!u&&typeof p=="object"&&p!==null){let y={};for(let f of Object.keys(p))f!=="__proto__"&&f!=="constructor"&&f!=="prototype"&&(y[f]=p[f]===!0);n(f=>({...f,...y}))}u||r(!1)}).catch(()=>{u||r(!1)}),()=>{u=!0}},[e.url]);let a=x(((...u)=>{let p=u[0];return t[p]===!0}),[t]),s=x(((...u)=>{let p=u[0],y=u[1];n(f=>({...f,[p]:y}))}),[]),i={flags:t,isEnabled:a,setFlag:s,loading:o};return d(J.Provider,{value:i},e.children)}function Z(e){let{isEnabled:t}=l(J);return t(e.flag)?e.children:e.fallback??null}function Q(){return l(J)}
2
+ "use strict";var U=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var Xe=(e,t)=>{for(var n in t)U(e,n,{get:t[n],enumerable:!0})},Ze=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ge(t))!Je.call(e,r)&&r!==n&&U(e,r,{get:()=>t[r],enumerable:!(o=We(t,r))||o.enumerable});return e};var Qe=e=>Ze(U({},"__esModule",{value:!0}),e);var lt={};Xe(lt,{Children:()=>he,Component:()=>P,ErrorBoundary:()=>L,FeatureFlagProvider:()=>X,FeatureGate:()=>Z,Fragment:()=>ce,Link:()=>j,Profiler:()=>Le,PureComponent:()=>k,Route:()=>Y,Router:()=>A,StrictMode:()=>Ne,Suspense:()=>_e,act:()=>He,assertSecureUrl:()=>G,cloneElement:()=>ye,createContext:()=>b,createElement:()=>d,createFactory:()=>ue,createRef:()=>le,forwardRef:()=>fe,getComponentTypeTable:()=>ze,h:()=>d,isValidElement:()=>w,lazy:()=>me,matchPath:()=>E,memo:()=>de,resolveComponentId:()=>Ke,secureFetch:()=>M,setComponentIdsEnabled:()=>Be,startTransition:()=>Ye,useCallback:()=>x,useContext:()=>l,useDebugValue:()=>ve,useDeferredValue:()=>we,useEffect:()=>S,useFeatureFlags:()=>Q,useHead:()=>$,useId:()=>be,useImperativeHandle:()=>ge,useInsertionEffect:()=>Te,useLayoutEffect:()=>Ee,useMemo:()=>R,useNavigate:()=>B,useParams:()=>q,useReducer:()=>Ce,useRef:()=>F,useRouter:()=>H,useState:()=>g,useSyncExternalStore:()=>ke,useTransition:()=>Re});module.exports=Qe(lt);var v=Symbol.for("spec.element"),ee=Symbol.for("spec.fragment"),dt=Symbol.for("spec.portal"),te=Symbol.for("spec.provider"),ne=Symbol.for("spec.consumer"),oe=Symbol.for("spec.forward_ref"),re=Symbol.for("spec.memo"),se=Symbol.for("spec.lazy"),ae=Symbol.for("spec.suspense"),ie=Symbol.for("spec.strict_mode"),pe=Symbol.for("spec.profiler");function d(e,t,...n){let o=null,r=null,a={};if(t!=null){t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(r=t.ref);for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&s!=="key"&&s!=="ref"&&s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(a[s]=t[s])}if(n.length===1?a.children=n[0]:n.length>1&&(a.children=n),typeof e=="function"&&e.defaultProps){let s=e.defaultProps;for(let i of Object.keys(s))i!=="__proto__"&&i!=="constructor"&&a[i]===void 0&&(a[i]=s[i])}return{$$typeof:v,type:e,props:a,key:o,ref:r}}function ue(e){return(t,...n)=>d(e,t??null,...n)}var ce=ee;function b(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:te,_context:t},o={$$typeof:ne,_context:t};return t.Provider=n,t.Consumer=o,t}function le(){return{current:null}}function fe(e){return{$$typeof:oe,render:e,displayName:e.displayName||e.name||"ForwardRef"}}function de(e,t){return{$$typeof:re,type:e,compare:t||null,displayName:e.displayName||e.name||"Memo"}}function me(e){let t={_status:"pending",_result:void 0};return{$$typeof:se,_payload:t,_init:()=>{if(t._status==="resolved")return t._result;if(t._status==="rejected")throw t._result;let o=e();throw t._status="pending",o.then(r=>{t._status="resolved",t._result=r.default},r=>{t._status="rejected",t._result=r}),o},displayName:"Lazy"}}function w(e){return typeof e=="object"&&e!==null&&e.$$typeof===v}function ye(e,t,...n){if(!w(e))throw new Error("cloneElement: argument must be a valid SpecifyJS element");let o=e.key,r=e.ref,a={...e.props};if(t!=null){t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(r=t.ref);for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&s!=="key"&&s!=="ref"&&s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(a[s]=t[s])}return n.length===1?a.children=n[0]:n.length>1&&(a.children=n),{$$typeof:v,type:e.type,props:a,key:o,ref:r}}function N(e){let t=[],n=[e];for(;n.length>0;){let o=n.pop();if(Array.isArray(o))for(let r=o.length-1;r>=0;r--)n.push(o[r]);else t.push(o)}return t}function et(e,t){let n=N(e),o=[];for(let r=0;r<n.length;r++){let a=n[r];a==null||typeof a=="boolean"||o.push(t(a,r))}return o}function tt(e,t){let n=N(e),o=0;for(let r of n)r==null||typeof r=="boolean"||t(r,o++)}function nt(e){let t=N(e),n=0;for(let o of t)o!=null&&typeof o!="boolean"&&n++;return n}function ot(e){if(!w(e))throw new Error("Children.only: expected a single SpecifyJS element child");return e}function rt(e){return N(e).filter(n=>n!=null&&typeof n!="boolean")}var he={map:et,forEach:tt,count:nt,only:ot,toArray:rt};var P=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};P.prototype.isSpecComponent=!0;var k=class extends P{shouldComponentUpdate(t,n){return!xe(this.props,t)||!xe(this.state,n)}};k.prototype.isPureSpecComponent=!0;function xe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;let r=e,a=t;for(let s of n)if(!Object.prototype.hasOwnProperty.call(a,s)||!Object.is(r[s],a[s]))return!1;return!0}var L=class extends P{static getDerivedStateFromError(t){return{hasError:!0,error:t}}constructor(t){super(t),this.state={hasError:!1,error:null}}componentDidCatch(t,n){this.props.onError?.(t,n)}render(){return this.state.hasError?this.props.fallback??null:this.props.children??null}};function $(e){let t=F(e);t.current=e;let n=JSON.stringify([e.title,e.description,e.keywords,e.author,e.canonical,e.og,e.twitter,e.httpEquiv,e.meta]);S(()=>{let o=t.current,r=[],a=document.title;if(o.title&&(document.title=o.title,r.push(()=>{document.title=a})),o.description&&r.push(C("name","description",o.description)),o.keywords&&r.push(C("name","keywords",o.keywords)),o.author&&r.push(C("name","author",o.author)),o.canonical){let s=document.createElement("link");s.rel="canonical",s.href=o.canonical,document.head.appendChild(s),r.push(()=>s.remove())}if(o.og)for(let[s,i]of Object.entries(o.og))r.push(C("property",`og:${s}`,i));if(o.twitter)for(let[s,i]of Object.entries(o.twitter))r.push(C("name",`twitter:${s}`,i));if(o.httpEquiv){let s={csp:"Content-Security-Policy",referrer:"Referrer-Policy",contentType:"X-Content-Type-Options",frameOptions:"X-Frame-Options",cacheControl:"Cache-Control"};for(let[i,u]of Object.entries(o.httpEquiv)){if(u===void 0)continue;let p=s[i]??i;r.push(st(p,u))}}if(o.meta)for(let s of o.meta)s.name?r.push(C("name",s.name,s.content)):s.property&&r.push(C("property",s.property,s.content));return()=>{for(let s of r)s()}},[n])}function Pe(e){return e.replace(/["\\]/g,"\\$&")}function C(e,t,n){let o=`meta[${e}="${Pe(t)}"]`,r=document.querySelector(o),a=r!==null,s=r?.content;return r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.content=n,()=>{a&&s!==void 0?r.content=s:a||r.remove()}}function st(e,t){let n=`meta[http-equiv="${Pe(e)}"]`,o=document.querySelector(n),r=o!==null,a=o?.content;return o||(o=document.createElement("meta"),o.setAttribute("http-equiv",e),document.head.appendChild(o)),o.content=t,()=>{r&&a!==void 0?o.content=a:r||o.remove()}}var Se=null;function c(){if(Se===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Se}function g(e){return c().useState(e)}function S(e,t){return c().useEffect(e,t)}function l(e){return c().useContext(e)}function Ce(e,t,n){return c().useReducer(e,t,n)}function x(e,t){return c().useCallback(e,t)}function R(e,t){return c().useMemo(e,t)}function F(e){return c().useRef(e)}function ge(e,t,n){return c().useImperativeHandle(e,t,n)}function Ee(e,t){return c().useLayoutEffect(e,t)}function ve(e,t){return c().useDebugValue(e,t)}function be(){return c().useId()}function we(e){return c().useDeferredValue(e)}function Re(){return c().useTransition()}function ke(e,t,n){return c().useSyncExternalStore(e,t,n)}function Te(e,t){return c().useInsertionEffect(e,t)}var _e=ae;var Ne=ie;var Le=pe;var m=b({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Fe(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Ie={pathname:Fe(),hash:typeof window<"u"?window.location.hash:""},V=new Set;function Me(){Ie={pathname:Fe(),hash:typeof window<"u"?window.location.hash:""};for(let e of V)e()}typeof window<"u"&&window.addEventListener("hashchange",Me);function Oe(e){return V.add(e),()=>{V.delete(e)}}function I(){return Ie}function De(e,t){let n=e.startsWith("#")?e:"#"+e;if(t?.replace){let o=window.location.pathname+window.location.search+n;window.history.replaceState(null,"",o)}else window.location.hash=n;Me()}function A(e){let[t,n]=g(()=>I().pathname);S(()=>(n(I().pathname),Oe(()=>{n(I().pathname)})),[]);let o=x((...a)=>{De(a[0],a[1])},[]),r=R(()=>({pathname:t,params:{},navigate:o,basePath:""}),[t,o]);return d(m.Provider,{value:r},e.children)}function Ue(e){let t=e.length;for(;t>1&&e.charCodeAt(t-1)===47;)t--;return t===e.length?e:e.slice(0,t)}function E(e,t,n){let o=n?.exact??!1,r=e==="/"?"/":Ue(e),a=t==="/"?"/":Ue(t);if(r==="/"){let h=a==="/";return o&&!h?null:{params:{},isExact:h,path:e,url:"/"}}let s=r.split("/").filter(Boolean),i=a.split("/").filter(Boolean),u=s[s.length-1]==="*";if(!u&&o&&i.length!==s.length||!u&&i.length<s.length)return null;let p={},y=[];for(let h=0;h<s.length;h++){let T=s[h];if(T==="*"){let D=i.slice(h).join("/");return p["*"]=D,{params:p,isExact:!0,path:e,url:"/"+i.join("/")}}if(h>=i.length)return null;let _=i[h];if(T.startsWith(":")){let D=T.slice(1);p[D]=decodeURIComponent(_),y.push(_);continue}if(T.toLowerCase()!==_.toLowerCase())return null;y.push(_)}let f="/"+y.join("/"),O=i.length===s.length;return o&&!O?null:{params:p,isExact:O,path:e,url:f}}function Y(e){let t=l(m),n=t.basePath+e.path,o=E(n,t.pathname,{exact:e.exact??!1}),r=R(()=>({pathname:t.pathname,params:{...t.params,...o?o.params:{}},navigate:t.navigate,basePath:o?o.url:t.basePath}),[t.pathname,t.navigate,t.params,t.basePath,o]);if(!o)return null;for(let s of Object.keys(t.params))s in r.params||(r.params[s]=t.params[s]);let a=e.component?d(e.component,{...r.params}):e.children;return d(m.Provider,{value:r},a)}function j(e){let{to:t,className:n,activeClassName:o,exact:r,children:a,...s}=e,i=l(m),u=E(t,i.pathname,{exact:r??!1})!==null,p=x(((...f)=>{f[0].preventDefault(),i.navigate(t)}),[t,i.navigate]),y=[n,u?o:null].filter(Boolean).join(" ")||void 0;return d("a",{...s,href:"#"+t,onClick:p,className:y},a)}function H(){return l(m)}function q(){return l(m).params}function B(){return l(m).navigate}var $e=8;function Ve(){let e=$e;return $e=e===8?16:8,e}var K=4,z=!1;var Ae=[];function Ye(e){let t=K,n=z;K=Ve(),z=!0;try{e()}finally{K=t,z=n,it()}}function it(){let e=Ae;Ae=[];for(let t of e)t()}var je=[];function W(){let e=je;je=[];for(let t of e)t()}function He(e){let t=e();W(),t&&typeof t.then=="function"&&t.then(()=>{W()})}var pt=/^127\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;function ut(e){let t=pt.exec(e);return t?Number(t[1])<=255&&Number(t[2])<=255&&Number(t[3])<=255:!1}function G(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))return;if(e.startsWith("data:")){if(e.length>1024*1024)throw new Error("[SpecifyJS] secureFetch: data: URI exceeds 1MB limit");return}let t;try{t=new URL(e,typeof window<"u"?window.location.href:void 0)}catch{throw new Error(`[SpecifyJS] secureFetch: unable to validate URL "${e}". Provide a valid absolute HTTPS URL or a relative path.`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase();if(!(n==="localhost"||n==="127.0.0.1"||n==="[::1]"||n==="0.0.0.0"||ut(n)))throw n.endsWith(".localhost")?new Error(`[SpecifyJS] SSRF protection: "${e}" uses a .localhost subdomain which resolves to the loopback interface. Use exact "localhost" instead.`):new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}function M(e,t){let n=typeof e=="string"?e:e instanceof URL?e.href:e.url;return G(n),fetch(e,{redirect:"error",...t})}var qe=new Map;var ct=!0;function Be(e){ct=e}function Ke(e){let t=e.match(/^s-(\d+)-(\d+)$/);if(!t||!t[1]||!t[2])return null;let n=parseInt(t[1],10),o=parseInt(t[2],10);for(let r of qe.values())if(r.index===n)return{typeName:r.name,typeIndex:n,instanceId:o};return null}function ze(){return qe}var J=b({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function X(e){let[t,n]=g(()=>({...e.defaults})),[o,r]=g(!!e.url);S(()=>{if(!e.url)return;let u=!1;return r(!0),M(e.url).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.json()}).then(p=>{if(!u&&typeof p=="object"&&p!==null){let y={};for(let f of Object.keys(p))f!=="__proto__"&&f!=="constructor"&&f!=="prototype"&&(y[f]=p[f]===!0);n(f=>({...f,...y}))}u||r(!1)}).catch(()=>{u||r(!1)}),()=>{u=!0}},[e.url]);let a=x(((...u)=>{let p=u[0];return t[p]===!0}),[t]),s=x(((...u)=>{let p=u[0],y=u[1];n(f=>({...f,[p]:y}))}),[]),i={flags:t,isEnabled:a,setFlag:s,loading:o};return d(J.Provider,{value:i},e.children)}function Z(e){let{isEnabled:t}=l(J);return t(e.flag)?e.children:e.fallback??null}function Q(){return l(J)}
@@ -24,7 +24,7 @@ import {
24
24
  useNavigate,
25
25
  useParams,
26
26
  useRouter
27
- } from "./esm/chunks/chunk-MWYZOVHI.js";
27
+ } from "./esm/chunks/chunk-PGUFCUSX.js";
28
28
  import {
29
29
  getComponentTypeTable,
30
30
  resolveComponentId,
@@ -43,7 +43,7 @@ import "./esm/chunks/chunk-UJTLBTMV.js";
43
43
  import {
44
44
  assertSecureUrl,
45
45
  secureFetch
46
- } from "./esm/chunks/chunk-LCSK4XUC.js";
46
+ } from "./esm/chunks/chunk-RH3DFT32.js";
47
47
  import {
48
48
  useCallback,
49
49
  useContext,
@@ -1,14 +1,3 @@
1
- /**
2
- * Secure fetch wrapper — enforces HTTPS-only policy.
3
- *
4
- * SpecifyJS prohibits HTTP connections. All network requests must use
5
- * HTTPS or be relative URLs. This prevents data from being transmitted
6
- * in plaintext, protecting against eavesdropping and MITM attacks.
7
- *
8
- * Exceptions:
9
- * - Relative URLs (./path, /path) — resolved by the browser
10
- * - localhost and 127.0.0.1 — development only
11
- */
12
1
  /**
13
2
  * Validate that a URL uses HTTPS or is a relative/localhost URL.
14
3
  * Throws if the URL uses plaintext HTTP.
@@ -1,14 +1,3 @@
1
- /**
2
- * Secure fetch wrapper — enforces HTTPS-only policy.
3
- *
4
- * SpecifyJS prohibits HTTP connections. All network requests must use
5
- * HTTPS or be relative URLs. This prevents data from being transmitted
6
- * in plaintext, protecting against eavesdropping and MITM attacks.
7
- *
8
- * Exceptions:
9
- * - Relative URLs (./path, /path) — resolved by the browser
10
- * - localhost and 127.0.0.1 — development only
11
- */
12
1
  /**
13
2
  * Validate that a URL uses HTTPS or is a relative/localhost URL.
14
3
  * Throws if the URL uses plaintext HTTP.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asymmetric-effort/specifyjs",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "A declarative TypeScript UI framework built for performance and simplicity",
5
5
  "publishConfig": {
6
6
  "access": "public"