@camstack/addon-admin-ui 1.1.55 → 1.1.56

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.
Files changed (99) hide show
  1. package/dist/assets/{AddLocationWizard-DKMFqTvZ.js → AddLocationWizard-BS_sw-yb.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-B7r7RnCS.js → AddonCollectionPage-B83rtm_P.js} +1 -1
  3. package/dist/assets/Addons-CVIk8bKA.js +1 -0
  4. package/dist/assets/{AdminTabs-DsU1olLw.js → AdminTabs-CGgxIyjn.js} +1 -1
  5. package/dist/assets/{AiProfiles-DbcBYG7x.js → AiProfiles-BiwHduY5.js} +1 -1
  6. package/dist/assets/{BrokerForm-Bof3-RsO.js → BrokerForm-Ce54Djz4.js} +1 -1
  7. package/dist/assets/{Capabilities-CpM6R2iG.js → Capabilities-B5IxdwuN.js} +1 -1
  8. package/dist/assets/{CapabilityBadges-CrG_Gpq2.js → CapabilityBadges-3XeZhtSI.js} +1 -1
  9. package/dist/assets/Cluster-D8rUWJST.js +1 -0
  10. package/dist/assets/ClusterRecordingTab-DX9aLngj.js +1 -0
  11. package/dist/assets/{Dashboard-BLwnF4KK.js → Dashboard-BblDjLKn.js} +1 -1
  12. package/dist/assets/Data-CdLaMkIJ.js +1 -0
  13. package/dist/assets/DetectionIntelligence-D6i0W6kk.js +1 -0
  14. package/dist/assets/DeviceDetail-BYfQe_30.js +2 -0
  15. package/dist/assets/{Devices-1MpXBj6n.js → Devices-x_UPdIGK.js} +1 -1
  16. package/dist/assets/EmbedPlayerPage-Buxyv9Ar.js +1 -0
  17. package/dist/assets/Events-CDDnJ01Z.js +1 -0
  18. package/dist/assets/{FormBuilder-1_hLh6UD.js → FormBuilder-iTpxBqBc.js} +1 -1
  19. package/dist/assets/{Identity-DIIHY4_I.js → Identity-DH41lSfX.js} +1 -1
  20. package/dist/assets/IntegrationDetail-CR5AD5vO.js +1 -0
  21. package/dist/assets/{Integrations-uUU6I8AA.js → Integrations-BDJ1xxLY.js} +1 -1
  22. package/dist/assets/{Integrations-D2UQlymQ.js → Integrations-CV1KBLOI.js} +1 -1
  23. package/dist/assets/{Logs-DklB9pQr.js → Logs-ErbjBqie.js} +1 -1
  24. package/dist/assets/{MotionZonesSettings-Cv4ArwMh.js → MotionZonesSettings-BMPiTO3l.js} +1 -1
  25. package/dist/assets/{MyAccess-DreWB3nL.js → MyAccess-DTt40JO0.js} +1 -1
  26. package/dist/assets/Network-CyPbysr8.js +1 -0
  27. package/dist/assets/{NodeAddonsSettingsPanel-adQJWpFA.js → NodeAddonsSettingsPanel-CFXh9ESA.js} +1 -1
  28. package/dist/assets/{NotificationTargets-BqY-ixcT.js → NotificationTargets-Dgs05HjS.js} +1 -1
  29. package/dist/assets/Pipeline-Dsx-nB1p.js +1 -0
  30. package/dist/assets/{Plates-BDN77UjR.js → Plates-B_BVouJR.js} +1 -1
  31. package/dist/assets/{PrivacyMaskSettings-DtvQVzUm.js → PrivacyMaskSettings-DSSEqXHi.js} +1 -1
  32. package/dist/assets/{ProviderIcon-BvqTmUAe.js → ProviderIcon-BeZnXEB7.js} +1 -1
  33. package/dist/assets/Recordings-H8TXnxuf.js +1 -0
  34. package/dist/assets/ScanNetworkModal-C_pd8W_5.js +1 -0
  35. package/dist/assets/{Settings-Bal6O--f.js → Settings-Cg4clEYW.js} +1 -1
  36. package/dist/assets/{Showroom-CRdx2BE1.js → Showroom-DQuD1mwE.js} +1 -1
  37. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-ByenDxWa.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DqSIGxiA.js} +1 -1
  38. package/dist/assets/{build-cluster-graph-DGTSGb1I.js → build-cluster-graph-D36_rlRB.js} +1 -1
  39. package/dist/assets/circle-check-big-DOCODmhZ.js +1 -0
  40. package/dist/assets/clock-D2H-Andr.js +1 -0
  41. package/dist/assets/{schemas-DSTjX9zr.js → compat-CbwIzIXq.js} +1 -1
  42. package/dist/assets/{copy-BFZ5D4BJ.js → copy-DAnlpNmN.js} +1 -1
  43. package/dist/assets/{debounced-invalidate-B_KsAVGD.js → debounced-invalidate-DkqNPsSh.js} +1 -1
  44. package/dist/assets/{dist-CqgNHN-E.js → dist-Ck-SkmF_.js} +1 -1
  45. package/dist/assets/dist-DZmXEoJH.js +7 -0
  46. package/dist/assets/{download-5vnInJfp.js → download-CTO2YqfN.js} +1 -1
  47. package/dist/assets/{face-bbox-VcgOLkvN.js → face-bbox-Ctmu8UoI.js} +1 -1
  48. package/dist/assets/{hostInit-BKkxJ9TG.js → hostInit-DRnXHdHY.js} +1 -1
  49. package/dist/assets/{index-Cmln2hC6.css → index-9438rY3p.css} +1 -1
  50. package/dist/assets/index-BVO5AjpN.js +4 -0
  51. package/dist/assets/{key-round-76xRX3g6.js → key-round-DY-W0ctm.js} +1 -1
  52. package/dist/assets/{mf-entry-bootstrap-0-4ee9f7b7.js → mf-entry-bootstrap-0-64545043.js} +2 -2
  53. package/dist/assets/{pencil-Gs6QSg5F.js → pencil-fohpLhWe.js} +1 -1
  54. package/dist/assets/{player-overlays-DArwlTAt.js → player-overlays-CDSEY_-X.js} +1 -1
  55. package/dist/assets/plus-CWmuK222.js +1 -0
  56. package/dist/assets/{radio-B4tiKZeo.js → radio-CCbXLtig.js} +1 -1
  57. package/dist/assets/{refresh-cw-dvjeQnSv.js → refresh-cw-7j7eJ_7S.js} +1 -1
  58. package/dist/assets/remoteEntry-BB2jugOV.js +1 -0
  59. package/dist/assets/{rotate-ccw-CdvaSzic.js → rotate-ccw-DVTmMtl2.js} +1 -1
  60. package/dist/assets/rotate-cw-Dl9N7lTh.js +1 -0
  61. package/dist/assets/search-DvkKd5B0.js +1 -0
  62. package/dist/assets/{send-Cn2E54X0.js → send-CyaRM2HU.js} +1 -1
  63. package/dist/assets/{server-Cgdp4E__.js → server-BxecI2el.js} +1 -1
  64. package/dist/assets/square-CzYy8xOt.js +1 -0
  65. package/dist/assets/{square-check-big-j_FMW3NH.js → square-check-big-BsYa2Tzh.js} +1 -1
  66. package/dist/assets/src-DNVzx9ag.js +7 -0
  67. package/dist/assets/src-P2A2VEVG.js +67 -0
  68. package/dist/assets/{upload-BkHF_KcS.js → upload-CYB5H427.js} +1 -1
  69. package/dist/assets/{useDevice-CNEnCHst.js → useDevice-BskeVR-e.js} +1 -1
  70. package/dist/assets/{useEventInvalidation-zuVyeFVc.js → useEventInvalidation-DtNYz-2H.js} +1 -1
  71. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BktxCRjD.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DtiKhSUE.js} +2 -2
  72. package/dist/assets/{wifi-CaslRhpX.js → wifi-D9-_VL0_.js} +1 -1
  73. package/dist/assets/{zap-1sJN7Bvb.js → zap-WiUYl_aC.js} +1 -1
  74. package/dist/index.html +7 -7
  75. package/dist/server/addon.js +193 -5
  76. package/package.json +1 -1
  77. package/dist/assets/Addons-DjQMioo-.js +0 -1
  78. package/dist/assets/Cluster-DGYFlvd-.js +0 -1
  79. package/dist/assets/Data-mjlU3tOI.js +0 -1
  80. package/dist/assets/DetectionIntelligence-BF7VOXIn.js +0 -1
  81. package/dist/assets/DeviceDetail-DHxFHQzX.js +0 -2
  82. package/dist/assets/EmbedPlayerPage-BG2XDJsy.js +0 -1
  83. package/dist/assets/Events-cycfxpUn.js +0 -1
  84. package/dist/assets/IntegrationDetail-ByT41Y57.js +0 -1
  85. package/dist/assets/Network-WAC7AOhT.js +0 -1
  86. package/dist/assets/Pipeline-8ill1YGg.js +0 -1
  87. package/dist/assets/ScanNetworkModal-7FD7LPU3.js +0 -1
  88. package/dist/assets/circle-check-big-CxoqUJ4a.js +0 -1
  89. package/dist/assets/clock-ByHlQpk3.js +0 -1
  90. package/dist/assets/dist-DcJZn370.js +0 -7
  91. package/dist/assets/film-FBIr-9R4.js +0 -1
  92. package/dist/assets/index-B0VBnS5H.js +0 -4
  93. package/dist/assets/plus-ByGzrFiA.js +0 -1
  94. package/dist/assets/remoteEntry-BOwRpCPu.js +0 -1
  95. package/dist/assets/rotate-cw-QbVLxhT1.js +0 -1
  96. package/dist/assets/search-BWa4jUVz.js +0 -1
  97. package/dist/assets/square-B8uQd9s9.js +0 -1
  98. package/dist/assets/src-7HDrFEPH.js +0 -7
  99. package/dist/assets/src-BhRH3dxa.js +0 -67
