import{D as e,_ as t,g as n,j as r,v as i}from"./DsanjglN.js";import{h as a}from"./B_DA9RKE2.js";import"./Cx_-1PHK2.js";import"./BVDTFQLg.js";function o(e){return{traitKey:e.traitKey,traitValue:e.traitValue,confidence:e.confidence,source:e.source,derivedFromMessageId:e.derivedFromMessageId??null,firstObservedAt:new Date(e.firstObservedAt).toISOString(),lastReinforcedAt:new Date(e.lastReinforcedAt).toISOString(),reinforcementCount:e.reinforcementCount,supersededBy:e.supersededBy??null}}async function s(s,c){let l=c?.minConfidence??0,u=c?.includeSuperseded??!1;return(await s.select().from(a).where(u?e(a.confidence,l):i(e(a.confidence,l),r(a.supersededBy))).orderBy(t(a.confidence),n(a.traitKey))).map(o)}export{s as t};