@@ -61,4 +61,4 @@ var e;function t(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod
61
61
 
62
62
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=g,l=!i.jitless,u=l&&re.value,d=t.catchall,f;e._zod.parse=(i,c)=>{f??=r.value;let p=i.value;return s(p)?l&&u&&c?.async===!1&&c.jitless!==!0?(o||=a(t.shape),i=o(i,c),d?fn([],p,i,c,f,e):i):n(i,c):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function hn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!x(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>w(e,r,a())))}),t)}var gn=t(`$ZodUnion`,(e,t)=>{M.init(e,t),p(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),p(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),p(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),p(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>u(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>hn(t,r,e,i)):hn(o,r,e,i)}}),_n=t(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,gn.init(e,t);let n=e._zod.parse;p(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=c(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!g(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),vn=t(`$ZodIntersection`,(e,t)=>{M.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>yn(e,t,n)):yn(e,i,a)}});function I(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=I(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=I(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),x(e))return e;let o=I(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var bn=t(`$ZodTuple`,(e,t)=>{M.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=xn(n,`optin`),c=xn(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Sn(t,r,e))):Sn(a,r,e)}}return o.length?Promise.all(o).then(()=>Cn(l,r,n,a,c)):Cn(l,r,n,a,c)}});function xn(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Sn(e,t,n){e.issues.length&&t.issues.push(...S(n,e.issues)),t.value[n]=e.value}function Cn(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...S(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var wn=t(`$ZodRecord`,(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let o=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l==`string`||typeof l==`number`||typeof l==`symbol`){c.add(typeof l==`number`?l.toString():l);let s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>w(e,r,a())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:i[l],issues:[]},r);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&n.issues.push(...S(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...S(l,d.issues)),n.value[u]=d.value)}let l;for(let e in i)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&at.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=i[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>w(e,r,a())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...S(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...S(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),Tn=t(`$ZodEnum`,(e,t)=>{M.init(e,t);let n=o(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ae.has(typeof e)).map(e=>typeof e==`string`?v(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),En=t(`$ZodLiteral`,(e,t)=>{if(M.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Dn=t(`$ZodTransform`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,e._zod.parse=(i,a)=>{if(a.direction===`backward`)throw new r(e.constructor.name);let o=t.transform(i.value,i);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(i.value=e,i.fallback=!0,i));if(o instanceof Promise)throw new n;return i.value=o,i.fallback=!0,i}});function On(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var kn=t(`$ZodOptional`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${u(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>On(e,r)):On(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),An=t(`$ZodExactOptional`,(e,t)=>{kn.init(e,t),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),jn=t(`$ZodNullable`,(e,t)=>{M.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${u(e.source)}|null)$`):void 0}),p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Mn=t(`$ZodDefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Nn(e,t)):Nn(r,t)}});function Nn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Pn=t(`$ZodPrefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Fn=t(`$ZodNonOptional`,(e,t)=>{M.init(e,t),p(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>In(t,e)):In(i,e)}});function In(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Ln=t(`$ZodCatch`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>w(e,n,a()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>w(e,n,a()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Rn=t(`$ZodPipe`,(e,t)=>{M.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>L(e,t.in,n)):L(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>L(e,t.out,n)):L(r,t.out,n)}});function L(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var zn=t(`$ZodReadonly`,(e,t)=>{M.init(e,t),p(e._zod,`propValues`,()=>t.innerType._zod.propValues),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`optin`,()=>t.innerType?._zod?.optin),p(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Bn):Bn(r)}});function Bn(e){return e.value=Object.freeze(e.value),e}var Vn=t(`$ZodLazy`,(e,t)=>{M.init(e,t),p(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),p(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),p(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),p(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),p(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Hn=t(`$ZodCustom`,(e,t)=>{A.init(e,t),M.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Un(t,n,r,e));Un(i,n,r,e)}});function Un(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(E(e))}}var Wn,Gn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Kn(){return new Gn}(Wn=globalThis).__zod_globalRegistry??(Wn.__zod_globalRegistry=Kn());var R=globalThis.__zod_globalRegistry;function qn(e,t){return new e({type:`string`,...b(t)})}function Jn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function Yn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function Xn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function Zn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function Qn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function $n(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function er(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function tr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function nr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function rr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function ir(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function ar(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function or(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function sr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function cr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function lr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function ur(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function dr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function fr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function pr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function mr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function hr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function gr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function _r(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function vr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function yr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function br(e,t){return new e({type:`number`,checks:[],...b(t)})}function xr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function Sr(e,t){return new e({type:`boolean`,...b(t)})}function Cr(e,t){return new e({type:`null`,...b(t)})}function wr(e){return new e({type:`any`})}function Tr(e){return new e({type:`unknown`})}function Er(e,t){return new e({type:`never`,...b(t)})}function Dr(e,t){return new e({type:`void`,...b(t)})}function Or(e,t){return new e({type:`date`,...b(t)})}function kr(e,t){return new dt({check:`less_than`,...b(t),value:e,inclusive:!1})}function z(e,t){return new dt({check:`less_than`,...b(t),value:e,inclusive:!0})}function Ar(e,t){return new ft({check:`greater_than`,...b(t),value:e,inclusive:!1})}function B(e,t){return new ft({check:`greater_than`,...b(t),value:e,inclusive:!0})}function jr(e,t){return new pt({check:`multiple_of`,...b(t),value:e})}function Mr(e,t){return new ht({check:`max_length`,...b(t),maximum:e})}function V(e,t){return new gt({check:`min_length`,...b(t),minimum:e})}function Nr(e,t){return new _t({check:`length_equals`,...b(t),length:e})}function Pr(e,t){return new vt({check:`string_format`,format:`regex`,...b(t),pattern:e})}function Fr(e){return new yt({check:`string_format`,format:`lowercase`,...b(e)})}function Ir(e){return new bt({check:`string_format`,format:`uppercase`,...b(e)})}function Lr(e,t){return new xt({check:`string_format`,format:`includes`,...b(t),includes:e})}function Rr(e,t){return new St({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function zr(e,t){return new Ct({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function H(e){return new wt({check:`overwrite`,tx:e})}function Br(e){return H(t=>t.normalize(e))}function Vr(){return H(e=>e.trim())}function Hr(){return H(e=>e.toLowerCase())}function Ur(){return H(e=>e.toUpperCase())}function Wr(){return H(e=>te(e))}function Gr(e,t,n){return new e({type:`array`,element:t,...b(n)})}function Kr(e,t,n){let r=b(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function qr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function Jr(e,t){let n=Yr(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(E(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(E(r))}},e(t.value,t)),t);return n}function Yr(e,t){let n=new A({check:`custom`,...b(t)});return n._zod.check=e,n}function Xr(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??R,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function U(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,U(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&W(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Zr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
63
63
 
64
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Qr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:G(t,`input`,e.processors),output:G(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function W(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return W(r.element,n);if(r.type===`set`)return W(r.valueType,n);if(r.type===`lazy`)return W(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return W(r.innerType,n);if(r.type===`intersection`)return W(r.left,n)||W(r.right,n);if(r.type===`record`||r.type===`map`)return W(r.keyType,n)||W(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:W(r.in,n)||W(r.out,n);if(r.type===`object`){for(let e in r.shape)if(W(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(W(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(W(e,n))return!0;return!!(r.rest&&W(r.rest,n))}return!1}var $r=(e,t={})=>n=>{let r=Xr({...n,processors:t});return U(e,r),Zr(r,e),Qr(r,e)},G=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Xr({...i??{},target:a,io:t,processors:n});return U(e,o),Zr(o,e),Qr(o,e)},ei={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ti=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ei[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ni=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},ri=(e,t,n,r)=>{n.type=`boolean`},ii=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ai=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},oi=(e,t,n,r)=>{n.not={}},si=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},ci=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},li=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ui=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},fi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=U(a.element,t,{...r,path:[...r.path,`items`]})},pi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=U(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=U(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},mi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>U(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},hi=(e,t,n,r)=>{let i=e._zod.def,a=U(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=U(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},gi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>U(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?U(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},_i=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=U(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=U(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=U(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},vi=(e,t,n,r)=>{let i=e._zod.def,a=U(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},yi=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bi=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xi=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Si=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ci=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;U(o,t,r);let s=t.seen.get(e);s.ref=o},wi=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ti=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ei=(e,t,n,r)=>{let i=e._zod.innerType;U(i,t,r);let a=t.seen.get(e);a.ref=i},Di=t(`ZodISODateTime`,(e,t)=>{Rt.init(e,t),Y.init(e,t)});function Oi(e){return gr(Di,e)}var ki=t(`ZodISODate`,(e,t)=>{zt.init(e,t),Y.init(e,t)});function Ai(e){return _r(ki,e)}var ji=t(`ZodISOTime`,(e,t)=>{Bt.init(e,t),Y.init(e,t)});function Mi(e){return vr(ji,e)}var Ni=t(`ZodISODuration`,(e,t)=>{Vt.init(e,t),Y.init(e,t)});function Pi(e){return yr(Ni,e)}var K=t(`ZodError`,(e,t)=>{_e.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>be(e,t)},flatten:{value:t=>ye(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Fi=D(K),Ii=xe(K),Li=O(K),Ri=k(K),zi=we(K),Bi=Te(K),Vi=Ee(K),Hi=De(K),Ui=Oe(K),Wi=ke(K),Gi=Ae(K),Ki=je(K),qi=new WeakMap;function q(e,t,n){let r=Object.getPrototypeOf(e),i=qi.get(r);if(i||(i=new Set,qi.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var J=t(`ZodType`,(e,t)=>(M.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:G(e,`input`),output:G(e,`output`)}}),e.toJSONSchema=$r(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Fi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Li(e,t,n),e.parseAsync=async(t,n)=>Ii(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ri(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zi(e,t,n),e.decode=(t,n)=>Bi(e,t,n),e.encodeAsync=async(t,n)=>Vi(e,t,n),e.decodeAsync=async(t,n)=>Hi(e,t,n),e.safeEncode=(t,n)=>Ui(e,t,n),e.safeDecode=(t,n)=>Wi(e,t,n),e.safeEncodeAsync=async(t,n)=>Gi(e,t,n),e.safeDecodeAsync=async(t,n)=>Ki(e,t,n),q(e,`ZodType`,{check(...e){let t=this.def;return this.clone(h(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Co(e,t))},superRefine(e,t){return this.check(wo(e,t))},overwrite(e){return this.check(H(e))},optional(){return no(this)},exactOptional(){return io(this)},nullable(){return oo(this)},nullish(){return no(oo(this))},nonoptional(e){return po(this,e)},array(){return Fa(this)},or(e){return Ba([this,e])},and(e){return Wa(this,e)},transform(e){return _o(this,eo(e))},default(e){return co(this,e)},prefault(e){return uo(this,e)},catch(e){return ho(this,e)},pipe(e){return _o(this,e)},readonly(){return yo(this)},describe(e){let t=this.clone();return R.add(t,{description:e}),t},meta(...e){if(e.length===0)return R.get(this);let t=this.clone();return R.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return R.get(e)?.description},configurable:!0}),e)),Ji=t(`_ZodString`,(e,t)=>{N.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,q(e,`_ZodString`,{regex(...e){return this.check(Pr(...e))},includes(...e){return this.check(Lr(...e))},startsWith(...e){return this.check(Rr(...e))},endsWith(...e){return this.check(zr(...e))},min(...e){return this.check(V(...e))},max(...e){return this.check(Mr(...e))},length(...e){return this.check(Nr(...e))},nonempty(...e){return this.check(V(1,...e))},lowercase(e){return this.check(Fr(e))},uppercase(e){return this.check(Ir(e))},trim(){return this.check(Vr())},normalize(...e){return this.check(Br(...e))},toLowerCase(){return this.check(Hr())},toUpperCase(){return this.check(Ur())},slugify(){return this.check(Wr())}})}),Yi=t(`ZodString`,(e,t)=>{N.init(e,t),Ji.init(e,t),e.email=t=>e.check(Jn(Zi,t)),e.url=t=>e.check(er(ea,t)),e.jwt=t=>e.check(hr(ga,t)),e.emoji=t=>e.check(tr(na,t)),e.guid=t=>e.check(Yn($i,t)),e.uuid=t=>e.check(Xn(X,t)),e.uuidv4=t=>e.check(Zn(X,t)),e.uuidv6=t=>e.check(Qn(X,t)),e.uuidv7=t=>e.check($n(X,t)),e.nanoid=t=>e.check(nr(ra,t)),e.guid=t=>e.check(Yn($i,t)),e.cuid=t=>e.check(rr(ia,t)),e.cuid2=t=>e.check(ir(aa,t)),e.ulid=t=>e.check(ar(oa,t)),e.base64=t=>e.check(fr(pa,t)),e.base64url=t=>e.check(pr(ma,t)),e.xid=t=>e.check(or(sa,t)),e.ksuid=t=>e.check(sr(ca,t)),e.ipv4=t=>e.check(cr(la,t)),e.ipv6=t=>e.check(lr(ua,t)),e.cidrv4=t=>e.check(ur(da,t)),e.cidrv6=t=>e.check(dr(fa,t)),e.e164=t=>e.check(mr(ha,t)),e.datetime=t=>e.check(Oi(t)),e.date=t=>e.check(Ai(t)),e.time=t=>e.check(Mi(t)),e.duration=t=>e.check(Pi(t))});function Xi(e){return qn(Yi,e)}var Y=t(`ZodStringFormat`,(e,t)=>{P.init(e,t),Ji.init(e,t)}),Zi=t(`ZodEmail`,(e,t)=>{kt.init(e,t),Y.init(e,t)});function Qi(e){return Jn(Zi,e)}var $i=t(`ZodGUID`,(e,t)=>{Dt.init(e,t),Y.init(e,t)}),X=t(`ZodUUID`,(e,t)=>{Ot.init(e,t),Y.init(e,t)}),ea=t(`ZodURL`,(e,t)=>{At.init(e,t),Y.init(e,t)});function ta(e){return er(ea,e)}var na=t(`ZodEmoji`,(e,t)=>{jt.init(e,t),Y.init(e,t)}),ra=t(`ZodNanoID`,(e,t)=>{Mt.init(e,t),Y.init(e,t)}),ia=t(`ZodCUID`,(e,t)=>{Nt.init(e,t),Y.init(e,t)}),aa=t(`ZodCUID2`,(e,t)=>{Pt.init(e,t),Y.init(e,t)}),oa=t(`ZodULID`,(e,t)=>{Ft.init(e,t),Y.init(e,t)}),sa=t(`ZodXID`,(e,t)=>{It.init(e,t),Y.init(e,t)}),ca=t(`ZodKSUID`,(e,t)=>{Lt.init(e,t),Y.init(e,t)}),la=t(`ZodIPv4`,(e,t)=>{Ht.init(e,t),Y.init(e,t)}),ua=t(`ZodIPv6`,(e,t)=>{Ut.init(e,t),Y.init(e,t)}),da=t(`ZodCIDRv4`,(e,t)=>{Wt.init(e,t),Y.init(e,t)}),fa=t(`ZodCIDRv6`,(e,t)=>{Gt.init(e,t),Y.init(e,t)}),pa=t(`ZodBase64`,(e,t)=>{qt.init(e,t),Y.init(e,t)}),ma=t(`ZodBase64URL`,(e,t)=>{Yt.init(e,t),Y.init(e,t)}),ha=t(`ZodE164`,(e,t)=>{Xt.init(e,t),Y.init(e,t)}),ga=t(`ZodJWT`,(e,t)=>{Qt.init(e,t),Y.init(e,t)}),_a=t(`ZodNumber`,(e,t)=>{$t.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),q(e,`ZodNumber`,{gt(e,t){return this.check(Ar(e,t))},gte(e,t){return this.check(B(e,t))},min(e,t){return this.check(B(e,t))},lt(e,t){return this.check(kr(e,t))},lte(e,t){return this.check(z(e,t))},max(e,t){return this.check(z(e,t))},int(e){return this.check(ba(e))},safe(e){return this.check(ba(e))},positive(e){return this.check(Ar(0,e))},nonnegative(e){return this.check(B(0,e))},negative(e){return this.check(kr(0,e))},nonpositive(e){return this.check(z(0,e))},multipleOf(e,t){return this.check(jr(e,t))},step(e,t){return this.check(jr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function va(e){return br(_a,e)}var ya=t(`ZodNumberFormat`,(e,t)=>{en.init(e,t),_a.init(e,t)});function ba(e){return xr(ya,e)}var xa=t(`ZodBoolean`,(e,t)=>{tn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ri(e,t,n,r)});function Sa(e){return Sr(xa,e)}var Ca=t(`ZodNull`,(e,t)=>{nn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r)});function wa(e){return Cr(Ca,e)}var Ta=t(`ZodAny`,(e,t)=>{rn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ea(){return wr(Ta)}var Da=t(`ZodUnknown`,(e,t)=>{an.init(e,t),J.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Z(){return Tr(Da)}var Oa=t(`ZodNever`,(e,t)=>{on.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r)});function ka(e){return Er(Oa,e)}var Aa=t(`ZodVoid`,(e,t)=>{sn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r)});function ja(e){return Dr(Aa,e)}var Ma=t(`ZodDate`,(e,t)=>{cn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),e.min=(t,n)=>e.check(B(t,n)),e.max=(t,n)=>e.check(z(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Na(e){return Or(Ma,e)}var Pa=t(`ZodArray`,(e,t)=>{un.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e.element=t.element,q(e,`ZodArray`,{min(e,t){return this.check(V(e,t))},nonempty(e){return this.check(V(1,e))},max(e,t){return this.check(Mr(e,t))},length(e,t){return this.check(Nr(e,t))},unwrap(){return this.element}})});function Fa(e,t){return Gr(Pa,e,t)}var Ia=t(`ZodObject`,(e,t)=>{mn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),p(e,`shape`,()=>t.shape),q(e,`ZodObject`,{keyof(){return Xa(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Z()})},loose(){return this.clone({...this._zod.def,catchall:Z()})},strict(){return this.clone({...this._zod.def,catchall:ka()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ue(this,e)},safeExtend(e){return de(this,e)},merge(e){return fe(this,e)},pick(e){return ce(this,e)},omit(e){return le(this,e)},partial(...e){return pe(to,this,e[0])},required(...e){return me(fo,this,e[0])}})});function La(e,t){return new Ia({type:`object`,shape:e??{},...b(t)})}function Ra(e,t){return new Ia({type:`object`,shape:e,catchall:Z(),...b(t)})}var za=t(`ZodUnion`,(e,t)=>{gn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.options=t.options});function Ba(e,t){return new za({type:`union`,options:e,...b(t)})}var Va=t(`ZodDiscriminatedUnion`,(e,t)=>{za.init(e,t),_n.init(e,t)});function Ha(e,t,n){return new Va({type:`union`,options:t,discriminator:e,...b(n)})}var Ua=t(`ZodIntersection`,(e,t)=>{vn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function Wa(e,t){return new Ua({type:`intersection`,left:e,right:t})}var Ga=t(`ZodTuple`,(e,t)=>{bn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Ka(e,t,n){let r=t instanceof M;return new Ga({type:`tuple`,items:e,rest:r?t:null,...b(r?n:t)})}var qa=t(`ZodRecord`,(e,t)=>{wn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ja(e,t,n){return!t||!t._zod?new qa({type:`record`,keyType:Xi(),valueType:e,...b(t)}):new qa({type:`record`,keyType:e,valueType:t,...b(n)})}function Ya(e,t,n){let r=y(e);return r._zod.values=void 0,new qa({type:`record`,keyType:r,valueType:t,...b(n)})}var Q=t(`ZodEnum`,(e,t)=>{Tn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Q({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Q({...t,checks:[],...b(r),entries:i})}});function Xa(e,t){return new Q({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var Za=t(`ZodLiteral`,(e,t)=>{En.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Qa(e,t){return new Za({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var $a=t(`ZodTransform`,(e,t)=>{Dn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e._zod.parse=(n,i)=>{if(i.direction===`backward`)throw new r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(E(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(E(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}});function eo(e){return new $a({type:`transform`,transform:e})}var to=t(`ZodOptional`,(e,t)=>{kn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function no(e){return new to({type:`optional`,innerType:e})}var ro=t(`ZodExactOptional`,(e,t)=>{An.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function io(e){return new ro({type:`optional`,innerType:e})}var ao=t(`ZodNullable`,(e,t)=>{jn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oo(e){return new ao({type:`nullable`,innerType:e})}var so=t(`ZodDefault`,(e,t)=>{Mn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function co(e,t){return new so({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var lo=t(`ZodPrefault`,(e,t)=>{Pn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uo(e,t){return new lo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var fo=t(`ZodNonOptional`,(e,t)=>{Fn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function po(e,t){return new fo({type:`nonoptional`,innerType:e,...b(t)})}var mo=t(`ZodCatch`,(e,t)=>{Ln.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ho(e,t){return new mo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var go=t(`ZodPipe`,(e,t)=>{Rn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.in=t.in,e.out=t.out});function _o(e,t){return new go({type:`pipe`,in:e,out:t})}var vo=t(`ZodReadonly`,(e,t)=>{zn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yo(e){return new vo({type:`readonly`,innerType:e})}var bo=t(`ZodLazy`,(e,t)=>{Vn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function xo(e){return new bo({type:`lazy`,getter:e})}var $=t(`ZodCustom`,(e,t)=>{Hn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r)});function So(e,t){return Kr($,e??(()=>!0),t)}function Co(e,t={}){return qr($,e,t)}function wo(e,t){return Jr(e,t)}function To(e,t={}){let n=new $({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...b(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}export{Ba as A,Ra as C,Ja as D,Ya as E,ta as M,Xi as O,Qa as S,La as T,So as _,ao as a,Qi as b,to as c,To as d,wa as f,Sa as g,Fa as h,Q as i,Z as j,Ka as k,Yi as l,Ea as m,xa as n,_a as o,ja as p,so as r,Ia as s,Pa as t,Xa as u,Na as v,va as w,xo as x,Ha as y};
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Qr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:G(t,`input`,e.processors),output:G(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function W(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return W(r.element,n);if(r.type===`set`)return W(r.valueType,n);if(r.type===`lazy`)return W(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return W(r.innerType,n);if(r.type===`intersection`)return W(r.left,n)||W(r.right,n);if(r.type===`record`||r.type===`map`)return W(r.keyType,n)||W(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:W(r.in,n)||W(r.out,n);if(r.type===`object`){for(let e in r.shape)if(W(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(W(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(W(e,n))return!0;return!!(r.rest&&W(r.rest,n))}return!1}var $r=(e,t={})=>n=>{let r=Xr({...n,processors:t});return U(e,r),Zr(r,e),Qr(r,e)},G=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Xr({...i??{},target:a,io:t,processors:n});return U(e,o),Zr(o,e),Qr(o,e)},ei={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ti=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ei[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ni=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},ri=(e,t,n,r)=>{n.type=`boolean`},ii=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ai=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},oi=(e,t,n,r)=>{n.not={}},si=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},ci=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},li=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ui=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},fi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=U(a.element,t,{...r,path:[...r.path,`items`]})},pi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=U(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=U(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},mi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>U(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},hi=(e,t,n,r)=>{let i=e._zod.def,a=U(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=U(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},gi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>U(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?U(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},_i=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=U(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=U(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=U(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},vi=(e,t,n,r)=>{let i=e._zod.def,a=U(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},yi=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bi=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xi=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Si=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ci=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;U(o,t,r);let s=t.seen.get(e);s.ref=o},wi=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ti=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ei=(e,t,n,r)=>{let i=e._zod.innerType;U(i,t,r);let a=t.seen.get(e);a.ref=i},Di=t(`ZodISODateTime`,(e,t)=>{Rt.init(e,t),Y.init(e,t)});function Oi(e){return gr(Di,e)}var ki=t(`ZodISODate`,(e,t)=>{zt.init(e,t),Y.init(e,t)});function Ai(e){return _r(ki,e)}var ji=t(`ZodISOTime`,(e,t)=>{Bt.init(e,t),Y.init(e,t)});function Mi(e){return vr(ji,e)}var Ni=t(`ZodISODuration`,(e,t)=>{Vt.init(e,t),Y.init(e,t)});function Pi(e){return yr(Ni,e)}var K=t(`ZodError`,(e,t)=>{_e.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>be(e,t)},flatten:{value:t=>ye(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Fi=D(K),Ii=xe(K),Li=O(K),Ri=k(K),zi=we(K),Bi=Te(K),Vi=Ee(K),Hi=De(K),Ui=Oe(K),Wi=ke(K),Gi=Ae(K),Ki=je(K),qi=new WeakMap;function q(e,t,n){let r=Object.getPrototypeOf(e),i=qi.get(r);if(i||(i=new Set,qi.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var J=t(`ZodType`,(e,t)=>(M.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:G(e,`input`),output:G(e,`output`)}}),e.toJSONSchema=$r(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Fi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Li(e,t,n),e.parseAsync=async(t,n)=>Ii(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ri(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zi(e,t,n),e.decode=(t,n)=>Bi(e,t,n),e.encodeAsync=async(t,n)=>Vi(e,t,n),e.decodeAsync=async(t,n)=>Hi(e,t,n),e.safeEncode=(t,n)=>Ui(e,t,n),e.safeDecode=(t,n)=>Wi(e,t,n),e.safeEncodeAsync=async(t,n)=>Gi(e,t,n),e.safeDecodeAsync=async(t,n)=>Ki(e,t,n),q(e,`ZodType`,{check(...e){let t=this.def;return this.clone(h(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Co(e,t))},superRefine(e,t){return this.check(wo(e,t))},overwrite(e){return this.check(H(e))},optional(){return no(this)},exactOptional(){return io(this)},nullable(){return oo(this)},nullish(){return no(oo(this))},nonoptional(e){return po(this,e)},array(){return Fa(this)},or(e){return Ba([this,e])},and(e){return Wa(this,e)},transform(e){return _o(this,eo(e))},default(e){return co(this,e)},prefault(e){return uo(this,e)},catch(e){return ho(this,e)},pipe(e){return _o(this,e)},readonly(){return yo(this)},describe(e){let t=this.clone();return R.add(t,{description:e}),t},meta(...e){if(e.length===0)return R.get(this);let t=this.clone();return R.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return R.get(e)?.description},configurable:!0}),e)),Ji=t(`_ZodString`,(e,t)=>{N.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,q(e,`_ZodString`,{regex(...e){return this.check(Pr(...e))},includes(...e){return this.check(Lr(...e))},startsWith(...e){return this.check(Rr(...e))},endsWith(...e){return this.check(zr(...e))},min(...e){return this.check(V(...e))},max(...e){return this.check(Mr(...e))},length(...e){return this.check(Nr(...e))},nonempty(...e){return this.check(V(1,...e))},lowercase(e){return this.check(Fr(e))},uppercase(e){return this.check(Ir(e))},trim(){return this.check(Vr())},normalize(...e){return this.check(Br(...e))},toLowerCase(){return this.check(Hr())},toUpperCase(){return this.check(Ur())},slugify(){return this.check(Wr())}})}),Yi=t(`ZodString`,(e,t)=>{N.init(e,t),Ji.init(e,t),e.email=t=>e.check(Jn(Zi,t)),e.url=t=>e.check(er(ea,t)),e.jwt=t=>e.check(hr(ga,t)),e.emoji=t=>e.check(tr(na,t)),e.guid=t=>e.check(Yn($i,t)),e.uuid=t=>e.check(Xn(X,t)),e.uuidv4=t=>e.check(Zn(X,t)),e.uuidv6=t=>e.check(Qn(X,t)),e.uuidv7=t=>e.check($n(X,t)),e.nanoid=t=>e.check(nr(ra,t)),e.guid=t=>e.check(Yn($i,t)),e.cuid=t=>e.check(rr(ia,t)),e.cuid2=t=>e.check(ir(aa,t)),e.ulid=t=>e.check(ar(oa,t)),e.base64=t=>e.check(fr(pa,t)),e.base64url=t=>e.check(pr(ma,t)),e.xid=t=>e.check(or(sa,t)),e.ksuid=t=>e.check(sr(ca,t)),e.ipv4=t=>e.check(cr(la,t)),e.ipv6=t=>e.check(lr(ua,t)),e.cidrv4=t=>e.check(ur(da,t)),e.cidrv6=t=>e.check(dr(fa,t)),e.e164=t=>e.check(mr(ha,t)),e.datetime=t=>e.check(Oi(t)),e.date=t=>e.check(Ai(t)),e.time=t=>e.check(Mi(t)),e.duration=t=>e.check(Pi(t))});function Xi(e){return qn(Yi,e)}var Y=t(`ZodStringFormat`,(e,t)=>{P.init(e,t),Ji.init(e,t)}),Zi=t(`ZodEmail`,(e,t)=>{kt.init(e,t),Y.init(e,t)});function Qi(e){return Jn(Zi,e)}var $i=t(`ZodGUID`,(e,t)=>{Dt.init(e,t),Y.init(e,t)}),X=t(`ZodUUID`,(e,t)=>{Ot.init(e,t),Y.init(e,t)}),ea=t(`ZodURL`,(e,t)=>{At.init(e,t),Y.init(e,t)});function ta(e){return er(ea,e)}var na=t(`ZodEmoji`,(e,t)=>{jt.init(e,t),Y.init(e,t)}),ra=t(`ZodNanoID`,(e,t)=>{Mt.init(e,t),Y.init(e,t)}),ia=t(`ZodCUID`,(e,t)=>{Nt.init(e,t),Y.init(e,t)}),aa=t(`ZodCUID2`,(e,t)=>{Pt.init(e,t),Y.init(e,t)}),oa=t(`ZodULID`,(e,t)=>{Ft.init(e,t),Y.init(e,t)}),sa=t(`ZodXID`,(e,t)=>{It.init(e,t),Y.init(e,t)}),ca=t(`ZodKSUID`,(e,t)=>{Lt.init(e,t),Y.init(e,t)}),la=t(`ZodIPv4`,(e,t)=>{Ht.init(e,t),Y.init(e,t)}),ua=t(`ZodIPv6`,(e,t)=>{Ut.init(e,t),Y.init(e,t)}),da=t(`ZodCIDRv4`,(e,t)=>{Wt.init(e,t),Y.init(e,t)}),fa=t(`ZodCIDRv6`,(e,t)=>{Gt.init(e,t),Y.init(e,t)}),pa=t(`ZodBase64`,(e,t)=>{qt.init(e,t),Y.init(e,t)}),ma=t(`ZodBase64URL`,(e,t)=>{Yt.init(e,t),Y.init(e,t)}),ha=t(`ZodE164`,(e,t)=>{Xt.init(e,t),Y.init(e,t)}),ga=t(`ZodJWT`,(e,t)=>{Qt.init(e,t),Y.init(e,t)}),_a=t(`ZodNumber`,(e,t)=>{$t.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),q(e,`ZodNumber`,{gt(e,t){return this.check(Ar(e,t))},gte(e,t){return this.check(B(e,t))},min(e,t){return this.check(B(e,t))},lt(e,t){return this.check(kr(e,t))},lte(e,t){return this.check(z(e,t))},max(e,t){return this.check(z(e,t))},int(e){return this.check(ba(e))},safe(e){return this.check(ba(e))},positive(e){return this.check(Ar(0,e))},nonnegative(e){return this.check(B(0,e))},negative(e){return this.check(kr(0,e))},nonpositive(e){return this.check(z(0,e))},multipleOf(e,t){return this.check(jr(e,t))},step(e,t){return this.check(jr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function va(e){return br(_a,e)}var ya=t(`ZodNumberFormat`,(e,t)=>{en.init(e,t),_a.init(e,t)});function ba(e){return xr(ya,e)}var xa=t(`ZodBoolean`,(e,t)=>{tn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ri(e,t,n,r)});function Sa(e){return Sr(xa,e)}var Ca=t(`ZodNull`,(e,t)=>{nn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r)});function wa(e){return Cr(Ca,e)}var Ta=t(`ZodAny`,(e,t)=>{rn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ea(){return wr(Ta)}var Da=t(`ZodUnknown`,(e,t)=>{an.init(e,t),J.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Z(){return Tr(Da)}var Oa=t(`ZodNever`,(e,t)=>{on.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r)});function ka(e){return Er(Oa,e)}var Aa=t(`ZodVoid`,(e,t)=>{sn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r)});function ja(e){return Dr(Aa,e)}var Ma=t(`ZodDate`,(e,t)=>{cn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),e.min=(t,n)=>e.check(B(t,n)),e.max=(t,n)=>e.check(z(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Na(e){return Or(Ma,e)}var Pa=t(`ZodArray`,(e,t)=>{un.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e.element=t.element,q(e,`ZodArray`,{min(e,t){return this.check(V(e,t))},nonempty(e){return this.check(V(1,e))},max(e,t){return this.check(Mr(e,t))},length(e,t){return this.check(Nr(e,t))},unwrap(){return this.element}})});function Fa(e,t){return Gr(Pa,e,t)}var Ia=t(`ZodObject`,(e,t)=>{mn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),p(e,`shape`,()=>t.shape),q(e,`ZodObject`,{keyof(){return Xa(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Z()})},loose(){return this.clone({...this._zod.def,catchall:Z()})},strict(){return this.clone({...this._zod.def,catchall:ka()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ue(this,e)},safeExtend(e){return de(this,e)},merge(e){return fe(this,e)},pick(e){return ce(this,e)},omit(e){return le(this,e)},partial(...e){return pe(to,this,e[0])},required(...e){return me(fo,this,e[0])}})});function La(e,t){return new Ia({type:`object`,shape:e??{},...b(t)})}function Ra(e,t){return new Ia({type:`object`,shape:e,catchall:Z(),...b(t)})}var za=t(`ZodUnion`,(e,t)=>{gn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.options=t.options});function Ba(e,t){return new za({type:`union`,options:e,...b(t)})}var Va=t(`ZodDiscriminatedUnion`,(e,t)=>{za.init(e,t),_n.init(e,t)});function Ha(e,t,n){return new Va({type:`union`,options:t,discriminator:e,...b(n)})}var Ua=t(`ZodIntersection`,(e,t)=>{vn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function Wa(e,t){return new Ua({type:`intersection`,left:e,right:t})}var Ga=t(`ZodTuple`,(e,t)=>{bn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Ka(e,t,n){let r=t instanceof M;return new Ga({type:`tuple`,items:e,rest:r?t:null,...b(r?n:t)})}var qa=t(`ZodRecord`,(e,t)=>{wn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ja(e,t,n){return!t||!t._zod?new qa({type:`record`,keyType:Xi(),valueType:e,...b(t)}):new qa({type:`record`,keyType:e,valueType:t,...b(n)})}function Ya(e,t,n){let r=y(e);return r._zod.values=void 0,new qa({type:`record`,keyType:r,valueType:t,...b(n)})}var Q=t(`ZodEnum`,(e,t)=>{Tn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Q({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Q({...t,checks:[],...b(r),entries:i})}});function Xa(e,t){return new Q({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var Za=t(`ZodLiteral`,(e,t)=>{En.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Qa(e,t){return new Za({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var $a=t(`ZodTransform`,(e,t)=>{Dn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e._zod.parse=(n,i)=>{if(i.direction===`backward`)throw new r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(E(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(E(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}});function eo(e){return new $a({type:`transform`,transform:e})}var to=t(`ZodOptional`,(e,t)=>{kn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function no(e){return new to({type:`optional`,innerType:e})}var ro=t(`ZodExactOptional`,(e,t)=>{An.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function io(e){return new ro({type:`optional`,innerType:e})}var ao=t(`ZodNullable`,(e,t)=>{jn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oo(e){return new ao({type:`nullable`,innerType:e})}var so=t(`ZodDefault`,(e,t)=>{Mn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function co(e,t){return new so({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var lo=t(`ZodPrefault`,(e,t)=>{Pn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uo(e,t){return new lo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var fo=t(`ZodNonOptional`,(e,t)=>{Fn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function po(e,t){return new fo({type:`nonoptional`,innerType:e,...b(t)})}var mo=t(`ZodCatch`,(e,t)=>{Ln.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ho(e,t){return new mo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var go=t(`ZodPipe`,(e,t)=>{Rn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.in=t.in,e.out=t.out});function _o(e,t){return new go({type:`pipe`,in:e,out:t})}var vo=t(`ZodReadonly`,(e,t)=>{zn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yo(e){return new vo({type:`readonly`,innerType:e})}var bo=t(`ZodLazy`,(e,t)=>{Vn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function xo(e){return new bo({type:`lazy`,getter:e})}var $=t(`ZodCustom`,(e,t)=>{Hn.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r)});function So(e,t){return Kr($,e??(()=>!0),t)}function Co(e,t={}){return qr($,e,t)}function wo(e,t){return Jr(e,t)}function To(e,t={}){let n=new $({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...b(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Eo={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},Do;Do||={};export{Ka as A,Qa as C,Ya as D,La as E,Z as M,ta as N,Ja as O,xo as S,va as T,Sa as _,Q as a,Ha as b,Ia as c,Xa as d,To as f,Fa as g,Ea as h,so as i,Ba as j,Xi as k,to as l,ja as m,Pa as n,ao as o,wa as p,xa as r,_a as s,Eo as t,Yi as u,So as v,Ra as w,Qi as x,Na as y};
@@ -1 +1 @@
1
- import{U as e}from"./index-B0VBnS5H.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t};
1
+ import{W as e}from"./index-BVO5AjpN.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e,Q as t,S as n,W as r,q as i,x as a,z as o}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{F as s,I as c,N as l,P as u,R as d,U as f}from"./index-B0VBnS5H.js";var p=f(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]);t();var m={fromMs:null,toMs:null},h=36e5,g=24*h;function _(e,t){switch(e){case`24h`:return{fromMs:t-g,toMs:null};case`7d`:return{fromMs:t-7*g,toMs:null};case`30d`:return{fromMs:t-30*g,toMs:null};case`all`:return m}}function v(e){return e.fromMs!==null||e.toMs!==null}function y(e,t){return v(t)?e.filter(e=>!(t.fromMs!==null&&e.timestamp<t.fromMs||t.toMs!==null&&e.timestamp>t.toMs)):[...e]}function b(e,t){return t.size===0?[...e]:e.filter(e=>t.has(e.deviceId))}function x(e){let t=new Set,n=[];for(let r of e)t.has(r.deviceId)||(t.add(r.deviceId),n.push(r.deviceId));return n}function S(e){if(!e)return null;let t=Date.parse(`${e}T00:00:00`);return Number.isNaN(t)?null:t}function C(e){if(!e)return null;let t=Date.parse(`${e}T23:59:59.999`);return Number.isNaN(t)?null:t}function w(e,t){if(!Number.isFinite(e)||e<=0)return`—`;let n=t-e;return n<6e4?`just now`:n<h?`${String(Math.floor(n/6e4))}m ago`:n<g?`${String(Math.floor(n/h))}h ago`:n<7*g?`${String(Math.floor(n/g))}d ago`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function T(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function E(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function D({cameras:t,selected:r,onChange:l}){let[u,f]=i(!1),p=e(null);o(()=>{if(!u)return;function e(e){p.current&&e.target instanceof Node&&!p.current.contains(e.target)&&f(!1)}function t(e){e.key===`Escape`&&f(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[u]);function m(e){let t=new Set(r);t.has(e)?t.delete(e):t.add(e),l(t)}let h=r.size,g=h===0?`All cameras`:h===1?t.find(e=>r.has(e.id))?.name??`1 camera`:`${String(h)} cameras`;return n(`div`,{ref:p,className:`relative`,children:[n(`button`,{type:`button`,onClick:()=>f(e=>!e),disabled:t.length===0,className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs transition-colors disabled:opacity-40 ${h>0?`border-primary/40 bg-primary/8 text-primary`:`border-border text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[a(d,{className:`h-3.5 w-3.5`}),a(`span`,{className:`max-w-[10rem] truncate`,children:g}),a(s,{className:`h-3 w-3 opacity-70`})]}),u&&n(`div`,{className:`absolute left-0 z-30 mt-1 max-h-64 w-[min(15rem,calc(100vw-1.5rem))] overflow-y-auto rounded-md border border-border bg-surface p-1 shadow-lg shadow-black/30`,children:[h>0&&a(`button`,{type:`button`,onClick:()=>l(new Set),className:`mb-1 w-full rounded px-2 py-1 text-left text-[11px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,children:`Clear selection`}),t.map(e=>{let t=r.has(e.id);return n(`button`,{type:`button`,onClick:()=>m(e.id),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${t?`bg-primary/10 text-primary`:`text-foreground hover:bg-surface-hover`}`,children:[a(`span`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border ${t?`border-primary bg-primary text-white`:`border-border`}`,children:t&&a(c,{className:`h-2.5 w-2.5`})}),a(`span`,{className:`truncate`,children:e.name})]},e.id)})]})]})}t();var O=[{label:`24h`,value:`24h`},{label:`7d`,value:`7d`},{label:`30d`,value:`30d`},{label:`All`,value:`all`}];function k({onChange:e}){let[t,r]=i(`all`),[o,s]=i(``),[c,l]=i(``);function u(t){r(t),s(``),l(``),e(_(t,Date.now()))}function d(t,n){r(`custom`),s(t),l(n),e({fromMs:S(t),toMs:C(n)})}let f=`rounded-md border border-border bg-surface px-2 py-1.5 text-[11px] text-foreground outline-none focus:border-primary [color-scheme:light] dark:[color-scheme:dark]`;return n(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[a(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:O.map(e=>a(`button`,{type:`button`,onClick:()=>u(e.value),className:`rounded px-2.5 py-1 text-[11px] transition-colors ${t===e.value?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:e.label},e.value))}),n(`div`,{className:`flex items-center gap-1`,children:[a(`input`,{type:`date`,"aria-label":`From date`,value:o,max:c||void 0,onChange:e=>d(e.target.value,c),className:`${f} ${t===`custom`&&o?`border-primary/50`:``}`}),a(`span`,{className:`text-[11px] text-foreground-subtle`,children:`→`}),a(`input`,{type:`date`,"aria-label":`To date`,value:c,min:o||void 0,onChange:e=>d(o,e.target.value),className:`${f} ${t===`custom`&&c?`border-primary/50`:``}`})]})]})}t();var A=2.6;function j({src:e,alt:t,className:r,overlay:s,fit:c=`contain`}){let[l,u]=i(!1),[d,f]=i(`50% 50%`);o(()=>{u(!1),f(`50% 50%`)},[e]);function p(e){if(!l){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*100,r=(e.clientY-t.top)/t.height*100;f(`${String(n)}% ${String(r)}%`)}u(e=>!e)}let m=c===`natural`;return a(`div`,{className:`relative overflow-hidden bg-background ${r??``}`,onClick:p,children:n(`div`,{className:`relative select-none transition-transform duration-200 ease-out ${m?`w-full`:`h-full w-full`} ${l?`cursor-zoom-out`:`cursor-zoom-in`}`,style:{transformOrigin:d,transform:l?`scale(${String(A)})`:`scale(1)`},children:[a(`img`,{src:e,alt:t,draggable:!1,className:m?`block h-auto w-full object-contain`:`h-full w-full object-contain`}),s]})})}var M=2;function N(e,t){if(t<=1)return[{kind:`page`,n:1}];if(t<=7){let e=[];for(let n=1;n<=t;n++)e.push({kind:`page`,n});return e}let n=[],r=Math.max(2,e-M),i=Math.min(t-1,e+M);n.push({kind:`page`,n:1}),r>2&&n.push({kind:`ellipsis`,side:`left`});for(let e=r;e<=i;e++)n.push({kind:`page`,n:e});return i<t-1&&n.push({kind:`ellipsis`,side:`right`}),n.push({kind:`page`,n:t}),n}function P({currentPage:e,totalItems:t,pageSize:r,onPageChange:i,itemNoun:o=`items`}){if(t<=r)return null;let s=Math.ceil(t/r),c=(e-1)*r+1,d=Math.min(e*r,t),f=N(e,s),p=`inline-flex h-7 min-w-7 items-center justify-center rounded-md px-2 text-[11px] transition-colors disabled:opacity-40`;return n(`div`,{className:`flex items-center justify-between gap-4 flex-wrap pt-2 text-[11px] text-foreground-subtle`,children:[n(`span`,{children:[`Showing `,c,`–`,d,` of `,t,` `,o]}),n(`div`,{className:`flex items-center gap-1`,children:[a(`button`,{type:`button`,className:`${p} hover:bg-surface-hover`,onClick:()=>i(e-1),disabled:e<=1,"aria-label":`Previous page`,children:a(u,{className:`h-3.5 w-3.5`})}),f.map(t=>t.kind===`ellipsis`?a(`span`,{className:`px-1 opacity-60`,children:`…`},`ellipsis-${t.side}`):a(`button`,{type:`button`,className:`${p} ${t.n===e?`bg-primary/12 text-primary font-medium`:`hover:bg-surface-hover hover:text-foreground`}`,onClick:()=>i(t.n),"aria-current":t.n===e?`page`:void 0,children:t.n},t.n)),a(`button`,{type:`button`,className:`${p} hover:bg-surface-hover`,onClick:()=>i(e+1),disabled:e>=s,"aria-label":`Next page`,children:a(l,{className:`h-3.5 w-3.5`})})]})]})}t();function F(e,t,n){let[a,s]=i(1);o(()=>{s(1)},[n]);let c=e.length,l=Math.max(1,Math.ceil(c/t)),u=Math.min(a,l);return o(()=>{u!==a&&s(u)},[u,a]),{page:u,setPage:s,pageItems:r(()=>{let n=(u-1)*t;return e.slice(n,n+t)},[e,u,t]),totalPages:l,totalItems:c,pageSize:t}}function I(e){let{delayMs:t,invalidate:n,setTimeoutFn:r=setTimeout,clearTimeoutFn:i=clearTimeout}=e,a;function o(){a===void 0&&(a=r(()=>{a=void 0,n()},t))}function s(){a!==void 0&&(i(a),a=void 0)}return{trigger:o,cancel:s}}export{k as a,x as c,T as d,w as f,j as i,b as l,p as m,F as n,D as o,E as p,P as r,m as s,I as t,y as u};
1
+ import{K as e,Q as t,S as n,W as r,q as i,x as a,z as o}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{F as s,I as c,L as l,P as u,W as d,z as f}from"./index-BVO5AjpN.js";var p=d(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]);t();var m={fromMs:null,toMs:null},h=36e5,g=24*h;function _(e,t){switch(e){case`24h`:return{fromMs:t-g,toMs:null};case`7d`:return{fromMs:t-7*g,toMs:null};case`30d`:return{fromMs:t-30*g,toMs:null};case`all`:return m}}function v(e){return e.fromMs!==null||e.toMs!==null}function y(e,t){return v(t)?e.filter(e=>!(t.fromMs!==null&&e.timestamp<t.fromMs||t.toMs!==null&&e.timestamp>t.toMs)):[...e]}function b(e,t){return t.size===0?[...e]:e.filter(e=>t.has(e.deviceId))}function x(e){let t=new Set,n=[];for(let r of e)t.has(r.deviceId)||(t.add(r.deviceId),n.push(r.deviceId));return n}function S(e){if(!e)return null;let t=Date.parse(`${e}T00:00:00`);return Number.isNaN(t)?null:t}function C(e){if(!e)return null;let t=Date.parse(`${e}T23:59:59.999`);return Number.isNaN(t)?null:t}function w(e,t){if(!Number.isFinite(e)||e<=0)return`—`;let n=t-e;return n<6e4?`just now`:n<h?`${String(Math.floor(n/6e4))}m ago`:n<g?`${String(Math.floor(n/h))}h ago`:n<7*g?`${String(Math.floor(n/g))}d ago`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function T(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function E(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function D({cameras:t,selected:r,onChange:s}){let[u,d]=i(!1),p=e(null);o(()=>{if(!u)return;function e(e){p.current&&e.target instanceof Node&&!p.current.contains(e.target)&&d(!1)}function t(e){e.key===`Escape`&&d(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[u]);function m(e){let t=new Set(r);t.has(e)?t.delete(e):t.add(e),s(t)}let h=r.size,g=h===0?`All cameras`:h===1?t.find(e=>r.has(e.id))?.name??`1 camera`:`${String(h)} cameras`;return n(`div`,{ref:p,className:`relative`,children:[n(`button`,{type:`button`,onClick:()=>d(e=>!e),disabled:t.length===0,className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs transition-colors disabled:opacity-40 ${h>0?`border-primary/40 bg-primary/8 text-primary`:`border-border text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[a(f,{className:`h-3.5 w-3.5`}),a(`span`,{className:`max-w-[10rem] truncate`,children:g}),a(c,{className:`h-3 w-3 opacity-70`})]}),u&&n(`div`,{className:`absolute left-0 z-30 mt-1 max-h-64 w-[min(15rem,calc(100vw-1.5rem))] overflow-y-auto rounded-md border border-border bg-surface p-1 shadow-lg shadow-black/30`,children:[h>0&&a(`button`,{type:`button`,onClick:()=>s(new Set),className:`mb-1 w-full rounded px-2 py-1 text-left text-[11px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,children:`Clear selection`}),t.map(e=>{let t=r.has(e.id);return n(`button`,{type:`button`,onClick:()=>m(e.id),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${t?`bg-primary/10 text-primary`:`text-foreground hover:bg-surface-hover`}`,children:[a(`span`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border ${t?`border-primary bg-primary text-white`:`border-border`}`,children:t&&a(l,{className:`h-2.5 w-2.5`})}),a(`span`,{className:`truncate`,children:e.name})]},e.id)})]})]})}t();var O=[{label:`24h`,value:`24h`},{label:`7d`,value:`7d`},{label:`30d`,value:`30d`},{label:`All`,value:`all`}];function k({onChange:e}){let[t,r]=i(`all`),[o,s]=i(``),[c,l]=i(``);function u(t){r(t),s(``),l(``),e(_(t,Date.now()))}function d(t,n){r(`custom`),s(t),l(n),e({fromMs:S(t),toMs:C(n)})}let f=`rounded-md border border-border bg-surface px-2 py-1.5 text-[11px] text-foreground outline-none focus:border-primary [color-scheme:light] dark:[color-scheme:dark]`;return n(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[a(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:O.map(e=>a(`button`,{type:`button`,onClick:()=>u(e.value),className:`rounded px-2.5 py-1 text-[11px] transition-colors ${t===e.value?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:e.label},e.value))}),n(`div`,{className:`flex items-center gap-1`,children:[a(`input`,{type:`date`,"aria-label":`From date`,value:o,max:c||void 0,onChange:e=>d(e.target.value,c),className:`${f} ${t===`custom`&&o?`border-primary/50`:``}`}),a(`span`,{className:`text-[11px] text-foreground-subtle`,children:`→`}),a(`input`,{type:`date`,"aria-label":`To date`,value:c,min:o||void 0,onChange:e=>d(o,e.target.value),className:`${f} ${t===`custom`&&c?`border-primary/50`:``}`})]})]})}t();var A=2.6;function j({src:e,alt:t,className:r,overlay:s,fit:c=`contain`}){let[l,u]=i(!1),[d,f]=i(`50% 50%`);o(()=>{u(!1),f(`50% 50%`)},[e]);function p(e){if(!l){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*100,r=(e.clientY-t.top)/t.height*100;f(`${String(n)}% ${String(r)}%`)}u(e=>!e)}let m=c===`natural`;return a(`div`,{className:`relative overflow-hidden bg-background ${r??``}`,onClick:p,children:n(`div`,{className:`relative select-none transition-transform duration-200 ease-out ${m?`w-full`:`h-full w-full`} ${l?`cursor-zoom-out`:`cursor-zoom-in`}`,style:{transformOrigin:d,transform:l?`scale(${String(A)})`:`scale(1)`},children:[a(`img`,{src:e,alt:t,draggable:!1,className:m?`block h-auto w-full object-contain`:`h-full w-full object-contain`}),s]})})}var M=2;function N(e,t){if(t<=1)return[{kind:`page`,n:1}];if(t<=7){let e=[];for(let n=1;n<=t;n++)e.push({kind:`page`,n});return e}let n=[],r=Math.max(2,e-M),i=Math.min(t-1,e+M);n.push({kind:`page`,n:1}),r>2&&n.push({kind:`ellipsis`,side:`left`});for(let e=r;e<=i;e++)n.push({kind:`page`,n:e});return i<t-1&&n.push({kind:`ellipsis`,side:`right`}),n.push({kind:`page`,n:t}),n}function P({currentPage:e,totalItems:t,pageSize:r,onPageChange:i,itemNoun:o=`items`}){if(t<=r)return null;let c=Math.ceil(t/r),l=(e-1)*r+1,d=Math.min(e*r,t),f=N(e,c),p=`inline-flex h-7 min-w-7 items-center justify-center rounded-md px-2 text-[11px] transition-colors disabled:opacity-40`;return n(`div`,{className:`flex items-center justify-between gap-4 flex-wrap pt-2 text-[11px] text-foreground-subtle`,children:[n(`span`,{children:[`Showing `,l,`–`,d,` of `,t,` `,o]}),n(`div`,{className:`flex items-center gap-1`,children:[a(`button`,{type:`button`,className:`${p} hover:bg-surface-hover`,onClick:()=>i(e-1),disabled:e<=1,"aria-label":`Previous page`,children:a(s,{className:`h-3.5 w-3.5`})}),f.map(t=>t.kind===`ellipsis`?a(`span`,{className:`px-1 opacity-60`,children:`…`},`ellipsis-${t.side}`):a(`button`,{type:`button`,className:`${p} ${t.n===e?`bg-primary/12 text-primary font-medium`:`hover:bg-surface-hover hover:text-foreground`}`,onClick:()=>i(t.n),"aria-current":t.n===e?`page`:void 0,children:t.n},t.n)),a(`button`,{type:`button`,className:`${p} hover:bg-surface-hover`,onClick:()=>i(e+1),disabled:e>=c,"aria-label":`Next page`,children:a(u,{className:`h-3.5 w-3.5`})})]})]})}t();function F(e,t,n){let[a,s]=i(1);o(()=>{s(1)},[n]);let c=e.length,l=Math.max(1,Math.ceil(c/t)),u=Math.min(a,l);return o(()=>{u!==a&&s(u)},[u,a]),{page:u,setPage:s,pageItems:r(()=>{let n=(u-1)*t;return e.slice(n,n+t)},[e,u,t]),totalPages:l,totalItems:c,pageSize:t}}function I(e){let{delayMs:t,invalidate:n,setTimeoutFn:r=setTimeout,clearTimeoutFn:i=clearTimeout}=e,a;function o(){a===void 0&&(a=r(()=>{a=void 0,n()},t))}function s(){a!==void 0&&(i(a),a=void 0)}return{trigger:o,cancel:s}}export{k as a,x as c,T as d,w as f,j as i,b as l,p as m,F as n,D as o,E as p,P as r,m as s,I as t,y as u};
@@ -1 +1 @@
1
- import{d as e,f as t}from"./src-7HDrFEPH.js";import{T as n,b as r,o as i,x as a}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CSJxMxg6.js";var o=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},s=class{constructor(e){this.generateIdentifier=e,this.kv=new o}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},c=class extends s{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function l(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function u(e,t){let n=l(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}function d(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function f(e,t){return e.indexOf(t)!==-1}function p(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var m=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return u(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},ee=e=>Object.prototype.toString.call(e).slice(8,-1),h=e=>e===void 0,te=e=>e===null,g=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,_=e=>g(e)&&Object.keys(e).length===0,v=e=>Array.isArray(e),ne=e=>typeof e==`string`,re=e=>typeof e==`number`&&!isNaN(e),ie=e=>typeof e==`boolean`,ae=e=>e instanceof RegExp,y=e=>e instanceof Map,b=e=>e instanceof Set,oe=e=>ee(e)===`Symbol`,se=e=>e instanceof Date&&!isNaN(e.valueOf()),ce=e=>e instanceof Error,le=e=>typeof e==`number`&&isNaN(e),ue=e=>ie(e)||te(e)||h(e)||re(e)||ne(e)||oe(e),de=e=>typeof e==`bigint`,fe=e=>e===1/0||e===-1/0,pe=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),me=e=>e instanceof URL,x=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),S=e=>e.map(String).map(x).join(`.`),C=(e,t)=>{let n=[],r=``;for(let i=0;i<e.length;i++){let a=e.charAt(i);if(!t&&a===`\\`){let t=e.charAt(i+1);if(t===`\\`){r+=`\\`,i++;continue}else if(t!==`.`)throw Error(`invalid path`)}if(a===`\\`&&e.charAt(i+1)===`.`){r+=`.`,i++;continue}if(a===`.`){n.push(r),r=``;continue}r+=a}let i=r;return n.push(i),n};function w(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var he=[w(h,`undefined`,()=>null,()=>void 0),w(de,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),w(se,`Date`,e=>e.toISOString(),e=>new Date(e)),w(ce,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return`cause`in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),w(ae,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),w(b,`set`,e=>[...e.values()],e=>new Set(e)),w(y,`map`,e=>[...e.entries()],e=>new Map(e)),w(e=>le(e)||fe(e),`number`,e=>le(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),w(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),w(me,`URL`,e=>e.toString(),e=>new URL(e))];function T(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var ge=T((e,t)=>oe(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),_e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),ve=T(pe,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=_e[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function ye(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var be=T(ye,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),xe=T((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),Se=[be,ge,xe,ve],E=(e,t)=>{let n=p(Se,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=p(he,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},D={};he.forEach(e=>{D[e.annotation]=e});var Ce=(e,t,n)=>{if(v(t))switch(t[0]){case`symbol`:return ge.untransform(e,t,n);case`class`:return be.untransform(e,t,n);case`custom`:return xe.untransform(e,t,n);case`typed-array`:return ve.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=D[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},O=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function k(e){if(f(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(f(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(f(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var we=(e,t)=>{k(t);for(let n=0;n<t.length;n++){let r=t[n];if(b(e))e=O(e,+r);else if(y(e)){let i=+r,a=+t[++n]==0?`key`:`value`,o=O(e,i);switch(a){case`key`:e=o;break;case`value`:e=e.get(o);break}}else e=e[r]}return e},A=(e,t,n)=>{if(k(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(v(r)){let e=+n;r=r[e]}else if(g(r))r=r[n];else if(b(r)){let e=+n;r=O(r,e)}else if(y(r)){if(e===t.length-2)break;let i=+n,a=+t[++e]==0?`key`:`value`,o=O(r,i);switch(a){case`key`:r=o;break;case`value`:r=r.get(o);break}}}let i=t[t.length-1];if(v(r)?r[+i]=n(r[+i]):g(r)&&(r[i]=n(r[i])),b(r)){let e=O(r,+i),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(y(r)){let e=+t[t.length-2],a=O(r,e);switch(+i==0?`key`:`value`){case`key`:{let e=n(a);r.set(e,r.get(a)),e!==a&&r.delete(a);break}case`value`:r.set(a,n(r.get(a)));break}}return e},j=e=>e<1;function M(e,t,n,r=[]){if(!e)return;let i=j(n);if(!v(e)){d(e,(e,a)=>M(e,t,n,[...r,...C(a,i)]));return}let[a,o]=e;o&&d(o,(e,a)=>{M(e,t,n,[...r,...C(a,i)])}),t(a,r)}function Te(e,t,n,r){return M(t,(t,n)=>{e=A(e,n,e=>Ce(e,t,r))},n),e}function Ee(e,t,n){let r=j(n);function i(t,n){let i=we(e,C(n,r));t.map(e=>C(e,r)).forEach(t=>{e=A(e,t,()=>i)})}if(v(t)){let[n,a]=t;n.forEach(t=>{e=A(e,C(t,r),()=>e)}),a&&d(a,i)}else d(t,i);return e}var De=(e,t)=>g(e)||v(e)||y(e)||b(e)||ce(e)||ye(e,t);function Oe(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function ke(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...a]=e;i.length===0?r=a.map(S):n[S(i)]=a.map(S)}),r?_(n)?[r]:[r,n]:_(n)?void 0:n}var N=(e,t,n,r,i=[],a=[],o=new Map)=>{let s=ue(e);if(!s){Oe(e,i,t);let n=o.get(e);if(n)return r?{transformedValue:null}:n}if(!De(e,n)){let t=E(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return s||o.set(e,r),r}if(f(a,e))return{transformedValue:null};let c=E(e,n),l=c?.value??e,u=v(l)?[]:{},p={};d(l,(s,c)=>{if(c===`__proto__`||c===`constructor`||c===`prototype`)throw Error(`Detected property ${c}. This is a prototype pollution risk, please remove it from your object.`);let l=N(s,t,n,r,[...i,c],[...a,e],o);u[c]=l.transformedValue,v(l.annotations)?p[x(c)]=l.annotations:g(l.annotations)&&d(l.annotations,(e,t)=>{p[x(c)+`.`+t]=e})});let m=_(p)?{transformedValue:u,annotations:c?[c.type]:void 0}:{transformedValue:u,annotations:c?[c.type,p]:p};return s||o.set(e,m),m};function P(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ae(e){return P(e)===`Array`}function je(e){if(P(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Me(e,t,n,r,i){let a={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;a===`enumerable`&&(e[t]=n),i&&a===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function F(e,t={}){if(Ae(e))return e.map(e=>F(e,t));if(!je(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||Ae(t.props)&&!t.props.includes(r))return n;let i=e[r];return Me(n,r,F(i,t),e,t.nonenumerable),n},{})}var I=class{constructor({dedupe:e=!1}={}){this.classRegistry=new c,this.symbolRegistry=new s(e=>e.description??``),this.customTransformerRegistry=new m,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=N(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let i=ke(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,i=t?.inPlace?n:F(n);return r?.values&&(i=Te(i,r.values,r.v??0,this)),r?.referentialEqualities&&(i=Ee(i,r.referentialEqualities,r.v??0)),i}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};I.defaultInstance=new I,I.serialize=I.defaultInstance.serialize.bind(I.defaultInstance),I.deserialize=I.defaultInstance.deserialize.bind(I.defaultInstance),I.stringify=I.defaultInstance.stringify.bind(I.defaultInstance),I.parse=I.defaultInstance.parse.bind(I.defaultInstance),I.registerClass=I.defaultInstance.registerClass.bind(I.defaultInstance),I.registerSymbol=I.defaultInstance.registerSymbol.bind(I.defaultInstance),I.registerCustom=I.defaultInstance.registerCustom.bind(I.defaultInstance),I.allowErrorProps=I.defaultInstance.allowErrorProps.bind(I.defaultInstance),I.serialize,I.deserialize,I.stringify,I.parse,I.registerClass,I.registerCustom,I.registerSymbol,I.allowErrorProps;var Ne=1e4,Pe=6e3,Fe=2e3,Ie=3e4,L=class{_serverUrl;useWs;baseRetryMs;maxRetryMs;onConnectionChange;token;_trpcClient;_wsClient=null;mirror=null;mirrorInit=null;connected=!1;connectedPromise=null;_systemProxy;_connectionVersion=0;connectionListeners=new Set;constructor(e){this._serverUrl=e.serverUrl.replace(/\/+$/,``),this.token=e.token;let n=typeof window<`u`;this.useWs=e.useWebSocket??n,this.onConnectionChange=e.onConnectionChange,this.baseRetryMs=e.retryDelayMs??Fe,this.maxRetryMs=e.maxRetryDelayMs??Ie,this._trpcClient=this.buildTrpcClient(),this._systemProxy=t(this._trpcClient)}get serverUrl(){return this._serverUrl}get connectionVersion(){return this._connectionVersion}subscribeConnectionEvents(e){return this.connectionListeners.add(e),()=>{this.connectionListeners.delete(e)}}emitConnectionEvent(e){try{this.onConnectionChange?.(e)}catch{}for(let t of this.connectionListeners)try{t(e,this._connectionVersion)}catch{}}async awaitConnected(e){if(this.connected)return;if(this.connectedPromise)return this.connectedPromise;let t=e??15e3;this.connectedPromise=(async()=>{let e=this._trpcClient.auth.me.query();Number.isFinite(t)?await new Promise((n,r)=>{let i=setTimeout(()=>r(Error(`System.awaitConnected: probe timed out after ${t}ms`)),t);e.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e instanceof Error?e:Error(String(e)))})}):await e,this.connected=!0})();try{await this.connectedPromise}finally{this.connectedPromise=null}}async init(t){if(this.mirror?.isReady())return;if(this.mirrorInit)return this.mirrorInit;let n=new e(this._trpcClient);return this.mirror=n,this.mirrorInit=(async()=>{await this.awaitConnected(t),await n.init(t)})().finally(()=>{this.mirrorInit=null}),this.mirrorInit}async awaitReady(){if(!this.mirror?.isReady())return this.mirrorInit?this.mirrorInit:this.init()}isReady(){return this.mirror?.isReady()??!1}isConnected(){return this.connected}reconnect(){this.useWs&&(this.emitConnectionEvent(`connecting`),this._wsClient?.close(),this.disposeMirror(),this.connected=!1,this.connectedPromise=null,this._trpcClient=this.buildTrpcClient(),this._systemProxy=t(this._trpcClient))}switchServerUrl(e){let t=e.replace(/\/+$/,``);t!==this._serverUrl&&(this._serverUrl=t,this.reconnect())}async raceConnectionEndpoints(e){let t=e?.perCandidateTimeoutMs??1500,n=(()=>{try{return new URL(this._serverUrl)}catch{return null}})(),r=n?.port?Number(n.port):n?.protocol===`https:`?443:80,i=n?.protocol===`https:`?`https`:`http`,a=this._trpcClient.localNetwork?.getConnectionEndpoints;if(!a)return{winner:this._serverUrl,switched:!1};let o;try{o=(await a.query({port:r,ipv4Only:e?.ipv4Only,scheme:i})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(o.length===0)return{winner:this._serverUrl,switched:!1};let s=await Re(o.map(e=>e.baseUrl),t);return!s||s===this._serverUrl?{winner:s??this._serverUrl,switched:!1}:(this.switchServerUrl(s),{winner:s,switched:!0})}close(){this.disposeMirror(),this.connected=!1,this.connectedPromise=null,this._wsClient?.close()}disposeMirror(){this.mirror?.dispose(),this.mirror=null,this.mirrorInit=null}async login(e,t){let n=await this._trpcClient.auth.login.mutate({username:e,password:t});if(typeof n==`object`&&n&&`token`in n){let e=n,t=e.token,r=e.requiresTotp===!0||Array.isArray(e.secondFactors)&&e.secondFactors.length>0;typeof t==`string`&&!r&&this.setToken(t)}return n}async loginVerifyTotp(e,t){let n=await this._trpcClient.auth.loginVerifyTotp.mutate({challengeToken:e,code:t});if(typeof n==`object`&&n&&`token`in n){let e=n.token;typeof e==`string`&&this.setToken(e)}return n}async loginBeginPasskey(e){return await this._trpcClient.auth.loginBeginPasskey.mutate({challengeToken:e})}async loginVerifyPasskey(e,t){let n=await this._trpcClient.auth.loginVerifyPasskey.mutate({challengeToken:e,response:t});if(typeof n==`object`&&n&&`token`in n){let e=n.token;typeof e==`string`&&this.setToken(e)}return n}async passkeyLoginBegin(){return await this._trpcClient.auth.passkeyLoginBegin.mutate()}async passkeyLoginFinish(e){let t=await this._trpcClient.auth.passkeyLoginFinish.mutate({response:e});if(typeof t==`object`&&t&&`token`in t){let e=t,n=e.requiresTotp===!0||Array.isArray(e.secondFactors)&&e.secondFactors.length>0;typeof e.token==`string`&&!n&&this.setToken(e.token)}return t}async logout(){await this._trpcClient.auth.logout.mutate()}async getMe(){return await this._trpcClient.auth.me.query()}async changeOwnPassword(e){return await this._trpcClient.auth.changeOwnPassword.mutate(e)}async setupOwnTotp(){return await this._trpcClient.auth.setupOwnTotp.mutate()}async confirmOwnTotp(e){return await this._trpcClient.auth.confirmOwnTotp.mutate(e)}async disableOwnTotp(){return await this._trpcClient.auth.disableOwnTotp.mutate()}async getOwnTotpStatus(){return await this._trpcClient.auth.getOwnTotpStatus.query()}async beginOwnPasskeyRegistration(){return await this._trpcClient.auth.beginOwnPasskeyRegistration.mutate()}async finishOwnPasskeyRegistration(e){return await this._trpcClient.auth.finishOwnPasskeyRegistration.mutate(e)}async listOwnPasskeys(){return await this._trpcClient.auth.listOwnPasskeys.query()}async removeOwnPasskey(e){return await this._trpcClient.auth.removeOwnPasskey.mutate(e)}async getOwnPasskeySecondFactorPreference(){return await this._trpcClient.auth.getOwnPasskeySecondFactorPreference.query()}async setOwnPasskeySecondFactorPreference(e){return await this._trpcClient.auth.setOwnPasskeySecondFactorPreference.mutate(e)}setToken(e){this.token=e}listDevices(e){return this.mirror?(e?this.mirror.query(e):this.mirror.getAllDevices()).map(e=>this.attachBinding(e)):[]}getDeviceInfo(e){return this.mirror?.getDeviceInfo(e)??null}listDeviceInfos(e){let t=this.mirror;if(!t)return[];let n=e?t.query(e):t.getAllDevices(),r=[];for(let e of n){let n=t.getDeviceInfo(e.deviceId);n&&r.push(n)}return r}getDevice(e){let t=this.mirror?.getDeviceById(e)??null;return t?this.attachBinding(t):null}getDeviceByName(e){let t=this.mirror?.getDeviceByName(e)??null;return t?this.attachBinding(t):null}getDeviceByStableId(e){let t=this.mirror?.getDeviceByStableId(e)??null;return t?this.attachBinding(t):null}async waitForDevice(e,t){this.mirror||await this.init();let n=await this.mirror.waitForDevice(e,t??3e4);return this.attachBinding(n)}onDeviceAdded(e){if(!this.mirror)throw Error(`System.onDeviceAdded: call init() before subscribing`);return this.mirror.onDeviceAdded(e)}onDeviceRemoved(e){if(!this.mirror)throw Error(`System.onDeviceRemoved: call init() before subscribing`);return this.mirror.onDeviceRemoved(e)}attachBinding(e){let t=this.lookupBinding(e.deviceId);if(t===e.binding)return e;let n=e;return n.binding=t,e}lookupBinding(e){return this.mirror?this.mirror.getDeviceById(e)?.binding??null:null}get addonPages(){return this._systemProxy.addonPages}get addonSettings(){return this._systemProxy.addonSettings}get alerts(){return this._systemProxy.alerts}get audioAnalyzer(){return this._systemProxy.audioAnalyzer}get audioCodec(){return this._systemProxy.audioCodec}get backup(){return this._systemProxy.backup}get decoder(){return this._systemProxy.decoder}get deviceManager(){return this._systemProxy.deviceManager}get deviceProvider(){return this._systemProxy.deviceProvider}get deviceState(){return this._systemProxy.deviceState}get metricsProvider(){return this._systemProxy.metricsProvider}get notificationOutput(){return this._systemProxy.notificationOutput}get pipelineExecutor(){return this._systemProxy.pipelineExecutor}get pipelineOrchestrator(){return this._systemProxy.pipelineOrchestrator}get pipelineRunner(){return this._systemProxy.pipelineRunner}get settingsStore(){return this._systemProxy.settingsStore}get storage(){return this._systemProxy.storage}get streamBroker(){return this._systemProxy.streamBroker}get turnProvider(){return this._systemProxy.turnProvider}get userManagement(){return this._systemProxy.userManagement}subscribeEvent(e,t){let n=this._trpcClient.live.onEvent.subscribe({category:e},{onData:e=>{try{t(e)}catch{}}});return()=>{try{n.unsubscribe()}catch{}}}get trpcClient(){return this._trpcClient}get wsClient(){return this._wsClient}buildTrpcClient(){let e=()=>{let e={};return this.token&&(e.Authorization=`Bearer ${this.token}`),e};if(this.useWs){let e=this._serverUrl.replace(/^http/,`ws`)+`/trpc`,t=this.baseRetryMs,i=this.maxRetryMs;return this._wsClient=n({url:e,connectionParams:()=>({token:this.token}),retryDelayMs:e=>Math.min(t*2**e,i),keepAlive:{enabled:!0,intervalMs:Ne,pongTimeoutMs:Pe},onOpen:()=>{this._connectionVersion+=1,this.emitConnectionEvent(`connected`)},onClose:()=>{this.emitConnectionEvent(`disconnected`)}}),a({links:[r({client:this._wsClient,transformer:I})]})}return this._wsClient=null,a({links:[i({url:`${this._serverUrl}/trpc`,headers:e,transformer:I})]})}};function Le(e){return new L(e)}async function Re(e,t){if(e.length===0)return null;if(typeof fetch!=`function`)return e[0]??null;let n=typeof window<`u`&&window.location!==void 0&&window.location.protocol===`https:`?e.filter(e=>e.toLowerCase().startsWith(`https://`)):e;if(n.length===0)return null;let r=n.map(()=>new AbortController),i=n.map(async(e,n)=>{let i=r[n],a=setTimeout(()=>i.abort(),t);try{let t=await fetch(`${e.replace(/\/+$/,``)}/trpc/health`,{method:`GET`,signal:i.signal,credentials:`omit`});if(!t.ok)throw Error(`${t.status}`);return e}finally{clearTimeout(a)}});try{let e=await Promise.any(i);for(let e of r)try{e.abort()}catch{}return e}catch{return null}}var ze=function(e){return e.Motion=`motion`,e.Person=`person`,e.Vehicle=`vehicle`,e.Animal=`animal`,e.Audio=`audio`,e.Face=`face`,e.Plate=`plate`,e.Package=`package`,e.Doorbell=`doorbell`,e.Sensor=`sensor`,e}({}),R=`animal.dog_cat.dog.cat.horse.sheep.cow.elephant.bear.zebra.giraffe.mouse.rabbit.deer.lion.tiger.bird.eagle.owl.pigeon.fish.whale.dolphin.snake.turtle.lizard`.split(`.`),z=[`person`,`people`,`pedestrian`,`rider`,`driver`,`cyclist`,`skier`,`skateboarder`,`face`,`hand`,`head`,`body`],B=[`vehicle`,`car`,`truck`,`bus`,`motorcycle`,`bicycle`,`van`,`ambulance`,`police_car`,`fire_truck`,`train`,`subway`,`tram`,`airplane`,`boat`,`ship`,`helicopter`],V=`face.eyes.nose.mouth.ears.eyebrows.left_eye.right_eye.pupil.iris.eyelid.eye_corner.upper_lip.lower_lip.teeth.chin.cheek.forehead.jaw.glasses.sunglasses.facial_hair.beard.mustache.facial_landmark.facial_keypoint`.split(`.`),H=[`plate`,`license_plate`,`front_plate`,`rear_plate`,`motorcycle_plate`,`temporary_plate`,`dealer_plate`,`licensePlate`,`plate_number`,`plate_character`,`plate_digit`,`plate_letter`,`plate_symbol`,`plate_region`,`plate_country_identifier`,`plate_frame`,`plate_bolt`,`plate_sticker`,`plate_validation_tag`,`damaged_plate`,`obscured_plate`,`dirty_plate`],U=[`motion`,`movement`,`other`],W=[`package`,`packet`],G=[`audio`],K=`speech.scream.babbling.yell.bellow.whoop.whispering.laughter.snicker.crying.cry.sigh.singing.choir.chant.mantra.child_singing.rapping.humming.groan.grunt.whistling.breathing.wheeze.snoring.gasp.pant.snort.cough.throat_clearing.sneeze.sniff.cheering.applause.chatter.crowd.children_playing.bark.yip.howl.bow-wow.growling.whimper_dog.purr.meow.hiss.caterwaul.pets.livestock.doorbell.ding-dong.door.slam.knock.alarm.telephone.music.dog.dogs`.split(`.`),q=[`doorbell`,`ring`],J=[`lock`,`binary`,`flood`,`entry`,`door`,`leak`,`door_open`,`flooded`,`entry_open`],Y={...R.reduce((e,t)=>({...e,[t]:`animal`}),{}),...z.reduce((e,t)=>({...e,[t]:`person`}),{}),...B.reduce((e,t)=>({...e,[t]:`vehicle`}),{}),...U.reduce((e,t)=>({...e,[t]:`motion`}),{}),...W.reduce((e,t)=>({...e,[t]:`package`}),{}),...V.reduce((e,t)=>({...e,[t]:`face`}),{}),...H.reduce((e,t)=>({...e,[t]:`plate`}),{}),...G.reduce((e,t)=>({...e,[t]:`audio`}),{}),...K.reduce((e,t)=>({...e,[t]:`audio`}),{}),...q.reduce((e,t)=>({...e,[t]:`doorbell`}),{}),...J.reduce((e,t)=>({...e,[t]:`sensor`}),{})},Be=e=>V.includes(e),Ve=e=>H.includes(e),He=e=>R.includes(e),Ue=e=>z.includes(e),We=e=>B.includes(e),Ge=e=>U.includes(e),Ke=e=>q.includes(e),qe=e=>W.includes(e),Je=e=>G.includes(e)||K.includes(e),Ye=e=>J.includes(e),Xe=e=>Be(e)||Ve(e),Ze=e=>Y[e],Qe=e=>{let{className:t}=e,n={face:`person`,plate:`vehicle`},r=Y[t];return r&&r!==t?r:n[t]},$e=Object.values(ze),X=$e.filter(e=>e!==`motion`),Z=[`person`,`doorbell`,`package`],et=[...Z,`vehicle`,`animal`,`audio`,`face`,`plate`],tt=[...X];function nt(e,t){switch(e){case`critical`:return Z;case`important`:return et;case`all`:return tt;case`custom`:return t?.length?t:X;default:return X}}var Q={Light:`light`,Switch:`switch`,WindowCovering:`cover`,Lock:`lock`,SecuritySystem:`alarm`,Buttons:`button`,Select:`select`,Siren:`siren`,Sensor:`sensor`,Entry:`entry`,Program:`script`,MediaPlayer:`media_player`,Outlet:`switch`,light:`light`,switch:`switch`,input_boolean:`switch`,cover:`cover`,lock:`lock`,alarm_control_panel:`alarm`,input_button:`button`,button:`button`,input_select:`select`,select:`select`,siren:`siren`,sensor:`sensor`,media_player:`media_player`,script:`script`},rt={light:`light`,switch:`switch`,input_boolean:`switch`,cover:`cover`,lock:`lock`,alarm_control_panel:`alarm`,input_button:`button`,button:`button`,input_select:`select`,select:`select`,siren:`siren`,sensor:`sensor`,binary_sensor:`sensor`,media_player:`media_player`,script:`script`,climate:`climate`,camera:`camera`,fan:`fan`,vacuum:`vacuum`,automation:`automation`,scene:`scene`,input_number:`sensor`,person:`person`,device_tracker:`tracker`,weather:`weather`,water_heater:`climate`},it={Light:`light`,Switch:`switch`,WindowCovering:`cover`,Lock:`lock`,SecuritySystem:`alarm`,Buttons:`button`,Select:`select`,Siren:`siren`,Sensor:`sensor`,Entry:`entry`,Program:`script`,MediaPlayer:`media_player`,Camera:`camera`,Doorbell:`doorbell`,Fan:`fan`,Outlet:`switch`};function at(e){return Q[e]||(Q[e.toLowerCase()]??null)}var ot=[`Entry`,`Light`,`Switch`,`Lock`,`SecuritySystem`,`Buttons`,`WindowCovering`,`Siren`,`Sensor`,`Select`,`Program`],st=new Set(ot),ct=[`light`,`switch`,`input_boolean`,`cover`,`lock`,`alarm_control_panel`,`input_button`,`button`,`input_select`,`select`,`siren`,`media_player`,`script`],lt=new Set(ct),$=[{id:`liveStream`,label:`Live Stream`,sources:{frigate:!0,scrypted:!0,rtsp:!0},adapterMethod:`getLiveStream`},{id:`multiResolution`,label:`Multi-Resolution`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getResolutions`},{id:`motion`,label:`Motion Detection`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getMotion`},{id:`objectDetection`,label:`Object Detection`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getObjectDetections`},{id:`audioVolume`,label:`Audio Level`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getAudioVolume`},{id:`audioVolumes`,label:`Audio Volumes (dBFS)`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getAudioVolumes`},{id:`ptz`,label:`PTZ Control`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getPTZ`},{id:`intercom`,label:`Intercom (Mic)`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getIntercomSupport`},{id:`deviceStatus`,label:`Device Status`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getStatus`},{id:`timeline`,label:`Detection Timeline`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getCameraDayData`},{id:`clusteredTimeline`,label:`Clustered Timeline`,sources:{frigate:!0,scrypted:!0,rtsp:!1},requiresBackend:!0,adapterMethod:`getClusteredDayData`},{id:`detectionClasses`,label:`Detection Classes`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getDetectionClasses`},{id:`videoClips`,label:`Video Clips`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getVideoClips`},{id:`nvrPlayback`,label:`NVR Playback`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getNvrPlaybackSupported`},{id:`nvrScrub`,label:`NVR Scrub/Seek`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`seekRecordingStream`},{id:`recordingThumbnail`,label:`Recording Thumbnails`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getRecordingStreamThumbnail`},{id:`nvrSeekToLive`,label:`Seek to Live`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`seekNvrToLive`}];function ut(e,t,n){let r=$.find(t=>t.id===e);return!(!r||!r.sources[t]||r.platforms&&r.platforms[n]===!1)}function dt(e){return $.filter(t=>t.sources[e])}function ft(){return $.filter(e=>e.requiresBackend)}export{X as DEFAULT_ENABLED_CLASSES,ze as DetectionClass,ct as ELIGIBLE_HA_DOMAINS,lt as ELIGIBLE_HA_DOMAINS_SET,ot as ELIGIBLE_SCRYPTED_DEVICE_TYPES,st as ELIGIBLE_SCRYPTED_DEVICE_TYPES_SET,$ as FEATURE_MATRIX,rt as HA_DOMAIN_TYPE_MAP,Q as RAW_TO_CANONICAL,it as SCRYPTED_TYPE_TO_CANONICAL,L as System,tt as TIMELINE_PRESET_ALL,Z as TIMELINE_PRESET_CRITICAL,et as TIMELINE_PRESET_IMPORTANT,R as animalClasses,G as audioClasses,K as audioLabelClasses,Le as createSystem,$e as defaultDetectionClasses,Y as detectionClassesDefaultMap,q as doorbellClasses,V as faceClasses,ft as getBackendRequiredFeatures,at as getCanonicalDeviceType,nt as getClassesForTimelinePreset,Ze as getParentClass,Qe as getParentDetectionClass,dt as getSourceFeatures,He as isAnimalClassname,Je as isAudioClassname,Ke as isDoorbellClassname,Be as isFaceClassname,ut as isFeatureAvailable,Xe as isLabelDetection,Ge as isMotionClassname,qe as isPackageClassname,Ue as isPersonClassname,Ve as isPlateClassname,Ye as isSensorLabelClassname,We as isVehicleClassname,H as licensePlateClasses,U as motionClasses,W as packageClasses,z as personClasses,Re as raceFastestEndpoint,J as sensorLabelClasses,B as vehicleClasses};
1
+ import{d as e,f as t}from"./src-DNVzx9ag.js";import{T as n,b as r,o as i,x as a}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CSJxMxg6.js";var o=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},s=class{constructor(e){this.generateIdentifier=e,this.kv=new o}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},c=class extends s{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function l(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function u(e,t){let n=l(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}function d(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function f(e,t){return e.indexOf(t)!==-1}function p(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var m=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return u(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},ee=e=>Object.prototype.toString.call(e).slice(8,-1),h=e=>e===void 0,te=e=>e===null,g=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,_=e=>g(e)&&Object.keys(e).length===0,v=e=>Array.isArray(e),ne=e=>typeof e==`string`,re=e=>typeof e==`number`&&!isNaN(e),ie=e=>typeof e==`boolean`,ae=e=>e instanceof RegExp,y=e=>e instanceof Map,b=e=>e instanceof Set,oe=e=>ee(e)===`Symbol`,se=e=>e instanceof Date&&!isNaN(e.valueOf()),ce=e=>e instanceof Error,le=e=>typeof e==`number`&&isNaN(e),ue=e=>ie(e)||te(e)||h(e)||re(e)||ne(e)||oe(e),de=e=>typeof e==`bigint`,fe=e=>e===1/0||e===-1/0,pe=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),me=e=>e instanceof URL,x=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),S=e=>e.map(String).map(x).join(`.`),C=(e,t)=>{let n=[],r=``;for(let i=0;i<e.length;i++){let a=e.charAt(i);if(!t&&a===`\\`){let t=e.charAt(i+1);if(t===`\\`){r+=`\\`,i++;continue}else if(t!==`.`)throw Error(`invalid path`)}if(a===`\\`&&e.charAt(i+1)===`.`){r+=`.`,i++;continue}if(a===`.`){n.push(r),r=``;continue}r+=a}let i=r;return n.push(i),n};function w(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var he=[w(h,`undefined`,()=>null,()=>void 0),w(de,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),w(se,`Date`,e=>e.toISOString(),e=>new Date(e)),w(ce,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return`cause`in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),w(ae,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),w(b,`set`,e=>[...e.values()],e=>new Set(e)),w(y,`map`,e=>[...e.entries()],e=>new Map(e)),w(e=>le(e)||fe(e),`number`,e=>le(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),w(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),w(me,`URL`,e=>e.toString(),e=>new URL(e))];function T(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var ge=T((e,t)=>oe(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),_e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),ve=T(pe,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=_e[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function ye(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var be=T(ye,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),xe=T((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),Se=[be,ge,xe,ve],E=(e,t)=>{let n=p(Se,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=p(he,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},D={};he.forEach(e=>{D[e.annotation]=e});var Ce=(e,t,n)=>{if(v(t))switch(t[0]){case`symbol`:return ge.untransform(e,t,n);case`class`:return be.untransform(e,t,n);case`custom`:return xe.untransform(e,t,n);case`typed-array`:return ve.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=D[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},O=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function k(e){if(f(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(f(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(f(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var we=(e,t)=>{k(t);for(let n=0;n<t.length;n++){let r=t[n];if(b(e))e=O(e,+r);else if(y(e)){let i=+r,a=+t[++n]==0?`key`:`value`,o=O(e,i);switch(a){case`key`:e=o;break;case`value`:e=e.get(o);break}}else e=e[r]}return e},A=(e,t,n)=>{if(k(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(v(r)){let e=+n;r=r[e]}else if(g(r))r=r[n];else if(b(r)){let e=+n;r=O(r,e)}else if(y(r)){if(e===t.length-2)break;let i=+n,a=+t[++e]==0?`key`:`value`,o=O(r,i);switch(a){case`key`:r=o;break;case`value`:r=r.get(o);break}}}let i=t[t.length-1];if(v(r)?r[+i]=n(r[+i]):g(r)&&(r[i]=n(r[i])),b(r)){let e=O(r,+i),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(y(r)){let e=+t[t.length-2],a=O(r,e);switch(+i==0?`key`:`value`){case`key`:{let e=n(a);r.set(e,r.get(a)),e!==a&&r.delete(a);break}case`value`:r.set(a,n(r.get(a)));break}}return e},j=e=>e<1;function M(e,t,n,r=[]){if(!e)return;let i=j(n);if(!v(e)){d(e,(e,a)=>M(e,t,n,[...r,...C(a,i)]));return}let[a,o]=e;o&&d(o,(e,a)=>{M(e,t,n,[...r,...C(a,i)])}),t(a,r)}function Te(e,t,n,r){return M(t,(t,n)=>{e=A(e,n,e=>Ce(e,t,r))},n),e}function Ee(e,t,n){let r=j(n);function i(t,n){let i=we(e,C(n,r));t.map(e=>C(e,r)).forEach(t=>{e=A(e,t,()=>i)})}if(v(t)){let[n,a]=t;n.forEach(t=>{e=A(e,C(t,r),()=>e)}),a&&d(a,i)}else d(t,i);return e}var De=(e,t)=>g(e)||v(e)||y(e)||b(e)||ce(e)||ye(e,t);function Oe(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function ke(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...a]=e;i.length===0?r=a.map(S):n[S(i)]=a.map(S)}),r?_(n)?[r]:[r,n]:_(n)?void 0:n}var N=(e,t,n,r,i=[],a=[],o=new Map)=>{let s=ue(e);if(!s){Oe(e,i,t);let n=o.get(e);if(n)return r?{transformedValue:null}:n}if(!De(e,n)){let t=E(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return s||o.set(e,r),r}if(f(a,e))return{transformedValue:null};let c=E(e,n),l=c?.value??e,u=v(l)?[]:{},p={};d(l,(s,c)=>{if(c===`__proto__`||c===`constructor`||c===`prototype`)throw Error(`Detected property ${c}. This is a prototype pollution risk, please remove it from your object.`);let l=N(s,t,n,r,[...i,c],[...a,e],o);u[c]=l.transformedValue,v(l.annotations)?p[x(c)]=l.annotations:g(l.annotations)&&d(l.annotations,(e,t)=>{p[x(c)+`.`+t]=e})});let m=_(p)?{transformedValue:u,annotations:c?[c.type]:void 0}:{transformedValue:u,annotations:c?[c.type,p]:p};return s||o.set(e,m),m};function P(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ae(e){return P(e)===`Array`}function je(e){if(P(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Me(e,t,n,r,i){let a={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;a===`enumerable`&&(e[t]=n),i&&a===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function F(e,t={}){if(Ae(e))return e.map(e=>F(e,t));if(!je(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||Ae(t.props)&&!t.props.includes(r))return n;let i=e[r];return Me(n,r,F(i,t),e,t.nonenumerable),n},{})}var I=class{constructor({dedupe:e=!1}={}){this.classRegistry=new c,this.symbolRegistry=new s(e=>e.description??``),this.customTransformerRegistry=new m,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=N(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let i=ke(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,i=t?.inPlace?n:F(n);return r?.values&&(i=Te(i,r.values,r.v??0,this)),r?.referentialEqualities&&(i=Ee(i,r.referentialEqualities,r.v??0)),i}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};I.defaultInstance=new I,I.serialize=I.defaultInstance.serialize.bind(I.defaultInstance),I.deserialize=I.defaultInstance.deserialize.bind(I.defaultInstance),I.stringify=I.defaultInstance.stringify.bind(I.defaultInstance),I.parse=I.defaultInstance.parse.bind(I.defaultInstance),I.registerClass=I.defaultInstance.registerClass.bind(I.defaultInstance),I.registerSymbol=I.defaultInstance.registerSymbol.bind(I.defaultInstance),I.registerCustom=I.defaultInstance.registerCustom.bind(I.defaultInstance),I.allowErrorProps=I.defaultInstance.allowErrorProps.bind(I.defaultInstance),I.serialize,I.deserialize,I.stringify,I.parse,I.registerClass,I.registerCustom,I.registerSymbol,I.allowErrorProps;var Ne=1e4,Pe=6e3,Fe=2e3,Ie=3e4,L=class{_serverUrl;useWs;baseRetryMs;maxRetryMs;onConnectionChange;token;_trpcClient;_wsClient=null;mirror=null;mirrorInit=null;connected=!1;connectedPromise=null;_systemProxy;_connectionVersion=0;connectionListeners=new Set;constructor(e){this._serverUrl=e.serverUrl.replace(/\/+$/,``),this.token=e.token;let n=typeof window<`u`;this.useWs=e.useWebSocket??n,this.onConnectionChange=e.onConnectionChange,this.baseRetryMs=e.retryDelayMs??Fe,this.maxRetryMs=e.maxRetryDelayMs??Ie,this._trpcClient=this.buildTrpcClient(),this._systemProxy=t(this._trpcClient)}get serverUrl(){return this._serverUrl}get connectionVersion(){return this._connectionVersion}subscribeConnectionEvents(e){return this.connectionListeners.add(e),()=>{this.connectionListeners.delete(e)}}emitConnectionEvent(e){try{this.onConnectionChange?.(e)}catch{}for(let t of this.connectionListeners)try{t(e,this._connectionVersion)}catch{}}async awaitConnected(e){if(this.connected)return;if(this.connectedPromise)return this.connectedPromise;let t=e??15e3;this.connectedPromise=(async()=>{let e=this._trpcClient.auth.me.query();Number.isFinite(t)?await new Promise((n,r)=>{let i=setTimeout(()=>r(Error(`System.awaitConnected: probe timed out after ${t}ms`)),t);e.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e instanceof Error?e:Error(String(e)))})}):await e,this.connected=!0})();try{await this.connectedPromise}finally{this.connectedPromise=null}}async init(t){if(this.mirror?.isReady())return;if(this.mirrorInit)return this.mirrorInit;let n=new e(this._trpcClient);return this.mirror=n,this.mirrorInit=(async()=>{await this.awaitConnected(t),await n.init(t)})().finally(()=>{this.mirrorInit=null}),this.mirrorInit}async awaitReady(){if(!this.mirror?.isReady())return this.mirrorInit?this.mirrorInit:this.init()}isReady(){return this.mirror?.isReady()??!1}isConnected(){return this.connected}reconnect(){this.useWs&&(this.emitConnectionEvent(`connecting`),this._wsClient?.close(),this.disposeMirror(),this.connected=!1,this.connectedPromise=null,this._trpcClient=this.buildTrpcClient(),this._systemProxy=t(this._trpcClient))}switchServerUrl(e){let t=e.replace(/\/+$/,``);t!==this._serverUrl&&(this._serverUrl=t,this.reconnect())}async raceConnectionEndpoints(e){let t=e?.perCandidateTimeoutMs??1500,n=(()=>{try{return new URL(this._serverUrl)}catch{return null}})(),r=n?.port?Number(n.port):n?.protocol===`https:`?443:80,i=n?.protocol===`https:`?`https`:`http`,a=this._trpcClient.localNetwork?.getConnectionEndpoints;if(!a)return{winner:this._serverUrl,switched:!1};let o;try{o=(await a.query({port:r,ipv4Only:e?.ipv4Only,scheme:i})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(o.length===0)return{winner:this._serverUrl,switched:!1};let s=await Re(o.map(e=>e.baseUrl),t);return!s||s===this._serverUrl?{winner:s??this._serverUrl,switched:!1}:(this.switchServerUrl(s),{winner:s,switched:!0})}close(){this.disposeMirror(),this.connected=!1,this.connectedPromise=null,this._wsClient?.close()}disposeMirror(){this.mirror?.dispose(),this.mirror=null,this.mirrorInit=null}async login(e,t){let n=await this._trpcClient.auth.login.mutate({username:e,password:t});if(typeof n==`object`&&n&&`token`in n){let e=n,t=e.token,r=e.requiresTotp===!0||Array.isArray(e.secondFactors)&&e.secondFactors.length>0;typeof t==`string`&&!r&&this.setToken(t)}return n}async loginVerifyTotp(e,t){let n=await this._trpcClient.auth.loginVerifyTotp.mutate({challengeToken:e,code:t});if(typeof n==`object`&&n&&`token`in n){let e=n.token;typeof e==`string`&&this.setToken(e)}return n}async loginBeginPasskey(e){return await this._trpcClient.auth.loginBeginPasskey.mutate({challengeToken:e})}async loginVerifyPasskey(e,t){let n=await this._trpcClient.auth.loginVerifyPasskey.mutate({challengeToken:e,response:t});if(typeof n==`object`&&n&&`token`in n){let e=n.token;typeof e==`string`&&this.setToken(e)}return n}async passkeyLoginBegin(){return await this._trpcClient.auth.passkeyLoginBegin.mutate()}async passkeyLoginFinish(e){let t=await this._trpcClient.auth.passkeyLoginFinish.mutate({response:e});if(typeof t==`object`&&t&&`token`in t){let e=t,n=e.requiresTotp===!0||Array.isArray(e.secondFactors)&&e.secondFactors.length>0;typeof e.token==`string`&&!n&&this.setToken(e.token)}return t}async logout(){await this._trpcClient.auth.logout.mutate()}async getMe(){return await this._trpcClient.auth.me.query()}async changeOwnPassword(e){return await this._trpcClient.auth.changeOwnPassword.mutate(e)}async setupOwnTotp(){return await this._trpcClient.auth.setupOwnTotp.mutate()}async confirmOwnTotp(e){return await this._trpcClient.auth.confirmOwnTotp.mutate(e)}async disableOwnTotp(){return await this._trpcClient.auth.disableOwnTotp.mutate()}async getOwnTotpStatus(){return await this._trpcClient.auth.getOwnTotpStatus.query()}async beginOwnPasskeyRegistration(){return await this._trpcClient.auth.beginOwnPasskeyRegistration.mutate()}async finishOwnPasskeyRegistration(e){return await this._trpcClient.auth.finishOwnPasskeyRegistration.mutate(e)}async listOwnPasskeys(){return await this._trpcClient.auth.listOwnPasskeys.query()}async removeOwnPasskey(e){return await this._trpcClient.auth.removeOwnPasskey.mutate(e)}async getOwnPasskeySecondFactorPreference(){return await this._trpcClient.auth.getOwnPasskeySecondFactorPreference.query()}async setOwnPasskeySecondFactorPreference(e){return await this._trpcClient.auth.setOwnPasskeySecondFactorPreference.mutate(e)}setToken(e){this.token=e}listDevices(e){return this.mirror?(e?this.mirror.query(e):this.mirror.getAllDevices()).map(e=>this.attachBinding(e)):[]}getDeviceInfo(e){return this.mirror?.getDeviceInfo(e)??null}listDeviceInfos(e){let t=this.mirror;if(!t)return[];let n=e?t.query(e):t.getAllDevices(),r=[];for(let e of n){let n=t.getDeviceInfo(e.deviceId);n&&r.push(n)}return r}getDevice(e){let t=this.mirror?.getDeviceById(e)??null;return t?this.attachBinding(t):null}getDeviceByName(e){let t=this.mirror?.getDeviceByName(e)??null;return t?this.attachBinding(t):null}getDeviceByStableId(e){let t=this.mirror?.getDeviceByStableId(e)??null;return t?this.attachBinding(t):null}async waitForDevice(e,t){this.mirror||await this.init();let n=await this.mirror.waitForDevice(e,t??3e4);return this.attachBinding(n)}onDeviceAdded(e){if(!this.mirror)throw Error(`System.onDeviceAdded: call init() before subscribing`);return this.mirror.onDeviceAdded(e)}onDeviceRemoved(e){if(!this.mirror)throw Error(`System.onDeviceRemoved: call init() before subscribing`);return this.mirror.onDeviceRemoved(e)}attachBinding(e){let t=this.lookupBinding(e.deviceId);if(t===e.binding)return e;let n=e;return n.binding=t,e}lookupBinding(e){return this.mirror?this.mirror.getDeviceById(e)?.binding??null:null}get addonPages(){return this._systemProxy.addonPages}get addonSettings(){return this._systemProxy.addonSettings}get alerts(){return this._systemProxy.alerts}get audioAnalyzer(){return this._systemProxy.audioAnalyzer}get audioCodec(){return this._systemProxy.audioCodec}get backup(){return this._systemProxy.backup}get decoder(){return this._systemProxy.decoder}get deviceManager(){return this._systemProxy.deviceManager}get deviceProvider(){return this._systemProxy.deviceProvider}get deviceState(){return this._systemProxy.deviceState}get metricsProvider(){return this._systemProxy.metricsProvider}get notificationOutput(){return this._systemProxy.notificationOutput}get pipelineExecutor(){return this._systemProxy.pipelineExecutor}get pipelineOrchestrator(){return this._systemProxy.pipelineOrchestrator}get pipelineRunner(){return this._systemProxy.pipelineRunner}get settingsStore(){return this._systemProxy.settingsStore}get storage(){return this._systemProxy.storage}get streamBroker(){return this._systemProxy.streamBroker}get turnProvider(){return this._systemProxy.turnProvider}get userManagement(){return this._systemProxy.userManagement}subscribeEvent(e,t){let n=this._trpcClient.live.onEvent.subscribe({category:e},{onData:e=>{try{t(e)}catch{}}});return()=>{try{n.unsubscribe()}catch{}}}get trpcClient(){return this._trpcClient}get wsClient(){return this._wsClient}buildTrpcClient(){let e=()=>{let e={};return this.token&&(e.Authorization=`Bearer ${this.token}`),e};if(this.useWs){let e=this._serverUrl.replace(/^http/,`ws`)+`/trpc`,t=this.baseRetryMs,i=this.maxRetryMs;return this._wsClient=n({url:e,connectionParams:()=>({token:this.token}),retryDelayMs:e=>Math.min(t*2**e,i),keepAlive:{enabled:!0,intervalMs:Ne,pongTimeoutMs:Pe},onOpen:()=>{this._connectionVersion+=1,this.emitConnectionEvent(`connected`)},onClose:()=>{this.emitConnectionEvent(`disconnected`)}}),a({links:[r({client:this._wsClient,transformer:I})]})}return this._wsClient=null,a({links:[i({url:`${this._serverUrl}/trpc`,headers:e,transformer:I})]})}};function Le(e){return new L(e)}async function Re(e,t){if(e.length===0)return null;if(typeof fetch!=`function`)return e[0]??null;let n=typeof window<`u`&&window.location!==void 0&&window.location.protocol===`https:`?e.filter(e=>e.toLowerCase().startsWith(`https://`)):e;if(n.length===0)return null;let r=n.map(()=>new AbortController),i=n.map(async(e,n)=>{let i=r[n],a=setTimeout(()=>i.abort(),t);try{let t=await fetch(`${e.replace(/\/+$/,``)}/trpc/health`,{method:`GET`,signal:i.signal,credentials:`omit`});if(!t.ok)throw Error(`${t.status}`);return e}finally{clearTimeout(a)}});try{let e=await Promise.any(i);for(let e of r)try{e.abort()}catch{}return e}catch{return null}}var ze=function(e){return e.Motion=`motion`,e.Person=`person`,e.Vehicle=`vehicle`,e.Animal=`animal`,e.Audio=`audio`,e.Face=`face`,e.Plate=`plate`,e.Package=`package`,e.Doorbell=`doorbell`,e.Sensor=`sensor`,e}({}),R=`animal.dog_cat.dog.cat.horse.sheep.cow.elephant.bear.zebra.giraffe.mouse.rabbit.deer.lion.tiger.bird.eagle.owl.pigeon.fish.whale.dolphin.snake.turtle.lizard`.split(`.`),z=[`person`,`people`,`pedestrian`,`rider`,`driver`,`cyclist`,`skier`,`skateboarder`,`face`,`hand`,`head`,`body`],B=[`vehicle`,`car`,`truck`,`bus`,`motorcycle`,`bicycle`,`van`,`ambulance`,`police_car`,`fire_truck`,`train`,`subway`,`tram`,`airplane`,`boat`,`ship`,`helicopter`],V=`face.eyes.nose.mouth.ears.eyebrows.left_eye.right_eye.pupil.iris.eyelid.eye_corner.upper_lip.lower_lip.teeth.chin.cheek.forehead.jaw.glasses.sunglasses.facial_hair.beard.mustache.facial_landmark.facial_keypoint`.split(`.`),H=[`plate`,`license_plate`,`front_plate`,`rear_plate`,`motorcycle_plate`,`temporary_plate`,`dealer_plate`,`licensePlate`,`plate_number`,`plate_character`,`plate_digit`,`plate_letter`,`plate_symbol`,`plate_region`,`plate_country_identifier`,`plate_frame`,`plate_bolt`,`plate_sticker`,`plate_validation_tag`,`damaged_plate`,`obscured_plate`,`dirty_plate`],U=[`motion`,`movement`,`other`],W=[`package`,`packet`],G=[`audio`],K=`speech.scream.babbling.yell.bellow.whoop.whispering.laughter.snicker.crying.cry.sigh.singing.choir.chant.mantra.child_singing.rapping.humming.groan.grunt.whistling.breathing.wheeze.snoring.gasp.pant.snort.cough.throat_clearing.sneeze.sniff.cheering.applause.chatter.crowd.children_playing.bark.yip.howl.bow-wow.growling.whimper_dog.purr.meow.hiss.caterwaul.pets.livestock.doorbell.ding-dong.door.slam.knock.alarm.telephone.music.dog.dogs`.split(`.`),q=[`doorbell`,`ring`],J=[`lock`,`binary`,`flood`,`entry`,`door`,`leak`,`door_open`,`flooded`,`entry_open`],Y={...R.reduce((e,t)=>({...e,[t]:`animal`}),{}),...z.reduce((e,t)=>({...e,[t]:`person`}),{}),...B.reduce((e,t)=>({...e,[t]:`vehicle`}),{}),...U.reduce((e,t)=>({...e,[t]:`motion`}),{}),...W.reduce((e,t)=>({...e,[t]:`package`}),{}),...V.reduce((e,t)=>({...e,[t]:`face`}),{}),...H.reduce((e,t)=>({...e,[t]:`plate`}),{}),...G.reduce((e,t)=>({...e,[t]:`audio`}),{}),...K.reduce((e,t)=>({...e,[t]:`audio`}),{}),...q.reduce((e,t)=>({...e,[t]:`doorbell`}),{}),...J.reduce((e,t)=>({...e,[t]:`sensor`}),{})},Be=e=>V.includes(e),Ve=e=>H.includes(e),He=e=>R.includes(e),Ue=e=>z.includes(e),We=e=>B.includes(e),Ge=e=>U.includes(e),Ke=e=>q.includes(e),qe=e=>W.includes(e),Je=e=>G.includes(e)||K.includes(e),Ye=e=>J.includes(e),Xe=e=>Be(e)||Ve(e),Ze=e=>Y[e],Qe=e=>{let{className:t}=e,n={face:`person`,plate:`vehicle`},r=Y[t];return r&&r!==t?r:n[t]},$e=Object.values(ze),X=$e.filter(e=>e!==`motion`),Z=[`person`,`doorbell`,`package`],et=[...Z,`vehicle`,`animal`,`audio`,`face`,`plate`],tt=[...X];function nt(e,t){switch(e){case`critical`:return Z;case`important`:return et;case`all`:return tt;case`custom`:return t?.length?t:X;default:return X}}var Q={Light:`light`,Switch:`switch`,WindowCovering:`cover`,Lock:`lock`,SecuritySystem:`alarm`,Buttons:`button`,Select:`select`,Siren:`siren`,Sensor:`sensor`,Entry:`entry`,Program:`script`,MediaPlayer:`media_player`,Outlet:`switch`,light:`light`,switch:`switch`,input_boolean:`switch`,cover:`cover`,lock:`lock`,alarm_control_panel:`alarm`,input_button:`button`,button:`button`,input_select:`select`,select:`select`,siren:`siren`,sensor:`sensor`,media_player:`media_player`,script:`script`},rt={light:`light`,switch:`switch`,input_boolean:`switch`,cover:`cover`,lock:`lock`,alarm_control_panel:`alarm`,input_button:`button`,button:`button`,input_select:`select`,select:`select`,siren:`siren`,sensor:`sensor`,binary_sensor:`sensor`,media_player:`media_player`,script:`script`,climate:`climate`,camera:`camera`,fan:`fan`,vacuum:`vacuum`,automation:`automation`,scene:`scene`,input_number:`sensor`,person:`person`,device_tracker:`tracker`,weather:`weather`,water_heater:`climate`},it={Light:`light`,Switch:`switch`,WindowCovering:`cover`,Lock:`lock`,SecuritySystem:`alarm`,Buttons:`button`,Select:`select`,Siren:`siren`,Sensor:`sensor`,Entry:`entry`,Program:`script`,MediaPlayer:`media_player`,Camera:`camera`,Doorbell:`doorbell`,Fan:`fan`,Outlet:`switch`};function at(e){return Q[e]||(Q[e.toLowerCase()]??null)}var ot=[`Entry`,`Light`,`Switch`,`Lock`,`SecuritySystem`,`Buttons`,`WindowCovering`,`Siren`,`Sensor`,`Select`,`Program`],st=new Set(ot),ct=[`light`,`switch`,`input_boolean`,`cover`,`lock`,`alarm_control_panel`,`input_button`,`button`,`input_select`,`select`,`siren`,`media_player`,`script`],lt=new Set(ct),$=[{id:`liveStream`,label:`Live Stream`,sources:{frigate:!0,scrypted:!0,rtsp:!0},adapterMethod:`getLiveStream`},{id:`multiResolution`,label:`Multi-Resolution`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getResolutions`},{id:`motion`,label:`Motion Detection`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getMotion`},{id:`objectDetection`,label:`Object Detection`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getObjectDetections`},{id:`audioVolume`,label:`Audio Level`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getAudioVolume`},{id:`audioVolumes`,label:`Audio Volumes (dBFS)`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getAudioVolumes`},{id:`ptz`,label:`PTZ Control`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getPTZ`},{id:`intercom`,label:`Intercom (Mic)`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getIntercomSupport`},{id:`deviceStatus`,label:`Device Status`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`getStatus`},{id:`timeline`,label:`Detection Timeline`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getCameraDayData`},{id:`clusteredTimeline`,label:`Clustered Timeline`,sources:{frigate:!0,scrypted:!0,rtsp:!1},requiresBackend:!0,adapterMethod:`getClusteredDayData`},{id:`detectionClasses`,label:`Detection Classes`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getDetectionClasses`},{id:`videoClips`,label:`Video Clips`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getVideoClips`},{id:`nvrPlayback`,label:`NVR Playback`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getNvrPlaybackSupported`},{id:`nvrScrub`,label:`NVR Scrub/Seek`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`seekRecordingStream`},{id:`recordingThumbnail`,label:`Recording Thumbnails`,sources:{frigate:!0,scrypted:!0,rtsp:!1},adapterMethod:`getRecordingStreamThumbnail`},{id:`nvrSeekToLive`,label:`Seek to Live`,sources:{frigate:!1,scrypted:!0,rtsp:!1},adapterMethod:`seekNvrToLive`}];function ut(e,t,n){let r=$.find(t=>t.id===e);return!(!r||!r.sources[t]||r.platforms&&r.platforms[n]===!1)}function dt(e){return $.filter(t=>t.sources[e])}function ft(){return $.filter(e=>e.requiresBackend)}export{X as DEFAULT_ENABLED_CLASSES,ze as DetectionClass,ct as ELIGIBLE_HA_DOMAINS,lt as ELIGIBLE_HA_DOMAINS_SET,ot as ELIGIBLE_SCRYPTED_DEVICE_TYPES,st as ELIGIBLE_SCRYPTED_DEVICE_TYPES_SET,$ as FEATURE_MATRIX,rt as HA_DOMAIN_TYPE_MAP,Q as RAW_TO_CANONICAL,it as SCRYPTED_TYPE_TO_CANONICAL,L as System,tt as TIMELINE_PRESET_ALL,Z as TIMELINE_PRESET_CRITICAL,et as TIMELINE_PRESET_IMPORTANT,R as animalClasses,G as audioClasses,K as audioLabelClasses,Le as createSystem,$e as defaultDetectionClasses,Y as detectionClassesDefaultMap,q as doorbellClasses,V as faceClasses,ft as getBackendRequiredFeatures,at as getCanonicalDeviceType,nt as getClassesForTimelinePreset,Ze as getParentClass,Qe as getParentDetectionClass,dt as getSourceFeatures,He as isAnimalClassname,Je as isAudioClassname,Ke as isDoorbellClassname,Be as isFaceClassname,ut as isFeatureAvailable,Xe as isLabelDetection,Ge as isMotionClassname,qe as isPackageClassname,Ue as isPersonClassname,Ve as isPlateClassname,Ye as isSensorLabelClassname,We as isVehicleClassname,H as licensePlateClasses,U as motionClasses,W as packageClasses,z as personClasses,Re as raceFastestEndpoint,J as sensorLabelClasses,B as vehicleClasses};