@camstack/addon-pipeline 1.2.38 → 1.2.40

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 (90) hide show
  1. package/dist/audio-analyzer/index.js +1 -1
  2. package/dist/audio-analyzer/index.mjs +1 -1
  3. package/dist/detection-pipeline/index.js +145 -175
  4. package/dist/detection-pipeline/index.mjs +120 -150
  5. package/dist/{dist-Du7_SNiR.mjs → dist-C6p8jcji.mjs} +495 -113
  6. package/dist/{dist-BvFLZyhW.js → dist-DcMBfoCg.js} +495 -113
  7. package/dist/{step-definitions-C8tk9fPJ.mjs → event-loop-stall-monitor-BHqCesa1.mjs} +139 -2
  8. package/dist/{step-definitions-i8O-hxyI.js → event-loop-stall-monitor-oL9xanvX.js} +150 -1
  9. package/dist/lazy-sharp-B-mb8uWx.mjs +20 -0
  10. package/dist/lazy-sharp-CcYuXtsa.js +25 -0
  11. package/dist/motion-wasm/index.js +3 -3
  12. package/dist/motion-wasm/index.mjs +3 -3
  13. package/dist/pipeline-runner/index.js +3316 -2428
  14. package/dist/pipeline-runner/index.mjs +3315 -2428
  15. package/dist/recorder/index.js +102 -664
  16. package/dist/recorder/index.mjs +102 -658
  17. package/dist/stream-broker/_stub.js +2 -2
  18. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-ByuMjhL3.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Bt1YkfUW.mjs} +2 -2
  19. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DJnh97n9.mjs +26 -0
  20. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BsNhZnfZ.mjs +26 -0
  21. package/dist/stream-broker/{hostInit-CfC64ye2.mjs → hostInit-Dyj8Vaql.mjs} +2 -2
  22. package/dist/stream-broker/index.js +723 -214
  23. package/dist/stream-broker/index.mjs +723 -214
  24. package/dist/stream-broker/remoteEntry.js +1 -1
  25. package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-Dx-Vrpyt.js → MaskShapeCanvas-DI4BY7W2-m1RaK_7F.js} +1 -1
  26. package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-9D-BWwQP.js → MotionZonesSettings-NcxxQN8r-C00UIgFo.js} +1 -1
  27. package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-HvAetfA4.js → PrivacyMaskSettings-APgPLF7p-DWYllToj.js} +1 -1
  28. package/embed-dist/assets/index-4fJzjj4H.css +2 -0
  29. package/embed-dist/assets/index-BaUgbxWl.js +112 -0
  30. package/embed-dist/index.html +2 -2
  31. package/package.json +2 -2
  32. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-ByHi7ZAe.mjs +0 -26
  33. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CscpvIRR.mjs +0 -26
  34. package/embed-dist/assets/index-9Ob2YrIf.js +0 -343
  35. package/embed-dist/assets/index-CAe6Dg-X.css +0 -2
  36. package/python/__pycache__/inference_pool.cpython-312.pyc +0 -0
  37. package/python/__pycache__/inference_pool.cpython-313.pyc +0 -0
  38. package/python/__pycache__/inference_pool.cpython-314.pyc +0 -0
  39. package/python/__pycache__/test_inference_pool_backpressure.cpython-314.pyc +0 -0
  40. package/python/__pycache__/test_inference_pool_coreml_cache.cpython-314.pyc +0 -0
  41. package/python/__pycache__/test_inference_pool_device_selection.cpython-314.pyc +0 -0
  42. package/python/__pycache__/test_inference_pool_layout.cpython-314.pyc +0 -0
  43. package/python/__pycache__/test_inference_pool_preprocess.cpython-314.pyc +0 -0
  44. package/python/__pycache__/yamnet_audio.cpython-314.pyc +0 -0
  45. package/python/postprocessors/__pycache__/__init__.cpython-312.pyc +0 -0
  46. package/python/postprocessors/__pycache__/__init__.cpython-313.pyc +0 -0
  47. package/python/postprocessors/__pycache__/__init__.cpython-314.pyc +0 -0
  48. package/python/postprocessors/__pycache__/_safety.cpython-313.pyc +0 -0
  49. package/python/postprocessors/__pycache__/arcface.cpython-312.pyc +0 -0
  50. package/python/postprocessors/__pycache__/arcface.cpython-313.pyc +0 -0
  51. package/python/postprocessors/__pycache__/arcface.cpython-314.pyc +0 -0
  52. package/python/postprocessors/__pycache__/clip.cpython-312.pyc +0 -0
  53. package/python/postprocessors/__pycache__/clip.cpython-313.pyc +0 -0
  54. package/python/postprocessors/__pycache__/clip.cpython-314.pyc +0 -0
  55. package/python/postprocessors/__pycache__/ctc.cpython-312.pyc +0 -0
  56. package/python/postprocessors/__pycache__/ctc.cpython-313.pyc +0 -0
  57. package/python/postprocessors/__pycache__/ctc.cpython-314.pyc +0 -0
  58. package/python/postprocessors/__pycache__/saliency.cpython-312.pyc +0 -0
  59. package/python/postprocessors/__pycache__/saliency.cpython-313.pyc +0 -0
  60. package/python/postprocessors/__pycache__/saliency.cpython-314.pyc +0 -0
  61. package/python/postprocessors/__pycache__/scrfd.cpython-312.pyc +0 -0
  62. package/python/postprocessors/__pycache__/scrfd.cpython-313.pyc +0 -0
  63. package/python/postprocessors/__pycache__/scrfd.cpython-314.pyc +0 -0
  64. package/python/postprocessors/__pycache__/softmax.cpython-312.pyc +0 -0
  65. package/python/postprocessors/__pycache__/softmax.cpython-313.pyc +0 -0
  66. package/python/postprocessors/__pycache__/softmax.cpython-314.pyc +0 -0
  67. package/python/postprocessors/__pycache__/ssd.cpython-312.pyc +0 -0
  68. package/python/postprocessors/__pycache__/ssd.cpython-313.pyc +0 -0
  69. package/python/postprocessors/__pycache__/ssd.cpython-314.pyc +0 -0
  70. package/python/postprocessors/__pycache__/test_clip.cpython-312-pytest-9.1.1.pyc +0 -0
  71. package/python/postprocessors/__pycache__/test_clip.cpython-313-pytest-9.1.1.pyc +0 -0
  72. package/python/postprocessors/__pycache__/test_ctc.cpython-312-pytest-9.1.1.pyc +0 -0
  73. package/python/postprocessors/__pycache__/test_ctc.cpython-312.pyc +0 -0
  74. package/python/postprocessors/__pycache__/test_ctc.cpython-313-pytest-9.1.1.pyc +0 -0
  75. package/python/postprocessors/__pycache__/test_ctc.cpython-313.pyc +0 -0
  76. package/python/postprocessors/__pycache__/test_saliency.cpython-312-pytest-9.1.1.pyc +0 -0
  77. package/python/postprocessors/__pycache__/test_saliency.cpython-313-pytest-9.1.1.pyc +0 -0
  78. package/python/postprocessors/__pycache__/test_softmax.cpython-312-pytest-9.1.1.pyc +0 -0
  79. package/python/postprocessors/__pycache__/test_yolo_nms.cpython-312-pytest-9.1.1.pyc +0 -0
  80. package/python/postprocessors/__pycache__/test_yolo_nms.cpython-39.pyc +0 -0
  81. package/python/postprocessors/__pycache__/yamnet.cpython-312.pyc +0 -0
  82. package/python/postprocessors/__pycache__/yamnet.cpython-313.pyc +0 -0
  83. package/python/postprocessors/__pycache__/yamnet.cpython-314.pyc +0 -0
  84. package/python/postprocessors/__pycache__/yolo.cpython-312.pyc +0 -0
  85. package/python/postprocessors/__pycache__/yolo.cpython-313.pyc +0 -0
  86. package/python/postprocessors/__pycache__/yolo.cpython-314.pyc +0 -0
  87. package/python/postprocessors/__pycache__/yolo.cpython-39.pyc +0 -0
  88. package/python/postprocessors/__pycache__/yolo_seg.cpython-312.pyc +0 -0
  89. package/python/postprocessors/__pycache__/yolo_seg.cpython-313.pyc +0 -0
  90. package/python/postprocessors/__pycache__/yolo_seg.cpython-314.pyc +0 -0
@@ -1,343 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-NcxxQN8r-9D-BWwQP.js","./MaskShapeCanvas-DI4BY7W2-Dx-Vrpyt.js","./PrivacyMaskSettings-APgPLF7p-HvAetfA4.js"])))=>i.map(i=>d[i]);
2
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var a in e)t(r,a,{get:e[a],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,a,s,c)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var l=r(a),u=0,d=l.length,f;u<d;u++)f=l[u],!o.call(e,f)&&f!==s&&t(e,f,{get:(e=>a[e]).bind(null,f),enumerable:!(c=n(a,f))||c.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(a(n)),l(r||!n||!n.__esModule?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<a(o,t))e[r]=t,e[n]=o,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,o=e.length,s=o>>>1;r<s;){var c=2*(r+1)-1,l=e[c],u=c+1,d=e[u];if(0>a(l,n))u<o&&0>a(d,l)?(e[r]=d,e[u]=n,r=u):(e[r]=l,e[c]=n,r=c);else if(u<o&&0>a(d,n))e[r]=d,e[u]=n,r=u;else break a}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var l=[],u=[],d=1,f=null,p=3,m=!1,h=!1,g=!1,_=!1,v=typeof setTimeout==`function`?setTimeout:null,y=typeof clearTimeout==`function`?clearTimeout:null,b=typeof setImmediate<`u`?setImmediate:null;function x(e){for(var a=n(u);a!==null;){if(a.callback===null)r(u);else if(a.startTime<=e)r(u),a.sortIndex=a.expirationTime,t(l,a);else break;a=n(u)}}function S(e){if(g=!1,x(e),!h)if(n(l)!==null)h=!0,C||(C=!0,te());else{var t=n(u);t!==null&&re(S,t.startTime-e)}}var C=!1,w=-1,T=5,E=-1;function D(){return _?!0:!(e.unstable_now()-E<T)}function ee(){if(_=!1,C){var t=e.unstable_now();E=t;var a=!0;try{a:{h=!1,g&&(g=!1,y(w),w=-1),m=!0;var o=p;try{b:{for(x(t),f=n(l);f!==null&&!(f.expirationTime>t&&D());){var s=f.callback;if(typeof s==`function`){f.callback=null,p=f.priorityLevel;var c=s(f.expirationTime<=t);if(t=e.unstable_now(),typeof c==`function`){f.callback=c,x(t),a=!0;break b}f===n(l)&&r(l),x(t)}else r(l);f=n(l)}if(f!==null)a=!0;else{var d=n(u);d!==null&&re(S,d.startTime-t),a=!1}}break a}finally{f=null,p=o,m=!1}a=void 0}}finally{a?te():C=!1}}}var te;if(typeof b==`function`)te=function(){b(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,ne=O.port2;O.port1.onmessage=ee,te=function(){ne.postMessage(null)}}else te=function(){v(ee,0)};function re(t,n){w=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},e.unstable_scheduleCallback=function(r,a,o){var s=e.unstable_now();switch(typeof o==`object`&&o?(o=o.delay,o=typeof o==`number`&&0<o?s+o:s):o=s,r){case 1:var c=-1;break;case 2:c=250;break;case 5:c=1073741823;break;case 4:c=1e4;break;default:c=5e3}return c=o+c,r={id:d++,callback:a,priorityLevel:r,startTime:o,expirationTime:c,sortIndex:-1},o>s?(r.sortIndex=o,t(u,r),n(l)===null&&r===n(u)&&(g?(y(w),w=-1):g=!0,re(S,o-s))):(r.sortIndex=c,t(l,r),h||m||(h=!0,C||(C=!0,te()))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}})),f=s(((e,t)=>{t.exports=d()})),p=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),a=Symbol.for(`react.strict_mode`),o=Symbol.for(`react.profiler`),s=Symbol.for(`react.consumer`),c=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.activity`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var a=r.ref;return{$$typeof:t,type:e,key:n,ref:a===void 0?null:a,props:r}}function ee(e,t){return D(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,a,o,s){var c=typeof e;(c===`undefined`||c===`boolean`)&&(e=null);var l=!1;if(e===null)l=!0;else switch(c){case`bigint`:case`string`:case`number`:l=!0;break;case`object`:switch(e.$$typeof){case t:case n:l=!0;break;case f:return l=e._init,ae(l(e._payload),r,a,o,s)}}if(l)return s=s(e),l=o===``?`.`+re(e,0):o,C(s)?(a=``,l!=null&&(a=l.replace(ne,`$&/`)+`/`),ae(s,r,a,``,function(e){return e})):s!=null&&(te(s)&&(s=ee(s,a+(s.key==null||e&&e.key===s.key?``:(``+s.key).replace(ne,`$&/`)+`/`)+l)),r.push(s)),1;l=0;var u=o===``?`.`:o+`:`;if(C(e))for(var d=0;d<e.length;d++)o=e[d],c=u+re(o,d),l+=ae(o,r,a,c,s);else if(d=h(e),typeof d==`function`)for(e=d.call(e),d=0;!(o=e.next()).done;)o=o.value,c=u+re(o,d++),l+=ae(o,r,a,c,s);else if(c===`object`){if(typeof e.then==`function`)return ae(ie(e),r,a,o,s);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return l}function oe(e,t,n){if(e==null)return e;var r=[],a=0;return ae(e,r,``,``,function(e){return t.call(n,e,a++)}),r}function se(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var k=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},A={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=p,e.Children=A,e.Component=y,e.Fragment=r,e.Profiler=o,e.PureComponent=x,e.StrictMode=a,e.Suspense=u,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),a=e.key;if(t!=null)for(o in t.key!==void 0&&(a=``+t.key),t)!E.call(t,o)||o===`key`||o===`__self`||o===`__source`||o===`ref`&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];r.children=s}return D(e.type,a,r)},e.createContext=function(e){return e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:s,_context:e},e},e.createElement=function(e,t,n){var r,a={},o=null;if(t!=null)for(r in t.key!==void 0&&(o=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(a[r]=t[r]);var s=arguments.length-2;if(s===1)a.children=n;else if(1<s){for(var c=Array(s),l=0;l<s;l++)c[l]=arguments[l+2];a.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)a[r]===void 0&&(a[r]=s[r]);return D(e,o,a)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:l,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:d,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=T.T,n={};T.T=n;try{var r=e(),a=T.S;a!==null&&a(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,k)}catch(e){k(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}},e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.2.7`})),m=s(((e,t)=>{t.exports=p()})),h=s((e=>{var t=m();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),o=typeof t.integrity==`string`?t.integrity:void 0,s=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:o,fetchPriority:s}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:o,fetchPriority:s,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),g=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=s((e=>{var t=f(),n=m(),r=g();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return u(o),e;if(c===r)return u(o),t;c=c.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=c;else{for(var l=!1,d=o.child;d;){if(d===n){l=!0,n=o,r=c;break}if(d===r){l=!0,r=o,n=c;break}d=d.sibling}if(!l){for(d=c.child;d;){if(d===n){l=!0,n=c,r=o;break}if(d===r){l=!0,r=c,n=o;break}d=d.sibling}if(!l)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,_=Symbol.for(`react.element`),v=Symbol.for(`react.transitional.element`),y=Symbol.for(`react.portal`),b=Symbol.for(`react.fragment`),x=Symbol.for(`react.strict_mode`),S=Symbol.for(`react.profiler`),C=Symbol.for(`react.consumer`),w=Symbol.for(`react.context`),T=Symbol.for(`react.forward_ref`),E=Symbol.for(`react.suspense`),D=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case b:return`Fragment`;case S:return`Profiler`;case x:return`StrictMode`;case E:return`Suspense`;case D:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case y:return`Portal`;case w:return e.displayName||`Context`;case C:return(e._context.displayName||`Context`)+`.Consumer`;case T:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function j(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function M(e,t){ue++,le[ue]=e.current,e.current=t}var fe=de(null),pe=de(null),me=de(null),he=de(null);function ge(e,t){switch(M(me,t),M(pe,e),M(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Yd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}j(fe),M(fe,e)}function _e(){j(fe),j(pe),j(me)}function N(e){e.memoizedState!==null&&M(he,e);var t=fe.current,n=Yd(t,e.type);t!==n&&(M(pe,e),M(fe,n))}function ve(e){pe.current===e&&(j(fe),j(pe)),he.current===e&&(j(he),ap._currentValue=ce)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var o=r.DetermineComponentFrameRoot(),s=o[0],c=o[1];if(s&&c){var l=s.split(`
5
- `),u=c.split(`
6
- `);for(a=r=0;r<l.length&&!l[r].includes(`DetermineComponentFrameRoot`);)r++;for(;a<u.length&&!u[a].includes(`DetermineComponentFrameRoot`);)a++;if(r===l.length||a===u.length)for(r=l.length-1,a=u.length-1;1<=r&&0<=a&&l[r]!==u[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==u[a]){if(r!==1||a!==1)do if(r--,a--,0>a||l[r]!==u[a]){var d=`
7
- `+l[r].replace(` at new `,` at `);return e.displayName&&d.includes(`<anonymous>`)&&(d=d.replace(`<anonymous>`,e.displayName)),d}while(1<=r&&0<=a);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var a=0,o=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var c=r&134217727;return c===0?(c=r&~o,c===0?s===0?n||(n=r&~e,n!==0&&(a=Xe(n))):a=Xe(s):a=Xe(c)):(r=c&~o,r===0?(s&=c,s===0?n||(n=c&~e,n!==0&&(a=Xe(n))):a=Xe(s)):a=Xe(r)),a===0?0:t!==0&&t!==a&&(t&o)===0&&(o=a&-a,n=t&-t,o>=n||o===32&&n&4194048)?t:a}function Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rt(e,t,n,r,a,o){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var c=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0<n;){var d=31-Ue(n),f=1<<d;c[d]=0,l[d]=-1;var p=u[d];if(p!==null)for(u[d]=null,d=0;d<p.length;d++){var m=p[d];m!==null&&(m.lane&=-536870913)}n&=~f}r!==0&&it(e,r,0),o!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=o&~(s&~t))}function it(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function at(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function ot(e,t){var n=t&-t;return n=n&42?1:st(n),(n&(e.suspendedLanes|t))===0?n:0}function st(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ct(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function lt(){var e=A.p;return e===0?(e=window.event,e===void 0?32:xp(e.type)):e}function ut(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var dt=Math.random().toString(36).slice(2),ft=`__reactFiber$`+dt,pt=`__reactProps$`+dt,mt=`__reactContainer$`+dt,ht=`__reactEvents$`+dt,gt=`__reactListeners$`+dt,_t=`__reactHandles$`+dt,vt=`__reactResources$`+dt,yt=`__reactMarker$`+dt;function bt(e){delete e[ft],delete e[pt],delete e[ht],delete e[gt],delete e[_t]}function xt(e){var t=e[ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mt]||n[ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vf(e);e!==null;){if(n=e[ft])return n;e=vf(e)}return t}e=n,n=e.parentNode}return null}function St(e){if(e=e[ft]||e[mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function wt(e){var t=e[vt];return t||=e[vt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Tt(e){e[yt]=!0}var Et=new Set,Dt={};function Ot(e,t){kt(e,t),kt(e+`Capture`,t)}function kt(e,t){for(Dt[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var At=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),jt={},Mt={};function Nt(e){return Ee.call(Mt,e)?!0:Ee.call(jt,e)?!1:At.test(e)?Mt[e]=!0:(jt[e]=!0,!1)}function Pt(e,t,n){if(Nt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ft(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function It(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Lt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Rt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function zt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var a=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){n=``+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bt(e){if(!e._valueTracker){var t=Rt(e)?`checked`:`value`;e._valueTracker=zt(e,t,``+e[t])}}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Rt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ht(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ut=/[\n"\\]/g;function Wt(e){return e.replace(Ut,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Gt(e,t,n,r,a,o,s,c){e.name=``,s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.type=s:e.removeAttribute(`type`),t==null?s!==`submit`&&s!==`reset`||e.removeAttribute(`value`):s===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Lt(t)):e.value!==``+Lt(t)&&(e.value=``+Lt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):qt(e,s,Lt(n)):qt(e,s,Lt(t)),a==null&&o!=null&&(e.defaultChecked=!!o),a!=null&&(e.checked=a&&typeof a!=`function`&&typeof a!=`symbol`),c!=null&&typeof c!=`function`&&typeof c!=`symbol`&&typeof c!=`boolean`?e.name=``+Lt(c):e.removeAttribute(`name`)}function Kt(e,t,n,r,a,o,s,c){if(o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.type=o),t!=null||n!=null){if(!(o!==`submit`&&o!==`reset`||t!=null)){Bt(e);return}n=n==null?``:``+Lt(n),t=t==null?n:``+Lt(t),c||t===e.value||(e.value=t),e.defaultValue=t}r??=a,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=c?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`&&(e.name=s),Bt(e)}function qt(e,t,n){t===`number`&&Ht(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Jt(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t[`$`+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Lt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Yt(e,t,n){if(t!=null&&(t=``+Lt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Lt(n)}function Xt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(se(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Lt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Bt(e)}function Zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function $t(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function en(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&$t(e,o,r)}else for(var s in t)t.hasOwnProperty(s)&&$t(e,s,t[s])}function tn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var nn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),rn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function an(e){return rn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function on(){}var sn=null;function cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ln=null,un=null;function dn(e){var t=St(e);if(t&&(e=t.stateNode)){var n=e[pt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Gt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Wt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[pt]||null;if(!o)throw Error(a(90));Gt(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Vt(r)}break a;case`textarea`:Yt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Jt(e,!!n.multiple,t,!1)}}}var fn=!1;function pn(e,t,n){if(fn)return e(t,n);fn=!0;try{return e(t)}finally{if(fn=!1,(ln!==null||un!==null)&&(wu(),ln&&(t=ln,e=un,un=ln=null,dn(t),e)))for(t=0;t<e.length;t++)dn(e[t])}}function mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[pt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var hn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(hn)try{var _n={};Object.defineProperty(_n,"passive",{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,a=`value`in vn?vn.value:vn.textContent,o=a.length;for(e=0;e<n&&t[e]===a[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===a[o-r];r++);return bn=a.slice(e,1<r?1-r:void 0)}function Sn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cn(){return!0}function wn(){return!1}function Tn(e){function t(t,n,r,a,o){for(var s in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented==null?!1===a.returnValue:a.defaultPrevented)?Cn:wn,this.isPropagationStopped=wn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Cn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Cn)},persist:function(){},isPersistent:Cn}),t}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dn=Tn(En),On=h({},En,{view:0,detail:0}),kn=Tn(On),An,jn,Mn,Nn=h({},On,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Mn&&(Mn&&e.type===`mousemove`?(An=e.screenX-Mn.screenX,jn=e.screenY-Mn.screenY):jn=An=0,Mn=e),An)},movementY:function(e){return`movementY`in e?e.movementY:jn}}),Pn=Tn(Nn),Fn=Tn(h({},Nn,{dataTransfer:0})),In=Tn(h({},On,{relatedTarget:0})),Ln=Tn(h({},En,{animationName:0,elapsedTime:0,pseudoElement:0})),Rn=Tn(h({},En,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),zn=Tn(h({},En,{data:0})),Bn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Vn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Hn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Un(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hn[e])?!!t[e]:!1}function Wn(){return Un}var Gn=Tn(h({},On,{key:function(e){if(e.key){var t=Bn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Sn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Vn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wn,charCode:function(e){return e.type===`keypress`?Sn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Sn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Kn=Tn(h({},Nn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),qn=Tn(h({},On,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wn})),Jn=Tn(h({},En,{propertyName:0,elapsedTime:0,pseudoElement:0})),Yn=Tn(h({},Nn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Xn=Tn(h({},En,{newState:0,oldState:0})),Zn=[9,13,27,32],Qn=hn&&`CompositionEvent`in window,$n=null;hn&&`documentMode`in document&&($n=document.documentMode);var er=hn&&`TextEvent`in window&&!$n,tr=hn&&(!Qn||$n&&8<$n&&11>=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=xn(),bn=yn=vn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return tr&&t.locale!==`ko`?null:t.data;default:return null}}var lr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!lr[e.type]:t===`textarea`}function dr(e,t,n,r){ln?un?un.push(r):un=[r]:ln=r,t=Md(t,`onChange`),0<t.length&&(n=new Dn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var fr=null,pr=null;function mr(e){wd(e,0)}function hr(e){if(Vt(Ct(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(hn){var vr;if(hn){var yr=`oninput`in document;if(!yr){var br=document.createElement(`div`);br.setAttribute(`oninput`,`return;`),yr=typeof br.oninput==`function`}vr=yr}else vr=!1;_r=vr&&(!document.documentMode||9<document.documentMode)}function xr(){fr&&(fr.detachEvent(`onpropertychange`,Sr),pr=fr=null)}function Sr(e){if(e.propertyName===`value`&&hr(pr)){var t=[];dr(t,pr,e,cn(e)),pn(mr,t)}}function Cr(e,t,n){e===`focusin`?(xr(),fr=t,pr=n,fr.attachEvent(`onpropertychange`,Sr)):e===`focusout`&&xr()}function wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return hr(pr)}function Tr(e,t){if(e===`click`)return hr(t)}function Er(e,t){if(e===`input`||e===`change`)return hr(t)}function Dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Or=typeof Object.is==`function`?Object.is:Dr;function kr(e,t){if(Or(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!Ee.call(t,a)||!Or(e[a],t[a]))return!1}return!0}function Ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jr(e,t){var n=Ar(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ht(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ht(e.document)}return t}function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Fr=hn&&`documentMode`in document&&11>=document.documentMode,Ir=null,Lr=null,Rr=null,zr=!1;function Br(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zr||Ir==null||Ir!==Ht(r)||(r=Ir,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rr&&kr(Rr,r)||(Rr=r,r=Md(Lr,`onSelect`),0<r.length&&(t=new Dn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ir)))}function Vr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Hr={animationend:Vr(`Animation`,`AnimationEnd`),animationiteration:Vr(`Animation`,`AnimationIteration`),animationstart:Vr(`Animation`,`AnimationStart`),transitionrun:Vr(`Transition`,`TransitionRun`),transitionstart:Vr(`Transition`,`TransitionStart`),transitioncancel:Vr(`Transition`,`TransitionCancel`),transitionend:Vr(`Transition`,`TransitionEnd`)},Ur={},Wr={};hn&&(Wr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Hr.animationend.animation,delete Hr.animationiteration.animation,delete Hr.animationstart.animation),`TransitionEvent`in window||delete Hr.transitionend.transition);function Gr(e){if(Ur[e])return Ur[e];if(!Hr[e])return e;var t=Hr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wr)return Ur[e]=t[n];return e}var Kr=Gr(`animationend`),qr=Gr(`animationiteration`),Jr=Gr(`animationstart`),Yr=Gr(`transitionrun`),Xr=Gr(`transitionstart`),Zr=Gr(`transitioncancel`),Qr=Gr(`transitionend`),$r=new Map,ei=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ei.push(`scrollEnd`);function ti(e,t){$r.set(e,t),Ot(t,[e])}var ni=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ri=[],ii=0,ai=0;function oi(){for(var e=ii,t=ai=ii=0;t<e;){var n=ri[t];ri[t++]=null;var r=ri[t];ri[t++]=null;var a=ri[t];ri[t++]=null;var o=ri[t];if(ri[t++]=null,r!==null&&a!==null){var s=r.pending;s===null?a.next=a:(a.next=s.next,s.next=a),r.pending=a}o!==0&&ui(n,a,o)}}function si(e,t,n,r){ri[ii++]=e,ri[ii++]=t,ri[ii++]=n,ri[ii++]=r,ai|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ci(e,t,n,r){return si(e,t,n,r),di(e)}function li(e,t){return si(e,null,null,t),di(e)}function ui(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var a=!1,o=e.return;o!==null;)o.childLanes|=n,r=o.alternate,r!==null&&(r.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(a=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,a&&t!==null&&(a=31-Ue(n),e=o.hiddenUpdates,r=e[a],r===null?e[a]=[t]:r.push(t),t.lane=n|536870912),o):null}function di(e){if(50<hu)throw hu=0,gu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fi={};function pi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mi(e,t,n,r){return new pi(e,t,n,r)}function hi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gi(e,t){var n=e.alternate;return n===null?(n=mi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function _i(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function vi(e,t,n,r,o,s){var c=0;if(r=e,typeof e==`function`)hi(e)&&(c=1);else if(typeof e==`string`)c=Xf(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=mi(31,n,t,o),e.elementType=O,e.lanes=s,e;case b:return yi(n.children,o,s,t);case x:c=8,o|=24;break;case S:return e=mi(12,n,t,o|2),e.elementType=S,e.lanes=s,e;case E:return e=mi(13,n,t,o),e.elementType=E,e.lanes=s,e;case D:return e=mi(19,n,t,o),e.elementType=D,e.lanes=s,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case w:c=10;break a;case C:c=9;break a;case T:c=11;break a;case ee:c=14;break a;case te:c=16,r=null;break a}c=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=mi(c,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function yi(e,t,n,r){return e=mi(7,e,r,t),e.lanes=n,e}function bi(e,t,n){return e=mi(6,e,null,t),e.lanes=n,e}function xi(e){var t=mi(18,null,null,0);return t.stateNode=e,t}function Si(e,t,n){return t=mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ci=new WeakMap;function wi(e,t){if(typeof e==`object`&&e){var n=Ci.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},Ci.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var Ti=[],Ei=0,Di=null,Oi=0,ki=[],Ai=0,ji=null,Mi=1,Ni=``;function Pi(e,t){Ti[Ei++]=Oi,Ti[Ei++]=Di,Di=e,Oi=t}function Fi(e,t,n){ki[Ai++]=Mi,ki[Ai++]=Ni,ki[Ai++]=ji,ji=e;var r=Mi;e=Ni;var a=32-Ue(r)-1;r&=~(1<<a),n+=1;var o=32-Ue(t)+a;if(30<o){var s=a-a%5;o=(r&(1<<s)-1).toString(32),r>>=s,a-=s,Mi=1<<32-Ue(t)+a|n<<a|r,Ni=o+e}else Mi=1<<o|n<<a|r,Ni=e}function Ii(e){e.return!==null&&(Pi(e,1),Fi(e,1,0))}function Li(e){for(;e===Di;)Di=Ti[--Ei],Ti[Ei]=null,Oi=Ti[--Ei],Ti[Ei]=null;for(;e===ji;)ji=ki[--Ai],ki[Ai]=null,Ni=ki[--Ai],ki[Ai]=null,Mi=ki[--Ai],ki[Ai]=null}function Ri(e,t){ki[Ai++]=Mi,ki[Ai++]=Ni,ki[Ai++]=ji,Mi=t.id,Ni=t.overflow,ji=e}var zi=null,Bi=null,Vi=!1,Hi=null,Ui=!1,Wi=Error(a(519));function Gi(e){throw Zi(wi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Wi}function Ki(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ft]=e,t[pt]=r,n){case`dialog`:Td(`cancel`,t),Td(`close`,t);break;case`iframe`:case`object`:case`embed`:Td(`load`,t);break;case`video`:case`audio`:for(n=0;n<Sd.length;n++)Td(Sd[n],t);break;case`source`:Td(`error`,t);break;case`img`:case`image`:case`link`:Td(`error`,t),Td(`load`,t);break;case`details`:Td(`toggle`,t);break;case`input`:Td(`invalid`,t),Kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Td(`invalid`,t);break;case`textarea`:Td(`invalid`,t),Xt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Rd(t.textContent,n)?(r.popover!=null&&(Td(`beforetoggle`,t),Td(`toggle`,t)),r.onScroll!=null&&Td(`scroll`,t),r.onScrollEnd!=null&&Td(`scrollend`,t),r.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||Gi(e,!0)}function qi(e){for(zi=e.return;zi;)switch(zi.tag){case 5:case 31:case 13:Ui=!1;return;case 27:case 3:Ui=!0;return;default:zi=zi.return}}function Ji(e){if(e!==zi)return!1;if(!Vi)return qi(e),Vi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Xd(e.type,e.memoizedProps)),n=!n),n&&Bi&&Gi(e),qi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Bi=_f(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Bi=_f(e)}else t===27?(t=Bi,af(e.type)?(e=gf,gf=null,Bi=e):Bi=t):Bi=zi?hf(e.stateNode.nextSibling):null;return!0}function Yi(){Bi=zi=null,Vi=!1}function Xi(){var e=Hi;return e!==null&&(tu===null?tu=e:tu.push.apply(tu,e),Hi=null),e}function Zi(e){Hi===null?Hi=[e]:Hi.push(e)}var Qi=de(null),$i=null,ea=null;function ta(e,t,n){M(Qi,t._currentValue),t._currentValue=n}function na(e){e._currentValue=Qi.current,j(Qi)}function ra(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ia(e,t,n,r){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){var c=o.child;s=s.firstContext;a:for(;s!==null;){var l=s;s=o;for(var u=0;u<t.length;u++)if(l.context===t[u]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),ra(s.return,n,e),r||(c=null);break a}s=l.next}}else if(o.tag===18){if(c=o.return,c===null)throw Error(a(341));c.lanes|=n,s=c.alternate,s!==null&&(s.lanes|=n),ra(c,n,e),c=null}else c=o.child;if(c!==null)c.return=o;else for(c=o;c!==null;){if(c===e){c=null;break}if(o=c.sibling,o!==null){o.return=c.return,c=o;break}c=c.return}o=c}}function aa(e,t,n,r){e=null;for(var o=t,s=!1;o!==null;){if(!s){if(o.flags&524288)s=!0;else if(o.flags&262144)break}if(o.tag===10){var c=o.alternate;if(c===null)throw Error(a(387));if(c=c.memoizedProps,c!==null){var l=o.type;Or(o.pendingProps.value,c.value)||(e===null?e=[l]:e.push(l))}}else if(o===he.current){if(c=o.alternate,c===null)throw Error(a(387));c.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e===null?e=[ap]:e.push(ap))}o=o.return}e!==null&&ia(t,e,n,r),t.flags|=262144}function oa(e){for(e=e.firstContext;e!==null;){if(!Or(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sa(e){$i=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ca(e){return ua($i,e)}function la(e,t){return $i===null&&sa(e),ua(e,t)}function ua(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ea===null){if(e===null)throw Error(a(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return n}var da=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},fa=t.unstable_scheduleCallback,pa=t.unstable_NormalPriority,ma={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ha(){return{controller:new da,data:new Map,refCount:0}}function ga(e){e.refCount--,e.refCount===0&&fa(pa,function(){e.controller.abort()})}var _a=null,va=0,ya=0,ba=null;function xa(e,t){if(_a===null){var n=_a=[];va=0,ya=gd(),ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return va++,t.then(Sa,Sa),t}function Sa(){if(--va===0&&_a!==null){ba!==null&&(ba.status=`fulfilled`);var e=_a;_a=null,ya=0,ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ca(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var wa=k.S;k.S=function(e,t){iu=je(),typeof t==`object`&&t&&typeof t.then==`function`&&xa(e,t),wa!==null&&wa(e,t)};var Ta=de(null);function Ea(){var e=Ta.current;return e===null?zl.pooledCache:e}function Da(e,t){t===null?M(Ta,Ta.current):M(Ta,t.pool)}function Oa(){var e=Ea();return e===null?null:{parent:ma._currentValue,pool:e}}var ka=Error(a(460)),Aa=Error(a(474)),ja=Error(a(542)),Ma={then:function(){}};function Na(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Pa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(on,on),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,La(e),e;default:if(typeof t.status==`string`)t.then(on,on);else{if(e=zl,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,La(e),e}throw P=t,ka}}function Fa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(P=e,ka):e}}var P=null;function Ia(){if(P===null)throw Error(a(459));var e=P;return P=null,e}function La(e){if(e===ka||e===ja)throw Error(a(483))}var Ra=null,za=0;function Ba(e){var t=za;return za+=1,Ra===null&&(Ra=[]),Pa(Ra,e,t)}function Va(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ha(e,t){throw t.$$typeof===_?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ua(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function o(e,t){return e=gi(e,t),e.index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function c(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function l(e,t,n,r){return t===null||t.tag!==6?(t=bi(n,e.mode,r),t.return=e,t):(t=o(t,n),t.return=e,t)}function u(e,t,n,r){var a=n.type;return a===b?f(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===te&&Fa(a)===t.type)?(t=o(t,n.props),Va(t,n),t.return=e,t):(t=vi(n.type,n.key,n.props,null,e.mode,r),Va(t,n),t.return=e,t)}function d(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Si(n,e.mode,r),t.return=e,t):(t=o(t,n.children||[]),t.return=e,t)}function f(e,t,n,r,a){return t===null||t.tag!==7?(t=yi(n,e.mode,r,a),t.return=e,t):(t=o(t,n),t.return=e,t)}function p(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case v:return n=vi(t.type,t.key,t.props,null,e.mode,n),Va(n,t),n.return=e,n;case y:return t=Si(t,e.mode,n),t.return=e,t;case te:return t=Fa(t),p(e,t,n)}if(se(t)||ie(t))return t=yi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return p(e,Ba(t),n);if(t.$$typeof===w)return p(e,la(e,t),n);Ha(e,t)}return null}function m(e,t,n,r){var a=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return a===null?l(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case v:return n.key===a?u(e,t,n,r):null;case y:return n.key===a?d(e,t,n,r):null;case te:return n=Fa(n),m(e,t,n,r)}if(se(n)||ie(n))return a===null?f(e,t,n,r,null):null;if(typeof n.then==`function`)return m(e,t,Ba(n),r);if(n.$$typeof===w)return m(e,t,la(e,n),r);Ha(e,n)}return null}function h(e,t,n,r,a){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,l(t,e,``+r,a);if(typeof r==`object`&&r){switch(r.$$typeof){case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,a);case y:return e=e.get(r.key===null?n:r.key)||null,d(t,e,r,a);case te:return r=Fa(r),h(e,t,n,r,a)}if(se(r)||ie(r))return e=e.get(n)||null,f(t,e,r,a,null);if(typeof r.then==`function`)return h(e,t,n,Ba(r),a);if(r.$$typeof===w)return h(e,t,n,la(t,r),a);Ha(t,r)}return null}function g(a,o,c,l){for(var u=null,d=null,f=o,g=o=0,_=null;f!==null&&g<c.length;g++){f.index>g?(_=f,f=null):_=f.sibling;var v=m(a,f,c[g],l);if(v===null){f===null&&(f=_);break}e&&f&&v.alternate===null&&t(a,f),o=s(v,o,g),d===null?u=v:d.sibling=v,d=v,f=_}if(g===c.length)return n(a,f),Vi&&Pi(a,g),u;if(f===null){for(;g<c.length;g++)f=p(a,c[g],l),f!==null&&(o=s(f,o,g),d===null?u=f:d.sibling=f,d=f);return Vi&&Pi(a,g),u}for(f=r(f);g<c.length;g++)_=h(f,a,g,c[g],l),_!==null&&(e&&_.alternate!==null&&f.delete(_.key===null?g:_.key),o=s(_,o,g),d===null?u=_:d.sibling=_,d=_);return e&&f.forEach(function(e){return t(a,e)}),Vi&&Pi(a,g),u}function _(o,c,l,u){if(l==null)throw Error(a(151));for(var d=null,f=null,g=c,_=c=0,v=null,y=l.next();g!==null&&!y.done;_++,y=l.next()){g.index>_?(v=g,g=null):v=g.sibling;var b=m(o,g,y.value,u);if(b===null){g===null&&(g=v);break}e&&g&&b.alternate===null&&t(o,g),c=s(b,c,_),f===null?d=b:f.sibling=b,f=b,g=v}if(y.done)return n(o,g),Vi&&Pi(o,_),d;if(g===null){for(;!y.done;_++,y=l.next())y=p(o,y.value,u),y!==null&&(c=s(y,c,_),f===null?d=y:f.sibling=y,f=y);return Vi&&Pi(o,_),d}for(g=r(g);!y.done;_++,y=l.next())y=h(g,o,_,y.value,u),y!==null&&(e&&y.alternate!==null&&g.delete(y.key===null?_:y.key),c=s(y,c,_),f===null?d=y:f.sibling=y,f=y);return e&&g.forEach(function(e){return t(o,e)}),Vi&&Pi(o,_),d}function x(e,r,s,l){if(typeof s==`object`&&s&&s.type===b&&s.key===null&&(s=s.props.children),typeof s==`object`&&s){switch(s.$$typeof){case v:a:{for(var u=s.key;r!==null;){if(r.key===u){if(u=s.type,u===b){if(r.tag===7){n(e,r.sibling),l=o(r,s.props.children),l.return=e,e=l;break a}}else if(r.elementType===u||typeof u==`object`&&u&&u.$$typeof===te&&Fa(u)===r.type){n(e,r.sibling),l=o(r,s.props),Va(l,s),l.return=e,e=l;break a}n(e,r);break}else t(e,r);r=r.sibling}s.type===b?(l=yi(s.props.children,e.mode,l,s.key),l.return=e,e=l):(l=vi(s.type,s.key,s.props,null,e.mode,l),Va(l,s),l.return=e,e=l)}return c(e);case y:a:{for(u=s.key;r!==null;){if(r.key===u)if(r.tag===4&&r.stateNode.containerInfo===s.containerInfo&&r.stateNode.implementation===s.implementation){n(e,r.sibling),l=o(r,s.children||[]),l.return=e,e=l;break a}else{n(e,r);break}else t(e,r);r=r.sibling}l=Si(s,e.mode,l),l.return=e,e=l}return c(e);case te:return s=Fa(s),x(e,r,s,l)}if(se(s))return g(e,r,s,l);if(ie(s)){if(u=ie(s),typeof u!=`function`)throw Error(a(150));return s=u.call(s),_(e,r,s,l)}if(typeof s.then==`function`)return x(e,r,Ba(s),l);if(s.$$typeof===w)return x(e,r,la(e,s),l);Ha(e,s)}return typeof s==`string`&&s!==``||typeof s==`number`||typeof s==`bigint`?(s=``+s,r!==null&&r.tag===6?(n(e,r.sibling),l=o(r,s),l.return=e,e=l):(n(e,r),l=bi(s,e.mode,l),l.return=e,e=l),c(e)):n(e,r)}return function(e,t,n,r){try{za=0;var a=x(e,t,n,r);return Ra=null,a}catch(t){if(t===ka||t===ja)throw t;var o=mi(29,t,null,e.mode);return o.lanes=r,o.return=e,o}}}var Wa=Ua(!0),Ga=Ua(!1),Ka=!1;function qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ja(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Rl&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=di(e),ui(e,null,n),t}return si(e,r,t,n),di(e)}function Za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}function Qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?a=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?a=o=t:o=o.next=t}else a=o=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var $a=!1;function eo(){if($a){var e=ba;if(e!==null)throw e}}function to(e,t,n,r){$a=!1;var a=e.updateQueue;Ka=!1;var o=a.firstBaseUpdate,s=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var l=c,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==s&&(c===null?d.firstBaseUpdate=u:c.next=u,d.lastBaseUpdate=l))}if(o!==null){var f=a.baseState;s=0,d=u=l=null,c=o;do{var p=c.lane&-536870913,m=p!==c.lane;if(m?(Vl&p)===p:(r&p)===p){p!==0&&p===ya&&($a=!0),d!==null&&(d=d.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});a:{var g=e,_=c;p=t;var v=n;switch(_.tag){case 1:if(g=_.payload,typeof g==`function`){f=g.call(v,f,p);break a}f=g;break a;case 3:g.flags=g.flags&-65537|128;case 0:if(g=_.payload,p=typeof g==`function`?g.call(v,f,p):g,p==null)break a;f=h({},f,p);break a;case 2:Ka=!0}}p=c.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=a.callbacks,m===null?a.callbacks=[p]:m.push(p))}else m={lane:p,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(u=d=m,l=f):d=d.next=m,s|=p;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;m=c,c=m.next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}while(1);d===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=d,o===null&&(a.shared.lanes=0),Yl|=s,e.lanes=s,e.memoizedState=f}}function no(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function ro(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)no(n[e],t)}var io=de(null),F=de(0);function ao(e,t){e=ql,M(F,e),M(io,t),ql=e|t.baseLanes}function oo(){M(F,ql),M(io,io.current)}function so(){ql=F.current,j(io),j(F)}var I=de(null),co=null;function lo(e){var t=e.alternate;M(mo,mo.current&1),M(I,e),co===null&&(t===null||io.current!==null||t.memoizedState!==null)&&(co=e)}function uo(e){M(mo,mo.current),M(I,e),co===null&&(co=e)}function fo(e){e.tag===22?(M(mo,mo.current),M(I,e),co===null&&(co=e)):po(e)}function po(){M(mo,mo.current),M(I,I.current)}function L(e){j(I),co===e&&(co=null),j(mo)}var mo=de(0);function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ff(n)||pf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var go=0,R=null,_o=null,vo=null,yo=!1,z=!1,bo=!1,B=0,xo=0,So=null,Co=0;function wo(){throw Error(a(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,a,o){return go=o,R=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Ls:q,bo=!1,o=n(r,a),bo=!1,z&&(o=Oo(t,n,r,a)),Do(e),o}function Do(e){k.H=Is;var t=_o!==null&&_o.next!==null;if(go=0,vo=_o=R=null,yo=!1,xo=0,So=null,t)throw Error(a(300));e===null||ec||(e=e.dependencies,e!==null&&oa(e)&&(ec=!0))}function Oo(e,t,n,r){R=e;var o=0;do{if(z&&(So=null),xo=0,z=!1,25<=o)throw Error(a(301));if(o+=1,vo=_o=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}k.H=Rs,s=t(n,r)}while(z);return s}function ko(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?U(t):t,e=e.useState()[0],(_o===null?null:_o.memoizedState)!==e&&(R.flags|=1024),t}function Ao(){var e=B!==0;return B=0,e}function V(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(yo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}yo=!1}go=0,vo=_o=R=null,z=!1,xo=B=0,So=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vo===null?R.memoizedState=vo=e:vo=vo.next=e,vo}function H(){if(_o===null){var e=R.alternate;e=e===null?null:e.memoizedState}else e=_o.next;var t=vo===null?R.memoizedState:vo.next;if(t!==null)vo=t,_o=e;else{if(e===null)throw R.alternate===null?Error(a(467)):Error(a(310));_o=e,e={memoizedState:_o.memoizedState,baseState:_o.baseState,baseQueue:_o.baseQueue,queue:_o.queue,next:null},vo===null?R.memoizedState=vo=e:vo=vo.next=e}return vo}function No(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function U(e){var t=xo;return xo+=1,So===null&&(So=[]),e=Pa(So,e,t),t=R,(vo===null?t.memoizedState:vo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Ls:q),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return U(e);if(e.$$typeof===w)return ca(e)}throw Error(a(438,String(e)))}function Fo(e){var t=null,n=R.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=R.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=No(),R.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ne;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(H(),_o,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var o=e.baseQueue,s=r.pending;if(s!==null){if(o!==null){var c=o.next;o.next=s.next,s.next=c}t.baseQueue=o=s,r.pending=null}if(s=e.baseState,o===null)e.memoizedState=s;else{t=o.next;var l=c=null,u=null,d=t,f=!1;do{var p=d.lane&-536870913;if(p===d.lane?(go&p)===p:(Vl&p)===p){var m=d.revertLane;if(m===0)u!==null&&(u=u.next={lane:0,revertLane:0,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),p===ya&&(f=!0);else if((go&m)===m){d=d.next,m===ya&&(f=!0);continue}else p={lane:0,revertLane:d.revertLane,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},u===null?(l=u=p,c=s):u=u.next=p,R.lanes|=m,Yl|=m;p=d.action,bo&&n(s,p),s=d.hasEagerState?d.eagerState:n(s,p)}else m={lane:p,revertLane:d.revertLane,gesture:d.gesture,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},u===null?(l=u=m,c=s):u=u.next=m,R.lanes|=p,Yl|=p;d=d.next}while(d!==null&&d!==t);if(u===null?c=s:u.next=l,!Or(s,e.memoizedState)&&(ec=!0,f&&(n=ba,n!==null)))throw n;e.memoizedState=s,e.baseState=c,e.baseQueue=u,r.lastRenderedState=s}return o===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var t=H(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var c=o=o.next;do s=e(s,c.action),c=c.next;while(c!==o);Or(s,t.memoizedState)||(ec=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Bo(e,t,n){var r=R,o=H(),s=Vi;if(s){if(n===void 0)throw Error(a(407));n=n()}else n=t();var c=!Or((_o||o).memoizedState,n);if(c&&(o.memoizedState=n,ec=!0),o=o.queue,ds(Uo.bind(null,r,o,e),[e]),o.getSnapshot!==t||c||vo!==null&&vo.memoizedState.tag&1){if(r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),zl===null)throw Error(a(349));s||go&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=R.updateQueue,t===null?(t=No(),R.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function Go(e){var t=li(e,2);t!==null&&yu(t,e,2)}function Ko(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),bo){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function qo(e,t,n,r){return e.baseState=n,Ro(e,_o,typeof r==`function`?r:Io)}function Jo(e,t,n,r,o){if(Ns(e))throw Error(a(485));if(e=t.action,e!==null){var s={payload:o,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){s.listeners.push(e)}};k.T===null?s.isTransition=!1:n(!0),r(s),n=t.pending,n===null?(s.next=t.pending=s,Yo(t,s)):(s.next=n.next,t.pending=n.next=s)}}function Yo(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var o=k.T,s={};k.T=s;try{var c=n(a,r),l=k.S;l!==null&&l(s,c),Xo(e,t,c)}catch(n){Qo(e,t,n)}finally{o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}else try{o=n(a,r),Xo(e,t,o)}catch(n){Qo(e,t,n)}}function Xo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Zo(e,t,n)},function(n){return Qo(e,t,n)}):Zo(e,t,n)}function Zo(e,t,n){t.status=`fulfilled`,t.value=n,$o(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yo(e,n)))}function Qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,$o(t),t=t.next;while(t!==r)}e.action=null}function $o(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function es(e,t){return t}function ts(e,t){if(Vi){var n=zl.formState;if(n!==null){a:{var r=R;if(Vi){if(Bi){b:{for(var a=Bi,o=Ui;a.nodeType!==8;){if(!o){a=null;break b}if(a=hf(a.nextSibling),a===null){a=null;break b}}o=a.data,a=o===`F!`||o===`F`?a:null}if(a){Bi=hf(a.nextSibling),r=a.data===`F!`;break a}}Gi(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=r,n=G.bind(null,R,r),r.dispatch=n,r=Ko(!1),o=K.bind(null,R,!1,r.queue),r=Mo(),a={state:t,dispatch:null,action:e,pending:null},r.queue=a,n=Jo.bind(null,R,a,o,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function ns(e){return rs(H(),_o,e)}function rs(e,t,n){if(t=Ro(e,t,es)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=U(t)}catch(e){throw e===ka?ja:e}else r=t;t=H();var a=t.queue,o=a.dispatch;return n!==t.memoizedState&&(R.flags|=2048,os(9,{destroy:void 0},is.bind(null,a,n),null)),[r,o,e]}function is(e,t){e.action=t}function as(e){var t=H(),n=_o;if(n!==null)return rs(t,n,e);H(),t=t.memoizedState,n=H();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=R.updateQueue,t===null&&(t=No(),R.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ss(){return H().memoizedState}function cs(e,t,n,r){var a=Mo();R.flags|=e,a.memoizedState=os(1|t,{destroy:void 0},n,r===void 0?null:r)}function ls(e,t,n,r){var a=H();r=r===void 0?null:r;var o=a.memoizedState.inst;_o!==null&&r!==null&&To(r,_o.memoizedState.deps)?a.memoizedState=os(t,o,n,r):(R.flags|=e,a.memoizedState=os(1|t,o,n,r))}function us(e,t){cs(8390656,8,e,t)}function ds(e,t){ls(2048,8,e,t)}function fs(e){R.flags|=4;var t=R.updateQueue;if(t===null)t=No(),R.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ps(e){var t=H().memoizedState;return fs({ref:t,nextImpl:e}),function(){if(Rl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ms(e,t){return ls(4,2,e,t)}function hs(e,t){return ls(4,4,e,t)}function gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _s(e,t,n){n=n==null?null:n.concat([e]),ls(4,4,gs.bind(null,t,e),n)}function vs(){}function ys(e,t){var n=H();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bs(e,t){var n=H();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),bo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function xs(e,t,n){return n===void 0||go&1073741824&&!(Vl&261930)?e.memoizedState=t:(e.memoizedState=n,e=vu(),R.lanes|=e,Yl|=e,n)}function Ss(e,t,n,r){return Or(n,t)?n:io.current===null?!(go&42)||go&1073741824&&!(Vl&261930)?(ec=!0,e.memoizedState=n):(e=vu(),R.lanes|=e,Yl|=e,t):(e=xs(e,n,r),Or(e,t)||(ec=!0),e)}function Cs(e,t,n,r,a){var o=A.p;A.p=o!==0&&8>o?o:8;var s=k.T,c={};k.T=c,K(e,!1,t,n);try{var l=a(),u=k.S;u!==null&&u(c,l),typeof l==`object`&&l&&typeof l.then==`function`?Ms(e,t,Ca(l,r),_u(e)):Ms(e,t,r,_u(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},_u())}finally{A.p=o,s!==null&&c.types!==null&&(s.types=c.types),k.T=s}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(a(476));var o=Es(e).queue;Cs(e,o,t,ce,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},_u())}function Os(){return ca(ap)}function ks(){return H().memoizedState}function As(){return H().memoizedState}function W(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_u();e=Ya(n);var r=Xa(t,e,n);r!==null&&(yu(r,t,n),Za(r,t,n)),t={cache:ha()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=_u();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=ci(e,t,n,r),n!==null&&(yu(n,e,r),Fs(n,t,r)))}function G(e,t,n){Ms(e,t,n,_u())}function Ms(e,t,n,r){var a={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,a);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,c=o(s,n);if(a.hasEagerState=!0,a.eagerState=c,Or(c,s))return si(e,t,a,0),zl===null&&oi(),!1}catch{}if(n=ci(e,t,a,r),n!==null)return yu(n,e,r),Fs(n,t,r),!0}return!1}function K(e,t,n,r){if(r={lane:2,revertLane:gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(a(479))}else t=ci(e,n,r,2),t!==null&&yu(t,e,2)}function Ns(e){var t=e.alternate;return e===R||t!==null&&t===R}function Ps(e,t){z=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}var Is={readContext:ca,use:Po,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useLayoutEffect:wo,useInsertionEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useSyncExternalStore:wo,useId:wo,useHostTransitionStatus:wo,useFormState:wo,useActionState:wo,useOptimistic:wo,useMemoCache:wo,useCacheRefresh:wo};Is.useEffectEvent=wo;var Ls={readContext:ca,use:Po,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ca,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(bo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var a=n(t);if(bo){He(!0);try{n(t)}finally{He(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=js.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=G.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(Mo(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,R,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,o=Mo();if(Vi){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),zl===null)throw Error(a(349));Vl&127||Vo(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,us(Uo.bind(null,r,s,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,s,n,t),null),n},useId:function(){var e=Mo(),t=zl.identifierPrefix;if(Vi){var n=Ni,r=Mi;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=B++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Os,useFormState:ts,useActionState:ts,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=K.bind(null,R,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Mo().memoizedState=W.bind(null,R)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(Rl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},q={readContext:ca,use:Po,useCallback:ys,useContext:ca,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:Lo,useRef:ss,useState:function(){return Lo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){return Ss(H(),_o.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=H().memoizedState;return[typeof e==`boolean`?e:U(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){return qo(H(),_o,e,t)},useMemoCache:Fo,useCacheRefresh:As};q.useEffectEvent=ps;var Rs={readContext:ca,use:Po,useCallback:ys,useContext:ca,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:zo,useRef:ss,useState:function(){return zo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){var n=H();return _o===null?xs(n,e,t):Ss(n,_o.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=H().memoizedState;return[typeof e==`boolean`?e:U(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:as,useActionState:as,useOptimistic:function(e,t){var n=H();return _o===null?(n.baseState=e,[e,n.queue.dispatch]):qo(n,_o,e,t)},useMemoCache:Fo,useCacheRefresh:As};Rs.useEffectEvent=ps;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_u(),a=Ya(r);a.payload=t,n!=null&&(a.callback=n),t=Xa(e,a,r),t!==null&&(yu(t,e,r),Za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_u(),a=Ya(r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Xa(e,a,r),t!==null&&(yu(t,e,r),Za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_u(),r=Ya(n);r.tag=2,t!=null&&(r.callback=t),t=Xa(e,r,n),t!==null&&(yu(t,e,n),Za(t,e,n))}};function Vs(e,t,n,r,a,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!kr(n,r)||!kr(a,o):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var a in n===t&&(n=h({},n)),e)n[a]===void 0&&(n[a]=e[a]);return n}function Ws(e){ni(e)}function Gs(e){console.error(e)}function Ks(e){ni(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=Ya(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Ya(e),e.tag=3,e}function Zs(e,t,n,r){var a=n.type.getDerivedStateFromError;if(typeof a==`function`){var o=r.value;e.payload=function(){return a(o)},e.callback=function(){Js(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof a!=`function`&&(su===null?su=new Set([this]):su.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,o){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&aa(t,n,o,!0),n=I.current,n!==null){switch(n.tag){case 31:case 13:return co===null?ju():n.alternate===null&&Jl===0&&(Jl=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===Ma?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Xu(e,r,o)),!1;case 22:return n.flags|=65536,r===Ma?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Xu(e,r,o)),!1}throw Error(a(435,n.tag))}return Xu(e,r,o),ju(),!1}if(Vi)return t=I.current,t===null?(r!==Wi&&(t=Error(a(423),{cause:r}),Zi(wi(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=wi(r,n),o=Ys(e.stateNode,r,o),Qa(e,o),Jl!==4&&(Jl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==Wi&&(e=Error(a(422),{cause:r}),Zi(wi(e,n)))),!1;var s=Error(a(520),{cause:r});if(s=wi(s,n),eu===null?eu=[s]:eu.push(s),Jl!==4&&(Jl=2),t===null)return!0;r=wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=Ys(n.stateNode,r,e),Qa(n,e),!1;case 1:if(t=n.type,s=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||s!==null&&typeof s.componentDidCatch==`function`&&(su===null||!su.has(s))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Xs(o),Zs(o,e,n,r),Qa(n,o),!1}n=n.return}while(n!==null);return!1}var $s=Error(a(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Ga(t,null,n,r):Wa(t,e.child,n,r)}function nc(e,t,n,r,a){n=n.render;var o=t.ref;if(`ref`in r){var s={};for(var c in r)c!==`ref`&&(s[c]=r[c])}else s=r;return sa(t),r=Eo(e,t,n,s,o,a),c=Ao(),e!==null&&!ec?(V(e,t,a),Ec(e,t,a)):(Vi&&c&&Ii(t),t.flags|=1,tc(e,t,r,a),t.child)}function rc(e,t,n,r,a){if(e===null){var o=n.type;return typeof o==`function`&&!hi(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,ic(e,t,o,r,a)):(e=vi(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Dc(e,a)){var s=o.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(s,r)&&e.ref===t.ref)return Ec(e,t,a)}return t.flags|=1,e=gi(o,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,a){if(e!==null){var o=e.memoizedProps;if(kr(o,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=o,Dc(e,a))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,a)}return fc(e,t,n,r,a)}function ac(e,t,n,r){var a=r.children,o=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(o=o===null?n:o.baseLanes|n,e!==null){for(r=t.child=e.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;r=a&~o}else r=0,t.child=null;return sc(e,t,o,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Da(t,o===null?null:o.cachePool),o===null?oo():ao(t,o),fo(t);else return r=t.lanes=536870912,sc(e,t,o===null?n:o.baseLanes|n,n,r)}else o===null?(e!==null&&Da(t,null),oo(),po(t)):(Da(t,o.cachePool),ao(t,o),po(t),t.memoizedState=null);return tc(e,t,a,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,a){var o=Ea();return o=o===null?null:{parent:ma._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&Da(t,null),oo(),fo(t),e!==null&&aa(e,t,r,!0),t.childLanes=a,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Wa(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,L(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,o=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Vi){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(uo(t),(e=Bi)?(e=df(e,Ui),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ji===null?null:{id:Mi,overflow:Ni},retryLane:536870912,hydrationErrors:null},n=xi(e),n.return=t,t.child=n,zi=t,Bi=null)):e=null,e===null)throw Gi(t);return t.lanes=536870912,null}return cc(t,r)}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(uo(t),o)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(ec||aa(e,t,n,!1),o=(n&e.childLanes)!==0,ec||o){if(r=zl,r!==null&&(c=ot(r,n),c!==0&&c!==s.retryLane))throw s.retryLane=c,li(e,c),yu(r,e,c),$s;ju(),t=lc(e,t,n)}else e=s.treeContext,Bi=hf(c.nextSibling),zi=t,Vi=!0,Hi=null,Ui=!1,e!==null&&Ri(t,e),t=cc(t,r),t.flags|=4096;return t}return e=gi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fc(e,t,n,r,a){return sa(t),n=Eo(e,t,n,r,void 0,a),r=Ao(),e!==null&&!ec?(V(e,t,a),Ec(e,t,a)):(Vi&&r&&Ii(t),t.flags|=1,tc(e,t,n,a),t.child)}function pc(e,t,n,r,a,o){return sa(t),t.updateQueue=null,n=Oo(t,r,n,a),Do(e),r=Ao(),e!==null&&!ec?(V(e,t,o),Ec(e,t,o)):(Vi&&r&&Ii(t),t.flags|=1,tc(e,t,n,o),t.child)}function mc(e,t,n,r,a){if(sa(t),t.stateNode===null){var o=fi,s=n.contextType;typeof s==`object`&&s&&(o=ca(s)),o=new n(r,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Bs,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=r,o.state=t.memoizedState,o.refs={},qa(t),s=n.contextType,o.context=typeof s==`object`&&s?ca(s):fi,o.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s==`function`&&(zs(t,n,s,r),o.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof o.getSnapshotBeforeUpdate==`function`||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(s=o.state,typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount(),s!==o.state&&Bs.enqueueReplaceState(o,o.state,null),to(t,r,o,a),eo(),o.state=t.memoizedState),typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){o=t.stateNode;var c=t.memoizedProps,l=Us(n,c);o.props=l;var u=o.context,d=n.contextType;s=fi,typeof d==`object`&&d&&(s=ca(d));var f=n.getDerivedStateFromProps;d=typeof f==`function`||typeof o.getSnapshotBeforeUpdate==`function`,c=t.pendingProps!==c,d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(c||u!==s)&&Hs(t,o,r,s),Ka=!1;var p=t.memoizedState;o.state=p,to(t,r,o,a),eo(),u=t.memoizedState,c||p!==u||Ka?(typeof f==`function`&&(zs(t,n,f,r),u=t.memoizedState),(l=Ka||Vs(t,n,l,r,p,u,s))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=s,r=l):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Ja(e,t),s=t.memoizedProps,d=Us(n,s),o.props=d,f=t.pendingProps,p=o.context,u=n.contextType,l=fi,typeof u==`object`&&u&&(l=ca(u)),c=n.getDerivedStateFromProps,(u=typeof c==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==f||p!==l)&&Hs(t,o,r,l),Ka=!1,p=t.memoizedState,o.state=p,to(t,r,o,a),eo();var m=t.memoizedState;s!==f||p!==m||Ka||e!==null&&e.dependencies!==null&&oa(e.dependencies)?(typeof c==`function`&&(zs(t,n,c,r),m=t.memoizedState),(d=Ka||Vs(t,n,d,r,p,m,l)||e!==null&&e.dependencies!==null&&oa(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=d):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return o=r,dc(e,t),r=(t.flags&128)!=0,o||r?(o=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:o.render(),t.flags|=1,e!==null&&r?(t.child=Wa(t,e.child,null,a),t.child=Wa(t,null,n,a)):tc(e,t,n,a),t.memoizedState=o.state,e=t.child):e=Ec(e,t,a),e}function hc(e,t,n,r){return Yi(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:Oa()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Ql),e}function yc(e,t,n){var r=t.pendingProps,o=!1,s=(t.flags&128)!=0,c;if((c=s)||(c=e!==null&&e.memoizedState===null?!1:(mo.current&2)!=0),c&&(o=!0,t.flags&=-129),c=(t.flags&32)!=0,t.flags&=-33,e===null){if(Vi){if(o?lo(t):po(t),(e=Bi)?(e=df(e,Ui),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ji===null?null:{id:Mi,overflow:Ni},retryLane:536870912,hydrationErrors:null},n=xi(e),n.return=t,t.child=n,zi=t,Bi=null)):e=null,e===null)throw Gi(t);return pf(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,o?(po(t),o=t.mode,l=xc({mode:`hidden`,children:l},o),r=yi(r,o,n,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,c,n),t.memoizedState=gc,oc(null,r)):(lo(t),bc(t,l))}var u=e.memoizedState;if(u!==null&&(l=u.dehydrated,l!==null)){if(s)t.flags&256?(lo(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(po(t),l=r.fallback,o=t.mode,r=xc({mode:`visible`,children:r.children},o),l=yi(l,o,n,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,Wa(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,c,n),t.memoizedState=gc,t=oc(null,r)):(po(t),t.child=e.child,t.flags|=128,t=null);else if(lo(t),pf(l)){if(c=l.nextSibling&&l.nextSibling.dataset,c)var d=c.dgst;c=d,r=Error(a(419)),r.stack=``,r.digest=c,Zi({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||aa(e,t,n,!1),c=(n&e.childLanes)!==0,ec||c){if(c=zl,c!==null&&(r=ot(c,n),r!==0&&r!==u.retryLane))throw u.retryLane=r,li(e,r),yu(c,e,r),$s;ff(l)||ju(),t=Sc(e,t,n)}else ff(l)?(t.flags|=192,t.child=e.child,t=null):(e=u.treeContext,Bi=hf(l.nextSibling),zi=t,Vi=!0,Hi=null,Ui=!1,e!==null&&Ri(t,e),t=bc(t,r.children),t.flags|=4096);return t}return o?(po(t),l=r.fallback,o=t.mode,u=e.child,d=u.sibling,r=gi(u,{mode:`hidden`,children:r.children}),r.subtreeFlags=u.subtreeFlags&65011712,d===null?(l=yi(l,o,n,null),l.flags|=2):l=gi(d,l),l.return=t,r.return=t,r.sibling=l,t.child=r,oc(null,r),r=t.child,l=e.child.memoizedState,l===null?l=_c(n):(o=l.cachePool,o===null?o=Oa():(u=ma._currentValue,o=o.parent===u?o:{parent:u,pool:u}),l={baseLanes:l.baseLanes|n,cachePool:o}),r.memoizedState=l,r.childLanes=vc(e,c,n),t.memoizedState=gc,oc(e.child,r)):(lo(t),n=e.child,e=n.sibling,n=gi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=n,t.memoizedState=null,n)}function bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=mi(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Wa(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ra(e.return,t,n)}function wc(e,t,n,r,a,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,treeForkCount:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a,s.treeForkCount=o)}function Tc(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;r=r.children;var s=mo.current,c=(s&2)!=0;if(c?(s=s&1|2,t.flags|=128):s&=1,M(mo,s),tc(e,t,r,n),r=Vi?Oi:0,!c&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case`forwards`:for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&ho(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),wc(t,!1,a,n,o,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ho(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}wc(t,!0,n,null,o,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(aa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=gi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&oa(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),ta(t,ma,e.memoizedState.cache),Yi();break;case 27:case 5:N(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,uo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(lo(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):(lo(t),t.flags|=128,null);lo(t);break;case 19:var a=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(aa(e,t,n,!1),(n&t.childLanes)!==0),a){if(r)return Tc(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),M(mo,mo.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:ta(t,ma,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,Vi&&t.flags&1048576&&Fi(t,Oi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Fa(t.elementType),t.type=e,typeof e==`function`)hi(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var o=e.$$typeof;if(o===T){t.tag=11,t=nc(null,t,e,r,n);break a}else if(o===ee){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=oe(e)||e,Error(a(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,o=Us(r,t.pendingProps),mc(e,t,r,o,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var s=t.memoizedState;o=s.element,Ja(e,t),to(t,r,null,n);var c=t.memoizedState;if(r=c.cache,ta(t,ma,r),r!==s.cache&&ia(t,[ma],n,!0),eo(),r=c.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=hc(e,t,r,n);break a}else if(r!==o){o=wi(Error(a(424)),t),Zi(o),t=hc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Bi=hf(e.firstChild),zi=t,Vi=!0,Hi=null,Ui=!0,n=Ga(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Yi(),r===o){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=If(t.type,null,t.pendingProps,null))?t.memoizedState=n:Vi||(n=t.type,e=t.pendingProps,r=qd(me.current).createElement(n),r[ft]=t,r[pt]=e,Vd(r,n,e),Tt(r),t.stateNode=r):t.memoizedState=If(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return N(t),e===null&&Vi&&(r=t.stateNode=yf(t.type,t.pendingProps,me.current),zi=t,Ui=!0,o=Bi,af(t.type)?(gf=o,Bi=hf(r.firstChild)):Bi=o),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Vi&&((o=r=Bi)&&(r=lf(r,t.type,t.pendingProps,Ui),r===null?o=!1:(t.stateNode=r,zi=t,Bi=hf(r.firstChild),Ui=!1,o=!0)),o||Gi(t)),N(t),o=t.type,s=t.pendingProps,c=e===null?null:e.memoizedProps,r=s.children,Xd(o,s)?r=null:c!==null&&Xd(o,c)&&(t.flags|=32),t.memoizedState!==null&&(o=Eo(e,t,ko,null,null,n),ap._currentValue=o),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&Vi&&((e=n=Bi)&&(n=uf(n,t.pendingProps,Ui),n===null?e=!1:(t.stateNode=n,zi=t,Bi=null,e=!0)),e||Gi(t)),null;case 13:return yc(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Wa(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ta(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,sa(t),o=ca(o),r=r(o),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return sa(t),r=ca(ma),e===null?(o=Ea(),o===null&&(o=zl,s=ha(),o.pooledCache=s,s.refCount++,s!==null&&(o.pooledCacheLanes|=n),o=s),t.memoizedState={parent:r,cache:o},qa(t),ta(t,ma,o)):((e.lanes&n)!==0&&(Ja(e,t),to(t,null,null,n),eo()),o=e.memoizedState,s=t.memoizedState,o.parent===r?(r=s.cache,ta(t,ma,r),r!==o.cache&&ia(t,[ma],n,!0)):(o={parent:r,cache:r},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),ta(t,ma,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Ac(e){e.flags|=4}function jc(e,t,n,r,a){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Ou())e.flags|=8192;else throw P=Ma,Aa}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zf(t))if(Ou())e.flags|=8192;else throw P=Ma,Aa}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:et(),e.lanes|=t,$l|=t)}function Pc(e,t){if(!Vi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&65011712,r|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ic(e,t,n){var r=t.pendingProps;switch(Li(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),na(ma),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ji(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xi())),Fc(t),null;case 26:var o=t.type,s=t.memoizedState;return e===null?(Ac(t),s===null?(Fc(t),jc(t,o,null,r,n)):(Fc(t),Mc(t,s))):s?s===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,s)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,o,e,r,n)),null;case 27:if(ve(t),n=me.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Fc(t),null}e=fe.current,Ji(t)?Ki(t,e):(e=yf(o,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(ve(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Fc(t),null}if(s=fe.current,Ji(t))Ki(t,s);else{var c=qd(me.current);switch(s){case 1:s=c.createElementNS(`http://www.w3.org/2000/svg`,o);break;case 2:s=c.createElementNS(`http://www.w3.org/1998/Math/MathML`,o);break;default:switch(o){case`svg`:s=c.createElementNS(`http://www.w3.org/2000/svg`,o);break;case`math`:s=c.createElementNS(`http://www.w3.org/1998/Math/MathML`,o);break;case`script`:s=c.createElement(`div`),s.innerHTML=`<script><\/script>`,s=s.removeChild(s.firstChild);break;case`select`:s=typeof r.is==`string`?c.createElement(`select`,{is:r.is}):c.createElement(`select`),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s=typeof r.is==`string`?c.createElement(o,{is:r.is}):c.createElement(o)}}s[ft]=t,s[pt]=r;a:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)s.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break a;for(;c.sibling===null;){if(c.return===null||c.return===t)break a;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=s;a:switch(Vd(s,o,r),o){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=me.current,Ji(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,o=zi,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}e[ft]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Rd(e.nodeValue,n)),e||Gi(t,!0)}else e=qd(e).createTextNode(r),e[ft]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ji(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[ft]=t}else Yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Xi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(L(t),t):(L(t),null);if(t.flags&128)throw Error(a(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Ji(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(a(318));if(o=t.memoizedState,o=o===null?null:o.dehydrated,!o)throw Error(a(317));o[ft]=t}else Yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),o=!1}else o=Xi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(L(t),t):(L(t),null)}return L(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Nc(t,t.updateQueue),Fc(t),null);case 4:return _e(),e===null&&Od(t.stateNode.containerInfo),Fc(t),null;case 10:return na(t.type),Fc(t),null;case 19:if(j(mo),r=t.memoizedState,r===null)return Fc(t),null;if(o=(t.flags&128)!=0,s=r.rendering,s===null)if(o)Pc(r,!1);else{if(Jl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ho(e),s!==null){for(t.flags|=128,Pc(r,!1),e=s.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_i(n,e),n=n.sibling;return M(mo,mo.current&1|2),Vi&&Pi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>au&&(t.flags|=128,o=!0,Pc(r,!1),t.lanes=4194304)}else{if(!o)if(e=ho(s),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!s.alternate&&!Vi)return Fc(t),null}else 2*je()-r.renderingStartTime>au&&n!==536870912&&(t.flags|=128,o=!0,Pc(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(e=r.last,e===null?t.child=s:e.sibling=s,r.last=s)}return r.tail===null?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=mo.current,M(mo,o?n&1|2:n&1),Vi&&Pi(t,r.treeForkCount),e);case 22:case 23:return L(t),so(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&j(Ta),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),na(ma),Fc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Lc(e,t){switch(Li(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return na(ma),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(L(t),t.alternate===null)throw Error(a(340));Yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(L(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(mo),null;case 4:return _e(),null;case 10:return na(t.type),null;case 22:case 23:return L(t),so(),e!==null&&j(Ta),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return na(ma),null;case 25:return null;default:return null}}function Rc(e,t){switch(Li(t),t.tag){case 3:na(ma),_e();break;case 26:case 27:case 5:ve(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&L(t);break;case 13:L(t);break;case 19:j(mo);break;case 10:na(t.type);break;case 22:case 23:L(t),so(),e!==null&&j(Ta);break;case 24:na(ma)}}function zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var o=n.create,s=n.inst;r=o(),s.destroy=r}n=n.next}while(n!==a)}}catch(e){Yu(t,t.return,e)}}function Bc(e,t,n){try{var r=t.updateQueue,a=r===null?null:r.lastEffect;if(a!==null){var o=a.next;r=o;do{if((r.tag&e)===e){var s=r.inst,c=s.destroy;if(c!==void 0){s.destroy=void 0,a=t;var l=n,u=c;try{u()}catch(e){Yu(a,l,e)}}}r=r.next}while(r!==o)}}catch(e){Yu(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ro(t,n)}catch(t){Yu(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Yu(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Yu(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Yu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Yu(e,t,n)}else n.current=null}function Gc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Yu(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Hd(r,e.type,n,t),r[pt]=t}catch(t){Yu(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&af(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&af(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=on));else if(r!==4&&(r===27&&af(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&af(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Vd(t,r,n),t[ft]=e,t[pt]=n}catch(t){Yu(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Gd=mp,e=Nr(e),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break a}var c=0,l=-1,u=-1,d=0,f=0,p=e,m=null;b:for(;;){for(var h;p!==n||o!==0&&p.nodeType!==3||(l=c+o),p!==s||r!==0&&p.nodeType!==3||(u=c+r),p.nodeType===3&&(c+=p.nodeValue.length),(h=p.firstChild)!==null;)m=p,p=h;for(;;){if(p===e)break b;if(m===n&&++d===o&&(l=c),m===s&&++f===r&&(u=c),(h=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=h}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n||={start:0,end:0}}else n=null;for(Kd={focusedElem:e,selectionRange:n},mp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&s!==null){e=void 0,n=t,o=s.memoizedProps,s=s.memoizedState,r=n.stateNode;try{var g=Us(n.type,o);e=r.getSnapshotBeforeUpdate(g,s),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Yu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)cf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:cf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Yu(n,n.return,e)}else{var a=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Yu(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ro(e,t)}catch(e){Yu(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$u.bind(null,n),mf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,a=Qc;var o=$c;Qc=r,($c=t)&&!o?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),Qc=a,$c=o}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,a=sl;af(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),bf(n.stateNode),ol=r,sl=a;break;case 5:$c||Wc(n,t);case 6:if(r=ol,a=sl,ol=null,cl(e,t,n),ol=r,sl=a,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Yu(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Yu(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,of(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Bp(e)):of(ol,n.stateNode));break;case 4:r=ol,a=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=a;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bp(e)}catch(e){Yu(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bp(e)}catch(e){Yu(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(a(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ed.bind(null,e,t);t.then(r,r)}})}function ml(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(af(l.type)){ol=l.stateNode,sl=!1;break a}break;case 5:ol=l.stateNode,sl=!1;break a;case 3:case 4:ol=l.stateNode.containerInfo,sl=!0;break a}l=l.return}if(ol===null)throw Error(a(160));ll(s,c,o),ol=null,sl=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&4){var s=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;b:switch(r){case`title`:s=o.getElementsByTagName(`title`)[0],(!s||s[yt]||s[ft]||s.namespaceURI===`http://www.w3.org/2000/svg`||s.hasAttribute(`itemprop`))&&(s=o.createElement(r),o.head.insertBefore(s,o.querySelector(`head > title`))),Vd(s,r,n),s[ft]=e,Tt(s),r=s;break a;case`link`:var c=Jf(`link`,`href`,o).get(r+(n.href||``));if(c){for(var l=0;l<c.length;l++)if(s=c[l],s.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&s.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&s.getAttribute(`title`)===(n.title==null?null:n.title)&&s.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){c.splice(l,1);break b}}s=o.createElement(r),Vd(s,r,n),o.head.appendChild(s);break;case`meta`:if(c=Jf(`meta`,`content`,o).get(r+(n.content||``))){for(l=0;l<c.length;l++)if(s=c[l],s.getAttribute(`content`)===(n.content==null?null:``+n.content)&&s.getAttribute(`name`)===(n.name==null?null:n.name)&&s.getAttribute(`property`)===(n.property==null?null:n.property)&&s.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){c.splice(l,1);break b}}s=o.createElement(r),Vd(s,r,n),o.head.appendChild(s);break;default:throw Error(a(468,r))}s[ft]=e,Tt(s),r=s}e.stateNode=r}else Yf(o,e.type,e.stateNode);else e.stateNode=Uf(o,r,e.memoizedProps);else s===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,r===null?Yf(o,e.type,e.stateNode):Uf(o,r,e.memoizedProps))}break;case 27:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){o=e.stateNode;try{Zt(o,``)}catch(t){Yu(e,e.return,t)}}r&4&&e.stateNode!=null&&(o=e.memoizedProps,Kc(e,o,n===null?o:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Yu(e,e.return,t)}}break;case 3:if(qf=null,o=hl,hl=Cf(t.containerInfo),ml(t,e),hl=o,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Bp(t.containerInfo)}catch(t){Yu(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=Cf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ru=je()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:o=e.memoizedState!==null;var u=n!==null&&n.memoizedState!==null,d=Qc,f=$c;if(Qc=d||o,$c=f||u,ml(t,e),$c=f,Qc=d,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||u||Qc||$c||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){u=n=t;try{if(s=u.stateNode,o)c=s.style,typeof c.setProperty==`function`?c.setProperty(`display`,`none`,`important`):c.display=`none`;else{l=u.stateNode;var p=u.memoizedProps.style,m=p!=null&&p.hasOwnProperty(`display`)?p.display:null;l.style.display=m==null||typeof m==`boolean`?``:(``+m).trim()}}catch(e){Yu(u,u.return,e)}}}else if(t.tag===6){if(n===null){u=t;try{u.stateNode.nodeValue=o?``:u.memoizedProps}catch(e){Yu(u,u.return,e)}}}else if(t.tag===18){if(n===null){u=t;try{var h=u.stateNode;o?sf(h,!0):sf(u.stateNode,!1)}catch(e){Yu(u,u.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var o=n.stateNode;Xc(e,Jc(e),o);break;case 5:var s=n.stateNode;n.flags&32&&(Zt(s,``),n.flags&=-33),Xc(e,Jc(e),s);break;case 3:case 4:var c=n.stateNode.containerInfo;Yc(e,Jc(e),c);break;default:throw Error(a(161))}}catch(t){Yu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),bl(t);break;case 27:bf(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,a=e,o=t,s=o.flags;switch(o.tag){case 0:case 11:case 15:xl(a,o,n),zc(4,o);break;case 1:if(xl(a,o,n),r=o,a=r.stateNode,typeof a.componentDidMount==`function`)try{a.componentDidMount()}catch(e){Yu(r,r.return,e)}if(r=o,a=r.updateQueue,a!==null){var c=r.stateNode;try{var l=a.shared.hiddenCallbacks;if(l!==null)for(a.shared.hiddenCallbacks=null,a=0;a<l.length;a++)no(l[a],c)}catch(e){Yu(r,r.return,e)}}n&&s&64&&Vc(o),Uc(o,o.return);break;case 27:Zc(o);case 26:case 5:xl(a,o,n),n&&r===null&&s&4&&Gc(o),Uc(o,o.return);break;case 12:xl(a,o,n);break;case 31:xl(a,o,n),n&&s&4&&ul(a,o);break;case 13:xl(a,o,n),n&&s&4&&dl(a,o);break;case 22:o.memoizedState===null&&xl(a,o,n),Uc(o,o.return);break;case 30:break;default:xl(a,o,n)}t=t.sibling}}function Sl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ga(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),a&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e)));break;case 12:if(a&2048){wl(e,t,n,r),e=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Yu(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?o._visibility&2?wl(e,t,n,r):(o._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):o._visibility&2?wl(e,t,n,r):Dl(e,t),a&2048&&Sl(s,t);break;case 24:wl(e,t,n,r),a&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,a){for(a&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var o=e,s=t,c=n,l=r,u=s.flags;switch(s.tag){case 0:case 11:case 15:El(o,s,c,l,a),zc(8,s);break;case 23:break;case 22:var d=s.stateNode;s.memoizedState===null?(d._visibility|=2,El(o,s,c,l,a)):d._visibility&2?El(o,s,c,l,a):Dl(o,s),a&&u&2048&&Sl(s.alternate,s);break;case 24:El(o,s,c,l,a),a&&u&2048&&Cl(s.alternate,s);break;default:El(o,s,c,l,a)}t=t.sibling}}function Dl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:Dl(n,r),a&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),a&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Qf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=Cf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ga(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var a=r.sibling,o=r.return;if(al(r),r===n){nl=null;break a}if(a!==null){a.return=o,nl=a;break a}nl=o}}}var Il={getCacheForType:function(e){var t=ca(ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ca(ma).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,Rl=0,zl=null,Bl=null,Vl=0,Hl=0,Ul=null,Wl=!1,Gl=!1,Kl=!1,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=null,tu=null,nu=!1,ru=0,iu=0,au=1/0,ou=null,su=null,cu=0,lu=null,uu=null,du=0,fu=0,pu=null,mu=null,hu=0,gu=null;function _u(){return Rl&2&&Vl!==0?Vl&-Vl:k.T===null?lt():gd()}function vu(){if(Ql===0)if(!(Vl&536870912)||Vi){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),Ql=e}else Ql=536870912;return e=I.current,e!==null&&(e.flags|=32),Ql}function yu(e,t,n){(e===zl&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)&&(Eu(e,0),Cu(e,Vl,Ql,!1)),nt(e,n),(!(Rl&2)||e!==zl)&&(e===zl&&(!(Rl&2)&&(Xl|=n),Jl===4&&Cu(e,Vl,Ql,!1)),cd(e))}function bu(e,t,n){if(Rl&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Qe(e,t),o=r?Pu(e,t):Mu(e,t,!0),s=r;do{if(o===0){Gl&&!r&&Cu(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!Su(n)){o=Mu(e,t,!1),s=!1;continue}if(o===2){if(s=t,e.errorRecoveryDisabledLanes&s)var c=0;else c=e.pendingLanes&-536870913,c=c===0?c&536870912?536870912:0:c;if(c!==0){t=c;a:{var l=e;o=eu;var u=l.current.memoizedState.isDehydrated;if(u&&(Eu(l,c).flags|=256),c=Mu(l,c,!1),c!==2){if(Kl&&!u){l.errorRecoveryDisabledLanes|=s,Xl|=s,o=4;break a}s=tu,tu=o,s!==null&&(tu===null?tu=s:tu.push.apply(tu,s))}o=c}if(s=!1,o!==2)continue}}if(o===1){Eu(e,0),Cu(e,t,0,!0);break}a:{switch(r=e,s=o,s){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:Cu(r,t,Ql,!Wl);break a;case 2:tu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(o=ru+300-je(),10<o)){if(Cu(r,t,Ql,!Wl),Ze(r,0,!0)!==0)break a;du=t,r.timeoutHandle=$d(xu.bind(null,r,n,tu,ou,nu,t,Ql,Xl,$l,Wl,s,`Throttled`,-0,0),o);break a}xu(r,n,tu,ou,nu,t,Ql,Xl,$l,Wl,s,null,-0,0)}}break}while(1);cd(e)}function xu(e,t,n,r,a,o,s,c,l,u,d,f,p,m){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)==16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:on},Al(t,o,f);var h=(o&62914560)===o?ru-je():(o&4194048)===o?iu-je():0;if(h=ep(f,h),h!==null){du=o,e.cancelPendingCommit=h(Vu.bind(null,e,t,o,n,r,a,s,c,l,d,f,null,p,m)),Cu(e,o,s,!u);return}}Vu(e,t,o,n,r,a,s,c,l)}function Su(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var a=n[r],o=a.getSnapshot;a=a.value;try{if(!Or(o(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Cu(e,t,n,r){t&=~Zl,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var o=31-Ue(a),s=1<<o;r[o]=-1,a&=~s}n!==0&&it(e,n,t)}function wu(){return Rl&6?!0:(ld(0,!1),!1)}function Tu(){if(Bl!==null){if(Hl===0)var e=Bl.return;else e=Bl,ea=$i=null,jo(e),Ra=null,za=0,e=Bl;for(;e!==null;)Rc(e.alternate,e),e=e.return;Bl=null}}function Eu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ef(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),du=0,Tu(),zl=e,Bl=n=gi(e.current,null),Vl=t,Hl=0,Ul=null,Wl=!1,Gl=Qe(e,t),Kl=!1,$l=Ql=Zl=Xl=Yl=Jl=0,tu=eu=null,nu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var a=31-Ue(r),o=1<<a;t|=e[a],r&=~o}return ql=t,oi(),n}function Du(e,t){R=null,k.H=Is,t===ka||t===ja?(t=Ia(),Hl=3):t===Aa?(t=Ia(),Hl=4):Hl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ul=t,Bl===null&&(Jl=1,qs(e,wi(t,e.current)))}function Ou(){var e=I.current;return e===null?!0:(Vl&4194048)===Vl?co===null:(Vl&62914560)===Vl||Vl&536870912?e===co:!1}function ku(){var e=k.H;return k.H=Is,e===null?Is:e}function Au(){var e=k.A;return k.A=Il,e}function ju(){Jl=4,Wl||(Vl&4194048)!==Vl&&I.current!==null||(Gl=!0),!(Yl&134217727)&&!(Xl&134217727)||zl===null||Cu(zl,Vl,Ql,!1)}function Mu(e,t,n){var r=Rl;Rl|=2;var a=ku(),o=Au();(zl!==e||Vl!==t)&&(ou=null,Eu(e,t)),t=!1;var s=Jl;a:do try{if(Hl!==0&&Bl!==null){var c=Bl,l=Ul;switch(Hl){case 8:Tu(),s=6;break a;case 3:case 2:case 9:case 6:I.current===null&&(t=!0);var u=Hl;if(Hl=0,Ul=null,Ru(e,c,l,u),n&&Gl){s=0;break a}break;default:u=Hl,Hl=0,Ul=null,Ru(e,c,l,u)}}Nu(),s=Jl;break}catch(t){Du(e,t)}while(1);return t&&e.shellSuspendCounter++,ea=$i=null,Rl=r,k.H=a,k.A=o,Bl===null&&(zl=null,Vl=0,oi()),s}function Nu(){for(;Bl!==null;)Iu(Bl)}function Pu(e,t){var n=Rl;Rl|=2;var r=ku(),o=Au();zl!==e||Vl!==t?(ou=null,au=je()+500,Eu(e,t)):Gl=Qe(e,t);a:do try{if(Hl!==0&&Bl!==null){t=Bl;var s=Ul;b:switch(Hl){case 1:Hl=0,Ul=null,Ru(e,t,s,1);break;case 2:case 9:if(Na(s)){Hl=0,Ul=null,Lu(t);break}t=function(){Hl!==2&&Hl!==9||zl!==e||(Hl=7),cd(e)},s.then(t,t);break a;case 3:Hl=7;break a;case 4:Hl=5;break a;case 7:Na(s)?(Hl=0,Ul=null,Lu(t)):(Hl=0,Ul=null,Ru(e,t,s,7));break;case 5:var c=null;switch(Bl.tag){case 26:c=Bl.memoizedState;case 5:case 27:var l=Bl;if(c?Zf(c):l.stateNode.complete){Hl=0,Ul=null;var u=l.sibling;if(u!==null)Bl=u;else{var d=l.return;d===null?Bl=null:(Bl=d,zu(d))}break b}}Hl=0,Ul=null,Ru(e,t,s,5);break;case 6:Hl=0,Ul=null,Ru(e,t,s,6);break;case 8:Tu(),Jl=6;break a;default:throw Error(a(462))}}Fu();break}catch(t){Du(e,t)}while(1);return ea=$i=null,k.H=r,k.A=o,Rl=n,Bl===null?(zl=null,Vl=0,oi(),Jl):0}function Fu(){for(;Bl!==null&&!ke();)Iu(Bl)}function Iu(e){var t=kc(e.alternate,e,ql);e.memoizedProps=e.pendingProps,t===null?zu(e):Bl=t}function Lu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,Vl);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,Vl);break;case 5:jo(t);default:Rc(n,t),t=Bl=_i(t,ql),t=kc(n,t,ql)}e.memoizedProps=e.pendingProps,t===null?zu(e):Bl=t}function Ru(e,t,n,r){ea=$i=null,jo(t),Ra=null,za=0;var a=t.return;try{if(Qs(e,a,t,n,Vl)){Jl=1,qs(e,wi(n,e.current)),Bl=null;return}}catch(t){if(a!==null)throw Bl=a,t;Jl=1,qs(e,wi(n,e.current)),Bl=null;return}t.flags&32768?(Vi||r===1?e=!0:Gl||Vl&536870912?e=!1:(Wl=e=!0,(r===2||r===9||r===3||r===6)&&(r=I.current,r!==null&&r.tag===13&&(r.flags|=16384))),Bu(t,e)):zu(t)}function zu(e){var t=e;do{if(t.flags&32768){Bu(t,Wl);return}e=t.return;var n=Ic(t.alternate,t,ql);if(n!==null){Bl=n;return}if(t=t.sibling,t!==null){Bl=t;return}Bl=t=e}while(t!==null);Jl===0&&(Jl=5)}function Bu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,Bl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Bl=e;return}Bl=e=n}while(e!==null);Jl=6,Bl=null}function Vu(e,t,n,r,o,s,c,l,u){e.cancelPendingCommit=null;do Ku();while(cu!==0);if(Rl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(s=t.lanes|t.childLanes,s|=ai,rt(e,n,s,c,l,u),e===zl&&(Bl=zl=null,Vl=0),uu=t,lu=e,du=n,fu=s,pu=o,mu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,td(Fe,function(){return qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,o=A.p,A.p=2,c=Rl,Rl|=4;try{rl(e,t,n)}finally{Rl=c,A.p=o,k.T=r}}cu=1,Hu(),Uu(),Wu()}}function Hu(){if(cu===1){cu=0;var e=lu,t=uu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var a=Rl;Rl|=4;try{gl(t,e);var o=Kd,s=Nr(e.containerInfo),c=o.focusedElem,l=o.selectionRange;if(s!==c&&c&&c.ownerDocument&&Mr(c.ownerDocument.documentElement,c)){if(l!==null&&Pr(c)){var u=l.start,d=l.end;if(d===void 0&&(d=u),`selectionStart`in c)c.selectionStart=u,c.selectionEnd=Math.min(d,c.value.length);else{var f=c.ownerDocument||document,p=f&&f.defaultView||window;if(p.getSelection){var m=p.getSelection(),h=c.textContent.length,g=Math.min(l.start,h),_=l.end===void 0?g:Math.min(l.end,h);!m.extend&&g>_&&(s=_,_=g,g=s);var v=jr(c,g),y=jr(c,_);if(v&&y&&(m.rangeCount!==1||m.anchorNode!==v.node||m.anchorOffset!==v.offset||m.focusNode!==y.node||m.focusOffset!==y.offset)){var b=f.createRange();b.setStart(v.node,v.offset),m.removeAllRanges(),g>_?(m.addRange(b),m.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),m.addRange(b))}}}}for(f=[],m=c;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof c.focus==`function`&&c.focus(),c=0;c<f.length;c++){var x=f[c];x.element.scrollLeft=x.left,x.element.scrollTop=x.top}}mp=!!Gd,Kd=Gd=null}finally{Rl=a,A.p=r,k.T=n}}e.current=t,cu=2}}function Uu(){if(cu===2){cu=0;var e=lu,t=uu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var a=Rl;Rl|=4;try{il(e,t.alternate,t)}finally{Rl=a,A.p=r,k.T=n}}cu=3}}function Wu(){if(cu===4||cu===3){cu=0,Ae();var e=lu,t=uu,n=du,r=mu;t.subtreeFlags&10256||t.flags&10256?cu=5:(cu=0,uu=lu=null,Gu(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(su=null),ct(n),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,a=A.p,A.p=2,k.T=null;try{for(var o=e.onRecoverableError,s=0;s<r.length;s++){var c=r[s];o(c.value,{componentStack:c.stack})}}finally{k.T=t,A.p=a}}du&3&&Ku(),cd(e),a=e.pendingLanes,n&261930&&a&42?e===gu?hu++:(hu=0,gu=e):hu=0,ld(0,!1)}}function Gu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ga(t)))}function Ku(){return Hu(),Uu(),Wu(),qu()}function qu(){if(cu!==5)return!1;var e=lu,t=fu;fu=0;var n=ct(du),r=k.T,o=A.p;try{A.p=32>n?32:n,k.T=null,n=pu,pu=null;var s=lu,c=du;if(cu=0,uu=lu=null,du=0,Rl&6)throw Error(a(331));var l=Rl;if(Rl|=4,Nl(s.current),Tl(s,s.current,c,n),Rl=l,ld(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,s)}catch{}return!0}finally{A.p=o,k.T=r,Gu(e,t)}}function Ju(e,t,n){t=wi(n,t),t=Ys(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(nt(e,2),cd(e))}function Yu(e,t,n){if(e.tag===3)Ju(e,e,n);else for(;t!==null;){if(t.tag===3){Ju(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(su===null||!su.has(r))){e=wi(n,e),n=Xs(2),r=Xa(t,n,2),r!==null&&(Zs(n,r,t,e),nt(r,2),cd(r));break}}t=t.return}}function Xu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(Kl=!0,a.add(n),e=Zu.bind(null,e,t,n),t.then(e,e))}function Zu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(Vl&n)===n&&(Jl===4||Jl===3&&(Vl&62914560)===Vl&&300>je()-ru?!(Rl&2)&&Eu(e,0):Zl|=n,$l===Vl&&($l=0)),cd(e)}function Qu(e,t){t===0&&(t=et()),e=li(e,t),e!==null&&(nt(e,t),cd(e))}function $u(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qu(e,n)}function ed(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Qu(e,n)}function td(e,t){return De(e,t)}var nd=null,rd=null,id=!1,ad=!1,od=!1,sd=0;function cd(e){e!==rd&&e.next===null&&(rd===null?nd=rd=e:rd=rd.next=e),ad=!0,id||(id=!0,hd())}function ld(e,t){if(!od&&ad){od=!0;do for(var n=!1,r=nd;r!==null;){if(!t)if(e!==0){var a=r.pendingLanes;if(a===0)var o=0;else{var s=r.suspendedLanes,c=r.pingedLanes;o=(1<<31-Ue(42|e)+1)-1,o&=a&~(s&~c),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,md(r,o))}else o=Vl,o=Ze(r,r===zl?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(o&3)||Qe(r,o)||(n=!0,md(r,o));r=r.next}while(n);od=!1}}function ud(){dd()}function dd(){ad=id=!1;var e=0;sd!==0&&Qd()&&(e=sd);for(var t=je(),n=null,r=nd;r!==null;){var a=r.next,o=fd(r,t);o===0?(r.next=null,n===null?nd=a:n.next=a,a===null&&(rd=n)):(n=r,(e!==0||o&3)&&(ad=!0)),r=a}cu!==0&&cu!==5||ld(e,!1),sd!==0&&(sd=0)}function fd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var s=31-Ue(o),c=1<<s,l=a[s];l===-1?((c&n)===0||(c&r)!==0)&&(a[s]=$e(c,t)):l<=t&&(e.expiredLanes|=c),o&=~c}if(t=zl,n=Vl,n=Ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),ct(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=pd.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(r),e.callbackPriority=2,e.callbackNode=null,2}function pd(e,t){if(cu!==0&&cu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ku()&&e.callbackNode!==n)return null;var r=Vl;return r=Ze(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(bu(e,r,t),fd(e,je()),e.callbackNode!=null&&e.callbackNode===n?pd.bind(null,e):null)}function md(e,t){if(Ku())return null;bu(e,t,!0)}function hd(){nf(function(){Rl&6?De(Ne,ud):dd()})}function gd(){if(sd===0){var e=ya;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),sd=e}return sd}function _d(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:an(``+e)}function vd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function yd(e,t,n,r,a){if(t===`submit`&&n&&n.stateNode===a){var o=_d((a[pt]||null).action),s=r.submitter;s&&(t=(t=s[pt]||null)?_d(t.formAction):s.getAttribute(`formAction`),t!==null&&(o=t,s=null));var c=new Dn(`action`,`action`,null,r,a);e.push({event:c,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(sd!==0){var e=s?vd(a,s):new FormData(a);Ts(n,{pending:!0,data:e,method:a.method,action:o},null,e)}}else typeof o==`function`&&(c.preventDefault(),e=s?vd(a,s):new FormData(a),Ts(n,{pending:!0,data:e,method:a.method,action:o},o,e))},currentTarget:a}]})}}for(var bd=0;bd<ei.length;bd++){var xd=ei[bd];ti(xd.toLowerCase(),`on`+(xd[0].toUpperCase()+xd.slice(1)))}ti(Kr,`onAnimationEnd`),ti(qr,`onAnimationIteration`),ti(Jr,`onAnimationStart`),ti(`dblclick`,`onDoubleClick`),ti(`focusin`,`onFocus`),ti(`focusout`,`onBlur`),ti(Yr,`onTransitionRun`),ti(Xr,`onTransitionStart`),ti(Zr,`onTransitionCancel`),ti(Qr,`onTransitionEnd`),kt(`onMouseEnter`,[`mouseout`,`mouseover`]),kt(`onMouseLeave`,[`mouseout`,`mouseover`]),kt(`onPointerEnter`,[`pointerout`,`pointerover`]),kt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ot(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ot(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ot(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ot(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Sd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Cd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Sd));function wd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;a:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var c=r[s],l=c.instance,u=c.currentTarget;if(c=c.listener,l!==o&&a.isPropagationStopped())break a;o=c,a.currentTarget=u;try{o(a)}catch(e){ni(e)}a.currentTarget=null,o=l}else for(s=0;s<r.length;s++){if(c=r[s],l=c.instance,u=c.currentTarget,c=c.listener,l!==o&&a.isPropagationStopped())break a;o=c,a.currentTarget=u;try{o(a)}catch(e){ni(e)}a.currentTarget=null,o=l}}}}function Td(e,t){var n=t[ht];n===void 0&&(n=t[ht]=new Set);var r=e+`__bubble`;n.has(r)||(kd(t,e,2,!1),n.add(r))}function Ed(e,t,n){var r=0;t&&(r|=4),kd(n,e,r,t)}var Dd=`_reactListening`+Math.random().toString(36).slice(2);function Od(e){if(!e[Dd]){e[Dd]=!0,Et.forEach(function(t){t!==`selectionchange`&&(Cd.has(t)||Ed(t,!1,e),Ed(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dd]||(t[Dd]=!0,Ed(`selectionchange`,!1,t))}}function kd(e,t,n,r){switch(xp(t)){case 2:var a=hp;break;case 8:a=gp;break;default:a=_p}n=a.bind(null,t,n,e),a=void 0,!gn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(a=!0),r?a===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:a}):a===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:a})}function Ad(e,t,n,r,a){var o=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var c=r.tag;if(c===3||c===4){var l=r.stateNode.containerInfo;if(l===a)break;if(c===4)for(c=r.return;c!==null;){var u=c.tag;if((u===3||u===4)&&c.stateNode.containerInfo===a)return;c=c.return}for(;l!==null;){if(c=xt(l),c===null)return;if(u=c.tag,u===5||u===6||u===26||u===27){r=o=c;continue a}l=l.parentNode}}r=r.return}pn(function(){var r=o,a=cn(n),c=[];a:{var l=$r.get(e);if(l!==void 0){var u=Dn,d=e;switch(e){case`keypress`:if(Sn(n)===0)break a;case`keydown`:case`keyup`:u=Gn;break;case`focusin`:d=`focus`,u=In;break;case`focusout`:d=`blur`,u=In;break;case`beforeblur`:case`afterblur`:u=In;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:u=Pn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:u=Fn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:u=qn;break;case Kr:case qr:case Jr:u=Ln;break;case Qr:u=Jn;break;case`scroll`:case`scrollend`:u=kn;break;case`wheel`:u=Yn;break;case`copy`:case`cut`:case`paste`:u=Rn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:u=Kn;break;case`toggle`:case`beforetoggle`:u=Xn}var f=(t&4)!=0,p=!f&&(e===`scroll`||e===`scrollend`),m=f?l===null?null:l+`Capture`:l;f=[];for(var h=r,g;h!==null;){var _=h;if(g=_.stateNode,_=_.tag,_!==5&&_!==26&&_!==27||g===null||m===null||(_=mn(h,m),_!=null&&f.push(jd(h,_,g))),p)break;h=h.return}0<f.length&&(l=new u(l,d,null,n,a),c.push({event:l,listeners:f}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,u=e===`mouseout`||e===`pointerout`,l&&n!==sn&&(d=n.relatedTarget||n.fromElement)&&(xt(d)||d[mt]))break a;if((u||l)&&(l=a.window===a?a:(l=a.ownerDocument)?l.defaultView||l.parentWindow:window,u?(d=n.relatedTarget||n.toElement,u=r,d=d?xt(d):null,d!==null&&(p=s(d),f=d.tag,d!==p||f!==5&&f!==27&&f!==6)&&(d=null)):(u=null,d=r),u!==d)){if(f=Pn,_=`onMouseLeave`,m=`onMouseEnter`,h=`mouse`,(e===`pointerout`||e===`pointerover`)&&(f=Kn,_=`onPointerLeave`,m=`onPointerEnter`,h=`pointer`),p=u==null?l:Ct(u),g=d==null?l:Ct(d),l=new f(_,h+`leave`,u,n,a),l.target=p,l.relatedTarget=g,_=null,xt(a)===r&&(f=new f(m,h+`enter`,d,n,a),f.target=g,f.relatedTarget=p,_=f),p=_,u&&d)b:{for(f=Nd,m=u,h=d,g=0,_=m;_;_=f(_))g++;_=0;for(var v=h;v;v=f(v))_++;for(;0<g-_;)m=f(m),g--;for(;0<_-g;)h=f(h),_--;for(;g--;){if(m===h||h!==null&&m===h.alternate){f=m;break b}m=f(m),h=f(h)}f=null}else f=null;u!==null&&Pd(c,l,u,f,!1),d!==null&&p!==null&&Pd(c,p,d,f,!0)}}a:{if(l=r?Ct(r):window,u=l.nodeName&&l.nodeName.toLowerCase(),u===`select`||u===`input`&&l.type===`file`)var y=gr;else if(ur(l))if(_r)y=Er;else{y=wr;var b=Cr}else u=l.nodeName,!u||u.toLowerCase()!==`input`||l.type!==`checkbox`&&l.type!==`radio`?r&&tn(r.elementType)&&(y=gr):y=Tr;if(y&&=y(e,r)){dr(c,y,n,a);break a}b&&b(e,l,r),e===`focusout`&&r&&l.type===`number`&&r.memoizedProps.value!=null&&qt(l,`number`,l.value)}switch(b=r?Ct(r):window,e){case`focusin`:(ur(b)||b.contentEditable===`true`)&&(Ir=b,Lr=r,Rr=null);break;case`focusout`:Rr=Lr=Ir=null;break;case`mousedown`:zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:zr=!1,Br(c,n,a);break;case`selectionchange`:if(Fr)break;case`keydown`:case`keyup`:Br(c,n,a)}var x;if(Qn)b:{switch(e){case`compositionstart`:var S=`onCompositionStart`;break b;case`compositionend`:S=`onCompositionEnd`;break b;case`compositionupdate`:S=`onCompositionUpdate`;break b}S=void 0}else or?ir(e,n)&&(S=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(S=`onCompositionStart`);S&&(tr&&n.locale!==`ko`&&(or||S!==`onCompositionStart`?S===`onCompositionEnd`&&or&&(x=xn()):(vn=a,yn=`value`in vn?vn.value:vn.textContent,or=!0)),b=Md(r,S),0<b.length&&(S=new zn(S,e,null,n,a),c.push({event:S,listeners:b}),x?S.data=x:(x=ar(n),x!==null&&(S.data=x)))),(x=er?sr(e,n):cr(e,n))&&(S=Md(r,`onBeforeInput`),0<S.length&&(b=new zn(`onBeforeInput`,`beforeinput`,null,n,a),c.push({event:b,listeners:S}),b.data=x)),yd(c,e,r,n,a)}wd(c,t)})}function jd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Md(e,t){for(var n=t+`Capture`,r=[];e!==null;){var a=e,o=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||o===null||(a=mn(e,n),a!=null&&r.unshift(jd(e,a,o)),a=mn(e,t),a!=null&&r.push(jd(e,a,o))),e.tag===3)return r;e=e.return}return[]}function Nd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pd(e,t,n,r,a){for(var o=t._reactName,s=[];n!==null&&n!==r;){var c=n,l=c.alternate,u=c.stateNode;if(c=c.tag,l!==null&&l===r)break;c!==5&&c!==26&&c!==27||u===null||(l=u,a?(u=mn(n,o),u!=null&&s.unshift(jd(n,u,l))):a||(u=mn(n,o),u!=null&&s.push(jd(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Fd=/\r\n?/g,Id=/\u0000|\uFFFD/g;function Ld(e){return(typeof e==`string`?e:``+e).replace(Fd,`
10
- `).replace(Id,``)}function Rd(e,t){return t=Ld(t),Ld(e)===t}function zd(e,t,n,r,o,s){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,s);break;case`data`:if(t!==`object`){Ft(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof s==`function`&&(n===`formAction`?(t!==`input`&&zd(e,t,`name`,o.name,o,null),zd(e,t,`formEncType`,o.formEncType,o,null),zd(e,t,`formMethod`,o.formMethod,o,null),zd(e,t,`formTarget`,o.formTarget,o,null)):(zd(e,t,`encType`,o.encType,o,null),zd(e,t,`method`,o.method,o,null),zd(e,t,`target`,o.target,o,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=an(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Td(`beforetoggle`,e),Td(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=nn.get(n)||n,Pt(e,n,r))}}function Bd(e,t,n,r,o,s){switch(n){case`style`:en(e,r,s);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=on);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Dt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(o=n.endsWith(`Capture`),t=n.slice(2,o?n.length-7:void 0),s=e[pt]||null,s=s==null?null:s[n],typeof s==`function`&&e.removeEventListener(t,s,o),typeof r==`function`)){typeof s!=`function`&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Pt(e,n,r)}}}function Vd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Td(`error`,e),Td(`load`,e);var r=!1,o=!1,s;for(s in n)if(n.hasOwnProperty(s)){var c=n[s];if(c!=null)switch(s){case`src`:r=!0;break;case`srcSet`:o=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:zd(e,t,s,c,n,null)}}o&&zd(e,t,`srcSet`,n.srcSet,n,null),r&&zd(e,t,`src`,n.src,n,null);return;case`input`:Td(`invalid`,e);var l=s=c=o=null,u=null,d=null;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case`name`:o=f;break;case`type`:c=f;break;case`checked`:u=f;break;case`defaultChecked`:d=f;break;case`value`:s=f;break;case`defaultValue`:l=f;break;case`children`:case`dangerouslySetInnerHTML`:if(f!=null)throw Error(a(137,t));break;default:zd(e,t,r,f,n,null)}}Kt(e,s,l,u,d,c,o,!1);return;case`select`:for(o in Td(`invalid`,e),r=c=s=null,n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case`value`:s=l;break;case`defaultValue`:c=l;break;case`multiple`:r=l;default:zd(e,t,o,l,n,null)}t=s,n=c,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(c in Td(`invalid`,e),s=o=r=null,n)if(n.hasOwnProperty(c)&&(l=n[c],l!=null))switch(c){case`value`:r=l;break;case`defaultValue`:o=l;break;case`children`:s=l;break;case`dangerouslySetInnerHTML`:if(l!=null)throw Error(a(91));break;default:zd(e,t,c,l,n,null)}Xt(e,r,o,s);return;case`option`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:zd(e,t,u,r,n,null)}return;case`dialog`:Td(`beforetoggle`,e),Td(`toggle`,e),Td(`cancel`,e),Td(`close`,e);break;case`iframe`:case`object`:Td(`load`,e);break;case`video`:case`audio`:for(r=0;r<Sd.length;r++)Td(Sd[r],e);break;case`image`:Td(`error`,e),Td(`load`,e);break;case`details`:Td(`toggle`,e);break;case`embed`:case`source`:case`link`:Td(`error`,e),Td(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(d in n)if(n.hasOwnProperty(d)&&(r=n[d],r!=null))switch(d){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:zd(e,t,d,r,n,null)}return;default:if(tn(t)){for(f in n)n.hasOwnProperty(f)&&(r=n[f],r!==void 0&&Bd(e,t,f,r,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(r=n[l],r!=null&&zd(e,t,l,r,n,null))}function Hd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var o=null,s=null,c=null,l=null,u=null,d=null,f=null;for(h in n){var p=n[h];if(n.hasOwnProperty(h)&&p!=null)switch(h){case`checked`:break;case`value`:break;case`defaultValue`:u=p;default:r.hasOwnProperty(h)||zd(e,t,h,null,r,p)}}for(var m in r){var h=r[m];if(p=n[m],r.hasOwnProperty(m)&&(h!=null||p!=null))switch(m){case`type`:s=h;break;case`name`:o=h;break;case`checked`:d=h;break;case`defaultChecked`:f=h;break;case`value`:c=h;break;case`defaultValue`:l=h;break;case`children`:case`dangerouslySetInnerHTML`:if(h!=null)throw Error(a(137,t));break;default:h!==p&&zd(e,t,m,h,r,p)}}Gt(e,c,l,u,d,f,s,o);return;case`select`:for(s in h=c=l=m=null,n)if(u=n[s],n.hasOwnProperty(s)&&u!=null)switch(s){case`value`:break;case`multiple`:h=u;default:r.hasOwnProperty(s)||zd(e,t,s,null,r,u)}for(o in r)if(s=r[o],u=n[o],r.hasOwnProperty(o)&&(s!=null||u!=null))switch(o){case`value`:m=s;break;case`defaultValue`:l=s;break;case`multiple`:c=s;default:s!==u&&zd(e,t,o,s,r,u)}t=l,n=c,r=h,m==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(e,!!n,m,!1);return;case`textarea`:for(l in h=m=null,n)if(o=n[l],n.hasOwnProperty(l)&&o!=null&&!r.hasOwnProperty(l))switch(l){case`value`:break;case`children`:break;default:zd(e,t,l,null,r,o)}for(c in r)if(o=r[c],s=n[c],r.hasOwnProperty(c)&&(o!=null||s!=null))switch(c){case`value`:m=o;break;case`defaultValue`:h=o;break;case`children`:break;case`dangerouslySetInnerHTML`:if(o!=null)throw Error(a(91));break;default:o!==s&&zd(e,t,c,o,r,s)}Yt(e,m,h);return;case`option`:for(var g in n)if(m=n[g],n.hasOwnProperty(g)&&m!=null&&!r.hasOwnProperty(g))switch(g){case`selected`:e.selected=!1;break;default:zd(e,t,g,null,r,m)}for(u in r)if(m=r[u],h=n[u],r.hasOwnProperty(u)&&m!==h&&(m!=null||h!=null))switch(u){case`selected`:e.selected=m&&typeof m!=`function`&&typeof m!=`symbol`;break;default:zd(e,t,u,m,r,h)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var _ in n)m=n[_],n.hasOwnProperty(_)&&m!=null&&!r.hasOwnProperty(_)&&zd(e,t,_,null,r,m);for(d in r)if(m=r[d],h=n[d],r.hasOwnProperty(d)&&m!==h&&(m!=null||h!=null))switch(d){case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:zd(e,t,d,m,r,h)}return;default:if(tn(t)){for(var v in n)m=n[v],n.hasOwnProperty(v)&&m!==void 0&&!r.hasOwnProperty(v)&&Bd(e,t,v,void 0,r,m);for(f in r)m=r[f],h=n[f],!r.hasOwnProperty(f)||m===h||m===void 0&&h===void 0||Bd(e,t,f,m,r,h);return}}for(var y in n)m=n[y],n.hasOwnProperty(y)&&m!=null&&!r.hasOwnProperty(y)&&zd(e,t,y,null,r,m);for(p in r)m=r[p],h=n[p],!r.hasOwnProperty(p)||m===h||m==null&&h==null||zd(e,t,p,m,r,h)}function Ud(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Wd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var a=n[r],o=a.transferSize,s=a.initiatorType,c=a.duration;if(o&&c&&Ud(s)){for(s=0,c=a.responseEnd,r+=1;r<n.length;r++){var l=n[r],u=l.startTime;if(u>c)break;var d=l.transferSize,f=l.initiatorType;d&&Ud(f)&&(l=l.responseEnd,s+=d*(l<c?1:(c-u)/(l-u)))}if(--r,t+=8*(o+s)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Gd=null,Kd=null;function qd(e){return e.nodeType===9?e:e.ownerDocument}function Jd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Yd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Xd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Zd=null;function Qd(){var e=window.event;return e&&e.type===`popstate`?e===Zd?!1:(Zd=e,!0):(Zd=null,!1)}var $d=typeof setTimeout==`function`?setTimeout:void 0,ef=typeof clearTimeout==`function`?clearTimeout:void 0,tf=typeof Promise==`function`?Promise:void 0,nf=typeof queueMicrotask==`function`?queueMicrotask:tf===void 0?$d:function(e){return tf.resolve(null).then(e).catch(rf)};function rf(e){setTimeout(function(){throw e})}function af(e){return e===`head`}function of(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(a),Bp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)bf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,bf(n);for(var o=n.firstChild;o;){var s=o.nextSibling,c=o.nodeName;o[yt]||c===`SCRIPT`||c===`STYLE`||c===`LINK`&&o.rel.toLowerCase()===`stylesheet`||n.removeChild(o),o=s}}else n===`body`&&bf(e.ownerDocument.body);n=a}while(n);Bp(t)}function sf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cf(n),bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lf(e,t,n,r){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var o=a.name==null?null:``+a.name;if(a.type===`hidden`&&e.getAttribute(`name`)===o)return e}else return e;else if(!e[yt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(o=e.getAttribute(`rel`),o===`stylesheet`&&e.hasAttribute(`data-precedence`)||o!==a.rel||e.getAttribute(`href`)!==(a.href==null||a.href===``?null:a.href)||e.getAttribute(`crossorigin`)!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute(`title`)!==(a.title==null?null:a.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(o=e.getAttribute(`src`),(o!==(a.src==null?null:a.src)||e.getAttribute(`type`)!==(a.type==null?null:a.type)||e.getAttribute(`crossorigin`)!==(a.crossOrigin==null?null:a.crossOrigin))&&o&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hf(e.nextSibling),e===null)break}return null}function uf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hf(e.nextSibling),e===null))return null;return e}function df(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hf(e.nextSibling),e===null))return null;return e}function ff(e){return e.data===`$?`||e.data===`$~`}function pf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gf=null;function _f(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function yf(e,t,n){switch(t=qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function bf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bt(e)}var xf=new Map,Sf=new Set;function Cf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wf=A.d;A.d={f:Tf,r:Ef,D:kf,C:Af,L:jf,m:Mf,X:Pf,S:Nf,M:Ff};function Tf(){var e=wf.f(),t=wu();return e||t}function Ef(e){var t=St(e);t!==null&&t.tag===5&&t.type===`form`?Ds(t):wf.r(e)}var Df=typeof document>`u`?null:document;function Of(e,t,n){var r=Df;if(r&&typeof t==`string`&&t){var a=Wt(t);a=`link[rel="`+e+`"][href="`+a+`"]`,typeof n==`string`&&(a+=`[crossorigin="`+n+`"]`),Sf.has(a)||(Sf.add(a),e={rel:e,crossOrigin:n,href:t},r.querySelector(a)===null&&(t=r.createElement(`link`),Vd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function kf(e){wf.D(e),Of(`dns-prefetch`,e,null)}function Af(e,t){wf.C(e,t),Of(`preconnect`,e,t)}function jf(e,t,n){wf.L(e,t,n);var r=Df;if(r&&e&&t){var a=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(a+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(a+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):a+=`[href="`+Wt(e)+`"]`;var o=a;switch(t){case`style`:o=Lf(e);break;case`script`:o=Vf(e)}xf.has(o)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),xf.set(o,e),r.querySelector(a)!==null||t===`style`&&r.querySelector(Rf(o))||t===`script`&&r.querySelector(Hf(o))||(t=r.createElement(`link`),Vd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Mf(e,t){wf.m(e,t);var n=Df;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,a=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,o=a;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:o=Vf(e)}if(!xf.has(o)&&(e=h({rel:`modulepreload`,href:e},t),xf.set(o,e),n.querySelector(a)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Hf(o)))return}r=n.createElement(`link`),Vd(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Nf(e,t,n){wf.S(e,t,n);var r=Df;if(r&&e){var a=wt(r).hoistableStyles,o=Lf(e);t||=`default`;var s=a.get(o);if(!s){var c={loading:0,preload:null};if(s=r.querySelector(Rf(o)))c.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=xf.get(o))&&Gf(e,n);var l=s=r.createElement(`link`);Tt(l),Vd(l,`link`,e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener(`load`,function(){c.loading|=1}),l.addEventListener(`error`,function(){c.loading|=2}),c.loading|=4,Wf(s,t,r)}s={type:`stylesheet`,instance:s,count:1,state:c},a.set(o,s)}}}function Pf(e,t){wf.X(e,t);var n=Df;if(n&&e){var r=wt(n).hoistableScripts,a=Vf(e),o=r.get(a);o||(o=n.querySelector(Hf(a)),o||(e=h({src:e,async:!0},t),(t=xf.get(a))&&Kf(e,t),o=n.createElement(`script`),Tt(o),Vd(o,`link`,e),n.head.appendChild(o)),o={type:`script`,instance:o,count:1,state:null},r.set(a,o))}}function Ff(e,t){wf.M(e,t);var n=Df;if(n&&e){var r=wt(n).hoistableScripts,a=Vf(e),o=r.get(a);o||(o=n.querySelector(Hf(a)),o||(e=h({src:e,async:!0,type:`module`},t),(t=xf.get(a))&&Kf(e,t),o=n.createElement(`script`),Tt(o),Vd(o,`link`,e),n.head.appendChild(o)),o={type:`script`,instance:o,count:1,state:null},r.set(a,o))}}function If(e,t,n,r){var o=(o=me.current)?Cf(o):null;if(!o)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Lf(n.href),n=wt(o).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Lf(n.href);var s=wt(o).hoistableStyles,c=s.get(e);if(c||(o=o.ownerDocument||o,c={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},s.set(e,c),(s=o.querySelector(Rf(e)))&&!s._p&&(c.instance=s,c.state.loading=5),xf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xf.set(e,n),s||Bf(o,e,n,c.state))),t&&r===null)throw Error(a(528,``));return c}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Vf(n),n=wt(o).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Lf(e){return`href="`+Wt(e)+`"`}function Rf(e){return`link[rel="stylesheet"][`+e+`]`}function zf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Bf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Vd(t,`link`,n),Tt(t),e.head.appendChild(t))}function Vf(e){return`[src="`+Wt(e)+`"]`}function Hf(e){return`script[async]`+e}function Uf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Tt(r),r;var o=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Tt(r),Vd(r,`style`,o),Wf(r,n.precedence,e),t.instance=r;case`stylesheet`:o=Lf(n.href);var s=e.querySelector(Rf(o));if(s)return t.state.loading|=4,t.instance=s,Tt(s),s;r=zf(n),(o=xf.get(o))&&Gf(r,o),s=(e.ownerDocument||e).createElement(`link`),Tt(s);var c=s;return c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),Vd(s,`link`,r),t.state.loading|=4,Wf(s,n.precedence,e),t.instance=s;case`script`:return s=Vf(n.src),(o=e.querySelector(Hf(s)))?(t.instance=o,Tt(o),o):(r=n,(o=xf.get(s))&&(r=h({},n),Kf(r,o)),e=e.ownerDocument||e,o=e.createElement(`script`),Tt(o),Vd(o,`link`,r),e.head.appendChild(o),t.instance=o);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Wf(r,n.precedence,e));return t.instance}function Wf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),a=r.length?r[r.length-1]:null,o=a,s=0;s<r.length;s++){var c=r[s];if(c.dataset.precedence===t)o=c;else if(o!==a)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Kf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var qf=null;function Jf(e,t,n){if(qf===null){var r=new Map,a=qf=new Map;a.set(n,r)}else a=qf,r=a.get(n),r||(r=new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var o=n[a];if(!(o[yt]||o[ft]||e===`link`&&o.getAttribute(`rel`)===`stylesheet`)&&o.namespaceURI!==`http://www.w3.org/2000/svg`){var s=o.getAttribute(t)||``;s=e+s;var c=r.get(s);c?c.push(o):r.set(s,[o])}}return r}function Yf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Xf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Zf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var a=Lf(r.href),o=t.querySelector(Rf(a));if(o){t=o._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=tp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,Tt(o);return}o=t.ownerDocument||t,r=zf(r),(a=xf.get(a))&&Gf(r,a),o=o.createElement(`link`),Tt(o);var s=o;s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Vd(o,`link`,r),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=tp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $f=0;function ep(e,t){return e.stylesheets&&e.count===0&&rp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&rp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$f===0&&($f=62500*Wd());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&rp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$f?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}function tp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var np=null;function rp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,np=new Map,t.forEach(ip,e),np=null,tp.call(e))}function ip(e,t){if(!(t.state.loading&4)){var n=np.get(e);if(n)var r=n.get(null);else{n=new Map,np.set(e,n);for(var a=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),o=0;o<a.length;o++){var s=a[o];(s.nodeName===`LINK`||s.getAttribute(`media`)!==`not all`)&&(n.set(s.dataset.precedence,s),r=s)}r&&n.set(null,r)}a=t.instance,s=a.getAttribute(`data-precedence`),o=n.get(s)||r,o===r&&n.set(null,a),n.set(s,a),this.count++,r=tp.bind(this),a.addEventListener(`load`,r),a.addEventListener(`error`,r),o?o.parentNode.insertBefore(a,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var ap={$$typeof:w,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function op(e,t,n,r,a,o,s,c,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tt(0),this.hiddenUpdates=tt(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=o,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function sp(e,t,n,r,a,o,s,c,l,u,d,f){return e=new op(e,t,n,s,l,u,d,f,c),t=1,!0===o&&(t|=24),o=mi(3,null,null,t),e.current=o,o.stateNode=e,t=ha(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:r,isDehydrated:n,cache:t},qa(o),e}function cp(e){return e?(e=fi,e):fi}function lp(e,t,n,r,a,o){a=cp(a),r.context===null?r.context=a:r.pendingContext=a,r=Ya(t),r.payload={element:n},o=o===void 0?null:o,o!==null&&(r.callback=o),n=Xa(e,r,t),n!==null&&(yu(n,e,t),Za(n,e,t))}function up(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function dp(e,t){up(e,t),(e=e.alternate)&&up(e,t)}function fp(e){if(e.tag===13||e.tag===31){var t=li(e,67108864);t!==null&&yu(t,e,67108864),dp(e,67108864)}}function pp(e){if(e.tag===13||e.tag===31){var t=_u();t=st(t);var n=li(e,t);n!==null&&yu(n,e,t),dp(e,t)}}var mp=!0;function hp(e,t,n,r){var a=k.T;k.T=null;var o=A.p;try{A.p=2,_p(e,t,n,r)}finally{A.p=o,k.T=a}}function gp(e,t,n,r){var a=k.T;k.T=null;var o=A.p;try{A.p=8,_p(e,t,n,r)}finally{A.p=o,k.T=a}}function _p(e,t,n,r){if(mp){var a=vp(r);if(a===null)Ad(e,t,r,yp,n),Ap(e,r);else if(Mp(a,e,t,n,r))r.stopPropagation();else if(Ap(e,r),t&4&&-1<kp.indexOf(e)){for(;a!==null;){var o=St(a);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var s=Xe(o.pendingLanes);if(s!==0){var c=o;for(c.pendingLanes|=2,c.entangledLanes|=2;s;){var l=1<<31-Ue(s);c.entanglements[1]|=l,s&=~l}cd(o),!(Rl&6)&&(au=je()+500,ld(0,!1))}}break;case 31:case 13:c=li(o,2),c!==null&&yu(c,o,2),wu(),dp(o,2)}if(o=vp(r),o===null&&Ad(e,t,r,yp,n),o===a)break;a=o}a!==null&&r.stopPropagation()}else Ad(e,t,r,null,n)}}function vp(e){return e=cn(e),bp(e)}var yp=null;function bp(e){if(yp=null,e=xt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return yp=e,null}function xp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var Sp=!1,Cp=null,wp=null,Tp=null,Ep=new Map,Dp=new Map,Op=[],kp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Ap(e,t){switch(e){case`focusin`:case`focusout`:Cp=null;break;case`dragenter`:case`dragleave`:wp=null;break;case`mouseover`:case`mouseout`:Tp=null;break;case`pointerover`:case`pointerout`:Ep.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Dp.delete(t.pointerId)}}function jp(e,t,n,r,a,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[a]},t!==null&&(t=St(t),t!==null&&fp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Mp(e,t,n,r,a){switch(t){case`focusin`:return Cp=jp(Cp,e,t,n,r,a),!0;case`dragenter`:return wp=jp(wp,e,t,n,r,a),!0;case`mouseover`:return Tp=jp(Tp,e,t,n,r,a),!0;case`pointerover`:var o=a.pointerId;return Ep.set(o,jp(Ep.get(o)||null,e,t,n,r,a)),!0;case`gotpointercapture`:return o=a.pointerId,Dp.set(o,jp(Dp.get(o)||null,e,t,n,r,a)),!0}return!1}function Np(e){var t=xt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,ut(e.priority,function(){pp(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,ut(e.priority,function(){pp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);sn=r,n.target.dispatchEvent(r),sn=null}else return t=St(n),t!==null&&fp(t),e.blockedOn=n,!1;t.shift()}return!0}function Fp(e,t,n){Pp(e)&&n.delete(t)}function Ip(){Sp=!1,Cp!==null&&Pp(Cp)&&(Cp=null),wp!==null&&Pp(wp)&&(wp=null),Tp!==null&&Pp(Tp)&&(Tp=null),Ep.forEach(Fp),Dp.forEach(Fp)}function Lp(e,n){e.blockedOn===n&&(e.blockedOn=null,Sp||(Sp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ip)))}var Rp=null;function zp(e){Rp!==e&&(Rp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Rp===e&&(Rp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if(typeof r!=`function`){if(bp(r||n)===null)continue;break}var o=St(n);o!==null&&(e.splice(t,3),t-=3,Ts(o,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function Bp(e){function t(t){return Lp(t,e)}Cp!==null&&Lp(Cp,e),wp!==null&&Lp(wp,e),Tp!==null&&Lp(Tp,e),Ep.forEach(t),Dp.forEach(t);for(var n=0;n<Op.length;n++){var r=Op[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Op.length&&(n=Op[0],n.blockedOn===null);)Np(n),n.blockedOn===null&&Op.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var a=n[r],o=n[r+1],s=a[pt]||null;if(typeof o==`function`)s||zp(n);else if(s){var c=null;if(o&&o.hasAttribute(`formAction`)){if(a=o,s=o[pt]||null)c=s.formAction;else if(bp(a)!==null)continue}else c=s.action;typeof c==`function`?n[r+1]=c:(n.splice(r,3),r-=3),zp(n)}}}function Vp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return a=e})},focusReset:`manual`,scroll:`manual`})}function t(){a!==null&&(a(),a=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,a=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),a!==null&&(a(),a=null)}}}function Hp(e){this._internalRoot=e}Up.prototype.render=Hp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;lp(n,_u(),e,t,null,null)},Up.prototype.unmount=Hp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lp(e.current,2,null,e,null,null),wu(),t[mt]=null}};function Up(e){this._internalRoot=e}Up.prototype.unstable_scheduleHydration=function(e){if(e){var t=lt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Op.length&&t!==0&&t<Op[n].priority;n++);Op.splice(n,0,e),n===0&&Np(e)}};var Wp=n.version;if(Wp!==`19.2.7`)throw Error(a(527,Wp,`19.2.7`));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Gp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Kp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kp.isDisabled&&Kp.supportsFiber)try{Be=Kp.inject(Gp),Ve=Kp}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,s=Ws,c=Gs,l=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=sp(e,1,!1,null,null,n,r,null,s,c,l,Vp),e[mt]=t.current,Od(e),new Hp(t)}})),v=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_()})),y=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var a=null;if(r!==void 0&&(a=``+r),n.key!==void 0&&(a=``+n.key),`key`in n)for(var o in r={},n)o!==`key`&&(r[o]=n[o]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:a,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),b=s(((e,t)=>{t.exports=y()})),x=u(v(),1),S=u(m(),1),C=u(b(),1);(0,S.createContext)(null);var w=function(e){return e.SystemBoot=`system.boot`,e.SystemAddonsReady=`system.addons-ready`,e.SystemRestarting=`system.restarting`,e.SystemRestartCompleted=`system.restart-completed`,e.SystemReadyState=`system.ready-state`,e.AddonStarted=`addon.started`,e.AddonStopped=`addon.stopped`,e.AddonRestarted=`addon.restarted`,e.AddonUpdated=`addon.updated`,e.AddonInstalled=`addon.installed`,e.AddonUninstalled=`addon.uninstalled`,e.AddonCrashed=`addon.crashed`,e.AddonError=`addon.error`,e.AddonPageReady=`addon.page-ready`,e.AddonWidgetReady=`addon.widget-ready`,e.AddonLoadFailed=`addon.load-failed`,e.AddonLoadRecovered=`addon.load-recovered`,e.AddonRetryScheduled=`addon.retry-scheduled`,e.AddonRetryAttempting=`addon.retry-attempting`,e.DeviceRegistered=`device.registered`,e.DeviceUnregistered=`device.unregistered`,e.DeviceEnabled=`device.enabled`,e.DeviceDisabled=`device.disabled`,e.DeviceSettingsUpdated=`device.settings-updated`,e.DeviceBindingsChanged=`device.bindings-changed`,e.DeviceMetaChanged=`device.meta-changed`,e.DeviceSourceInfoChanged=`device.source-info-changed`,e.DeviceStreamsRegistered=`device.streams-registered`,e.DeviceProvisioned=`device.provisioned`,e.DeviceReady=`device.ready`,e.IntegrationEnabled=`integration.enabled`,e.IntegrationDisabled=`integration.disabled`,e.IntegrationDeleted=`integration.deleted`,e.BrokerStatusChanged=`broker.status-changed`,e.BrokerMessage=`broker.message`,e.ProviderStarted=`provider.started`,e.ProviderStopped=`provider.stopped`,e.ProcessCrashed=`process.crashed`,e.ProcessRestartScheduled=`process.restart_scheduled`,e.ProcessRestarted=`process.restarted`,e.RecordingStarted=`recording.started`,e.RecordingStopped=`recording.stopped`,e.RecordingError=`recording.error`,e.RecordingHealthDegraded=`recording.health.degraded`,e.RecordingStorageCritical=`recording.storage.critical`,e.RecordingSegmentWritten=`recording.segment.written`,e.RecordingPolicyFallback=`recording.policy.fallback`,e.RecordingRetentionCompleted=`recording.retention.completed`,e.RecordingExportProgress=`recording.export.progress`,e.RecordingExportCompleted=`recording.export.completed`,e.RecordingExportFailed=`recording.export.failed`,e.DetectionEvent=`detection.event`,e.SessionTrackNew=`session.track.new`,e.SessionTrackExpired=`session.track.expired`,e.BenchmarkProgress=`benchmark.progress`,e.PlatformProbePhase=`platform-probe.phase`,e.PipelineProgress=`pipeline.progress`,e.PipelineTrace=`pipeline.trace`,e.PipelineInferenceResult=`pipeline.inference-result`,e.PipelineCameraAssigned=`pipeline.camera-assigned`,e.PipelineCameraUnassigned=`pipeline.camera-unassigned`,e.PipelineCameraUpdated=`pipeline.camera-updated`,e.PipelineIngestOwnerChanged=`pipeline.ingest-owner-changed`,e.PipelineRunnerLoadSnapshot=`pipeline.runner-load-snapshot`,e.PipelineCameraMetricsSnapshot=`pipeline.camera-metrics-snapshot`,e.StreamBrokerMetricsSnapshot=`stream-broker.metrics-snapshot`,e.StreamBrokerOnCamStreamDemand=`stream-broker.onCamStreamDemand`,e.StreamBrokerOnCamStreamIdle=`stream-broker.onCamStreamIdle`,e.StreamBrokerOnRequestStreamSourceRefresh=`stream-broker.onRequestStreamSourceRefresh`,e.StreamParamsChanged=`stream-params.changed`,e.DeviceStateChanged=`device.state-changed`,e.ZoneAnalyticsOccupancyChanged=`zone-analytics.occupancy-changed`,e.BatteryOnStatusChanged=`battery.onStatusChanged`,e.BatteryOnWakeStarted=`battery.onWakeStarted`,e.DoorbellOnPressed=`doorbell.onPressed`,e.EventEmitted=`event-emitter.event`,e.PipelineEngineMetricsSnapshot=`pipeline.engine-metrics-snapshot`,e.PipelineEngineProvisioning=`pipeline.engine-provisioning`,e.ClusterTopologySnapshot=`cluster.topology-snapshot`,e.MetricsNodeResourcesSnapshot=`metrics.node-resources-snapshot`,e.MetricsNodeProcessesSnapshot=`metrics.node-processes-snapshot`,e.CapabilityBindingChanged=`capability.binding-changed`,e.ModelDownloadProgress=`model.download.progress`,e.AgentRegistered=`agent.registered`,e.AgentUnregistered=`agent.unregistered`,e.AgentOnline=`agent.online`,e.AgentOffline=`agent.offline`,e.WorkerOnline=`worker.online`,e.WorkerOffline=`worker.offline`,e.AgentTaskDispatched=`agent.task.dispatched`,e.AgentTaskAssigned=`agent.task.assigned`,e.AgentTrpcConnected=`agent.trpc.connected`,e.AgentWsConnected=`agent.ws.connected`,e.AgentWsDisconnected=`agent.ws.disconnected`,e.AgentBackupActivated=`agent.backup.activated`,e.OrchestrationSettingsUpdated=`orchestration.settings-updated`,e.PipelineAgentHwaccelChanged=`pipeline.agent-hwaccel-changed`,e.MotionAnalysis=`detection.motion-analysis`,e.MotionZonesRaw=`detection.motion-zones-raw`,e.MotionOnMotionChanged=`motion.on-motion-changed`,e.DetectionResult=`detection.result`,e.DetectionRaw=`detection.raw`,e.DetectionCameraNative=`detection.camera-native`,e.PipelineAudioInferenceResult=`pipeline.audio-inference-result`,e.DetectionPhaseTransition=`detection.phase-transition`,e.ProviderMotion=`provider.motion`,e.ProviderDetection=`provider.detection`,e.EnrichmentEmbeddingStored=`enrichment.embedding.stored`,e.EnrichmentSceneStateChanged=`enrichment.scene.state-changed`,e.EnrichmentActivitySummary=`enrichment.activity.summary`,e.PipelineAnalyticsTrackLifecycle=`pipeline-analytics.track-lifecycle`,e.PipelineAnalyticsTrackStarted=`pipeline-analytics.track-started`,e.PipelineAnalyticsTrackEnded=`pipeline-analytics.track-ended`,e.PipelineAnalyticsDetectionEvent=`pipeline-analytics.detection-event`,e.PipelineAnalyticsFrameTracked=`pipeline-analytics.frame-tracked`,e.PipelineAnalyticsStationaryChanged=`pipeline-analytics.stationary-changed`,e.PipelineAnalyticsPackageDelivered=`pipeline-analytics.package-delivered`,e.PipelineAnalyticsPackagePickedUp=`pipeline-analytics.package-picked-up`,e.PipelineAnalyticsFaceGalleryChanged=`pipeline-analytics.face-gallery-changed`,e.PipelineAnalyticsPlateGalleryChanged=`pipeline-analytics.plate-gallery-changed`,e.FrigateLiveEvent=`frigate.live-event`,e.CameraStreamsProfileSlotsChanged=`camera-streams.onProfileSlotsChanged`,e.StreamOnline=`stream.online`,e.StreamOffline=`stream.offline`,e.NetworkTunnelStarted=`network.tunnel.started`,e.NetworkTunnelStopped=`network.tunnel.stopped`,e.LocalNetworkChanged=`network.local.changed`,e.MeshNetworkChanged=`network.mesh.changed`,e.BackupCompleted=`backup.completed`,e.BackupRestored=`backup.restored`,e.NotificationDispatched=`notification.dispatched`,e.NotificationFailed=`notification.failed`,e.DeviceUpdated=`device.updated`,e.DeviceOnline=`device.online`,e.DeviceOffline=`device.offline`,e.DeviceAwake=`device.awake`,e.DeviceSleeping=`device.sleeping`,e.RetentionCleanup=`retention.cleanup`,e.AddonsBulkUpdateProgress=`addons.bulk-update-progress`,e.AddonsJobProgress=`addons.job-progress`,e.AddonsJobLog=`addons.job-log`,e.AccessoriesChildVisibilityChanged=`accessories.onChildVisibilityChanged`,e.AccessoriesChanged=`accessories.onAccessoriesChanged`,e.ModelConvertProgress=`model-convert.progress`,e}({}),T;function E(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let a=s.prototype,o=Object.keys(a);for(let e=0;e<o.length;e++){let t=o[e];t in n||(n[t]=a[t].bind(n))}}let a=n?.Parent??Object;class o extends a{}Object.defineProperty(o,"name",{value:e});function s(e){var t;let a=n?.Parent?new o:this;r(a,e),(t=a._zod).deferred??(t.deferred=[]);for(let e of a._zod.deferred)e();return a}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var D=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ee=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(T=globalThis).__zod_globalConfig??(T.__zod_globalConfig={});var te=globalThis.__zod_globalConfig;function O(e){return e&&Object.assign(te,e),te}function ne(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function re(e,t){return typeof t==`bigint`?t.toString():t}function ie(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function ae(e){return e==null}function oe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function se(e,t){let n=e/t,r=Math.round(n),a=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<a?0:n-r}var k=Symbol(`evaluating`);function A(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==k)return r===void 0&&(r=k,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ce(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function le(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ue(e){return JSON.stringify(e)}function de(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var j=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var fe=ie(()=>{if(te.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function pe(e){if(M(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(M(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function me(e){return pe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var he=new Set([`string`,`number`,`symbol`]);function ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function _e(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function N(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ve(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ye={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function be(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return _e(e,le(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ce(this,`shape`,e),e},checks:[]}))}function xe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return _e(e,le(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ce(this,`shape`,r),r},checks:[]}))}function Se(e,t){if(!pe(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _e(e,le(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ce(this,`shape`,n),n}}))}function Ce(e,t){if(!pe(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return _e(e,le(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ce(this,`shape`,n),n}}))}function we(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return _e(e,le(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ce(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Te(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return _e(t,le(t._zod.def,{get shape(){let r=t._zod.def.shape,a={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)a[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ce(this,`shape`,a),a},checks:[]}))}function Ee(e,t,n){return _e(t,le(t._zod.def,{get shape(){let r=t._zod.def.shape,a={...r};if(n)for(let t in n){if(!(t in a))throw Error(`Unrecognized key: "${t}"`);n[t]&&(a[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)a[t]=new e({type:`nonoptional`,innerType:r[t]});return ce(this,`shape`,a),a}}))}function De(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Oe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ke(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ae(e){return typeof e==`string`?e:e?.message}function je(e,t,n){let r=e.message?e.message:Ae(e.inst?._zod.def?.error?.(e))??Ae(t?.error?.(e))??Ae(n.customError?.(e))??Ae(n.localeError?.(e))??`Invalid input`,{inst:a,continue:o,input:s,...c}=e;return c.path??=[],c.message=r,t?.reportInput&&(c.input=s),c}function Me(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ne(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Pe=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,re,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Fe=E(`$ZodError`,Pe),Ie=E(`$ZodError`,Pe,{Parent:Error});function Le(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}function Re(e,t=e=>e.message){let n={_errors:[]},r=(e,a=[])=>{for(let o of e.issues)if(o.code===`invalid_union`&&o.errors.length)o.errors.map(e=>r({issues:e},[...a,...o.path]));else if(o.code===`invalid_key`)r({issues:o.issues},[...a,...o.path]);else if(o.code===`invalid_element`)r({issues:o.issues},[...a,...o.path]);else{let e=[...a,...o.path];if(e.length===0)n._errors.push(t(o));else{let r=n,a=0;for(;a<e.length;){let n=e[a];a===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(o))):r[n]=r[n]||{_errors:[]},r=r[n],a++}}}};return r(e),n}var ze=e=>(t,n,r,a)=>{let o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new D;if(s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>je(e,o,O())));throw j(t,a?.callee),t}return s.value},Be=e=>async(t,n,r,a)=>{let o=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>je(e,o,O())));throw j(t,a?.callee),t}return s.value},Ve=e=>(t,n,r)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new D;return o.issues.length?{success:!1,error:new(e??Fe)(o.issues.map(e=>je(e,a,O())))}:{success:!0,data:o.value}},He=Ve(Ie),Ue=e=>async(t,n,r)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>je(e,a,O())))}:{success:!0,data:o.value}},We=Ue(Ie),Ge=e=>(t,n,r)=>{let a=r?{...r,direction:`backward`}:{direction:`backward`};return ze(e)(t,n,a)},Ke=e=>(t,n,r)=>ze(e)(t,n,r),qe=e=>async(t,n,r)=>{let a=r?{...r,direction:`backward`}:{direction:`backward`};return Be(e)(t,n,a)},Je=e=>async(t,n,r)=>Be(e)(t,n,r),Ye=e=>(t,n,r)=>{let a=r?{...r,direction:`backward`}:{direction:`backward`};return Ve(e)(t,n,a)},Xe=e=>(t,n,r)=>Ve(e)(t,n,r),Ze=e=>async(t,n,r)=>{let a=r?{...r,direction:`backward`}:{direction:`backward`};return Ue(e)(t,n,a)},Qe=e=>async(t,n,r)=>Ue(e)(t,n,r),$e=/^[cC][0-9a-z]{6,}$/,et=/^[0-9a-z]+$/,tt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nt=/^[0-9a-vA-V]{20}$/,rt=/^[A-Za-z0-9]{27}$/,it=/^[a-zA-Z0-9_-]{21}$/,at=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ot=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,st=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ct=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function ut(){return new RegExp(lt,`u`)}var dt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,pt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,mt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ht=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gt=/^[A-Za-z0-9_-]*$/,_t=/^https?$/,vt=/^\+[1-9]\d{6,14}$/,yt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,bt=RegExp(`^${yt}$`);function xt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function St(e){return RegExp(`^${xt(e)}$`)}function Ct(e){let t=xt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${yt}T(?:${r})$`)}var wt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Tt=/^-?\d+$/,Et=/^-?\d+(?:\.\d+)?$/,Dt=/^(?:true|false)$/i,Ot=/^null$/i,kt=/^[^A-Z]*$/,At=/^[^a-z]*$/,jt=E(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Mt={number:`number`,bigint:`bigint`,object:`date`},Nt=E(`$ZodCheckLessThan`,(e,t)=>{jt.init(e,t);let n=Mt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pt=E(`$ZodCheckGreaterThan`,(e,t)=>{jt.init(e,t);let n=Mt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ft=E(`$ZodCheckMultipleOf`,(e,t)=>{jt.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):se(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),It=E(`$ZodCheckNumberFormat`,(e,t)=>{jt.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[a,o]=ye[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=a,r.maximum=o,n&&(r.pattern=Tt)}),e._zod.check=s=>{let c=s.value;if(n){if(!Number.isInteger(c)){s.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<a&&s.issues.push({origin:`number`,input:c,code:`too_small`,minimum:a,inclusive:!0,inst:e,continue:!t.abort}),c>o&&s.issues.push({origin:`number`,input:c,code:`too_big`,maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Lt=E(`$ZodCheckMaxLength`,(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ae(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let a=Me(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rt=E(`$ZodCheckMinLength`,(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ae(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let a=Me(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zt=E(`$ZodCheckLengthEquals`,(e,t)=>{var n;jt.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ae(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,a=r.length;if(a===t.length)return;let o=Me(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Bt=E(`$ZodCheckStringFormat`,(e,t)=>{var n,r;jt.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Vt=E(`$ZodCheckRegex`,(e,t)=>{Bt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ht=E(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=kt,Bt.init(e,t)}),Ut=E(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=At,Bt.init(e,t)}),Wt=E(`$ZodCheckIncludes`,(e,t)=>{jt.init(e,t);let n=ge(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Gt=E(`$ZodCheckStartsWith`,(e,t)=>{jt.init(e,t);let n=RegExp(`^${ge(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Kt=E(`$ZodCheckEndsWith`,(e,t)=>{jt.init(e,t);let n=RegExp(`.*${ge(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),qt=E(`$ZodCheckOverwrite`,(e,t)=>{jt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Jt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
11
- `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
12
- `))}},Yt={major:4,minor:4,patch:3},Xt=E(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Yt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=De(e),a;for(let o of t){if(o._zod.def.when){if(Oe(e)||!o._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new D;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(r||=De(e,t))});else{if(e.issues.length===t)continue;r||=De(e,t)}}return a?a.then(()=>e):e},n=(n,a,o)=>{if(De(n))return n.aborted=!0,n;let s=t(a,r,o);if(s instanceof Promise){if(o.async===!1)throw new D;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if(o.direction===`backward`){let t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,a,o)):n(t,a,o)}let s=e._zod.parse(a,o);if(s instanceof Promise){if(o.async===!1)throw new D;return s.then(e=>t(e,r,o))}return t(s,r,o)}}A(e,`~standard`,()=>({validate:t=>{try{let n=He(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return We(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Zt=E(`$ZodString`,(e,t)=>{Xt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Qt=E(`$ZodStringFormat`,(e,t)=>{Bt.init(e,t),Zt.init(e,t)}),$t=E(`$ZodGUID`,(e,t)=>{t.pattern??=ot,Qt.init(e,t)}),en=E(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=st(e)}else t.pattern??=st();Qt.init(e,t)}),tn=E(`$ZodEmail`,(e,t)=>{t.pattern??=ct,Qt.init(e,t)}),nn=E(`$ZodURL`,(e,t)=>{Qt.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===_t.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let a=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(`:`)?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=a.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),rn=E(`$ZodEmoji`,(e,t)=>{t.pattern??=ut(),Qt.init(e,t)}),an=E(`$ZodNanoID`,(e,t)=>{t.pattern??=it,Qt.init(e,t)}),on=E(`$ZodCUID`,(e,t)=>{t.pattern??=$e,Qt.init(e,t)}),sn=E(`$ZodCUID2`,(e,t)=>{t.pattern??=et,Qt.init(e,t)}),cn=E(`$ZodULID`,(e,t)=>{t.pattern??=tt,Qt.init(e,t)}),ln=E(`$ZodXID`,(e,t)=>{t.pattern??=nt,Qt.init(e,t)}),un=E(`$ZodKSUID`,(e,t)=>{t.pattern??=rt,Qt.init(e,t)}),dn=E(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ct(t),Qt.init(e,t)}),fn=E(`$ZodISODate`,(e,t)=>{t.pattern??=bt,Qt.init(e,t)}),pn=E(`$ZodISOTime`,(e,t)=>{t.pattern??=St(t),Qt.init(e,t)}),mn=E(`$ZodISODuration`,(e,t)=>{t.pattern??=at,Qt.init(e,t)}),hn=E(`$ZodIPv4`,(e,t)=>{t.pattern??=dt,Qt.init(e,t),e._zod.bag.format=`ipv4`}),gn=E(`$ZodIPv6`,(e,t)=>{t.pattern??=ft,Qt.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),_n=E(`$ZodCIDRv4`,(e,t)=>{t.pattern??=pt,Qt.init(e,t)}),vn=E(`$ZodCIDRv6`,(e,t)=>{t.pattern??=mt,Qt.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function yn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var bn=E(`$ZodBase64`,(e,t)=>{t.pattern??=ht,Qt.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{yn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function xn(e){if(!gt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return yn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Sn=E(`$ZodBase64URL`,(e,t)=>{t.pattern??=gt,Qt.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{xn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Cn=E(`$ZodE164`,(e,t)=>{t.pattern??=vt,Qt.init(e,t)});function wn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let a=JSON.parse(atob(r));return!(`typ`in a&&a?.typ!==`JWT`||!a.alg||t&&(!(`alg`in a)||a.alg!==t))}catch{return!1}}var Tn=E(`$ZodJWT`,(e,t)=>{Qt.init(e,t),e._zod.check=n=>{wn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),En=E(`$ZodNumber`,(e,t)=>{Xt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Et,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let a=n.value;if(typeof a==`number`&&!Number.isNaN(a)&&Number.isFinite(a))return n;let o=typeof a==`number`?Number.isNaN(a)?`NaN`:Number.isFinite(a)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:a,inst:e,...o?{received:o}:{}}),n}}),Dn=E(`$ZodNumberFormat`,(e,t)=>{It.init(e,t),En.init(e,t)}),On=E(`$ZodBoolean`,(e,t)=>{Xt.init(e,t),e._zod.pattern=Dt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let a=n.value;return typeof a==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:a,inst:e}),n}}),kn=E(`$ZodNull`,(e,t)=>{Xt.init(e,t),e._zod.pattern=Ot,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),An=E(`$ZodAny`,(e,t)=>{Xt.init(e,t),e._zod.parse=e=>e}),jn=E(`$ZodUnknown`,(e,t)=>{Xt.init(e,t),e._zod.parse=e=>e}),Mn=E(`$ZodNever`,(e,t)=>{Xt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Nn=E(`$ZodVoid`,(e,t)=>{Xt.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Pn=E(`$ZodDate`,(e,t)=>{Xt.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let a=n.value,o=a instanceof Date;return o&&!Number.isNaN(a.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:a,...o?{received:`Invalid Date`}:{},inst:e}),n}});function Fn(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}var In=E(`$ZodArray`,(e,t)=>{Xt.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),n;n.value=Array(a.length);let o=[];for(let e=0;e<a.length;e++){let s=a[e],c=t.element._zod.run({value:s,issues:[]},r);c instanceof Promise?o.push(c.then(t=>Fn(t,n,e))):Fn(c,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function Ln(e,t,n,r,a,o){let s=n in r;if(e.issues.length){if(a&&o&&!s)return;t.issues.push(...ke(n,e.issues))}if(!s&&!a){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?s&&(t.value[n]=void 0):t.value[n]=e.value}function Rn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ve(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function zn(e,t,n,r,a,o){let s=[],c=a.keySet,l=a.catchall._zod,u=l.def.type,d=l.optin===`optional`,f=l.optout===`optional`;for(let a in t){if(a===`__proto__`||c.has(a))continue;if(u===`never`){s.push(a);continue}let o=l.run({value:t[a],issues:[]},r);o instanceof Promise?e.push(o.then(e=>Ln(e,n,a,t,d,f))):Ln(o,n,a,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}var Bn=E(`$ZodObject`,(e,t)=>{if(Xt.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=ie(()=>Rn(t));A(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=M,a=t.catchall,o;e._zod.parse=(t,s)=>{o??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value={};let l=[],u=o.shape;for(let e of o.keys){let n=u[e],r=n._zod.optin===`optional`,a=n._zod.optout===`optional`,o=n._zod.run({value:c[e],issues:[]},s);o instanceof Promise?l.push(o.then(n=>Ln(n,t,e,c,r,a))):Ln(o,t,e,c,r,a)}return a?zn(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Vn=E(`$ZodObjectJIT`,(e,t)=>{Bn.init(e,t);let n=e._zod.parse,r=ie(()=>Rn(t)),a=e=>{let t=new Jt([`shape`,`payload`,`ctx`]),n=r.value,a=e=>{let t=ue(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let o=Object.create(null),s=0;for(let e of n.keys)o[e]=`key_${s++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=o[r],s=ue(r),c=e[r],l=c?._zod?.optin===`optional`,u=c?._zod?.optout===`optional`;t.write(`const ${n} = ${a(r)};`),l&&u?t.write(`
13
- if (${n}.issues.length) {
14
- if (${s} in input) {
15
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
16
- ...iss,
17
- path: iss.path ? [${s}, ...iss.path] : [${s}]
18
- })));
19
- }
20
- }
21
-
22
- if (${n}.value === undefined) {
23
- if (${s} in input) {
24
- newResult[${s}] = undefined;
25
- }
26
- } else {
27
- newResult[${s}] = ${n}.value;
28
- }
29
-
30
- `):l?t.write(`
31
- if (${n}.issues.length) {
32
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
33
- ...iss,
34
- path: iss.path ? [${s}, ...iss.path] : [${s}]
35
- })));
36
- }
37
-
38
- if (${n}.value === undefined) {
39
- if (${s} in input) {
40
- newResult[${s}] = undefined;
41
- }
42
- } else {
43
- newResult[${s}] = ${n}.value;
44
- }
45
-
46
- `):t.write(`
47
- const ${n}_present = ${s} in input;
48
- if (${n}.issues.length) {
49
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
50
- ...iss,
51
- path: iss.path ? [${s}, ...iss.path] : [${s}]
52
- })));
53
- }
54
- if (!${n}_present && !${n}.issues.length) {
55
- payload.issues.push({
56
- code: "invalid_type",
57
- expected: "nonoptional",
58
- input: undefined,
59
- path: [${s}]
60
- });
61
- }
62
-
63
- if (${n}_present) {
64
- if (${n}.value === undefined) {
65
- newResult[${s}] = undefined;
66
- } else {
67
- newResult[${s}] = ${n}.value;
68
- }
69
- }
70
-
71
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let c=t.compile();return(t,n)=>c(e,t,n)},o,s=M,c=!te.jitless,l=c&&fe.value,u=t.catchall,d;e._zod.parse=(f,p)=>{d??=r.value;let m=f.value;return s(m)?c&&l&&p?.async===!1&&p.jitless!==!0?(o||=a(t.shape),f=o(f,p),u?zn([],m,f,p,d,e):f):n(f,p):(f.issues.push({expected:`object`,code:`invalid_type`,input:m,inst:e}),f)}});function Hn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let a=e.filter(e=>!De(e));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>je(e,r,O())))}),t)}var Un=E(`$ZodUnion`,(e,t)=>{Xt.init(e,t),A(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),A(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),A(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),A(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=>oe(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,a)=>{if(n)return n(r,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Hn(t,r,e,a)):Hn(s,r,e,a)}}),Wn=E(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Un.init(e,t);let n=e._zod.parse;A(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=ie(()=>{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=(a,o)=>{let s=a.value;if(!M(s))return a.issues.push({code:`invalid_type`,expected:`object`,input:s,inst:e}),a;let c=r.value.get(s?.[t.discriminator]);return c?c._zod.run(a,o):t.unionFallback||o.direction===`backward`?n(a,o):(a.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),a)}}),Gn=E(`$ZodIntersection`,(e,t)=>{Xt.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,a=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([t,n])=>qn(e,t,n)):qn(e,a,o)}});function Kn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pe(e)&&pe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),a={...e,...t};for(let n of r){let r=Kn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};a[n]=r.data}return{valid:!0,data:a}}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 a=e[r],o=t[r],s=Kn(a,o);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qn(e,t,n){let r=new Map,a;for(let n of t.issues)if(n.code===`unrecognized_keys`){a??=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 o=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&a&&e.issues.push({...a,keys:o}),De(e))return e;let s=Kn(t.value,n.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var Jn=E(`$ZodTuple`,(e,t)=>{Xt.init(e,t);let n=t.items;e._zod.parse=(r,a)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let s=[],c=Yn(n,`optin`),l=Yn(n,`optout`);if(!t.rest){if(o.length<c)return r.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),r;o.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):u[e]=t}if(t.rest){let e=n.length-1,c=o.slice(n.length);for(let n of c){e++;let o=t.rest._zod.run({value:n,issues:[]},a);o instanceof Promise?s.push(o.then(t=>Xn(t,r,e))):Xn(o,r,e)}}return s.length?Promise.all(s).then(()=>Zn(u,r,n,o,l)):Zn(u,r,n,o,l)}});function Yn(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Xn(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}function Zn(e,t,n,r,a){for(let o=0;o<n.length;o++){let n=e[o],s=o<r.length;if(n.issues.length){if(!s&&o>=a){t.value.length=o;break}t.issues.push(...ke(o,n.issues))}t.value[o]=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 Qn=E(`$ZodRecord`,(e,t)=>{Xt.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!pe(a))return n.issues.push({expected:`record`,code:`invalid_type`,input:a,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=>je(e,r,O())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:a[l],issues:[]},r);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&n.issues.push(...ke(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...ke(l,d.issues)),n.value[u]=d.value)}let l;for(let e in a)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(a)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,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`&&Et.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]=a[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>je(e,r,O())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:a[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...ke(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...ke(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),$n=E(`$ZodEnum`,(e,t)=>{Xt.init(e,t);let n=ne(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>he.has(typeof e)).map(e=>typeof e==`string`?ge(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,a)=>{let o=t.value;return r.has(o)||t.issues.push({code:`invalid_value`,values:n,input:o,inst:e}),t}}),er=E(`$ZodLiteral`,(e,t)=>{if(Xt.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`?ge(e):e?ge(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,a)=>{let o=r.value;return n.has(o)||r.issues.push({code:`invalid_value`,values:t.values,input:o,inst:e}),r}}),tr=E(`$ZodTransform`,(e,t)=>{Xt.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ee(e.constructor.name);let a=t.transform(n.value,n);if(r.async)return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(n.value=e,n.fallback=!0,n));if(a instanceof Promise)throw new D;return n.value=a,n.fallback=!0,n}});function nr(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var rr=E(`$ZodOptional`,(e,t)=>{Xt.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,A(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),A(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${oe(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(e=>nr(e,r)):nr(a,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),ir=E(`$ZodExactOptional`,(e,t)=>{rr.init(e,t),A(e._zod,`values`,()=>t.innerType._zod.values),A(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ar=E(`$ZodNullable`,(e,t)=>{Xt.init(e,t),A(e._zod,`optin`,()=>t.innerType._zod.optin),A(e._zod,`optout`,()=>t.innerType._zod.optout),A(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${oe(e.source)}|null)$`):void 0}),A(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)}),or=E(`$ZodDefault`,(e,t)=>{Xt.init(e,t),e._zod.optin=`optional`,A(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=>sr(e,t)):sr(r,t)}});function sr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var cr=E(`$ZodPrefault`,(e,t)=>{Xt.init(e,t),e._zod.optin=`optional`,A(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))}),lr=E(`$ZodNonOptional`,(e,t)=>{Xt.init(e,t),A(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 a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(t=>ur(t,e)):ur(a,e)}});function ur(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 dr=E(`$ZodCatch`,(e,t)=>{Xt.init(e,t),e._zod.optin=`optional`,A(e._zod,`optout`,()=>t.innerType._zod.optout),A(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=>je(e,n,O()))},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=>je(e,n,O()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),fr=E(`$ZodPipe`,(e,t)=>{Xt.init(e,t),A(e._zod,`values`,()=>t.in._zod.values),A(e._zod,`optin`,()=>t.in._zod.optin),A(e._zod,`optout`,()=>t.out._zod.optout),A(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=>pr(e,t.in,n)):pr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>pr(e,t.out,n)):pr(r,t.out,n)}});function pr(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 mr=E(`$ZodReadonly`,(e,t)=>{Xt.init(e,t),A(e._zod,`propValues`,()=>t.innerType._zod.propValues),A(e._zod,`values`,()=>t.innerType._zod.values),A(e._zod,`optin`,()=>t.innerType?._zod?.optin),A(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(hr):hr(r)}});function hr(e){return e.value=Object.freeze(e.value),e}var gr=E(`$ZodLazy`,(e,t)=>{Xt.init(e,t),A(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),A(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),A(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),A(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),A(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),_r=E(`$ZodCustom`,(e,t)=>{jt.init(e,t),Xt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(t=>vr(t,n,r,e));vr(a,n,r,e)}});function vr(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(Ne(e))}}var yr,br=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 xr(){return new br}(yr=globalThis).__zod_globalRegistry??(yr.__zod_globalRegistry=xr());var Sr=globalThis.__zod_globalRegistry;function Cr(e,t){return new e({type:`string`,...N(t)})}function wr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...N(t)})}function Tr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...N(t)})}function Er(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...N(t)})}function Dr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...N(t)})}function Or(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...N(t)})}function kr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...N(t)})}function Ar(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...N(t)})}function jr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...N(t)})}function Mr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...N(t)})}function Nr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...N(t)})}function Pr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...N(t)})}function Fr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...N(t)})}function Ir(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...N(t)})}function Lr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...N(t)})}function Rr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...N(t)})}function zr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...N(t)})}function Br(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...N(t)})}function Vr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...N(t)})}function Hr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...N(t)})}function Ur(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...N(t)})}function Wr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...N(t)})}function Gr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...N(t)})}function Kr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...N(t)})}function qr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...N(t)})}function Jr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...N(t)})}function Yr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...N(t)})}function Xr(e,t){return new e({type:`number`,checks:[],...N(t)})}function Zr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...N(t)})}function Qr(e,t){return new e({type:`boolean`,...N(t)})}function $r(e,t){return new e({type:`null`,...N(t)})}function ei(e){return new e({type:`any`})}function ti(e){return new e({type:`unknown`})}function ni(e,t){return new e({type:`never`,...N(t)})}function ri(e,t){return new e({type:`void`,...N(t)})}function ii(e,t){return new e({type:`date`,...N(t)})}function ai(e,t){return new Nt({check:`less_than`,...N(t),value:e,inclusive:!1})}function oi(e,t){return new Nt({check:`less_than`,...N(t),value:e,inclusive:!0})}function si(e,t){return new Pt({check:`greater_than`,...N(t),value:e,inclusive:!1})}function ci(e,t){return new Pt({check:`greater_than`,...N(t),value:e,inclusive:!0})}function li(e,t){return new Ft({check:`multiple_of`,...N(t),value:e})}function ui(e,t){return new Lt({check:`max_length`,...N(t),maximum:e})}function di(e,t){return new Rt({check:`min_length`,...N(t),minimum:e})}function fi(e,t){return new zt({check:`length_equals`,...N(t),length:e})}function pi(e,t){return new Vt({check:`string_format`,format:`regex`,...N(t),pattern:e})}function mi(e){return new Ht({check:`string_format`,format:`lowercase`,...N(e)})}function hi(e){return new Ut({check:`string_format`,format:`uppercase`,...N(e)})}function gi(e,t){return new Wt({check:`string_format`,format:`includes`,...N(t),includes:e})}function _i(e,t){return new Gt({check:`string_format`,format:`starts_with`,...N(t),prefix:e})}function vi(e,t){return new Kt({check:`string_format`,format:`ends_with`,...N(t),suffix:e})}function yi(e){return new qt({check:`overwrite`,tx:e})}function bi(e){return yi(t=>t.normalize(e))}function xi(){return yi(e=>e.trim())}function Si(){return yi(e=>e.toLowerCase())}function Ci(){return yi(e=>e.toUpperCase())}function wi(){return yi(e=>de(e))}function Ti(e,t,n){return new e({type:`array`,element:t,...N(n)})}function Ei(e,t,n){let r=N(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Di(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...N(n)})}function Oi(e,t){let n=ki(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ne(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(Ne(r))}},e(t.value,t)),t);return n}function ki(e,t){let n=new jt({check:`custom`,...N(t)});return n._zod.check=e,n}function Ai(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??Sr,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 ji(e,t,n={path:[],schemaPath:[]}){var r;let a=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{let n=s.schema,o=t.processors[a.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(s.ref||=o,ji(o,t,r),t.seen.get(o).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io===`input`&&Pi(e)&&(delete s.schema.examples,delete s.schema.default),t.io===`input`&&`_prefault`in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Mi(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 a=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(n)return{ref:a(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${a(`__shared`)}#/${r}/${o}`}}if(t[1]===n)return{ref:`#`};let a=`#/${r}/`,o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:a+o}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=a(e);t.def={...t.schema},r&&(t.defId=r);let o=t.schema;for(let e in o)delete o[e];o.$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>
72
-
73
- 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]){o(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}if(e.metadataRegistry.get(n[0])?.id){o(n);continue}if(r.cycle){o(n);continue}if(r.count>1&&e.reused===`ref`){o(n);continue}}}function Ni(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 a=n.def??n.schema,o={...a},s=n.ref;if(n.ref=null,s){r(s);let n=e.seen.get(s),c=n.schema;if(c.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(a.allOf=a.allOf??[],a.allOf.push(c)):Object.assign(a,c),Object.assign(a,o),t._zod.parent===s)for(let e in a)e===`$ref`||e===`allOf`||e in o||delete a[e];if(c.$ref&&n.def)for(let e in a)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(a[e])===JSON.stringify(n.def[e])&&delete a[e]}let c=t._zod.parent;if(c&&c!==s){r(c);let t=e.seen.get(c);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(let e in a)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let a={};if(e.target===`draft-2020-12`?a.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?a.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?a.$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");a.$id=e.external.uri(n)}Object.assign(a,n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&a.id===o&&delete a.id;let s=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,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&(e.target===`draft-2020-12`?a.$defs=s:a.definitions=s);try{let n=JSON.parse(JSON.stringify(a));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ii(t,`input`,e.processors),output:Ii(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Pi(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 Pi(r.element,n);if(r.type===`set`)return Pi(r.valueType,n);if(r.type===`lazy`)return Pi(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 Pi(r.innerType,n);if(r.type===`intersection`)return Pi(r.left,n)||Pi(r.right,n);if(r.type===`record`||r.type===`map`)return Pi(r.keyType,n)||Pi(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Pi(r.in,n)||Pi(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Pi(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Pi(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Pi(e,n))return!0;return!!(r.rest&&Pi(r.rest,n))}return!1}var Fi=(e,t={})=>n=>{let r=Ai({...n,processors:t});return ji(e,r),Mi(r,e),Ni(r,e)},Ii=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},s=Ai({...a??{},target:o,io:t,processors:n});return ji(e,s),Mi(s,e),Ni(s,e)},Li={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ri=(e,t,n,r)=>{let a=n;a.type=`string`;let{minimum:o,maximum:s,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof o==`number`&&(a.minLength=o),typeof s==`number`&&(a.maxLength=s),c&&(a.format=Li[c]??c,a.format===``&&delete a.format,c===`time`&&delete a.format),u&&(a.contentEncoding=u),l&&l.size>0){let e=[...l];e.length===1?a.pattern=e[0].source:e.length>1&&(a.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},zi=(e,t,n,r)=>{let a=n,{minimum:o,maximum:s,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof c==`string`&&c.includes(`int`)?a.type=`integer`:a.type=`number`;let f=typeof d==`number`&&d>=(o??-1/0),p=typeof u==`number`&&u<=(s??1/0),m=t.target===`draft-04`||t.target===`openapi-3.0`;f?m?(a.minimum=d,a.exclusiveMinimum=!0):a.exclusiveMinimum=d:typeof o==`number`&&(a.minimum=o),p?m?(a.maximum=u,a.exclusiveMaximum=!0):a.exclusiveMaximum=u:typeof s==`number`&&(a.maximum=s),typeof l==`number`&&(a.multipleOf=l)},Bi=(e,t,n,r)=>{n.type=`boolean`},Vi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Hi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Ui=(e,t,n,r)=>{n.not={}},Wi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Gi=(e,t,n,r)=>{let a=e._zod.def,o=ne(a.entries);o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},Ki=(e,t,n,r)=>{let a=e._zod.def,o=[];for(let e of a.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`);o.push(Number(e))}else o.push(e);if(o.length!==0)if(o.length===1){let e=o[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),o.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),o.every(e=>e===null)&&(n.type=`null`),n.enum=o},qi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ji=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Yi=(e,t,n,r)=>{let a=n,o=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;typeof s==`number`&&(a.minItems=s),typeof c==`number`&&(a.maxItems=c),a.type=`array`,a.items=ji(o.element,t,{...r,path:[...r.path,`items`]})},Xi=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type=`object`,a.properties={};let s=o.shape;for(let e in s)a.properties[e]=ji(s[e],t,{...r,path:[...r.path,`properties`,e]});let c=new Set(Object.keys(s)),l=new Set([...c].filter(e=>{let n=o.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));l.size>0&&(a.required=Array.from(l)),o.catchall?._zod.def.type===`never`?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=ji(o.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(a.additionalProperties=!1)},Zi=(e,t,n,r)=>{let a=e._zod.def,o=a.inclusive===!1,s=a.options.map((e,n)=>ji(e,t,{...r,path:[...r.path,o?`oneOf`:`anyOf`,n]}));o?n.oneOf=s:n.anyOf=s},Qi=(e,t,n,r)=>{let a=e._zod.def,o=ji(a.left,t,{...r,path:[...r.path,`allOf`,0]}),s=ji(a.right,t,{...r,path:[...r.path,`allOf`,1]}),c=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]]},$i=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type=`array`;let s=t.target===`draft-2020-12`?`prefixItems`:`items`,c=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,l=o.items.map((e,n)=>ji(e,t,{...r,path:[...r.path,s,n]})),u=o.rest?ji(o.rest,t,{...r,path:[...r.path,c,...t.target===`openapi-3.0`?[o.items.length]:[]]}):null;t.target===`draft-2020-12`?(a.prefixItems=l,u&&(a.items=u)):t.target===`openapi-3.0`?(a.items={anyOf:l},u&&a.items.anyOf.push(u),a.minItems=l.length,u||(a.maxItems=l.length)):(a.items=l,u&&(a.additionalItems=u));let{minimum:d,maximum:f}=e._zod.bag;typeof d==`number`&&(a.minItems=d),typeof f==`number`&&(a.maxItems=f)},ea=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type=`object`;let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode===`loose`&&c&&c.size>0){let e=ji(o.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});a.patternProperties={};for(let t of c)a.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(a.propertyNames=ji(o.keyType,t,{...r,path:[...r.path,`propertyNames`]})),a.additionalProperties=ji(o.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let l=s._zod.values;if(l){let e=[...l].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(a.required=e)}},ta=(e,t,n,r)=>{let a=e._zod.def,o=ji(a.innerType,t,r),s=t.seen.get(e);t.target===`openapi-3.0`?(s.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:`null`}]},na=(e,t,n,r)=>{let a=e._zod.def;ji(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},ra=(e,t,n,r)=>{let a=e._zod.def;ji(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))},ia=(e,t,n,r)=>{let a=e._zod.def;ji(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},aa=(e,t,n,r)=>{let a=e._zod.def;ji(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let s;try{s=a.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=s},oa=(e,t,n,r)=>{let a=e._zod.def,o=a.in._zod.traits.has(`$ZodTransform`),s=t.io===`input`?o?a.out:a.in:a.out;ji(s,t,r);let c=t.seen.get(e);c.ref=s},sa=(e,t,n,r)=>{let a=e._zod.def;ji(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.readOnly=!0},ca=(e,t,n,r)=>{let a=e._zod.def;ji(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},la=(e,t,n,r)=>{let a=e._zod.innerType;ji(a,t,r);let o=t.seen.get(e);o.ref=a},ua=E(`ZodISODateTime`,(e,t)=>{dn.init(e,t),Ia.init(e,t)});function da(e){return Kr(ua,e)}var fa=E(`ZodISODate`,(e,t)=>{fn.init(e,t),Ia.init(e,t)});function pa(e){return qr(fa,e)}var ma=E(`ZodISOTime`,(e,t)=>{pn.init(e,t),Ia.init(e,t)});function ha(e){return Jr(ma,e)}var ga=E(`ZodISODuration`,(e,t)=>{mn.init(e,t),Ia.init(e,t)});function _a(e){return Yr(ga,e)}var va=E(`ZodError`,(e,t)=>{Fe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Re(e,t)},flatten:{value:t=>Le(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,re,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,re,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ya=ze(va),ba=Be(va),xa=Ve(va),Sa=Ue(va),Ca=Ge(va),wa=Ke(va),Ta=qe(va),Ea=Je(va),Da=Ye(va),Oa=Xe(va),ka=Ze(va),Aa=Qe(va),ja=new WeakMap;function Ma(e,t,n){let r=Object.getPrototypeOf(e),a=ja.get(r);if(a||(a=new Set,ja.set(r,a)),!a.has(t)){a.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 Na=E(`ZodType`,(e,t)=>(Xt.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ii(e,`input`),output:Ii(e,`output`)}}),e.toJSONSchema=Fi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>ya(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>xa(e,t,n),e.parseAsync=async(t,n)=>ba(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Sa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ca(e,t,n),e.decode=(t,n)=>wa(e,t,n),e.encodeAsync=async(t,n)=>Ta(e,t,n),e.decodeAsync=async(t,n)=>Ea(e,t,n),e.safeEncode=(t,n)=>Da(e,t,n),e.safeDecode=(t,n)=>Oa(e,t,n),e.safeEncodeAsync=async(t,n)=>ka(e,t,n),e.safeDecodeAsync=async(t,n)=>Aa(e,t,n),Ma(e,`ZodType`,{check(...e){let t=this.def;return this.clone(le(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 _e(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(is(e,t))},superRefine(e,t){return this.check(as(e,t))},overwrite(e){return this.check(yi(e))},optional(){return Lo(this)},exactOptional(){return zo(this)},nullable(){return Vo(this)},nullish(){return Lo(Vo(this))},nonoptional(e){return qo(this,e)},array(){return z(this)},or(e){return Co([this,e])},and(e){return Do(this,e)},transform(e){return Zo(this,Fo(e))},default(e){return Uo(this,e)},prefault(e){return Go(this,e)},catch(e){return Yo(this,e)},pipe(e){return Zo(this,e)},readonly(){return $o(this)},describe(e){let t=this.clone();return Sr.add(t,{description:e}),t},meta(...e){if(e.length===0)return Sr.get(this);let t=this.clone();return Sr.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 Sr.get(e)?.description},configurable:!0}),e)),Pa=E(`_ZodString`,(e,t)=>{Zt.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Ma(e,`_ZodString`,{regex(...e){return this.check(pi(...e))},includes(...e){return this.check(gi(...e))},startsWith(...e){return this.check(_i(...e))},endsWith(...e){return this.check(vi(...e))},min(...e){return this.check(di(...e))},max(...e){return this.check(ui(...e))},length(...e){return this.check(fi(...e))},nonempty(...e){return this.check(di(1,...e))},lowercase(e){return this.check(mi(e))},uppercase(e){return this.check(hi(e))},trim(){return this.check(xi())},normalize(...e){return this.check(bi(...e))},toLowerCase(){return this.check(Si())},toUpperCase(){return this.check(Ci())},slugify(){return this.check(wi())}})}),Fa=E(`ZodString`,(e,t)=>{Zt.init(e,t),Pa.init(e,t),e.email=t=>e.check(wr(La,t)),e.url=t=>e.check(Ar(Va,t)),e.jwt=t=>e.check(Gr(ro,t)),e.emoji=t=>e.check(jr(Ua,t)),e.guid=t=>e.check(Tr(za,t)),e.uuid=t=>e.check(Er(Ba,t)),e.uuidv4=t=>e.check(Dr(Ba,t)),e.uuidv6=t=>e.check(Or(Ba,t)),e.uuidv7=t=>e.check(kr(Ba,t)),e.nanoid=t=>e.check(Mr(Wa,t)),e.guid=t=>e.check(Tr(za,t)),e.cuid=t=>e.check(Nr(Ga,t)),e.cuid2=t=>e.check(Pr(Ka,t)),e.ulid=t=>e.check(Fr(qa,t)),e.base64=t=>e.check(Hr(eo,t)),e.base64url=t=>e.check(Ur(to,t)),e.xid=t=>e.check(Ir(Ja,t)),e.ksuid=t=>e.check(Lr(Ya,t)),e.ipv4=t=>e.check(Rr(Xa,t)),e.ipv6=t=>e.check(zr(Za,t)),e.cidrv4=t=>e.check(Br(Qa,t)),e.cidrv6=t=>e.check(Vr($a,t)),e.e164=t=>e.check(Wr(no,t)),e.datetime=t=>e.check(da(t)),e.date=t=>e.check(pa(t)),e.time=t=>e.check(ha(t)),e.duration=t=>e.check(_a(t))});function P(e){return Cr(Fa,e)}var Ia=E(`ZodStringFormat`,(e,t)=>{Qt.init(e,t),Pa.init(e,t)}),La=E(`ZodEmail`,(e,t)=>{tn.init(e,t),Ia.init(e,t)});function Ra(e){return wr(La,e)}var za=E(`ZodGUID`,(e,t)=>{$t.init(e,t),Ia.init(e,t)}),Ba=E(`ZodUUID`,(e,t)=>{en.init(e,t),Ia.init(e,t)}),Va=E(`ZodURL`,(e,t)=>{nn.init(e,t),Ia.init(e,t)});function Ha(e){return Ar(Va,e)}var Ua=E(`ZodEmoji`,(e,t)=>{rn.init(e,t),Ia.init(e,t)}),Wa=E(`ZodNanoID`,(e,t)=>{an.init(e,t),Ia.init(e,t)}),Ga=E(`ZodCUID`,(e,t)=>{on.init(e,t),Ia.init(e,t)}),Ka=E(`ZodCUID2`,(e,t)=>{sn.init(e,t),Ia.init(e,t)}),qa=E(`ZodULID`,(e,t)=>{cn.init(e,t),Ia.init(e,t)}),Ja=E(`ZodXID`,(e,t)=>{ln.init(e,t),Ia.init(e,t)}),Ya=E(`ZodKSUID`,(e,t)=>{un.init(e,t),Ia.init(e,t)}),Xa=E(`ZodIPv4`,(e,t)=>{hn.init(e,t),Ia.init(e,t)}),Za=E(`ZodIPv6`,(e,t)=>{gn.init(e,t),Ia.init(e,t)}),Qa=E(`ZodCIDRv4`,(e,t)=>{_n.init(e,t),Ia.init(e,t)}),$a=E(`ZodCIDRv6`,(e,t)=>{vn.init(e,t),Ia.init(e,t)}),eo=E(`ZodBase64`,(e,t)=>{bn.init(e,t),Ia.init(e,t)}),to=E(`ZodBase64URL`,(e,t)=>{Sn.init(e,t),Ia.init(e,t)}),no=E(`ZodE164`,(e,t)=>{Cn.init(e,t),Ia.init(e,t)}),ro=E(`ZodJWT`,(e,t)=>{Tn.init(e,t),Ia.init(e,t)}),io=E(`ZodNumber`,(e,t)=>{En.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),Ma(e,`ZodNumber`,{gt(e,t){return this.check(si(e,t))},gte(e,t){return this.check(ci(e,t))},min(e,t){return this.check(ci(e,t))},lt(e,t){return this.check(ai(e,t))},lte(e,t){return this.check(oi(e,t))},max(e,t){return this.check(oi(e,t))},int(e){return this.check(oo(e))},safe(e){return this.check(oo(e))},positive(e){return this.check(si(0,e))},nonnegative(e){return this.check(ci(0,e))},negative(e){return this.check(ai(0,e))},nonpositive(e){return this.check(oi(0,e))},multipleOf(e,t){return this.check(li(e,t))},step(e,t){return this.check(li(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 F(e){return Xr(io,e)}var ao=E(`ZodNumberFormat`,(e,t)=>{Dn.init(e,t),io.init(e,t)});function oo(e){return Zr(ao,e)}var so=E(`ZodBoolean`,(e,t)=>{On.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r)});function I(e){return Qr(so,e)}var co=E(`ZodNull`,(e,t)=>{kn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r)});function lo(e){return $r(co,e)}var uo=E(`ZodAny`,(e,t)=>{An.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function fo(){return ei(uo)}var po=E(`ZodUnknown`,(e,t)=>{jn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function L(){return ti(po)}var mo=E(`ZodNever`,(e,t)=>{Mn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r)});function ho(e){return ni(mo,e)}var go=E(`ZodVoid`,(e,t)=>{Nn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r)});function R(e){return ri(go,e)}var _o=E(`ZodDate`,(e,t)=>{Pn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.min=(t,n)=>e.check(ci(t,n)),e.max=(t,n)=>e.check(oi(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 vo(e){return ii(_o,e)}var yo=E(`ZodArray`,(e,t)=>{In.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.element=t.element,Ma(e,`ZodArray`,{min(e,t){return this.check(di(e,t))},nonempty(e){return this.check(di(1,e))},max(e,t){return this.check(ui(e,t))},length(e,t){return this.check(fi(e,t))},unwrap(){return this.element}})});function z(e,t){return Ti(yo,e,t)}var bo=E(`ZodObject`,(e,t)=>{Vn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xi(e,t,n,r),A(e,`shape`,()=>t.shape),Ma(e,`ZodObject`,{keyof(){return H(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:L()})},loose(){return this.clone({...this._zod.def,catchall:L()})},strict(){return this.clone({...this._zod.def,catchall:ho()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Se(this,e)},safeExtend(e){return Ce(this,e)},merge(e){return we(this,e)},pick(e){return be(this,e)},omit(e){return xe(this,e)},partial(...e){return Te(Io,this,e[0])},required(...e){return Ee(Ko,this,e[0])}})});function B(e,t){return new bo({type:`object`,shape:e??{},...N(t)})}function xo(e,t){return new bo({type:`object`,shape:e,catchall:L(),...N(t)})}var So=E(`ZodUnion`,(e,t)=>{Un.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zi(e,t,n,r),e.options=t.options});function Co(e,t){return new So({type:`union`,options:e,...N(t)})}var wo=E(`ZodDiscriminatedUnion`,(e,t)=>{So.init(e,t),Wn.init(e,t)});function To(e,t,n){return new wo({type:`union`,options:t,discriminator:e,...N(n)})}var Eo=E(`ZodIntersection`,(e,t)=>{Gn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qi(e,t,n,r)});function Do(e,t){return new Eo({type:`intersection`,left:e,right:t})}var Oo=E(`ZodTuple`,(e,t)=>{Jn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$i(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function ko(e,t,n){let r=t instanceof Xt;return new Oo({type:`tuple`,items:e,rest:r?t:null,...N(r?n:t)})}var Ao=E(`ZodRecord`,(e,t)=>{Qn.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ea(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function V(e,t,n){return!t||!t._zod?new Ao({type:`record`,keyType:P(),valueType:e,...N(t)}):new Ao({type:`record`,keyType:e,valueType:t,...N(n)})}function jo(e,t,n){let r=_e(e);return r._zod.values=void 0,new Ao({type:`record`,keyType:r,valueType:t,...N(n)})}var Mo=E(`ZodEnum`,(e,t)=>{$n.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(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 a={};for(let r of e)if(n.has(r))a[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Mo({...t,checks:[],...N(r),entries:a})},e.exclude=(e,r)=>{let a={...t.entries};for(let t of e)if(n.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new Mo({...t,checks:[],...N(r),entries:a})}});function H(e,t){return new Mo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...N(t)})}var No=E(`ZodLiteral`,(e,t)=>{er.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(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 U(e,t){return new No({type:`literal`,values:Array.isArray(e)?e:[e],...N(t)})}var Po=E(`ZodTransform`,(e,t)=>{tr.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ee(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ne(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(Ne(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 Fo(e){return new Po({type:`transform`,transform:e})}var Io=E(`ZodOptional`,(e,t)=>{rr.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ca(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lo(e){return new Io({type:`optional`,innerType:e})}var Ro=E(`ZodExactOptional`,(e,t)=>{ir.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ca(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zo(e){return new Ro({type:`optional`,innerType:e})}var Bo=E(`ZodNullable`,(e,t)=>{ar.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ta(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vo(e){return new Bo({type:`nullable`,innerType:e})}var Ho=E(`ZodDefault`,(e,t)=>{or.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ra(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Uo(e,t){return new Ho({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():me(t)}})}var Wo=E(`ZodPrefault`,(e,t)=>{cr.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ia(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Go(e,t){return new Wo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():me(t)}})}var Ko=E(`ZodNonOptional`,(e,t)=>{lr.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>na(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qo(e,t){return new Ko({type:`nonoptional`,innerType:e,...N(t)})}var Jo=E(`ZodCatch`,(e,t)=>{dr.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Yo(e,t){return new Jo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Xo=E(`ZodPipe`,(e,t)=>{fr.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oa(e,t,n,r),e.in=t.in,e.out=t.out});function Zo(e,t){return new Xo({type:`pipe`,in:e,out:t})}var Qo=E(`ZodReadonly`,(e,t)=>{mr.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $o(e){return new Qo({type:`readonly`,innerType:e})}var es=E(`ZodLazy`,(e,t)=>{gr.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>la(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function ts(e){return new es({type:`lazy`,getter:e})}var ns=E(`ZodCustom`,(e,t)=>{_r.init(e,t),Na.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r)});function rs(e,t){return Ei(ns,e??(()=>!0),t)}function is(e,t={}){return Di(ns,e,t)}function as(e,t){return Oi(e,t)}function os(e,t={}){let n=new ns({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...N(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 ss={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`},cs;cs||={};var ls=`modulepreload`,us=function(e,t){return new URL(e,t).href},ds={},fs=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),a=document.querySelector(`meta[property=csp-nonce]`),o=a?.nonce||a?.getAttribute(`nonce`);function s(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=s(t.map(t=>{if(t=us(t,n),t in ds)return;ds[t]=!0;let r=t.endsWith(`.css`),a=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let a=e[n];if(a.href===t&&(!r||a.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${a}`))return;let s=document.createElement(`link`);if(s.rel=r?`stylesheet`:ls,r||(s.as=`script`),s.crossOrigin=``,s.href=t,o&&s.setAttribute(`nonce`,o),document.head.appendChild(s),r)return new Promise((e,n)=>{s.addEventListener(`load`,e),s.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function a(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&a(e.reason);return e().catch(a)})};Object.fromEntries([{id:`overview`,label:`Overview`,icon:`layout-dashboard`,order:-10},{id:`general`,label:`General`,icon:`settings`,order:0},{id:`image`,label:`Image`,icon:`image`,order:5},{id:`light`,label:`Light`,icon:`lightbulb`,order:7},{id:`motion`,label:`Motion`,icon:`activity`,order:10},{id:`audio`,label:`Audio`,icon:`mic`,order:12},{id:`alarms`,label:`Alarms`,icon:`bell-ring`,order:13},{id:`snapshot`,label:`Snapshot`,icon:`camera`,order:15},{id:`osd`,label:`OSD`,icon:`type`,order:18},{id:`stream-broker`,label:`Stream Broker`,icon:`radio`,order:20},{id:`streaming`,label:`Streaming`,icon:`video`,order:35},{id:`ptz`,label:`PTZ`,icon:`move`,order:40},{id:`consumables`,label:`Consumables`,icon:`recycle`,order:44},{id:`pipeline`,label:`Detection Pipeline`,icon:`cpu`,order:39},{id:`detection-pipeline`,label:`Detection pipeline`,icon:`cpu`,order:39},{id:`zones`,label:`Detection`,icon:`shapes`,order:38},{id:`analytics`,label:`Analytics`,icon:`activity`,order:37},{id:`live-stats`,label:`Live Stats`,icon:`activity`,order:39},{id:`recording`,label:`Recording`,icon:`circle-dot`,order:40},{id:`engine`,label:`Inference Engine`,icon:`zap`,order:41},{id:`scheduler`,label:`Scheduler`,icon:`list-checks`,order:42},{id:`decoder`,label:`Decoder`,icon:`film`,order:43},{id:`notifications`,label:`Notifications`,icon:`bell`,order:50},{id:`network`,label:`Network`,icon:`globe`,order:60},{id:`storage`,label:`Storage`,icon:`hard-drive`,order:70},{id:`advanced`,label:`Advanced`,icon:`wrench`,order:100}].map(e=>[e.id,e]));var ps=H([`high`,`mid`,`low`]),ms=H([`pull-rtsp`,`pull-rtmp`,`pull-http`,`pull-flv`,`pull-rfc4571`,`push-annexb`,`derived`]),hs=B({width:F().int().positive(),height:F().int().positive()}),gs=B({camStreamId:P().min(1),deviceId:F().int().nonnegative(),kind:ms,url:P().optional(),codec:P().optional(),resolution:hs.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:V(P(),L()).optional()}),_s=H([`unassigned`,`idle`,`connecting`,`streaming`,`error`]),vs=B({deviceId:F().int().nonnegative(),profile:ps,brokerId:P(),sourceCamStreamId:P().nullable(),status:_s,resolution:hs.optional(),codec:P().optional(),preBufferSec:F().nonnegative().optional(),errorMessage:P().optional()}),ys=B({id:P(),label:P(),protocol:H([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:P().optional(),resolution:B({width:F(),height:F()}).readonly().optional(),fps:F().optional(),bitrate:F().optional(),codec:P().optional(),profileHint:ps.optional()});B({type:P(),url:P(),videoCodec:P().optional(),audioCodec:P().optional(),metadata:V(P(),L()).readonly().optional()});var bs=B({type:H([`video`,`audio`]),data:os(Uint8Array),pts:F(),dts:F(),keyframe:I(),codec:P()}),xs=B({data:os(Uint8Array),width:F(),height:F(),format:H([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),timestamp:F()}),Ss=B({shmId:P(),slot:F().int().nonnegative(),seq:F().int().nonnegative(),width:F().int().positive(),height:F().int().positive(),format:H([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),pts:F(),byteLength:F().int().nonnegative(),nodeId:P(),slotCount:F().int().positive()}),Cs=H([`rgb`,`bgr`,`yuv420`,`gray`]),ws=B({brokerId:P(),format:Cs,maxFps:F().positive().optional(),tag:P().optional()}),Ts=B({subscriptionId:P(),maxFps:F().nonnegative()}),Es=B({data:os(Uint8Array),sampleRate:F().int().positive(),channels:F().int().positive(),timestamp:F()}),Ds=B({brokerId:P(),tag:P().optional()}),Os=B({subscriptionId:P()}),ks=B({status:H([`idle`,`connecting`,`streaming`,`error`,`stopped`]),inputFps:F(),decodeFps:F(),encodedSubscribers:F(),decodedSubscribers:F(),uptimeMs:F(),bitrateKbps:F(),idrIntervalMs:F(),codec:P().optional(),totalBytes:F(),packetCount:F(),rtspClients:F(),pipeClients:F(),preBufferSec:F(),preBufferMs:F(),preBufferPackets:F(),decoderNodeId:P().nullable(),audio:B({codec:P(),sampleRate:F(),channels:F(),supported:I()}).nullable().optional()}),As=B({profile:ps,brokerId:P(),url:P(),mutedUrl:P(),enabled:I(),codec:P().optional(),resolution:hs.optional()}),W=function(e){return e.Camera=`camera`,e.Hub=`hub`,e.Light=`light`,e.Siren=`siren`,e.Switch=`switch`,e.Sensor=`sensor`,e.Thermostat=`thermostat`,e.Climate=`climate`,e.Button=`button`,e.EventEmitter=`event-emitter`,e.Update=`update`,e.Generic=`generic`,e.Notifier=`notifier`,e.Script=`script`,e.Automation=`automation`,e.Lock=`lock`,e.Cover=`cover`,e.Valve=`valve`,e.Humidifier=`humidifier`,e.WaterHeater=`water-heater`,e.Fan=`fan`,e.MediaPlayer=`media-player`,e.AlarmPanel=`alarm-panel`,e.Control=`control`,e.Presence=`presence`,e.Weather=`weather`,e.Vacuum=`vacuum`,e.LawnMower=`lawn-mower`,e.Container=`container`,e.Image=`image`,e.PetFeeder=`pet-feeder`,e}({}),js=function(e){return e.BatteryOperated=`battery-operated`,e.Rebootable=`rebootable`,e.Resyncable=`resyncable`,e.NativeSnapshot=`native-snapshot`,e.DoorbellButton=`doorbell-button`,e.TwoWayAudio=`two-way-audio`,e.PanTiltZoom=`pan-tilt-zoom`,e.PtzAutotrack=`ptz-autotrack`,e.MotionTrigger=`motion-trigger`,e.LightColorRgb=`light-color-rgb`,e.LightColorHsv=`light-color-hsv`,e.LightColorMired=`light-color-mired`,e.ClimateDualSetpoint=`climate-dual-setpoint`,e.ClimateHumidity=`climate-humidity`,e.ClimateFanMode=`climate-fan-mode`,e.ClimatePreset=`climate-preset`,e.ClimateSwingVertical=`climate-swing-vertical`,e.ClimateSwingHorizontal=`climate-swing-horizontal`,e.CoverPositionable=`cover-positionable`,e.CoverTilt=`cover-tilt`,e.ValvePositionable=`valve-positionable`,e.FanSpeed=`fan-speed`,e.FanPreset=`fan-preset`,e.FanDirection=`fan-direction`,e.FanOscillating=`fan-oscillating`,e.LockPinRequired=`lock-pin-required`,e.LockOpen=`lock-open`,e.MediaPlayerSeek=`media-player-seek`,e.MediaPlayerVolume=`media-player-volume`,e.MediaPlayerMute=`media-player-mute`,e.MediaPlayerShuffle=`media-player-shuffle`,e.MediaPlayerRepeat=`media-player-repeat`,e.MediaPlayerSelectSource=`media-player-select-source`,e.MediaPlayerPlayMedia=`media-player-play-media`,e.MediaPlayerNext=`media-player-next`,e.MediaPlayerPrevious=`media-player-previous`,e.MediaPlayerStop=`media-player-stop`,e.AlarmPinRequired=`alarm-pin-required`,e.PresenceGps=`presence-gps`,e.NotifierImage=`notifier-image`,e.NotifierPriority=`notifier-priority`,e.NotifierData=`notifier-data`,e.NotifierActions=`notifier-actions`,e.NotifierRecipients=`notifier-recipients`,e.ScriptVariables=`script-variables`,e.AutomationSkipCondition=`automation-skip-condition`,e.VacuumHasMap=`vacuum-has-map`,e.VacuumHasAi=`vacuum-has-ai`,e.MowerHasMap=`mower-has-map`,e.MowerHasTargetedMowing=`mower-has-targeted-mowing`,e}({}),G=function(e){return e.Siren=`siren`,e.Floodlight=`floodlight`,e.Spotlight=`spotlight`,e.PirSensor=`pir-sensor`,e.Chime=`chime`,e.Autotrack=`autotrack`,e.Nightvision=`nightvision`,e.PrivacyMask=`privacy-mask`,e.Doorbell=`doorbell`,e.BinaryHelper=`binary-helper`,e.MotionSensor=`motion-sensor`,e.ContactSensor=`contact-sensor`,e.LeakSensor=`leak-sensor`,e.SmokeSensor=`smoke-sensor`,e.COSensor=`co-sensor`,e.GasSensor=`gas-sensor`,e.TamperSensor=`tamper-sensor`,e.VibrationSensor=`vibration-sensor`,e.ConnectivitySensor=`connectivity-sensor`,e.SoundSensor=`sound-sensor`,e.BinarySensor=`binary-sensor`,e.TemperatureSensor=`temperature-sensor`,e.HumiditySensor=`humidity-sensor`,e.AmbientLightSensor=`ambient-light-sensor`,e.PressureSensor=`pressure-sensor`,e.WindSensor=`wind-sensor`,e.RainSensor=`rain-sensor`,e.UvSensor=`uv-sensor`,e.SolarRadiationSensor=`solar-radiation-sensor`,e.SoilMoistureSensor=`soil-moisture-sensor`,e.PowerSensor=`power-sensor`,e.EnergySensor=`energy-sensor`,e.VoltageSensor=`voltage-sensor`,e.CurrentSensor=`current-sensor`,e.AirQualitySensor=`air-quality-sensor`,e.BatterySensor=`battery-sensor`,e.NumericSensor=`numeric-sensor`,e.EnumSensor=`enum-sensor`,e.DateTimeSensor=`datetime-sensor`,e.GenericSensor=`generic-sensor`,e.NumericControl=`numeric-control`,e.SelectControl=`select-control`,e.TextControl=`text-control`,e.DateTimeControl=`datetime-control`,e.MobilePushNotifier=`mobile-push-notifier`,e.MessagingNotifier=`messaging-notifier`,e.EmailNotifier=`email-notifier`,e.GenericNotifier=`generic-notifier`,e}({}),Ms=B({id:P(),title:P(),description:P().optional(),style:H([`card`,`accordion`]).optional(),defaultCollapsed:I().optional(),columns:Co([U(1),U(2),U(3),U(4)]).optional(),tab:P().optional(),location:H([`settings`,`top-tab`]).optional(),order:F().optional(),fields:z(fo())});B({tabs:z(B({id:P(),label:P(),icon:P(),order:F().optional()})).optional(),sections:z(Ms)}).nullable(),B({deviceId:F()}),B({deviceId:F()}),B({deviceId:F(),patch:V(P(),L())}),B({success:U(!0)}),B({deviceId:F()}),L().nullable();function K(e,t,n){return{input:e,output:t,kind:n?.kind??`query`,auth:n?.auth??`protected`,...n?.access===void 0?{}:{access:n.access},...n?.caller===void 0?{}:{caller:n.caller},timeoutMs:n?.timeoutMs}}function Ns(e,t,n){return{...K(e,t,n),systemOnly:!0}}function Ps(e){return{data:e}}var Fs=`device.state-changed`;function Is(e){let t=new Map,n=new Map,r=null,a=(e,t)=>`${e}:${t}`,o=()=>{r||e.live?.onEvent&&(r=e.live.onEvent.subscribe({category:Fs},{onData:e=>{let r=e.data;if(!r||typeof r.deviceId!=`number`||typeof r.capName!=`string`)return;let o=a(r.deviceId,r.capName);t.set(o,r.slice);let s=n.get(o);if(s)for(let e of s)try{e(r.slice)}catch{}}}))},s=()=>{r&&(n.size>0||(r.unsubscribe(),r=null))};return{read(e,n){return t.get(a(e,n))},async refresh(r,o){let s=await e.deviceState.getCapSlice.query({deviceId:r,capName:o}),c=a(r,o);t.set(c,s??void 0);let l=n.get(c);if(l)for(let e of l)try{e(s??void 0)}catch{}},watch(e,t,r){let c=a(e,t),l=n.get(c);return l||(l=new Set,n.set(c,l)),l.add(r),o(),()=>{l.delete(r),l.size===0&&n.delete(c),s()}},async write(t,n,r){await e.deviceState.setCapSlice.mutate({deviceId:t,capName:n,slice:r})}}}function Ls(e,t,n){let r=(e,t)=>`${e}:${t}`;return{read(t,n){return e.get(t)?.get(n)},async refresh(){},watch(e,n,a){let o=r(e,n),s=t.get(o);return s||(s=new Set,t.set(o,s)),s.add(a),()=>{s.delete(a),s.size===0&&t.delete(o)}},async write(e,t,r){if(!n)throw Error(`createMirrorSource: write requires an api reference — pass it as the third argument when constructing the source`);await n.deviceState.setCapSlice.mutate({deviceId:e,capName:t,slice:r})}}}function q(e,t,n){let r=Rs(e)?e:Is(e);return{get value(){return r.read(t,n)},refresh(){return r.refresh(t,n)},subscribe(e){let a=r.watch(t,n,t=>{try{e(t)}catch{}});try{e(r.read(t,n))}catch{}return r.read(t,n)===void 0&&r.refresh(t,n).catch(()=>void 0),a},async set(e){await r.write(t,n,e)},async patch(e){let a={...r.read(t,n),...e};await r.write(t,n,a)}}}function Rs(e){return typeof e.read==`function`&&typeof e.watch==`function`}function zs(e,t,n){let r=e,a=n?.stateSource??Is(e);function o(e,n){let r=typeof e==`object`&&e?e:{};return n===void 0?{...r,deviceId:t.deviceId}:{...r,deviceId:t.deviceId,nodeId:n}}function s(e,t,n,a,o){let s=r[e]?.[t];if(!s)throw Error(`DeviceProxy: api has no '${e}.${t}'`);let c=s;return n===`mutation`?c.mutate(a):n===`subscription`?c.subscribe(a,o):c.query(a)}function c(e,n,r,a,c,l){return s(n,r,a,o(c,t.entries.find(t=>t.capName===e)?.providerNodeId),l)}function l(e,t,n,r,a){return s(e,t,n,o(r,void 0),a)}return{deviceId:t.deviceId,binding:t,state:{airQualitySensor:q(a,t.deviceId,`air-quality-sensor`),alarmPanel:q(a,t.deviceId,`alarm-panel`),ambientLightSensor:q(a,t.deviceId,`ambient-light-sensor`),audioMetrics:q(a,t.deviceId,`audio-metrics`),automationControl:q(a,t.deviceId,`automation-control`),battery:q(a,t.deviceId,`battery`),binary:q(a,t.deviceId,`binary`),brightness:q(a,t.deviceId,`brightness`),cameraStreams:q(a,t.deviceId,`camera-streams`),carbonMonoxide:q(a,t.deviceId,`carbon-monoxide`),climateControl:q(a,t.deviceId,`climate-control`),color:q(a,t.deviceId,`color`),connectivity:q(a,t.deviceId,`connectivity`),consumables:q(a,t.deviceId,`consumables`),contact:q(a,t.deviceId,`contact`),control:q(a,t.deviceId,`control`),cover:q(a,t.deviceId,`cover`),dayNight:q(a,t.deviceId,`day-night`),deviceDiscovery:q(a,t.deviceId,`device-discovery`),deviceStatus:q(a,t.deviceId,`device-status`),doorbell:q(a,t.deviceId,`doorbell`),enumSensor:q(a,t.deviceId,`enum-sensor`),eventEmitter:q(a,t.deviceId,`event-emitter`),fanControl:q(a,t.deviceId,`fan-control`),featureProbe:q(a,t.deviceId,`feature-probe`),flood:q(a,t.deviceId,`flood`),gas:q(a,t.deviceId,`gas`),humidifier:q(a,t.deviceId,`humidifier`),humiditySensor:q(a,t.deviceId,`humidity-sensor`),image:q(a,t.deviceId,`image`),imageSettings:q(a,t.deviceId,`image-settings`),lawnMowerControl:q(a,t.deviceId,`lawn-mower-control`),lockControl:q(a,t.deviceId,`lock-control`),mediaPlayer:q(a,t.deviceId,`media-player`),motion:q(a,t.deviceId,`motion`),motionTrigger:q(a,t.deviceId,`motion-trigger`),motionZones:q(a,t.deviceId,`motion-zones`),nativeObjectDetection:q(a,t.deviceId,`native-object-detection`),notifier:q(a,t.deviceId,`notifier`),numericSensor:q(a,t.deviceId,`numeric-sensor`),petFeeder:q(a,t.deviceId,`pet-feeder`),powerMeter:q(a,t.deviceId,`power-meter`),presence:q(a,t.deviceId,`presence`),pressureSensor:q(a,t.deviceId,`pressure-sensor`),privacyMask:q(a,t.deviceId,`privacy-mask`),ptzAutotrack:q(a,t.deviceId,`ptz-autotrack`),sceneMonitor:q(a,t.deviceId,`scene-monitor`),scriptRunner:q(a,t.deviceId,`script-runner`),smoke:q(a,t.deviceId,`smoke`),streamParams:q(a,t.deviceId,`stream-params`),switch:q(a,t.deviceId,`switch`),tamper:q(a,t.deviceId,`tamper`),temperatureSensor:q(a,t.deviceId,`temperature-sensor`),update:q(a,t.deviceId,`update`),vacuumControl:q(a,t.deviceId,`vacuum-control`),valve:q(a,t.deviceId,`valve`),vibration:q(a,t.deviceId,`vibration`),waterHeater:q(a,t.deviceId,`water-heater`),weather:q(a,t.deviceId,`weather`),zoneAnalytics:q(a,t.deviceId,`zone-analytics`),zoneRules:q(a,t.deviceId,`zone-rules`),zones:q(a,t.deviceId,`zones`)},accessories:{setChildHidden:e=>c(`accessories`,`accessories`,`setChildHidden`,`mutation`,e),getStatus:e=>c(`accessories`,`accessories`,`getStatus`,`query`,e)},airQualitySensor:{getStatus:e=>c(`air-quality-sensor`,`airQualitySensor`,`getStatus`,`query`,e)},alarmPanel:{arm:e=>c(`alarm-panel`,`alarmPanel`,`arm`,`mutation`,e),disarm:e=>c(`alarm-panel`,`alarmPanel`,`disarm`,`mutation`,e),trigger:e=>c(`alarm-panel`,`alarmPanel`,`trigger`,`mutation`,e),getStatus:e=>c(`alarm-panel`,`alarmPanel`,`getStatus`,`query`,e)},ambientLightSensor:{getStatus:e=>c(`ambient-light-sensor`,`ambientLightSensor`,`getStatus`,`query`,e)},audioAnalysis:{resolveDeviceSettings:e=>c(`audio-analysis`,`audioAnalysis`,`resolveDeviceSettings`,`query`,e),getDeviceSettingsContribution:e=>c(`audio-analysis`,`audioAnalysis`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`audio-analysis`,`audioAnalysis`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`audio-analysis`,`audioAnalysis`,`applyDeviceSettingsPatch`,`mutation`,e)},audioMetrics:{getCurrentSnapshot:e=>c(`audio-metrics`,`audioMetrics`,`getCurrentSnapshot`,`query`,e),getHistory:e=>c(`audio-metrics`,`audioMetrics`,`getHistory`,`query`,e)},automationControl:{enable:e=>c(`automation-control`,`automationControl`,`enable`,`mutation`,e),disable:e=>c(`automation-control`,`automationControl`,`disable`,`mutation`,e),trigger:e=>c(`automation-control`,`automationControl`,`trigger`,`mutation`,e),getStatus:e=>c(`automation-control`,`automationControl`,`getStatus`,`query`,e)},battery:{wakeForStream:e=>c(`battery`,`battery`,`wakeForStream`,`mutation`,e),getStatus:e=>c(`battery`,`battery`,`getStatus`,`query`,e)},binary:{getStatus:e=>c(`binary`,`binary`,`getStatus`,`query`,e)},brightness:{setBrightness:e=>c(`brightness`,`brightness`,`setBrightness`,`mutation`,e),getStatus:e=>c(`brightness`,`brightness`,`getStatus`,`query`,e)},button:{press:e=>c(`button`,`button`,`press`,`mutation`,e)},cameraCredentials:{getCredentials:e=>c(`camera-credentials`,`cameraCredentials`,`getCredentials`,`query`,e),getStatus:e=>c(`camera-credentials`,`cameraCredentials`,`getStatus`,`query`,e)},cameraStreams:{getCameraStreams:e=>c(`camera-streams`,`cameraStreams`,`getCameraStreams`,`query`,e),getBrokerStreams:e=>c(`camera-streams`,`cameraStreams`,`getBrokerStreams`,`query`,e),getRtspEntries:e=>c(`camera-streams`,`cameraStreams`,`getRtspEntries`,`query`,e),getProfileRtspEntries:e=>c(`camera-streams`,`cameraStreams`,`getProfileRtspEntries`,`query`,e),pickStream:e=>c(`camera-streams`,`cameraStreams`,`pickStream`,`query`,e)},carbonMonoxide:{getStatus:e=>c(`carbon-monoxide`,`carbonMonoxide`,`getStatus`,`query`,e)},climateControl:{setMode:e=>c(`climate-control`,`climateControl`,`setMode`,`mutation`,e),setFanMode:e=>c(`climate-control`,`climateControl`,`setFanMode`,`mutation`,e),setPreset:e=>c(`climate-control`,`climateControl`,`setPreset`,`mutation`,e),setTarget:e=>c(`climate-control`,`climateControl`,`setTarget`,`mutation`,e),setTargetRange:e=>c(`climate-control`,`climateControl`,`setTargetRange`,`mutation`,e),setTargetHumidity:e=>c(`climate-control`,`climateControl`,`setTargetHumidity`,`mutation`,e),setSwingVertical:e=>c(`climate-control`,`climateControl`,`setSwingVertical`,`mutation`,e),setSwingHorizontal:e=>c(`climate-control`,`climateControl`,`setSwingHorizontal`,`mutation`,e),getStatus:e=>c(`climate-control`,`climateControl`,`getStatus`,`query`,e)},color:{setColor:e=>c(`color`,`color`,`setColor`,`mutation`,e),getStatus:e=>c(`color`,`color`,`getStatus`,`query`,e)},connectivity:{getStatus:e=>c(`connectivity`,`connectivity`,`getStatus`,`query`,e)},consumables:{reset:e=>c(`consumables`,`consumables`,`reset`,`mutation`,e),getStatus:e=>c(`consumables`,`consumables`,`getStatus`,`query`,e)},contact:{getStatus:e=>c(`contact`,`contact`,`getStatus`,`query`,e)},control:{setValue:e=>c(`control`,`control`,`setValue`,`mutation`,e),getStatus:e=>c(`control`,`control`,`getStatus`,`query`,e)},cover:{open:e=>c(`cover`,`cover`,`open`,`mutation`,e),close:e=>c(`cover`,`cover`,`close`,`mutation`,e),stop:e=>c(`cover`,`cover`,`stop`,`mutation`,e),setPosition:e=>c(`cover`,`cover`,`setPosition`,`mutation`,e),setTiltPosition:e=>c(`cover`,`cover`,`setTiltPosition`,`mutation`,e),getStatus:e=>c(`cover`,`cover`,`getStatus`,`query`,e)},dayNight:{getOptions:e=>c(`day-night`,`dayNight`,`getOptions`,`query`,e),setSettings:e=>c(`day-night`,`dayNight`,`setSettings`,`mutation`,e),getStatus:e=>c(`day-night`,`dayNight`,`getStatus`,`query`,e)},detectionPipeline:{getDeviceSettingsContribution:e=>c(`detection-pipeline`,`detectionPipeline`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`detection-pipeline`,`detectionPipeline`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`detection-pipeline`,`detectionPipeline`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceDiscovery:{listDiscovered:e=>c(`device-discovery`,`deviceDiscovery`,`listDiscovered`,`query`,e),refreshDiscovery:e=>c(`device-discovery`,`deviceDiscovery`,`refreshDiscovery`,`mutation`,e),adoptDevice:e=>c(`device-discovery`,`deviceDiscovery`,`adoptDevice`,`mutation`,e),releaseDevice:e=>c(`device-discovery`,`deviceDiscovery`,`releaseDevice`,`mutation`,e),getStatus:e=>c(`device-discovery`,`deviceDiscovery`,`getStatus`,`query`,e)},deviceOps:{getStreamSources:e=>c(`device-ops`,`deviceOps`,`getStreamSources`,`query`,e),getConfigEntries:e=>c(`device-ops`,`deviceOps`,`getConfigEntries`,`query`,e),setConfig:e=>c(`device-ops`,`deviceOps`,`setConfig`,`mutation`,e),runAction:e=>c(`device-ops`,`deviceOps`,`runAction`,`mutation`,e),removeDevice:e=>c(`device-ops`,`deviceOps`,`removeDevice`,`mutation`,e),getSettingsSchema:e=>c(`device-ops`,`deviceOps`,`getSettingsSchema`,`query`,e),getRawState:e=>c(`device-ops`,`deviceOps`,`getRawState`,`query`,e)},deviceStatus:{getStatus:e=>c(`device-status`,`deviceStatus`,`getStatus`,`query`,e)},doorbell:{getStatus:e=>c(`doorbell`,`doorbell`,`getStatus`,`query`,e),getDeviceSettingsContribution:e=>c(`doorbell`,`doorbell`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`doorbell`,`doorbell`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`doorbell`,`doorbell`,`applyDeviceSettingsPatch`,`mutation`,e)},enumSensor:{getStatus:e=>c(`enum-sensor`,`enumSensor`,`getStatus`,`query`,e)},eventEmitter:{getStatus:e=>c(`event-emitter`,`eventEmitter`,`getStatus`,`query`,e)},events:{getEvents:e=>c(`events`,`events`,`getEvents`,`query`,e),getEventThumbnail:e=>c(`events`,`events`,`getEventThumbnail`,`query`,e),getEventClipUrl:e=>c(`events`,`events`,`getEventClipUrl`,`query`,e)},fanControl:{setPercentage:e=>c(`fan-control`,`fanControl`,`setPercentage`,`mutation`,e),setPreset:e=>c(`fan-control`,`fanControl`,`setPreset`,`mutation`,e),setDirection:e=>c(`fan-control`,`fanControl`,`setDirection`,`mutation`,e),setOscillating:e=>c(`fan-control`,`fanControl`,`setOscillating`,`mutation`,e),getStatus:e=>c(`fan-control`,`fanControl`,`getStatus`,`query`,e)},featureProbe:{getStatus:e=>c(`feature-probe`,`featureProbe`,`getStatus`,`query`,e)},flood:{getStatus:e=>c(`flood`,`flood`,`getStatus`,`query`,e)},gas:{getStatus:e=>c(`gas`,`gas`,`getStatus`,`query`,e)},humidifier:{setOn:e=>c(`humidifier`,`humidifier`,`setOn`,`mutation`,e),setTargetHumidity:e=>c(`humidifier`,`humidifier`,`setTargetHumidity`,`mutation`,e),setMode:e=>c(`humidifier`,`humidifier`,`setMode`,`mutation`,e),getStatus:e=>c(`humidifier`,`humidifier`,`getStatus`,`query`,e)},humiditySensor:{getStatus:e=>c(`humidity-sensor`,`humiditySensor`,`getStatus`,`query`,e)},image:{getStatus:e=>c(`image`,`image`,`getStatus`,`query`,e)},imageSettings:{getOptions:e=>c(`image-settings`,`imageSettings`,`getOptions`,`query`,e),setSettings:e=>c(`image-settings`,`imageSettings`,`setSettings`,`mutation`,e),getStatus:e=>c(`image-settings`,`imageSettings`,`getStatus`,`query`,e)},intercom:{startSession:e=>c(`intercom`,`intercom`,`startSession`,`mutation`,e),handleAnswer:e=>c(`intercom`,`intercom`,`handleAnswer`,`mutation`,e),stopSession:e=>c(`intercom`,`intercom`,`stopSession`,`mutation`,e),startTalkSession:e=>c(`intercom`,`intercom`,`startTalkSession`,`mutation`,e),pushTalkAudio:e=>c(`intercom`,`intercom`,`pushTalkAudio`,`mutation`,e),endTalkSession:e=>c(`intercom`,`intercom`,`endTalkSession`,`mutation`,e),getStatus:e=>c(`intercom`,`intercom`,`getStatus`,`query`,e)},lawnMowerControl:{startMowing:e=>c(`lawn-mower-control`,`lawnMowerControl`,`startMowing`,`mutation`,e),pause:e=>c(`lawn-mower-control`,`lawnMowerControl`,`pause`,`mutation`,e),dock:e=>c(`lawn-mower-control`,`lawnMowerControl`,`dock`,`mutation`,e),getStatus:e=>c(`lawn-mower-control`,`lawnMowerControl`,`getStatus`,`query`,e)},lockControl:{lock:e=>c(`lock-control`,`lockControl`,`lock`,`mutation`,e),unlock:e=>c(`lock-control`,`lockControl`,`unlock`,`mutation`,e),open:e=>c(`lock-control`,`lockControl`,`open`,`mutation`,e),getStatus:e=>c(`lock-control`,`lockControl`,`getStatus`,`query`,e)},mediaPlayer:{play:e=>c(`media-player`,`mediaPlayer`,`play`,`mutation`,e),pause:e=>c(`media-player`,`mediaPlayer`,`pause`,`mutation`,e),stop:e=>c(`media-player`,`mediaPlayer`,`stop`,`mutation`,e),next:e=>c(`media-player`,`mediaPlayer`,`next`,`mutation`,e),previous:e=>c(`media-player`,`mediaPlayer`,`previous`,`mutation`,e),seek:e=>c(`media-player`,`mediaPlayer`,`seek`,`mutation`,e),setVolume:e=>c(`media-player`,`mediaPlayer`,`setVolume`,`mutation`,e),setMute:e=>c(`media-player`,`mediaPlayer`,`setMute`,`mutation`,e),setShuffle:e=>c(`media-player`,`mediaPlayer`,`setShuffle`,`mutation`,e),setRepeat:e=>c(`media-player`,`mediaPlayer`,`setRepeat`,`mutation`,e),selectSource:e=>c(`media-player`,`mediaPlayer`,`selectSource`,`mutation`,e),playMedia:e=>c(`media-player`,`mediaPlayer`,`playMedia`,`mutation`,e),getStatus:e=>c(`media-player`,`mediaPlayer`,`getStatus`,`query`,e)},motion:{isDetected:e=>c(`motion`,`motion`,`isDetected`,`query`,e),getStatus:e=>c(`motion`,`motion`,`getStatus`,`query`,e)},motionDetection:{analyze:e=>c(`motion-detection`,`motionDetection`,`analyze`,`mutation`,e),removeCamera:e=>c(`motion-detection`,`motionDetection`,`removeCamera`,`mutation`,e),reset:e=>c(`motion-detection`,`motionDetection`,`reset`,`mutation`,e),getDeviceSettingsContribution:e=>c(`motion-detection`,`motionDetection`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`motion-detection`,`motionDetection`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`motion-detection`,`motionDetection`,`applyDeviceSettingsPatch`,`mutation`,e)},motionTrigger:{setMotionTrigger:e=>c(`motion-trigger`,`motionTrigger`,`setMotionTrigger`,`mutation`,e),getStatus:e=>c(`motion-trigger`,`motionTrigger`,`getStatus`,`query`,e)},motionZones:{getOptions:e=>c(`motion-zones`,`motionZones`,`getOptions`,`query`,e),setZone:e=>c(`motion-zones`,`motionZones`,`setZone`,`mutation`,e),getStatus:e=>c(`motion-zones`,`motionZones`,`getStatus`,`query`,e)},nativeObjectDetection:{setEnabled:e=>c(`native-object-detection`,`nativeObjectDetection`,`setEnabled`,`mutation`,e),getStatus:e=>c(`native-object-detection`,`nativeObjectDetection`,`getStatus`,`query`,e)},notifier:{send:e=>c(`notifier`,`notifier`,`send`,`mutation`,e),cancel:e=>c(`notifier`,`notifier`,`cancel`,`mutation`,e),getStatus:e=>c(`notifier`,`notifier`,`getStatus`,`query`,e)},numericSensor:{getStatus:e=>c(`numeric-sensor`,`numericSensor`,`getStatus`,`query`,e)},osd:{setOverlay:e=>c(`osd`,`osd`,`setOverlay`,`mutation`,e),getStatus:e=>c(`osd`,`osd`,`getStatus`,`query`,e)},petFeeder:{feed:e=>c(`pet-feeder`,`petFeeder`,`feed`,`mutation`,e),cancelFeed:e=>c(`pet-feeder`,`petFeeder`,`cancelFeed`,`mutation`,e),resetDesiccant:e=>c(`pet-feeder`,`petFeeder`,`resetDesiccant`,`mutation`,e),markFoodReplenished:e=>c(`pet-feeder`,`petFeeder`,`markFoodReplenished`,`mutation`,e),callPet:e=>c(`pet-feeder`,`petFeeder`,`callPet`,`mutation`,e),playSound:e=>c(`pet-feeder`,`petFeeder`,`playSound`,`mutation`,e),setChildLock:e=>c(`pet-feeder`,`petFeeder`,`setChildLock`,`mutation`,e),setIndicatorLight:e=>c(`pet-feeder`,`petFeeder`,`setIndicatorLight`,`mutation`,e),setFeedSound:e=>c(`pet-feeder`,`petFeeder`,`setFeedSound`,`mutation`,e),setVolume:e=>c(`pet-feeder`,`petFeeder`,`setVolume`,`mutation`,e),getStatus:e=>c(`pet-feeder`,`petFeeder`,`getStatus`,`query`,e)},pipelineAnalytics:{getActiveTracks:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getActiveTracks`,`query`,e),getTrack:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getTrack`,`query`,e),listTracks:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`listTracks`,`query`,e),listRecentTracks:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`listRecentTracks`,`query`,e),clearTracks:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`clearTracks`,`mutation`,e),getMotionEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getMotionEvents`,`query`,e),getObjectEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getObjectEvents`,`query`,e),getAudioEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getAudioEvents`,`query`,e),listEventKinds:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`listEventKinds`,`query`,e),getSensorEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getSensorEvents`,`query`,e),getKeyEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getKeyEvents`,`query`,e),getEventDensity:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getEventDensity`,`query`,e),pruneEventsBefore:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`pruneEventsBefore`,`mutation`,e),pruneTracksBefore:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`pruneTracksBefore`,`mutation`,e),wipeAllAnalytics:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`wipeAllAnalytics`,`mutation`,e),deleteTracks:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`deleteTracks`,`mutation`,e),getEventStoreFootprint:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getEventStoreFootprint`,`query`,e),pruneEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`pruneEvents`,`mutation`,e),deleteDeviceEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`deleteDeviceEvents`,`mutation`,e),relocateMedia:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`relocateMedia`,`mutation`,e),getMediaRelocateStatus:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getMediaRelocateStatus`,`query`,e),cancelMediaRelocate:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`cancelMediaRelocate`,`mutation`,e),listOpsLog:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`listOpsLog`,`query`,e),getEventMedia:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getEventMedia`,`query`,e),getTrackMedia:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getTrackMedia`,`query`,e),searchObjectEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`searchObjectEvents`,`query`,e),getDeviceSettingsContribution:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`applyDeviceSettingsPatch`,`mutation`,e)},powerMeter:{getStatus:e=>c(`power-meter`,`powerMeter`,`getStatus`,`query`,e)},presence:{getStatus:e=>c(`presence`,`presence`,`getStatus`,`query`,e)},pressureSensor:{getStatus:e=>c(`pressure-sensor`,`pressureSensor`,`getStatus`,`query`,e)},privacyMask:{getOptions:e=>c(`privacy-mask`,`privacyMask`,`getOptions`,`query`,e),setMask:e=>c(`privacy-mask`,`privacyMask`,`setMask`,`mutation`,e),getStatus:e=>c(`privacy-mask`,`privacyMask`,`getStatus`,`query`,e)},ptz:{move:e=>c(`ptz`,`ptz`,`move`,`mutation`,e),continuousMove:e=>c(`ptz`,`ptz`,`continuousMove`,`mutation`,e),stop:e=>c(`ptz`,`ptz`,`stop`,`mutation`,e),getPresets:e=>c(`ptz`,`ptz`,`getPresets`,`query`,e),goToPreset:e=>c(`ptz`,`ptz`,`goToPreset`,`mutation`,e),savePreset:e=>c(`ptz`,`ptz`,`savePreset`,`mutation`,e),deletePreset:e=>c(`ptz`,`ptz`,`deletePreset`,`mutation`,e),getOptions:e=>c(`ptz`,`ptz`,`getOptions`,`query`,e),goHome:e=>c(`ptz`,`ptz`,`goHome`,`mutation`,e),getPosition:e=>c(`ptz`,`ptz`,`getPosition`,`query`,e),setAutofocus:e=>c(`ptz`,`ptz`,`setAutofocus`,`mutation`,e),getStatus:e=>c(`ptz`,`ptz`,`getStatus`,`query`,e)},ptzAutotrack:{getStatus:e=>c(`ptz-autotrack`,`ptzAutotrack`,`getStatus`,`query`,e),setEnabled:e=>c(`ptz-autotrack`,`ptzAutotrack`,`setEnabled`,`mutation`,e),getSettings:e=>c(`ptz-autotrack`,`ptzAutotrack`,`getSettings`,`query`,e),setSettings:e=>c(`ptz-autotrack`,`ptzAutotrack`,`setSettings`,`mutation`,e)},reboot:{reboot:e=>c(`reboot`,`reboot`,`reboot`,`mutation`,e)},sceneMonitor:{listScenes:e=>c(`scene-monitor`,`sceneMonitor`,`listScenes`,`query`,e),createScene:e=>c(`scene-monitor`,`sceneMonitor`,`createScene`,`mutation`,e),updateScene:e=>c(`scene-monitor`,`sceneMonitor`,`updateScene`,`mutation`,e),deleteScene:e=>c(`scene-monitor`,`sceneMonitor`,`deleteScene`,`mutation`,e),captureReference:e=>c(`scene-monitor`,`sceneMonitor`,`captureReference`,`mutation`,e),deleteReference:e=>c(`scene-monitor`,`sceneMonitor`,`deleteReference`,`mutation`,e),recheckNow:e=>c(`scene-monitor`,`sceneMonitor`,`recheckNow`,`mutation`,e),getStatus:e=>c(`scene-monitor`,`sceneMonitor`,`getStatus`,`query`,e)},scriptRunner:{run:e=>c(`script-runner`,`scriptRunner`,`run`,`mutation`,e),stop:e=>c(`script-runner`,`scriptRunner`,`stop`,`mutation`,e),getStatus:e=>c(`script-runner`,`scriptRunner`,`getStatus`,`query`,e)},smoke:{getStatus:e=>c(`smoke`,`smoke`,`getStatus`,`query`,e)},snapshot:{getSnapshot:e=>c(`snapshot`,`snapshot`,`getSnapshot`,`query`,e),invalidateCache:e=>c(`snapshot`,`snapshot`,`invalidateCache`,`mutation`,e),getSnapshotOverview:e=>c(`snapshot`,`snapshot`,`getSnapshotOverview`,`query`,e),getStatus:e=>c(`snapshot`,`snapshot`,`getStatus`,`query`,e),getDeviceSettingsContribution:e=>c(`snapshot`,`snapshot`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`snapshot`,`snapshot`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`snapshot`,`snapshot`,`applyDeviceSettingsPatch`,`mutation`,e)},streamCatalog:{getCatalog:e=>c(`stream-catalog`,`streamCatalog`,`getCatalog`,`query`,e)},streamParams:{getOptions:e=>c(`stream-params`,`streamParams`,`getOptions`,`query`,e),setProfile:e=>c(`stream-params`,`streamParams`,`setProfile`,`mutation`,e),getConfigSchema:e=>c(`stream-params`,`streamParams`,`getConfigSchema`,`query`,e),getStatus:e=>c(`stream-params`,`streamParams`,`getStatus`,`query`,e)},switch:{setState:e=>c(`switch`,`switch`,`setState`,`mutation`,e),getStatus:e=>c(`switch`,`switch`,`getStatus`,`query`,e)},tamper:{getStatus:e=>c(`tamper`,`tamper`,`getStatus`,`query`,e)},temperatureSensor:{getStatus:e=>c(`temperature-sensor`,`temperatureSensor`,`getStatus`,`query`,e)},update:{installUpdate:e=>c(`update`,`update`,`installUpdate`,`mutation`,e),getStatus:e=>c(`update`,`update`,`getStatus`,`query`,e)},vacuumControl:{start:e=>c(`vacuum-control`,`vacuumControl`,`start`,`mutation`,e),pause:e=>c(`vacuum-control`,`vacuumControl`,`pause`,`mutation`,e),stop:e=>c(`vacuum-control`,`vacuumControl`,`stop`,`mutation`,e),returnToBase:e=>c(`vacuum-control`,`vacuumControl`,`returnToBase`,`mutation`,e),locate:e=>c(`vacuum-control`,`vacuumControl`,`locate`,`mutation`,e),setFanSpeed:e=>c(`vacuum-control`,`vacuumControl`,`setFanSpeed`,`mutation`,e),getStatus:e=>c(`vacuum-control`,`vacuumControl`,`getStatus`,`query`,e)},valve:{open:e=>c(`valve`,`valve`,`open`,`mutation`,e),close:e=>c(`valve`,`valve`,`close`,`mutation`,e),stop:e=>c(`valve`,`valve`,`stop`,`mutation`,e),setPosition:e=>c(`valve`,`valve`,`setPosition`,`mutation`,e),getStatus:e=>c(`valve`,`valve`,`getStatus`,`query`,e)},vibration:{getStatus:e=>c(`vibration`,`vibration`,`getStatus`,`query`,e)},videoclips:{listClips:e=>c(`videoclips`,`videoclips`,`listClips`,`query`,e),getClipPlayback:e=>c(`videoclips`,`videoclips`,`getClipPlayback`,`query`,e)},waterHeater:{setTargetTemp:e=>c(`water-heater`,`waterHeater`,`setTargetTemp`,`mutation`,e),setOperationMode:e=>c(`water-heater`,`waterHeater`,`setOperationMode`,`mutation`,e),setAway:e=>c(`water-heater`,`waterHeater`,`setAway`,`mutation`,e),getStatus:e=>c(`water-heater`,`waterHeater`,`getStatus`,`query`,e)},weather:{getStatus:e=>c(`weather`,`weather`,`getStatus`,`query`,e)},webrtcSession:{listStreams:e=>c(`webrtc-session`,`webrtcSession`,`listStreams`,`query`,e),createSession:e=>c(`webrtc-session`,`webrtcSession`,`createSession`,`mutation`,e),handleOffer:e=>c(`webrtc-session`,`webrtcSession`,`handleOffer`,`mutation`,e),handleAnswer:e=>c(`webrtc-session`,`webrtcSession`,`handleAnswer`,`mutation`,e),addIceCandidate:e=>c(`webrtc-session`,`webrtcSession`,`addIceCandidate`,`mutation`,e),getIceCandidates:e=>c(`webrtc-session`,`webrtcSession`,`getIceCandidates`,`query`,e),closeSession:e=>c(`webrtc-session`,`webrtcSession`,`closeSession`,`mutation`,e),hasAdaptiveBitrate:e=>c(`webrtc-session`,`webrtcSession`,`hasAdaptiveBitrate`,`query`,e),getSessionState:e=>c(`webrtc-session`,`webrtcSession`,`getSessionState`,`query`,e)},zoneAnalytics:{getCurrentSnapshot:e=>c(`zone-analytics`,`zoneAnalytics`,`getCurrentSnapshot`,`query`,e),getZoneHistory:e=>c(`zone-analytics`,`zoneAnalytics`,`getZoneHistory`,`query`,e),getCameraHistory:e=>c(`zone-analytics`,`zoneAnalytics`,`getCameraHistory`,`query`,e),getUnzonedHistory:e=>c(`zone-analytics`,`zoneAnalytics`,`getUnzonedHistory`,`query`,e)},zoneRules:{listRules:e=>c(`zone-rules`,`zoneRules`,`listRules`,`query`,e),setRules:e=>c(`zone-rules`,`zoneRules`,`setRules`,`mutation`,e)},zones:{listZones:e=>c(`zones`,`zones`,`listZones`,`query`,e),addZone:e=>c(`zones`,`zones`,`addZone`,`mutation`,e),removeZone:e=>c(`zones`,`zones`,`removeZone`,`mutation`,e),updateZone:e=>c(`zones`,`zones`,`updateZone`,`mutation`,e)},addonSettings:{getDeviceSettings:e=>l(`addonSettings`,`getDeviceSettings`,`query`,e),updateDeviceSettings:e=>l(`addonSettings`,`updateDeviceSettings`,`mutation`,e)},cameraPipelineConfig:{getDeviceSettingsContribution:e=>l(`cameraPipelineConfig`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`cameraPipelineConfig`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`cameraPipelineConfig`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceAdoption:{getStatus:e=>l(`deviceAdoption`,`getStatus`,`query`,e)},deviceExport:{getDeviceSettingsContribution:e=>l(`deviceExport`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`deviceExport`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`deviceExport`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceManager:{loadConfig:e=>l(`deviceManager`,`loadConfig`,`query`,e),loadRuntimeState:e=>l(`deviceManager`,`loadRuntimeState`,`query`,e),loadMeta:e=>l(`deviceManager`,`loadMeta`,`query`,e),setName:e=>l(`deviceManager`,`setName`,`mutation`,e),setLocation:e=>l(`deviceManager`,`setLocation`,`mutation`,e),setType:e=>l(`deviceManager`,`setType`,`mutation`,e),setIntegrationId:e=>l(`deviceManager`,`setIntegrationId`,`mutation`,e),setLinkDeviceId:e=>l(`deviceManager`,`setLinkDeviceId`,`mutation`,e),setPrimaryChildEntityId:e=>l(`deviceManager`,`setPrimaryChildEntityId`,`mutation`,e),setChildLayout:e=>l(`deviceManager`,`setChildLayout`,`mutation`,e),setDeviceLinks:e=>l(`deviceManager`,`setDeviceLinks`,`mutation`,e),setDisplay:e=>l(`deviceManager`,`setDisplay`,`mutation`,e),getWireableFields:e=>l(`deviceManager`,`getWireableFields`,`query`,e),setRole:e=>l(`deviceManager`,`setRole`,`mutation`,e),applyInitialMeta:e=>l(`deviceManager`,`applyInitialMeta`,`mutation`,e),setMetadata:e=>l(`deviceManager`,`setMetadata`,`mutation`,e),setDisabled:e=>l(`deviceManager`,`setDisabled`,`mutation`,e),getDevice:e=>l(`deviceManager`,`getDevice`,`query`,e),getLinkedDevices:e=>l(`deviceManager`,`getLinkedDevices`,`query`,e),getStreamSources:e=>l(`deviceManager`,`getStreamSources`,`query`,e),getConfigSchema:e=>l(`deviceManager`,`getConfigSchema`,`query`,e),getSettingsSchema:e=>l(`deviceManager`,`getSettingsSchema`,`query`,e),updateConfig:e=>l(`deviceManager`,`updateConfig`,`mutation`,e),enable:e=>l(`deviceManager`,`enable`,`mutation`,e),disable:e=>l(`deviceManager`,`disable`,`mutation`,e),remove:e=>l(`deviceManager`,`remove`,`mutation`,e),getStreamProfileMap:e=>l(`deviceManager`,`getStreamProfileMap`,`query`,e),setStreamProfileMap:e=>l(`deviceManager`,`setStreamProfileMap`,`mutation`,e),probeStreams:e=>l(`deviceManager`,`probeStreams`,`mutation`,e),getBindings:e=>l(`deviceManager`,`getBindings`,`query`,e),getAllBindings:e=>l(`deviceManager`,`getAllBindings`,`query`,e),setWrapperActive:e=>l(`deviceManager`,`setWrapperActive`,`mutation`,e),getDeviceSettingsAggregate:e=>l(`deviceManager`,`getDeviceSettingsAggregate`,`query`,e),getDeviceLiveInfoAggregate:e=>l(`deviceManager`,`getDeviceLiveInfoAggregate`,`query`,e),getDeviceAggregate:e=>l(`deviceManager`,`getDeviceAggregate`,`query`,e),runDeviceAction:e=>l(`deviceManager`,`runDeviceAction`,`mutation`,e),updateDeviceField:e=>l(`deviceManager`,`updateDeviceField`,`mutation`,e),updateDeviceFieldsBatch:e=>l(`deviceManager`,`updateDeviceFieldsBatch`,`mutation`,e),testField:e=>l(`deviceManager`,`testField`,`mutation`,e),getDeviceStatusAggregate:e=>l(`deviceManager`,`getDeviceStatusAggregate`,`query`,e),getDeviceSettingsContribution:e=>l(`deviceManager`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`deviceManager`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`deviceManager`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceState:{getSnapshot:e=>l(`deviceState`,`getSnapshot`,`query`,e),getCapSlice:e=>l(`deviceState`,`getCapSlice`,`query`,e),setCapSlice:e=>l(`deviceState`,`setCapSlice`,`mutation`,e)},faceGallery:{getFaceByTrack:e=>l(`faceGallery`,`getFaceByTrack`,`query`,e)},networkQuality:{getDeviceStats:e=>l(`networkQuality`,`getDeviceStats`,`query`,e),reportClientStats:e=>l(`networkQuality`,`reportClientStats`,`mutation`,e)},pipelineExecutor:{runPipeline:e=>l(`pipelineExecutor`,`runPipeline`,`mutation`,e),runPipelineBatch:e=>l(`pipelineExecutor`,`runPipelineBatch`,`mutation`,e)},pipelineOrchestrator:{assignPipeline:e=>l(`pipelineOrchestrator`,`assignPipeline`,`mutation`,e),unassignPipeline:e=>l(`pipelineOrchestrator`,`unassignPipeline`,`mutation`,e),setPipelineDevicePin:e=>l(`pipelineOrchestrator`,`setPipelineDevicePin`,`mutation`,e),getPipelineDevicePin:e=>l(`pipelineOrchestrator`,`getPipelineDevicePin`,`query`,e),getPipelineAssignment:e=>l(`pipelineOrchestrator`,`getPipelineAssignment`,`query`,e),getCameraMetrics:e=>l(`pipelineOrchestrator`,`getCameraMetrics`,`query`,e),assignAudio:e=>l(`pipelineOrchestrator`,`assignAudio`,`mutation`,e),unassignAudio:e=>l(`pipelineOrchestrator`,`unassignAudio`,`mutation`,e),getAudioAssignment:e=>l(`pipelineOrchestrator`,`getAudioAssignment`,`query`,e),getAudioAssignments:e=>l(`pipelineOrchestrator`,`getAudioAssignments`,`query`,e),getCameraSettings:e=>l(`pipelineOrchestrator`,`getCameraSettings`,`query`,e),setCameraStepToggle:e=>l(`pipelineOrchestrator`,`setCameraStepToggle`,`mutation`,e),getCameraStepOverrides:e=>l(`pipelineOrchestrator`,`getCameraStepOverrides`,`query`,e),setCameraStepOverride:e=>l(`pipelineOrchestrator`,`setCameraStepOverride`,`mutation`,e),setCameraPipelineForAgent:e=>l(`pipelineOrchestrator`,`setCameraPipelineForAgent`,`mutation`,e),resolvePipeline:e=>l(`pipelineOrchestrator`,`resolvePipeline`,`query`,e),getCameraStatus:e=>l(`pipelineOrchestrator`,`getCameraStatus`,`query`,e),getDeviceSettingsContribution:e=>l(`pipelineOrchestrator`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`pipelineOrchestrator`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`pipelineOrchestrator`,`applyDeviceSettingsPatch`,`mutation`,e)},pipelineRunner:{detachCamera:e=>l(`pipelineRunner`,`detachCamera`,`mutation`,e),getCameraMetrics:e=>l(`pipelineRunner`,`getCameraMetrics`,`query`,e),runDetailSubtree:e=>l(`pipelineRunner`,`runDetailSubtree`,`mutation`,e)},plateGallery:{listPlates:e=>l(`plateGallery`,`listPlates`,`query`,e),getPlateByTrack:e=>l(`plateGallery`,`getPlateByTrack`,`query`,e)},recording:{getAvailability:e=>l(`recording`,`getAvailability`,`query`,e),getDaysWithRecordings:e=>l(`recording`,`getDaysWithRecordings`,`query`,e),getPlaybackManifest:e=>l(`recording`,`getPlaybackManifest`,`query`,e),getDeviceConfig:e=>l(`recording`,`getDeviceConfig`,`query`,e),locateSegment:e=>l(`recording`,`locateSegment`,`query`,e),readSegmentBytes:e=>l(`recording`,`readSegmentBytes`,`query`,e),setDeviceConfig:e=>l(`recording`,`setDeviceConfig`,`mutation`,e),rescanStorage:e=>l(`recording`,`rescanStorage`,`mutation`,e),pruneFootage:e=>l(`recording`,`pruneFootage`,`mutation`,e),deleteFootprint:e=>l(`recording`,`deleteFootprint`,`mutation`,e),renderGif:e=>l(`recording`,`renderGif`,`mutation`,e),renderClip:e=>l(`recording`,`renderClip`,`mutation`,e),getStatus:e=>l(`recording`,`getStatus`,`query`,e),getDeviceSettingsContribution:e=>l(`recording`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`recording`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`recording`,`applyDeviceSettingsPatch`,`mutation`,e)},recordingExport:{createExport:e=>l(`recordingExport`,`createExport`,`mutation`,e),listExports:e=>l(`recordingExport`,`listExports`,`query`,e)},streamBroker:{publishCameraStream:e=>l(`streamBroker`,`publishCameraStream`,`mutation`,e),retractCameraStream:e=>l(`streamBroker`,`retractCameraStream`,`mutation`,e),assignProfile:e=>l(`streamBroker`,`assignProfile`,`mutation`,e),unassignProfile:e=>l(`streamBroker`,`unassignProfile`,`mutation`,e),renderPreBufferClip:e=>l(`streamBroker`,`renderPreBufferClip`,`mutation`,e),restartProfile:e=>l(`streamBroker`,`restartProfile`,`mutation`,e),getDeviceSettingsContribution:e=>l(`streamBroker`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`streamBroker`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`streamBroker`,`applyDeviceSettingsPatch`,`mutation`,e)}}}var Bs=B({staticDir:P()}),Vs=B({version:P()}),Hs={name:`admin-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:K(R(),Bs),getVersion:K(R(),Vs)}},Us=B({staticDir:P()}),Ws=B({version:P()}),Gs={name:`viewer-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:K(R(),Us),getVersion:K(R(),Ws)}},Ks=B({id:P(),label:P(),protocol:H([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:P().optional(),resolution:B({width:F(),height:F()}).optional(),fps:F().optional(),bitrate:F().optional(),codec:P().optional(),profileHint:ps.optional(),sdp:P().optional()}),qs=B({key:P(),value:L()}),Js=B({source:P(),data:V(P(),L())}),Ys={name:`device-ops`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getStreamSources:K(B({deviceId:F()}),z(Ks)),getConfigEntries:K(B({deviceId:F()}),z(qs)),setConfig:K(B({deviceId:F(),values:V(P(),L())}),R(),{kind:`mutation`}),runAction:K(B({deviceId:F(),action:P().min(1),input:L()}),L(),{kind:`mutation`}),removeDevice:K(B({deviceId:F()}),R(),{kind:`mutation`}),getSettingsSchema:K(B({deviceId:F()}),L().nullable()),getRawState:K(B({deviceId:F()}),Js.nullable(),{auth:`protected`})}},Xs=H([`singleton`,`device`,`widget`]),Zs=B({capName:P(),kind:Xs,deviceId:F().optional(),reachable:I(),latencyMs:F(),error:P().optional()}),Qs=B({addonId:P(),caps:z(Zs).readonly(),widgets:z(Zs).readonly()}),$s=B({nodeId:P(),addons:z(Qs).readonly()});B({ok:I(),degraded:I(),checkedAt:P(),nodes:z($s).readonly(),summary:B({total:F(),reachable:F(),unreachable:F()})});var ec=B({id:P(),name:P(),category:P().optional(),description:P().optional(),icon:P().optional()}),tc=[`onnx`,`coreml`,`openvino`,`tflite`,`pt`,`gguf`],nc=B({url:P(),sizeMB:F(),isDirectory:I().optional(),files:z(P()).readonly().optional(),runtimes:z(H([`node`,`python`])).readonly().optional()}),rc=B({url:P(),filename:P(),sizeMB:F()}),ic=B({onnx:nc.optional(),coreml:nc.optional(),openvino:nc.optional(),tflite:nc.optional(),pt:nc.optional(),gguf:nc.optional()}),ac=B({family:P(),tier:P(),precision:H([`fp32`,`int8`]).optional(),optimization:H([`standard`,`fast`]).optional(),resolution:F().int().positive().optional()}),oc=B({id:P(),name:P(),description:P(),formats:ic,inputSize:B({width:F(),height:F()}),inputChannels:F().int().positive().optional(),labels:z(ec).readonly(),inputLayout:H([`nchw`,`nhwc`]).optional(),inputNormalization:H([`zero-one`,`imagenet`,`none`]).optional(),outputProbabilities:I().optional(),preprocessMode:H([`letterbox`,`resize`]).optional(),postprocessor:rs().optional(),faceAlignment:I().optional(),extraFiles:z(rc).readonly().optional(),legacy:I().optional(),metrics:B({map50:F().optional(),p95LatencyMs:V(P(),F()).optional()}).optional(),license:P().optional(),group:ac.optional()}),sc=To(`format`,[B({format:U(`openvino`),precisions:z(H([`fp16`,`int8`])).min(1).readonly()}),B({format:U(`coreml`)})]),cc=B({id:P().regex(/^[a-zA-Z0-9._-]+$/),name:P(),labels:z(ec).readonly(),inputSize:B({width:F(),height:F()}),inputLayout:H([`nchw`,`nhwc`]).optional(),inputNormalization:H([`zero-one`,`imagenet`,`none`]).optional(),preprocessMode:H([`letterbox`,`resize`]).optional(),outputFormat:H([`yolo`,`ssd`,`embedding`,`classification`,`ocr`,`segmentation`]),faceAlignment:I().optional()}),lc=B({entry:oc,artifacts:z(B({format:H(tc),precision:H([`fp16`,`int8`]).optional(),sizeMB:F(),validated:I(),files:z(P()).readonly()})).readonly()}),uc=F().int().min(0).max(6),dc=/^([01]\d|2[0-3]):[0-5]\d$/,fc=H([`off`,`events`,`continuous`]),pc=B({motion:I().optional(),audioThresholdDbfs:F().optional()}),mc=H([`continuous`,`events`]),hc=pc,gc=B({days:z(uc),start:P().regex(dc),end:P().regex(dc),mode:mc,triggers:hc.optional(),preBufferSec:F().min(0).optional(),postBufferSec:F().min(0).optional()}),_c=B({maxAgeDays:F().min(0).optional(),maxSizeGb:F().min(0).optional()}),vc=H([`minimal`,`low`,`standard`,`high`,`max`]),yc=B({enabled:I(),mode:fc.optional(),profiles:z(ps).optional(),segmentSeconds:F().int().positive().optional(),bands:z(gc).default([]),retention:_c.optional(),scrubThumbnails:vc.optional(),stripsEnabled:I().optional()}).strict(),bc=H([`recording`,`events`]),xc=H([`prune`,`manual-delete`,`rescan`,`retention-run`,`relocate`]),Sc=H([`retention`,`quota`,`manual`,`operator`]),Cc=B({id:P(),at:F(),domain:bc,op:xc,reason:Sc,deviceId:F().nullable(),nodeId:P(),itemsAffected:F(),bytesReclaimed:F(),detail:P().nullable(),actor:P()}),wc=B({deviceId:F().optional(),limit:F().int().min(1).max(1e3).optional()}),Tc=H([`running`,`done`,`failed`,`cancelled`]),Ec=B({jobId:P(),state:Tc,fromLocationId:P(),toLocationId:P(),deviceId:F().nullable(),entities:z(P()),filesMoved:F().int(),bytesMoved:F().int(),filesTotal:F().int().nullable(),startedAt:F(),finishedAt:F().nullable(),error:P().nullable()}),Dc=B({deviceId:F().optional(),fromLocationId:P(),toLocationId:P(),entities:z(H([`segments`,`strips`])).optional(),throttleMbps:F().min(1).max(1e3).optional()}),Oc=B({deviceId:F().optional(),toLocationId:P(),throttleMbps:F().min(1).max(1e3).optional()}),kc=P().regex(/^[a-z][a-zA-Z0-9-]*$/),Ac=B({id:P().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:P(),displayName:P().min(1),providerId:P().min(1),config:V(P(),L()),nodeId:P().optional(),isDefault:I().default(!1),isSystem:I().default(!1),capacity:B({totalBytes:F(),availableBytes:F()}).nullable().optional(),createdAt:F(),updatedAt:F()}),jc=Co([kc,P().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),Mc=B({id:P().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:`id must start with a lowercase letter and contain only letters, digits, or hyphens`}),displayName:P().min(1,{message:`displayName must not be empty`}),description:P().optional(),cardinality:H([`single`,`multi`]),defaultsTo:P().optional(),defaultRoot:H([`data`,`media`,`backup`]).optional()}),Nc=B({inputFps:F(),outputFps:F(),avgDecodeTimeMs:F(),droppedFrames:F(),lagMs:F().optional(),effectiveFps:F().optional(),adaptiveFps:F().optional()}),Pc=B({codec:P(),maxFps:F().default(0),outputFormat:H([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]).default(`jpeg`),scale:F().default(1),width:F().optional(),height:F().optional(),deviceId:F().int().nonnegative().optional(),tag:P().optional(),frameSink:H([`callback`,`shm`]).default(`callback`),debug:I().optional()}),Fc=B({video:B({codec:H([`h264`,`h265`,`copy`]),profile:H([`baseline`,`main`,`high`]).optional(),width:F().int().positive().optional(),height:F().int().positive().optional(),fps:F().positive().optional(),bitrateKbps:F().int().positive().optional(),gopFrames:F().int().positive().optional(),bf:F().int().min(0).optional(),preset:H([`ultrafast`,`superfast`,`veryfast`,`faster`,`fast`,`medium`]).optional(),tune:H([`zerolatency`,`film`,`animation`]).optional()}),audio:Co([U(`passthrough`),B({codec:H([`opus`,`aac`,`pcmu`,`pcma`,`copy`]),bitrateKbps:F().int().positive().optional(),sampleRateHz:F().int().positive().optional(),channels:Co([U(1),U(2)]).optional()})]),inputArgs:z(P()).optional(),outputArgs:z(P()).optional()}),Ic={mapping:{person:`person`,bicycle:`vehicle`,car:`vehicle`,motorcycle:`vehicle`,airplane:`vehicle`,bus:`vehicle`,train:`vehicle`,truck:`vehicle`,boat:`vehicle`,bird:`animal`,cat:`animal`,dog:`animal`,horse:`animal`,sheep:`animal`,cow:`animal`,elephant:`animal`,bear:`animal`,zebra:`animal`,giraffe:`animal`,suitcase:`package`,backpack:`package`,handbag:`package`},preserveOriginal:!1},Lc=[{id:`speech`,name:`Speech`,icon:`🗣️`},{id:`scream`,name:`Scream / Shout`,icon:`😱`},{id:`crying`,name:`Crying / Baby`,icon:`😢`},{id:`laughter`,name:`Laughter`,icon:`😂`},{id:`music`,name:`Music`,icon:`🎵`},{id:`dog`,name:`Dog`,icon:`🐕`},{id:`cat`,name:`Cat`,icon:`🐈`},{id:`bird`,name:`Bird`,icon:`🐦`},{id:`animal`,name:`Animal (other)`,icon:`🐾`},{id:`alarm`,name:`Alarm / Siren`,icon:`🚨`},{id:`doorbell`,name:`Doorbell / Knock`,icon:`🔔`},{id:`glass_breaking`,name:`Glass Breaking`,icon:`💥`},{id:`gunshot`,name:`Gunshot / Explosion`,icon:`💣`},{id:`vehicle`,name:`Vehicle`,icon:`🚗`},{id:`siren`,name:`Emergency Siren`,icon:`🚑`},{id:`fire`,name:`Fire / Smoke`,icon:`🔥`},{id:`water`,name:`Water`,icon:`💧`},{id:`wind`,name:`Wind / Weather`,icon:`🌬️`},{id:`door`,name:`Door`,icon:`🚪`},{id:`footsteps`,name:`Footsteps`,icon:`👣`},{id:`crowd`,name:`Crowd / Chatter`,icon:`👥`},{id:`telephone`,name:`Telephone`,icon:`📞`},{id:`engine`,name:`Engine / Motor`,icon:`⚙️`},{id:`tools`,name:`Tools / Construction`,icon:`🔨`},{id:`silence`,name:`Silence`,icon:`🤫`}],Rc={mapping:{Speech:`speech`,"Child speech, kid speaking":`speech`,Conversation:`speech`,"Narration, monologue":`speech`,Babbling:`speech`,Whispering:`speech`,"Speech synthesizer":`speech`,Humming:`speech`,Rapping:`speech`,Singing:`speech`,Choir:`speech`,"Child singing":`speech`,Shout:`scream`,Bellow:`scream`,Yell:`scream`,Screaming:`scream`,"Children shouting":`scream`,Whoop:`scream`,"Crying, sobbing":`crying`,"Baby cry, infant cry":`crying`,Whimper:`crying`,"Wail, moan":`crying`,Groan:`crying`,Laughter:`laughter`,"Baby laughter":`laughter`,Giggle:`laughter`,Snicker:`laughter`,"Belly laugh":`laughter`,"Chuckle, chortle":`laughter`,Music:`music`,"Musical instrument":`music`,Guitar:`music`,Piano:`music`,Drum:`music`,"Drum kit":`music`,"Violin, fiddle":`music`,Flute:`music`,Saxophone:`music`,Trumpet:`music`,Synthesizer:`music`,"Pop music":`music`,"Rock music":`music`,"Hip hop music":`music`,"Classical music":`music`,Jazz:`music`,"Electronic music":`music`,"Background music":`music`,Dog:`dog`,Bark:`dog`,Yip:`dog`,Howl:`dog`,"Bow-wow":`dog`,Growling:`dog`,"Whimper (dog)":`dog`,Cat:`cat`,Purr:`cat`,Meow:`cat`,Hiss:`cat`,Caterwaul:`cat`,Bird:`bird`,"Bird vocalization, bird call, bird song":`bird`,"Chirp, tweet":`bird`,Squawk:`bird`,Crow:`bird`,Owl:`bird`,"Pigeon, dove":`bird`,Animal:`animal`,"Domestic animals, pets":`animal`,"Livestock, farm animals, working animals":`animal`,Horse:`animal`,"Cattle, bovinae":`animal`,Pig:`animal`,Sheep:`animal`,Goat:`animal`,Frog:`animal`,Insect:`animal`,Cricket:`animal`,Alarm:`alarm`,"Alarm clock":`alarm`,"Smoke detector, smoke alarm":`alarm`,"Fire alarm":`alarm`,Buzzer:`alarm`,"Civil defense siren":`alarm`,"Car alarm":`alarm`,Siren:`siren`,"Police car (siren)":`siren`,"Ambulance (siren)":`siren`,"Fire engine, fire truck (siren)":`siren`,"Emergency vehicle":`siren`,Foghorn:`siren`,Doorbell:`doorbell`,"Ding-dong":`doorbell`,Knock:`doorbell`,Tap:`doorbell`,Glass:`glass_breaking`,Shatter:`glass_breaking`,"Chink, clink":`glass_breaking`,"Gunshot, gunfire":`gunshot`,"Machine gun":`gunshot`,Explosion:`gunshot`,Fireworks:`gunshot`,Firecracker:`gunshot`,"Artillery fire":`gunshot`,"Cap gun":`gunshot`,Boom:`gunshot`,Vehicle:`vehicle`,Car:`vehicle`,Truck:`vehicle`,Bus:`vehicle`,Motorcycle:`vehicle`,"Car passing by":`vehicle`,"Vehicle horn, car horn, honking":`vehicle`,"Traffic noise, roadway noise":`vehicle`,Train:`vehicle`,Aircraft:`vehicle`,Helicopter:`vehicle`,Bicycle:`vehicle`,Skateboard:`vehicle`,Fire:`fire`,Crackle:`fire`,Water:`water`,Rain:`water`,Raindrop:`water`,"Rain on surface":`water`,Stream:`water`,Waterfall:`water`,Ocean:`water`,"Waves, surf":`water`,"Splash, splatter":`water`,Wind:`wind`,Thunderstorm:`wind`,Thunder:`wind`,"Wind noise (microphone)":`wind`,"Rustling leaves":`wind`,Door:`door`,"Sliding door":`door`,Slam:`door`,"Cupboard open or close":`door`,"Walk, footsteps":`footsteps`,Run:`footsteps`,Shuffle:`footsteps`,Crowd:`crowd`,Chatter:`crowd`,Cheering:`crowd`,Applause:`crowd`,"Children playing":`crowd`,"Hubbub, speech noise, speech babble":`crowd`,Telephone:`telephone`,"Telephone bell ringing":`telephone`,Ringtone:`telephone`,"Telephone dialing, DTMF":`telephone`,"Busy signal":`telephone`,Engine:`engine`,"Engine starting":`engine`,Idling:`engine`,"Accelerating, revving, vroom":`engine`,"Light engine (high frequency)":`engine`,"Medium engine (mid frequency)":`engine`,"Heavy engine (low frequency)":`engine`,"Lawn mower":`engine`,Chainsaw:`engine`,Hammer:`tools`,Jackhammer:`tools`,Sawing:`tools`,"Power tool":`tools`,Drill:`tools`,Sanding:`tools`,Silence:`silence`},preserveOriginal:!1},zc={mapping:{speech:`speech`,child_speech:`speech`,conversation:`speech`,whispering:`speech`,singing:`speech`,humming:`speech`,shout:`scream`,yell:`scream`,screaming:`scream`,crying:`crying`,baby_crying:`crying`,sobbing:`crying`,laughter:`laughter`,baby_laughter:`laughter`,giggling:`laughter`,music:`music`,guitar:`music`,piano:`music`,drums:`music`,dog_bark:`dog`,dog_bow_wow:`dog`,dog_growling:`dog`,dog_howl:`dog`,cat_meow:`cat`,cat_purr:`cat`,cat_hiss:`cat`,bird:`bird`,bird_chirp:`bird`,bird_squawk:`bird`,animal:`animal`,horse:`animal`,cow_moo:`animal`,insect:`animal`,alarm:`alarm`,smoke_alarm:`alarm`,fire_alarm:`alarm`,car_alarm:`alarm`,siren:`siren`,police_siren:`siren`,ambulance_siren:`siren`,doorbell:`doorbell`,door_knock:`doorbell`,knocking:`doorbell`,glass_breaking:`glass_breaking`,glass_shatter:`glass_breaking`,gunshot:`gunshot`,explosion:`gunshot`,fireworks:`gunshot`,car:`vehicle`,truck:`vehicle`,motorcycle:`vehicle`,car_horn:`vehicle`,vehicle_horn:`vehicle`,traffic:`vehicle`,fire:`fire`,fire_crackle:`fire`,water:`water`,rain:`water`,ocean:`water`,splash:`water`,wind:`wind`,thunder:`wind`,thunderstorm:`wind`,door:`door`,door_slam:`door`,sliding_door:`door`,footsteps:`footsteps`,walking:`footsteps`,running:`footsteps`,crowd:`crowd`,chatter:`crowd`,cheering:`crowd`,applause:`crowd`,telephone_ring:`telephone`,ringtone:`telephone`,engine:`engine`,engine_starting:`engine`,lawn_mower:`engine`,chainsaw:`engine`,hammer:`tools`,jackhammer:`tools`,drill:`tools`,power_tool:`tools`,silence:`silence`},preserveOriginal:!1},Bc=new Map;for(let[e,t]of Object.entries(Rc.mapping))Bc.set(e.toLowerCase(),t);for(let[e,t]of Object.entries(zc.mapping))Bc.set(e.toLowerCase(),t);var Vc={motion:`#f59e0b`,audio:`#06b6d4`,person:`#22c55e`,vehicle:`#3b82f6`,animal:`#f97316`,package:`#a855f7`,sensor:`#8b5cf6`,control:`#10b981`,genericDetection:`#64748b`},Hc={car:`#f59e0b`,truck:`#d97706`,bus:`#b45309`,motorcycle:`#eab308`,bicycle:`#ca8a04`,airplane:`#60a5fa`,boat:`#2563eb`,train:`#1d4ed8`,bird:`#14b8a6`,dog:`#84cc16`,cat:`#f97316`,horse:`#a16207`,sheep:`#a3a3a3`,cow:`#78716c`,elephant:`#6b7280`,bear:`#7c2d12`,zebra:`#404040`,giraffe:`#d4a373`};function Uc(e){return e.split(/[-_ ]/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var Wc=new Map;function Gc(e,t,n,r,a){Wc.set(e,{kind:e,parentKind:null,level:`macro`,category:t,color:n,iconId:r,labelKey:`eventKind.${e}`,label:a})}function Kc(e,t,n,r,a,o){Wc.set(e,{kind:e,parentKind:t,level:`sub`,category:n,color:r,iconId:a,labelKey:`eventKind.${e}`,label:o})}Gc(`motion`,`motion`,Vc.motion,`motion`,`Motion`),Gc(`audio`,`audio`,Vc.audio,`audio`,`Audio`),Gc(`person`,`detection`,Vc.person,`person`,`Person`),Gc(`vehicle`,`detection`,Vc.vehicle,`vehicle`,`Vehicle`),Gc(`animal`,`detection`,Vc.animal,`animal`,`Animal`),Gc(`package`,`package`,Vc.package,`package`,`Package`),Gc(`sensor`,`sensor`,Vc.sensor,`sensor`,`Sensor`),Gc(`control`,`control`,Vc.control,`control`,`Control`);for(let[e,t]of Object.entries(Ic.mapping))t!==`vehicle`&&t!==`animal`||Wc.has(e)||Kc(e,t,`detection`,Hc[e]??Vc.genericDetection,e,Uc(e));Kc(`package-delivered`,`package`,`package`,Vc.package,`package`,`Package delivered`),Kc(`package-picked-up`,`package`,`package`,Vc.package,`package`,`Package picked up`),Kc(`contact`,`sensor`,`sensor`,`#f59e0b`,`door`,`Contact`),Kc(`motion-sensor`,`sensor`,`sensor`,Vc.sensor,`pir`,`Motion sensor`),Kc(`smoke`,`sensor`,`sensor`,`#ef4444`,`smoke`,`Smoke`),Kc(`flood`,`sensor`,`sensor`,`#3b82f6`,`water`,`Water leak`),Kc(`gas`,`sensor`,`sensor`,`#ef4444`,`gas`,`Gas`),Kc(`carbon-monoxide`,`sensor`,`sensor`,`#dc2626`,`smoke`,`Carbon monoxide`),Kc(`vibration`,`sensor`,`sensor`,`#eab308`,`vibration`,`Vibration`),Kc(`tamper`,`sensor`,`sensor`,`#f97316`,`tamper`,`Tamper`),Kc(`presence`,`sensor`,`sensor`,`#22c55e`,`presence`,`Presence`),Kc(`enum-sensor`,`sensor`,`sensor`,Vc.sensor,`generic`,`Sensor state`),Kc(`device-event`,`sensor`,`sensor`,`#10b981`,`button`,`Device event`),Kc(`lock`,`control`,`control`,`#0ea5e9`,`lock`,`Lock`),Kc(`switch`,`control`,`control`,Vc.control,`switch`,`Switch`),Kc(`siren`,`control`,`control`,`#dc2626`,`siren`,`Siren`),Kc(`button`,`control`,`control`,`#10b981`,`button`,`Button`),Kc(`doorbell`,`control`,`control`,`#a855f7`,`doorbell`,`Doorbell`);for(let e of Lc){let t=`audio-${e.id}`;Wc.has(t)||Kc(t,`audio`,`audio`,Vc.audio,t,e.name)}var qc=Object.freeze(Object.fromEntries(Wc)),Jc=B({kind:P(),label:P(),parentKind:P().nullable()}),Yc=B({videoClasses:z(Jc),audioKinds:z(Jc),labels:z(Jc)});function Xc(e,t,n){return{kind:e,label:t,parentKind:n}}function Zc(){let e=Object.values(qc);return{videoClasses:e.filter(e=>e.category===`detection`).map(e=>Xc(e.kind,e.label,e.parentKind)),audioKinds:e.filter(e=>e.category===`audio`&&e.level===`sub`).map(e=>Xc(e.kind,e.label,e.parentKind)),labels:e.filter(e=>e.category===`sensor`||e.category===`control`).map(e=>Xc(e.kind,e.label,e.parentKind))}}Object.freeze(Zc());var Qc=class extends Error{position;constructor(e,t){super(e),this.name=`ExpressionParseError`,this.position=t}},$c=class extends Error{constructor(e){super(e),this.name=`ExpressionEvalError`}},el=2048,tl=/^[A-Za-z_][A-Za-z0-9_]*$/,nl=new Set([`now`,`true`,`false`,`null`]),rl=new Set([`true`,`false`,`null`]);function il(e){return e>=`0`&&e<=`9`}function al(e){return e>=`A`&&e<=`Z`||e>=`a`&&e<=`z`||e===`_`}function ol(e){return al(e)||il(e)}function sl(e){return e===` `||e===` `||e===`
74
- `||e===`\r`||e===`\f`||e===`\v`}function cl(e){if(e.length>2048)throw new Qc(`expression too long (${e.length} > ${el} chars)`,0);let t=[],n=0,r=e.length;for(;n<r;){let a=e[n];if(sl(a)){n+=1;continue}if(il(a)){let a=n;for(;n<r&&il(e[n]);)n+=1;if(n<r&&e[n]===`.`){if(n+1>=r||!il(e[n+1]))throw new Qc(`malformed number: decimal point needs a digit`,n);for(n+=1;n<r&&il(e[n]);)n+=1}let o=e.slice(a,n),s=Number(o);if(!Number.isFinite(s))throw new Qc(`malformed number: '${o}'`,a);t.push({type:`number`,value:s,pos:a});continue}if(a===`'`||a===`"`){let o=a,s=n;n+=1;let c=``,l=!1;for(;n<r;){let t=e[n];if(t===`\\`){let t=n+1<r?e[n+1]:``;if(t===`\\`||t===`'`||t===`"`){c+=t,n+=2;continue}throw new Qc(`invalid string escape: '\\${t}'`,n)}if(t===o){l=!0,n+=1;break}c+=t,n+=1}if(!l)throw new Qc(`unterminated string literal`,s);t.push({type:`string`,value:c,pos:s});continue}if(al(a)){let a=n;for(;n<r&&ol(e[n]);)n+=1;let o=e.slice(a,n);rl.has(o)?t.push({type:`keyword`,keyword:ll(o),pos:a}):t.push({type:`identifier`,name:o,pos:a});continue}let o=n+1<r?e.slice(n,n+2):``;if(o===`<=`||o===`>=`||o===`==`||o===`!=`||o===`&&`||o===`||`){t.push({type:`punct`,punct:o,pos:n}),n+=2;continue}if(ul(a)){t.push({type:`punct`,punct:a,pos:n}),n+=1;continue}throw new Qc(`unexpected character '${a}'`,n)}return t.push({type:`eof`,pos:r}),t}function ll(e){return e===`true`?`true`:e===`false`?`false`:`null`}function ul(e){return e===`(`||e===`)`||e===`,`||e===`?`||e===`:`||e===`+`||e===`-`||e===`*`||e===`/`||e===`%`||e===`!`||e===`<`||e===`>`}function dl(e,t,n){if(typeof e!=`number`||!Number.isFinite(e))throw new $c(`${t}: argument ${n+1} must be a finite number`);return e}function fl(e,t,n){if(typeof e!=`string`)throw new $c(`${t}: argument ${n+1} must be a string`);return e}function pl(e,t){if(!Number.isFinite(e))throw new $c(`${t}: produced a non-finite result`);return e}function ml(e,t){return e.map((e,n)=>dl(e,t,n))}var hl=1/0,gl={min:{minArgs:1,maxArgs:hl,apply:e=>pl(Math.min(...ml(e,`min`)),`min`)},max:{minArgs:1,maxArgs:hl,apply:e=>pl(Math.max(...ml(e,`max`)),`max`)},abs:{minArgs:1,maxArgs:1,apply:e=>pl(Math.abs(dl(e[0],`abs`,0)),`abs`)},floor:{minArgs:1,maxArgs:1,apply:e=>pl(Math.floor(dl(e[0],`floor`,0)),`floor`)},ceil:{minArgs:1,maxArgs:1,apply:e=>pl(Math.ceil(dl(e[0],`ceil`,0)),`ceil`)},sqrt:{minArgs:1,maxArgs:1,apply:e=>pl(Math.sqrt(dl(e[0],`sqrt`,0)),`sqrt`)},round:{minArgs:1,maxArgs:2,apply:e=>{let t=dl(e[0],`round`,0),n=e.length>1?Math.trunc(dl(e[1],`round`,1)):0;if(n<0||n>100)throw new $c(`round: digits must be between 0 and 100`);let r=10**n;return pl(Math.round(t*r)/r,`round`)}},pow:{minArgs:2,maxArgs:2,apply:e=>pl(dl(e[0],`pow`,0)**dl(e[1],`pow`,1),`pow`)},clamp:{minArgs:3,maxArgs:3,apply:e=>{let t=dl(e[0],`clamp`,0),n=dl(e[1],`clamp`,1),r=dl(e[2],`clamp`,2);if(n>r)throw new $c(`clamp: lower bound is greater than upper bound`);return pl(Math.min(r,Math.max(n,t)),`clamp`)}},avg:{minArgs:1,maxArgs:hl,apply:e=>{let t=ml(e,`avg`);return pl(t.reduce((e,t)=>e+t,0)/t.length,`avg`)}},sum:{minArgs:1,maxArgs:hl,apply:e=>pl(ml(e,`sum`).reduce((e,t)=>e+t,0),`sum`)},coalesce:{minArgs:1,maxArgs:hl,apply:e=>{for(let t of e)if(t!==null)return t;return null}},age:{minArgs:2,maxArgs:2,apply:e=>pl(dl(e[0],`age`,0)-dl(e[1],`age`,1),`age`)},convert:{minArgs:3,maxArgs:3,apply:(e,t)=>{let n=dl(e[0],`convert`,0),r=fl(e[1],`convert`,1).trim(),a=fl(e[2],`convert`,2).trim();if(t.convert){let e=t.convert(n,r,a);if(e===null)throw new $c(`convert: cannot convert '${r}' to '${a}'`);return pl(e,`convert`)}if(r===a)return n;throw new $c(`convert: unit conversion table not installed`)}}};Object.freeze(Object.assign(Object.create(null),gl));var _l=new Set(Object.keys(gl)),vl={"||":1,"&&":2,"==":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function yl(e){return e===`&&`||e===`||`}function bl(e){return e===`+`||e===`-`||e===`*`||e===`/`||e===`%`||e===`==`||e===`!=`||e===`<`||e===`<=`||e===`>`||e===`>=`}var xl=class{tokens;pos=0;nodeCount=0;identifiers=new Set;callees=new Set;constructor(e){this.tokens=e}parse(){let e=this.parseTernary(),t=this.peek();if(t.type!==`eof`)throw new Qc(`unexpected trailing input`,t.pos);return{ast:e,identifiers:this.identifiers,callees:this.callees,nodeCount:this.nodeCount}}peek(){return this.tokens[this.pos]}next(){return this.tokens[this.pos++]}expectPunct(e){let t=this.peek();if(t.type!==`punct`||t.punct!==e)throw new Qc(`expected '${e}'`,t.pos);this.pos+=1}matchPunct(e){let t=this.peek();return t.type===`punct`&&t.punct===e?(this.pos+=1,!0):!1}countNode(){if(this.nodeCount+=1,this.nodeCount>256)throw new Qc(`expression too complex`,this.peek().pos)}parseTernary(){let e=this.parseBinary(1);if(this.matchPunct(`?`)){let t=this.parseTernary();this.expectPunct(`:`);let n=this.parseTernary();return this.countNode(),{kind:`conditional`,test:e,consequent:t,alternate:n}}return e}parseBinary(e){let t=this.parseUnary();for(;;){let n=this.peek();if(n.type!==`punct`)break;let r=vl[n.punct];if(r===void 0||r<e)break;let a=n.punct;this.pos+=1;let o=this.parseBinary(r+1);if(this.countNode(),yl(a))t={kind:`logical`,op:a,left:t,right:o};else if(bl(a))t={kind:`binary`,op:a,left:t,right:o};else throw new Qc(`unexpected operator '${a}'`,n.pos)}return t}parseUnary(){let e=this.peek();if(e.type===`punct`&&(e.punct===`!`||e.punct===`-`)){let t=e.punct;this.pos+=1;let n=this.parseUnary();return this.countNode(),{kind:`unary`,op:t,operand:n}}return this.parsePrimary()}parsePrimary(){let e=this.next();switch(e.type){case`number`:return this.countNode(),{kind:`literal`,value:e.value};case`string`:return this.countNode(),{kind:`literal`,value:e.value};case`keyword`:return this.countNode(),{kind:`literal`,value:e.keyword===`null`?null:e.keyword===`true`};case`identifier`:{let t=this.peek();return t.type===`punct`&&t.punct===`(`?this.parseCall(e.name,e.pos):(this.identifiers.add(e.name),this.countNode(),{kind:`identifier`,name:e.name})}case`punct`:if(e.punct===`(`){let e=this.parseTernary();return this.expectPunct(`)`),e}throw new Qc(`unexpected token '${e.punct}'`,e.pos);case`eof`:throw new Qc(`unexpected end of expression`,e.pos)}}parseCall(e,t){if(!_l.has(e))throw new Qc(`unknown function '${e}'`,t);this.expectPunct(`(`);let n=[];if(!this.matchPunct(`)`))for(;;){if(n.push(this.parseTernary()),n.length>16)throw new Qc(`too many arguments to '${e}'`,t);if(!this.matchPunct(`,`)){this.expectPunct(`)`);break}}return this.callees.add(e),this.countNode(),{kind:`call`,callee:e,args:n}}};function Sl(e){return new xl(cl(e)).parse()}Object.freeze({});var Cl=new Map;function wl(e){let t=Cl.get(e);if(t!==void 0)return Cl.delete(e),Cl.set(e,t),t;let n;try{n={ok:!0,parsed:Sl(e)}}catch(e){n={ok:!1,error:e instanceof Qc?e.message:String(e)}}if(Cl.set(e,n),Cl.size>256){let e=Cl.keys().next().value;e!==void 0&&Cl.delete(e)}return n}function Tl(e){return wl(e)}function El(e){let t=Object.keys(e.bindings);if(t.length>32)return`too many bindings (${t.length} > 32)`;for(let e of t){if(!tl.test(e))return`invalid binding name '${e}'`;if(nl.has(e))return`binding name '${e}' is reserved`;if(_l.has(e))return`binding name '${e}' shadows a builtin function`}let n=Tl(e.expr);if(!n.ok)return n.error;let r=new Set(t);for(let e of n.parsed.identifiers)if(e!==`now`&&!r.has(e))return`expression references unbound identifier '${e}'`;return null}var Dl={Siren:G.Siren,Floodlight:G.Floodlight,Spotlight:G.Spotlight,PirSensor:G.PirSensor,Chime:G.Chime,Autotrack:G.Autotrack,Nightvision:G.Nightvision,PrivacyMask:G.PrivacyMask};Dl.Siren,Dl.Floodlight,Dl.Spotlight,Dl.PirSensor,Dl.Chime,Dl.Autotrack,Dl.Nightvision,Dl.PrivacyMask,js.BatteryOperated,new Set([`devices`,`classes`]);var Ol=B({x:F(),y:F()}),kl=B({kind:U(`rect`),x:F(),y:F(),width:F(),height:F()}),Al=B({kind:U(`polygon`),points:z(Ol)}),jl=B({kind:U(`grid`),gridWidth:F(),gridHeight:F(),cells:z(I())});To(`kind`,[kl,Al,jl,B({kind:U(`line`),points:z(Ol)})]);var Ml=H([`rect`,`polygon`,`grid`,`line`]),Nl=B({min:F(),max:F()}),Pl=B({width:F(),height:F()}),Fl=H([`immediate`,`track-end`,`device-event`,`package-event`]),Il=B({windows:z(B({days:z(F().int().min(0).max(6)).min(1),startMinute:F().int().min(0).max(1439),endMinute:F().int().min(0).max(1439)})).min(1),timezone:P().optional(),invert:I().optional()}),Ll=B({values:z(P().min(1)).min(1),maxDistance:F().int().min(0).max(3).default(1)}),Rl=B({zoneId:P().optional(),className:P().optional(),op:H([`became-occupied`,`became-free`,`>=`,`<=`]).default(`became-occupied`),count:F().int().min(0).default(1),sustainSeconds:F().int().min(0).max(3600).default(15)}),zl=H([`enter`,`exit`,`any`]),Bl=B({ids:z(P().min(1)).min(1),match:H([`any`,`all`]).default(`any`)}),Vl=B({devices:z(F()).optional(),classes:z(P().min(1)).optional(),classesExclude:z(P().min(1)).optional(),minConfidence:F().min(0).max(1).optional(),zones:Bl.optional(),zonesExclude:z(P().min(1)).optional(),crossing:zl.optional(),labelEquals:z(P().min(1)).optional(),identities:z(P().min(1)).optional(),plates:Ll.optional(),identitiesExclude:z(P().min(1)).optional(),minImportance:F().min(0).max(1).optional(),minDwellSeconds:F().min(0).optional(),source:H([`pipeline`,`onboard`,`sensor`,`any`]).optional(),minLabelConfidence:F().min(0).max(1).optional(),eventTypeTokens:z(P().min(1)).optional(),sensorKinds:z(P().min(1)).optional(),packagePhase:H([`delivered`,`picked-up`,`both`]).optional(),customZones:z(Al).optional(),occupancy:Rl.optional()}),Hl=B({targetId:P().min(1),params:V(P(),L()).optional()}),Ul=H([`cropped`,`full`,`boxed`]),Wl=B({attach:H([`best`,`best-matching`,`keyFrame`,`none`]).default(`best`),frame:Ul.optional(),zoneCrop:I().optional(),gif:I().optional(),clip:I().optional(),clipPreRollSec:F().int().min(0).max(30).optional(),clipPostRollSec:F().int().min(0).max(30).optional(),profile:ps.optional()}),Gl=H([`shared`,`per-class`]),Kl=B({cooldownSec:F().int().min(0).max(86400).default(60),scope:H([`rule`,`rule-device`]).default(`rule-device`),granularity:Gl.optional()}),ql=B({name:P().min(1).max(200),enabled:I().default(!0),delivery:Fl,conditions:Vl.default({}),schedule:Il.optional(),targets:z(Hl),targetUsers:z(P()).optional(),media:Wl.default({attach:`best`}),throttle:Kl.default({cooldownSec:60,scope:`rule-device`}),template:B({title:P().max(500).optional(),body:P().max(2e3).optional()}).optional(),priority:F().int().min(1).max(5).default(3),ownerUserId:P().optional()}),Jl=ql.partial().extend({disabledTargetIds:z(P()).optional()}),Yl=ql.extend({id:P(),createdBy:P(),createdAt:F(),updatedAt:F(),disabledTargetIds:z(P()).default([])}),Xl=B({recordId:P(),recordKind:H([`object-event`,`track`,`device-event`,`package-event`]),deviceId:F(),timestamp:F(),wouldFire:I(),failedCondition:P().optional(),className:P().optional(),label:P().optional()}),Zl=B({id:P(),group:H([`scope`,`class`,`zones`,`quality`,`label`,`schedule`,`device`,`package`,`occupancy`]),label:P(),valueType:H([`deviceIdList`,`stringList`,`number01`,`number`,`sourceSelect`,`zoneSelection`,`zoneIdList`,`schedule`,`plateMatcher`,`packagePhase`,`crossingSelect`,`polygonDraw`,`occupancy`]),operator:H([`in`,`notIn`,`anyOf`,`allOf`,`gte`,`fuzzyIn`,`withinSchedule`]),appliesTo:z(Fl),phase:P(),description:P().optional()}),Ql=H([`pending`,`sent`,`dead`]),$l=H([`object-event`,`track-end`,`device-event`,`package-event`]),eu=B({className:P(),label:P().optional(),confidence:F().optional(),zones:z(P()),timestamp:F()}),tu=B({id:P(),ruleId:P(),ruleName:P(),delivery:Fl,targetId:P(),deviceId:F(),recordKind:$l,recordId:P(),trackId:P().optional(),status:Ql,attempts:F().int(),createdAt:F(),updatedAt:F(),error:P().optional(),subject:eu}),nu=B({ruleId:P().optional(),deviceId:F().optional(),status:Ql.optional(),since:F().optional(),until:F().optional(),limit:F().int().min(1).max(500).default(100)}),ru={name:`notification-rules`,scope:`system`,mode:`singleton`,methods:{listRules:K(B({}),B({rules:z(Yl)}),{auth:`admin`}),getRule:K(B({ruleId:P()}),B({rule:Yl.nullable()}),{auth:`admin`}),createRule:K(B({rule:ql}),B({rule:Yl}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateRule:K(B({ruleId:P(),patch:Jl}),B({rule:Yl}),{kind:`mutation`,auth:`admin`,caller:`required`}),deleteRule:K(B({ruleId:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),setRuleEnabled:K(B({ruleId:P(),enabled:I()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),testRule:K(B({rule:ql,lookbackMinutes:F().int().min(1).max(1440).default(60)}),B({results:z(Xl)}),{kind:`mutation`,auth:`admin`}),getConditionCatalog:K(B({}),B({catalog:z(Zl),taxonomy:Yc.optional()})),getHistory:K(B({filter:nu.default({limit:100})}),B({entries:z(tu)}),{auth:`admin`})}},iu=B({title:P().max(500).optional(),body:P().max(2e3).optional()}),au=P().min(1).max(200),ou=z(F()).min(1),su=F().int().min(2).max(3600),cu=F().int().min(1).max(60),lu=z(Hl).min(1),uu=F().int().min(1).max(5),du=B({name:au,enabled:I().default(!0),deviceIds:ou,schedule:Il,cadenceSec:su.default(15),framerate:cu.default(10),targets:lu,template:iu.optional(),priority:uu.default(3)});B({name:au.optional(),enabled:I().optional(),deviceIds:ou.optional(),schedule:Il.optional(),cadenceSec:su.optional(),framerate:cu.optional(),targets:lu.optional(),template:iu.nullable().optional(),priority:uu.optional()}),du.extend({id:P(),ownerUserId:P().optional(),lastGeneratedAt:F().optional(),createdBy:P(),createdAt:F(),updatedAt:F()});var fu=B({online:I(),lastChangedAt:F()}),pu={name:`device-status`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onStatusChanged:{data:B({deviceId:F(),status:fu})}},status:{schema:fu,kind:`push`},runtimeState:fu},mu=B({flags:V(P(),L()),deviceType:P().nullable(),model:P().nullable(),channelCount:F().nullable(),lastProbedAt:F(),lastFetchedAt:F()}),hu={name:`feature-probe`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onProbeChanged:{data:B({deviceId:F(),status:mu})}},status:{schema:mu,kind:`push`},runtimeState:mu},gu=B({co2Ppm:F().min(0).optional(),vocPpb:F().min(0).optional(),pm25:F().min(0).optional(),pm10:F().min(0).optional(),aqi:F().optional(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),_u={name:`air-quality-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:gu,kind:`push`},runtimeState:gu},vu=H([`disarmed`,`armed_home`,`armed_away`,`armed_night`,`armed_vacation`,`armed_custom_bypass`,`arming`,`disarming`,`pending`,`triggered`]),yu=H([`home`,`away`,`night`,`vacation`,`custom_bypass`]),bu=B({state:vu,availableModes:z(yu),requiresCode:I(),lastChangedAt:F()}),xu={name:`alarm-panel`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.AlarmPanel],methods:{arm:K(B({deviceId:F().int().nonnegative(),mode:yu,code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),disarm:K(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),trigger:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:bu,kind:`push`},runtimeState:bu},Su=B({lux:F().min(0),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Cu={name:`ambient-light-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:Su,kind:`push`},runtimeState:Su},wu=B({className:P(),hits:F().int().nonnegative(),avgScore:F().min(0).max(1),peakScore:F().min(0).max(1)}),Tu=B({ts:F().int(),windowSec:F().int().positive(),level:B({rms:F(),dbfs:F()}),peakDbfs:F(),avgDbfs:F(),current:B({className:P(),score:F().min(0).max(1),timestamp:F().int()}).nullable(),byClass:z(wu).readonly()}),Eu=B({points:z(B({ts:F().int(),dbfs:F().nullable(),peakDbfs:F(),avgDbfs:F(),topClass:P().nullable(),topScore:F().min(0).max(1).nullable()})).readonly(),effectiveSampleEveryMs:F().int().positive(),windowMsActual:F().int().nonnegative()}),Du={name:`audio-metrics`,scope:`device`,mode:`singleton`,deviceTypes:[W.Camera],methods:{getCurrentSnapshot:K(B({deviceId:F()}),Tu.nullable()),getHistory:K(B({deviceId:F(),windowSec:F().int().positive().optional(),sampleEveryMs:F().int().positive().optional()}),Eu)},runtimeState:Tu},Ou=B({enabled:I(),isRunning:I(),lastTriggeredAt:F(),lastError:P().nullable(),lastChangedAt:F()}),ku={name:`automation-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Automation],methods:{enable:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),disable:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),trigger:K(B({deviceId:F().int().nonnegative(),skipCondition:I().optional()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Ou,kind:`push`},runtimeState:Ou},Au=B({percentage:F().min(0).max(100),charging:H([`dc`,`solar`,`none`]),sleeping:I(),lastUpdated:F(),binary:I().optional()}),ju={name:`battery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera,W.Sensor,W.Button,W.Switch],methods:{wakeForStream:K(B({deviceId:F(),timeoutMs:F().int().min(500).max(3e4).default(8e3)}),B({awoke:I(),durationMs:F()}),{kind:`mutation`})},events:{onStatusChanged:{data:B({deviceId:F(),status:Au})}},status:{schema:Au,kind:`push`,empty:{percentage:0,charging:`none`,sleeping:!1,lastUpdated:0}},runtimeState:Au},Mu=B({on:I(),lastChangedAt:F()}),Nu={name:`binary`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:Mu,kind:`push`},runtimeState:Mu},Pu=B({percentage:F().min(0).max(100),lastChangedAt:F()}),Fu={name:`brightness`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Light],methods:{setBrightness:K(B({deviceId:F().int().nonnegative(),percentage:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},events:{onBrightnessChanged:{data:B({deviceId:F(),percentage:F().min(0).max(100),lastChangedAt:F()})}},status:{schema:Pu,kind:`command-driven`},runtimeState:Pu},Iu=H([`webrtc`,`hls`,`mjpeg`,`rtsp`]),Lu=B({brokerId:P(),url:P(),mutedUrl:P(),enabled:I(),codec:P().optional(),resolution:B({width:F().int().positive(),height:F().int().positive()}).optional()}),Ru=B({sessionId:P(),remoteAddr:P(),userAgent:P().nullish(),playing:I(),muted:I(),connectedAt:F(),lastRtpAt:F(),bytesSent:F()}),zu=B({tag:P(),subscribedAt:F(),maxFps:F(),framesDelivered:F(),framesDropped:F()}),Bu=B({tag:P(),subscribedAt:F(),chunksDelivered:F()}),Vu=B({kind:H([`alexa`,`homekit`,`webrtc-browser`,`webrtc-mobile`,`webrtc-whep`,`rtsp-listen`,`derived-broker`,`recording`,`pipeline`,`snapshot`,`warmup`,`unknown`]),label:P().optional(),media:H([`audio`,`video`,`both`]).optional(),targetCodec:P().optional(),transport:H([`passthrough`,`repacketize`,`transcode`]).optional(),remoteAddr:P().optional(),userAgent:P().optional(),userId:P().optional(),sessionId:P().optional(),extra:V(P(),P()).optional()}).readonly(),Hu=B({id:P(),channel:H([`annexb`,`rtp`]),attribution:Vu,subscribedAt:F(),packetsDelivered:F()}),Uu=B({rtsp:z(Ru).readonly(),decoded:z(zu).readonly(),audio:z(Bu).readonly(),encoded:z(Hu).readonly(),pipeClients:F(),encodedSubscribers:F()});H([`reconnecting`,`sleeping`,`offline`,`disabled`,`waking`]);var Wu=H([`h264`,`h265`,`copy`]),Gu=H([`aac`,`opus`,`pcmu`,`copy`,`none`]),Ku=B({deviceId:F().int().nonnegative(),video:Wu,audio:Gu.optional(),profile:ps.optional(),targetResolution:B({width:F().int().positive(),height:F().int().positive()}).optional(),outputArgs:z(P()).optional(),audioEgress:I().optional(),hostname:P().optional(),tag:P().optional()}),qu=B({url:P(),videoCodec:H([`H264`,`H265`]),audioCodec:P(),resolution:B({width:F().int().positive(),height:F().int().positive()}),transcoded:I(),encoder:P(),pipelineKey:P()}),Ju={name:`stream-broker`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{publishCameraStream:K(B({deviceId:F().int().nonnegative(),camStreamId:P().min(1),kind:ms,url:P().optional(),codec:P().optional(),resolution:hs.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:V(P(),L()).optional(),sourceCamStreamId:P().min(1).optional(),encodeProfile:Fc.optional()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),retractCameraStream:K(B({deviceId:F().int().nonnegative(),camStreamId:P().min(1)}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),assignProfile:K(B({deviceId:F().int().nonnegative(),profile:ps,camStreamId:P().min(1)}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),unassignProfile:K(B({deviceId:F().int().nonnegative(),profile:ps}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),renderPreBufferClip:K(B({deviceId:F(),profile:ps.optional(),aroundMs:F(),preRollSec:F().min(0).max(20).default(3),postRollSec:F().min(0).max(20).default(5),format:H([`gif`,`mp4`]).default(`gif`),maxWidth:F().int().min(120).max(1920).default(480),fps:F().int().min(1).max(15).default(5)}),B({base64:P(),mime:P(),bytes:F().int(),profile:ps,durationMs:F()}),{kind:`mutation`,auth:`admin`}),listAllCameraStreams:K(R(),z(gs).readonly()),listAllProfileSlots:K(R(),z(vs).readonly()),getBrokerStats:K(B({brokerId:P()}),ks),probeStream:K(B({brokerId:P()}),B({probed:I(),summary:P()}),{kind:`mutation`,auth:`admin`}),listClients:K(B({brokerId:P()}),Uu),killClient:K(B({brokerId:P(),channel:H([`rtsp`,`decoded`,`audio`]),handle:P()}),B({killed:I()}),{kind:`mutation`,auth:`admin`}),restartProfile:K(B({deviceId:F().int().nonnegative(),profile:ps}),B({success:I()}),{kind:`mutation`,auth:`admin`}),getStreamUrl:K(B({streamId:P(),format:Iu}),B({url:P()})),getStreamWithCodec:K(Ku,qu,{kind:`mutation`,auth:`admin`}),releaseStreamWithCodec:K(B({pipelineKey:P()}),B({released:I(),refcount:F().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),subscribeAudioChunks:K(Ds,Os,{kind:`mutation`}),pullAudioChunks:K(B({subscriptionId:P(),maxCount:F().int().positive().default(8)}),z(Es).readonly()),unsubscribeAudioChunks:K(B({subscriptionId:P()}),B({released:I()}),{kind:`mutation`}),subscribeFrames:K(ws,Ts,{kind:`mutation`}),pullFrameHandles:K(B({subscriptionId:P(),maxCount:F().int().positive().default(4)}),z(Ss).readonly()),unsubscribeFrames:K(B({subscriptionId:P()}),B({released:I()}),{kind:`mutation`}),setPreBufferDuration:K(B({brokerId:P(),seconds:F().min(0).max(30)}),R(),{kind:`mutation`,auth:`admin`}),getPreBufferInfo:K(B({brokerId:P()}),B({configuredSec:F(),bufferedMs:F(),packetCount:F()})),getRtspPort:K(R(),F()),getAllRtspEntries:K(B({hostname:P().optional()}),z(Lu).readonly()),getRtspEntry:K(B({brokerId:P(),hostname:P().optional()}),Lu.nullable()),regenerateRtspToken:K(B({brokerId:P()}),P().nullable(),{kind:`mutation`,auth:`admin`}),setRtspEnabled:K(B({brokerId:P(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`}),isRtspEnabled:K(B({brokerId:P()}),I())},events:{onCamStreamDemand:Ps(B({deviceId:F().int().nonnegative(),camStreamId:P(),profile:ps})),onCamStreamIdle:Ps(B({deviceId:F().int().nonnegative(),camStreamId:P()})),onRequestStreamSourceRefresh:Ps(B({deviceId:F().int().nonnegative(),camStreamId:P(),brokerId:P()}))}},Yu=H([`h264`,`h265`,`hevc`,`av1`,`mjpeg`,`vp8`,`vp9`]),Xu=B({acceptCodecs:z(Yu).readonly().optional(),minHeight:F().int().positive().optional(),minWidth:F().int().positive().optional(),excludeDerived:I().optional(),requireSiblingCodec:z(Yu).readonly().optional()}).readonly(),Zu=B({preferredProviders:z(P()).readonly().optional(),resolutionPreference:H([`highest`,`lowest`]).optional()}).readonly(),Qu=B({camStreamId:P(),codec:P().optional(),resolution:hs.optional(),reason:P()}),$u={name:`camera-streams`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[W.Camera],methods:{getCameraStreams:K(B({deviceId:F().int().nonnegative()}),z(gs).readonly()),getBrokerStreams:K(B({deviceId:F().int().nonnegative()}),z(vs).readonly()),getRtspEntries:K(B({deviceId:F().int().nonnegative(),hostname:P().optional()}),z(Lu).readonly()),getProfileRtspEntries:K(B({deviceId:F().int().nonnegative(),hostname:P().optional()}),z(As).readonly()),pickStream:K(B({deviceId:F().int().nonnegative(),requirements:Xu,preferences:Zu.optional()}),Qu.nullable())},events:{onCamStreamsChanged:Ps(B({deviceId:F().int().nonnegative(),camStreams:z(gs).readonly()})),onProfileSlotsChanged:Ps(B({deviceId:F().int().nonnegative(),profileSlots:z(vs).readonly()}))},runtimeState:B({online:I(),slotStatuses:B({high:_s.optional(),mid:_s.optional(),low:_s.optional()}),slotErrors:B({high:P().optional(),mid:P().optional(),low:P().optional()}),lastChangedAt:F()})},ed=B({detected:I(),lastChangedAt:F()}),td={name:`carbon-monoxide`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:ed,kind:`push`},runtimeState:ed},nd=H([`off`,`heat`,`cool`,`auto`,`heat_cool`,`fan_only`,`dry`]),rd=B({mode:nd,availableModes:z(nd),fanMode:P(),availableFanModes:z(P()),preset:P(),availablePresets:z(P()),target:F().nullable(),targetHigh:F().nullable(),targetLow:F().nullable(),targetHumidity:F().min(0).max(100).nullable(),currentTemp:F().nullable(),currentHumidity:F().min(0).max(100).nullable(),swingVertical:I().nullable(),swingHorizontal:I().nullable(),lastFetchedAt:F()}),id={name:`climate-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Thermostat,W.Climate],methods:{setMode:K(B({deviceId:F().int().nonnegative(),mode:nd}),R(),{kind:`mutation`,auth:`admin`}),setFanMode:K(B({deviceId:F().int().nonnegative(),fanMode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setPreset:K(B({deviceId:F().int().nonnegative(),preset:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setTarget:K(B({deviceId:F().int().nonnegative(),target:F()}),R(),{kind:`mutation`,auth:`admin`}),setTargetRange:K(B({deviceId:F().int().nonnegative(),targetLow:F(),targetHigh:F()}),R(),{kind:`mutation`,auth:`admin`}),setTargetHumidity:K(B({deviceId:F().int().nonnegative(),targetHumidity:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setSwingVertical:K(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`}),setSwingHorizontal:K(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:rd,kind:`push`},runtimeState:rd},ad=B({r:F().int().min(0).max(255),g:F().int().min(0).max(255),b:F().int().min(0).max(255)}),od=B({h:F().min(0).max(360),s:F().min(0).max(100),v:F().min(0).max(100)}),sd=To(`mode`,[B({mode:U(`rgb`),rgb:ad}),B({mode:U(`hsv`),hsv:od}),B({mode:U(`mired`),mireds:F().int().min(50).max(1e3)})]),cd=B({mode:H([`rgb`,`hsv`,`mired`]),rgb:ad.optional(),hsv:od.optional(),mireds:F().int().optional(),lastChangedAt:F()}),ld={name:`color`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Light],methods:{setColor:K(B({deviceId:F().int().nonnegative(),color:sd}),R(),{kind:`mutation`,auth:`admin`})},events:{onColorChanged:{data:B({deviceId:F(),mode:H([`rgb`,`hsv`,`mired`]),rgb:ad.optional(),hsv:od.optional(),mireds:F().int().optional(),lastChangedAt:F()})}},status:{schema:cd,kind:`command-driven`},runtimeState:cd},ud=B({connected:I(),lastChangedAt:F()}),dd={name:`connectivity`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:ud,kind:`push`},runtimeState:ud},fd=B({key:P().min(1),label:P().min(1),level:F().min(0).max(100).nullable(),status:H([`ok`,`replace`]).nullable(),lastResetAt:F().nullable(),resettable:I()}),pd=B({items:z(fd),lastChangedAt:F()}),md={name:`consumables`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(W),deviceConfig:{ui:{kind:`widget`,widgetId:`host/consumables-panel`,tab:`consumables`,topTab:!0,label:`Consumables`,order:5}},methods:{reset:K(B({deviceId:F().int().nonnegative(),key:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:pd,kind:`push`,empty:{items:[],lastChangedAt:0},itemArray:{path:`items`,keyField:`key`,labelField:`label`,itemSchema:fd,emptyItem:{key:``,label:``,level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:pd.extend({lastFetchedAt:F()})},hd=B({entryOpen:I(),lastChangedAt:F()}),gd={name:`contact`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:hd,kind:`push`},runtimeState:hd},_d=B({kind:H([`numeric`,`select`,`text`,`datetime`]),value:Co([F(),P()]),options:z(P()),lastChangedAt:F(),unit:P().optional(),min:F().optional(),max:F().optional(),step:F().optional(),precision:F().int().min(0).max(10).optional(),format:H([`date`,`time`,`datetime`]).optional()}),vd=To(`kind`,[B({kind:U(`numeric`),value:F()}),B({kind:U(`select`),value:P().min(1)}),B({kind:U(`text`),value:P()}),B({kind:U(`datetime`),value:P().min(1)})]),yd={name:`control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Control],methods:{setValue:K(B({deviceId:F().int().nonnegative(),control:vd}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:_d,kind:`push`},runtimeState:_d},bd=B({state:H([`open`,`opening`,`closing`,`closed`,`stopped`]),position:F().min(0).max(100).nullable(),tiltPosition:F().min(0).max(100).nullable(),lastChangedAt:F()}),xd={name:`cover`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Cover],methods:{open:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),close:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setPosition:K(B({deviceId:F().int().nonnegative(),position:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setTiltPosition:K(B({deviceId:F().int().nonnegative(),tiltPosition:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:bd,kind:`push`},runtimeState:bd},Sd=H([`auto`,`day`,`night`,`schedule`]),Cd=B({min:F(),max:F(),step:F()}),wd=B({mode:Sd,sensitivity:F().optional(),switchDelaySec:F().optional(),lastFetchedAt:F()}),Td=B({modes:z(Sd),supportsSensitivity:I(),sensitivity:Cd.optional(),supportsSwitchDelay:I(),switchDelaySec:Cd.optional()}),Ed=B({mode:Sd.optional(),sensitivity:F().optional(),switchDelaySec:F().optional()}),Dd={name:`day-night`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`day-night`,tab:`image`}},methods:{getOptions:K(B({deviceId:F()}),Td),setSettings:K(B({deviceId:F(),settings:Ed}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:wd,kind:`poll`},runtimeState:wd},Od=B({id:P(),system:P(),uniqueId:P().optional(),raw:V(P(),L()).optional()}),kd=H([`online`,`sleeping`,`offline`,`unknown`]),Ad=ts(()=>B({childNativeId:P(),name:P(),type:H(W),status:kd,metadata:B({model:P().optional(),serialNumber:P().optional(),uid:P().optional(),rtspChannel:F().int().nonnegative().optional(),isBattery:I().optional(),isDoorbell:I().optional(),isMultifocal:I().optional(),externalLocation:P().optional(),manufacturer:P().optional(),integration:P().optional()}).default({}),alreadyAdopted:I(),adoptedDeviceId:F().int().nonnegative().nullable(),capabilities:z(P()).readonly().optional(),features:z(P()).readonly().optional(),sourceInfo:Od.optional(),children:z(Ad).readonly().optional()})),jd=B({discovered:z(Ad),lastDiscoveryAt:F().int().nonnegative().nullable(),lastError:P().nullable()}),Md={name:`device-discovery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Hub],status:{schema:jd,kind:`poll`},runtimeState:jd.extend({lastFetchedAt:F().int().nonnegative()}),methods:{listDiscovered:K(B({deviceId:F().int().nonnegative()}),z(Ad).readonly()),refreshDiscovery:K(B({deviceId:F().int().nonnegative()}),z(Ad).readonly(),{kind:`mutation`,auth:`admin`}),adoptDevice:K(B({deviceId:F().int().nonnegative(),childNativeId:P(),name:P().optional()}),B({deviceId:F().int().nonnegative(),stableId:P()}),{kind:`mutation`,auth:`admin`}),releaseDevice:K(B({deviceId:F().int().nonnegative(),childDeviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})}},Nd=B({lastPressedAt:F().nullable(),pressCountSinceStart:F()}),Pd=B({deviceId:F(),timestamp:F()}),Fd={name:`doorbell`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!1,deviceTypes:[W.Button,W.Camera],exposesDeviceSettings:!0,methods:{},events:{onPressed:{data:Pd}},status:{schema:Nd,kind:`push`},runtimeState:Nd},Id=H([`date`,`time`,`datetime`]),Ld=B({value:P(),format:Id.optional(),lastFetchedAt:F()}),Rd={name:`enum-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:Ld,kind:`push`},runtimeState:Ld},zd=B({deviceId:F(),eventType:P(),data:V(P(),L()).nullable(),timestamp:F(),seq:F()}),Bd=B({eventTypes:z(P()),lastEvent:zd.nullable(),eventCountSinceStart:F()}),Vd={name:`event-emitter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.EventEmitter],methods:{},events:{onEvent:{data:zd}},status:{schema:Bd,kind:`push`},runtimeState:Bd},Hd=H([`forward`,`reverse`]),Ud=B({percentage:F().min(0).max(100).nullable(),percentageStep:F().positive().optional(),preset:P(),availablePresets:z(P()),direction:Hd.nullable(),oscillating:I().nullable(),lastChangedAt:F()}),Wd={name:`fan-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Fan],methods:{setPercentage:K(B({deviceId:F().int().nonnegative(),percentage:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setPreset:K(B({deviceId:F().int().nonnegative(),preset:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setDirection:K(B({deviceId:F().int().nonnegative(),direction:Hd}),R(),{kind:`mutation`,auth:`admin`}),setOscillating:K(B({deviceId:F().int().nonnegative(),oscillating:I()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Ud,kind:`push`},runtimeState:Ud},Gd=B({flooded:I(),lastChangedAt:F()}),Kd={name:`flood`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:Gd,kind:`push`},runtimeState:Gd},qd=B({detected:I(),lastChangedAt:F()}),Jd={name:`gas`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:qd,kind:`push`},runtimeState:qd},Yd=B({on:I(),currentHumidity:F().min(0).max(100).nullable(),targetHumidity:F().min(0).max(100).nullable(),mode:P().nullable(),availableModes:z(P()),action:P().nullable(),minHumidity:F().nullable(),maxHumidity:F().nullable(),lastChangedAt:F()}),Xd={name:`humidifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Humidifier],methods:{setOn:K(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`}),setTargetHumidity:K(B({deviceId:F().int().nonnegative(),humidity:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setMode:K(B({deviceId:F().int().nonnegative(),mode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Yd,kind:`push`},runtimeState:Yd},Zd=B({percent:F().min(0).max(100),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Qd={name:`humidity-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor,W.Thermostat],methods:{},status:{schema:Zd,kind:`push`},runtimeState:Zd},$d=B({url:P().nullable(),lastUpdated:F().nullable()}),ef={name:`image`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Image],methods:{},status:{schema:$d,kind:`push`},runtimeState:$d},tf=H([`0`,`90`,`180`,`270`]),nf=H([`auto`,`manual`]),rf=H([`auto`,`manual`]),af=H([`off`,`blc`,`wdr`,`hlc`]),of=B({min:F(),max:F(),step:F()}),sf=B({brightness:F().optional(),contrast:F().optional(),saturation:F().optional(),sharpness:F().optional(),mirror:I().optional(),flip:I().optional(),rotate:tf.optional(),whiteBalance:nf.optional(),warmth:F().optional(),exposureMode:rf.optional(),backlightMode:af.optional(),lastFetchedAt:F()}),cf=B({supportsBrightness:I(),brightness:of.optional(),supportsContrast:I(),contrast:of.optional(),supportsSaturation:I(),saturation:of.optional(),supportsSharpness:I(),sharpness:of.optional(),supportsMirror:I(),supportsFlip:I(),rotateOptions:z(tf),whiteBalanceModes:z(nf),supportsWarmth:I(),warmth:of.optional(),exposureModes:z(rf),backlightModes:z(af)}),lf=B({brightness:F().optional(),contrast:F().optional(),saturation:F().optional(),sharpness:F().optional(),mirror:I().optional(),flip:I().optional(),rotate:tf.optional(),whiteBalance:nf.optional(),warmth:F().optional(),exposureMode:rf.optional(),backlightMode:af.optional()}),uf={name:`image-settings`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`image-settings`,tab:`image`}},methods:{getOptions:K(B({deviceId:F()}),cf),setSettings:K(B({deviceId:F(),settings:lf}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:sf,kind:`poll`},runtimeState:sf},df=H([`idle`,`mowing`,`paused`,`docked`,`error`]),ff=H([`info`,`warning`,`error`]),pf=B({activity:df,batteryLevel:F().min(0).max(100).nullable(),progressPercent:F().min(0).max(100).nullable(),currentCode:F().nullable(),currentCodeLabel:P().nullable(),severity:ff,lastChangedAt:F()}),mf={name:`lawn-mower-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.LawnMower],methods:{startMowing:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),dock:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:pf,kind:`push`},runtimeState:pf},hf=B({state:H([`locked`,`unlocked`,`locking`,`unlocking`,`jammed`]),lastChangedAt:F()}),gf={name:`lock-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Lock],methods:{lock:K(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),unlock:K(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),open:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:hf,kind:`push`},runtimeState:hf},_f=H([`off`,`on`,`idle`,`playing`,`paused`,`buffering`,`standby`]),vf=H([`off`,`all`,`one`]),yf=B({type:P(),title:P(),artist:P().optional(),album:P().optional(),imageUrl:P().optional()}),bf=B({state:_f,volumeLevel:F().min(0).max(100).nullable(),isMuted:I().nullable(),source:P(),availableSources:z(P()),currentMedia:yf.nullable(),positionMs:F().int().nonnegative().nullable(),durationMs:F().int().nonnegative().nullable(),shuffle:I().nullable(),repeat:vf.nullable(),lastChangedAt:F()}),xf={name:`media-player`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.MediaPlayer],methods:{play:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),next:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),previous:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),seek:K(B({deviceId:F().int().nonnegative(),positionMs:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setVolume:K(B({deviceId:F().int().nonnegative(),volumeLevel:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setMute:K(B({deviceId:F().int().nonnegative(),muted:I()}),R(),{kind:`mutation`,auth:`admin`}),setShuffle:K(B({deviceId:F().int().nonnegative(),shuffle:I()}),R(),{kind:`mutation`,auth:`admin`}),setRepeat:K(B({deviceId:F().int().nonnegative(),repeat:vf}),R(),{kind:`mutation`,auth:`admin`}),selectSource:K(B({deviceId:F().int().nonnegative(),source:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),playMedia:K(B({deviceId:F().int().nonnegative(),mediaId:P().min(1),mediaType:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:bf,kind:`push`},runtimeState:bf},Sf=H([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),Cf=B({data:rs(),format:Sf,width:F(),height:F(),timestamp:F()}),wf=B({x:F(),y:F(),w:F(),h:F()});B({class:P(),originalClass:P(),score:F(),bbox:wf});var Tf=B({data:os(Uint8Array),sampleRate:F(),channels:F(),timestamp:F(),deviceId:F().optional()}),Ef=B({rms:F(),dbfs:F()}),Df=B({className:P(),originalClass:P().optional(),score:F()}),Of=B({bbox:wf,pixelCount:F(),intensity:F()}),kf=B({detected:I(),regionCount:F(),regions:z(Of).readonly(),rawRegions:z(Of).readonly(),frameWidth:F(),frameHeight:F(),analysisMs:F()}),Af={name:`motion-detection`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,exposesDeviceSettings:!0,methods:{analyze:K(B({deviceId:F(),frame:Cf.optional(),frameHandle:Ss.optional()}),kf,{kind:`mutation`}),removeCamera:K(B({deviceId:F()}),R(),{kind:`mutation`}),reset:K(R(),R(),{kind:`mutation`})},events:{onMotion:{data:B({deviceId:F(),detected:I(),regionCount:F()})}}};B({activeCameras:F(),throttledCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()});var jf=B({detectionMode:H([`disabled`,`always-on`,`on-motion`]),configuredFps:F(),actualFps:F(),queueDepth:F(),avgInferenceTimeMs:F(),droppedFrames:F(),phase:H([`idle`,`watching`,`active`])}),Mf=jf.extend({deviceId:F()}),Nf=B({handle:Ss,cropFrameSpace:B({x:F(),y:F(),w:F(),h:F()})}),Pf=H([`onnx`,`coreml`,`openvino`,`tflite`,`pt`,`gguf`]),Ff=H([`detector`,`cropper`,`classifier`,`refiner`,`audio-classifier`]),If=B({runtime:H([`node`,`python`]),backend:P(),format:Pf,device:P().optional()}),Lf=B({engine:If,devices:z(B({id:P(),label:P(),description:P().optional()})).readonly(),defaultDevice:P()}),Rf=ts(()=>B({addonId:P(),addonName:P(),slot:Ff,inputClasses:z(P()).readonly(),outputClasses:z(P()).readonly(),enabled:I(),modelId:P(),children:z(Rf).readonly(),group:P().optional(),settings:V(P(),L()).optional()})),zf=ts(()=>B({addonId:P(),enabled:I(),modelId:P(),children:z(zf).readonly(),settings:V(P(),L()).optional()})),Bf=B({id:P(),name:P(),createdAt:P(),updatedAt:P(),engine:If,steps:z(zf).readonly()}),Vf=B({id:P(),name:P(),formats:V(P(),B({downloaded:I(),sizeMB:F()})),group:ac.optional(),legacy:I().optional()}),Hf=rs(),Uf=B({id:P(),name:P(),slot:Ff,inputClasses:z(P()).readonly(),outputClasses:z(P()).readonly(),childSlots:z(Ff).readonly(),models:z(Vf).readonly(),defaultModelId:P(),defaultModelIdByFormat:V(P(),P()).optional(),enabledByDefault:I().optional(),backfillIntoExistingOverrides:I().optional(),defaultConfidence:F(),group:P().optional(),configSchema:z(Hf).readonly().optional()}),Wf=B({id:Ff,label:P(),priority:F(),parentSlot:Ff.nullable(),addons:z(Uf).readonly()}),Gf=B({availableEngines:z(Lf).readonly(),selectedEngine:If,slots:z(Wf).readonly()}),Kf=B({runtimeId:H([`onnx`,`openvino`,`coreml`,`edgetpu`]).nullable(),device:P().nullable(),state:H([`idle`,`installing`,`verifying`,`ready`,`failed`]),progress:F().optional(),error:P().optional(),nextRetryAt:F().optional(),configIssues:z(P()).optional()}),qf=ts(()=>B({addonId:P(),modelId:P().optional(),enabled:I().default(!0),children:z(qf).optional(),settings:V(P(),L()).optional(),jumpDeviceKey:P().optional()})),Jf=B({addonId:P(),chosen:P(),running:P(),format:P()}),Yf=B({addonId:P(),kind:H([`unknown-addon`,`no-format-build`]),detail:P()}),Xf=B({ok:I(),issues:z(Yf).readonly(),substitutions:z(Jf).readonly(),format:P()}),Zf=B({filename:P(),stepIds:z(P()).readonly().optional()}),Qf=B({base64:P(),filename:P()}),$f=B({filename:P(),sizeKb:F()}),ep=B({base64:P()}),tp=B({id:P(),name:P(),description:P(),available:I(),rawLabels:z(P()).readonly().optional()}),np=B({activeBackend:P(),availableBackends:z(tp).readonly(),sampleRate:F(),chunkDurationMs:F()}),rp=B({filePath:P(),sizeMB:F(),durationMs:F()}),ip=B({success:I(),error:P().optional(),frame:rs().optional()}),ap=rs(),op=rs(),sp=rs(),cp=rs(),lp=rs(),up=rs(),dp={name:`pipeline-executor`,scope:`system`,mode:`singleton`,methods:{getAvailableEngines:K(R(),z(If)),getSelectedEngine:K(R(),If),getDefaultSteps:K(If,z(Rf)),getEngineProvisioning:K(B({nodeId:P()}),Kf),getVideoPipelineSteps:K(R(),V(P(),B({modelId:P(),settings:V(P(),L()).readonly()}))),setVideoPipelineSteps:K(B({steps:V(P(),B({modelId:P(),settings:V(P(),L()).readonly()}))}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),clearDeviceOverrides:K(B({nodeId:P()}),B({success:U(!0),clearedDevices:F()}),{kind:`mutation`,auth:`admin`}),getSchema:K(R(),Gf),getGlobalSteps:K(R(),z(Rf).readonly().nullable()),getGlobalPipelineConfig:K(R(),ap),getOrchestratorConfigSchema:K(R(),op),validatePipeline:K(B({steps:z(qf)}),Xf),listTemplates:K(R(),z(Bf).readonly()),saveTemplate:K(B({name:P(),steps:z(zf).readonly(),engine:If}),Bf,{kind:`mutation`}),updateTemplate:K(B({id:P(),name:P().optional(),steps:z(zf).readonly().optional()}),Bf,{kind:`mutation`}),deleteTemplate:K(B({id:P()}),R(),{kind:`mutation`}),getCapabilities:K(R(),cp),getAddonModels:K(B({addonId:P()}),lp),downloadModel:K(B({addonId:P(),modelId:P(),format:Pf}),rp,{kind:`mutation`}),deleteModel:K(B({addonId:P(),modelId:P(),format:Pf}),B({success:U(!0)}),{kind:`mutation`}),runPipeline:K(B({engine:If.optional(),steps:z(qf).min(1),frame:Cf.optional(),frameHandle:Ss.optional(),imageBase64:P().optional(),image:os(Uint8Array).optional(),referenceImage:P().optional(),deviceId:F().optional(),sessionId:P().optional(),plane:H([`full`,`frame`]).optional(),deviceKey:P().optional(),nativeCropRef:Nf.optional()}),up,{kind:`mutation`}),runPipelineBatch:K(B({engine:If.optional(),steps:z(qf).min(1),frames:z(Cf).min(1).max(255),deviceId:F().optional(),sessionId:P().optional(),frameId:F().int().nonnegative().optional(),deviceKey:P().optional()}),B({results:z(up).readonly()}),{kind:`mutation`}),cacheFrameInPool:K(B({data:os(Uint8Array),width:F().int().positive(),height:F().int().positive(),format:H([`rgb`,`bgr`,`gray`])}),B({frameId:F(),width:F(),height:F()}),{kind:`mutation`}),inferCached:K(B({stepId:P(),frameId:F().int()}),V(P(),L()),{kind:`mutation`}),uncacheFrame:K(B({frameId:F().int()}),R(),{kind:`mutation`}),getEffectiveTuning:K(R(),B({batchMode:P(),windowMs:F(),maxBatchSize:F(),concurrency:F()})),listLoadedEngines:K(R(),z(B({engineKey:P(),engine:If,modelsLoaded:z(P()).readonly(),inUseByCameras:z(F()).readonly(),kind:H([`runtime`,`warm-override`,`device-pool`]),poolPid:F().nullable(),idleMs:F().nullable(),idleTtlMs:F().nullable()})).readonly()),spinEngine:K(B({engine:If}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),killEngine:K(B({engine:If,force:I().optional()}),B({success:I(),reason:P().optional()}),{kind:`mutation`,auth:`admin`}),listReferenceImages:K(R(),z(Zf).readonly()),getReferenceImage:K(B({filename:P()}),Qf.nullable()),getReferenceAudioFiles:K(R(),z($f).readonly()),getReferenceAudio:K(B({filename:P()}),ep.nullable()),getAudioCapabilities:K(R(),np),runAudioTest:K(B({addonId:P(),modelId:P(),filename:P().optional(),settings:V(P(),L()).optional()}),ip,{kind:`mutation`}),getDetectionConfigSchema:K(R(),sp)}},fp=H([`polygon`,`tripwire`]),pp=B({x:F(),y:F()}),mp=B({id:P(),name:P(),kind:fp.default(`polygon`),polygon:z(pp).readonly(),color:P().default(`#3b82f6`)}),hp={name:`zones`,scope:`device`,mode:`singleton`,deviceTypes:[W.Camera],methods:{listZones:K(B({deviceId:F()}),z(mp).readonly()),addZone:K(B({deviceId:F(),zone:mp}),R(),{kind:`mutation`,auth:`admin`}),removeZone:K(B({deviceId:F(),zoneId:P()}),R(),{kind:`mutation`,auth:`admin`}),updateZone:K(B({deviceId:F(),zone:mp}),R(),{kind:`mutation`,auth:`admin`})},runtimeState:B({zones:z(mp).readonly()})},gp=B({x:F(),y:F(),w:F(),h:F()}),_p=B({bytes:os(Uint8Array).optional(),jpeg:P().optional(),width:F().int().positive(),height:F().int().positive(),tier:H([`native`,`ram-fullframe`]).optional()}),vp=B({bbox:gp,className:P()}),yp=B({stepId:P(),className:P(),score:F(),bbox:gp.optional(),embedding:P().optional(),label:P().optional(),alignedCropJpeg:P().optional(),nativeFaceShortSidePx:F().optional()}),bp={min:0,max:6e4,default:3e4,step:500},xp={min:0,max:6e5,default:12e4,step:5e3},Sp={min:1,max:30,default:4,step:1},Cp={min:1,max:30,default:10,step:1},wp={min:0,max:300,default:30,step:5},Tp={min:1,max:10,default:4,step:1},Ep=H([`onboard`,`analyzer`]),Dp=z(Ep),Op=B({deviceId:F(),detected:I(),source:Ep.default(`analyzer`),regions:z(Of).readonly().optional()}),kp=To(`kind`,[B({kind:U(`local-broker`)}),B({kind:U(`remote-restream`),ownerNodeId:P(),ownerReachableHost:P().optional(),hubHostnameOverride:P().optional()})]).describe(`Per-camera frame-source mode for the runner (P2c)`),Ap=B({deviceKey:P(),weight:F().positive().default(1),maxSessions:F().int().positive().nullable().default(null)}),jp=B({deviceId:F(),detectionMode:H([`disabled`,`always-on`,`on-motion`]).default(`on-motion`),audioMode:H([`disabled`,`always-on`,`on-motion`]).default(`always-on`),motionCooldownMs:F().min(bp.min).default(bp.default),maxSessionHoldMs:F().min(xp.min).max(xp.max).optional(),motionFps:F().min(Sp.min).max(Sp.max).default(Sp.default),detectionFps:F().min(Cp.min).max(Cp.max).default(Cp.default),motionStreamId:P(),detectionStreamId:P(),motionSources:Dp.default([`analyzer`]),pipelineEnabled:I().default(!0),steps:z(qf).readonly().optional(),audio:B({modelId:P().optional(),enabled:I()}).nullable().optional(),zones:z(mp).readonly().default([]),onboardMotionDrivesAnalyzer:I().default(!0),occupancyRecheckEnabled:I().default(!1),occupancyRecheckSec:F().min(wp.min).max(wp.max).default(wp.default),occupancyRecheckFrames:F().min(Tp.min).max(Tp.max).default(Tp.default),frameSource:kp.default({kind:`local-broker`}),deviceKey:P().optional(),inferenceDevices:z(Ap).readonly().optional()});Sp.min,Sp.max,Sp.step,Sp.default,Cp.min,Cp.max,Cp.step,Cp.default,bp.min,bp.max,bp.step,bp.default,xp.min,xp.max,xp.step,xp.default,wp.min,wp.max,wp.step,wp.default,Tp.min,Tp.max,Tp.step,Tp.default;var Mp=B({nodeId:P(),attachedCameras:F(),activeCameras:F(),avgInferenceFps:F(),avgInferenceTimeMs:F(),queueDepthTotal:F(),devices:z(B({deviceKey:P(),backend:P(),attachedCameras:F(),queueDepthTotal:F()})).default([]),hardware:B({hasGpu:I(),inferenceBackend:P().optional(),cpuCores:F().optional()})}),Np=B({nodeId:P(),activeCameras:F(),throttledCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()}),Pp={name:`pipeline-runner`,scope:`system`,mode:`singleton`,methods:{attachCamera:K(jp,B({success:U(!0)}),{kind:`mutation`}),detachCamera:K(B({deviceId:F()}),B({success:U(!0)}),{kind:`mutation`}),reportMotion:K(Op,B({success:U(!0)}),{kind:`mutation`}),getLocalLoad:K(R(),Mp),getLocalMetrics:K(R(),Np),getCameraMetrics:K(B({deviceId:F()}),jf.nullable()),getAllCameraMetrics:K(R(),z(Mf).readonly()),getLocalCameras:K(R(),z(F()).readonly()),getNativeCrop:K(B({handle:Ss,bbox:gp,maxWidth:F().int().positive().optional(),encodeJpeg:I().optional()}),_p.nullable()),runDetailSubtree:K(B({deviceId:F(),frameHandle:Ss.optional(),cropJpeg:P().optional(),parent:vp,steps:z(P()).optional()}),B({details:z(yp)}).nullable(),{kind:`mutation`})}},Fp=B({detected:I(),lastDetectedAt:F().nullable(),autoClearAfterMs:F().nullable()}),Ip=B({deviceId:F(),detected:I(),timestamp:F(),source:Ep,regions:z(Of).readonly().optional()}),Lp={name:`motion`,scope:`device`,mode:`singleton`,deviceNative:!0,deviceTypes:[W.Camera,W.Sensor],methods:{isDetected:K(B({deviceId:F()}),I())},events:{onMotionChanged:{data:Ip}},status:{schema:Fp,kind:`push`},runtimeState:Fp},Rp=B({enabled:I(),lastChangedAt:F()}),zp=Rp.extend({lastFetchedAt:F()}),Bp={name:`motion-trigger`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Light,W.Siren,W.Switch],methods:{setMotionTrigger:K(B({deviceId:F().int().nonnegative(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onMotionTriggerChanged:{data:B({deviceId:F(),enabled:I(),lastChangedAt:F()})}},status:{schema:Rp,kind:`command-driven`},runtimeState:zp},Vp=B({id:F(),enabled:I(),shape:jl}),Hp=B({enabled:I(),sensitivity:F(),regions:z(Vp),lastFetchedAt:F()}),Up=B({maxRegions:F(),supportedShapes:z(Ml),grid:Pl,sensitivity:B({min:F(),max:F(),step:F()})}),Wp=B({enabled:I().optional(),sensitivity:F().optional(),regions:z(Vp).optional()}),Gp={name:`motion-zones`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/motion-zones-grid`,tab:`motion`,label:`Motion Zones`}},methods:{getOptions:K(B({deviceId:F()}),Up),setZone:K(B({deviceId:F(),patch:Wp}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Hp,kind:`poll`},runtimeState:Hp},Kp=H([`person`,`vehicle`,`animal`,`face`,`package`,`other`]),qp=B({class:Kp,timestamp:F(),confidence:F().min(0).max(1).optional()}),Jp=B({lastByClass:jo(Kp,qp.nullable()),supportedClasses:z(Kp).readonly(),enabled:I()}),Yp=Jp.extend({lastFetchedAt:F()}),Xp={name:`native-object-detection`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],methods:{setEnabled:K(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onDetected:{data:B({deviceId:F(),detection:qp})}},status:{schema:Jp,kind:`push`},runtimeState:Yp},Zp=H([`min`,`low`,`normal`,`high`]),Qp=B({id:P().min(1),title:P().min(1),uri:Ha().optional(),destructive:I().optional()}),$p=B({image:I(),priority:I(),data:I(),actions:I(),recipients:I()}),em=B({lastSentAt:F(),lastError:P().nullable(),queueDepth:F().int().nonnegative(),supports:$p}),tm=B({deviceId:F().int().nonnegative(),title:P().optional(),body:P().min(1),image:P().optional(),priority:Zp.optional(),channel:P().optional(),recipients:z(P()).optional(),actions:z(Qp).optional(),data:V(P(),L()).optional()}),nm=B({notificationId:P(),acceptedAt:F()}),rm={name:`notifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Notifier],methods:{send:K(tm,nm,{kind:`mutation`,auth:`admin`}),cancel:K(B({deviceId:F().int().nonnegative(),notificationId:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},events:{onSent:{data:B({deviceId:F(),notificationId:P(),success:I(),error:P().nullable(),acceptedAt:F()})}},status:{schema:em,kind:`command-driven`},runtimeState:em},im=B({value:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional(),lastFetchedAt:F()}),am={name:`numeric-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:im,kind:`push`},runtimeState:im},om=H([`normal`,`offline`,`on_batteries`]),sm=F().int().min(4).max(200),cm=B({foodLevel:F().nullable(),food1:F().nullable(),food2:F().nullable(),lowFood:I(),batteryPower:F().min(0).max(100).nullable(),desiccantLeftDays:F().nullable(),feeding:I(),status:om.nullable(),error:P().nullable(),errorCode:F().nullable(),isDualHopper:I(),childLock:I(),indicatorLight:I(),feedSound:I(),volume:F(),lastFetchedAt:F()}),lm={name:`pet-feeder`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.PetFeeder],methods:{feed:K(B({deviceId:F().int().nonnegative(),grams:sm.optional(),hopper1:sm.optional(),hopper2:sm.optional()}),R(),{kind:`mutation`,auth:`admin`}),cancelFeed:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),resetDesiccant:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),markFoodReplenished:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),callPet:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),playSound:K(B({deviceId:F().int().nonnegative(),soundId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setChildLock:K(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`}),setIndicatorLight:K(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`}),setFeedSound:K(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`}),setVolume:K(B({deviceId:F().int().nonnegative(),level:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:cm,kind:`poll`},runtimeState:cm},um=B({watts:F().optional(),kwhTotal:F().optional(),volts:F().optional(),amps:F().optional(),va:F().optional(),powerFactor:F().min(0).max(1).optional(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),dm={name:`power-meter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:um,kind:`push`},runtimeState:um},fm=B({latitude:F().min(-90).max(90),longitude:F().min(-180).max(180),accuracyMeters:F().nonnegative()}),pm=B({state:P(),location:P().nullable(),gps:fm.nullable(),batteryPercent:F().min(0).max(100).nullable(),lastChangedAt:F()}),mm={name:`presence`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Presence],methods:{},status:{schema:pm,kind:`push`},runtimeState:pm},hm=B({hpa:F(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),gm={name:`pressure-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:hm,kind:`push`},runtimeState:hm},_m=To(`kind`,[kl,Al]),vm=B({id:F(),enabled:I(),shape:_m}),ym=B({enabled:I(),regions:z(vm),lastFetchedAt:F()}),bm=B({maxRegions:F(),supportedShapes:z(Ml),polygonVertices:Nl.optional()}),xm=B({enabled:I().optional(),regions:z(vm).optional()}),Sm={name:`privacy-mask`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/privacy-mask-grid`,tab:`image`,label:`Privacy Mask`}},methods:{getOptions:K(B({deviceId:F()}),bm),setMask:K(B({deviceId:F(),patch:xm}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:ym,kind:`poll`},runtimeState:ym},Cm=B({targetType:P().describe(`Vendor target string (people/vehicle/pet); empty = camera default`),stopDelaySeconds:F().int().min(0).max(300),disappearDelaySeconds:F().int().min(0).max(300)}),wm=B({value:P(),label:P()}),Tm=B({enabled:I(),lastChangedAt:F(),currentSettings:Cm.nullable(),supportedTargetTypes:z(wm)}),Em=Tm.extend({lastFetchedAt:F()}),Dm={name:`ptz-autotrack`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-autotrack`,tab:`ptz`,topTab:!0,label:`Auto-Tracking`,order:5}},methods:{getStatus:K(B({deviceId:F()}),Tm),setEnabled:K(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`}),getSettings:K(B({deviceId:F()}),Cm.nullable()),setSettings:K(B({deviceId:F(),settings:Cm.partial()}),R(),{kind:`mutation`})},events:{onStatusChanged:{data:B({deviceId:F(),status:Tm})}},status:{schema:Tm,kind:`command-driven`},runtimeState:Em},Om=P(),km=B({embedding:z(F()),modelId:P(),condition:Om,capturedAt:F(),thumbnailMediaId:P().optional()}),Am=B({id:P(),label:P(),references:z(km),textPrompts:z(P()).optional(),referenceCount:F(),currentlyMatched:I()}),jm=To(`mode`,[B({mode:U(`similarity`),threshold:F().min(0).max(1),hysteresisCount:F().int().positive()}),B({mode:U(`llm`),prompt:P(),profileId:P().optional(),hysteresisCount:F().int().positive()})]),Mm=B({id:P(),label:P(),roi:kl,enabled:I(),triggerMode:H([`periodic`,`on-motion`,`both`]),checkIntervalSec:F().optional(),check:jm,states:z(Am),currentStateId:P().nullable(),lastCheckedAt:F().nullable(),lastConfidence:F().nullable(),currentCondition:Om.nullable(),availability:H([`ok`,`unavailable`]),unavailableReason:P().nullable()}),Nm=B({monitors:z(Mm),lastFetchedAt:F()}),Pm={name:`scene-monitor`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[W.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/scene-monitor-editor`,tab:`scenes`,label:`Scenes`}},methods:{listScenes:K(B({deviceId:F()}),Nm),createScene:K(B({deviceId:F(),label:P(),roi:kl,check:jm,triggerMode:H([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:F().optional()}),Mm,{kind:`mutation`,auth:`admin`}),updateScene:K(B({deviceId:F(),monitorId:P(),patch:B({label:P().optional(),roi:kl.optional(),enabled:I().optional(),triggerMode:H([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:F().optional(),check:jm.optional()})}),R(),{kind:`mutation`,auth:`admin`}),deleteScene:K(B({deviceId:F(),monitorId:P()}),R(),{kind:`mutation`,auth:`admin`}),captureReference:K(B({deviceId:F(),monitorId:P(),stateId:P().optional(),label:P().optional(),condition:Om.optional()}),B({stateId:P(),referenceCount:F()}),{kind:`mutation`,auth:`admin`}),deleteReference:K(B({deviceId:F(),monitorId:P(),stateId:P(),index:F()}),R(),{kind:`mutation`,auth:`admin`}),recheckNow:K(B({deviceId:F(),monitorId:P()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Nm,kind:`push`},runtimeState:Nm},Fm=B({isRunning:I(),lastRunAt:F(),lastRunSuccess:I().nullable(),lastError:P().nullable(),lastChangedAt:F()}),Im={name:`script-runner`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Script],methods:{run:K(B({deviceId:F().int().nonnegative(),variables:V(P(),L()).optional()}),R(),{kind:`mutation`,auth:`admin`}),stop:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Fm,kind:`push`},runtimeState:Fm},Lm=B({detected:I(),lastChangedAt:F()}),Rm={name:`smoke`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:Lm,kind:`push`},runtimeState:Lm},zm=H([`main`,`sub`,`ext`]),Bm=B({width:F(),height:F(),codec:H([`h264`,`h265`]),framerate:F(),bitrate:F(),bitrateMode:H([`vbr`,`cbr`]).optional(),encoderProfile:H([`high`,`main`,`baseline`]).optional(),gop:F().optional(),audio:I().optional()}),Vm=B({main:Bm.optional(),sub:Bm.optional(),ext:Bm.optional(),lastFetchedAt:F()}),Hm=B({resolutions:z(B({width:F(),height:F()})),codecs:z(H([`h264`,`h265`])),framerates:z(F()),bitrates:z(F()),bitrateRange:ko([F(),F()]).optional(),supportsBitrateMode:I(),supportsEncoderProfile:I(),supportsGop:I(),gop:B({min:F(),max:F(),step:F()}).optional()}),Um=B({main:Hm.optional(),sub:Hm.optional(),ext:Hm.optional()}),Wm=B({width:F().optional(),height:F().optional(),codec:H([`h264`,`h265`]).optional(),framerate:F().optional(),bitrate:F().optional(),bitrateMode:H([`vbr`,`cbr`]).optional(),encoderProfile:H([`high`,`main`,`baseline`]).optional(),gop:F().optional(),audio:I().optional()}),Gm={name:`stream-params`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`stream-params`,tab:`streaming`}},methods:{getOptions:K(B({deviceId:F()}),Um),setProfile:K(B({deviceId:F(),profile:zm,patch:Wm}),R(),{kind:`mutation`,auth:`admin`}),getConfigSchema:K(B({deviceId:F()}),L().nullable())},status:{schema:Vm,kind:`poll`},runtimeState:Vm},Km=B({on:I(),lastChangedAt:F()}),qm={name:`switch`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Switch,W.Siren,W.Light],methods:{setState:K(B({deviceId:F(),on:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onStateChanged:{data:B({deviceId:F(),on:I(),lastChangedAt:F()})}},status:{schema:Km,kind:`command-driven`},runtimeState:Km,settings:{bindings:[{kind:`scalar`,statusPath:`on`,method:`setState`,valueArg:`on`,field:{label:`On`,kind:`boolean`}}]}},Jm=B({tampered:I(),lastChangedAt:F()}),Ym={name:`tamper`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:Jm,kind:`push`},runtimeState:Jm},Xm=B({celsius:F(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Zm={name:`temperature-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor,W.Thermostat],methods:{},status:{schema:Xm,kind:`push`},runtimeState:Xm},Qm=B({currentVersion:P().nullable(),availableVersion:P().nullable(),updatable:I(),state:P().nullable(),inProgress:I()}),$m={name:`update`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Update],methods:{installUpdate:K(R(),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Qm,kind:`poll`},runtimeState:Qm},eh=H([`idle`,`cleaning`,`paused`,`returning`,`docked`,`drying`,`error`]),th=B({level:F().min(0).max(100).nullable(),status:H([`ok`,`low`,`full`]).nullable()}),nh=B({state:eh,batteryLevel:F().min(0).max(100).nullable(),fanSpeed:P().nullable(),availableFanSpeeds:z(P()),cleanWater:th.nullable(),dirtyWater:th.nullable(),detergent:th.nullable(),dustBin:th.nullable(),progressPercent:F().min(0).max(100).nullable(),errorCode:F().nullable(),errorLabel:P().nullable(),lastChangedAt:F()}),rh={name:`vacuum-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Vacuum],methods:{start:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),returnToBase:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),locate:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setFanSpeed:K(B({deviceId:F().int().nonnegative(),speed:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:nh,kind:`push`},runtimeState:nh},ih=B({state:H([`open`,`opening`,`closing`,`closed`,`stopped`]),position:F().min(0).max(100).nullable(),lastChangedAt:F()}),ah={name:`valve`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Valve],methods:{open:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),close:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setPosition:K(B({deviceId:F().int().nonnegative(),position:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:ih,kind:`push`},runtimeState:ih},oh=B({detected:I(),lastChangedAt:F()}),sh={name:`vibration`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Sensor],methods:{},status:{schema:oh,kind:`push`},runtimeState:oh},ch=B({currentTemp:F().nullable(),targetTemp:F().nullable(),operationMode:P().nullable(),availableModes:z(P()),away:I().nullable(),minTemp:F().nullable(),maxTemp:F().nullable(),lastChangedAt:F()}),lh={name:`water-heater`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.WaterHeater],methods:{setTargetTemp:K(B({deviceId:F().int().nonnegative(),temp:F().finite()}),R(),{kind:`mutation`,auth:`admin`}),setOperationMode:K(B({deviceId:F().int().nonnegative(),mode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setAway:K(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:ch,kind:`push`},runtimeState:ch},uh=B({condition:P().nullable(),temperature:F().nullable(),temperatureUnit:P().nullable(),humidity:F().min(0).max(100).nullable(),pressure:F().nullable(),pressureUnit:P().nullable(),windSpeed:F().nullable(),windSpeedUnit:P().nullable(),windBearing:F().nullable(),lastFetchedAt:F()}),dh={name:`weather`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Weather],methods:{},status:{schema:uh,kind:`push`},runtimeState:uh},fh=B({totalObjects:F().int().nonnegative(),byClass:V(P(),F().int().nonnegative())}),ph=fh.extend({zoneId:P(),zoneName:P(),trackIds:z(P()).readonly()}),mh=B({id:P(),className:P(),bbox:B({x:F(),y:F(),w:F(),h:F()}),frameWidth:F().int().nonnegative(),frameHeight:F().int().nonnegative(),firstSeenAt:F().int(),becameStationaryAt:F().int(),lastConfirmedAt:F().int(),label:P().optional(),keyFrameMediaKey:P().optional()}),hh=B({ts:F().int(),frameWidth:F().int().nonnegative(),frameHeight:F().int().nonnegative(),zones:z(ph).readonly(),frame:fh,unzoned:fh,stationaryObjects:z(mh).readonly().optional()}),gh=H([`minute`,`5min`,`hour`]),_h=B({from:F().int(),to:F().int(),resolution:gh}),vh=B({ts:F().int(),count:F().int().nonnegative()}),yh={name:`zone-analytics`,scope:`device`,mode:`singleton`,deviceTypes:[W.Camera],methods:{getCurrentSnapshot:K(B({deviceId:F()}),hh.nullable()),getZoneHistory:K(B({deviceId:F(),zoneId:P(),className:P().optional()}).extend(_h.shape),z(vh).readonly()),getCameraHistory:K(B({deviceId:F(),className:P().optional()}).extend(_h.shape),z(vh).readonly()),getUnzonedHistory:K(B({deviceId:F(),className:P().optional()}).extend(_h.shape),z(vh).readonly())},runtimeState:hh},bh=H([`include`,`exclude`]),xh=B({id:P(),name:P().optional(),zoneIds:z(P()).min(1).readonly(),mode:bh,classFilter:z(P()).readonly().optional(),overlapThreshold:F().min(0).max(1).optional(),bboxInclusionPct:F().min(0).max(100).optional(),preferMask:I().optional(),enabled:I().default(!0)});z(xh).readonly();var Sh=H([`motion`,`detection`,`package`]),Ch={name:`zone-rules`,scope:`device`,mode:`singleton`,deviceTypes:[W.Camera],methods:{listRules:K(B({deviceId:F(),stage:Sh}),z(xh).readonly()),setRules:K(B({deviceId:F(),stage:Sh,rules:z(xh).readonly()}),R(),{kind:`mutation`,auth:`admin`})},runtimeState:B({motion:z(xh).readonly(),detection:z(xh).readonly(),package:z(xh).readonly()})},wh={"°C":{dimension:`temperature`,factor:1,offset:0},"°F":{dimension:`temperature`,factor:5/9,offset:-160/9},K:{dimension:`temperature`,factor:1,offset:-273.15},hPa:{dimension:`pressure`,factor:1,offset:0},kPa:{dimension:`pressure`,factor:10,offset:0},Pa:{dimension:`pressure`,factor:.01,offset:0},mbar:{dimension:`pressure`,factor:1,offset:0},bar:{dimension:`pressure`,factor:1e3,offset:0},inHg:{dimension:`pressure`,factor:33.8639,offset:0},mmHg:{dimension:`pressure`,factor:1.33322,offset:0},psi:{dimension:`pressure`,factor:68.9476,offset:0},"m/s":{dimension:`speed`,factor:1,offset:0},"km/h":{dimension:`speed`,factor:1/3.6,offset:0},mph:{dimension:`speed`,factor:.44704,offset:0},kn:{dimension:`speed`,factor:.514444,offset:0},"mm/h":{dimension:`precipitation-rate`,factor:1,offset:0},"in/h":{dimension:`precipitation-rate`,factor:25.4,offset:0},m:{dimension:`length`,factor:1,offset:0},mm:{dimension:`length`,factor:.001,offset:0},cm:{dimension:`length`,factor:.01,offset:0},km:{dimension:`length`,factor:1e3,offset:0},in:{dimension:`length`,factor:.0254,offset:0},ft:{dimension:`length`,factor:.3048,offset:0},mi:{dimension:`length`,factor:1609.344,offset:0},lx:{dimension:`illuminance`,factor:1,offset:0},"W/m²":{dimension:`irradiance`,factor:1,offset:0},W:{dimension:`power`,factor:1,offset:0},kW:{dimension:`power`,factor:1e3,offset:0},VA:{dimension:`apparent-power`,factor:1,offset:0},Wh:{dimension:`energy`,factor:1,offset:0},kWh:{dimension:`energy`,factor:1e3,offset:0},MWh:{dimension:`energy`,factor:1e6,offset:0},V:{dimension:`voltage`,factor:1,offset:0},mV:{dimension:`voltage`,factor:.001,offset:0},A:{dimension:`current`,factor:1,offset:0},mA:{dimension:`current`,factor:.001,offset:0},ppm:{dimension:`concentration-volume`,factor:1,offset:0},ppb:{dimension:`concentration-volume`,factor:.001,offset:0},"µg/m³":{dimension:`concentration-mass`,factor:1,offset:0},"mg/m³":{dimension:`concentration-mass`,factor:1e3,offset:0},kg:{dimension:`mass`,factor:1,offset:0},g:{dimension:`mass`,factor:.001,offset:0},lb:{dimension:`mass`,factor:.453592,offset:0},oz:{dimension:`mass`,factor:.0283495,offset:0},"%":{dimension:`percentage`,factor:1,offset:0}};function Th(e){return Object.hasOwn(wh,e)?wh[e]:void 0}function Eh(e){return Th(e)?.dimension}function Dh(e,t){return e*t.factor+t.offset}function Oh(e,t){return(e-t.offset)/t.factor}function kh(e,t,n){if(t===n)return e;let r=Th(t);if(!r)return;let a=Th(n);if(a&&r.dimension===a.dimension)return Oh(Dh(e,r),a)}function Ah(e,t){if(e===t)return!0;let n=Eh(e);return n===void 0?!1:n===Eh(t)}var jh=B({connected:I(),deviceCount:F(),error:P().optional()});B({externalId:P(),name:P(),type:P(),metadata:V(P(),L()).optional()});var Mh=B({stableId:P(),type:H(W),suggestedName:P(),prefilledConfig:V(P(),L()),sourceInfo:Od.optional()}),Nh=B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),parentDeviceId:F().nullable(),online:I(),features:z(P()),config:V(P(),L()),sourceInfo:Od.optional()}),Ph=B({status:H([`ok`,`error`]),labels:z(P()).optional(),error:P().optional()}),Fh=L(),Ih={name:`device-provider`,scope:`system`,mode:`collection`,methods:{start:K(R(),R(),{kind:`mutation`}),stop:K(R(),R(),{kind:`mutation`}),getStatus:K(R(),jh),getDevices:K(R(),z(B({id:P(),name:P(),type:P()}))),supportsDiscovery:K(B({}),I()),discoverDevices:K(B({params:V(P(),L()).optional()}),z(Mh),{kind:`mutation`,auth:`admin`}),getDiscoveryParamsSchema:K(B({}),Fh),getManualCreationType:K(B({}),B({deviceType:H(W).nullable()})),adoptDiscoveredDevice:K(B({candidate:Mh}),Nh,{kind:`mutation`,auth:`admin`}),supportsManualCreation:K(B({}),I()),getChildCreationSchema:K(B({type:H(W)}),Fh),createDevice:K(B({type:H(W),config:V(P(),L())}),Nh,{kind:`mutation`,auth:`admin`}),testCreationField:K(B({type:H(W),key:P(),value:L(),formValues:V(P(),L()).optional()}),Ph,{kind:`mutation`,auth:`admin`})}},Lh={[W.Cover]:`cover`,[W.Valve]:`valve`,[W.Humidifier]:`humidifier`,[W.WaterHeater]:`water-heater`,[W.Camera]:`dummy`,[W.Hub]:`dummy`,[W.Switch]:`switch`,[W.Siren]:`switch`,[W.Light]:`light`,[W.Fan]:`fan`,[W.Sensor]:`sensor`,[W.Thermostat]:`thermostat`,[W.Climate]:`climate`,[W.Button]:`button`,[W.EventEmitter]:`dummy`,[W.Update]:`update`,[W.Generic]:`dummy`,[W.Notifier]:`dummy`,[W.Script]:`dummy`,[W.Automation]:`dummy`,[W.Lock]:`lock`,[W.MediaPlayer]:`media-player`,[W.AlarmPanel]:`alarm`,[W.Control]:`control`,[W.Presence]:`sensor`,[W.Weather]:`weather`,[W.Vacuum]:`vacuum`,[W.LawnMower]:`lawn-mower`,[W.Container]:`dummy`,[W.Image]:`image`,[W.PetFeeder]:`pet-feeder`};new Set(Object.values(W));function Rh(e){let t=e;function n(e,n,r,a,o){let s=t[e]?.[n];if(!s)throw Error(`SystemProxy: api has no '${e}.${n}'`);let c=s;return r===`mutation`?c.mutate(a):r===`subscription`?c.subscribe(a,o):c.query(a)}return{addonPages:{listPages:e=>n(`addonPages`,`listPages`,`query`,e)},addons:{list:e=>n(`addons`,`list`,`query`,e),getLogs:e=>n(`addons`,`getLogs`,`query`,e),listPackages:e=>n(`addons`,`listPackages`,`query`,e),installPackage:e=>n(`addons`,`installPackage`,`mutation`,e),installFromWorkspace:e=>n(`addons`,`installFromWorkspace`,`mutation`,e),isWorkspaceAvailable:e=>n(`addons`,`isWorkspaceAvailable`,`query`,e),listWorkspacePackages:e=>n(`addons`,`listWorkspacePackages`,`query`,e),uninstallPackage:e=>n(`addons`,`uninstallPackage`,`mutation`,e),reloadPackages:e=>n(`addons`,`reloadPackages`,`mutation`,e),searchAvailable:e=>n(`addons`,`searchAvailable`,`query`,e),listUpdates:e=>n(`addons`,`listUpdates`,`query`,e),updatePackage:e=>n(`addons`,`updatePackage`,`mutation`,e),rollbackPackage:e=>n(`addons`,`rollbackPackage`,`mutation`,e),forceRefresh:e=>n(`addons`,`forceRefresh`,`mutation`,e),restartServer:e=>n(`addons`,`restartServer`,`mutation`,e),getLastRestart:e=>n(`addons`,`getLastRestart`,`query`,e),listFrameworkPackages:e=>n(`addons`,`listFrameworkPackages`,`query`,e),listCapabilityProviders:e=>n(`addons`,`listCapabilityProviders`,`query`,e),setCapabilityProviderEnabled:e=>n(`addons`,`setCapabilityProviderEnabled`,`mutation`,e),getVersions:e=>n(`addons`,`getVersions`,`query`,e),restartAddon:e=>n(`addons`,`restartAddon`,`mutation`,e),retryLoad:e=>n(`addons`,`retryLoad`,`mutation`,e),getAutoUpdateSettings:e=>n(`addons`,`getAutoUpdateSettings`,`query`,e),setAutoUpdateSettings:e=>n(`addons`,`setAutoUpdateSettings`,`mutation`,e),getAddonAutoUpdate:e=>n(`addons`,`getAddonAutoUpdate`,`query`,e),setAddonAutoUpdate:e=>n(`addons`,`setAddonAutoUpdate`,`mutation`,e),applyAutoUpdateToAll:e=>n(`addons`,`applyAutoUpdateToAll`,`mutation`,e),custom:e=>n(`addons`,`custom`,`mutation`,e),startJob:e=>n(`addons`,`startJob`,`mutation`,e),getJob:e=>n(`addons`,`getJob`,`query`,e),listJobs:e=>n(`addons`,`listJobs`,`query`,e),cancelJob:e=>n(`addons`,`cancelJob`,`mutation`,e),onAddonLogs:(e,t)=>n(`addons`,`onAddonLogs`,`subscription`,e,t)},addonSettings:{getGlobalSettings:e=>n(`addonSettings`,`getGlobalSettings`,`query`,e),updateGlobalSettings:e=>n(`addonSettings`,`updateGlobalSettings`,`mutation`,e)},addonWidgets:{listWidgets:e=>n(`addonWidgets`,`listWidgets`,`query`,e)},alerts:{emit:e=>n(`alerts`,`emit`,`mutation`,e),update:e=>n(`alerts`,`update`,`mutation`,e),list:e=>n(`alerts`,`list`,`query`,e),getUnreadCount:e=>n(`alerts`,`getUnreadCount`,`query`,e),markRead:e=>n(`alerts`,`markRead`,`mutation`,e),markAllRead:e=>n(`alerts`,`markAllRead`,`mutation`,e),dismiss:e=>n(`alerts`,`dismiss`,`mutation`,e)},audioAnalyzer:{analyseChunk:e=>n(`audioAnalyzer`,`analyseChunk`,`mutation`,e),classify:e=>n(`audioAnalyzer`,`classify`,`query`,e),isReady:e=>n(`audioAnalyzer`,`isReady`,`query`,e),dispose:e=>n(`audioAnalyzer`,`dispose`,`mutation`,e),reprobeAudioEngine:e=>n(`audioAnalyzer`,`reprobeAudioEngine`,`mutation`,e)},audioCodec:{listSupportedCodecs:e=>n(`audioCodec`,`listSupportedCodecs`,`query`,e),canHandle:e=>n(`audioCodec`,`canHandle`,`query`,e),createDecodeSession:e=>n(`audioCodec`,`createDecodeSession`,`mutation`,e),createEncodeSession:e=>n(`audioCodec`,`createEncodeSession`,`mutation`,e),closeSession:e=>n(`audioCodec`,`closeSession`,`mutation`,e),pushEncodedFrame:e=>n(`audioCodec`,`pushEncodedFrame`,`mutation`,e),pullPcm:e=>n(`audioCodec`,`pullPcm`,`query`,e),pushPcm:e=>n(`audioCodec`,`pushPcm`,`mutation`,e),pullEncoded:e=>n(`audioCodec`,`pullEncoded`,`query`,e),flushEncode:e=>n(`audioCodec`,`flushEncode`,`mutation`,e),listActiveSessions:e=>n(`audioCodec`,`listActiveSessions`,`query`,e)},backup:{listDestinations:e=>n(`backup`,`listDestinations`,`query`,e),trigger:e=>n(`backup`,`trigger`,`mutation`,e),list:e=>n(`backup`,`list`,`query`,e),listLocations:e=>n(`backup`,`listLocations`,`query`,e),getEntries:e=>n(`backup`,`getEntries`,`query`,e),restore:e=>n(`backup`,`restore`,`mutation`,e),delete:e=>n(`backup`,`delete`,`mutation`,e),listArchives:e=>n(`backup`,`listArchives`,`query`,e),upsertDestinationPolicy:e=>n(`backup`,`upsertDestinationPolicy`,`mutation`,e),previewSchedule:e=>n(`backup`,`previewSchedule`,`query`,e),listSchedules:e=>n(`backup`,`listSchedules`,`query`,e),upsertSchedule:e=>n(`backup`,`upsertSchedule`,`mutation`,e),deleteSchedule:e=>n(`backup`,`deleteSchedule`,`mutation`,e)},broker:{list:e=>n(`broker`,`list`,`query`,e),get:e=>n(`broker`,`get`,`query`,e),listProviders:e=>n(`broker`,`listProviders`,`query`,e),add:e=>n(`broker`,`add`,`mutation`,e),remove:e=>n(`broker`,`remove`,`mutation`,e),testConnection:e=>n(`broker`,`testConnection`,`mutation`,e),getSettings:e=>n(`broker`,`getSettings`,`query`,e),setSettings:e=>n(`broker`,`setSettings`,`mutation`,e),getBrokerConfig:e=>n(`broker`,`getBrokerConfig`,`query`,e),getSettingsSchema:e=>n(`broker`,`getSettingsSchema`,`query`,e),testSettings:e=>n(`broker`,`testSettings`,`mutation`,e),publish:e=>n(`broker`,`publish`,`mutation`,e),subscribe:e=>n(`broker`,`subscribe`,`mutation`,e),unsubscribe:e=>n(`broker`,`unsubscribe`,`mutation`,e),getState:e=>n(`broker`,`getState`,`query`,e),getStatus:e=>n(`broker`,`getStatus`,`query`,e)},decoder:{supportsCodec:e=>n(`decoder`,`supportsCodec`,`query`,e),getInfo:e=>n(`decoder`,`getInfo`,`query`,e),createSession:e=>n(`decoder`,`createSession`,`query`,e),destroySession:e=>n(`decoder`,`destroySession`,`query`,e),pushPacket:e=>n(`decoder`,`pushPacket`,`query`,e),openStream:e=>n(`decoder`,`openStream`,`query`,e),pullFrames:e=>n(`decoder`,`pullFrames`,`query`,e),pullHandles:e=>n(`decoder`,`pullHandles`,`query`,e),getFrame:e=>n(`decoder`,`getFrame`,`query`,e),getShmStats:e=>n(`decoder`,`getShmStats`,`query`,e),updateConfig:e=>n(`decoder`,`updateConfig`,`query`,e),getStats:e=>n(`decoder`,`getStats`,`query`,e),listActiveSessions:e=>n(`decoder`,`listActiveSessions`,`query`,e),reprobeHwaccel:e=>n(`decoder`,`reprobeHwaccel`,`mutation`,e)},deviceAdoption:{listCandidateFilters:e=>n(`deviceAdoption`,`listCandidateFilters`,`query`,e),listCandidates:e=>n(`deviceAdoption`,`listCandidates`,`query`,e),getCandidate:e=>n(`deviceAdoption`,`getCandidate`,`query`,e),refresh:e=>n(`deviceAdoption`,`refresh`,`mutation`,e),adopt:e=>n(`deviceAdoption`,`adopt`,`mutation`,e),release:e=>n(`deviceAdoption`,`release`,`mutation`,e),resync:e=>n(`deviceAdoption`,`resync`,`mutation`,e)},deviceExport:{getStatus:e=>n(`deviceExport`,`getStatus`,`query`,e),listSupportedDeviceKinds:e=>n(`deviceExport`,`listSupportedDeviceKinds`,`query`,e),listExposedDevices:e=>n(`deviceExport`,`listExposedDevices`,`query`,e),exposeDevice:e=>n(`deviceExport`,`exposeDevice`,`mutation`,e),unexposeDevice:e=>n(`deviceExport`,`unexposeDevice`,`mutation`,e)},deviceManager:{allocateDeviceId:e=>n(`deviceManager`,`allocateDeviceId`,`mutation`,e),registerDevice:e=>n(`deviceManager`,`registerDevice`,`mutation`,e),removeDevice:e=>n(`deviceManager`,`removeDevice`,`mutation`,e),persistConfig:e=>n(`deviceManager`,`persistConfig`,`mutation`,e),getRoleDisplayDefaults:e=>n(`deviceManager`,`getRoleDisplayDefaults`,`query`,e),setRoleDisplayDefaults:e=>n(`deviceManager`,`setRoleDisplayDefaults`,`mutation`,e),listLocations:e=>n(`deviceManager`,`listLocations`,`query`,e),addLocation:e=>n(`deviceManager`,`addLocation`,`mutation`,e),removeLocation:e=>n(`deviceManager`,`removeLocation`,`mutation`,e),listPersistedByAddon:e=>n(`deviceManager`,`listPersistedByAddon`,`query`,e),listAll:e=>n(`deviceManager`,`listAll`,`query`,e),getChildren:e=>n(`deviceManager`,`getChildren`,`query`,e),removeByIntegration:e=>n(`deviceManager`,`removeByIntegration`,`mutation`,e),listWrappersForCap:e=>n(`deviceManager`,`listWrappersForCap`,`query`,e),listBindableCapsForDeviceType:e=>n(`deviceManager`,`listBindableCapsForDeviceType`,`query`,e),discoverDevices:e=>n(`deviceManager`,`discoverDevices`,`mutation`,e),adoptDevice:e=>n(`deviceManager`,`adoptDevice`,`mutation`,e),getCreationSchema:e=>n(`deviceManager`,`getCreationSchema`,`query`,e),createDevice:e=>n(`deviceManager`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceManager`,`testCreationField`,`mutation`,e),adoptionListCandidateFilters:e=>n(`deviceManager`,`adoptionListCandidateFilters`,`query`,e),adoptionListCandidates:e=>n(`deviceManager`,`adoptionListCandidates`,`query`,e),adoptionRefresh:e=>n(`deviceManager`,`adoptionRefresh`,`mutation`,e),adoptionAdopt:e=>n(`deviceManager`,`adoptionAdopt`,`mutation`,e),adoptionRelease:e=>n(`deviceManager`,`adoptionRelease`,`mutation`,e),adoptionResync:e=>n(`deviceManager`,`adoptionResync`,`mutation`,e),discoveryProviders:e=>n(`deviceManager`,`discoveryProviders`,`query`,e),discoverAllProviders:e=>n(`deviceManager`,`discoverAllProviders`,`mutation`,e),discoverProvider:e=>n(`deviceManager`,`discoverProvider`,`mutation`,e),providerCreationType:e=>n(`deviceManager`,`providerCreationType`,`query`,e),providerDiscoveryParamsSchema:e=>n(`deviceManager`,`providerDiscoveryParamsSchema`,`query`,e),getDeviceStatusAggregateBatch:e=>n(`deviceManager`,`getDeviceStatusAggregateBatch`,`query`,e)},deviceProvider:{start:e=>n(`deviceProvider`,`start`,`mutation`,e),stop:e=>n(`deviceProvider`,`stop`,`mutation`,e),getStatus:e=>n(`deviceProvider`,`getStatus`,`query`,e),getDevices:e=>n(`deviceProvider`,`getDevices`,`query`,e),supportsDiscovery:e=>n(`deviceProvider`,`supportsDiscovery`,`query`,e),discoverDevices:e=>n(`deviceProvider`,`discoverDevices`,`mutation`,e),getDiscoveryParamsSchema:e=>n(`deviceProvider`,`getDiscoveryParamsSchema`,`query`,e),getManualCreationType:e=>n(`deviceProvider`,`getManualCreationType`,`query`,e),adoptDiscoveredDevice:e=>n(`deviceProvider`,`adoptDiscoveredDevice`,`mutation`,e),supportsManualCreation:e=>n(`deviceProvider`,`supportsManualCreation`,`query`,e),getChildCreationSchema:e=>n(`deviceProvider`,`getChildCreationSchema`,`query`,e),createDevice:e=>n(`deviceProvider`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceProvider`,`testCreationField`,`mutation`,e)},deviceState:{getAllSnapshots:e=>n(`deviceState`,`getAllSnapshots`,`query`,e)},faceGallery:{listIdentities:e=>n(`faceGallery`,`listIdentities`,`query`,e),createIdentity:e=>n(`faceGallery`,`createIdentity`,`mutation`,e),renameIdentity:e=>n(`faceGallery`,`renameIdentity`,`mutation`,e),deleteIdentity:e=>n(`faceGallery`,`deleteIdentity`,`mutation`,e),listIdentitySamples:e=>n(`faceGallery`,`listIdentitySamples`,`query`,e),removeSample:e=>n(`faceGallery`,`removeSample`,`mutation`,e),listRecentFaces:e=>n(`faceGallery`,`listRecentFaces`,`query`,e),getFaceMedia:e=>n(`faceGallery`,`getFaceMedia`,`query`,e),assignFace:e=>n(`faceGallery`,`assignFace`,`mutation`,e),unassignFace:e=>n(`faceGallery`,`unassignFace`,`mutation`,e),deleteFace:e=>n(`faceGallery`,`deleteFace`,`mutation`,e),assignFaces:e=>n(`faceGallery`,`assignFaces`,`mutation`,e),unassignFaces:e=>n(`faceGallery`,`unassignFaces`,`mutation`,e),suggestFaceClusters:e=>n(`faceGallery`,`suggestFaceClusters`,`query`,e)},integrations:{list:e=>n(`integrations`,`list`,`query`,e),get:e=>n(`integrations`,`get`,`query`,e),getByAddonId:e=>n(`integrations`,`getByAddonId`,`query`,e),create:e=>n(`integrations`,`create`,`mutation`,e),update:e=>n(`integrations`,`update`,`mutation`,e),delete:e=>n(`integrations`,`delete`,`mutation`,e),getSettings:e=>n(`integrations`,`getSettings`,`query`,e),setSettings:e=>n(`integrations`,`setSettings`,`mutation`,e),getAvailableTypes:e=>n(`integrations`,`getAvailableTypes`,`query`,e),testConnection:e=>n(`integrations`,`testConnection`,`mutation`,e)},llm:{generate:e=>n(`llm`,`generate`,`mutation`,e),generateVision:e=>n(`llm`,`generateVision`,`mutation`,e),listProfileKinds:e=>n(`llm`,`listProfileKinds`,`query`,e),listProfiles:e=>n(`llm`,`listProfiles`,`query`,e),upsertProfile:e=>n(`llm`,`upsertProfile`,`mutation`,e),deleteProfile:e=>n(`llm`,`deleteProfile`,`mutation`,e),testProfile:e=>n(`llm`,`testProfile`,`mutation`,e),listModels:e=>n(`llm`,`listModels`,`query`,e),getDefaults:e=>n(`llm`,`getDefaults`,`query`,e),setDefault:e=>n(`llm`,`setDefault`,`mutation`,e),getUsage:e=>n(`llm`,`getUsage`,`query`,e),listModelCatalog:e=>n(`llm`,`listModelCatalog`,`query`,e),listRuntimeNodes:e=>n(`llm`,`listRuntimeNodes`,`query`,e),listNodeModels:e=>n(`llm`,`listNodeModels`,`query`,e),installModel:e=>n(`llm`,`installModel`,`mutation`,e),deleteModel:e=>n(`llm`,`deleteModel`,`mutation`,e),getRuntimeStatus:e=>n(`llm`,`getRuntimeStatus`,`query`,e),startRuntime:e=>n(`llm`,`startRuntime`,`mutation`,e),stopRuntime:e=>n(`llm`,`stopRuntime`,`mutation`,e)},localNetwork:{list:e=>n(`localNetwork`,`list`,`query`,e),getPreferred:e=>n(`localNetwork`,`getPreferred`,`query`,e),getConnectionEndpoints:e=>n(`localNetwork`,`getConnectionEndpoints`,`query`,e),getNotificationEndpoint:e=>n(`localNetwork`,`getNotificationEndpoint`,`query`,e),setNotificationEndpoint:e=>n(`localNetwork`,`setNotificationEndpoint`,`mutation`,e),getAllowedAddresses:e=>n(`localNetwork`,`getAllowedAddresses`,`query`,e),setAllowedAddresses:e=>n(`localNetwork`,`setAllowedAddresses`,`mutation`,e),resetAllowlistToBestMatch:e=>n(`localNetwork`,`resetAllowlistToBestMatch`,`mutation`,e)},meshNetwork:{getStatus:e=>n(`meshNetwork`,`getStatus`,`query`,e),join:e=>n(`meshNetwork`,`join`,`mutation`,e),startLogin:e=>n(`meshNetwork`,`startLogin`,`mutation`,e),leave:e=>n(`meshNetwork`,`leave`,`mutation`,e),logout:e=>n(`meshNetwork`,`logout`,`mutation`,e),listPeers:e=>n(`meshNetwork`,`listPeers`,`query`,e),testConnection:e=>n(`meshNetwork`,`testConnection`,`mutation`,e)},metricsProvider:{collectSnapshot:e=>n(`metricsProvider`,`collectSnapshot`,`query`,e),getCached:e=>n(`metricsProvider`,`getCached`,`query`,e),getCurrent:e=>n(`metricsProvider`,`getCurrent`,`query`,e),getDiskSpace:e=>n(`metricsProvider`,`getDiskSpace`,`query`,e),getGpuInfo:e=>n(`metricsProvider`,`getGpuInfo`,`query`,e),getCpuTemperature:e=>n(`metricsProvider`,`getCpuTemperature`,`query`,e),getProcessStats:e=>n(`metricsProvider`,`getProcessStats`,`query`,e),listAddonInstances:e=>n(`metricsProvider`,`listAddonInstances`,`query`,e),getAddonStats:e=>n(`metricsProvider`,`getAddonStats`,`query`,e),listNodeProcesses:e=>n(`metricsProvider`,`listNodeProcesses`,`query`,e),killProcess:e=>n(`metricsProvider`,`killProcess`,`mutation`,e),dumpHeapSnapshot:e=>n(`metricsProvider`,`dumpHeapSnapshot`,`mutation`,e)},mqttBroker:{listBrokers:e=>n(`mqttBroker`,`listBrokers`,`query`,e),getBrokerConfig:e=>n(`mqttBroker`,`getBrokerConfig`,`query`,e),addBroker:e=>n(`mqttBroker`,`addBroker`,`mutation`,e),removeBroker:e=>n(`mqttBroker`,`removeBroker`,`mutation`,e),testConnection:e=>n(`mqttBroker`,`testConnection`,`mutation`,e),startEmbeddedBroker:e=>n(`mqttBroker`,`startEmbeddedBroker`,`mutation`,e),stopEmbeddedBroker:e=>n(`mqttBroker`,`stopEmbeddedBroker`,`mutation`,e),getStatus:e=>n(`mqttBroker`,`getStatus`,`query`,e)},networkAccess:{start:e=>n(`networkAccess`,`start`,`mutation`,e),stop:e=>n(`networkAccess`,`stop`,`mutation`,e),getEndpoint:e=>n(`networkAccess`,`getEndpoint`,`query`,e),getStatus:e=>n(`networkAccess`,`getStatus`,`query`,e),listEndpoints:e=>n(`networkAccess`,`listEndpoints`,`query`,e)},networkQuality:{getAllStats:e=>n(`networkQuality`,`getAllStats`,`query`,e)},nodes:{topology:e=>n(`nodes`,`topology`,`query`,e),deployAddon:e=>n(`nodes`,`deployAddon`,`mutation`,e),undeployAddon:e=>n(`nodes`,`undeployAddon`,`mutation`,e),restartAddon:e=>n(`nodes`,`restartAddon`,`mutation`,e),restartProcess:e=>n(`nodes`,`restartProcess`,`mutation`,e),restartNode:e=>n(`nodes`,`restartNode`,`mutation`,e),shutdownNode:e=>n(`nodes`,`shutdownNode`,`mutation`,e),renameNode:e=>n(`nodes`,`renameNode`,`mutation`,e),clusterAddonStatus:e=>n(`nodes`,`clusterAddonStatus`,`query`,e),getCapUsageGraph:e=>n(`nodes`,`getCapUsageGraph`,`query`,e),getNodeAddons:e=>n(`nodes`,`getNodeAddons`,`query`,e),setProcessLogLevel:e=>n(`nodes`,`setProcessLogLevel`,`mutation`,e),executeQuery:e=>n(`nodes`,`executeQuery`,`mutation`,e)},notificationOutput:{listTargetKinds:e=>n(`notificationOutput`,`listTargetKinds`,`query`,e),listTargets:e=>n(`notificationOutput`,`listTargets`,`query`,e),discoverTargets:e=>n(`notificationOutput`,`discoverTargets`,`query`,e),send:e=>n(`notificationOutput`,`send`,`mutation`,e),testTarget:e=>n(`notificationOutput`,`testTarget`,`mutation`,e),upsertTarget:e=>n(`notificationOutput`,`upsertTarget`,`mutation`,e),deleteTarget:e=>n(`notificationOutput`,`deleteTarget`,`mutation`,e),setTargetEnabled:e=>n(`notificationOutput`,`setTargetEnabled`,`mutation`,e)},notificationRules:{listRules:e=>n(`notificationRules`,`listRules`,`query`,e),getRule:e=>n(`notificationRules`,`getRule`,`query`,e),createRule:e=>n(`notificationRules`,`createRule`,`mutation`,e),updateRule:e=>n(`notificationRules`,`updateRule`,`mutation`,e),deleteRule:e=>n(`notificationRules`,`deleteRule`,`mutation`,e),setRuleEnabled:e=>n(`notificationRules`,`setRuleEnabled`,`mutation`,e),testRule:e=>n(`notificationRules`,`testRule`,`mutation`,e),getConditionCatalog:e=>n(`notificationRules`,`getConditionCatalog`,`query`,e),getHistory:e=>n(`notificationRules`,`getHistory`,`query`,e)},pipelineExecutor:{getAvailableEngines:e=>n(`pipelineExecutor`,`getAvailableEngines`,`query`,e),getSelectedEngine:e=>n(`pipelineExecutor`,`getSelectedEngine`,`query`,e),getDefaultSteps:e=>n(`pipelineExecutor`,`getDefaultSteps`,`query`,e),getEngineProvisioning:e=>n(`pipelineExecutor`,`getEngineProvisioning`,`query`,e),getVideoPipelineSteps:e=>n(`pipelineExecutor`,`getVideoPipelineSteps`,`query`,e),setVideoPipelineSteps:e=>n(`pipelineExecutor`,`setVideoPipelineSteps`,`mutation`,e),clearDeviceOverrides:e=>n(`pipelineExecutor`,`clearDeviceOverrides`,`mutation`,e),getSchema:e=>n(`pipelineExecutor`,`getSchema`,`query`,e),getGlobalSteps:e=>n(`pipelineExecutor`,`getGlobalSteps`,`query`,e),getGlobalPipelineConfig:e=>n(`pipelineExecutor`,`getGlobalPipelineConfig`,`query`,e),getOrchestratorConfigSchema:e=>n(`pipelineExecutor`,`getOrchestratorConfigSchema`,`query`,e),validatePipeline:e=>n(`pipelineExecutor`,`validatePipeline`,`query`,e),listTemplates:e=>n(`pipelineExecutor`,`listTemplates`,`query`,e),saveTemplate:e=>n(`pipelineExecutor`,`saveTemplate`,`mutation`,e),updateTemplate:e=>n(`pipelineExecutor`,`updateTemplate`,`mutation`,e),deleteTemplate:e=>n(`pipelineExecutor`,`deleteTemplate`,`mutation`,e),getCapabilities:e=>n(`pipelineExecutor`,`getCapabilities`,`query`,e),getAddonModels:e=>n(`pipelineExecutor`,`getAddonModels`,`query`,e),downloadModel:e=>n(`pipelineExecutor`,`downloadModel`,`mutation`,e),deleteModel:e=>n(`pipelineExecutor`,`deleteModel`,`mutation`,e),cacheFrameInPool:e=>n(`pipelineExecutor`,`cacheFrameInPool`,`mutation`,e),inferCached:e=>n(`pipelineExecutor`,`inferCached`,`mutation`,e),uncacheFrame:e=>n(`pipelineExecutor`,`uncacheFrame`,`mutation`,e),getEffectiveTuning:e=>n(`pipelineExecutor`,`getEffectiveTuning`,`query`,e),listLoadedEngines:e=>n(`pipelineExecutor`,`listLoadedEngines`,`query`,e),spinEngine:e=>n(`pipelineExecutor`,`spinEngine`,`mutation`,e),killEngine:e=>n(`pipelineExecutor`,`killEngine`,`mutation`,e),listReferenceImages:e=>n(`pipelineExecutor`,`listReferenceImages`,`query`,e),getReferenceImage:e=>n(`pipelineExecutor`,`getReferenceImage`,`query`,e),getReferenceAudioFiles:e=>n(`pipelineExecutor`,`getReferenceAudioFiles`,`query`,e),getReferenceAudio:e=>n(`pipelineExecutor`,`getReferenceAudio`,`query`,e),getAudioCapabilities:e=>n(`pipelineExecutor`,`getAudioCapabilities`,`query`,e),runAudioTest:e=>n(`pipelineExecutor`,`runAudioTest`,`mutation`,e),getDetectionConfigSchema:e=>n(`pipelineExecutor`,`getDetectionConfigSchema`,`query`,e)},pipelineOrchestrator:{rebalance:e=>n(`pipelineOrchestrator`,`rebalance`,`mutation`,e),getPipelineAssignments:e=>n(`pipelineOrchestrator`,`getPipelineAssignments`,`query`,e),getAgentLoad:e=>n(`pipelineOrchestrator`,`getAgentLoad`,`query`,e),getGlobalMetrics:e=>n(`pipelineOrchestrator`,`getGlobalMetrics`,`query`,e),getCapabilityBindings:e=>n(`pipelineOrchestrator`,`getCapabilityBindings`,`query`,e),setCapabilityBinding:e=>n(`pipelineOrchestrator`,`setCapabilityBinding`,`mutation`,e),getIngestOwner:e=>n(`pipelineOrchestrator`,`getIngestOwner`,`query`,e),getAudioNodeLoad:e=>n(`pipelineOrchestrator`,`getAudioNodeLoad`,`query`,e),getAgentSettings:e=>n(`pipelineOrchestrator`,`getAgentSettings`,`query`,e),listAgentSettings:e=>n(`pipelineOrchestrator`,`listAgentSettings`,`query`,e),removeAgentSettings:e=>n(`pipelineOrchestrator`,`removeAgentSettings`,`mutation`,e),setAgentMaxCameras:e=>n(`pipelineOrchestrator`,`setAgentMaxCameras`,`mutation`,e),setAgentDetectWeight:e=>n(`pipelineOrchestrator`,`setAgentDetectWeight`,`mutation`,e),setAgentCapabilities:e=>n(`pipelineOrchestrator`,`setAgentCapabilities`,`mutation`,e),setAgentReachableHost:e=>n(`pipelineOrchestrator`,`setAgentReachableHost`,`mutation`,e),setAgentInferenceDevices:e=>n(`pipelineOrchestrator`,`setAgentInferenceDevices`,`mutation`,e),getNodeInferenceDevices:e=>n(`pipelineOrchestrator`,`getNodeInferenceDevices`,`query`,e),resetNodePipelineDefaults:e=>n(`pipelineOrchestrator`,`resetNodePipelineDefaults`,`mutation`,e),getCameraStatuses:e=>n(`pipelineOrchestrator`,`getCameraStatuses`,`query`,e),listTemplates:e=>n(`pipelineOrchestrator`,`listTemplates`,`query`,e),saveTemplate:e=>n(`pipelineOrchestrator`,`saveTemplate`,`mutation`,e),updateTemplate:e=>n(`pipelineOrchestrator`,`updateTemplate`,`mutation`,e),deleteTemplate:e=>n(`pipelineOrchestrator`,`deleteTemplate`,`mutation`,e)},pipelineRunner:{attachCamera:e=>n(`pipelineRunner`,`attachCamera`,`mutation`,e),reportMotion:e=>n(`pipelineRunner`,`reportMotion`,`mutation`,e),getLocalLoad:e=>n(`pipelineRunner`,`getLocalLoad`,`query`,e),getLocalMetrics:e=>n(`pipelineRunner`,`getLocalMetrics`,`query`,e),getAllCameraMetrics:e=>n(`pipelineRunner`,`getAllCameraMetrics`,`query`,e),getLocalCameras:e=>n(`pipelineRunner`,`getLocalCameras`,`query`,e),getNativeCrop:e=>n(`pipelineRunner`,`getNativeCrop`,`query`,e)},plateGallery:{getPlateMedia:e=>n(`plateGallery`,`getPlateMedia`,`query`,e),searchPlates:e=>n(`plateGallery`,`searchPlates`,`query`,e),suggestPlateClusters:e=>n(`plateGallery`,`suggestPlateClusters`,`query`,e),correctPlateText:e=>n(`plateGallery`,`correctPlateText`,`mutation`,e),deletePlate:e=>n(`plateGallery`,`deletePlate`,`mutation`,e),listVehicles:e=>n(`plateGallery`,`listVehicles`,`query`,e),createVehicle:e=>n(`plateGallery`,`createVehicle`,`mutation`,e),renameVehicle:e=>n(`plateGallery`,`renameVehicle`,`mutation`,e),deleteVehicle:e=>n(`plateGallery`,`deleteVehicle`,`mutation`,e),listVehicleSamples:e=>n(`plateGallery`,`listVehicleSamples`,`query`,e),removeVehicleSample:e=>n(`plateGallery`,`removeVehicleSample`,`mutation`,e),assignPlate:e=>n(`plateGallery`,`assignPlate`,`mutation`,e),unassignPlate:e=>n(`plateGallery`,`unassignPlate`,`mutation`,e),assignPlates:e=>n(`plateGallery`,`assignPlates`,`mutation`,e),unassignPlates:e=>n(`plateGallery`,`unassignPlates`,`mutation`,e)},recording:{getStorageUsage:e=>n(`recording`,`getStorageUsage`,`query`,e),listOpsLog:e=>n(`recording`,`listOpsLog`,`query`,e),relocateFootage:e=>n(`recording`,`relocateFootage`,`mutation`,e),getRelocateStatus:e=>n(`recording`,`getRelocateStatus`,`query`,e),cancelRelocate:e=>n(`recording`,`cancelRelocate`,`mutation`,e)},recordingExport:{getExport:e=>n(`recordingExport`,`getExport`,`query`,e),cancelExport:e=>n(`recordingExport`,`cancelExport`,`mutation`,e),deleteExport:e=>n(`recordingExport`,`deleteExport`,`mutation`,e),getDownloadUrl:e=>n(`recordingExport`,`getDownloadUrl`,`query`,e)},serverManagement:{getServerPackageStatus:e=>n(`serverManagement`,`getServerPackageStatus`,`query`,e),checkServerUpdate:e=>n(`serverManagement`,`checkServerUpdate`,`mutation`,e),applyServerUpdate:e=>n(`serverManagement`,`applyServerUpdate`,`mutation`,e),rollbackServerUpdate:e=>n(`serverManagement`,`rollbackServerUpdate`,`mutation`,e),restartServer:e=>n(`serverManagement`,`restartServer`,`mutation`,e)},settingsStore:{get:e=>n(`settingsStore`,`get`,`query`,e),set:e=>n(`settingsStore`,`set`,`mutation`,e),query:e=>n(`settingsStore`,`query`,`query`,e),insert:e=>n(`settingsStore`,`insert`,`mutation`,e),update:e=>n(`settingsStore`,`update`,`mutation`,e),delete:e=>n(`settingsStore`,`delete`,`mutation`,e),count:e=>n(`settingsStore`,`count`,`query`,e),histogram:e=>n(`settingsStore`,`histogram`,`query`,e),isEmpty:e=>n(`settingsStore`,`isEmpty`,`query`,e),declareCollection:e=>n(`settingsStore`,`declareCollection`,`mutation`,e)},storage:{resolve:e=>n(`storage`,`resolve`,`query`,e),write:e=>n(`storage`,`write`,`mutation`,e),read:e=>n(`storage`,`read`,`query`,e),exists:e=>n(`storage`,`exists`,`query`,e),list:e=>n(`storage`,`list`,`query`,e),delete:e=>n(`storage`,`delete`,`mutation`,e),getAvailableSpace:e=>n(`storage`,`getAvailableSpace`,`query`,e),beginUpload:e=>n(`storage`,`beginUpload`,`mutation`,e),writeChunk:e=>n(`storage`,`writeChunk`,`mutation`,e),finalizeUpload:e=>n(`storage`,`finalizeUpload`,`mutation`,e),abortUpload:e=>n(`storage`,`abortUpload`,`mutation`,e),beginDownload:e=>n(`storage`,`beginDownload`,`mutation`,e),readChunk:e=>n(`storage`,`readChunk`,`query`,e),endDownload:e=>n(`storage`,`endDownload`,`mutation`,e),listLocations:e=>n(`storage`,`listLocations`,`query`,e),getDefaultLocation:e=>n(`storage`,`getDefaultLocation`,`query`,e),listLocationDeclarations:e=>n(`storage`,`listLocationDeclarations`,`query`,e),upsertLocation:e=>n(`storage`,`upsertLocation`,`mutation`,e),deleteLocation:e=>n(`storage`,`deleteLocation`,`mutation`,e),testLocation:e=>n(`storage`,`testLocation`,`query`,e),listProviders:e=>n(`storage`,`listProviders`,`query`,e),testConfig:e=>n(`storage`,`testConfig`,`query`,e)},streamBroker:{listAllCameraStreams:e=>n(`streamBroker`,`listAllCameraStreams`,`query`,e),listAllProfileSlots:e=>n(`streamBroker`,`listAllProfileSlots`,`query`,e),getBrokerStats:e=>n(`streamBroker`,`getBrokerStats`,`query`,e),probeStream:e=>n(`streamBroker`,`probeStream`,`mutation`,e),listClients:e=>n(`streamBroker`,`listClients`,`query`,e),killClient:e=>n(`streamBroker`,`killClient`,`mutation`,e),getStreamUrl:e=>n(`streamBroker`,`getStreamUrl`,`query`,e),getStreamWithCodec:e=>n(`streamBroker`,`getStreamWithCodec`,`mutation`,e),releaseStreamWithCodec:e=>n(`streamBroker`,`releaseStreamWithCodec`,`mutation`,e),subscribeAudioChunks:e=>n(`streamBroker`,`subscribeAudioChunks`,`mutation`,e),pullAudioChunks:e=>n(`streamBroker`,`pullAudioChunks`,`query`,e),unsubscribeAudioChunks:e=>n(`streamBroker`,`unsubscribeAudioChunks`,`mutation`,e),subscribeFrames:e=>n(`streamBroker`,`subscribeFrames`,`mutation`,e),pullFrameHandles:e=>n(`streamBroker`,`pullFrameHandles`,`query`,e),unsubscribeFrames:e=>n(`streamBroker`,`unsubscribeFrames`,`mutation`,e),setPreBufferDuration:e=>n(`streamBroker`,`setPreBufferDuration`,`mutation`,e),getPreBufferInfo:e=>n(`streamBroker`,`getPreBufferInfo`,`query`,e),getRtspPort:e=>n(`streamBroker`,`getRtspPort`,`query`,e),getAllRtspEntries:e=>n(`streamBroker`,`getAllRtspEntries`,`query`,e),getRtspEntry:e=>n(`streamBroker`,`getRtspEntry`,`query`,e),regenerateRtspToken:e=>n(`streamBroker`,`regenerateRtspToken`,`mutation`,e),setRtspEnabled:e=>n(`streamBroker`,`setRtspEnabled`,`mutation`,e),isRtspEnabled:e=>n(`streamBroker`,`isRtspEnabled`,`query`,e)},system:{info:e=>n(`system`,`info`,`query`,e),health:e=>n(`system`,`health`,`query`,e),featureFlags:e=>n(`system`,`featureFlags`,`query`,e),networkAddresses:e=>n(`system`,`networkAddresses`,`query`,e),getRetentionConfig:e=>n(`system`,`getRetentionConfig`,`query`,e),setRetentionConfig:e=>n(`system`,`setRetentionConfig`,`mutation`,e),forceRetentionCleanup:e=>n(`system`,`forceRetentionCleanup`,`mutation`,e)},terminalSession:{listProfiles:e=>n(`terminalSession`,`listProfiles`,`query`,e),listSessions:e=>n(`terminalSession`,`listSessions`,`query`,e),openSession:e=>n(`terminalSession`,`openSession`,`mutation`,e),resize:e=>n(`terminalSession`,`resize`,`mutation`,e),close:e=>n(`terminalSession`,`close`,`mutation`,e)},toast:{onToast:(e,t)=>n(`toast`,`onToast`,`subscription`,e,t)},turnProvider:{getTurnServers:e=>n(`turnProvider`,`getTurnServers`,`query`,e)},userManagement:{listUsers:e=>n(`userManagement`,`listUsers`,`query`,e),createUser:e=>n(`userManagement`,`createUser`,`mutation`,e),updateUser:e=>n(`userManagement`,`updateUser`,`mutation`,e),deleteUser:e=>n(`userManagement`,`deleteUser`,`mutation`,e),resetPassword:e=>n(`userManagement`,`resetPassword`,`mutation`,e),setUserScopes:e=>n(`userManagement`,`setUserScopes`,`mutation`,e),validateCredentials:e=>n(`userManagement`,`validateCredentials`,`mutation`,e),listApiKeys:e=>n(`userManagement`,`listApiKeys`,`query`,e),createApiKey:e=>n(`userManagement`,`createApiKey`,`mutation`,e),revokeApiKey:e=>n(`userManagement`,`revokeApiKey`,`mutation`,e),validateApiKey:e=>n(`userManagement`,`validateApiKey`,`mutation`,e),createScopedToken:e=>n(`userManagement`,`createScopedToken`,`mutation`,e),revokeScopedToken:e=>n(`userManagement`,`revokeScopedToken`,`mutation`,e),validateScopedToken:e=>n(`userManagement`,`validateScopedToken`,`query`,e),listScopedTokens:e=>n(`userManagement`,`listScopedTokens`,`query`,e),setupTotp:e=>n(`userManagement`,`setupTotp`,`mutation`,e),confirmTotp:e=>n(`userManagement`,`confirmTotp`,`mutation`,e),disableTotp:e=>n(`userManagement`,`disableTotp`,`mutation`,e),getTotpStatus:e=>n(`userManagement`,`getTotpStatus`,`query`,e),verifyTotp:e=>n(`userManagement`,`verifyTotp`,`mutation`,e),oauthIssueCode:e=>n(`userManagement`,`oauthIssueCode`,`mutation`,e),oauthExchangeCode:e=>n(`userManagement`,`oauthExchangeCode`,`mutation`,e),oauthRefresh:e=>n(`userManagement`,`oauthRefresh`,`mutation`,e),oauthVerifyAccessToken:e=>n(`userManagement`,`oauthVerifyAccessToken`,`query`,e),listOauthSessions:e=>n(`userManagement`,`listOauthSessions`,`query`,e),revokeOauthSession:e=>n(`userManagement`,`revokeOauthSession`,`mutation`,e)}}}var zh=`device.state-changed`,Bh=`capability.binding-changed`,Vh=`device.registered`,Hh=`device.unregistered`,Uh=`device.updated`,Wh=class{api;stateMirror=new Map;bindings=new Map;devices=new Map;handleListeners=new Map;globalStateListeners=new Set;capListeners=new Map;deviceListeners=new Map;addedListeners=new Set;removedListeners=new Set;pendingWaits=new Set;stateSource;bridges=[];initialized=!1;initPromise=null;constructor(e){this.api=e,this.stateSource=Ls(this.stateMirror,this.handleListeners,this.api)}async init(e=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{let t=(t,n)=>Number.isFinite(e)?new Promise((r,a)=>{let o=setTimeout(()=>a(Error(`SystemMirror.init: '${n}' timed out after ${e}ms`)),e);t.then(e=>{clearTimeout(o),r(e)},e=>{clearTimeout(o),a(e)})}):t,[n,r,a]=await Promise.all([t(this.api.deviceManager.getAllBindings.query({}),`deviceManager.getAllBindings`),t(this.api.deviceState.getAllSnapshots.query({}),`deviceState.getAllSnapshots`),t(this.api.deviceManager.listAll.query({}),`deviceManager.listAll`)]);for(let e of n)this.bindings.set(e.deviceId,e);for(let[e,t]of Object.entries(r)){let n=Number(e);if(!Number.isFinite(n))continue;let r=new Map;for(let[e,n]of Object.entries(t))r.set(e,n);this.stateMirror.set(n,r)}for(let e of a)this.devices.set(e.id,e);try{this.subscribeBus()}catch{}this.initialized=!0})();try{await this.initPromise}finally{this.initPromise=null}}}isReady(){return this.initialized}async awaitReady(){if(!this.initialized)return this.initPromise?this.initPromise:this.init()}dispose(){for(let e of this.bridges)try{e.unsubscribe()}catch{}this.bridges=[],this.handleListeners.clear(),this.globalStateListeners.clear(),this.capListeners.clear(),this.deviceListeners.clear(),this.addedListeners.clear(),this.removedListeners.clear(),this.pendingWaits.clear(),this.initialized=!1}getDeviceById(e){let t=this.bindings.get(e);return t?zs(this.api,t,{stateSource:this.stateSource}):null}getDeviceByName(e){for(let t of this.devices.values())if(t.name===e)return this.getDeviceById(t.id);return null}getDeviceByStableId(e){for(let t of this.devices.values())if(t.stableId===e)return this.getDeviceById(t.id);return null}getDevicesByAddon(e){return this.query({addonId:e})}getDevicesByType(e){return this.query({type:e})}getDeviceInfo(e){return this.devices.get(e)??null}getAllDevices(){let e=[];for(let t of this.bindings.keys()){let n=this.getDeviceById(t);n&&e.push(n)}return e}filterByCap(e){return this.query({caps:e})}query(e={}){let t=[];for(let[n,r]of this.bindings){let a=this.devices.get(n);if(e.id!==void 0&&!Gh(n,e.id)||e.stableId!==void 0&&(!a||!Gh(a.stableId,e.stableId))||e.addonId!==void 0&&(!a||!Gh(a.addonId,e.addonId))||e.type!==void 0&&(!a||!Gh(a.type,e.type)))continue;if(e.caps!==void 0){let t=Kh(e.caps),n=new Set(r.entries.map(e=>e.capName));if(!t.every(e=>n.has(e)))continue}if(e.anyCap!==void 0){let t=Kh(e.anyCap),n=new Set(r.entries.map(e=>e.capName));if(!t.some(e=>n.has(e)))continue}if(e.name!==void 0&&(!a||!qh(a.name,e.name))||e.online!==void 0&&(!a||a.online!==e.online))continue;if(e.parentDeviceId!==void 0){if(!a)continue;let t=e.parentDeviceId;if((a.parentDeviceId??null)!==t)continue}if(e.feature!==void 0&&(!a||!Kh(e.feature).every(e=>a.features.includes(e)))||e.isCamera!==void 0&&(!a||a.isCamera!==e.isCamera))continue;let o=this.getDeviceById(n);if(o){if(e.where&&a){if(!e.where(a,o))continue}else if(e.where&&!a)continue;t.push(o)}}return t}whereState(e,t){let n=[];for(let[r,a]of this.stateMirror){let o=a.get(e);if(!o||!t(o,r))continue;let s=this.getDeviceById(r);s&&n.push(s)}return n}mapState(e,t){let n=[];for(let[r,a]of this.stateMirror){let o=a.get(e);o&&n.push(t(o,r))}return n}findState(e,t){for(let[n,r]of this.stateMirror){let a=r.get(e);if(a&&t(a,n))return this.getDeviceById(n)}return null}countByCap(e){let t=0;for(let n of this.bindings.values())n.entries.some(t=>t.capName===e)&&t++;return t}countByState(e,t){let n=0;for(let[r,a]of this.stateMirror){let o=a.get(e);o&&t(o,r)&&n++}return n}listen(e){return this.globalStateListeners.add(e),()=>{this.globalStateListeners.delete(e)}}listenCap(e,t){let n=this.capListeners.get(e);return n||(n=new Set,this.capListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.capListeners.delete(e)}}listenDevice(e,t){let n=this.deviceListeners.get(e);return n||(n=new Set,this.deviceListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.deviceListeners.delete(e)}}onDeviceAdded(e){return this.addedListeners.add(e),()=>{this.addedListeners.delete(e)}}onDeviceRemoved(e){return this.removedListeners.add(e),()=>{this.removedListeners.delete(e)}}waitForState(e,t,n,r=3e4){return new Promise((a,o)=>{let s=(()=>{let r=this.stateMirror.get(e)?.get(t);return r&&n(r)?r:null})();if(s){a(s);return}let c=null,l=this.listenDevice(e,(e,r,o)=>{r===t&&o&&n(o)&&(c&&clearTimeout(c),l(),a(o))});Number.isFinite(r)&&(c=setTimeout(()=>{l(),o(Error(`waitForState timed out after ${r}ms (deviceId=${e}, capName=${t})`))},r))})}waitForDevice(e,t=3e4){return new Promise((n,r)=>{let a=this.getDeviceById(e);if(a){n(a);return}let o=null,s=this.onDeviceAdded(t=>{if(t!==e)return;let r=this.getDeviceById(t);r&&(o&&clearTimeout(o),s(),n(r))});Number.isFinite(t)&&(o=setTimeout(()=>{s(),r(Error(`waitForDevice timed out after ${t}ms (deviceId=${e})`))},t))})}async forEachCap(e,t){for(let n of this.filterByCap(e))await t(n)}async invokeCap(e,t,n,r={}){let a=this.filterByCap(e),o=Math.max(1,r.parallelism??a.length),s=[];for(let r=0;r<a.length;r+=o){let c=a.slice(r,r+o),l=await Promise.allSettled(c.map(async r=>{let a=r[e];if(!a||typeof a[t]!=`function`)throw Error(`device '${r.deviceId}' does not expose '${e}.${t}'`);return await a[t](n)}));for(let e=0;e<l.length;e++){let t=c[e],n=l[e];n.status===`fulfilled`?s.push({deviceId:t.deviceId,ok:!0,result:n.value}):s.push({deviceId:t.deviceId,ok:!1,error:n.reason})}}return s}summary(){let e={},t={},n={},r=0,a=0;for(let t of this.bindings.values())for(let n of t.entries)e[n.capName]=(e[n.capName]??0)+1;for(let e of this.devices.values())t[e.addonId]=(t[e.addonId]??0)+1,n[e.type]=(n[e.type]??0)+1,e.online?r++:a++;return{totalDevices:this.bindings.size,online:r,offline:a,byCap:e,byAddon:t,byType:n,statedDevices:this.stateMirror.size}}dump(e){let t=e=>{let t=this.devices.get(e)??null,n=this.bindings.get(e)??null,r={},a=this.stateMirror.get(e);if(a)for(let[e,t]of a)r[e]={...t};return{deviceId:e,info:t,binding:n?{...n,entries:n.entries.map(e=>({...e}))}:null,state:r}};if(e!==void 0)return t(e);let n=[];for(let e of this.bindings.keys())n.push(t(e));return n}getRawMirror(){return this.stateMirror}getSystemState(){let e=new Map;for(let[t,n]of this.stateMirror){let r=new Map;for(let[e,t]of n)r.set(e,{...t});e.set(t,r)}return e}subscribeBus(){if(!this.api.live?.onEvent)return;let e=this.api.live.onEvent;this.bridges.push(e.subscribe({category:zh},{onData:e=>{let t=e.data;!t||typeof t.deviceId!=`number`||typeof t.capName!=`string`||this.applyStateUpdate(t.deviceId,t.capName,t.slice)}})),this.bridges.push(e.subscribe({category:Bh},{onData:e=>{let t=e.data,n=typeof t?.deviceId==`number`?t.deviceId:t?.source?.type===`device`&&typeof t.source.id==`number`?t.source.id:null;n!==null&&this.refreshBinding(n)}})),this.bridges.push(e.subscribe({category:Vh},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`added`)}})),this.bridges.push(e.subscribe({category:Hh},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.applyDeviceRemoval(t.deviceId)}})),this.bridges.push(e.subscribe({category:Uh},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`updated`)}}))}applyStateUpdate(e,t,n){let r=this.stateMirror.get(e);r||(r=new Map,this.stateMirror.set(e,r)),n===void 0?r.delete(t):r.set(t,n);let a=`${e}:${t}`,o=this.handleListeners.get(a);if(o)for(let e of o)try{e(n)}catch{}for(let r of this.globalStateListeners)try{r(e,t,n)}catch{}let s=this.capListeners.get(t);if(s)for(let t of s)try{t(e,n)}catch{}let c=this.deviceListeners.get(e);if(c)for(let r of c)try{r(e,t,n)}catch{}}applyDeviceRemoval(e){let t=this.devices.get(e)??null;this.bindings.delete(e),this.devices.delete(e),this.stateMirror.delete(e);for(let n of this.removedListeners)try{n(e,t)}catch{}}async refreshBinding(e){try{let t=(await this.api.deviceManager.getAllBindings.query({})).find(t=>t.deviceId===e);t?this.bindings.set(e,t):this.applyDeviceRemoval(e)}catch{}}async refreshDeviceMetadata(e,t){try{let n=(await this.api.deviceManager.listAll.query({})).find(t=>t.id===e);if(!n)return;let r=!this.devices.has(e);if(this.devices.set(e,n),t===`added`&&r){await this.refreshBinding(e);for(let t of this.addedListeners)try{t(e,n)}catch{}}}catch{}}};function Gh(e,t){return Array.isArray(t)?t.includes(e):e===t}function Kh(e){return Array.isArray(e)?e:[e]}function qh(e,t){return typeof t==`string`?e===t:t instanceof RegExp?t.test(e):`exact`in t?e===t.exact:`contains`in t?e.toLowerCase().includes(t.contains.toLowerCase()):!1}var Jh=B({id:P(),label:P(),icon:P(),path:P(),remoteName:P(),bundle:P(),section:P().optional(),sectionLabel:P().optional()}),Yh=B({addonId:P(),page:Jh,bundleUrl:P()}),Xh={name:`addon-pages`,scope:`system`,mode:`singleton`,methods:{listPages:K(R(),z(Yh).readonly())}},Zh=B({id:P(),label:P(),icon:P(),path:P(),remoteName:P(),bundle:P(),section:P().optional(),sectionLabel:P().optional()}),Qh={name:`addon-pages-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listPages:K(R(),z(Zh).readonly())}},$h=B({method:H([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`]),path:P(),access:H([`public`,`authenticated`,`admin`]).optional(),description:P().optional()}),eg=B({method:P(),path:P(),params:V(P(),P()),query:V(P(),P()),body:L(),headers:V(P(),P()),user:B({id:P(),username:P(),isAdmin:I()}).optional(),scopedToken:L().optional()}),tg=B({status:F().int(),headers:V(P(),P()),redirectUrl:P().nullable(),body:L().optional(),contentType:P().optional()}),ng={name:`addon-routes`,scope:`system`,mode:`collection`,internal:!0,methods:{getRoutes:K(R(),z($h)),invoke:K(eg,tg,{kind:`mutation`})},mount:{kind:`skip`}},rg=B({id:P(),label:P(),icon:P(),order:F().optional()}),ig=B({id:P(),title:P(),description:P().optional(),style:H([`card`,`accordion`]).optional(),defaultCollapsed:I().optional(),columns:Co([U(1),U(2),U(3),U(4)]).optional(),tab:P().optional(),location:H([`settings`,`top-tab`]).optional(),order:F().optional(),fields:z(fo())}),ag=B({tabs:z(rg).optional(),sections:z(ig)}),og=V(P(),L()),sg=B({success:U(!0)}),cg={name:`addon-settings`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{getGlobalSettings:K(B({addonId:P(),nodeId:P().optional(),overlay:V(P(),L()).optional(),cap:P().optional()}),ag.nullable()),updateGlobalSettings:K(B({addonId:P(),nodeId:P().optional(),patch:og}),sg,{kind:`mutation`,auth:`admin`}),getDeviceSettings:K(B({addonId:P(),deviceId:F(),nodeId:P().optional()}),ag.nullable()),updateDeviceSettings:K(B({addonId:P(),deviceId:F(),nodeId:P().optional(),patch:og}),sg,{kind:`mutation`,auth:`admin`})}},lg=H([`device-tab`,`dashboard`,`integration-detail`]),ug=H([`xs`,`sm`,`md`,`lg`,`xl`]),dg=B({remoteName:P(),exposedModule:P(),componentKey:P().optional()}),fg=B({tab:P(),subTab:P().optional(),label:P(),order:F().optional(),kind:U(`remote`),remote:dg,stableId:P(),description:P().optional(),icon:P().optional(),bundle:P(),hosts:z(lg).readonly(),requires:B({deviceContext:I().default(!1),integrationContext:I().default(!1)}),preAuth:I().optional().default(!1),defaultSize:ug.default(`md`),allowedSizes:z(ug).readonly().default([`sm`,`md`,`lg`]),defaultColumns:F().int().min(1).max(12).default(6),defaultRows:F().int().min(1).max(12).default(1)}),pg={name:`addon-widgets-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listWidgets:K(R(),z(fg).readonly())}},mg=fg.extend({addonId:P(),bundleUrl:P()}),hg={name:`addon-widgets`,scope:`system`,mode:`singleton`,methods:{listWidgets:K(R(),z(mg).readonly())}},gg=H([`info`,`success`,`warning`,`error`]),_g=H([`active`,`in-progress`,`completed`,`failed`,`dismissed`]),vg=B({type:P(),id:P()}),yg=B({id:P(),category:P(),severity:gg,title:P(),message:P(),status:_g,progress:F().optional(),read:I(),createdAt:F(),updatedAt:F(),source:vg.optional(),metadata:V(P(),L()).optional()}),bg={name:`alerts`,scope:`system`,mode:`singleton`,methods:{emit:K(yg,R(),{kind:`mutation`}),update:K(B({alertId:P(),patch:yg.partial()}),R(),{kind:`mutation`}),list:K(B({unreadOnly:I().optional(),limit:F().optional()}).optional(),z(yg).readonly()),getUnreadCount:K(R(),F()),markRead:K(B({alertId:P()}),R(),{kind:`mutation`}),markAllRead:K(R(),R(),{kind:`mutation`}),dismiss:K(B({alertId:P()}),R(),{kind:`mutation`})}},xg={name:`audio-analysis`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[W.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:K(B({deviceId:F()}),rs())},events:{onAudioLevel:Ps(B({deviceId:F(),rms:F(),dbfs:F()}))}},Sg=B({level:Ef,classification:B({labels:z(Df).readonly(),inferenceMs:F()}).optional(),timestamp:F()}),Cg=B({minConfidence:F().min(0).max(1).default(.3),allowedClasses:z(P()).default([])}),wg=B({labels:z(Df).readonly(),rawLabels:z(Df).readonly().optional(),inferenceMs:F()}),Tg={name:`audio-analyzer`,scope:`system`,mode:`singleton`,methods:{analyseChunk:K(B({chunk:Tf,settings:Cg}),Sg.nullable(),{kind:`mutation`}),classify:K(Tf,wg,{timeoutMs:3e4}),isReady:K(R(),I()),dispose:K(R(),R(),{kind:`mutation`}),reprobeAudioEngine:K(R(),B({backend:P()}),{kind:`mutation`,auth:`admin`})}},Eg=H([`f32le`,`s16le`]),Dg=B({codec:P(),canDecode:I(),canEncode:I(),label:P().optional()}),Og=B({codec:P(),sourceSampleRate:F().int().positive(),sourceChannels:F().int().positive(),extraData:os(Uint8Array).optional(),targetSampleRate:F().int().positive(),targetChannels:F().int().positive(),targetFormat:Eg.optional(),idleMs:F().int().positive().optional(),tag:P().optional()}),kg=B({codec:P(),sourceSampleRate:F().int().positive(),sourceChannels:F().int().positive(),sourceFormat:Eg.optional(),targetSampleRate:F().int().positive(),targetChannels:F().int().positive(),bitrateKbps:F().int().positive().optional(),idleMs:F().int().positive().optional(),tag:P().optional()}),Ag=B({data:os(Uint8Array),sampleRate:F().int().positive(),channels:F().int().positive(),format:Eg,pts:F()}),jg=B({data:os(Uint8Array),codec:P(),pts:F(),frameComplete:I()}),Mg=B({sessionId:P(),kind:H([`decode`,`encode`]),codec:P(),sourceSampleRate:F(),sourceChannels:F(),targetSampleRate:F(),targetChannels:F(),format:Eg,tag:P().optional(),createdAtMs:F(),lastActivityMs:F(),framesIn:F(),framesOut:F()}),Ng={name:`audio-codec`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{listSupportedCodecs:K(R(),z(Dg).readonly()),canHandle:K(B({codec:P(),kind:H([`decode`,`encode`])}),I()),createDecodeSession:K(Og,B({sessionId:P(),nodeId:P()}),{kind:`mutation`}),createEncodeSession:K(kg,B({sessionId:P(),nodeId:P()}),{kind:`mutation`}),closeSession:K(B({sessionId:P(),nodeId:P().optional()}),R(),{kind:`mutation`}),pushEncodedFrame:K(B({sessionId:P(),nodeId:P().optional(),data:os(Uint8Array),pts:F().optional()}),R(),{kind:`mutation`}),pullPcm:K(B({sessionId:P(),nodeId:P().optional(),maxCount:F().int().positive().default(8)}),z(Ag)),pushPcm:K(B({sessionId:P(),nodeId:P().optional(),data:os(Uint8Array),pts:F().optional()}),R(),{kind:`mutation`}),pullEncoded:K(B({sessionId:P(),nodeId:P().optional(),maxCount:F().int().positive().default(8)}),z(jg)),flushEncode:K(B({sessionId:P(),nodeId:P().optional()}),z(jg),{kind:`mutation`}),listActiveSessions:K(R(),z(Mg).readonly())}},Pg=B({userId:P(),username:P(),email:P().optional(),displayName:P().optional(),isAdmin:I().default(!1)}),Fg={name:`auth-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{validateCredentials:K(B({username:P(),password:P()}),Pg.nullable(),{kind:`mutation`}),getLoginUrl:K(B({state:P()}),P()),handleCallback:K(V(P(),P()),Pg,{kind:`mutation`}),validateToken:K(B({token:P()}),Pg.nullable())},mount:{kind:`skip`}},Ig=B({sessionId:P(),profileId:P(),label:P(),cols:F().int().positive(),rows:F().int().positive(),startedAt:F()}),Lg=B({profileId:P(),label:P(),description:P().optional()}),Rg={name:`terminal-session`,scope:`system`,mode:`singleton`,methods:{listProfiles:K(R(),z(Lg).readonly(),{auth:`admin`}),listSessions:K(R(),z(Ig).readonly(),{auth:`admin`}),openSession:K(B({profileId:P(),cols:F().int().positive(),rows:F().int().positive()}),Ig,{kind:`mutation`,auth:`admin`}),resize:K(B({sessionId:P(),cols:F().int().positive(),rows:F().int().positive()}),R(),{kind:`mutation`,auth:`admin`}),close:K(B({sessionId:P()}),R(),{kind:`mutation`,auth:`admin`})}},zg=B({subId:P(),displayName:P(),description:P().optional(),kind:P(),triggerSupported:I(),restoreSupported:I()}).extend({id:P(),addonId:P(),enabled:I(),retentionCount:F(),label:P().optional(),lastSuccessAt:F().optional(),lastSuccessSizeBytes:F().optional(),cron:P().optional(),nextRunAt:F().optional(),lastRunAt:F().optional()}),Bg=B({id:P(),filename:P(),createdAt:F(),sizeBytes:F(),label:P().optional(),locations:z(P()).readonly()}),Vg=B({id:P(),destinationId:P().optional(),label:P().optional(),createdAt:F(),sizeBytes:F(),locations:z(P()).optional()}),Hg=B({path:P(),kind:H([`file`,`dir`,`symlink`]),sizeBytes:F(),mtime:F()}),Ug=B({archiveVersion:U(1),createdAt:F(),dataDir:P(),locations:z(P()),entries:z(Hg),totalBytes:F(),totalFiles:F()}),Wg=B({name:P(),sizeBytes:F(),fileCount:F(),present:I()}),Gg=B({id:P(),label:P(),cron:P(),enabled:I(),locationIds:z(P()).readonly(),retentionCount:F().int().min(1).max(1e3),dataSources:z(P()).readonly().optional(),lastRunAt:F().optional(),nextRunAt:F().optional()}),Kg={name:`backup`,scope:`system`,mode:`singleton`,methods:{listDestinations:K(R(),z(zg).readonly(),{auth:`admin`}),trigger:K(B({destinations:z(P()).optional(),locations:z(P()).optional(),label:P().optional(),retentionCount:F().int().min(1).max(1e3).optional()}).optional(),z(Vg).readonly(),{kind:`mutation`,auth:`admin`}),list:K(R(),z(Vg).readonly(),{auth:`admin`}),listLocations:K(R(),z(Wg).readonly(),{auth:`admin`}),getEntries:K(B({destinationId:P(),backupId:P()}),Ug.nullable(),{auth:`admin`}),restore:K(B({destinationId:P(),backupId:P(),locations:z(P()).optional()}),R(),{kind:`mutation`,auth:`admin`}),delete:K(B({destinationId:P(),backupId:P()}),R(),{kind:`mutation`,auth:`admin`}),listArchives:K(B({destinationId:P()}),z(Bg).readonly(),{auth:`admin`}),upsertDestinationPolicy:K(B({locationId:P(),enabled:I(),retentionCount:F().int().min(1).max(1e3),label:P().optional(),cron:P().optional()}),R(),{kind:`mutation`,auth:`admin`}),previewSchedule:K(B({cron:P(),count:F().int().min(1).max(20).optional()}),B({ok:I(),error:P().optional(),nextRuns:z(F()).readonly()})),listSchedules:K(R(),z(Gg).readonly(),{auth:`admin`}),upsertSchedule:K(B({id:P().optional(),label:P(),cron:P(),enabled:I(),locationIds:z(P()).readonly(),retentionCount:F().int().min(1).max(1e3),dataSources:z(P()).readonly().optional()}),Gg,{kind:`mutation`,auth:`admin`}),deleteSchedule:K(B({id:P()}),R(),{kind:`mutation`,auth:`admin`})}},qg=H([`connected`,`disconnected`,`connecting`,`auth-failed`,`unreachable`,`error`]),Jg=B({id:P(),addonId:P(),name:P(),kind:P(),status:qg,info:V(P(),L()),lastCheckedAt:F().nullable(),error:P().nullable()}),Yg=B({brokerCount:F().int().nonnegative(),connectedCount:F().int().nonnegative()}),Xg=B({addonId:P(),kinds:z(B({kind:P(),label:P()}))}),Zg=B({kind:P().optional()}),Qg=B({id:P()}),$g=B({kind:P().min(1),name:P().min(1),settings:V(P(),L())}),e_=B({id:P()}),t_=B({id:P()}),n_=To(`ok`,[B({ok:U(!0),latencyMs:F().nonnegative()}),B({ok:U(!1),error:P()})]),r_=V(P(),L()),i_=B({kind:P()}),a_=B({kind:P(),settings:r_}),o_=To(`ok`,[B({ok:U(!0),latencyMs:F().nonnegative().optional()}).strict(),B({ok:U(!1),error:P()})]),s_=L().nullable(),c_=B({brokerId:P(),target:V(P(),L()),payload:L().optional()}),l_=B({brokerId:P(),filter:V(P(),L())}),u_=B({subscriptionId:P()}),d_=B({brokerId:P(),subscriptionId:P()}),f_=B({brokerId:P(),key:P()}),p_={name:`broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:Yg,kind:`poll`},methods:{list:K(Zg,z(Jg)),get:K(Qg,Jg.nullable()),listProviders:K(R(),z(Xg),{auth:`admin`}),add:K($g,e_,{kind:`mutation`,auth:`admin`}),remove:K(t_,R(),{kind:`mutation`,auth:`admin`}),testConnection:K(Qg,n_,{kind:`mutation`,auth:`admin`}),getSettings:K(Qg,r_.nullable(),{auth:`admin`}),setSettings:K(B({id:P(),settings:r_}),R(),{kind:`mutation`,auth:`admin`}),getBrokerConfig:K(Qg,r_.nullable(),{auth:`admin`}),getSettingsSchema:K(i_,s_,{auth:`admin`}),testSettings:K(a_,o_,{kind:`mutation`,auth:`admin`}),publish:K(c_,L(),{kind:`mutation`,auth:`admin`}),subscribe:K(l_,u_,{kind:`mutation`,auth:`admin`}),unsubscribe:K(d_,R(),{kind:`mutation`,auth:`admin`}),getState:K(f_,L().nullable()),getStatus:K(R(),Yg)}},m_={name:`camera-pipeline-config`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[W.Camera],exposesDeviceSettings:!0,methods:{}},h_=B({stepId:P(),entry:oc}),g_={name:`custom-model-registry`,scope:`system`,mode:`collection`,internal:!0,methods:{listModels:K(R(),z(h_).readonly())}},__=B({sessionId:P(),slotCount:F().int(),slotByteLength:F().int(),segmentBytes:F().int(),budgetMb:F().int(),framesWritten:F().int(),getFrameHits:F().int(),getFrameMisses:F().int()}),v_={name:`decoder`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{supportsCodec:K(B({codec:P()}),I()),getInfo:K(R(),B({id:P(),name:P(),isPullMode:I().optional(),priority:F().optional(),hwaccel:P().optional(),probedBestHwaccel:P().optional()})),createSession:K(Pc,B({sessionId:P(),nodeId:P()})),destroySession:K(B({sessionId:P()}),R()),pushPacket:K(B({sessionId:P(),packet:bs}),R()),openStream:K(B({sessionId:P(),url:P()}),R()),pullFrames:K(B({sessionId:P(),maxCount:F().default(1),waitMs:F().optional()}),z(xs)),pullHandles:K(B({sessionId:P(),maxCount:F().default(1),waitMs:F().optional()}),z(Ss)),getFrame:K(B({handle:Ss}),xs.nullable()),getShmStats:K(B({sessionId:P()}),__.nullable()),updateConfig:K(B({sessionId:P(),config:Pc.partial()}),R()),getStats:K(B({sessionId:P()}),Nc),listActiveSessions:K(R(),z(B({sessionId:P(),codec:P(),outputFormat:P(),createdAtMs:F()})).readonly()),reprobeHwaccel:K(R(),B({backend:P()}),{kind:`mutation`,auth:`admin`})}},y_={name:`detection-pipeline`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[W.Camera],exposesDeviceSettings:!0,methods:{}},b_=B({id:P(),label:P(),isDefault:I().optional()}),x_=B({search:P().optional(),area:P().optional(),manufacturer:P().optional(),adoptedOnly:I().optional(),unadoptedOnly:I().optional()}),S_=B({integrationId:P(),page:F().int().positive().default(1),pageSize:F().int().positive().max(2e4).default(50),filter:P().optional(),filterText:x_.optional()}),C_=B({candidates:z(Ad).readonly(),totalCount:F().int().nonnegative(),page:F().int().positive(),pageSize:F().int().positive()}),w_=B({integrationId:P(),childNativeId:P()}),T_=B({lastDiscoveryAt:F().int().nonnegative().nullable(),candidateCount:F().int().nonnegative(),adoptedCount:F().int().nonnegative(),lastError:P().nullable()}),E_=B({name:P().min(1).optional(),hiddenChildIds:z(P()).optional()}),D_=B({integrationId:P(),childNativeIds:z(P()).min(1),filter:P().optional(),importLocations:I().optional(),perCandidate:V(P(),E_).optional()}),O_=B({adopted:z(B({childNativeId:P(),parentDeviceId:F().int().nonnegative(),accessoryDeviceIds:z(F().int().nonnegative()).readonly()})).readonly()}),k_=B({integrationId:P(),camDeviceId:F().int().nonnegative()}),A_=B({camDeviceId:F().int().nonnegative(),resetToSource:I().optional()}),j_=B({changed:I(),rebuiltChildren:F().int().nonnegative(),removedChildren:F().int().nonnegative().optional()}),M_={name:`device-adoption`,scope:`system`,mode:`singleton`,status:{schema:T_,kind:`poll`},methods:{listCandidateFilters:K(B({integrationId:P()}),B({filters:z(b_)}),{auth:`admin`}),listCandidates:K(S_,C_,{auth:`admin`}),getCandidate:K(w_,Ad.nullable(),{auth:`admin`}),refresh:K(B({integrationId:P()}),T_,{kind:`mutation`,auth:`admin`}),adopt:K(D_,O_,{kind:`mutation`,auth:`admin`}),release:K(k_,R(),{kind:`mutation`,auth:`admin`}),resync:K(A_,j_,{kind:`mutation`,auth:`admin`})}},N_=H([`unlinked`,`linked`,`error`]),P_=B({label:P(),value:P(),secret:I().optional()}),F_=B({qr:P().optional(),fields:z(P_).readonly().optional(),note:P().optional()}),I_=B({linkState:N_,exposedDeviceCount:F(),error:P().optional(),setup:F_.optional()}),L_=P(),R_=B({deviceId:P(),exposedAs:P().optional(),capabilities:z(P()).optional()}),z_=B({deviceId:P(),capabilities:z(P()).optional()}),B_=B({deviceId:P()}),V_={name:`device-export`,scope:`system`,mode:`collection`,providerKind:`device-export`,status:{schema:I_,kind:`poll`},exposesDeviceSettings:!0,methods:{getStatus:K(R(),I_),listSupportedDeviceKinds:K(R(),z(L_)),listExposedDevices:K(R(),z(R_)),exposeDevice:K(z_,R(),{kind:`mutation`}),unexposeDevice:K(B_,R(),{kind:`mutation`})}},H_=B({childKey:P(),section:P(),order:F().optional(),collapsed:I().optional()}),U_=B({kind:U(`field`).optional(),sourceKey:P(),cap:P(),fieldPath:P()}),W_=B({kind:U(`literal`),value:Co([P(),F(),I(),lo()])}),G_=B({kind:U(`global`),sourceStableId:P(),cap:P(),fieldPath:P()}),K_=B({kind:U(`expression`),expr:P().min(1).max(el),bindings:V(P().regex(tl),Co([U_,W_,G_]))}).superRefine((e,t)=>{let n=El(e);n!==null&&t.addIssue({code:`custom`,message:n,path:[`expr`]})}),q_=B({id:P(),source:Co([U_,W_,G_,K_]),target:B({cap:P(),fieldPath:P(),itemKey:P().optional()}),transform:To(`kind`,[B({kind:U(`identity`)}),B({kind:U(`enum-map`),mapping:V(P(),Co([P(),F(),I()])),fallback:Co([P(),F(),I()]).optional()}),B({kind:U(`linear`),scale:F(),offset:F(),clamp:ko([F(),F()]).readonly().optional()})]).optional()}),J_=B({unit:P().min(1).optional(),precision:F().int().min(0).max(10).optional()}),Y_=B({icon:P().min(1).optional(),label:P().min(1).optional(),unit:P().min(1).optional(),precision:F().int().min(0).max(10).optional(),hidden:I().optional(),perCap:V(P(),J_).optional()}),X_=B({unit:P().min(1).optional(),precision:F().int().min(0).max(10).optional(),icon:P().min(1).optional()}),Z_=B({id:F(),stableId:P(),addonId:P(),type:H(W),name:P(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional(),online:I(),probed:I().optional(),features:z(P()),isCamera:I(),config:V(P(),L()),metadata:V(P(),L()).nullable().optional(),sourceInfo:Od.optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),primaryChildEntityId:P().nullable().optional(),childLayout:z(H_).readonly().optional(),deviceLinks:z(q_).readonly().optional(),display:Y_.optional()}),Q_=B({key:P(),value:L(),description:P().optional()}),$_=H([`auto`,`manual`]),ev=B({deviceId:F(),name:P(),location:P().nullable(),features:z(P()),producesTrackedEvents:I().optional()}),tv=B({id:F(),stableId:P(),type:P(),name:P(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional()}),nv=B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),userNamed:I().optional(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),metadata:V(P(),L()).nullable().optional(),sourceInfo:Od.optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),primaryChildEntityId:P().nullable().optional(),childLayout:z(H_).readonly().optional(),deviceLinks:z(q_).readonly().optional(),role:P().nullable().optional(),display:Y_.optional()}),rv=L().nullable(),iv=B({streamId:P(),width:F().optional(),height:F().optional(),codec:P().optional(),fps:F().optional(),bitrateKbps:F().optional()}),av=B({addonId:P(),stableId:P(),id:F(),type:P(),name:P(),location:P().nullable().optional(),disabled:I().optional(),parentDeviceId:F().nullable(),role:P().nullable().optional(),features:z(P()).optional(),config:V(P(),L())}),ov=B({deviceId:F()}),sv=B({deviceId:F(),data:V(P(),L())}),cv={name:`device-manager`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{allocateDeviceId:K(B({addonId:P(),stableId:P()}),B({id:F()}),{kind:`mutation`}),registerDevice:K(av,R(),{kind:`mutation`}),removeDevice:K(ov,R(),{kind:`mutation`}),persistConfig:K(sv,R(),{kind:`mutation`}),loadConfig:K(B({deviceId:F()}),V(P(),L())),loadRuntimeState:K(B({deviceId:F()}),V(P(),L())),loadMeta:K(B({deviceId:F()}),nv.nullable()),setName:K(B({deviceId:F(),name:P()}),R(),{kind:`mutation`,auth:`admin`}),setLocation:K(B({deviceId:F(),location:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setType:K(B({deviceId:F(),type:H(W)}),R(),{kind:`mutation`,auth:`admin`}),setIntegrationId:K(B({deviceId:F(),integrationId:P()}),R(),{kind:`mutation`,auth:`admin`}),setLinkDeviceId:K(B({deviceId:F(),linkDeviceId:F().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setPrimaryChildEntityId:K(B({deviceId:F(),primaryChildEntityId:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setChildLayout:K(B({deviceId:F(),childLayout:z(H_).readonly()}),R(),{kind:`mutation`,auth:`admin`}),setDeviceLinks:K(B({deviceId:F(),deviceLinks:z(q_).readonly()}),R(),{kind:`mutation`,auth:`admin`}),setDisplay:K(B({deviceId:F(),display:Y_.nullable()}),R(),{kind:`mutation`,auth:`admin`}),getRoleDisplayDefaults:K(B({}),B({defaults:V(P(),X_)}),{kind:`query`}),setRoleDisplayDefaults:K(B({defaults:V(P(),X_)}),R(),{kind:`mutation`,auth:`admin`}),getWireableFields:K(B({deviceId:F(),includeSynthesizable:I().optional()}),B({caps:z(B({cap:P(),fields:z(B({path:P(),kind:H([`string`,`number`,`boolean`,`enum`]),enumValues:z(P()).optional(),item:I().optional()})).readonly(),itemArray:B({path:P(),keyField:P()}).optional()})).readonly()}),{kind:`query`}),setRole:K(B({deviceId:F(),role:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),applyInitialMeta:K(B({deviceId:F(),name:P().optional(),location:P().nullable().optional(),type:H(W).optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),role:P().nullable().optional()}),R(),{kind:`mutation`,auth:`admin`}),setMetadata:K(B({deviceId:F(),patch:V(P(),L())}),R(),{kind:`mutation`,auth:`admin`}),listLocations:K(R(),z(P())),addLocation:K(B({name:P()}),R(),{kind:`mutation`,auth:`admin`}),removeLocation:K(B({name:P(),cascade:I().optional()}),R(),{kind:`mutation`,auth:`admin`}),setDisabled:K(B({deviceId:F(),disabled:I()}),R(),{kind:`mutation`,auth:`admin`}),listPersistedByAddon:K(B({addonId:P()}),z(tv)),listAll:K(B({addonId:P().optional()}),z(Z_)),getDevice:K(B({deviceId:F()}),Z_.nullable()),getChildren:K(B({parentDeviceId:F()}),z(Z_)),getLinkedDevices:K(B({deviceId:F()}),B({mode:$_,devices:z(ev)})),getStreamSources:K(B({deviceId:F()}),z(ys)),getConfigSchema:K(B({deviceId:F()}),z(Q_)),getSettingsSchema:K(B({deviceId:F()}),rv),updateConfig:K(B({deviceId:F(),values:V(P(),L())}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),enable:K(B({deviceId:F()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),disable:K(B({deviceId:F()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),remove:K(B({deviceId:F()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),removeByIntegration:K(B({integrationId:P()}),B({removed:F()}),{kind:`mutation`,auth:`admin`}),getStreamProfileMap:K(B({deviceId:F()}),V(P(),P().nullable())),setStreamProfileMap:K(B({deviceId:F(),profileMap:V(P(),P().nullable())}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),probeStreams:K(B({deviceId:F()}),z(iv),{kind:`mutation`,auth:`admin`}),getBindings:K(B({deviceId:F()}),B({deviceId:F(),entries:z(B({capName:P(),kind:H([`native`,`wrapped`,`linked`]),providerAddonId:P(),providerNodeId:P(),nativeAddonId:P()}))})),getAllBindings:K(B({}),z(B({deviceId:F(),entries:z(B({capName:P(),kind:H([`native`,`wrapped`,`linked`]),providerAddonId:P(),providerNodeId:P(),nativeAddonId:P()}))}))),setWrapperActive:K(B({deviceId:F(),capName:P(),wrapperAddonId:P(),active:I()}),R(),{kind:`mutation`,auth:`admin`}),listWrappersForCap:K(B({capName:P()}),z(P())),listBindableCapsForDeviceType:K(B({deviceType:P()}),z(B({capName:P(),wrappers:z(P())}))),getDeviceSettingsAggregate:K(B({deviceId:F()}),ag.nullable()),getDeviceLiveInfoAggregate:K(B({deviceId:F()}),ag.nullable()),getDeviceAggregate:K(B({deviceId:F()}),B({settings:ag.nullable(),live:ag.nullable()})),runDeviceAction:K(B({deviceId:F().int().nonnegative(),action:P().min(1),input:L()}),L(),{kind:`mutation`}),updateDeviceField:K(B({deviceId:F(),writerCapName:P(),writerAddonId:P(),key:P(),value:L()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),updateDeviceFieldsBatch:K(B({deviceId:F(),changes:z(B({writerCapName:P(),writerAddonId:P(),key:P(),value:L()}))}),B({success:U(!0),failures:z(B({writerCapName:P(),writerAddonId:P(),error:P()}))}),{kind:`mutation`,auth:`admin`}),discoverDevices:K(B({addonId:P()}),z(Mh),{kind:`mutation`,auth:`admin`}),adoptDevice:K(B({addonId:P(),candidate:Mh,integrationId:P().optional()}),Nh,{kind:`mutation`,auth:`admin`}),getCreationSchema:K(B({addonId:P(),type:H(W)}),L().nullable()),createDevice:K(B({addonId:P(),type:H(W),config:V(P(),L()),integrationId:P().optional()}),Nh,{kind:`mutation`,auth:`admin`}),testCreationField:K(B({addonId:P(),type:H(W),key:P(),value:L(),formValues:V(P(),L()).optional()}),Ph,{kind:`mutation`,auth:`admin`}),adoptionListCandidateFilters:K(B({addonId:P(),integrationId:P()}),B({filters:z(b_)}),{auth:`admin`}),adoptionListCandidates:K(S_.extend({addonId:P()}),C_,{auth:`admin`}),adoptionRefresh:K(B({addonId:P(),integrationId:P()}),T_,{kind:`mutation`,auth:`admin`}),adoptionAdopt:K(D_.extend({addonId:P()}),O_,{kind:`mutation`,auth:`admin`}),adoptionRelease:K(k_.extend({addonId:P()}),R(),{kind:`mutation`,auth:`admin`}),adoptionResync:K(A_,j_,{kind:`mutation`,auth:`admin`}),discoveryProviders:K(B({}),B({providers:z(B({addonId:P(),label:P()})).readonly()}),{auth:`admin`}),discoverAllProviders:K(B({}),B({groups:z(B({addonId:P(),label:P(),candidates:z(Mh).readonly(),error:P().nullable()})).readonly()}),{kind:`mutation`,auth:`admin`}),discoverProvider:K(B({addonId:P(),params:V(P(),L()).optional()}),B({candidates:z(Mh).readonly()}),{kind:`mutation`,auth:`admin`}),providerCreationType:K(B({addonId:P()}),B({deviceType:H(W).nullable()}),{auth:`admin`}),providerDiscoveryParamsSchema:K(B({addonId:P()}),L(),{auth:`admin`}),testField:K(B({deviceId:F(),key:P(),value:L()}),Ph,{kind:`mutation`,auth:`admin`}),getDeviceStatusAggregate:K(B({deviceId:F(),caps:z(P()).readonly().optional()}),V(P(),L().nullable())),getDeviceStatusAggregateBatch:K(B({deviceIds:z(F()).readonly(),caps:z(P()).readonly().optional()}),V(P(),V(P(),L().nullable())))}},lv={name:`device-state`,scope:`system`,mode:`singleton`,methods:{getSnapshot:K(B({deviceId:F()}),V(P(),V(P(),L()))),getCapSlice:K(B({deviceId:F(),capName:P()}),V(P(),L()).nullable()),getAllSnapshots:K(B({}),V(P(),V(P(),V(P(),L())))),setCapSlice:K(B({deviceId:F(),capName:P(),slice:V(P(),L())}),R(),{kind:`mutation`})},events:{onChanged:Ps(B({deviceId:F(),capName:P(),slice:V(P(),L())}))}},uv=B({embedding:z(F()),inferenceMs:F()}),dv=B({modelId:P(),embeddingDim:F(),ready:I()}),fv={name:`embedding-encoder`,scope:`system`,mode:`collection`,internal:!0,methods:{encode:K(B({crop:os(Uint8Array),width:F(),height:F()}),uv),encodeText:K(B({text:P()}),uv),getInfo:K(R(),dv)}},pv=B({name:P(),path:P()}),mv=B({path:P(),entries:z(pv).readonly(),freeBytes:F(),totalBytes:F()}),hv={name:`filesystem-browse`,scope:`system`,mode:`singleton`,internal:!0,methods:{listAllowedRoots:K(R(),z(P()).readonly(),{auth:`admin`}),browse:K(B({path:P()}),mv,{auth:`admin`}),createDir:K(B({path:P()}),B({path:P()}),{kind:`mutation`,auth:`admin`})}},gv=B({inputTokens:F(),outputTokens:F()}),_v=H([`timeout`,`rate-limited`,`auth`,`refusal`,`bad-request`,`unavailable`,`no-profile`,`budget-exceeded`,`adapter-error`]),vv=To(`ok`,[B({ok:U(!0),text:P(),model:P(),usage:gv,truncated:I(),latencyMs:F()}),B({ok:U(!1),code:_v,message:P(),retryAfterMs:F().optional()})]),yv=B({bytes:os(Uint8Array),mimeType:P()}),bv=B({addonId:P().optional(),profileId:P().optional(),consumer:P(),system:P().optional(),prompt:P(),jsonSchema:V(P(),L()).optional(),maxTokens:F().int().positive().optional(),temperature:F().optional()}),xv=To(`kind`,[B({kind:U(`catalog`),catalogId:P()}),B({kind:U(`url`),url:P(),sha256:P().optional()}),B({kind:U(`path`),path:P()})]),Sv=B({nodeId:P(),engine:H([`llama-cpp`]),model:xv,contextSize:F().int().default(4096),gpuLayers:F().int().default(0),threads:F().int().optional(),parallel:F().int().default(1),autoStart:I().default(!1),idleStopMinutes:F().int().default(30)}),Cv=B({nodeId:P(),state:H([`stopped`,`downloading`,`starting`,`ready`,`crashed`,`failed`]),pid:F().optional(),port:F().optional(),modelPath:P().optional(),modelId:P().optional(),downloadProgress:F().min(0).max(1).optional(),lastError:P().optional(),crashesInWindow:F(),memoryBytes:F().optional(),vramBytes:F().optional()}),wv=B({file:P(),sizeBytes:F(),catalogId:P().optional(),installedAt:F().optional()}),Tv=B({nodeId:P(),modelsBytes:F(),freeBytes:F().optional()}),Ev={name:`llm-runtime`,scope:`system`,mode:`singleton`,internal:!0,methods:{complete:K(bv.extend({images:z(yv).optional(),runtime:Sv,timeoutMs:F().int().positive().optional()}),vv,{kind:`mutation`}),ensureStarted:K(B({runtime:Sv}),Cv,{kind:`mutation`,auth:`admin`}),stop:K(B({}),R(),{kind:`mutation`,auth:`admin`}),status:K(B({}),Cv),installModel:K(B({model:xv}),R(),{kind:`mutation`,auth:`admin`}),deleteModel:K(B({file:P()}),R(),{kind:`mutation`,auth:`admin`}),listLocalModels:K(B({}),z(wv)),getDiskUsage:K(B({}),Tv)}},Dv=H([`openai-compatible`,`openai`,`anthropic`,`google`,`managed-local`]),Ov=B({id:P(),name:P(),kind:Dv,addonId:P(),enabled:I(),model:P(),baseUrl:P().optional(),apiKey:P().optional(),supportsVision:I(),temperature:F().min(0).max(2).optional(),maxTokens:F().int().positive().optional(),timeoutMs:F().int().positive().default(6e4),extraHeaders:V(P(),P()).optional(),runtime:Sv.optional()}),kv=L(),Av=B({kind:Dv,label:P(),icon:P(),addonId:P(),configSchema:kv}),jv=Co([B({consumer:P()}),B({purpose:H([`text`,`vision`])})]),Mv=B({selector:jv,profileId:P()}),Nv=B({day:P(),consumer:P(),profileId:P(),calls:F(),okCalls:F(),errorCalls:F(),inputTokens:F(),outputTokens:F(),avgLatencyMs:F()}),Pv=B({id:P(),label:P(),family:P(),purpose:H([`text`,`vision`]),url:P(),sha256:P(),sizeBytes:F(),quantization:P(),minRamBytes:F(),contextSizeDefault:F().int(),mmprojUrl:P().optional()}),Fv=B({nodeId:P(),reachable:I(),status:Cv.optional(),disk:Tv.optional(),error:P().optional()}),Iv=bv.extend({images:z(yv).min(1)}),Lv=B({addonId:P(),profileId:P()}),Rv={name:`llm`,scope:`system`,mode:`collection`,internal:!1,providerKind:`ai`,nodeIdMode:`data`,methods:{generate:K(bv,vv,{kind:`mutation`}),generateVision:K(Iv,vv,{kind:`mutation`}),listProfileKinds:K(B({}),z(Av)),listProfiles:K(B({}),z(Ov)),upsertProfile:K(B({profile:Ov}),Ov,{kind:`mutation`,auth:`admin`}),deleteProfile:K(Lv,R(),{kind:`mutation`,auth:`admin`}),testProfile:K(Lv,vv,{kind:`mutation`,auth:`admin`}),listModels:K(Lv,z(P())),getDefaults:K(B({}),z(Mv)),setDefault:K(B({selector:jv,profileId:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),getUsage:K(B({since:F().optional(),until:F().optional(),consumer:P().optional(),profileId:P().optional()}),z(Nv)),listModelCatalog:K(B({}),z(Pv)),listRuntimeNodes:K(B({}),z(Fv)),listNodeModels:K(B({nodeId:P()}),z(wv)),installModel:K(B({nodeId:P(),model:xv}),R(),{kind:`mutation`,auth:`admin`}),deleteModel:K(B({nodeId:P(),file:P()}),R(),{kind:`mutation`,auth:`admin`}),getRuntimeStatus:K(Lv,Cv),startRuntime:K(Lv,Cv,{kind:`mutation`,auth:`admin`}),stopRuntime:K(Lv,R(),{kind:`mutation`,auth:`admin`})}},zv=H([`debug`,`info`,`warn`,`error`]),Bv=B({timestamp:vo(),level:zv,scope:z(P()),message:P(),meta:V(P(),L()).optional(),tags:V(P(),P()).optional()}),Vv={name:`log-destination`,scope:`system`,mode:`collection`,internal:!0,methods:{write:K(Bv,R(),{kind:`mutation`}),query:K(B({scope:z(P()).optional(),level:zv.optional(),since:vo().optional(),until:vo().optional(),limit:F().optional(),tags:V(P(),P()).optional()}),z(Bv).readonly())},mount:{kind:`skip`}},Hv=H([`primary`,`second-factor`]),Uv=To(`kind`,[B({kind:U(`redirect`),id:P(),label:P(),icon:P().optional(),startUrl:P(),stage:Hv}),B({kind:U(`widget`),id:P(),addonId:P(),bundle:P(),remote:dg,stage:Hv}),B({kind:U(`passkey`),id:P(),label:P(),stage:Hv,rpId:P(),origin:P().nullable()})]),Wv={name:`login-method`,scope:`system`,mode:`collection`,internal:!0,methods:{getLoginMethods:K(R(),z(Uv).readonly())},mount:{kind:`skip`}},Gv=B({total:F(),user:F(),system:F(),irq:F(),nice:F(),loadAvg:ko([F(),F(),F()]),cores:F()}),Kv=B({percent:F(),totalBytes:F(),usedBytes:F(),availableBytes:F(),swapUsedBytes:F(),swapTotalBytes:F()}),qv=B({readBytes:F(),writeBytes:F(),readOps:F(),writeOps:F(),timestampMs:F()}),Jv=B({rxBytes:F(),txBytes:F(),rxPackets:F(),txPackets:F(),rxErrors:F(),txErrors:F(),timestampMs:F()}),Yv=B({utilization:F(),model:P(),memoryUsedBytes:F(),memoryTotalBytes:F(),temperature:F().nullable()}),Xv=B({openFds:F(),threadCount:F(),activeHandles:F(),activeRequests:F()}),Zv=B({avg10:F(),avg60:F(),avg300:F()}),Qv=B({some:Zv,full:Zv.nullable()}),$v=B({cpu:Gv,memory:Kv,gpu:Yv.nullable(),network:Jv,disk:qv,pressure:B({cpu:Qv.nullable(),memory:Qv.nullable(),io:Qv.nullable()}),process:Xv,cpuTemperature:F().nullable(),timestampMs:F()}),ey=B({path:P(),totalBytes:F(),usedBytes:F(),availableBytes:F(),percent:F()}),ty=B({pid:F(),cpu:F(),memory:F(),privateBytes:F().optional(),sharedBytes:F().optional()}),ny=B({addonId:P(),nodeId:P(),role:H([`hub`,`worker`]),pid:F(),state:H([`starting`,`running`,`stopping`,`stopped`,`crashed`]),uptimeSec:F()}),ry=B({pid:F(),ppid:F(),pgid:F(),classification:H([`root`,`managed`,`system`,`ghost`]),addonId:P().nullable(),nodeId:P().nullable(),command:P(),cpuPercent:F(),memoryRssBytes:F(),uptimeSec:F(),orphaned:I()}),iy=B({pid:F(),force:I().optional()}),ay=B({success:I(),reason:P().optional(),signal:H([`SIGTERM`,`SIGKILL`]).optional()}),oy=B({addonId:P()}),sy=B({success:I(),path:P().optional(),pid:F().optional(),reason:P().optional()}),cy=B({cpuPercent:F(),memoryPercent:F(),memoryUsedMB:F(),memoryTotalMB:F(),diskPercent:F().optional(),temperature:F().optional(),gpuPercent:F().optional(),gpuMemoryPercent:F().optional()}),ly={name:`metrics-provider`,scope:`system`,mode:`singleton`,methods:{collectSnapshot:K(R(),$v),getCached:K(R(),$v.nullable()),getCurrent:K(R(),cy),getDiskSpace:K(B({dirPath:P()}),ey),getGpuInfo:K(R(),Yv.nullable()),getCpuTemperature:K(R(),F().nullable()),getProcessStats:K(B({pids:z(F())}),z(ty)),listAddonInstances:K(R(),z(ny).readonly()),getAddonStats:K(B({addonId:P()}),ty.nullable()),listNodeProcesses:K(R(),z(ry).readonly()),killProcess:K(iy,ay,{kind:`mutation`,auth:`admin`}),dumpHeapSnapshot:K(oy,sy,{kind:`mutation`,auth:`admin`})}},uy={name:`model-convert`,scope:`system`,mode:`singleton`,internal:!0,methods:{convert:K(B({sourceUrl:P(),metadata:cc,targets:z(sc).min(1).readonly(),calibrationRef:P().optional(),sessionId:P().optional()}),lc,{kind:`mutation`,auth:`admin`,timeoutMs:6e5})}},dy={name:`model-distributor`,scope:`system`,mode:`singleton`,internal:!0,methods:{distributeModel:K(B({nodeId:P(),modelId:P(),format:H(tc),entry:oc}),B({ok:I(),sha256:P(),bytes:F(),path:P()}),{kind:`mutation`,auth:`admin`})}},fy=H([`external`,`embedded`]),py=H([`connected`,`disconnected`,`auth-failed`,`unreachable`,`tls-error`]),my=B({id:P(),name:P(),url:P(),kind:fy,status:py,latencyMs:F().nullable(),error:P().optional(),connectedClients:F().int().nonnegative().optional(),lastCheckedAt:F().optional()}),hy=B({url:P(),username:P().optional(),password:P().optional(),clientIdPrefix:P().optional()}),gy=B({name:P().min(1),url:P().regex(/^(mqtt|mqtts|ws|wss):\/\//,`URL must start with mqtt(s):// or ws(s)://`),username:P().optional(),password:P().optional(),clientIdPrefix:P().optional()}),_y=B({id:P()}),vy=B({id:P()}),yy=To(`ok`,[B({ok:U(!0),latencyMs:F()}),B({ok:U(!1),error:P()})]),by=B({port:F().int().min(1).max(65535).default(1883),allowAnonymous:I().default(!1),username:P().optional(),password:P().optional()}),xy=B({id:P(),url:P()}),Sy=B({brokerCount:F(),embeddedRunning:I()}),Cy={name:`mqtt-broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:Sy,kind:`poll`},methods:{listBrokers:K(R(),z(my)),getBrokerConfig:K(vy,hy),addBroker:K(gy,_y,{kind:`mutation`}),removeBroker:K(vy,R(),{kind:`mutation`}),testConnection:K(vy,yy,{kind:`mutation`}),startEmbeddedBroker:K(by,xy,{kind:`mutation`}),stopEmbeddedBroker:K(vy,R(),{kind:`mutation`}),getStatus:K(R(),Sy)}},wy=B({url:P(),hostname:P(),port:F(),protocol:H([`http`,`https`])}),Ty=B({connected:I(),endpoint:wy.nullable(),error:P().optional()}),Ey=wy.extend({id:P(),label:P(),mode:P().optional(),sourcePort:F().optional()}),Dy={name:`network-access`,scope:`system`,mode:`collection`,providerKind:`ingress`,methods:{start:K(R(),wy,{kind:`mutation`}),stop:K(R(),R(),{kind:`mutation`}),getEndpoint:K(R(),wy.nullable()),getStatus:K(R(),Ty),listEndpoints:K(R(),z(Ey).readonly())}},Oy=H([`image`,`video`,`gif`,`audio`,`icon`]),ky=B({mediaType:Oy,url:P().optional(),bytes:os(Uint8Array).optional(),mime:P().optional(),name:P().optional()}).refine(e=>e.url!==void 0||e.bytes!==void 0,{message:"Attachment requires either `url` or `bytes`"}),Ay=H([`text`,`markdown`,`html`]),jy=B({id:P(),label:P(),url:P().optional()}),My=B({body:P(),title:P().optional(),format:Ay.default(`text`),priority:F().int().min(1).max(5).default(3),level:P().optional(),attachments:z(ky).optional(),clickUrl:P().optional(),actions:z(jy).optional(),sound:P().optional(),ttl:F().optional(),tag:P().optional(),deviceId:F().optional(),eventId:P().optional(),metadata:V(P(),L()).optional()}),Ny=B({id:P(),label:P(),ordinal:F().int().min(1).max(5).nullable(),flags:B({critical:I().optional(),silent:I().optional(),noPush:I().optional()}).optional(),requires:z(P()).optional(),description:P().optional()}),Py=B({attachments:B({mediaTypes:z(Oy),mode:H([`url`,`bytes`,`both`]),max:F().int().nonnegative(),maxBytes:F().int().positive().optional()}),actions:F().int().nonnegative(),levels:z(Ny),format:z(Ay),clickUrl:I(),sound:I(),ttl:I(),bodyMaxLen:F().int().positive()}),Fy=L(),Iy=B({kind:P(),label:P(),icon:P(),addonId:P(),iconUrl:P().optional(),iconMediaType:P().optional(),configSchema:Fy,supportsDiscovery:I(),caps:Py}),Ly=B({id:P(),name:P(),kind:P(),addonId:P(),enabled:I(),config:V(P(),L())}),Ry=B({kind:P(),suggestedName:P(),config:V(P(),L())}),zy=B({level:P(),format:Ay,attachmentsSent:F().int().nonnegative(),actionsSent:F().int().nonnegative(),truncated:I(),dropped:z(P())}),By=B({success:I(),error:P().optional(),renderedAs:zy.optional()}),Vy=By,Hy={name:`notification-output`,scope:`system`,mode:`collection`,methods:{listTargetKinds:K(B({}),z(Iy)),listTargets:K(B({}),z(Ly)),discoverTargets:K(B({kind:P(),config:V(P(),L()).optional()}),z(Ry)),send:K(B({targetId:P(),notification:My}),By,{kind:`mutation`}),testTarget:K(B({targetId:P(),sample:My.optional()}),Vy,{kind:`mutation`}),upsertTarget:K(B({target:Ly}),Ly,{kind:`mutation`}),deleteTarget:K(B({targetId:P()}),R(),{kind:`mutation`}),setTargetEnabled:K(B({targetId:P(),enabled:I()}),R(),{kind:`mutation`})}},Uy=H([`view`,`create`,`delete`]),Wy=Co([U(`*`),z(P())]),Gy=V(P(),Co([U(`*`),z(P())])),Ky=H([`device`,`system`]),qy=To(`type`,[B({type:U(`category`),target:Ky,access:z(Uy).min(1)}),B({type:U(`capability`),target:P(),access:z(Uy).min(1)}),B({type:U(`addon`),target:P(),access:z(Uy).min(1)}),B({type:U(`device`),targets:z(P()).min(1),access:z(Uy).min(1)})]);B({id:P(),username:P(),passwordHash:P(),isAdmin:I().default(!1),allowedProviders:Wy,allowedDevices:Gy,scopes:z(qy).default([]),createdAt:F(),updatedAt:F()}),B({id:P(),label:P(),isAdmin:I().default(!1),allowedProviders:Wy,allowedDevices:Gy,tokenHash:P(),tokenPrefix:P(),createdAt:F(),lastUsedAt:F().optional()}),B({id:P(),userId:P(),name:P(),tokenHash:P(),tokenPrefix:P(),scopes:z(qy),expiresAt:F().nullish(),lastUsedAt:F().nullish(),createdAt:F()});var Jy=B({integrationId:P(),displayName:P(),requestedScopes:z(qy),allowedRedirectPrefixes:z(P()).min(1),hubUrl:P().optional()}),Yy={name:`oauth-integration`,scope:`system`,mode:`collection`,internal:!0,methods:{getDescriptor:K(R(),Jy)}},Xy=H([`new`,`entered`,`left`,`moving`,`idle`]),Zy=H([`motion`,`object`,`audio`]),Qy=To(`kind`,[kl,Al]),$y=H([`motion`,`audio`,`person`,`vehicle`,`animal`,`door`,`pir`,`smoke`,`water`,`button`,`package`,`generic`]),eb=H([`motion`,`audio`,`detection`,`sensor`,`control`,`custom`,`package`]),tb=H([`macro`,`sub`]),nb=B({kind:P(),labelKey:P(),label:P(),color:P(),iconId:P(),icon:$y,category:eb,parentKind:P().nullable(),level:tb,source:B({capName:P(),deviceId:F()})}),rb=B({id:P(),deviceId:F(),sourceDeviceId:F(),kind:P(),value:V(P(),L()).nullable(),timestamp:F()}),ib=B({x:F(),y:F(),timestamp:F(),bbox:wf}),ab=B({timestamp:F(),position:ib,mediaKey:P()}),ob=B({minX:F(),minY:F(),maxX:F(),maxY:F()}),sb=H([`full`,`slim`]),cb=B({label:P(),peakScore:F(),count:F(),firstAt:F(),lastAt:F()}),lb=H([`pipeline`,`sensor`]),ub=B({trackId:P(),deviceId:F(),className:P(),label:P().optional(),producingDeviceName:P().optional(),source:lb.optional(),firstSeen:F(),lastSeen:F(),positions:z(ib).readonly(),snapshots:z(ab).readonly(),zonesVisited:z(P()).readonly(),classes:z(P()).readonly().optional(),totalDistance:F(),state:Xy,active:I(),importance:F().optional(),bestEventId:P().optional(),importanceReason:P().optional(),audioLabels:z(cb).readonly().optional(),envelope:ob.optional()}),db={id:P(),deviceId:F(),timestamp:F()},fb=B({...db,kind:U(`motion`),regionCount:F(),regions:z(B({bbox:wf,pixelCount:F(),intensity:F()})).readonly().optional(),frameWidth:F().optional(),frameHeight:F().optional(),mediaUrl:P().optional()}),pb=H([`pipeline`,`onboard`]),mb=B({direction:H([`enter`,`exit`]),zoneId:P(),zoneName:P().optional()}),hb=B({...db,kind:U(`object`),source:pb.optional(),frameId:P().optional(),trackId:P().optional(),className:P(),label:P().optional(),confidence:F().optional(),bbox:wf.optional(),zones:z(P()).readonly().optional(),state:Xy.optional(),zoneCrossing:mb.optional(),frameWidth:F().optional(),frameHeight:F().optional(),mediaKey:P().optional(),keyFrameMediaKey:P().optional(),mediaUrl:P().optional(),importance:F().optional()}),gb=B({...db,kind:U(`audio`),rms:F(),dbfs:F(),classification:B({className:P(),originalClass:P().optional(),score:F()}).optional(),mediaUrl:P().optional()}),_b=H([`crop`,`thumbnail`,`snapshot`,`firstFrame`,`lastFrame`,`fullFrame`,`fullFrameBoxed`,`faceCrop`,`plateCrop`,`keyFrame`,`keyFrameSmall`,`thumbnailSmall`]),vb=B({key:P(),kind:_b,base64:P(),sizeBytes:F(),timestamp:F()}),yb=1e3,bb=5e3,xb=B({deviceId:F(),since:F().optional(),until:F().optional(),limit:F().int().min(1).max(bb).default(yb),projection:H([`full`,`slim`]).optional()}),Sb=xb.extend({classFilter:P().optional()}),Cb=B({deviceIds:z(F()),since:F().optional(),until:F().optional(),limit:F().int().min(1).max(1e3).default(200),cursor:P().optional(),projection:sb.optional()}),wb=B({tracks:z(ub).readonly(),nextCursor:P().nullable()}),Tb=B({deviceId:F(),since:F(),until:F(),limit:F().int().min(1).max(200).default(50),minImportance:F().min(0).max(1).optional(),classFilter:P().optional()}),Eb=B({id:P(),trackId:P(),timestamp:F(),className:P(),label:P().optional(),importance:F(),bestEventId:P(),windowMs:F().optional()});B({trackId:P(),className:P(),confidence:F(),bbox:wf,zones:z(P()).readonly(),state:Xy});var Db=xo({id:P(),kind:H([`first-level`,`detail`]),macroClass:P(),score:F(),bbox:B({x:F(),y:F(),width:F(),height:F()}),labels:z(xo({label:P(),score:F()})).readonly(),parentId:P().optional()}),Ob=hb.extend({score:F()}),kb=B({text:P(),deviceId:F().optional(),since:F().optional(),until:F().optional(),classFilter:P().optional(),limit:F().default(50),minScore:F().min(0).max(1).default(.2)}),Ab=B({tracks:F().int(),events:F().int(),media:F().int(),faces:F().int(),plates:F().int(),embeddings:F().int()}),jb=B({deviceId:F(),rows:F().int(),bytes:F().int()}),Mb=B({totalRows:F().int(),totalBytes:F().int(),devices:z(jb).readonly()}),Nb=B({motion:F().int(),object:F().int(),audio:F().int()}),Pb={name:`pipeline-analytics`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[W.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:K(B({deviceId:F()}),z(ub).readonly()),getTrack:K(B({deviceId:F(),trackId:P()}),ub.nullable()),listTracks:K(B({deviceId:F(),since:F().optional(),until:F().optional(),limit:F().optional(),zone:Qy.optional(),projection:sb.optional()}),z(ub).readonly()),listRecentTracks:K(Cb,wb),clearTracks:K(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`}),getMotionEvents:K(xb,z(fb).readonly()),getObjectEvents:K(Sb,z(hb).readonly()),getAudioEvents:K(xb,z(gb).readonly()),listEventKinds:K(B({deviceId:F()}),z(nb).readonly()),getSensorEvents:K(B({deviceId:F(),since:F().optional(),until:F().optional(),kinds:z(P()).optional(),limit:F().int().min(1).max(bb).default(yb)}),z(rb).readonly()),getKeyEvents:K(Tb,z(Eb).readonly()),getEventDensity:K(B({deviceId:F(),since:F(),until:F(),bucketMs:F().int().positive()}),z(B({bucketStart:F(),motion:F().int(),object:F().int(),audio:F().int()})).readonly()),pruneEventsBefore:K(B({deviceId:F(),cutoffMs:F()}),B({motion:F().int(),object:F().int(),audio:F().int()}),{kind:`mutation`,auth:`admin`}),pruneTracksBefore:K(B({deviceId:F(),cutoffMs:F()}),Ab,{kind:`mutation`,auth:`admin`}),wipeAllAnalytics:K(B({deviceId:F()}),Ab,{kind:`mutation`,auth:`admin`}),deleteTracks:K(B({deviceId:F(),trackIds:z(P()).min(1)}),B({deleted:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`}),getEventStoreFootprint:K(B({}),Mb,{kind:`query`,auth:`admin`}),pruneEvents:K(B({olderThanMs:F(),reason:Sc.optional()}),Nb,{kind:`mutation`,auth:`admin`}),deleteDeviceEvents:K(B({deviceId:F()}),Nb,{kind:`mutation`,auth:`admin`}),relocateMedia:K(Oc,B({jobId:P()}),{kind:`mutation`,auth:`admin`}),getMediaRelocateStatus:K(B({}),z(Ec).readonly(),{kind:`query`,auth:`admin`}),cancelMediaRelocate:K(B({jobId:P()}),B({cancelled:I()}),{kind:`mutation`,auth:`admin`}),listOpsLog:K(wc,z(Cc).readonly(),{kind:`query`,auth:`admin`}),getEventMedia:K(B({eventId:P(),kind:_b.optional()}),z(vb).readonly()),getTrackMedia:K(B({trackId:P(),kinds:z(_b).optional()}),z(vb).readonly()),searchObjectEvents:K(kb,z(Ob).readonly())},events:{onFrameTracked:{data:B({deviceId:F(),timestamp:F(),frameWidth:F(),frameHeight:F(),detections:z(Db).readonly()})},onTrackStarted:{data:B({deviceId:F(),trackId:P(),className:P()})},onTrackEnded:{data:B({deviceId:F(),trackId:P(),className:P(),durationMs:F()})},onDetectionEvent:{data:B({deviceId:F(),kind:Zy,eventId:P(),timestamp:F()})}}},Fb=B({engine:If.optional(),steps:z(qf).readonly(),audio:B({engine:If.optional(),modelId:P().optional(),enabled:I(),settings:V(P(),L()).readonly().optional()}).nullable().optional()}),Ib=B({id:P(),name:P(),description:P().optional(),config:Fb,createdAt:P(),updatedAt:P()}),Lb=B({modelId:P().optional(),settings:V(P(),L()).optional(),jumpDeviceKey:P().optional()}),Rb=B({maxCameras:F().int().nonnegative().nullable().default(null),detectWeight:F().positive().optional(),detect:I().optional(),decode:I().optional(),audio:I().optional(),ingest:I().optional(),reachableHost:P().optional(),inferenceDevices:V(P(),B({enabled:I(),weight:F().positive().optional(),maxSessions:F().int().positive().optional(),steps:V(P(),Lb).optional()})).optional()}),zb=B({steps:z(qf).readonly(),audio:B({modelId:P(),enabled:I()}).nullable()}),Bb=B({modelId:P().optional(),settings:V(P(),L()).readonly().optional()}),Vb=B({pinnedAgentNodeId:P().optional(),stepToggles:V(P(),I()).optional(),stepOverridesByDevice:V(P(),V(P(),V(P(),Bb))).optional(),pipelineByAgent:V(P(),zb).optional()}),Hb=B({deviceId:F(),agentNodeId:P(),pinned:I(),reason:H([`manual`,`capacity`,`hardware-affinity`,`failover`,`rebalance`]),assignedAt:F()}),Ub=B({nodeId:P(),online:I(),load:Mp,score:F(),decodeHwaccel:P().nullable()}),Wb=B({totalAgents:F(),onlineAgents:F(),totalCameras:F(),attachedCameras:F(),activeCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()}),Gb=V(P(),P()),Kb=B({ownerNodeId:P(),reachableHost:P().optional(),configIssue:P().optional()}),qb=B({streams:z(B({camStreamId:P(),codec:P(),width:F(),height:F(),fps:F(),kind:P()})).readonly()}),Jb=B({detectionNodeId:P().nullable(),decoderNodeId:P().nullable(),audioNodeId:P().nullable(),sourceNodeId:P().nullable(),pinned:B({detection:I(),decoder:I(),audio:I()}),reasons:B({detection:P().optional(),decoder:P().optional(),audio:P().optional()})}),Yb=B({profiles:z(B({profile:P(),status:P(),codec:P(),width:F(),height:F(),subscribers:F(),inFps:F(),outFps:F()})).readonly(),webrtcSessions:F(),rtspRestream:I()}),Xb=B({framesWritten:F(),getFrameHits:F(),getFrameMisses:F(),budgetMb:F()}),Zb=B({nodeId:P(),formats:z(P()).readonly(),sessionCount:F(),shm:Xb}),Qb=B({enabled:I(),fps:F()}),$b=B({state:H([`idle`,`installing`,`verifying`,`ready`,`failed`]),error:P().optional()}),ex=H([`idle`,`watching`,`active`]),tx=B({nodeId:P(),engine:B({backend:P(),device:P()}),phase:ex,configuredFps:F(),actualFps:F(),queueDepth:F(),avgInferenceMs:F(),provisioning:$b}),nx=B({nodeId:P(),enabled:I()}),rx=B({mode:H([`off`,`continuous`,`events`]),active:I(),storageBytes:F()}),ix=B({deviceId:F(),assignment:Jb,source:qb,broker:Yb.nullable(),decoder:Zb.nullable(),motion:Qb.nullable(),detection:tx.nullable(),audio:nx.nullable(),recording:rx.nullable(),fetchedAt:F()}),ax=B({key:P(),backend:P(),device:P(),format:H(tc),available:I(),enabled:I(),weight:F(),maxSessions:F().nullable(),defaultModelId:P(),steps:V(P(),Lb).optional()}),ox=B({nodeId:P(),reachable:I(),devices:z(ax).readonly()}),sx={name:`pipeline-orchestrator`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,exposesDeviceSettings:!0,methods:{assignPipeline:K(B({deviceId:F(),agentNodeId:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),unassignPipeline:K(B({deviceId:F()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),setPipelineDevicePin:K(B({deviceId:F(),deviceKey:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),getPipelineDevicePin:K(B({deviceId:F()}),B({deviceKey:P().nullable()})),rebalance:K(R(),B({migrated:F()}),{kind:`mutation`,auth:`admin`}),getPipelineAssignments:K(R(),z(Hb).readonly()),getPipelineAssignment:K(B({deviceId:F()}),Hb.nullable()),getAgentLoad:K(R(),z(Ub).readonly()),getGlobalMetrics:K(R(),Wb),getCameraMetrics:K(B({deviceId:F()}),jf.nullable()),getCapabilityBindings:K(B({nodeId:P()}),Gb),setCapabilityBinding:K(B({nodeId:P(),capName:P(),addonId:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),getIngestOwner:K(R(),Kb),assignAudio:K(B({deviceId:F(),nodeId:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),unassignAudio:K(B({deviceId:F()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),getAudioAssignment:K(B({deviceId:F()}),B({nodeId:P(),pinned:I(),assignedAt:F()}).nullable()),getAudioNodeLoad:K(R(),z(B({nodeId:P(),deviceCount:F()}))),getAudioAssignments:K(R(),z(B({deviceId:F(),nodeId:P(),pinned:I(),assignedAt:F()}))),getAgentSettings:K(B({agentNodeId:P()}),Rb.nullable()),listAgentSettings:K(R(),z(B({nodeId:P(),settings:Rb})).readonly()),removeAgentSettings:K(B({agentNodeId:P()}),B({success:I(),removed:I()}),{kind:`mutation`,auth:`admin`}),setAgentMaxCameras:K(B({agentNodeId:P(),maxCameras:F().int().nonnegative().nullable()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),setAgentDetectWeight:K(B({agentNodeId:P(),detectWeight:F().positive().nullable()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),setAgentCapabilities:K(B({agentNodeId:P(),detect:I().nullable().optional(),audio:I().nullable().optional(),ingest:I().nullable().optional()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),setAgentReachableHost:K(B({agentNodeId:P(),reachableHost:P().nullable()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),setAgentInferenceDevices:K(B({agentNodeId:P(),inferenceDevices:V(P(),B({enabled:I(),weight:F().positive().optional(),maxSessions:F().int().positive().optional(),steps:V(P(),Lb).optional()}))}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),getNodeInferenceDevices:K(B({nodeId:P()}),ox),resetNodePipelineDefaults:K(B({agentNodeId:P()}),B({success:U(!0),effectiveModelId:P().nullable(),clearedCameraOverrides:F()}),{kind:`mutation`,auth:`admin`}),getCameraSettings:K(B({deviceId:F()}),Vb.nullable()),setCameraStepToggle:K(B({deviceId:F(),addonId:P(),enabled:I().nullable()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),getCameraStepOverrides:K(B({deviceId:F()}),V(P(),V(P(),V(P(),Bb))).nullable()),setCameraStepOverride:K(B({deviceId:F(),agentNodeId:P(),deviceKey:P(),addonId:P(),patch:Bb.nullable()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),setCameraPipelineForAgent:K(B({deviceId:F(),agentNodeId:P(),pipeline:zb.nullable()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),resolvePipeline:K(B({deviceId:F(),agentNodeId:P().optional()}),Fb),getCameraStatus:K(B({deviceId:F()}),ix),getCameraStatuses:K(B({deviceIds:z(F()).optional()}),z(ix).readonly()),listTemplates:K(R(),z(Ib).readonly()),saveTemplate:K(B({name:P(),description:P().optional(),config:Fb}),Ib,{kind:`mutation`,auth:`admin`}),updateTemplate:K(B({id:P(),name:P().optional(),description:P().optional(),config:Fb.optional()}),Ib,{kind:`mutation`,auth:`admin`}),deleteTemplate:K(B({id:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`})}},cx={motion:`motion`,audio:`audio`,person:`person`,vehicle:`vehicle`,animal:`animal`,package:`package`,door:`door`,pir:`pir`,smoke:`smoke`,water:`water`,button:`button`,generic:`generic`,gas:`smoke`,vibration:`generic`,tamper:`generic`,presence:`person`,lock:`generic`,siren:`generic`,switch:`generic`,doorbell:`button`};function lx(e){return cx[e]??`generic`}var ux={contact:`contact`,motion:`motion-sensor`,smoke:`smoke`,flood:`flood`,gas:`gas`,"carbon-monoxide":`carbon-monoxide`,vibration:`vibration`,tamper:`tamper`,presence:`presence`,"enum-sensor":`enum-sensor`,"event-emitter":`device-event`,"lock-control":`lock`,switch:`switch`,button:`button`,doorbell:`doorbell`};function dx(e,t){let n=qc[t];if(n===void 0)throw Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:lx(n.iconId)}}Object.freeze(Object.fromEntries(Object.entries(ux).map(([e,t])=>[e,dx(e,t)])));var fx=H([`workspace`,`baked`,`data-root`]),px=H([`idle`,`checking`,`staging`,`pending-restart`,`awaiting-confirmation`]),mx=B({fromVersion:P(),toVersion:P().nullable(),atMs:F(),reason:P()}),hx=B({packageName:P(),runningVersion:P().nullable(),nodeRuntimeVersion:P().nullable(),activeVersion:P().nullable(),previousVersion:P().nullable(),seedVersion:P().nullable(),latestVersion:P().nullable(),updateAvailable:I(),bootMode:fx,updateState:px,pendingVersion:P().nullable(),rolledBack:mx.nullable(),stateFileCorrupt:I(),lastCheckedAtMs:F().nullable()}),gx=B({packageName:P(),runningVersion:P().nullable(),latestVersion:P().nullable(),updateAvailable:I(),checkedAtMs:F(),error:P().nullable()}),_x=B({accepted:I(),targetVersion:P().nullable(),restarting:I(),message:P()}),vx={name:`server-management`,scope:`system`,mode:`singleton`,methods:{getServerPackageStatus:K(R(),hx,{auth:`admin`}),checkServerUpdate:K(R(),gx,{kind:`mutation`,auth:`admin`}),applyServerUpdate:K(B({version:P().optional()}),_x,{kind:`mutation`,auth:`admin`,timeoutMs:16*6e4}),rollbackServerUpdate:K(R(),_x,{kind:`mutation`,auth:`admin`}),restartServer:K(R(),_x,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},yx=B({where:V(P(),L()).optional(),whereIn:V(P(),z(L())).optional(),whereBetween:V(P(),ko([L(),L()])).optional(),orderBy:B({field:P(),direction:H([`asc`,`desc`])}).optional(),limit:F().optional(),offset:F().optional()}),bx=B({id:P(),data:V(P(),L())}),xx=B({name:P(),type:H([`TEXT`,`INTEGER`,`REAL`,`JSON`,`BOOLEAN`]),primaryKey:I().optional(),notNull:I().optional(),unique:I().optional()}),Sx=B({name:P(),columns:z(P()).readonly(),unique:I().optional()}),Cx={name:`settings-store`,scope:`system`,mode:`singleton`,methods:{get:K(B({namespace:P().optional(),collection:P(),key:P()}),L()),set:K(B({namespace:P().optional(),collection:P(),key:P(),value:L()}),R(),{kind:`mutation`}),query:K(B({namespace:P().optional(),collection:P(),filter:yx.optional()}),z(bx).readonly()),insert:K(B({namespace:P().optional(),collection:P(),record:bx}),R(),{kind:`mutation`}),update:K(B({namespace:P().optional(),collection:P(),id:P(),data:V(P(),L())}),R(),{kind:`mutation`}),delete:K(B({namespace:P().optional(),collection:P(),key:P()}),R(),{kind:`mutation`}),count:K(B({namespace:P().optional(),collection:P(),filter:yx.optional()}),F()),histogram:K(B({namespace:P().optional(),collection:P(),field:P(),bucketSize:F().int().positive(),origin:F().int(),filter:yx.optional()}),z(B({bucket:F().int(),count:F().int()})).readonly()),isEmpty:K(B({namespace:P().optional(),collection:P()}),I()),declareCollection:K(B({namespace:P().optional(),collection:P(),columns:z(xx).readonly(),indexes:z(Sx).readonly().optional()}),R(),{kind:`mutation`})}},wx=Ra(),Tx=B({to:Co([wx,z(wx).min(1)]),cc:z(wx).optional(),bcc:z(wx).optional(),from:P().optional(),replyTo:P().optional(),subject:P(),text:P(),html:P().optional()}),Ex=B({messageId:P(),accepted:z(wx).default([]),rejected:z(wx).default([])}),Dx=B({ready:I(),host:P(),error:P().optional(),lastVerifiedAt:F().optional()}),Ox={name:`smtp-provider`,scope:`system`,mode:`collection`,internal:!0,providerKind:`email`,methods:{sendEmail:K(Tx,Ex,{kind:`mutation`,auth:`admin`,access:`create`}),verify:K(R(),Dx,{kind:`mutation`,auth:`admin`,access:`view`}),getStatus:K(R(),Dx,{auth:`admin`})}},kx=B({base64:P(),contentType:P()}),Ax=B({lastCapturedAt:F().nullable(),cacheAgeMs:F().nullable(),lastBytes:F().nullable(),lastStreamId:P().nullable()}),jx={name:`snapshot`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[W.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:K(B({deviceId:F(),streamId:P().optional(),force:I().optional()}),kx.nullable()),invalidateCache:K(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`}),getSnapshotOverview:Ns(B({deviceIds:z(F()).min(1).max(200)}),z(B({deviceId:F(),lastCapturedAt:F().nullable(),cacheAgeMs:F().nullable(),etag:P().nullable()})))},status:{schema:Ax,kind:`poll`}},Mx=B({userId:P(),username:P(),isAdmin:I(),provider:P(),email:P().optional(),displayName:P().optional(),hubUrl:P().optional(),scopes:z(qy).optional(),redirectUri:P().optional(),integrationId:P().optional(),jti:P().optional(),sessionId:P().optional()}),Nx={name:`sso-bridge`,scope:`system`,mode:`singleton`,internal:!0,methods:{signBridgeToken:K(B({claims:Mx,ttlSec:F().int().positive().optional()}),B({token:P()})),verifyBridgeToken:K(B({token:P()}),Mx.nullable())}},Px=To(`shouldSaveDiskSpace`,[B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:U(!0),minFreePercent:F().min(0).max(100)}),B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:U(!1),minFreePercent:U(null)})]),Fx={name:`storage`,scope:`system`,mode:`singleton`,methods:{resolve:K(B({location:jc,relativePath:P()}),P()),write:K(B({location:jc,relativePath:P(),data:os(Uint8Array)}),R(),{kind:`mutation`}),read:K(B({location:jc,relativePath:P()}),os(Uint8Array)),exists:K(B({location:jc,relativePath:P()}),I()),list:K(B({location:jc,prefix:P().optional()}),z(P()).readonly()),delete:K(B({location:jc,relativePath:P()}),R(),{kind:`mutation`}),getAvailableSpace:K(B({location:jc}),F().nullable()),beginUpload:K(B({location:jc,relativePath:P(),sizeBytes:F().optional()}),B({uploadId:P()}),{kind:`mutation`}),writeChunk:K(B({uploadId:P(),offset:F(),data:os(Uint8Array)}),R(),{kind:`mutation`}),finalizeUpload:K(B({uploadId:P()}),R(),{kind:`mutation`}),abortUpload:K(B({uploadId:P()}),R(),{kind:`mutation`}),beginDownload:K(B({location:jc,relativePath:P()}),B({downloadId:P(),sizeBytes:F()}),{kind:`mutation`}),readChunk:K(B({downloadId:P(),offset:F(),length:F()}),os(Uint8Array)),endDownload:K(B({downloadId:P()}),R(),{kind:`mutation`}),listLocations:K(B({type:kc.optional()}),z(Ac).readonly()),getDefaultLocation:K(B({type:kc}),Ac.nullable()),listLocationDeclarations:K(R(),z(Mc).readonly()),upsertLocation:K(Ac.omit({createdAt:!0,updatedAt:!0}),Ac,{kind:`mutation`,auth:`admin`}),deleteLocation:K(B({id:P()}),R(),{kind:`mutation`,auth:`admin`}),testLocation:K(B({id:P()}),B({ok:I(),error:P().optional()}),{auth:`admin`}),listProviders:K(R(),z(Px).readonly()),testConfig:K(B({providerId:P(),config:V(P(),L())}),B({ok:I(),error:P().optional()}),{auth:`admin`})}},Ix=B({bytes:F().int().nonnegative()}),Lx=B({reclaimedBytes:F().int().nonnegative(),exhausted:I()}),Rx={name:`storage-evictable`,scope:`system`,mode:`collection`,internal:!0,methods:{getEvictableUsage:K(B({locationId:P()}),Ix),evict:K(B({locationId:P(),targetBytes:F().int().positive()}),Lx,{kind:`mutation`})}},zx=To(`shouldSaveDiskSpace`,[B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:U(!0),minFreePercent:F().min(0).max(100)}),B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:U(!1),minFreePercent:U(null)})]),Bx=B({ok:I(),error:P().optional()}),Vx=B({location:Ac,relativePath:P(),sizeBytes:F().optional()}),Hx=B({uploadId:P()}),Ux=B({uploadId:P(),offset:F(),data:os(Uint8Array)}),Wx=B({uploadId:P()}),Gx=B({uploadId:P()}),Kx=B({location:Ac,relativePath:P()}),qx=B({downloadId:P(),sizeBytes:F()}),Jx=B({downloadId:P(),offset:F(),length:F()}),Yx=B({downloadId:P()}),Xx={name:`storage-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getProviderInfo:K(R(),zx),testLocation:K(B({config:V(P(),L())}),Bx,{auth:`admin`}),resolve:K(B({location:Ac,relativePath:P()}),P()),write:K(B({location:Ac,relativePath:P(),data:os(Uint8Array)}),R(),{kind:`mutation`}),read:K(B({location:Ac,relativePath:P()}),os(Uint8Array)),exists:K(B({location:Ac,relativePath:P()}),I()),list:K(B({location:Ac,prefix:P().optional()}),z(P()).readonly()),delete:K(B({location:Ac,relativePath:P()}),R(),{kind:`mutation`}),getAvailableSpace:K(B({location:Ac}),F().nullable()),beginUpload:K(Vx,Hx,{kind:`mutation`}),writeChunk:K(Ux,R(),{kind:`mutation`}),finalizeUpload:K(Wx,R(),{kind:`mutation`}),abortUpload:K(Gx,R(),{kind:`mutation`}),beginDownload:K(Kx,qx,{kind:`mutation`}),readChunk:K(Jx,os(Uint8Array)),endDownload:K(Yx,R(),{kind:`mutation`})}},Zx=B({urls:Co([P(),z(P())]),username:P().optional(),credential:P().optional()}),Qx={name:`turn-provider`,scope:`system`,mode:`collection`,methods:{getTurnServers:K(R(),z(Zx).readonly())}},$x=B({credentialId:P(),label:P(),createdAt:F(),lastUsedAt:F().nullable(),transports:z(P()).default([])}),eS={name:`user-passkeys`,scope:`system`,mode:`collection`,internal:!0,methods:{beginRegistration:K(B({userId:P(),username:P()}),B({optionsJSON:V(P(),L())}),{kind:`mutation`,auth:`admin`,access:`create`}),finishRegistration:K(B({userId:P(),response:V(P(),L()),label:P()}),B({success:U(!0),credentialId:P()}),{kind:`mutation`,auth:`admin`,access:`create`}),beginAuthentication:K(B({userId:P().optional()}),B({optionsJSON:V(P(),L())}),{kind:`mutation`,access:`view`}),finishAuthentication:K(B({userId:P(),response:V(P(),L())}),B({verified:I()}),{kind:`mutation`,access:`view`}),beginDiscoverableAuthentication:K(B({}),B({optionsJSON:V(P(),L())}),{kind:`mutation`,access:`view`}),finishDiscoverableAuthentication:K(B({response:V(P(),L())}),B({verified:I(),userId:P().nullable()}),{kind:`mutation`,access:`view`}),listPasskeys:K(B({userId:P()}),z($x),{auth:`admin`}),removePasskey:K(B({userId:P(),credentialId:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getSecondFactorPreference:K(B({userId:P()}),B({enabled:I()}),{auth:`admin`}),setSecondFactorPreference:K(B({userId:P(),enabled:I()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`create`})}},tS=B({id:P(),source:P(),kind:H([`motion`,`object`,`audio`,`native`]),timeRange:B({startMs:F(),endMs:F()}),thumbnail:P().optional()}),nS=B({playbackUrl:P(),playbackEndpoints:z(P()).optional(),token:P().optional()}),rS={name:`videoclips`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,methods:{listClips:K(B({deviceId:F(),since:F(),until:F(),limit:F().int().positive().optional()}),z(tS).readonly(),{kind:`query`,auth:`admin`}),getClipPlayback:K(B({deviceId:F(),clipId:P()}),nS,{kind:`query`,auth:`admin`})}},iS=B({viewportWidth:F().int().positive().optional(),viewportHeight:F().int().positive().optional(),devicePixelRatio:F().positive().optional(),downlinkMbps:F().nonnegative().optional(),prefersTier:P().optional()}).partial(),aS=To(`kind`,[B({kind:U(`adaptive`)}),B({kind:U(`profile`),profile:ps}),B({kind:U(`cam-stream`),camStreamId:P().min(1)})]),oS=B({id:P(),label:P(),target:aS,codec:P().nullable(),resolution:B({width:F(),height:F()}).nullable(),status:H([`idle`,`connecting`,`streaming`,`error`,`stopped`]).nullable(),inputFps:F().nullable(),decodeFps:F().nullable(),bitrateKbps:F().nullable()}),sS={name:`webrtc-session`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,preferredProvider:`stream-broker`,deviceTypes:[W.Camera],methods:{listStreams:K(B({deviceId:F().int().nonnegative()}),z(oS)),createSession:K(B({deviceId:F().int().nonnegative(),target:aS,hints:iS.optional(),relayOnly:I().optional(),consumerAttribution:Vu.optional()}),B({sessionId:P(),sdpOffer:P()}),{kind:`mutation`}),handleOffer:K(B({deviceId:F().int().nonnegative(),target:aS.optional(),sdpOffer:P(),sessionId:P().optional(),relayOnly:I().optional(),nonTrickle:I().optional(),disableTurn:I().optional(),disableIpv6:I().optional(),consumerAttribution:Vu.optional(),hints:iS.optional()}),B({sessionId:P(),sdpAnswer:P()}),{kind:`mutation`}),handleAnswer:K(B({deviceId:F().int().nonnegative(),sessionId:P(),sdpAnswer:P()}),R(),{kind:`mutation`}),addIceCandidate:K(B({deviceId:F().int().nonnegative(),sessionId:P(),candidate:P(),sdpMid:P().nullable().optional(),sdpMLineIndex:F().int().nullable().optional()}),R(),{kind:`mutation`}),getIceCandidates:K(B({deviceId:F().int().nonnegative(),sessionId:P()}),B({candidates:z(B({candidate:P(),sdpMid:P().nullable(),sdpMLineIndex:F().int().nullable()})),done:I()}),{kind:`query`}),closeSession:K(B({deviceId:F().int().nonnegative(),sessionId:P()}),R(),{kind:`mutation`}),hasAdaptiveBitrate:K(B({deviceId:F().int().nonnegative(),profile:ps}),I()),getSessionState:K(B({deviceId:F().int().nonnegative(),sessionId:P()}),B({pendingRenegotiation:B({target:aS,epoch:F()}).nullable()}))},mount:{kind:`server-provided`}},cS=B({childDeviceIds:z(F()).readonly(),hiddenChildIds:z(F()).readonly()}),lS={name:`accessories`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera,W.Hub,W.Switch,W.Light,W.Sensor,W.Thermostat,W.Cover,W.Lock,W.Fan,W.MediaPlayer,W.AlarmPanel,W.Generic],methods:{setChildHidden:K(B({deviceId:F().int().nonnegative(),childDeviceId:F().int().nonnegative(),hidden:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onAccessoriesChanged:{data:B({deviceId:F(),childDeviceIds:z(F()).readonly(),hiddenChildIds:z(F()).readonly()})},onChildVisibilityChanged:{data:B({deviceId:F(),childDeviceId:F(),hidden:I()})}},status:{schema:cS,kind:`command-driven`}},uS=H([`install`,`update`,`uninstall`,`restart`]),dS=H([`queued`,`fetching`,`staged`,`validating`,`applying`,`restarting`,`applied`,`done`,`failed`,`skipped`]),fS=H([`framework`,`addon`]),pS=B({tsMs:F(),nodeId:P(),packageName:P(),phase:dS,message:P()}),mS=B({taskId:P(),nodeId:P(),packageName:P(),fromVersion:P().nullable(),toVersion:P(),target:fS,phase:dS,stagedPath:P().nullable(),attempts:F(),steps:z(pS),error:P().nullable(),startedAtMs:F().nullable(),finishedAtMs:F().nullable()}),hS=H([`running`,`completed`,`failed`,`partially-failed`,`cancelled`]),gS=H([`single`,`bulk`,`cluster`]),_S=B({jobId:P(),kind:uS,createdAtMs:F(),createdBy:P(),scope:gS,tasks:z(mS),state:hS,schemaVersion:U(1)}),vS=H([`debug`,`info`,`warn`,`error`]),yS=H([`off`,`latest`,`beta`]),bS=H([`off`,`latest`,`beta`,`inherit`]),xS=B({id:P(),name:P().optional(),version:P().optional(),description:P().optional(),icon:P().optional(),color:P().optional(),capabilities:z(L()).readonly().optional(),packageName:P(),packageVersion:P(),packageDisplayName:P().optional(),bundle:B({displayName:P(),description:P().optional(),icon:P().optional()}).optional(),protected:I().optional(),removable:I().optional()}),SS=B({pid:F().optional(),mode:P(),state:P()}),CS=B({phase:H([`pending`,`healthy`,`failed`]),retryCount:F(),firstFailureAt:F().nullable(),lastAttemptAt:F().nullable(),lastError:B({message:P(),stack:P().optional()}).nullable(),nextRetryAt:F().nullable(),alertEmitted:I(),retrying:I(),inGracePeriod:I()}),wS=B({manifest:xS,declaration:L().optional(),source:P(),installSource:P().optional(),process:SS.optional(),hasBackup:I().optional(),health:CS.nullable().optional()}),TS=B({name:P(),version:P(),dir:P(),installSource:P().optional()}),ES=B({name:P(),currentVersion:P(),latestVersion:P(),category:H([`addon`,`core`]),requiresRestart:I(),isSystem:I()}),DS=B({version:P(),publishedAt:P(),deprecated:P().optional(),distTags:z(P()).readonly()}),OS=B({name:P(),version:P(),description:P(),keywords:z(P()).readonly(),publishedAt:P(),author:P(),installed:I(),installedVersion:P().optional()}),kS=B({channel:yS,intervalSeconds:F()}),AS=bS,jS=L(),MS=L(),NS=L(),PS=H([`queued`,`updating`,`done`,`done-pending-restart`,`failed`]),FS=B({name:P(),isSystem:I(),fromVersion:P(),toVersion:P(),status:PS,error:P().optional(),startedAtMs:F().optional(),completedAtMs:F().optional()}),IS=H([`regular`,`system`,`restarting`,`finalizing`]);B({id:P(),nodeId:P(),startedAtMs:F(),completedAtMs:F().optional(),total:F(),completed:F(),failed:F(),current:P().nullable(),phase:IS,cancelled:I(),items:z(FS).readonly()});var LS=B({packageName:P(),currentVersion:P(),latestVersion:P().nullable(),hasUpdate:I(),description:P().optional(),buildId:P().nullable()}),RS=B({timestamp:P(),level:P(),message:P(),scope:P().optional()}),zS=L(),BS=B({addonId:P().min(1),action:P().min(1),input:L()}),VS={name:`addons`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{list:K(R(),z(wS).readonly()),getLogs:K(B({addonId:P(),limit:F().min(1).max(500).default(100),level:vS.optional()}),z(zS)),listPackages:K(R(),z(TS).readonly()),installPackage:K(B({packageName:P(),version:P().optional()}),MS,{kind:`mutation`,auth:`admin`}),installFromWorkspace:K(B({packageName:P()}),MS,{kind:`mutation`,auth:`admin`}),isWorkspaceAvailable:K(R(),I()),listWorkspacePackages:K(R(),z(L()).readonly()),uninstallPackage:K(B({packageName:P()}),L(),{kind:`mutation`,auth:`admin`}),reloadPackages:K(R(),NS,{kind:`mutation`,auth:`admin`}),searchAvailable:K(B({query:P().optional()}),z(OS)),listUpdates:K(B({nodeId:P().optional()}),z(ES).readonly(),{auth:`admin`}),updatePackage:K(B({name:P().min(1),version:P().optional(),nodeId:P().optional()}),L(),{kind:`mutation`,auth:`admin`}),rollbackPackage:K(B({name:P().min(1)}),B({rolledBackTo:P().nullable()}),{kind:`mutation`,auth:`admin`}),forceRefresh:K(B({nodeId:P().optional()}),L(),{kind:`mutation`,auth:`admin`}),restartServer:K(B({confirm:U(!0)}),L(),{kind:`mutation`,auth:`admin`}),getLastRestart:K(R(),B({kind:H([`framework-update`,`manual`,`system`,`framework-bulk-update`]),packageName:P().optional(),fromVersion:P().optional(),toVersion:P().optional(),requestedBy:P().optional(),requestedAt:F()}).nullable(),{auth:`admin`}),listFrameworkPackages:K(R(),z(LS).readonly(),{auth:`admin`}),listCapabilityProviders:K(B({capName:P().min(1)}),z(B({addonId:P(),mode:H([`singleton`,`collection`]),isActive:I()})).readonly()),setCapabilityProviderEnabled:K(B({capName:P().min(1),addonId:P().min(1),enabled:I()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),getVersions:K(B({name:P()}),z(DS).readonly()),restartAddon:K(B({addonId:P()}),jS,{kind:`mutation`,auth:`admin`}),retryLoad:K(B({packageName:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),getAutoUpdateSettings:K(R(),kS,{auth:`admin`}),setAutoUpdateSettings:K(B({channel:yS,intervalSeconds:F().min(300).max(86400).optional()}),L(),{kind:`mutation`,auth:`admin`}),getAddonAutoUpdate:K(B({addonId:P()}),AS,{auth:`admin`}),setAddonAutoUpdate:K(B({addonId:P(),channel:bS}),L(),{kind:`mutation`,auth:`admin`}),applyAutoUpdateToAll:K(B({channel:yS}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`}),custom:K(BS,L(),{kind:`mutation`}),startJob:K(B({kind:H([`install`,`update`,`uninstall`,`restart`]),targets:z(B({name:P().min(1),version:P().min(1)})).min(1),nodeIds:z(P()).optional()}),B({jobId:P()}),{kind:`mutation`,auth:`admin`}),getJob:K(B({jobId:P()}),_S.nullable(),{auth:`admin`}),listJobs:K(B({activeOnly:I().optional()}),z(_S),{auth:`admin`}),cancelJob:K(B({jobId:P()}),B({cancelled:I()}),{kind:`mutation`,auth:`admin`}),onAddonLogs:K(B({addonId:P(),level:vS.optional()}),RS,{kind:`subscription`})},mount:{kind:`server-provided`}},HS={name:`button`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Button],methods:{press:K(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})}},US=B({host:P(),port:F().int().positive().optional(),onvifPort:F().int().positive().optional(),rtspPort:F().int().positive().optional(),https:I().optional(),username:P().optional(),password:P().optional(),onvifProfile:P().optional()}),WS=B({host:P(),port:F().int().positive().nullable(),onvifPort:F().int().positive().nullable(),rtspPort:F().int().positive().nullable(),https:I().nullable(),hasUsername:I(),hasPassword:I(),onvifProfile:P().nullable()}),GS={name:`camera-credentials`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],methods:{getCredentials:K(B({deviceId:F()}),US.nullable(),{kind:`query`,auth:`admin`})},status:{schema:WS,kind:`command-driven`}},KS=B({id:P(),type:P(),timestamp:F(),label:P().optional(),thumbnailUrl:P().optional(),clipUrl:P().optional(),metadata:V(P(),L()).optional()}),qS={name:`events`,scope:`device`,mode:`singleton`,deviceTypes:[W.Camera],methods:{getEvents:K(B({deviceId:F(),from:F().optional(),to:F().optional(),limit:F().optional()}),z(KS)),getEventThumbnail:K(B({deviceId:F(),eventId:P()}),B({base64:P(),contentType:P()}).nullable()),getEventClipUrl:K(B({deviceId:F(),eventId:P()}),P().nullable())}},JS=B({id:P(),name:P(),sampleCount:F().int().nonnegative(),coverMediaKey:P().optional(),coverBase64:P().optional()}),YS=B({id:P(),source:H([`detected`,`photo`]),addedAt:F().int(),deviceId:F().int().optional(),base64:P().optional()}),XS=B({faceId:P(),deviceId:F().int(),trackId:P(),timestamp:F().int(),recognizedIdentityId:P().optional(),identityName:P().optional(),assigned:I(),base64:P().optional(),faceBbox:wf.optional(),keyFrameMediaKey:P().optional(),bestMatchScore:F().optional(),nativeFaceShortSidePx:F().optional(),suggestedIdentityId:P().optional(),suggestedMatchScore:F().optional()}),ZS=H([`unassigned`,`recognized`,`all`]),QS=B({key:P(),kind:P(),base64:P(),sizeBytes:F(),timestamp:F()}),$S={name:`face-gallery`,scope:`system`,mode:`singleton`,methods:{listIdentities:K(R(),z(JS).readonly()),createIdentity:K(B({name:P().min(1)}),JS,{kind:`mutation`,auth:`admin`}),renameIdentity:K(B({id:P(),name:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),deleteIdentity:K(B({id:P()}),R(),{kind:`mutation`,auth:`admin`}),listIdentitySamples:K(B({identityId:P()}),z(YS).readonly()),removeSample:K(B({identityId:P(),sampleId:P()}),R(),{kind:`mutation`,auth:`admin`}),listRecentFaces:K(B({limit:F().int().positive().optional(),filter:ZS.optional()}).optional(),z(XS).readonly()),getFaceByTrack:K(B({deviceId:F().int(),trackId:P()}),XS.nullable()),getFaceMedia:K(B({faceId:P()}),z(QS).readonly()),assignFace:K(B({faceId:P(),identityId:P()}),R(),{kind:`mutation`,auth:`admin`}),unassignFace:K(B({faceId:P()}),R(),{kind:`mutation`,auth:`admin`}),deleteFace:K(B({faceId:P()}),R(),{kind:`mutation`,auth:`admin`}),assignFaces:K(B({faceIds:z(P()).min(1),identityId:P()}),B({assigned:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignFaces:K(B({faceIds:z(P()).min(1)}),B({unassigned:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`}),suggestFaceClusters:K(B({threshold:F().min(0).max(1).optional(),minClusterSize:F().int().min(2).optional(),limit:F().int().positive().optional()}).optional(),z(B({faceIds:z(P()).readonly(),representativeFaceId:P(),size:F().int(),cohesion:F()})).readonly())}},eC=B({id:P(),addonId:P(),name:P(),enabled:I(),info:V(P(),L()).readonly(),createdAt:F(),updatedAt:F(),processState:P()}),tC=B({id:P(),addonId:P(),name:P(),enabled:I(),info:V(P(),L()).readonly(),createdAt:F(),updatedAt:F()}),nC=B({addonId:P(),name:P(),description:P(),iconUrl:P().nullable(),color:P(),instanceMode:P(),mode:H([`standalone`,`account`,`broker`]),discoveryMode:P(),kind:H([`device-adoption`,`device-provider`]),brokerKind:P().nullable(),supportsLocationImport:I(),existingInstances:z(B({id:P(),name:P()})),canAdd:I()}),rC=B({success:I(),error:P().optional()}),iC=B({addonId:P(),name:P(),enabled:I().optional(),info:V(P(),L()).optional(),settings:V(P(),L()).optional(),skipRestart:I().optional()}),aC=B({id:P(),name:P().optional(),enabled:I().optional(),info:V(P(),L()).optional()}),oC=B({success:I(),deletedId:P()}),sC={name:`integrations`,scope:`system`,mode:`singleton`,methods:{list:K(R(),z(eC)),get:K(B({id:P()}),eC),getByAddonId:K(B({addonId:P()}),tC.nullable()),create:K(iC,tC,{kind:`mutation`,auth:`admin`}),update:K(aC,tC,{kind:`mutation`,auth:`admin`}),delete:K(B({id:P()}),oC,{kind:`mutation`,auth:`admin`}),getSettings:K(B({id:P()}),V(P(),L()),{auth:`admin`}),setSettings:K(B({id:P(),settings:V(P(),L())}),B({success:I()}),{kind:`mutation`,auth:`admin`}),getAvailableTypes:K(R(),z(nC),{auth:`admin`}),testConnection:K(B({addonId:P(),settings:V(P(),L())}),rC,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},cC=B({codecs:z(P()),sampleRate:F(),duplex:H([`half`,`full`]),maxBacklogMs:F()}),lC=B({talking:I(),lastSessionAt:F().nullable(),ability:cC.nullable()}),uC=H([`opus`,`s16le`,`g711ulaw`,`g711alaw`]),dC={name:`intercom`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],methods:{startSession:K(B({deviceId:F()}),B({sessionId:P(),sdpOffer:P()}),{kind:`mutation`,auth:`admin`}),handleAnswer:K(B({deviceId:F(),sessionId:P(),sdpAnswer:P()}),R(),{kind:`mutation`,auth:`admin`}),stopSession:K(B({deviceId:F(),sessionId:P()}),R(),{kind:`mutation`,auth:`admin`}),startTalkSession:K(B({deviceId:F()}),B({sessionId:P()}),{kind:`mutation`,auth:`admin`}),pushTalkAudio:K(B({deviceId:F(),audioBase64:P(),codec:uC.optional(),sampleRate:F().int().positive().optional(),channels:F().int().positive().optional(),sequenceNumber:F().int()}),B({accepted:I()}),{kind:`mutation`,auth:`admin`}),endTalkSession:K(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:B({deviceId:F(),status:lC})}},status:{schema:lC,kind:`command-driven`}},fC=H([`lan`,`wifi`,`docker`,`vpn`,`loopback`,`other`]),pC=B({name:P(),family:H([`IPv4`,`IPv6`]),address:P(),cidr:P(),netmask:P(),internal:I(),mac:P(),kind:fC,preferred:I(),plausible:I(),plausibleReason:P()}),mC=B({interfaces:z(pC).readonly(),probedAt:F()}),hC=pC.nullable(),gC=B({endpoints:z(B({label:P(),baseUrl:P(),kind:H([`lan-ipv4`,`lan-ipv6`,`public`,`loopback`]),interfaceKind:H([`lan`,`wifi`,`docker`,`vpn`,`other`,`loopback`,`public`]),plausible:I(),plausibleReason:P(),priority:F()})).readonly()}),_C=B({baseUrl:P().nullable(),resolved:P().nullable()}),vC=B({addresses:z(P()).readonly()}),yC={name:`local-network`,scope:`system`,mode:`singleton`,methods:{list:K(R(),mC),getPreferred:K(R(),hC),getConnectionEndpoints:K(B({port:F().int().min(1).max(65535),includeLoopback:I().optional(),ipv4Only:I().optional(),scheme:H([`http`,`https`]).optional()}),gC),getNotificationEndpoint:K(R(),_C),setNotificationEndpoint:K(B({baseUrl:P().nullable()}),_C,{kind:`mutation`}),getAllowedAddresses:K(R(),vC),setAllowedAddresses:K(vC,B({success:U(!0)}),{kind:`mutation`}),resetAllowlistToBestMatch:K(R(),vC,{kind:`mutation`})},mount:{kind:`hub-only`}},bC=B({id:P(),label:P(),scope:H([`mesh`,`public`]),url:P(),hostname:P(),port:F(),protocol:H([`http`,`https`])}),xC=B({id:P(),hostname:P(),magicDns:P(),addresses:z(P()).readonly(),os:P().optional(),online:I(),lastSeenMs:F(),isSelf:I(),connection:H([`direct`,`relay`,`idle`]),relay:P().nullable(),lastHandshakeMs:F(),rxBytes:F(),txBytes:F(),tags:z(P()).readonly(),exitNodeOption:I(),advertisedRoutes:z(P()).readonly(),userLogin:P().nullable(),keyExpiry:F().nullable()}),SC=B({joined:I(),meshIp:P(),magicDnsHostname:P(),peerCount:F(),endpoints:z(bC).readonly(),error:P().optional(),tenantName:P(),magicDnsSuffix:P(),userLogin:P().nullable(),controlPlaneUrl:P(),keyExpiry:F().nullable(),daemonSocket:P().optional(),daemonCliPath:P().optional()}),CC={name:`mesh-network`,scope:`system`,mode:`collection`,providerKind:`mesh`,methods:{getStatus:K(R(),SC),join:K(B({authKey:P().min(8),hostname:P().optional()}),B({joined:U(!0)}),{kind:`mutation`}),startLogin:K(B({hostname:P().optional()}),B({loginUrl:P()}),{kind:`mutation`}),leave:K(R(),B({left:U(!0)}),{kind:`mutation`}),logout:K(R(),B({loggedOut:U(!0)}),{kind:`mutation`}),listPeers:K(R(),B({peers:z(xC).readonly()})),testConnection:K(B({authKey:P().optional()}),B({ok:I(),tenant:P().optional(),daemonVersion:P().optional(),error:P().optional()}),{kind:`mutation`})}},wC=B({nominalBitrateKbps:F(),observedBitrateKbps:F(),peakBitrateKbps:F(),packetLossPercent:F(),lastUpdated:F()}),TC=B({rttMs:F(),jitterMs:F(),estimatedBandwidthKbps:F(),packetLossPercent:F().min(0).max(100),lastUpdated:F()}),EC=B({deviceId:F(),streams:V(P(),wC),client:TC.optional()}),DC={name:`network-quality`,scope:`system`,mode:`singleton`,methods:{getDeviceStats:K(B({deviceId:F()}),EC.nullable()),getAllStats:K(R(),z(EC).readonly()),reportClientStats:K(B({deviceId:F(),rttMs:F().min(0).max(6e4),jitterMs:F().min(0).max(1e4),estimatedBandwidthKbps:F().min(0).max(1e6),packetLossPercent:F().min(0).max(100)}),R(),{kind:`mutation`})},mount:{kind:`server-provided`}},OC=B({addonId:P(),capabilities:z(P()).readonly(),status:P()}),kC=B({pid:F(),name:P(),state:P(),cpuPercent:F(),memoryRss:F(),uptimeSeconds:F(),services:z(OC).readonly(),groupId:P().optional()}),AC=B({id:P(),status:P(),cpuPercent:F(),memoryRss:F()}),jC=B({category:P(),total:F(),healthy:F(),addons:z(AC).readonly()}),MC=B({name:P(),version:P()}),NC=B({id:P(),name:P(),hostname:P(),platform:P(),arch:P(),cpuModel:P().nullable(),cpuCores:F(),memoryMB:F(),engines:z(P()).readonly(),isHub:I(),isOnline:I(),cpuPercent:F(),memoryPercent:F(),uptime:F(),lastSeen:P(),localIps:z(P()).readonly(),addons:z(B({id:P(),capabilities:z(P()).readonly(),status:P()})).readonly(),processes:z(kC).readonly(),categories:z(jC).readonly(),rootPackage:MC.nullable()}),PC=B({callerAddonId:P(),providerAddonId:P(),capName:P(),callsPerMin:F(),lastCallAtMs:F()}),FC=B({nodeId:P(),name:P(),version:P(),status:P(),synced:I()}),IC=B({hubVersion:P(),nodes:z(FC)}),LC=B({nodeId:P(),addonId:P()}),RC=B({id:P(),status:P(),version:P().optional(),packageName:P().optional()}),zC=B({success:I()}),BC=B({success:I(),reason:P().optional()}),VC=B({restarted:z(P()).readonly(),failed:z(P()).readonly()}),HC=B({nodeId:P(),name:P()}),UC={name:`nodes`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{topology:K(R(),z(NC).readonly(),{auth:`admin`}),deployAddon:K(LC,zC,{kind:`mutation`,auth:`admin`}),undeployAddon:K(LC,zC,{kind:`mutation`,auth:`admin`}),restartAddon:K(LC,zC,{kind:`mutation`,auth:`admin`}),restartProcess:K(B({nodeId:P(),processName:P()}),BC,{kind:`mutation`,auth:`admin`}),restartNode:K(B({nodeId:P()}),VC,{kind:`mutation`,auth:`admin`}),shutdownNode:K(B({nodeId:P()}),zC,{kind:`mutation`,auth:`admin`}),renameNode:K(B({nodeId:P(),name:P().min(1).max(64)}),HC,{kind:`mutation`,auth:`admin`}),clusterAddonStatus:K(R(),V(P(),IC),{auth:`admin`}),getCapUsageGraph:K(B({windowSeconds:F().int().positive().max(300).default(60)}),z(PC).readonly(),{auth:`admin`}),getNodeAddons:K(B({nodeId:P()}),z(RC).readonly(),{auth:`admin`}),setProcessLogLevel:K(B({nodeId:P(),level:P()}),zC,{kind:`mutation`,auth:`admin`}),executeQuery:K(B({nodeId:P(),addonId:P(),queryName:P(),params:V(P(),L()).optional()}),L(),{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},WC=H([`text`,`timestamp`,`watermark`]),GC=H([`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`custom`]),KC=B({overlays:z(B({id:P(),kind:WC,enabled:I(),text:P().optional(),position:GC.optional(),availablePositions:z(GC).readonly(),readOnly:I().optional()})).readonly()}),qC=B({enabled:I().optional(),text:P().optional(),position:GC.optional()}).partial(),JC={name:`osd`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],methods:{setOverlay:K(B({deviceId:F(),overlayId:P(),patch:qC}),R(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:B({deviceId:F(),status:KC})}},status:{schema:KC,kind:`command-driven`},settings:{bindings:[{kind:`array`,statusPath:`overlays`,idField:`id`,method:`setOverlay`,idArg:`overlayId`,patchArg:`patch`,sectionId:`osd`,sectionTitle:`Video overlays`,itemFields:{enabled:{label:e=>`${String(e.id)} enabled`,kind:`boolean`},text:{label:e=>`${String(e.id)} text`,kind:`text`,when:e=>e.kind!==`timestamp`&&!e.readOnly},position:{label:e=>`${String(e.id)} position`,kind:`select`,options:e=>e.availablePositions??[],when:e=>Array.isArray(e.availablePositions)&&e.availablePositions.length>0}}}]}},YC=B({id:P(),name:P(),sampleCount:F().int().nonnegative(),coverMediaKey:P().optional(),coverBase64:P().optional()}),XC=B({id:P(),text:P(),score:F(),addedAt:F().int(),deviceId:F().int().optional(),base64:P().optional()}),ZC=B({plateId:P(),deviceId:F().int(),trackId:P(),timestamp:F().int(),text:P(),score:F(),corrected:I(),recognizedVehicleId:P().optional(),vehicleName:P().optional(),assigned:I(),plateBbox:wf.optional(),keyFrameMediaKey:P().optional(),base64:P().optional()}),QC=B({key:P(),kind:P(),base64:P(),sizeBytes:F(),timestamp:F()}),$C=B({plateIds:z(P()).readonly(),representativePlateId:P(),representativeText:P(),size:F().int(),cohesion:F()}),ew={name:`plate-gallery`,scope:`system`,mode:`singleton`,methods:{listPlates:K(B({deviceId:F().int().optional(),limit:F().int().positive().optional()}).optional(),z(ZC).readonly()),getPlateByTrack:K(B({deviceId:F().int(),trackId:P()}),ZC.nullable()),getPlateMedia:K(B({plateId:P()}),z(QC).readonly()),searchPlates:K(B({text:P().min(1),maxDistance:F().int().min(0).optional(),limit:F().int().positive().optional()}),z(ZC).readonly()),suggestPlateClusters:K(B({maxDistance:F().int().min(0).optional(),minClusterSize:F().int().min(2).optional(),limit:F().int().positive().optional()}).optional(),z($C).readonly()),correctPlateText:K(B({plateId:P(),text:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),deletePlate:K(B({plateId:P()}),R(),{kind:`mutation`,auth:`admin`}),listVehicles:K(R(),z(YC).readonly()),createVehicle:K(B({name:P().min(1)}),YC,{kind:`mutation`,auth:`admin`}),renameVehicle:K(B({id:P(),name:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),deleteVehicle:K(B({id:P()}),R(),{kind:`mutation`,auth:`admin`}),listVehicleSamples:K(B({vehicleId:P()}),z(XC).readonly()),removeVehicleSample:K(B({vehicleId:P(),sampleId:P()}),R(),{kind:`mutation`,auth:`admin`}),assignPlate:K(B({plateId:P(),vehicleId:P()}),R(),{kind:`mutation`,auth:`admin`}),unassignPlate:K(B({plateId:P()}),R(),{kind:`mutation`,auth:`admin`}),assignPlates:K(B({plateIds:z(P()).min(1),vehicleId:P()}),B({assigned:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignPlates:K(B({plateIds:z(P()).min(1)}),B({unassigned:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`})}},tw=H(tc),nw=H([`videotoolbox`,`cuda`,`nvdec`,`vaapi`,`qsv`,`d3d11va`,`dxva2`,`amf`,`vdpau`,`drm`,`coreml`,`tensorrt`,`openvino`,`directml`,`webgpu`,`none`]).nullable().optional(),rw=B({preferred:z(P()).readonly(),rationale:P()}),iw=H([`h264_videotoolbox`,`hevc_videotoolbox`,`h264_vaapi`,`hevc_vaapi`,`h264_nvenc`,`hevc_nvenc`,`h264_qsv`,`hevc_qsv`,`h264_amf`,`hevc_amf`,`libx264`,`libx265`]);B({encoders:z(B({encoder:iw,codec:H([`H264`,`H265`]),family:H([`videotoolbox`,`vaapi`,`nvenc`,`qsv`,`amf`,`software`]),available:I(),reason:P().optional()})).readonly(),defaultH264:iw,defaultH265:iw,probedAt:F()}),B({methods:z(P()).readonly(),probedAt:F()});var aw=H([`darwin`,`linux`,`win32`]),ow=H([`arm64`,`x64`]),sw=B({type:H([`nvidia`,`amd`,`intel`,`apple`]),name:P(),memoryMB:F().optional()}),cw=B({type:H([`apple-ane`,`intel-npu`])}),lw=B({type:U(`coral-edgetpu`),bus:P().optional()}),uw=B({platform:aw,arch:ow,cpuModel:P(),cpuCores:F(),totalRAM_MB:F(),availableRAM_MB:F(),gpu:sw.nullable(),npu:cw.nullable(),coral:lw.nullable().optional()}),dw=B({runtime:H([`node`,`python`]),backend:P(),format:H([`onnx`,`coreml`,`openvino`,`tflite`]),score:F(),reason:P(),available:I()}),fw=B({key:P(),backend:P(),device:P(),format:tw,runtime:U(`python`),score:F(),available:I()}),pw=B({hardware:uw,scores:z(dw).readonly(),bestScore:dw,pythonPath:P().nullable(),devices:z(fw).readonly()}),mw=B({modelId:P(),name:P(),minRAM_MB:F(),accuracyScore:F(),formats:z(P()).readonly()}),hw=B({modelId:P(),runtime:H([`node`,`python`]),backend:P(),format:tw,reason:P()}),gw={name:`platform-probe`,scope:`system`,mode:`singleton`,methods:{getCapabilities:K(R(),pw),getHardware:K(R(),uw),resolveInferenceConfig:K(B({requirements:z(mw).readonly()}),hw),resolveHwAccel:K(B({prefer:nw}),rw)}},_w=B({id:P(),name:P()}),vw=B({pan:F(),tilt:F(),zoom:F()}),yw=B({pan:F().optional(),tilt:F().optional(),zoom:F().optional(),speed:F().optional()}),bw=vw.extend({autofocus:I()}),xw=B({hasPan:I(),hasTilt:I(),hasZoom:I(),supportsPresets:I(),maxPresets:F().optional(),hasAutofocus:I()}),Sw={name:`ptz`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-panel`,tab:`ptz`,topTab:!0,label:`PTZ`,order:0}},methods:{move:K(yw.extend({deviceId:F()}),R(),{kind:`mutation`}),continuousMove:K(yw.extend({deviceId:F()}),R(),{kind:`mutation`}),stop:K(B({deviceId:F()}),R(),{kind:`mutation`}),getPresets:K(B({deviceId:F()}),z(_w)),goToPreset:K(B({deviceId:F(),presetId:P()}),R(),{kind:`mutation`}),savePreset:K(B({deviceId:F(),presetId:P(),name:P()}),R(),{kind:`mutation`,auth:`admin`}),deletePreset:K(B({deviceId:F(),presetId:P()}),R(),{kind:`mutation`,auth:`admin`}),getOptions:K(B({deviceId:F()}),xw),goHome:K(B({deviceId:F()}),R(),{kind:`mutation`}),getPosition:K(B({deviceId:F()}),vw),setAutofocus:K(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`})},status:{schema:bw,kind:`command-driven`}},Cw={name:`reboot`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera,W.Sensor,W.Switch],methods:{reboot:K(B({deviceId:F().int().nonnegative()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`})}},ww=B({deviceId:F(),enabled:I(),activeMode:H([`off`,`continuous`,`events`]),nodeId:P(),storageBytes:F()}),Tw=B({profile:P(),startMs:F(),endMs:F()}),Ew=B({deviceId:F(),ranges:z(Tw)}),Dw=B({deviceId:F(),days:z(F())}),Ow=B({deviceId:F(),localMasterPath:P().nullable(),playbackUrl:P().nullable(),playbackEndpoints:z(P())}),kw=B({deviceId:F(),usedBytes:F()}),Aw=B({locationId:P().nullable(),locationIds:z(P()).optional(),usedBytes:F(),availableBytes:F().nullable(),totalBytes:F().nullable()}),jw=B({nodeId:P(),totalUsedBytes:F(),devices:z(kw),locations:z(Aw)}),Mw=To(`kind`,[B({kind:U(`segment`),startMs:F(),durMs:F(),bytes:F()}),B({kind:U(`gap`),nearestEdgeMs:F().nullable(),prevEndMs:F().nullable().optional()})]),Nw=B({data:os(Uint8Array)}),Pw={name:`recording`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,status:{schema:ww,kind:`command-driven`},methods:{getAvailability:K(B({deviceId:F(),fromMs:F(),toMs:F()}),Ew,{kind:`query`,auth:`admin`}),getDaysWithRecordings:K(B({deviceId:F(),fromMs:F(),toMs:F(),tzOffsetMinutes:F()}),Dw,{kind:`query`,auth:`admin`}),getPlaybackManifest:K(B({deviceId:F(),fromMs:F(),toMs:F()}),Ow,{kind:`query`,auth:`admin`}),getStorageUsage:K(B({}),jw,{kind:`query`,auth:`admin`}),getDeviceConfig:K(B({deviceId:F()}),yc,{kind:`query`,auth:`admin`}),locateSegment:K(B({deviceId:F(),profile:P(),epochMs:F()}),Mw,{kind:`query`,auth:`admin`}),readSegmentBytes:K(B({deviceId:F(),profile:P(),startMs:F()}),Nw,{kind:`query`,auth:`admin`}),setDeviceConfig:K(B({deviceId:F(),config:yc}),yc,{kind:`mutation`,auth:`admin`}),rescanStorage:K(B({deviceId:F()}),ww,{kind:`mutation`,auth:`admin`}),pruneFootage:K(B({deviceId:F(),reason:Sc.optional()}),B({floorMs:F().nullable(),deletedBuckets:F().int(),reclaimedBytes:F().int()}),{kind:`mutation`,auth:`admin`}),deleteFootprint:K(B({deviceId:F(),fromMs:F().optional(),toMs:F().optional()}),B({deletedBuckets:F().int(),reclaimedBytes:F().int()}),{kind:`mutation`,auth:`admin`}),listOpsLog:K(wc,z(Cc).readonly(),{kind:`query`,auth:`admin`}),renderGif:K(B({deviceId:F(),aroundMs:F(),preRollSec:F().min(0).max(30).default(2),postRollSec:F().min(0).max(30).default(5),maxWidth:F().int().min(120).max(1280).default(480),fps:F().int().min(1).max(15).default(5)}),B({gifBase64:P(),fromMs:F(),toMs:F()}),{kind:`mutation`,auth:`admin`}),renderClip:K(B({deviceId:F(),aroundMs:F(),preRollSec:F().min(0).max(30).default(3),postRollSec:F().min(0).max(30).default(7),maxWidth:F().int().min(160).max(1920).default(640)}),B({clipBase64:P(),mime:P(),fromMs:F(),toMs:F(),bytes:F().int()}),{kind:`mutation`,auth:`admin`}),relocateFootage:K(Dc,B({jobId:P()}),{kind:`mutation`,auth:`admin`}),getRelocateStatus:K(B({}),z(Ec).readonly(),{kind:`query`,auth:`admin`}),cancelRelocate:K(B({jobId:P()}),B({cancelled:I()}),{kind:`mutation`,auth:`admin`})}},Fw=F().min(.25).max(32),Iw=B({everyMs:F().int().positive(),outputFps:F().int().min(1).max(60).optional()}),Lw=B({speed:Fw.optional(),timelapse:Iw.optional(),includeAudio:I(),maxLifeMs:F().int().positive(),deleteAfterDownload:I(),title:P().max(200).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:ss.custom,message:`speed and timelapse are mutually exclusive`,path:[`timelapse`]})}),Rw=H([`queued`,`rendering`,`ready`,`failed`,`expired`,`deleted`]),zw=B({id:P(),deviceId:F(),profile:P(),fromMs:F(),toMs:F(),options:Lw,state:Rw,progressPct:F().nullable(),fileBytes:F().nullable(),expiresAt:F(),deleteAfterDownload:I(),downloadedAt:F().nullable(),createdAt:F(),createdBy:P(),error:P().nullable()}),Bw=B({url:P(),endpoints:z(P())}),Vw={name:`recordingExport`,scope:`system`,mode:`singleton`,methods:{createExport:K(B({deviceId:F(),profile:P(),fromMs:F(),toMs:F(),options:Lw}),zw,{kind:`mutation`,auth:`protected`}),listExports:K(B({deviceId:F().optional()}),z(zw),{kind:`query`,auth:`protected`}),getExport:K(B({exportId:P()}),zw,{kind:`query`,auth:`protected`}),cancelExport:K(B({exportId:P()}),zw,{kind:`mutation`,auth:`protected`}),deleteExport:K(B({exportId:P()}),zw,{kind:`mutation`,auth:`protected`}),getDownloadUrl:K(B({exportId:P()}),Bw,{kind:`query`,auth:`protected`})}},Hw=B({camStreamId:P().min(1),kind:ms,url:P().optional(),codec:P().optional(),resolution:hs.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:V(P(),L()).optional()}),Uw={name:`stream-catalog`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[W.Camera],methods:{getCatalog:K(B({deviceId:F().int().nonnegative()}),z(Hw).readonly())}},Ww=B({streaming:I(),notifications:I(),objectDetection:I(),remoteAccess:I(),agentCluster:I(),smartHome:I(),recordings:I(),backup:I(),repl:I()}),Gw=B({status:U(`ok`),uptime:F()}),Kw=B({name:P(),address:P(),family:P(),internal:I()}),qw={name:`system`,scope:`system`,mode:`singleton`,methods:{info:K(R(),Ww),health:K(R(),Gw),featureFlags:K(R(),Ww),networkAddresses:K(R(),z(Kw).readonly()),getRetentionConfig:K(R(),L().nullable(),{auth:`admin`}),setRetentionConfig:K(V(P(),L()),lo(),{kind:`mutation`,auth:`admin`}),forceRetentionCleanup:K(R(),R(),{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},Jw=B({title:P(),message:P(),severity:H([`info`,`warning`,`critical`]),duration:F().optional(),action:B({label:P(),url:P()}).optional()}),Yw={name:`toast`,scope:`system`,mode:`singleton`,methods:{onToast:K(R(),Jw,{kind:`subscription`})},mount:{kind:`server-provided`}},Xw=B({id:P(),username:P(),isAdmin:I().default(!1),allowedProviders:Co([z(P()),U(`*`)]),allowedDevices:V(P(),Co([z(P()),U(`*`)])),scopes:z(qy).default([]),totpEnabled:I().default(!1),createdAt:F(),updatedAt:F()}),Zw=B({username:P(),password:P().min(6),isAdmin:I().default(!1),allowedProviders:Co([z(P()),U(`*`)]).optional(),allowedDevices:V(P(),Co([z(P()),U(`*`)])).optional(),scopes:z(qy).optional()}),Qw=B({id:P(),isAdmin:I().optional(),allowedProviders:Co([z(P()),U(`*`)]).optional(),allowedDevices:V(P(),Co([z(P()),U(`*`)])).optional(),scopes:z(qy).optional()}),$w=B({id:P(),label:P(),isAdmin:I().default(!1),allowedProviders:Co([z(P()),U(`*`)]).optional(),allowedDevices:V(P(),Co([z(P()),U(`*`)])).optional(),tokenPrefix:P(),createdAt:F(),lastUsedAt:F().optional()}),eT=B({label:P(),isAdmin:I().default(!1),allowedProviders:Co([z(P()),U(`*`)]).optional(),allowedDevices:V(P(),Co([z(P()),U(`*`)])).optional()}),tT=B({token:P(),record:$w}),nT=B({id:P(),userId:P(),name:P(),tokenPrefix:P(),scopes:z(qy),expiresAt:F().nullish(),lastUsedAt:F().nullish(),createdAt:F()}),rT=B({userId:P(),name:P(),scopes:z(qy),expiresAt:F().optional()}),iT=B({token:P(),record:nT}),aT=B({id:P(),userId:P(),username:P(),integrationId:P(),scopes:z(qy),createdAt:F(),lastUsedAt:F(),revokedAt:F().nullable()}),oT=B({secret:P(),otpauthUrl:P()}),sT=B({enabled:I(),confirmedAt:F().nullable()}),cT=[lS,Xh,Qh,ng,cg,hg,pg,VS,Hs,_u,xu,bg,Cu,xg,Tg,Ng,Du,Fg,ku,Kg,ju,Nu,Fu,p_,HS,GS,m_,$u,td,id,ld,dd,md,gd,yd,xd,g_,Dd,v_,y_,M_,Md,V_,cv,Ys,Ih,lv,pu,Fd,fv,Rd,Vd,qS,$S,Wd,hu,hv,Kd,Jd,Xd,Qd,ef,uf,sC,dC,mf,Rv,Ev,yC,gf,Vv,Wv,xf,CC,ly,uy,dy,Lp,Af,Bp,Gp,Cy,Xp,Dy,DC,UC,Hy,ru,rm,am,Yy,JC,lm,Pb,dp,sx,Pp,ew,gw,dm,mm,gm,Sm,Sw,Dm,Cw,Pw,Vw,Pm,Im,vx,Cx,Rm,Ox,jx,Nx,Fx,Rx,Xx,Ju,Uw,Gm,qm,qw,Ym,Zm,Rg,Yw,Qx,$m,{name:`user-management`,scope:`system`,mode:`singleton`,methods:{listUsers:K(R(),z(Xw),{auth:`admin`}),createUser:K(Zw,Xw,{kind:`mutation`,auth:`admin`,access:`create`}),updateUser:K(Qw,B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),deleteUser:K(B({id:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),resetPassword:K(B({id:P(),newPassword:P().min(6)}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),setUserScopes:K(B({userId:P(),scopes:z(qy)}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),validateCredentials:K(B({username:P(),password:P()}),Xw.extend({passwordHash:P()}).nullable(),{kind:`mutation`,access:`view`}),listApiKeys:K(R(),z($w),{auth:`admin`}),createApiKey:K(eT,tT,{kind:`mutation`,auth:`admin`,access:`create`}),revokeApiKey:K(B({id:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateApiKey:K(B({token:P()}),$w.nullable(),{kind:`mutation`,access:`view`}),createScopedToken:K(rT,iT,{kind:`mutation`,auth:`admin`,access:`create`}),revokeScopedToken:K(B({id:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateScopedToken:K(B({token:P()}),nT.nullable(),{access:`view`}),listScopedTokens:K(B({userId:P()}),z(nT),{auth:`admin`}),setupTotp:K(B({userId:P()}),oT,{kind:`mutation`,auth:`admin`,access:`create`}),confirmTotp:K(B({userId:P(),code:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),disableTotp:K(B({userId:P()}),B({success:U(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getTotpStatus:K(B({userId:P()}),sT,{auth:`admin`}),verifyTotp:K(B({userId:P(),code:P()}),B({valid:I()}),{kind:`mutation`,access:`view`}),oauthIssueCode:K(B({integrationId:P(),userId:P(),username:P(),scopes:z(qy),redirectUri:P(),hubUrl:P()}),B({code:P()}),{kind:`mutation`,access:`create`}),oauthExchangeCode:K(B({code:P(),redirectUri:P()}),B({accessToken:P(),refreshToken:P(),expiresIn:F()}).nullable(),{kind:`mutation`,access:`view`}),oauthRefresh:K(B({refreshToken:P()}),B({accessToken:P(),refreshToken:P(),expiresIn:F()}).nullable(),{kind:`mutation`,access:`view`}),oauthVerifyAccessToken:K(B({token:P()}),B({userId:P(),username:P(),scopes:z(qy)}).nullable(),{access:`view`}),listOauthSessions:K(R(),z(aT),{auth:`admin`}),revokeOauthSession:K(B({id:P()}),B({success:I()}),{kind:`mutation`,auth:`admin`,access:`delete`})}},eS,rh,ah,sh,rS,Gs,lh,dh,sS,yh,Ch,hp];Object.freeze({"accessories.setChildHidden":{capName:`accessories`,capScope:`device`,addonId:null,access:`create`},"addonPages.listPages":{capName:`addon-pages`,capScope:`system`,addonId:null,access:`view`},"addonPagesSource.listPages":{capName:`addon-pages-source`,capScope:`system`,addonId:null,access:`view`},"addonRoutes.getRoutes":{capName:`addon-routes`,capScope:`system`,addonId:null,access:`view`},"addonRoutes.invoke":{capName:`addon-routes`,capScope:`system`,addonId:null,access:`create`},"addons.applyAutoUpdateToAll":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.cancelJob":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.custom":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.forceRefresh":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.getAddonAutoUpdate":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getAutoUpdateSettings":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getJob":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getLastRestart":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getLogs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getVersions":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.installFromWorkspace":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.installPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.isWorkspaceAvailable":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.list":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listCapabilityProviders":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listFrameworkPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listJobs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listUpdates":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listWorkspacePackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.onAddonLogs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.reloadPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.restartAddon":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.restartServer":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.retryLoad":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.rollbackPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.searchAvailable":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.setAddonAutoUpdate":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.setAutoUpdateSettings":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.setCapabilityProviderEnabled":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.startJob":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.uninstallPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`delete`},"addons.updatePackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addonSettings.getDeviceSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`view`},"addonSettings.getGlobalSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`view`},"addonSettings.updateDeviceSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`create`},"addonSettings.updateGlobalSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`create`},"addonWidgets.listWidgets":{capName:`addon-widgets`,capScope:`system`,addonId:null,access:`view`},"addonWidgetsSource.listWidgets":{capName:`addon-widgets-source`,capScope:`system`,addonId:null,access:`view`},"adminUi.getStaticDir":{capName:`admin-ui`,capScope:`system`,addonId:null,access:`view`},"adminUi.getVersion":{capName:`admin-ui`,capScope:`system`,addonId:null,access:`view`},"alarmPanel.arm":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alarmPanel.disarm":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alarmPanel.trigger":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alerts.dismiss":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.emit":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.getUnreadCount":{capName:`alerts`,capScope:`system`,addonId:null,access:`view`},"alerts.list":{capName:`alerts`,capScope:`system`,addonId:null,access:`view`},"alerts.markAllRead":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.markRead":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.update":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"audioAnalysis.resolveDeviceSettings":{capName:`audio-analysis`,capScope:`device`,addonId:null,access:`view`},"audioAnalyzer.analyseChunk":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioAnalyzer.classify":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`view`},"audioAnalyzer.dispose":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioAnalyzer.isReady":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`view`},"audioAnalyzer.reprobeAudioEngine":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioCodec.canHandle":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.closeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.createDecodeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.createEncodeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.flushEncode":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.listActiveSessions":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.listSupportedCodecs":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pullEncoded":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pullPcm":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pushEncodedFrame":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.pushPcm":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioMetrics.getCurrentSnapshot":{capName:`audio-metrics`,capScope:`device`,addonId:null,access:`view`},"audioMetrics.getHistory":{capName:`audio-metrics`,capScope:`device`,addonId:null,access:`view`},"authProvider.getLoginUrl":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`view`},"authProvider.handleCallback":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`create`},"authProvider.validateCredentials":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`create`},"authProvider.validateToken":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`view`},"automationControl.disable":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"automationControl.enable":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"automationControl.trigger":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"backup.delete":{capName:`backup`,capScope:`system`,addonId:null,access:`delete`},"backup.deleteSchedule":{capName:`backup`,capScope:`system`,addonId:null,access:`delete`},"backup.getEntries":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.list":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listArchives":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listDestinations":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listLocations":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listSchedules":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.previewSchedule":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.restore":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.trigger":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.upsertDestinationPolicy":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.upsertSchedule":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"battery.wakeForStream":{capName:`battery`,capScope:`device`,addonId:null,access:`create`},"brightness.setBrightness":{capName:`brightness`,capScope:`device`,addonId:null,access:`create`},"broker.add":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.get":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getBrokerConfig":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getSettingsSchema":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getState":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getStatus":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.list":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.listProviders":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.publish":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.remove":{capName:`broker`,capScope:`system`,addonId:null,access:`delete`},"broker.setSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.subscribe":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.testConnection":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.testSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.unsubscribe":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"button.press":{capName:`button`,capScope:`device`,addonId:null,access:`create`},"cameraCredentials.getCredentials":{capName:`camera-credentials`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getBrokerStreams":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getCameraStreams":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getProfileRtspEntries":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getRtspEntries":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.pickStream":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"climateControl.setFanMode":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setMode":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setPreset":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setSwingHorizontal":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setSwingVertical":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTarget":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTargetHumidity":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTargetRange":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"color.setColor":{capName:`color`,capScope:`device`,addonId:null,access:`create`},"consumables.reset":{capName:`consumables`,capScope:`device`,addonId:null,access:`delete`},"control.setValue":{capName:`control`,capScope:`device`,addonId:null,access:`create`},"cover.close":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.open":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.setPosition":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.setTiltPosition":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.stop":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"customModelRegistry.listModels":{capName:`custom-model-registry`,capScope:`system`,addonId:null,access:`view`},"dayNight.getOptions":{capName:`day-night`,capScope:`device`,addonId:null,access:`view`},"dayNight.setSettings":{capName:`day-night`,capScope:`device`,addonId:null,access:`create`},"decoder.createSession":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.destroySession":{capName:`decoder`,capScope:`system`,addonId:null,access:`delete`},"decoder.getFrame":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getInfo":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getShmStats":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getStats":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.listActiveSessions":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.openStream":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pullFrames":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pullHandles":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pushPacket":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.reprobeHwaccel":{capName:`decoder`,capScope:`system`,addonId:null,access:`create`},"decoder.supportsCodec":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.updateConfig":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.adopt":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.getCandidate":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidateFilters":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidates":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.refresh":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.release":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.resync":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceDiscovery.adoptDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.listDiscovered":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`view`},"deviceDiscovery.refreshDiscovery":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.releaseDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceExport.exposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExport.getStatus":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listExposedDevices":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listSupportedDeviceKinds":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.unexposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceManager.addLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionAdopt":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionListCandidateFilters":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionListCandidates":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionRefresh":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionRelease":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionResync":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.allocateDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.applyInitialMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.createDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.disable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverAllProviders":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverProvider":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoveryProviders":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.enable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.getAllBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getChildren":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getConfigSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getCreationSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceLiveInfoAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceSettingsAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregateBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getLinkedDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getRoleDisplayDefaults":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getSettingsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamSources":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getWireableFields":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listAll":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listBindableCapsForDeviceType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocations":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listPersistedByAddon":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listWrappersForCap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadRuntimeState":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.persistConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.probeStreams":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.providerCreationType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.providerDiscoveryParamsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.registerDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.remove":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeByIntegration":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.runDeviceAction":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setChildLayout":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDeviceLinks":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisabled":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisplay":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setIntegrationId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLinkDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setMetadata":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setName":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setPrimaryChildEntityId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRole":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRoleDisplayDefaults":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setWrapperActive":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testCreationField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceFieldsBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceOps.getConfigEntries":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getRawState":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getSettingsSchema":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getStreamSources":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.removeDevice":{capName:`device-ops`,capScope:`device`,addonId:null,access:`delete`},"deviceOps.runAction":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceOps.setConfig":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceProvider.adoptDiscoveredDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.createDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.discoverDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.getChildCreationSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDiscoveryParamsSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getManualCreationType":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getStatus":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.start":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.stop":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.supportsDiscovery":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.supportsManualCreation":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.testCreationField":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceState.getAllSnapshots":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getSnapshot":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.setCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"embeddingEncoder.encode":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.encodeText":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.getInfo":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"events.getEventClipUrl":{capName:`events`,capScope:`device`,addonId:null,access:`view`},"events.getEvents":{capName:`events`,capScope:`device`,addonId:null,access:`view`},"events.getEventThumbnail":{capName:`events`,capScope:`device`,addonId:null,access:`view`},"faceGallery.assignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.assignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.createIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.deleteFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.deleteIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.getFaceByTrack":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.getFaceMedia":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentities":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentitySamples":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listRecentFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.removeSample":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.renameIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.suggestFaceClusters":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.unassignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.unassignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"fanControl.setDirection":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setOscillating":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPercentage":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPreset":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"filesystemBrowse.browse":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"filesystemBrowse.createDir":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`create`},"filesystemBrowse.listAllowedRoots":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"humidifier.setMode":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setOn":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setTargetHumidity":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"imageSettings.getOptions":{capName:`image-settings`,capScope:`device`,addonId:null,access:`view`},"imageSettings.setSettings":{capName:`image-settings`,capScope:`device`,addonId:null,access:`create`},"integrations.create":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.delete":{capName:`integrations`,capScope:`system`,addonId:null,access:`delete`},"integrations.get":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getAvailableTypes":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getByAddonId":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.list":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.setSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.testConnection":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.update":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"intercom.endTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.handleAnswer":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.pushTalkAudio":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.stopSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.dock":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.pause":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.startMowing":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"llm.deleteModel":{capName:`llm`,capScope:`system`,addonId:null,access:`delete`},"llm.deleteProfile":{capName:`llm`,capScope:`system`,addonId:null,access:`delete`},"llm.generate":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.generateVision":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.getDefaults":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.getRuntimeStatus":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.getUsage":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.installModel":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.listModelCatalog":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listModels":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listNodeModels":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listProfileKinds":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listProfiles":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listRuntimeNodes":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.setDefault":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.startRuntime":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.stopRuntime":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.testProfile":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.upsertProfile":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.complete":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.deleteModel":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`delete`},"llmRuntime.ensureStarted":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.getDiskUsage":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`view`},"llmRuntime.installModel":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.listLocalModels":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`view`},"llmRuntime.status":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`view`},"llmRuntime.stop":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"localNetwork.getAllowedAddresses":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getConnectionEndpoints":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getNotificationEndpoint":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getPreferred":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.list":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.resetAllowlistToBestMatch":{capName:`local-network`,capScope:`system`,addonId:null,access:`delete`},"localNetwork.setAllowedAddresses":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.setNotificationEndpoint":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"lockControl.lock":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"lockControl.open":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"lockControl.unlock":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"logDestination.query":{capName:`log-destination`,capScope:`system`,addonId:null,access:`view`},"logDestination.write":{capName:`log-destination`,capScope:`system`,addonId:null,access:`create`},"loginMethod.getLoginMethods":{capName:`login-method`,capScope:`system`,addonId:null,access:`view`},"mediaPlayer.next":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.pause":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.play":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.playMedia":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.previous":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.seek":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.selectSource":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setMute":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setRepeat":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setShuffle":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setVolume":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.stop":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"meshNetwork.getStatus":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`view`},"meshNetwork.join":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.leave":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.listPeers":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`view`},"meshNetwork.logout":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.startLogin":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.testConnection":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"metricsProvider.collectSnapshot":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.dumpHeapSnapshot":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`create`},"metricsProvider.getAddonStats":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCached":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCpuTemperature":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCurrent":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getDiskSpace":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getGpuInfo":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getProcessStats":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.killProcess":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`create`},"metricsProvider.listAddonInstances":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.listNodeProcesses":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"modelConvert.convert":{capName:`model-convert`,capScope:`system`,addonId:null,access:`create`},"modelDistributor.distributeModel":{capName:`model-distributor`,capScope:`system`,addonId:null,access:`create`},"motion.isDetected":{capName:`motion`,capScope:`device`,addonId:null,access:`view`},"motionDetection.analyze":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`create`},"motionDetection.removeCamera":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`delete`},"motionDetection.reset":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`delete`},"motionTrigger.setMotionTrigger":{capName:`motion-trigger`,capScope:`device`,addonId:null,access:`create`},"motionZones.getOptions":{capName:`motion-zones`,capScope:`device`,addonId:null,access:`view`},"motionZones.setZone":{capName:`motion-zones`,capScope:`device`,addonId:null,access:`create`},"mqttBroker.addBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.getBrokerConfig":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.getStatus":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.listBrokers":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.removeBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`delete`},"mqttBroker.startEmbeddedBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.stopEmbeddedBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.testConnection":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"nativeObjectDetection.setEnabled":{capName:`native-object-detection`,capScope:`device`,addonId:null,access:`create`},"networkAccess.getEndpoint":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.getStatus":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.listEndpoints":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.start":{capName:`network-access`,capScope:`system`,addonId:null,access:`create`},"networkAccess.stop":{capName:`network-access`,capScope:`system`,addonId:null,access:`create`},"networkQuality.getAllStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`view`},"networkQuality.getDeviceStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`view`},"networkQuality.reportClientStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`create`},"nodes.clusterAddonStatus":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.deployAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.executeQuery":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.getCapUsageGraph":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.getNodeAddons":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.renameNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartProcess":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.setProcessLogLevel":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.shutdownNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.topology":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.undeployAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.deleteTarget":{capName:`notification-output`,capScope:`system`,addonId:null,access:`delete`},"notificationOutput.discoverTargets":{capName:`notification-output`,capScope:`system`,addonId:null,access:`view`},"notificationOutput.listTargetKinds":{capName:`notification-output`,capScope:`system`,addonId:null,access:`view`},"notificationOutput.listTargets":{capName:`notification-output`,capScope:`system`,addonId:null,access:`view`},"notificationOutput.send":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.setTargetEnabled":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.testTarget":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.upsertTarget":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.deleteRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`delete`},"notificationRules.getConditionCatalog":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getHistory":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.listRules":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.setRuleEnabled":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.testRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.updateRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notifier.cancel":{capName:`notifier`,capScope:`device`,addonId:null,access:`create`},"notifier.send":{capName:`notifier`,capScope:`device`,addonId:null,access:`create`},"oauthIntegration.getDescriptor":{capName:`oauth-integration`,capScope:`system`,addonId:null,access:`view`},"osd.setOverlay":{capName:`osd`,capScope:`device`,addonId:null,access:`create`},"petFeeder.callPet":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.cancelFeed":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.feed":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.markFoodReplenished":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.playSound":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.resetDesiccant":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`delete`},"petFeeder.setChildLock":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.setFeedSound":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.setIndicatorLight":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.setVolume":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.cancelMediaRelocate":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.clearTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.deleteDeviceEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.deleteTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.getActiveTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getAudioEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventDensity":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventStoreFootprint":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getKeyEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getMediaRelocateStatus":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getMotionEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getObjectEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getSensorEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrackMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventKinds":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listOpsLog":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRecentTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.pruneEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.pruneEventsBefore":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.pruneTracksBefore":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.relocateMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.searchObjectEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.wipeAllAnalytics":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineExecutor.cacheFrameInPool":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.clearDeviceOverrides":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.deleteModel":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.deleteTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.downloadModel":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.getAddonModels":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getAudioCapabilities":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getAvailableEngines":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getCapabilities":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getDefaultSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getDetectionConfigSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getEffectiveTuning":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getEngineProvisioning":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getGlobalPipelineConfig":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getGlobalSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getOrchestratorConfigSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceAudio":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceAudioFiles":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceImage":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getSelectedEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getVideoPipelineSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.inferCached":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.killEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.listLoadedEngines":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.listReferenceImages":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.listTemplates":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.runAudioTest":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.runPipeline":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.runPipelineBatch":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.saveTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.setVideoPipelineSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.spinEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.uncacheFrame":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.updateTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.validatePipeline":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.assignAudio":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.assignPipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.deleteTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.getAgentLoad":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioAssignment":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioAssignments":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioNodeLoad":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraMetrics":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStatus":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStatuses":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStepOverrides":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCapabilityBindings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getGlobalMetrics":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getIngestOwner":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getNodeInferenceDevices":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getPipelineAssignment":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getPipelineAssignments":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getPipelineDevicePin":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.listAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.listTemplates":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.rebalance":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.removeAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.resetNodePipelineDefaults":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.resolvePipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.saveTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentCapabilities":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentDetectWeight":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentInferenceDevices":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentMaxCameras":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentReachableHost":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraPipelineForAgent":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepOverride":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepToggle":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCapabilityBinding":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setPipelineDevicePin":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignAudio":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignPipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.updateTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.attachCamera":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.detachCamera":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.getAllCameraMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getCameraMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalCameras":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalLoad":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getNativeCrop":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.reportMotion":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.runDetailSubtree":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"plateGallery.assignPlate":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.assignPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.correctPlateText":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.createVehicle":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.deletePlate":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`delete`},"plateGallery.deleteVehicle":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`delete`},"plateGallery.getPlateByTrack":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.getPlateMedia":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.listPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.listVehicles":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.listVehicleSamples":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.removeVehicleSample":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`delete`},"plateGallery.renameVehicle":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.searchPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.suggestPlateClusters":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.unassignPlate":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.unassignPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"platformProbe.getCapabilities":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.getHardware":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.resolveHwAccel":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.resolveInferenceConfig":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"privacyMask.getOptions":{capName:`privacy-mask`,capScope:`device`,addonId:null,access:`view`},"privacyMask.setMask":{capName:`privacy-mask`,capScope:`device`,addonId:null,access:`create`},"ptz.continuousMove":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.deletePreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`delete`},"ptz.getOptions":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getPosition":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getPresets":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.goHome":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.goToPreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.move":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.savePreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.setAutofocus":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.stop":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptzAutotrack.getSettings":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`view`},"ptzAutotrack.getStatus":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`view`},"ptzAutotrack.setEnabled":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`create`},"ptzAutotrack.setSettings":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`create`},"reboot.reboot":{capName:`reboot`,capScope:`device`,addonId:null,access:`create`},"recording.cancelRelocate":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recording.deleteFootprint":{capName:`recording`,capScope:`system`,addonId:null,access:`delete`},"recording.getAvailability":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getDaysWithRecordings":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getDeviceConfig":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getPlaybackManifest":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getRelocateStatus":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getStorageUsage":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.listOpsLog":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.locateSegment":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.pruneFootage":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recording.readSegmentBytes":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.relocateFootage":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recording.renderClip":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recording.renderGif":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recording.rescanStorage":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recording.setDeviceConfig":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recordingExport.cancelExport":{capName:`recordingExport`,capScope:`system`,addonId:null,access:`create`},"recordingExport.createExport":{capName:`recordingExport`,capScope:`system`,addonId:null,access:`create`},"recordingExport.deleteExport":{capName:`recordingExport`,capScope:`system`,addonId:null,access:`delete`},"recordingExport.getDownloadUrl":{capName:`recordingExport`,capScope:`system`,addonId:null,access:`view`},"recordingExport.getExport":{capName:`recordingExport`,capScope:`system`,addonId:null,access:`view`},"recordingExport.listExports":{capName:`recordingExport`,capScope:`system`,addonId:null,access:`view`},"sceneMonitor.captureReference":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`create`},"sceneMonitor.createScene":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`create`},"sceneMonitor.deleteReference":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`delete`},"sceneMonitor.deleteScene":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`delete`},"sceneMonitor.listScenes":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`view`},"sceneMonitor.recheckNow":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`create`},"sceneMonitor.updateScene":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`create`},"scriptRunner.run":{capName:`script-runner`,capScope:`device`,addonId:null,access:`create`},"scriptRunner.stop":{capName:`script-runner`,capScope:`device`,addonId:null,access:`create`},"serverManagement.applyServerUpdate":{capName:`server-management`,capScope:`system`,addonId:null,access:`create`},"serverManagement.checkServerUpdate":{capName:`server-management`,capScope:`system`,addonId:null,access:`create`},"serverManagement.getServerPackageStatus":{capName:`server-management`,capScope:`system`,addonId:null,access:`view`},"serverManagement.restartServer":{capName:`server-management`,capScope:`system`,addonId:null,access:`create`},"serverManagement.rollbackServerUpdate":{capName:`server-management`,capScope:`system`,addonId:null,access:`create`},"settingsStore.count":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.declareCollection":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.delete":{capName:`settings-store`,capScope:`system`,addonId:null,access:`delete`},"settingsStore.get":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.histogram":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.insert":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.isEmpty":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.query":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.set":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.update":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"smtpProvider.getStatus":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`view`},"smtpProvider.sendEmail":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`create`},"smtpProvider.verify":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`view`},"snapshot.getSnapshot":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.getSnapshotOverview":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.invalidateCache":{capName:`snapshot`,capScope:`device`,addonId:null,access:`create`},"ssoBridge.signBridgeToken":{capName:`sso-bridge`,capScope:`system`,addonId:null,access:`view`},"ssoBridge.verifyBridgeToken":{capName:`sso-bridge`,capScope:`system`,addonId:null,access:`view`},"storage.abortUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.beginDownload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.beginUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.delete":{capName:`storage`,capScope:`system`,addonId:null,access:`delete`},"storage.deleteLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`delete`},"storage.endDownload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.exists":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.finalizeUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.getAvailableSpace":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.getDefaultLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.list":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listLocationDeclarations":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listLocations":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listProviders":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.read":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.readChunk":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.resolve":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.testConfig":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.testLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.upsertLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.write":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.writeChunk":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storageEvictable.evict":{capName:`storage-evictable`,capScope:`system`,addonId:null,access:`create`},"storageEvictable.getEvictableUsage":{capName:`storage-evictable`,capScope:`system`,addonId:null,access:`view`},"storageProvider.abortUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.beginDownload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.beginUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.delete":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`delete`},"storageProvider.endDownload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.exists":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.finalizeUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.getAvailableSpace":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.getProviderInfo":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.list":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.read":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.readChunk":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.resolve":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.testLocation":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.write":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.writeChunk":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"streamBroker.assignProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.getAllRtspEntries":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getBrokerStats":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getPreBufferInfo":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getRtspEntry":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getRtspPort":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getStreamUrl":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getStreamWithCodec":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.isRtspEnabled":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.killClient":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.listAllCameraStreams":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.listAllProfileSlots":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.listClients":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.probeStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.publishCameraStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.pullAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.pullFrameHandles":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.regenerateRtspToken":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.releaseStreamWithCodec":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.renderPreBufferClip":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.restartProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.retractCameraStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.setPreBufferDuration":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.setRtspEnabled":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.subscribeAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.subscribeFrames":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unassignProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unsubscribeAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unsubscribeFrames":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamCatalog.getCatalog":{capName:`stream-catalog`,capScope:`device`,addonId:null,access:`view`},"streamParams.getConfigSchema":{capName:`stream-params`,capScope:`device`,addonId:null,access:`view`},"streamParams.getOptions":{capName:`stream-params`,capScope:`device`,addonId:null,access:`view`},"streamParams.setProfile":{capName:`stream-params`,capScope:`device`,addonId:null,access:`create`},"switch.setState":{capName:`switch`,capScope:`device`,addonId:null,access:`create`},"system.featureFlags":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.forceRetentionCleanup":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"system.getRetentionConfig":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.health":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.info":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.networkAddresses":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.setRetentionConfig":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"terminalSession.close":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.listProfiles":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`view`},"terminalSession.listSessions":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`view`},"terminalSession.openSession":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.resize":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"toast.onToast":{capName:`toast`,capScope:`system`,addonId:null,access:`view`},"turnProvider.getTurnServers":{capName:`turn-provider`,capScope:`system`,addonId:null,access:`view`},"update.installUpdate":{capName:`update`,capScope:`device`,addonId:null,access:`create`},"userManagement.confirmTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.deleteUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.disableTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.getTotpStatus":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listApiKeys":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listOauthSessions":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listScopedTokens":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listUsers":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthExchangeCode":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthIssueCode":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.oauthRefresh":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthVerifyAccessToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.resetPassword":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.revokeApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.revokeOauthSession":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.revokeScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.setupTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.setUserScopes":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.updateUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.validateApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.validateCredentials":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.validateScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.verifyTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.beginAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.beginDiscoverableAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.beginRegistration":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`create`},"userPasskeys.finishAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.finishDiscoverableAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.finishRegistration":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`create`},"userPasskeys.getSecondFactorPreference":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.listPasskeys":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.removePasskey":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`delete`},"userPasskeys.setSecondFactorPreference":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`create`},"vacuumControl.locate":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.pause":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.returnToBase":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.setFanSpeed":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.start":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.stop":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"valve.close":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.open":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.setPosition":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.stop":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"videoclips.getClipPlayback":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"videoclips.listClips":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"viewerUi.getStaticDir":{capName:`viewer-ui`,capScope:`system`,addonId:null,access:`view`},"viewerUi.getVersion":{capName:`viewer-ui`,capScope:`system`,addonId:null,access:`view`},"waterHeater.setAway":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"waterHeater.setOperationMode":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"waterHeater.setTargetTemp":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.addIceCandidate":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.closeSession":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.createSession":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.getIceCandidates":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.getSessionState":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.handleAnswer":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.handleOffer":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.hasAdaptiveBitrate":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.listStreams":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getCameraHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getCurrentSnapshot":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getUnzonedHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getZoneHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneRules.listRules":{capName:`zone-rules`,capScope:`device`,addonId:null,access:`view`},"zoneRules.setRules":{capName:`zone-rules`,capScope:`device`,addonId:null,access:`create`},"zones.addZone":{capName:`zones`,capScope:`device`,addonId:null,access:`create`},"zones.listZones":{capName:`zones`,capScope:`device`,addonId:null,access:`view`},"zones.removeZone":{capName:`zones`,capScope:`device`,addonId:null,access:`delete`},"zones.updateZone":{capName:`zones`,capScope:`device`,addonId:null,access:`create`}}),Object.freeze({broker:`broker`,"device-export":`device-export`,llm:`ai`,"mesh-network":`mesh`,"mqtt-broker":`broker`,"network-access":`ingress`,"smtp-provider":`email`});var lT=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},uT=new class extends lT{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},dT={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fT=new class{#e=dT;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function pT(e){setTimeout(e,0)}var mT=typeof window>`u`||`Deno`in globalThis;function hT(){}function gT(e,t){return typeof e==`function`?e(t):e}function _T(e){return typeof e==`number`&&e>=0&&e!==1/0}function vT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yT(e,t){return typeof e==`function`?e(t):e}function bT(e,t){return typeof e==`function`?e(t):e}function xT(e,t){let{type:n=`all`,exact:r,fetchStatus:a,predicate:o,queryKey:s,stale:c}=e;if(s){if(r){if(t.queryHash!==CT(s,t.options))return!1}else if(!TT(t.queryKey,s))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof c==`boolean`&&t.isStale()!==c||a&&a!==t.state.fetchStatus||o&&!o(t))}function ST(e,t){let{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(wT(t.options.mutationKey)!==wT(o))return!1}else if(!TT(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function CT(e,t){return(t?.queryKeyHashFn||wT)(e)}function wT(e){return JSON.stringify(e,(e,t)=>AT(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function TT(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>TT(e[n],t[n])):!1}var ET=Object.prototype.hasOwnProperty;function DT(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=kT(e)&&kT(t);if(!r&&!(AT(e)&&AT(t)))return t;let a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),s=o.length,c=r?Array(s):{},l=0;for(let u=0;u<s;u++){let s=r?u:o[u],d=e[s],f=t[s];if(d===f){c[s]=d,(r?u<a:ET.call(e,s))&&l++;continue}if(d===null||f===null||typeof d!=`object`||typeof f!=`object`){c[s]=f;continue}let p=DT(d,f,n+1);c[s]=p,p===d&&l++}return a===s&&l===a?e:c}function OT(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function kT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function AT(e){if(!jT(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!jT(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function jT(e){return Object.prototype.toString.call(e)===`[object Object]`}function MT(e){return new Promise(t=>{fT.setTimeout(t,e)})}function NT(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:DT(e,t)}function PT(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function FT(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var IT=Symbol();function LT(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===IT?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function RT(e,t){return typeof e==`function`?e(...t):!!e}function zT(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=t(),r?a:(r=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0}),a))}),e}var BT=(()=>{let e=()=>mT;return{isServer(){return e()},setIsServer(t){e=t}}})();function VT(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var HT=pT;function UT(){let e=[],t=0,n=e=>{e()},r=e=>{e()},a=HT,o=r=>{t?e.push(r):a(()=>{n(r)})},s=()=>{let t=e;e=[],t.length&&a(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||s()}return n},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{a=e}}}var WT=UT(),GT=new class extends lT{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function KT(e){return Math.min(1e3*2**e,3e4)}function qT(e){return(e??`online`)===`online`?GT.isOnline():!0}var JT=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function YT(e){let t=!1,n=0,r,a=VT(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new JT(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>uT.isFocused()&&(e.networkMode===`always`||GT.isOnline())&&e.canRun(),d=()=>qT(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),a.resolve(e))},p=e=>{o()||(r?.(),a.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let r,a=n===0?e.initialPromise:void 0;try{r=a??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(o())return;let a=e.retry??(BT.isServer()?0:3),s=e.retryDelay??KT,c=typeof s==`function`?s(n,r):s,l=a===!0||typeof a==`number`&&n<a||typeof a==`function`&&a(n,r);if(t||!l){p(r);return}n++,e.onFail?.(n,r),MT(c).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),a)}}var XT=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_T(this.gcTime)&&(this.#e=fT.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(BT.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(fT.clearTimeout(this.#e),this.#e=void 0)}};function ZT(e){return{onFetch:(t,n)=>{let r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[],c={pages:[],pageParams:[]},l=0,u=async()=>{let n=!1,u=e=>{zT(e,()=>t.signal,()=>n=!0)},d=LT(t.options,t.fetchOptions),f=async(e,r,a)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let o=await d((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:a?`backward`:`forward`,meta:t.options.meta};return u(e),e})()),{maxPages:s}=t.options,c=a?FT:PT;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(a&&o.length){let e=a===`backward`,t=e?$T:QT,n={pages:o,pageParams:s};c=await f(n,t(r,n),e)}else{let t=e??o.length;do{let e=l===0?s[0]??r.initialPageParam:QT(r,c);if(l>0&&e==null)break;c=await f(c,e),l++}while(l<t)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function QT(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function $T(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function eE(e,t){return t?QT(e,t)!=null:!1}function tE(e,t){return!t||!e.getPreviousPageParam?!1:$T(e,t)!=null}var nE=class extends XT{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=aE(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=aE(this.options);e.data!==void 0&&(this.setState(iE(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=NT(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(hT).catch(hT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>bT(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===IT||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>yT(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!vT(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},a=()=>{let e=LT(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},o=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:a};return r(e),e})();(this.#e===`infinite`?ZT(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:o.fetchOptions?.meta}),this.#a=YT({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof JT&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof JT){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...rE(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...iE(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),WT.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function rE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qT(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function iE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function aE(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var oE=class extends lT{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=VT(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),cE(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lE(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lE(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof bT(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!OT(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&uE(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||bT(this.options.enabled,this.#t)!==bT(t.enabled,this.#t)||yT(this.options.staleTime,this.#t)!==yT(t.staleTime,this.#t))&&this.#g();let a=this.#_();r&&(this.#t!==n||bT(this.options.enabled,this.#t)!==bT(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return fE(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(hT)),t}#g(){this.#b();let e=yT(this.options.staleTime,this.#t);if(BT.isServer()||this.#r.isStale||!_T(e))return;let t=vT(this.#r.dataUpdatedAt,e)+1;this.#d=fT.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(BT.isServer()||bT(this.options.enabled,this.#t)===!1||!_T(this.#p)||this.#p===0)&&(this.#f=fT.setInterval(()=>{(this.options.refetchIntervalInBackground||uT.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(fT.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(fT.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,a=this.#r,o=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:l}=e,u={...l},d=!1,f;if(t._optimisticResults){let a=this.hasListeners(),o=!a&&cE(e,t),s=a&&uE(e,n,t,r);(o||s)&&(u={...u,...rE(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:p,errorUpdatedAt:m,status:h}=u;f=u.data;let g=!1;if(t.placeholderData!==void 0&&f===void 0&&h===`pending`){let e;a?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=a.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(h=`success`,f=NT(a?.data,e,t),d=!0)}if(t.select&&f!==void 0&&!g)if(a&&f===o?.data&&t.select===this.#c)f=this.#l;else try{this.#c=t.select,f=t.select(f),f=NT(a?.data,f,t),this.#l=f,this.#s=null}catch(e){this.#s=e}this.#s&&(p=this.#s,f=this.#l,m=Date.now(),h=`error`);let _=u.fetchStatus===`fetching`,v=h===`pending`,y=h===`error`,b=v&&_,x=f!==void 0,S={status:h,fetchStatus:u.fetchStatus,isPending:v,isSuccess:h===`success`,isError:y,isInitialLoading:b,isLoading:b,data:f,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:u.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:y&&x,isStale:dE(e,t),refetch:this.refetch,promise:this.#o,isEnabled:bT(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,a=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},o=()=>{a(this.#o=S.promise=VT())},s=this.#o;switch(s.status){case`pending`:e.queryHash===n.queryHash&&a(s);break;case`fulfilled`:(r||S.data!==s.value)&&o();break;case`rejected`:(!r||S.error!==s.reason)&&o();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!OT(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){WT.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function sE(e,t){return bT(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&bT(t.retryOnMount,e)===!1)}function cE(e,t){return sE(e,t)||e.state.data!==void 0&&lE(e,t,t.refetchOnMount)}function lE(e,t,n){if(bT(t.enabled,e)!==!1&&yT(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&dE(e,t)}return!1}function uE(e,t,n,r){return(e!==t||bT(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&dE(e,n)}function dE(e,t){return bT(t.enabled,e)!==!1&&e.isStaleByTime(yT(t.staleTime,e))}function fE(e,t){return!OT(e.getCurrentResult(),t)}var pE=class extends oE{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:s,isRefetchError:c}=r,l=n.fetchMeta?.fetchMore?.direction,u=s&&l===`forward`,d=a&&l===`forward`,f=s&&l===`backward`,p=a&&l===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:eE(t,n.data),hasPreviousPage:tE(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:c&&!u&&!f,isRefetching:o&&!d&&!p}}},mE=class extends XT{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||hE(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=YT({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,a=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),WT.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function hE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var gE=class extends lT{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new mE({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=_E(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=_E(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=_E(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=_E(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){WT.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ST(t,e))}findAll(e={}){return this.getAll().filter(t=>ST(e,t))}notify(e){WT.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return WT.batch(()=>Promise.all(e.map(e=>e.continue().catch(hT))))}};function _E(e){return e.options.scope?.id}var vE=class extends lT{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),OT(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&wT(t.mutationKey)!==wT(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??hE();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){WT.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function yE(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function bE(e,t,n){let r=e.slice(0);return r[t]=n,r}var xE=class extends lT{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,WT.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),a=e.length!==n.length,o=n.some((t,n)=>t!==e[n]),s=a||o,c=s?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!OT(e,n)});!s&&!c||(s&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(s&&(yE(e,n).forEach(e=>{e.destroy()}),yE(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),a=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,a),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let a=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?a:n.observer.trackResult(a,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,a=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||a||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=DT(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),a=t.get(r.queryHash)?.shift()??new oE(this.#e,r);n.push({defaultedQueryOptions:r,observer:a})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=bE(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&WT.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},SE=class extends lT{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,a=t.queryHash??CT(r,t),o=this.get(a);return o||(o=new nE({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){WT.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>xT(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>xT(e,t)):t}notify(e){WT.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){WT.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){WT.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},CE=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new SE,this.#t=e.mutationCache||new gE,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=uT.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=GT.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(yT(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(r.queryHash)?.state.data,o=gT(t,a);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return WT.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;WT.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return WT.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=WT.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(hT).catch(hT)}invalidateQueries(e,t={}){return WT.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=WT.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(hT)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(hT)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(yT(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(hT).catch(hT)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(hT).catch(hT)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return GT.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(wT(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{TT(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(wT(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{TT(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=CT(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===IT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},wE=S.createContext(void 0),TE=e=>{let t=S.useContext(wE);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},EE=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,C.jsx)(wE.Provider,{value:e,children:t})),DE=S.createContext(!1),OE=()=>S.useContext(DE);DE.Provider;function kE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var AE=S.createContext(kE()),jE=()=>S.useContext(AE),ME=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?RT(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},NE=e=>{S.useEffect(()=>{e.clearReset()},[e])},PE=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||RT(n,[e.error,r])),FE=(e,t)=>t.state.data===void 0,IE=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},LE=(e,t)=>e.isLoading&&e.isFetching&&!t,RE=(e,t)=>e?.suspense&&t.isPending,zE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function BE({queries:e,...t},n){let r=TE(n),a=OE(),o=jE(),s=S.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=a?`isRestoring`:`optimistic`,t}),[e,r,a]);s.forEach(e=>{IE(e),ME(e,o,r.getQueryCache().get(e.queryHash))}),NE(o);let[c]=S.useState(()=>new xE(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!a&&t.subscribed!==!1;S.useSyncExternalStore(S.useCallback(e=>f?c.subscribe(WT.batchCalls(e)):hT,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>RE(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&RE(n,e)?zE(n,new oE(r,n),o):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&PE({result:e,errorResetBoundary:o,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m?.error)throw m.error;return u(d())}function VE(e,t,n){let r=OE(),a=jE(),o=TE(n),s=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=o.getQueryCache().get(s.queryHash),l=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,IE(s),ME(s,a,c),NE(a);let u=!o.getQueryCache().get(s.queryHash),[d]=S.useState(()=>new t(o,s)),f=d.getOptimisticResult(s),p=!r&&l;if(S.useSyncExternalStore(S.useCallback(e=>{let t=p?d.subscribe(WT.batchCalls(e)):hT;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),S.useEffect(()=>{d.setOptions(s)},[s,d]),RE(s,f))throw zE(s,d,a);if(PE({result:f,errorResetBoundary:a,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,f),s.experimental_prefetchInRender&&!BT.isServer()&&LE(f,r)&&(u?zE(s,d,a):c?.promise)?.catch(hT).finally(()=>{d.updateResult()}),s.notifyOnChangeProps?f:d.trackResult(f)}function HE(e,t){return VE(e,oE,t)}function UE(e,t){return VE({...e,enabled:!0,suspense:!0,throwOnError:FE,placeholderData:void 0},oE,t)}function WE(e,t){return VE({...e,enabled:!0,suspense:!0,throwOnError:FE},pE,t)}function GE(e,t){return BE({...e,queries:e.queries.map(e=>({...e,suspense:!0,throwOnError:FE,enabled:!0,placeholderData:void 0}))},t)}function KE(e,t){let n=TE(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function qE(e,t){let n=TE(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function JE(e){return e}function YE(e){return e}function XE(e,t){let n=TE(t),[r]=S.useState(()=>new vE(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);let a=S.useSyncExternalStore(S.useCallback(e=>r.subscribe(WT.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=S.useCallback((e,t)=>{r.mutate(e,t).catch(hT)},[r]);if(a.error&&RT(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function ZE(e,t){return VE(e,pE,t)}g();var QE=Object.create,$E=Object.defineProperty,eD=Object.getOwnPropertyDescriptor,tD=Object.getOwnPropertyNames,nD=Object.getPrototypeOf,rD=Object.prototype.hasOwnProperty,iD=(e,t)=>function(){return t||(0,e[tD(e)[0]])((t={exports:{}}).exports,t),t.exports},aD=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var a=tD(t),o=0,s=a.length,c;o<s;o++)c=a[o],!rD.call(e,c)&&c!==n&&$E(e,c,{get:(e=>t[e]).bind(null,c),enumerable:!(r=eD(t,c))||r.enumerable});return e},oD=(e,t,n)=>(n=e==null?{}:QE(nD(e)),aD(t||!e||!e.__esModule?$E(n,`default`,{value:e,enumerable:!0}):n,e)),sD=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),cD=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=sD().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||`default`);if(n(a)!=`object`)return a;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),lD=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=sD().default,r=cD();function a(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),uD=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=lD();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),dD=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=uD();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]==null?{}:arguments[t];t%2?r(Object(a),!0).forEach(function(t){n(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}});function fD(e){let t={subscribe(t){let n=null,r=!1,a=!1,o=!1;function s(){if(n===null){o=!0;return}a||(a=!0,typeof n==`function`?n():n&&n.unsubscribe())}return n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){var n;r||(r=!0,(n=t.error)==null||n.call(t,e),s())},complete(){var e;r||(r=!0,(e=t.complete)==null||e.call(t),s())}}),o&&s(),{unsubscribe:s}},pipe(...e){return e.reduce(pD,t)}};return t}function pD(e,t){return t(e)}function mD(e){let t=new AbortController;return new Promise((n,r)=>{let a=!1;function o(){a||(a=!0,s.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let s=e.subscribe({next(e){a=!0,n(e),o()},error(e){r(e)},complete(){t.abort(),o()}})})}function hD(e){return e=>{let t=0,n=null,r=[];function a(){n||=e.subscribe({next(e){for(let n of r){var t;(t=n.next)==null||t.call(n,e)}},error(e){for(let n of r){var t;(t=n.error)==null||t.call(n,e)}},complete(){for(let t of r){var e;(e=t.complete)==null||e.call(t)}}})}function o(){if(t===0&&n){let e=n;n=null,e.unsubscribe()}}return fD(e=>(t++,r.push(e),a(),{unsubscribe(){t--,o();let n=r.findIndex(t=>t===e);n>-1&&r.splice(n,1)}}))}}function gD(e){let t=e,n=[],r=e=>{t!==void 0&&e.next(t),n.push(e)},a=e=>{n.splice(n.indexOf(e),1)},o=fD(e=>(r(e),()=>{a(e)}));return o.next=e=>{if(t!==e){t=e;for(let t of n)t.next(e)}},o.get=()=>t,o}function _D(e){return fD(t=>{function n(t=0,r=e.op){let a=e.links[t];if(!a)throw Error(`No more links to execute - did you forget to add an ending link?`);return a({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}function vD(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function yD(){return Object.create(null)}var bD=typeof Symbol==`function`&&!!Symbol.asyncIterator;function xD(e){return bD&&vD(e)&&Symbol.asyncIterator in e}var SD=e=>e();function CD(e=0){return new Promise(t=>setTimeout(t,e))}var wD={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};wD.BAD_GATEWAY,wD.SERVICE_UNAVAILABLE,wD.GATEWAY_TIMEOUT,wD.INTERNAL_SERVER_ERROR;var TD=Object.create,ED=Object.defineProperty,DD=Object.getOwnPropertyDescriptor,OD=Object.getOwnPropertyNames,kD=Object.getPrototypeOf,AD=Object.prototype.hasOwnProperty,jD=(e,t)=>function(){return t||(0,e[OD(e)[0]])((t={exports:{}}).exports,t),t.exports},MD=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var a=OD(t),o=0,s=a.length,c;o<s;o++)c=a[o],!AD.call(e,c)&&c!==n&&ED(e,c,{get:(e=>t[e]).bind(null,c),enumerable:!(r=DD(t,c))||r.enumerable});return e},ND=(e,t,n)=>(n=e==null?{}:TD(kD(e)),MD(t||!e||!e.__esModule?ED(n,`default`,{value:e,enumerable:!0}):n,e)),PD=()=>{},FD=e=>{Object.freeze&&Object.freeze(e)};function ID(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(PD,{get(r,a){if(!(typeof a!=`string`||a===`then`))return ID(e,[...t,a],n)},apply(n,r,a){let o=t[t.length-1];if(o===`valueOf`||o===`toString`||o===`toJSON`)return`tRPC.proxy(${t.slice(0,-1).join(`.`)})`;let s={args:a,path:t};return o===`call`?s={args:a.length>=2?[a[1]]:[],path:t.slice(0,-1)}:o===`apply`&&(s={args:a.length>=2?a[1]:[],path:t.slice(0,-1)}),FD(s.args),FD(s.path),e(s)}})),n[r]}var LD=e=>ID(e,[],yD()),RD=e=>new Proxy(PD,{get(t,n){if(n!==`then`)return e(n)}}),zD=jD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),BD=jD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=zD().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||`default`);if(n(a)!=`object`)return a;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),VD=jD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=zD().default,r=BD();function a(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),HD=jD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=VD();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),UD=jD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=HD();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]==null?{}:arguments[t];t%2?r(Object(a),!0).forEach(function(t){n(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}});ND(UD(),1),ND(HD(),1);var WD=ND(UD(),1);function GD(e,t){if(`error`in e){let n=t.deserialize(e.error);return{ok:!1,error:(0,WD.default)((0,WD.default)({},e),{},{error:n})}}return{ok:!0,result:(0,WD.default)((0,WD.default)({},e.result),(!e.result.type||e.result.type===`data`)&&{type:`data`,data:t.deserialize(e.result.data)})}}var KD=class extends Error{constructor(){super(`Unable to transform response from server`)}};function qD(e,t){let n;try{n=GD(e,t)}catch{throw new KD}if(!n.ok&&(!vD(n.error.error)||typeof n.error.error.code!=`number`)||n.ok&&!vD(n.result))throw new KD;return n}ND(UD(),1);var JD=oD(uD(),1),YD=oD(dD(),1);function XD(e){return e instanceof $D}function ZD(e){return vD(e)&&vD(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function QD(e,t){return typeof e==`string`?e:vD(e)&&typeof e.message==`string`?e.message:t}var $D=class e extends Error{constructor(t,n){var r,a;let o=n?.cause;super(t,{cause:o}),(0,JD.default)(this,`cause`,void 0),(0,JD.default)(this,`shape`,void 0),(0,JD.default)(this,`data`,void 0),(0,JD.default)(this,`meta`,void 0),this.meta=n?.meta,this.cause=o,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(a=n.result)==null?void 0:a.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return XD(r)?(n.meta&&(r.meta=(0,YD.default)((0,YD.default)({},r.meta),n.meta)),r):ZD(r)?new e(r.error.message,(0,YD.default)((0,YD.default)({},n),{},{result:r,cause:n.cause})):new e(QD(r,`Unknown error`),(0,YD.default)((0,YD.default)({},n),{},{cause:r}))}};function eO(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var tO=e=>typeof e==`function`;function nO(e){if(e)return e;if(typeof window<`u`&&tO(window.fetch))return window.fetch;if(typeof globalThis<`u`&&tO(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}var rO=oD(dD());function iO(e){return{url:e.url.toString(),fetch:e.fetch,transformer:eO(e.transformer),methodOverride:e.methodOverride}}function aO(e){let t={};for(let n=0;n<e.length;n++)t[n]=e[n];return t}var oO={query:`GET`,mutation:`POST`,subscription:`PATCH`};function sO(e){return`input`in e?e.transformer.input.serialize(e.input):aO(e.inputs.map(t=>e.transformer.input.serialize(t)))}var cO=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+e.path,r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),e.type===`query`||e.type===`subscription`){let t=sO(e);t!==void 0&&e.methodOverride!==`POST`&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},lO=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=sO(e);return t===void 0?void 0:JSON.stringify(t)},uO=e=>mO((0,rO.default)((0,rO.default)({},e),{},{contentTypeHeader:`application/json`,getUrl:cO,getBody:lO})),dO=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},fO=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new dO};async function pO(e){fO(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??oO[e.type],a=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),o=(0,rO.default)((0,rO.default)((0,rO.default)({},e.contentTypeHeader&&r!==`GET`?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),a);return nO(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:o})}async function mO(e){let t={},n=await pO(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}function hO(e){return e instanceof Uint8Array||e instanceof Blob}function gO(e){return e instanceof FormData}var _O=oD(dD(),1),vO=e=>{if(`input`in e){let{input:t}=e;if(gO(t)){if(e.type!==`mutation`&&e.methodOverride!==`POST`)throw Error(`FormData is only supported for mutations`);return mO((0,_O.default)((0,_O.default)({},e),{},{contentTypeHeader:void 0,getUrl:cO,getBody:()=>t}))}if(hO(t)){if(e.type!==`mutation`&&e.methodOverride!==`POST`)throw Error(`Octet type input is only supported for mutations`);return mO((0,_O.default)((0,_O.default)({},e),{},{contentTypeHeader:`application/octet-stream`,getUrl:cO,getBody:()=>t}))}}return uO(e)};function yO(e){let t=iO(e);return()=>n=>{let{op:r}=n;return fD(n=>{let{path:a,input:o,type:s}=r;if(s===`subscription`)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let c=vO((0,_O.default)((0,_O.default)({},t),{},{type:s,path:a,input:o,signal:r.signal,headers(){return e.headers?typeof e.headers==`function`?e.headers({op:r}):e.headers:{}}})),l;return c.then(e=>{l=e.meta;let r=qD(e.json,t.transformer.output);if(!r.ok){n.error($D.from(r.error,{meta:l}));return}n.next({context:e.meta,result:r.result}),n.complete()}).catch(e=>{n.error($D.from(e,{meta:l}))}),()=>{}})}}oD(dD(),1),oD(dD(),1);var bO={encode:e=>JSON.stringify(e),decode:e=>{if(typeof e!=`string`)throw Error(`jsonEncoder received binary data. JSON uses text frames. Use a binary encoder for binary data.`);return JSON.parse(e)}},xO={enabled:!1,closeMs:0},SO={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},CO=e=>e===0?0:Math.min(1e3*2**e,3e4),wO=(e,...t)=>typeof e==`function`?e(...t):e,TO=oD(uD(),1),EO=class e extends Error{constructor(t){super(t.message,{cause:t.cause}),this.name=`TRPCWebSocketClosedError`,Object.setPrototypeOf(this,e.prototype)}},DO=class{constructor(e,t){this.onTimeout=e,this.timeoutMs=t,(0,TO.default)(this,`timeout`,void 0)}reset(){this.timeout&&=(clearTimeout(this.timeout),setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}};function OO(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function kO(e){let t=await wO(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function AO(e,t){let n={method:`connectionParams`,data:await wO(e)};return t.encode(n)}var jO=oD(uD(),1),MO=class{constructor(){(0,jO.default)(this,`outgoingRequests`,[]),(0,jO.default)(this,`pendingRequests`,{})}register(e,t){let{promise:n,resolve:r}=OO();return this.outgoingRequests.push({id:String(e.id),message:e,end:n,callbacks:{next:t.next,complete:()=>{t.complete(),r()},error:e=>{t.error(e),r()}}}),()=>{this.delete(e.id),t.complete(),r()}}delete(e){e!==null&&(this.outgoingRequests=this.outgoingRequests.filter(({id:t})=>t!==String(e)),delete this.pendingRequests[String(e)])}flush(){let e=this.outgoingRequests;this.outgoingRequests=[];for(let t of e)this.pendingRequests[t.id]=t;return e}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(e){return e===null?null:this.pendingRequests[String(e)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map(e=>({state:`outgoing`,message:e.message,end:e.end,callbacks:e.callbacks})),...this.getPendingRequests().map(e=>({state:`pending`,message:e.message,end:e.end,callbacks:e.callbacks}))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasPendingSubscriptions(){return this.getPendingRequests().some(e=>e.message.method===`subscription`)}hasOutgoingRequests(){return this.outgoingRequests.length>0}},NO=oD(uD(),1);function PO(e){let{promise:t,resolve:n,reject:r}=OO();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function FO(e,{intervalMs:t,pongTimeoutMs:n}){let r,a;function o(){r=setTimeout(()=>{e.send(`PING`),a=setTimeout(()=>{e.close()},n)},t)}function s(){clearTimeout(r),o()}function c(){clearTimeout(a),s()}e.addEventListener(`open`,o),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),o(),e===`PONG`&&c()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(a)})}var IO=class e{constructor(t){if((0,NO.default)(this,`id`,++e.connectCount),(0,NO.default)(this,`WebSocketPonyfill`,void 0),(0,NO.default)(this,`urlOptions`,void 0),(0,NO.default)(this,`keepAliveOpts`,void 0),(0,NO.default)(this,`encoder`,void 0),(0,NO.default)(this,`wsObservable`,gD(null)),(0,NO.default)(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++e.connectCount,t.openPromise=kO(t.urlOptions).then(e=>new t.WebSocketPonyfill(e)).then(async e=>{t.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),t.keepAliveOpts.enabled&&FO(e,t.keepAliveOpts),e.addEventListener(`close`,()=>{t.ws===e&&(t.ws=null)}),await PO(e),t.urlOptions.connectionParams&&e.send(await AO(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var t;(t=e.ws)==null||t.close()}}};(0,NO.default)(IO,`connectCount`,0);function LO(e){return e.isOpen()?{id:e.id,state:`open`,ws:e.ws}:e.isClosed()?{id:e.id,state:`closed`,ws:e.ws}:e.ws?{id:e.id,state:`connecting`,ws:e.ws}:null}var RO=oD(uD(),1),zO=oD(dD(),1),BO=class{constructor(e){(0,RO.default)(this,`connectionState`,void 0),(0,RO.default)(this,`allowReconnect`,!1),(0,RO.default)(this,`requestManager`,new MO),(0,RO.default)(this,`activeConnection`,void 0),(0,RO.default)(this,`reconnectRetryDelay`,void 0),(0,RO.default)(this,`inactivityTimeout`,void 0),(0,RO.default)(this,`callbacks`,void 0),(0,RO.default)(this,`lazyMode`,void 0),(0,RO.default)(this,`encoder`,void 0),(0,RO.default)(this,`reconnecting`,null),this.encoder=e.experimental_encoder??bO,this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onError:e.onError};let t=(0,zO.default)((0,zO.default)({},xO),e.lazy);this.inactivityTimeout=new DO(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},t.closeMs),this.activeConnection=new IO({WebSocketPonyfill:e.WebSocket,urlOptions:e,keepAlive:(0,zO.default)((0,zO.default)({},SO),e.keepAlive),encoder:this.encoder}),this.activeConnection.wsObservable.subscribe({next:e=>{e&&this.setupWebSocketListeners(e)}}),this.reconnectRetryDelay=e.retryDelayMs??CO,this.lazyMode=t.enabled,this.connectionState=gD({type:`state`,state:t.enabled?`idle`:`connecting`,error:null}),this.lazyMode||this.open().catch(()=>null)}async open(){var e=this;e.allowReconnect=!0,e.connectionState.get().state===`idle`&&e.connectionState.next({type:`state`,state:`connecting`,error:null});try{await e.activeConnection.open()}catch(t){return e.reconnect(new EO({message:`Initialization error`,cause:t})),e.reconnecting}}async close(){var e=this;e.allowReconnect=!1,e.inactivityTimeout.stop();let t=[];for(let n of e.requestManager.getRequests())n.message.method===`subscription`?n.callbacks.complete():n.state===`outgoing`?n.callbacks.error($D.from(new EO({message:`Closed before connection was established`}))):t.push(n.end);await Promise.all(t).catch(()=>null),await e.activeConnection.close().catch(()=>null),e.connectionState.next({type:`state`,state:`idle`,error:null})}request({op:{id:e,type:t,path:n,input:r,signal:a},transformer:o,lastEventId:s}){return fD(c=>{let l=this.batchSend({id:e,method:t,params:{input:o.input.serialize(r),path:n,lastEventId:s}},(0,zO.default)((0,zO.default)({},c),{},{next(e){let t=qD(e,o.output);if(!t.ok){c.error($D.from(t.error));return}c.next({result:t.result})}}));return()=>{l(),t===`subscription`&&this.activeConnection.isOpen()&&this.send({id:e,method:`subscription.stop`}),a?.removeEventListener(`abort`,l)}})}get connection(){return LO(this.activeConnection)}reconnect(e){var t=this;if(this.connectionState.next({type:`state`,state:`connecting`,error:$D.from(e)}),this.reconnecting)return;let n=async e=>{try{await CD(t.reconnectRetryDelay(e)),t.allowReconnect&&(await t.activeConnection.close(),await t.activeConnection.open(),t.requestManager.hasPendingRequests()&&t.send(t.requestManager.getPendingRequests().map(({message:e})=>e))),t.reconnecting=null}catch{await n(e+1)}};this.reconnecting=n(0)}setupWebSocketListeners(e){var t=this;let n=e=>{let t=this.requestManager.getPendingRequests();for(let{message:n,callbacks:r}of t)n.method!==`subscription`&&(r.error($D.from(e??new EO({message:`WebSocket closed`,cause:e}))),this.requestManager.delete(n.id))};e.addEventListener(`open`,()=>{SD(async()=>{var e,n;t.lazyMode&&t.inactivityTimeout.start(),(e=(n=t.callbacks).onOpen)==null||e.call(n),t.connectionState.next({type:`state`,state:`pending`,error:null})}).catch(t=>{e.close(3e3),n(t)})}),e.addEventListener(`message`,({data:e})=>{if(this.inactivityTimeout.reset(),[`PING`,`PONG`].includes(e))return;let t=this.encoder.decode(e);if(`method`in t){this.handleIncomingRequest(t);return}this.handleResponseMessage(t)}),e.addEventListener(`close`,e=>{var t,r;n(e),(t=(r=this.callbacks).onClose)==null||t.call(r,e),(!this.lazyMode||this.requestManager.hasPendingSubscriptions())&&this.reconnect(new EO({message:`WebSocket closed`,cause:e}))}),e.addEventListener(`error`,e=>{var t,r;n(e),(t=(r=this.callbacks).onError)==null||t.call(r,e),this.reconnect(new EO({message:`WebSocket closed`,cause:e}))})}handleResponseMessage(e){let t=this.requestManager.getPendingRequest(e.id);if(!t)return;t.callbacks.next(e);let n=!0;`result`in e&&t.message.method===`subscription`&&(e.result.type===`data`&&(t.message.params.lastEventId=e.result.id),e.result.type!==`stopped`&&(n=!1)),n&&(t.callbacks.complete(),this.requestManager.delete(e.id))}handleIncomingRequest(e){e.method===`reconnect`&&this.reconnect(new EO({message:`Server requested reconnect`}))}send(e){if(!this.activeConnection.isOpen())throw Error(`Active connection is not open`);let t=e instanceof Array?e:[e];this.activeConnection.ws.send(this.encoder.encode(t.length===1?t[0]:t))}batchSend(e,t){var n=this;return this.inactivityTimeout.reset(),SD(async()=>{n.activeConnection.isOpen()||await n.open(),await CD(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:e})=>e))}).catch(n=>{this.requestManager.delete(e.id),t.error($D.from(n))}),this.requestManager.register(e,t)}};function VO(e){return new BO(e)}function HO(e){let{client:t}=e,n=eO(e.transformer);return()=>({op:e})=>fD(r=>{let a=e.type===`subscription`?t.connectionState.subscribe({next(t){r.next({result:t,context:e.context})}}):null,o=t.request({op:e,transformer:n}).subscribe(r);return()=>{o.unsubscribe(),a?.unsubscribe()}})}var UO=oD(uD(),1),WO=oD(dD(),1),GO=class{constructor(e){(0,UO.default)(this,`links`,void 0),(0,UO.default)(this,`runtime`,void 0),(0,UO.default)(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return _D({links:this.links,op:(0,WO.default)((0,WO.default)({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(hD())}async requestAsPromise(e){var t=this;try{return(await mD(t.$request(e))).result.data}catch(e){throw $D.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var a;(a=n.onStopped)==null||a.call(n);break;case`data`:case void 0:var o;(o=n.onData)==null||o.call(n,e.result.data);break}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},KO=Symbol.for(`trpc_untypedClient`),qO={query:`query`,mutate:`mutation`,subscribe:`subscription`},JO=e=>qO[e];function YO(e){let t=LD(({path:t,args:n})=>{let r=[...t],a=JO(r.pop()),o=r.join(`.`);return e[a](o,...n)});return RD(n=>n===KO?e:t[n])}function XO(e){return YO(new GO(e))}function ZO(e){return e[KO]}oD(dD(),1),oD(dD(),1),oD(iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,a,o=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,a=Symbol.iterator);o--;){if(n&&(t=e[n])!=null)return t.call(e);if(a&&(t=e[a])!=null)return new r(t.call(e));n=`@@asyncIterator`,a=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1),oD(dD(),1);var QO=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var a=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);a&&(r=function(){try{a.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,a=this.e,o=0;function s(){for(;r=n.pop();)try{if(!r.a&&o===1)return o=0,n.push(r),Promise.resolve().then(s);if(r.d){var e=r.d.call(r.v);if(r.a)return o|=2,Promise.resolve(e).then(s,c)}else o|=1}catch(e){return c(e)}if(o===1)return a===t?Promise.resolve():Promise.reject(a);if(a!==t)throw a}function c(n){return a=a===t?n:new e(n,a),s()}return s()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),$O=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(e,t){this.v=e,this.k=t}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),ek=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=$O();function r(e){return new n(e,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),tk=iD({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=$O();function r(e){return function(){return new a(e.apply(this,arguments))}}function a(e){var t,r;function a(t,r){try{var s=e[t](r),c=s.value,l=c instanceof n;Promise.resolve(l?c.v:c).then(function(n){if(l){var r=t===`return`?`return`:`next`;if(!c.k||n.done)return a(r,n);n=e[r](n).value}o(s.done?`return`:`normal`,n)},function(e){a(`throw`,e)})}catch(e){o(`throw`,e)}}function o(e,n){switch(e){case`return`:t.resolve({value:n,done:!0});break;case`throw`:t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?a(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise(function(o,s){var c={key:e,arg:n,resolve:o,reject:s,next:null};r?r=r.next=c:(t=r=c,a(e,n))})},typeof e.return!=`function`&&(this.return=void 0)}a.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},a.prototype.next=function(e){return this._invoke(`next`,e)},a.prototype.throw=function(e){return this._invoke(`throw`,e)},a.prototype.return=function(e){return this._invoke(`return`,e)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});oD(QO(),1),oD(ek(),1),oD(tk(),1),oD(dD(),1);var nk=Object.create,rk=Object.defineProperty,ik=Object.getOwnPropertyDescriptor,ak=Object.getOwnPropertyNames,ok=Object.getPrototypeOf,sk=Object.prototype.hasOwnProperty,ck=(e,t)=>function(){return t||(0,e[ak(e)[0]])((t={exports:{}}).exports,t),t.exports},lk=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var a=ak(t),o=0,s=a.length,c;o<s;o++)c=a[o],!sk.call(e,c)&&c!==n&&rk(e,c,{get:(e=>t[e]).bind(null,c),enumerable:!(r=ik(t,c))||r.enumerable});return e},uk=(e,t,n)=>(n=e==null?{}:nk(ok(e)),lk(t||!e||!e.__esModule?rk(n,`default`,{value:e,enumerable:!0}):n,e)),dk=ck({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),fk=ck({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=dk();function r(e,t){if(e==null)return{};var r,a,o=n(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),pk=ck({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),mk=ck({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=pk().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||`default`);if(n(a)!=`object`)return a;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),hk=ck({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=pk().default,r=mk();function a(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),gk=ck({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=hk();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),_k=ck({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=gk();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]==null?{}:arguments[t];t%2?r(Object(a),!0).forEach(function(t){n(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),vk=uk(fk(),1),yk=uk(_k(),1),bk=[`cursor`,`direction`];function xk(e,t,n){let r=e.flatMap(e=>e.split(`.`));if(!t&&(!n||n===`any`))return r.length?[r]:[];if(n===`infinite`&&vD(t)&&(`direction`in t||`cursor`in t)){let{cursor:e,direction:n}=t;return[r,{input:(0,vk.default)(t,bk),type:`infinite`}]}return[r,(0,yk.default)((0,yk.default)({},t!==void 0&&t!==IT&&{input:t}),n&&n!==`any`&&{type:n})]}function Sk(e){return xk(e,void 0,`any`)}function Ck(e){return LD(({path:t,args:n})=>{let r=[...t],a=r.pop();if(a===`useMutation`)return e[a](r,...n);if(a===`_def`)return{path:r};let[o,...s]=n,c=s[0]??{};return e[a](r,o,c)})}var wk=[`client`,`ssrContext`,`ssrState`,`abortOnUnmount`],Tk=S.createContext?.call(S,null),Ek=e=>{switch(e){case`queryOptions`:case`fetch`:case`ensureData`:case`prefetch`:case`getData`:case`setData`:case`setQueriesData`:return`query`;case`infiniteQueryOptions`:case`fetchInfinite`:case`prefetchInfinite`:case`getInfiniteData`:case`setInfiniteData`:return`infinite`;case`setMutationDefaults`:case`getMutationDefaults`:case`isMutating`:case`cancel`:case`invalidate`:case`refetch`:case`reset`:return`any`}};function Dk(e){return LD(t=>{let n=[...t.path],r=n.pop(),a=[...t.args],o=a.shift(),s=xk(n,o,Ek(r));return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,s,a[0]),queryOptions:()=>e.queryOptions(n,s,...a),fetch:()=>e.fetchQuery(s,...a),fetchInfinite:()=>e.fetchInfiniteQuery(s,a[0]),prefetch:()=>e.prefetchQuery(s,...a),prefetchInfinite:()=>e.prefetchInfiniteQuery(s,a[0]),ensureData:()=>e.ensureQueryData(s,...a),invalidate:()=>e.invalidateQueries(s,...a),reset:()=>e.resetQueries(s,...a),refetch:()=>e.refetchQueries(s,...a),cancel:()=>e.cancelQuery(s,...a),setData:()=>{e.setQueryData(s,a[0],a[1])},setQueriesData:()=>e.setQueriesData(s,a[0],a[1],a[2]),setInfiniteData:()=>{e.setInfiniteQueryData(s,a[0],a[1])},getData:()=>e.getQueryData(s),getInfiniteData:()=>e.getInfiniteQueryData(s),setMutationDefaults:()=>e.setMutationDefaults(Sk(n),o),getMutationDefaults:()=>e.getMutationDefaults(Sk(n)),isMutating:()=>e.isMutating({mutationKey:Sk(n)})}[r]()})}function Ok(e){let t=YO(e.client),n=Dk(e);return RD(r=>{let a=r;return a===`client`?t:wk.includes(a)?e[a]:n[r]})}var kk=uk(_k(),1);function Ak(e){let t=e instanceof GO?e:ZO(e);return LD(e=>{let n=e.path,r=n.join(`.`),[a,o]=e.args;return(0,kk.default)({queryKey:xk(n,a,`query`),queryFn:()=>t.query(r,a,o?.trpc)},o)})}var jk=uk(_k(),1);function Mk(e,t,n){let r=e[0],a=e[1]?.input;return n&&(a=(0,jk.default)((0,jk.default)((0,jk.default)({},a??{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})),[r.join(`.`),a,t?.trpc]}var Nk=uk(ck({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,a,o=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,a=Symbol.iterator);o--;){if(n&&(t=e[n])!=null)return t.call(e);if(a&&(t=e[a])!=null)return new r(t.call(e));n=`@@asyncIterator`,a=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1);function Pk(e){return{path:e.path.join(`.`)}}function Fk(e){let t=Pk(e);return S.useMemo(()=>t,[t])}async function Ik(e,t,n){let r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:`success`});let a=[];var o=!1,s=!1,c;try{for(var l=(0,Nk.default)(e),u;o=!(u=await l.next()).done;o=!1){let e=u.value;a.push(e),r.setState({data:[...a]})}}catch(e){s=!0,c=e}finally{try{o&&l.return!=null&&await l.return()}finally{if(s)throw c}}return a}var Lk=uk(_k(),1);function Rk(e){let{client:t,queryClient:n}=e,r=t instanceof GO?t:ZO(t);return{infiniteQueryOptions:(e,t,n)=>{let a=t[1]?.input===IT;return Object.assign(YE((0,Lk.default)((0,Lk.default)({},n),{},{initialData:n?.initialData,queryKey:t,queryFn:a?IT:async e=>{var a;let o=(0,Lk.default)((0,Lk.default)({},n),{},{trpc:(0,Lk.default)((0,Lk.default)({},n?.trpc),!(n==null||(a=n.trpc)==null)&&a.abortOnUnmount?{signal:e.signal}:{signal:null})});return await r.query(...Mk(t,o,{direction:e.direction,pageParam:e.pageParam}))},initialPageParam:n?.initialCursor??null})),{trpc:Pk({path:e})})},queryOptions:(e,t,a)=>{let o=t[1]?.input===IT;return Object.assign(JE((0,Lk.default)((0,Lk.default)({},a),{},{initialData:a?.initialData,queryKey:t,queryFn:o?IT:async e=>{var o;let s=(0,Lk.default)((0,Lk.default)({},a),{},{trpc:(0,Lk.default)((0,Lk.default)({},a?.trpc),!(a==null||(o=a.trpc)==null)&&o.abortOnUnmount?{signal:e.signal}:{signal:null})}),c=await r.query(...Mk(t,s));return xD(c)?Ik(c,n,t):c}})),{trpc:Pk({path:e})})},fetchQuery:(e,t)=>n.fetchQuery((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...Mk(e,t))})),fetchInfiniteQuery:(e,t)=>n.fetchInfiniteQuery((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e,queryFn:({pageParam:n,direction:a})=>r.query(...Mk(e,t,{pageParam:n,direction:a})),initialPageParam:t?.initialCursor??null})),prefetchQuery:(e,t)=>n.prefetchQuery((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...Mk(e,t))})),prefetchInfiniteQuery:(e,t)=>n.prefetchInfiniteQuery((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e,queryFn:({pageParam:n,direction:a})=>r.query(...Mk(e,t,{pageParam:n,direction:a})),initialPageParam:t?.initialCursor??null})),ensureQueryData:(e,t)=>n.ensureQueryData((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...Mk(e,t))})),invalidateQueries:(e,t,r)=>n.invalidateQueries((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e}),r),resetQueries:(e,t,r)=>n.resetQueries((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e}),r),refetchQueries:(e,t,r)=>n.refetchQueries((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e}),r),cancelQuery:(e,t)=>n.cancelQueries({queryKey:e},t),setQueryData:(e,t,r)=>n.setQueryData(e,t,r),setQueriesData:(e,t,r,a)=>n.setQueriesData((0,Lk.default)((0,Lk.default)({},t),{},{queryKey:e}),r,a),getQueryData:e=>n.getQueryData(e),setInfiniteQueryData:(e,t,r)=>n.setQueryData(e,t,r),getInfiniteQueryData:e=>n.getQueryData(e),setMutationDefaults:(t,a)=>{let o=t[0];return n.setMutationDefaults(t,typeof a==`function`?a({canonicalMutationFn:t=>r.mutation(...Mk([o,{input:t}],e))}):a)},getMutationDefaults:e=>n.getMutationDefaults(e),isMutating:e=>n.isMutating((0,Lk.default)((0,Lk.default)({},e),{},{exact:!0}))}}var J=uk(_k()),zk=(e,t)=>new Proxy(e,{get(e,n){return t(n),e[n]}});function Bk(e){var t;let n=(e==null||(t=e.overrides)==null||(t=t.useMutation)==null?void 0:t.onSuccess)??(e=>e.originalFn()),r=e?.context??Tk,a=XO,o=e=>{let{abortOnUnmount:t=!1,queryClient:n,ssrContext:a}=e,[o,s]=S.useState(e.ssrState??!1),c=e.client instanceof GO?e.client:ZO(e.client),l=S.useMemo(()=>Rk({client:c,queryClient:n}),[c,n]),u=S.useMemo(()=>(0,J.default)({abortOnUnmount:t,queryClient:n,client:c,ssrContext:a??null,ssrState:o},l),[t,c,l,n,a,o]);return S.useEffect(()=>{s(e=>e?`mounted`:!1)},[]),(0,C.jsx)(r.Provider,{value:u,children:e.children})};function s(){let e=S.useContext(r);if(!e)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return e}function c(e,t){let{queryClient:n,ssrState:r}=s();return r&&r!==`mounted`&&n.getQueryCache().find({queryKey:e})?.state.status===`error`?(0,J.default)({retryOnMount:!1},t):t}function l(t,n,r){var a,o;let{abortOnUnmount:l,client:u,ssrState:d,queryClient:f,prefetchQuery:p}=s(),m=xk(t,n,`query`),h=f.getQueryDefaults(m),g=n===IT;typeof window>`u`&&d===`prepass`&&(r==null||(a=r.trpc)==null?void 0:a.ssr)!==!1&&(r?.enabled??h?.enabled)!==!1&&!g&&!f.getQueryCache().find({queryKey:m})&&p(m,r);let _=c(m,(0,J.default)((0,J.default)({},h),r)),v=(r==null||(o=r.trpc)==null?void 0:o.abortOnUnmount)??e?.abortOnUnmount??l,y=HE((0,J.default)((0,J.default)({},_),{},{queryKey:m,queryFn:g?n:async e=>{let t=(0,J.default)((0,J.default)({},_),{},{trpc:(0,J.default)((0,J.default)({},_?.trpc),v?{signal:e.signal}:{signal:null})}),n=await u.query(...Mk(m,t));return xD(n)?Ik(n,f,m):n}}),f);return y.trpc=Fk({path:t}),y}function u(t,n,r){var a;let o=s(),c=xk(t,n,`query`),l=n===IT,u=(r==null||(a=r.trpc)==null?void 0:a.abortOnUnmount)??e?.abortOnUnmount??o.abortOnUnmount;KE((0,J.default)((0,J.default)({},r),{},{queryKey:c,queryFn:l?n:e=>{let t={trpc:(0,J.default)((0,J.default)({},r?.trpc),u?{signal:e.signal}:{})};return o.client.query(...Mk(c,t))}}))}function d(t,n,r){var a;let o=s(),c=xk(t,n,`query`),l=(r==null||(a=r.trpc)==null?void 0:a.abortOnUnmount)??e?.abortOnUnmount??o.abortOnUnmount,u=UE((0,J.default)((0,J.default)({},r),{},{queryKey:c,queryFn:e=>{let t=(0,J.default)((0,J.default)({},r),{},{trpc:(0,J.default)((0,J.default)({},r?.trpc),l?{signal:e.signal}:{signal:null})});return o.client.query(...Mk(c,t))}}),o.queryClient);return u.trpc=Fk({path:t}),[u.data,u]}function f(e,t){let{client:r,queryClient:a}=s(),o=Sk(e),c=a.defaultMutationOptions(a.getMutationDefaults(o)),l=XE((0,J.default)((0,J.default)({},t),{},{mutationKey:o,mutationFn:n=>r.mutation(...Mk([e,{input:n}],t)),onSuccess(...e){return n({originalFn:()=>{var n,r;return(t==null||(n=t.onSuccess)==null?void 0:n.call(t,...e))??(c==null||(r=c.onSuccess)==null?void 0:r.call(c,...e))},queryClient:a,meta:t?.meta??c?.meta??{}})}}),a);return l.trpc=Fk({path:e}),l}let p={data:void 0,error:null,status:`idle`},m={data:void 0,error:null,status:`connecting`};function h(e,t,n){let r=n?.enabled??t!==IT,a=wT(xk(e,t,`any`)),{client:o}=s(),c=S.useRef(n);S.useEffect(()=>{c.current=n});let[l]=S.useState(new Set([])),u=S.useCallback(e=>{l.add(e)},[l]),d=S.useRef(null),f=S.useCallback(e=>{let t=g.current,n=g.current=e(t),r=!1;for(let e of l)if(t[e]!==n[e]){r=!0;break}r&&v(zk(n,u))},[u,l]),h=S.useCallback(()=>{var n;if((n=d.current)==null||n.unsubscribe(),!r){f(()=>(0,J.default)((0,J.default)({},p),{},{reset:h}));return}f(()=>(0,J.default)((0,J.default)({},m),{},{reset:h})),d.current=o.subscription(e.join(`.`),t??void 0,{onStarted:()=>{var e,t;(e=(t=c.current).onStarted)==null||e.call(t),f(e=>(0,J.default)((0,J.default)({},e),{},{status:`pending`,error:null}))},onData:e=>{var t,n;(t=(n=c.current).onData)==null||t.call(n,e),f(t=>(0,J.default)((0,J.default)({},t),{},{status:`pending`,data:e,error:null}))},onError:e=>{var t,n;(t=(n=c.current).onError)==null||t.call(n,e),f(t=>(0,J.default)((0,J.default)({},t),{},{status:`error`,error:e}))},onConnectionStateChange:e=>{f(t=>{switch(e.state){case`idle`:return(0,J.default)((0,J.default)({},t),{},{status:e.state,error:null,data:void 0});case`connecting`:return(0,J.default)((0,J.default)({},t),{},{error:e.error,status:e.state});case`pending`:return t}})},onComplete:()=>{var e,t;(e=(t=c.current).onComplete)==null||e.call(t),f(e=>(0,J.default)((0,J.default)({},e),{},{status:`idle`,error:null,data:void 0}))}})},[o,a,r,f]);S.useEffect(()=>(h(),()=>{var e;(e=d.current)==null||e.unsubscribe()}),[h]);let g=S.useRef(r?(0,J.default)((0,J.default)({},m),{},{reset:h}):(0,J.default)((0,J.default)({},p),{},{reset:h})),[_,v]=S.useState(zk(g.current,u));return _}function g(e,t,n){var r,a;let{client:o,ssrState:l,prefetchInfiniteQuery:u,queryClient:d,abortOnUnmount:f}=s(),p=xk(e,t,`infinite`),m=d.getQueryDefaults(p),h=t===IT;typeof window>`u`&&l===`prepass`&&(n==null||(r=n.trpc)==null?void 0:r.ssr)!==!1&&(n?.enabled??m?.enabled)!==!1&&!h&&!d.getQueryCache().find({queryKey:p})&&u(p,(0,J.default)((0,J.default)({},m),n));let g=c(p,(0,J.default)((0,J.default)({},m),n)),_=(n==null||(a=n.trpc)==null?void 0:a.abortOnUnmount)??f,v=ZE((0,J.default)((0,J.default)({},g),{},{initialPageParam:n.initialCursor??null,persister:n.persister,queryKey:p,queryFn:h?t:e=>{let t=(0,J.default)((0,J.default)({},g),{},{trpc:(0,J.default)((0,J.default)({},g?.trpc),_?{signal:e.signal}:{signal:null})});return o.query(...Mk(p,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}),d);return v.trpc=Fk({path:e}),v}function _(e,t,n){var r;let a=s(),o=xk(e,t,`infinite`),l=a.queryClient.getQueryDefaults(o),u=t===IT,d=c(o,(0,J.default)((0,J.default)({},l),n)),f=(n==null||(r=n.trpc)==null?void 0:r.abortOnUnmount)??a.abortOnUnmount;qE((0,J.default)((0,J.default)({},n),{},{initialPageParam:n.initialCursor??null,queryKey:o,queryFn:u?t:e=>{let t=(0,J.default)((0,J.default)({},d),{},{trpc:(0,J.default)((0,J.default)({},d?.trpc),f?{signal:e.signal}:{})});return a.client.query(...Mk(o,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}))}function v(e,t,n){var r;let a=s(),o=xk(e,t,`infinite`),l=a.queryClient.getQueryDefaults(o),u=c(o,(0,J.default)((0,J.default)({},l),n)),d=(n==null||(r=n.trpc)==null?void 0:r.abortOnUnmount)??a.abortOnUnmount,f=WE((0,J.default)((0,J.default)({},n),{},{initialPageParam:n.initialCursor??null,queryKey:o,queryFn:e=>{let t=(0,J.default)((0,J.default)({},u),{},{trpc:(0,J.default)((0,J.default)({},u?.trpc),d?{signal:e.signal}:{})});return a.client.query(...Mk(o,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}),a.queryClient);return f.trpc=Fk({path:e}),[f.data,f]}return{Provider:o,createClient:a,useContext:s,useUtils:s,useQuery:l,usePrefetchQuery:u,useSuspenseQuery:d,useQueries:(e,t)=>{let{ssrState:n,queryClient:r,prefetchQuery:a,client:o}=s(),c=e(Ak(o));if(typeof window>`u`&&n===`prepass`)for(let e of c){let t=e;t.trpc?.ssr!==!1&&!r.getQueryCache().find({queryKey:t.queryKey})&&a(t.queryKey,t)}return BE({queries:c.map(e=>(0,J.default)((0,J.default)({},e),{},{queryKey:e.queryKey})),combine:t?.combine},r)},useSuspenseQueries:e=>{let{queryClient:t,client:n}=s(),r=GE({queries:e(Ak(n)).map(e=>(0,J.default)((0,J.default)({},e),{},{queryFn:e.queryFn,queryKey:e.queryKey}))},t);return[r.map(e=>e.data),r]},useMutation:f,useSubscription:h,useInfiniteQuery:g,usePrefetchInfiniteQuery:_,useSuspenseInfiniteQuery:v}}function Vk(e){let t=Ck(e);return RD(n=>n===`useContext`||n===`useUtils`?()=>{let t=e.useUtils();return S.useMemo(()=>Ok(t),[t])}:e.hasOwnProperty(n)?e[n]:t[n])}function Hk(e){return Vk(Bk(e))}var Uk=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()}},Wk=class{constructor(e){this.generateIdentifier=e,this.kv=new Uk}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)}},Gk=class extends Wk{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 Kk(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 qk(e,t){let n=Kk(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 Jk(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function Yk(e,t){return e.indexOf(t)!==-1}function Xk(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var Zk=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return qk(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},Qk=e=>Object.prototype.toString.call(e).slice(8,-1),$k=e=>e===void 0,eA=e=>e===null,tA=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,nA=e=>tA(e)&&Object.keys(e).length===0,rA=e=>Array.isArray(e),iA=e=>typeof e==`string`,aA=e=>typeof e==`number`&&!isNaN(e),oA=e=>typeof e==`boolean`,sA=e=>e instanceof RegExp,cA=e=>e instanceof Map,lA=e=>e instanceof Set,uA=e=>Qk(e)===`Symbol`,dA=e=>e instanceof Date&&!isNaN(e.valueOf()),fA=e=>e instanceof Error,pA=e=>typeof e==`number`&&isNaN(e),mA=e=>oA(e)||eA(e)||$k(e)||aA(e)||iA(e)||uA(e),hA=e=>typeof e==`bigint`,gA=e=>e===1/0||e===-1/0,_A=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),vA=e=>e instanceof URL,yA=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),bA=e=>e.map(String).map(yA).join(`.`),xA=(e,t)=>{let n=[],r=``;for(let a=0;a<e.length;a++){let o=e.charAt(a);if(!t&&o===`\\`){let t=e.charAt(a+1);if(t===`\\`){r+=`\\`,a++;continue}else if(t!==`.`)throw Error(`invalid path`)}if(o===`\\`&&e.charAt(a+1)===`.`){r+=`.`,a++;continue}if(o===`.`){n.push(r),r=``;continue}r+=o}let a=r;return n.push(a),n};function SA(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var CA=[SA($k,`undefined`,()=>null,()=>void 0),SA(hA,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),SA(dA,`Date`,e=>e.toISOString(),e=>new Date(e)),SA(fA,`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}),SA(sA,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),SA(lA,`set`,e=>[...e.values()],e=>new Set(e)),SA(cA,`map`,e=>[...e.entries()],e=>new Map(e)),SA(e=>pA(e)||gA(e),`number`,e=>pA(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),SA(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),SA(vA,`URL`,e=>e.toString(),e=>new URL(e))];function wA(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var TA=wA((e,t)=>uA(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}),EA=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),DA=wA(_A,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=EA[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function OA(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var kA=wA(OA,(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)}),AA=wA((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)}),jA=[kA,TA,AA,DA],MA=(e,t)=>{let n=Xk(jA,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=Xk(CA,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},NA={};CA.forEach(e=>{NA[e.annotation]=e});var PA=(e,t,n)=>{if(rA(t))switch(t[0]){case`symbol`:return TA.untransform(e,t,n);case`class`:return kA.untransform(e,t,n);case`custom`:return AA.untransform(e,t,n);case`typed-array`:return DA.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=NA[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},FA=(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 IA(e){if(Yk(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(Yk(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(Yk(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var LA=(e,t)=>{IA(t);for(let n=0;n<t.length;n++){let r=t[n];if(lA(e))e=FA(e,+r);else if(cA(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=FA(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},RA=(e,t,n)=>{if(IA(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(rA(r)){let e=+n;r=r[e]}else if(tA(r))r=r[n];else if(lA(r)){let e=+n;r=FA(r,e)}else if(cA(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=FA(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if(rA(r)?r[+a]=n(r[+a]):tA(r)&&(r[a]=n(r[a])),lA(r)){let e=FA(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(cA(r)){let e=+t[t.length-2],o=FA(r,e);switch(+a==0?`key`:`value`){case`key`:{let e=n(o);r.set(e,r.get(o)),e!==o&&r.delete(o);break}case`value`:r.set(o,n(r.get(o)));break}}return e},zA=e=>e<1;function BA(e,t,n,r=[]){if(!e)return;let a=zA(n);if(!rA(e)){Jk(e,(e,o)=>BA(e,t,n,[...r,...xA(o,a)]));return}let[o,s]=e;s&&Jk(s,(e,o)=>{BA(e,t,n,[...r,...xA(o,a)])}),t(o,r)}function VA(e,t,n,r){return BA(t,(t,n)=>{e=RA(e,n,e=>PA(e,t,r))},n),e}function HA(e,t,n){let r=zA(n);function a(t,n){let a=LA(e,xA(n,r));t.map(e=>xA(e,r)).forEach(t=>{e=RA(e,t,()=>a)})}if(rA(t)){let[n,o]=t;n.forEach(t=>{e=RA(e,xA(t,r),()=>e)}),o&&Jk(o,a)}else Jk(t,a);return e}var UA=(e,t)=>tA(e)||rA(e)||cA(e)||lA(e)||fA(e)||OA(e,t);function WA(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function GA(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[a,...o]=e;a.length===0?r=o.map(bA):n[bA(a)]=o.map(bA)}),r?nA(n)?[r]:[r,n]:nA(n)?void 0:n}var KA=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=mA(e);if(!c){WA(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!UA(e,n)){let t=MA(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(Yk(o,e))return{transformedValue:null};let l=MA(e,n),u=l?.value??e,d=rA(u)?[]:{},f={};Jk(u,(c,l)=>{if(l===`__proto__`||l===`constructor`||l===`prototype`)throw Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);let u=KA(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,rA(u.annotations)?f[yA(l)]=u.annotations:tA(u.annotations)&&Jk(u.annotations,(e,t)=>{f[yA(l)+`.`+t]=e})});let p=nA(f)?{transformedValue:d,annotations:l?[l.type]:void 0}:{transformedValue:d,annotations:l?[l.type,f]:f};return c||s.set(e,p),p};function qA(e){return Object.prototype.toString.call(e).slice(8,-1)}function JA(e){return qA(e)===`Array`}function YA(e){if(qA(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function XA(e,t,n,r,a){let o={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;o===`enumerable`&&(e[t]=n),a&&o===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function ZA(e,t={}){if(JA(e))return e.map(e=>ZA(e,t));if(!YA(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||JA(t.props)&&!t.props.includes(r))return n;let a=e[r];return XA(n,r,ZA(a,t),e,t.nonenumerable),n},{})}var QA=class{constructor({dedupe:e=!1}={}){this.classRegistry=new Gk,this.symbolRegistry=new Wk(e=>e.description??``),this.customTransformerRegistry=new Zk,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=KA(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=GA(t,this.dedupe);return a&&(r.meta={...r.meta,referentialEqualities:a}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,a=t?.inPlace?n:ZA(n);return r?.values&&(a=VA(a,r.values,r.v??0,this)),r?.referentialEqualities&&(a=HA(a,r.referentialEqualities,r.v??0)),a}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)}};QA.defaultInstance=new QA,QA.serialize=QA.defaultInstance.serialize.bind(QA.defaultInstance),QA.deserialize=QA.defaultInstance.deserialize.bind(QA.defaultInstance),QA.stringify=QA.defaultInstance.stringify.bind(QA.defaultInstance),QA.parse=QA.defaultInstance.parse.bind(QA.defaultInstance),QA.registerClass=QA.defaultInstance.registerClass.bind(QA.defaultInstance),QA.registerSymbol=QA.defaultInstance.registerSymbol.bind(QA.defaultInstance),QA.registerCustom=QA.defaultInstance.registerCustom.bind(QA.defaultInstance),QA.allowErrorProps=QA.defaultInstance.allowErrorProps.bind(QA.defaultInstance),QA.serialize,QA.deserialize,QA.stringify,QA.parse,QA.registerClass,QA.registerCustom,QA.registerSymbol,QA.allowErrorProps;var $A=1e4,ej=6e3,tj=2e3,nj=3e4,rj=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 t=typeof window<`u`;this.useWs=e.useWebSocket??t,this.onConnectionChange=e.onConnectionChange,this.baseRetryMs=e.retryDelayMs??tj,this.maxRetryMs=e.maxRetryDelayMs??nj,this._trpcClient=this.buildTrpcClient(),this._systemProxy=Rh(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 a=setTimeout(()=>r(Error(`System.awaitConnected: probe timed out after ${t}ms`)),t);e.then(()=>{clearTimeout(a),n()},e=>{clearTimeout(a),r(e instanceof Error?e:Error(String(e)))})}):await e,this.connected=!0})();try{await this.connectedPromise}finally{this.connectedPromise=null}}async init(e){if(this.mirror?.isReady())return;if(this.mirrorInit)return this.mirrorInit;let t=new Wh(this._trpcClient);return this.mirror=t,this.mirrorInit=(async()=>{await this.awaitConnected(e),await t.init(e)})().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=Rh(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,a=n?.protocol===`https:`?`https`:`http`,o=this._trpcClient.localNetwork?.getConnectionEndpoints;if(!o)return{winner:this._serverUrl,switched:!1};let s;try{s=(await o.query({port:r,ipv4Only:e?.ipv4Only,scheme:a})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(s.length===0)return{winner:this._serverUrl,switched:!1};let c=await aj(s.map(e=>e.baseUrl),t);return!c||c===this._serverUrl?{winner:c??this._serverUrl,switched:!1}:(this.switchServerUrl(c),{winner:c,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,n=this.maxRetryMs;return this._wsClient=VO({url:e,connectionParams:()=>({token:this.token}),retryDelayMs:e=>Math.min(t*2**e,n),keepAlive:{enabled:!0,intervalMs:$A,pongTimeoutMs:ej},onOpen:()=>{this._connectionVersion+=1,this.emitConnectionEvent(`connected`)},onClose:()=>{this.emitConnectionEvent(`disconnected`)}}),XO({links:[HO({client:this._wsClient,transformer:QA})]})}return this._wsClient=null,XO({links:[yO({url:`${this._serverUrl}/trpc`,headers:e,transformer:QA})]})}};function ij(e){return new rj(e)}async function aj(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),a=n.map(async(e,n)=>{let a=r[n],o=setTimeout(()=>a.abort(),t);try{let t=await fetch(`${e.replace(/\/+$/,``)}/trpc/health`,{method:`GET`,signal:a.signal,credentials:`omit`});if(!t.ok)throw Error(`${t.status}`);return e}finally{clearTimeout(o)}});try{let e=await Promise.any(a);for(let e of r)try{e.abort()}catch{}return e}catch{return null}}var oj=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}({}),sj=`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(`.`),cj=[`person`,`people`,`pedestrian`,`rider`,`driver`,`cyclist`,`skier`,`skateboarder`,`face`,`hand`,`head`,`body`],lj=[`vehicle`,`car`,`truck`,`bus`,`motorcycle`,`bicycle`,`van`,`ambulance`,`police_car`,`fire_truck`,`train`,`subway`,`tram`,`airplane`,`boat`,`ship`,`helicopter`],uj=`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(`.`),dj=[`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`],fj=[`motion`,`movement`,`other`],pj=[`package`,`packet`],mj=[`audio`],hj=`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(`.`),gj=[`doorbell`,`ring`],_j=[`lock`,`binary`,`flood`,`entry`,`door`,`leak`,`door_open`,`flooded`,`entry_open`];({...sj.reduce((e,t)=>({...e,[t]:`animal`}),{}),...cj.reduce((e,t)=>({...e,[t]:`person`}),{}),...lj.reduce((e,t)=>({...e,[t]:`vehicle`}),{}),...fj.reduce((e,t)=>({...e,[t]:`motion`}),{}),...pj.reduce((e,t)=>({...e,[t]:`package`}),{}),...uj.reduce((e,t)=>({...e,[t]:`face`}),{}),...dj.reduce((e,t)=>({...e,[t]:`plate`}),{}),...mj.reduce((e,t)=>({...e,[t]:`audio`}),{}),...hj.reduce((e,t)=>({...e,[t]:`audio`}),{}),...gj.reduce((e,t)=>({...e,[t]:`doorbell`}),{}),..._j.reduce((e,t)=>({...e,[t]:`sensor`}),{})}),[...Object.values(oj).filter(e=>e!==`motion`)],new Set([`Entry`,`Light`,`Switch`,`Lock`,`SecuritySystem`,`Buttons`,`WindowCovering`,`Siren`,`Sensor`,`Select`,`Program`]),new Set([`light`,`switch`,`input_boolean`,`cover`,`lock`,`alarm_control_panel`,`input_button`,`button`,`input_select`,`select`,`siren`,`media_player`,`script`]);function vj(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=vj(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function yj(){for(var e,t,n=0,r=``,a=arguments.length;n<a;n++)(e=arguments[n])&&(t=vj(e))&&(r&&(r+=` `),r+=t);return r}var bj=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},xj=(e,t)=>({classGroupId:e,validator:t}),Sj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Cj=`-`,wj=[],Tj=`arbitrary..`,Ej=e=>{let t=kj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Oj(e);let n=e.split(Cj);return Dj(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];return t?a?bj(a,t):t:a||wj}return n[e]||wj}}},Dj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let n=Dj(e,t+1,a);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(Cj):e.slice(t).join(Cj),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},Oj=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Tj+r:void 0})(),kj=e=>{let{theme:t,classGroups:n}=e;return Aj(n,t)},Aj=(e,t)=>{let n=Sj();for(let r in e){let a=e[r];jj(a,n,r,t)}return n},jj=(e,t,n,r)=>{let a=e.length;for(let o=0;o<a;o++){let a=e[o];Mj(a,t,n,r)}},Mj=(e,t,n,r)=>{if(typeof e==`string`){Nj(e,t,n);return}if(typeof e==`function`){Pj(e,t,n,r);return}Fj(e,t,n,r)},Nj=(e,t,n)=>{let r=e===``?t:Ij(t,e);r.classGroupId=n},Pj=(e,t,n,r)=>{if(Lj(e)){jj(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(xj(n,e))},Fj=(e,t,n,r)=>{let a=Object.entries(e),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];jj(s,Ij(t,o),n,r)}},Ij=(e,t)=>{let n=e,r=t.split(Cj),a=r.length;for(let e=0;e<a;e++){let t=r[e],a=n.nextPart.get(t);a||(a=Sj(),n.nextPart.set(t,a)),n=a}return n},Lj=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Rj=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),a=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return a(e,t),t},set(e,t){e in n?n[e]=t:a(e,t)}}},zj=`!`,Bj=`:`,Vj=[],Hj=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),Uj=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,a=0,o,s=e.length;for(let c=0;c<s;c++){let s=e[c];if(n===0&&r===0){if(s===Bj){t.push(e.slice(a,c)),a=c+1;continue}if(s===`/`){o=c;continue}}s===`[`?n++:s===`]`?n--:s===`(`?r++:s===`)`&&r--}let c=t.length===0?e:e.slice(a),l=c,u=!1;c.endsWith(zj)?(l=c.slice(0,-1),u=!0):c.startsWith(zj)&&(l=c.slice(1),u=!0);let d=o&&o>a?o-a:void 0;return Hj(t,u,l,d)};if(t){let e=t+Bj,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Hj(Vj,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Wj=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let a=0;a<e.length;a++){let o=e[a],s=o[0]===`[`,c=t.has(o);s||c?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},Gj=e=>({cache:Rj(e.cacheSize),parseClassName:Uj(e),sortModifiers:Wj(e),postfixLookupClassGroupIds:Kj(e),...Ej(e)}),Kj=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},qj=/\s+/,Jj=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:s}=t,c=[],l=e.trim().split(qj),u=``;for(let e=l.length-1;e>=0;--e){let t=l[e],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}=n(t);if(d){u=t+(u.length>0?` `+u:u);continue}let g=!!h,_;if(g){_=r(m.substring(0,h));let e=_&&s[_]?r(m):void 0;e&&e!==_&&(_=e,g=!1)}else _=r(m);if(!_){if(!g){u=t+(u.length>0?` `+u:u);continue}if(_=r(m),!_){u=t+(u.length>0?` `+u:u);continue}g=!1}let v=f.length===0?``:f.length===1?f[0]:o(f).join(`:`),y=p?v+zj:v,b=y+_;if(c.indexOf(b)>-1)continue;c.push(b);let x=a(_,g);for(let e=0;e<x.length;++e){let t=x[e];c.push(y+t)}u=t+(u.length>0?` `+u:u)}return u},Yj=(...e)=>{let t=0,n,r,a=``;for(;t<e.length;)(n=e[t++])&&(r=Xj(n))&&(a&&(a+=` `),a+=r);return a},Xj=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Xj(e[r]))&&(n&&(n+=` `),n+=t);return n},Zj=(e,...t)=>{let n,r,a,o,s=s=>(n=Gj(t.reduce((e,t)=>t(e),e())),r=n.cache.get,a=n.cache.set,o=c,c(s)),c=e=>{let t=r(e);if(t)return t;let o=Jj(e,n);return a(e,o),o};return o=s,(...e)=>o(Yj(...e))},Qj=[],$j=e=>{let t=t=>t[e]||Qj;return t.isThemeGetter=!0,t},eM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cM=e=>nM.test(e),lM=e=>!!e&&!Number.isNaN(Number(e)),uM=e=>!!e&&Number.isInteger(Number(e)),dM=e=>e.endsWith(`%`)&&lM(e.slice(0,-1)),fM=e=>rM.test(e),pM=()=>!0,mM=e=>iM.test(e)&&!aM.test(e),hM=()=>!1,gM=e=>oM.test(e),_M=e=>sM.test(e),vM=e=>!Y(e)&&!X(e),yM=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),bM=e=>FM(e,zM,hM),Y=e=>eM.test(e),xM=e=>FM(e,BM,mM),SM=e=>FM(e,VM,lM),CM=e=>FM(e,UM,pM),wM=e=>FM(e,HM,hM),TM=e=>FM(e,LM,hM),EM=e=>FM(e,RM,_M),DM=e=>FM(e,WM,gM),X=e=>tM.test(e),OM=e=>IM(e,BM),kM=e=>IM(e,HM),AM=e=>IM(e,LM),jM=e=>IM(e,zM),MM=e=>IM(e,RM),NM=e=>IM(e,WM,!0),PM=e=>IM(e,UM,!0),FM=(e,t,n)=>{let r=eM.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},IM=(e,t,n=!1)=>{let r=tM.exec(e);return r?r[1]?t(r[1]):n:!1},LM=e=>e===`position`||e===`percentage`,RM=e=>e===`image`||e===`url`,zM=e=>e===`length`||e===`size`||e===`bg-size`,BM=e=>e===`length`,VM=e=>e===`number`,HM=e=>e===`family-name`,UM=e=>e===`number`||e===`weight`,WM=e=>e===`shadow`,GM=Zj(()=>{let e=$j(`color`),t=$j(`font`),n=$j(`text`),r=$j(`font-weight`),a=$j(`tracking`),o=$j(`leading`),s=$j(`breakpoint`),c=$j(`container`),l=$j(`spacing`),u=$j(`radius`),d=$j(`shadow`),f=$j(`inset-shadow`),p=$j(`text-shadow`),m=$j(`drop-shadow`),h=$j(`blur`),g=$j(`perspective`),_=$j(`aspect`),v=$j(`ease`),y=$j(`animate`),b=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],x=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],S=()=>[...x(),X,Y],C=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],w=()=>[`auto`,`contain`,`none`],T=()=>[X,Y,l],E=()=>[cM,`full`,`auto`,...T()],D=()=>[uM,`none`,`subgrid`,X,Y],ee=()=>[`auto`,{span:[`full`,uM,X,Y]},uM,X,Y],te=()=>[uM,`auto`,X,Y],O=()=>[`auto`,`min`,`max`,`fr`,X,Y],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],re=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ie=()=>[`auto`,...T()],ae=()=>[cM,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...T()],oe=()=>[cM,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...T()],se=()=>[cM,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...T()],k=()=>[e,X,Y],A=()=>[...x(),AM,TM,{position:[X,Y]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,jM,bM,{size:[X,Y]}],ue=()=>[dM,OM,xM],de=()=>[``,`none`,`full`,u,X,Y],j=()=>[``,lM,OM,xM],M=()=>[`solid`,`dashed`,`dotted`,`double`],fe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],pe=()=>[lM,dM,AM,TM],me=()=>[``,`none`,h,X,Y],he=()=>[`none`,lM,X,Y],ge=()=>[`none`,lM,X,Y],_e=()=>[lM,X,Y],N=()=>[cM,`full`,...T()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[fM],breakpoint:[fM],color:[pM],container:[fM],"drop-shadow":[fM],ease:[`in`,`out`,`in-out`],font:[vM],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[fM],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[fM],shadow:[fM],spacing:[`px`,lM],text:[fM],"text-shadow":[fM],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,cM,Y,X,_]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,Y]}],"container-named":[yM],columns:[{columns:[lM,Y,X,c]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:S()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{"inset-s":E(),start:E()}],end:[{"inset-e":E(),end:E()}],"inset-bs":[{"inset-bs":E()}],"inset-be":[{"inset-be":E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[uM,`auto`,X,Y]}],basis:[{basis:[cM,`full`,`auto`,c,...T()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[lM,cM,`auto`,`initial`,`none`,Y]}],grow:[{grow:[``,lM,X,Y]}],shrink:[{shrink:[``,lM,X,Y]}],order:[{order:[uM,`first`,`last`,`none`,X,Y]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...re(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...re()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...re(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...re(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...re(),`baseline`]}],"place-self":[{"place-self":[`auto`,...re()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mbs:[{mbs:ie()}],mbe:[{mbe:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":T()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":T()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ae()}],"inline-size":[{inline:[`auto`,...oe()]}],"min-inline-size":[{"min-inline":[`auto`,...oe()]}],"max-inline-size":[{"max-inline":[`none`,...oe()]}],"block-size":[{block:[`auto`,...se()]}],"min-block-size":[{"min-block":[`auto`,...se()]}],"max-block-size":[{"max-block":[`none`,...se()]}],w:[{w:[c,`screen`,...ae()]}],"min-w":[{"min-w":[c,`screen`,`none`,...ae()]}],"max-w":[{"max-w":[c,`screen`,`none`,`prose`,{screen:[s]},...ae()]}],h:[{h:[`screen`,`lh`,...ae()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ae()]}],"max-h":[{"max-h":[`screen`,`lh`,...ae()]}],"font-size":[{text:[`base`,n,OM,xM]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,PM,CM]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,dM,Y]}],"font-family":[{font:[kM,wM,t]}],"font-features":[{"font-features":[Y]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[a,X,Y]}],"line-clamp":[{"line-clamp":[lM,`none`,X,SM]}],leading:[{leading:[o,...T()]}],"list-image":[{"list-image":[`none`,X,Y]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,Y]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[lM,`from-font`,`auto`,X,xM]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[lM,`auto`,X,Y]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:T()}],"tab-size":[{tab:[uM,X,Y]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,Y]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,Y]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},uM,X,Y],radial:[``,X,Y],conic:[uM,X,Y]},MM,EM]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:j()}],"border-w-x":[{"border-x":j()}],"border-w-y":[{"border-y":j()}],"border-w-s":[{"border-s":j()}],"border-w-e":[{"border-e":j()}],"border-w-bs":[{"border-bs":j()}],"border-w-be":[{"border-be":j()}],"border-w-t":[{"border-t":j()}],"border-w-r":[{"border-r":j()}],"border-w-b":[{"border-b":j()}],"border-w-l":[{"border-l":j()}],"divide-x":[{"divide-x":j()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":j()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...M(),`hidden`,`none`]}],"divide-style":[{divide:[...M(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...M(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[lM,X,Y]}],"outline-w":[{outline:[``,lM,OM,xM]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`none`,d,NM,DM]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,f,NM,DM]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:j()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[lM,xM]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":j()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,p,NM,DM]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[lM,X,Y]}],"mix-blend":[{"mix-blend":[...fe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[lM]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[X,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[lM]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,Y]}],filter:[{filter:[``,`none`,X,Y]}],blur:[{blur:me()}],brightness:[{brightness:[lM,X,Y]}],contrast:[{contrast:[lM,X,Y]}],"drop-shadow":[{"drop-shadow":[``,`none`,m,NM,DM]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,lM,X,Y]}],"hue-rotate":[{"hue-rotate":[lM,X,Y]}],invert:[{invert:[``,lM,X,Y]}],saturate:[{saturate:[lM,X,Y]}],sepia:[{sepia:[``,lM,X,Y]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,Y]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[lM,X,Y]}],"backdrop-contrast":[{"backdrop-contrast":[lM,X,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,lM,X,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lM,X,Y]}],"backdrop-invert":[{"backdrop-invert":[``,lM,X,Y]}],"backdrop-opacity":[{"backdrop-opacity":[lM,X,Y]}],"backdrop-saturate":[{"backdrop-saturate":[lM,X,Y]}],"backdrop-sepia":[{"backdrop-sepia":[``,lM,X,Y]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,Y]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[lM,`initial`,X,Y]}],ease:[{ease:[`linear`,`initial`,v,X,Y]}],delay:[{delay:[lM,X,Y]}],animate:[{animate:[`none`,y,X,Y]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[g,X,Y]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":[`scale-3d`],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[X,Y,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:N()}],"translate-x":[{"translate-x":N()}],"translate-y":[{"translate-y":N()}],"translate-z":[{"translate-z":N()}],"translate-none":[`translate-none`],zoom:[{zoom:[uM,X,Y]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,Y]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,Y]}],fill:[{fill:[`none`,...k()]}],"stroke-w":[{stroke:[lM,OM,xM,SM]}],stroke:[{stroke:[`none`,...k()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Z(...e){return GM(yj(e))}var KM=1e3;24*(60*KM*60),30*KM;var qM=/^(\d{4})-(\d{2})-(\d{2})/,JM=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;function YM(e,t){let n=qM.exec(e);if(n===null)return e;let r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=new Date(r,a-1,o);if(Number.isNaN(s.getTime()))return e;try{return s.toLocaleDateString(t)}catch{return e}}function XM(e,t){let n=JM.exec(e);if(n===null)return e;let r=new Date(1970,0,1,Number(n[1]),Number(n[2]),n[3]===void 0?0:Number(n[3]));if(Number.isNaN(r.getTime()))return e;try{return r.toLocaleTimeString(t,{hour:`2-digit`,minute:`2-digit`})}catch{return e}}function ZM(e,t){let n=e.includes(`T`)?e:e.replace(` `,`T`),r=new Date(n);if(Number.isNaN(r.getTime()))return e;try{return r.toLocaleString(t,{dateStyle:`medium`,timeStyle:`short`})}catch{return e}}function QM(e,t,n){return e===``?e:t===`date`?YM(e,n):t===`time`?XM(e,n):ZM(e,n)}function $M(e,t){return t===void 0?Number.isInteger(e)?String(e):e.toFixed(1):e.toFixed(t)}var eN=e=>e;function tN(e){let t=e.capName===void 0?void 0:e.display?.perCap?.[e.capName],n=t?.precision??e.display?.precision??e.roleDefault?.precision??e.slicePrecision,r=e.sliceUnit??e.canonicalUnit,a=t?.unit??e.display?.unit??e.roleDefault?.unit;return a!==void 0&&r!==void 0&&a!==r&&Ah(r,a)?{unit:a,precision:n,toDisplayValue:e=>kh(e,r,a)??e}:{unit:r??``,precision:n,toDisplayValue:eN}}function nN(e){if(typeof e!=`object`||!e)return null;let t=Reflect.get(e,`data`);if(typeof t==`object`&&t){let e=Reflect.get(t,`capRouteReason`);if(typeof e==`string`)return e}return null}function rN(e){let t=nN(e);return t===null?(e instanceof Error?e.message:String(e)).includes(`provider not available`):t===`no-provider`||t===`node-offline`}var iN=`text-[10px] text-foreground-subtle`;function aN(e,t){if(typeof globalThis>`u`)return(0,S.createContext)(t);let n=globalThis.__camstackSharedContexts,r=n??new Map;n||(globalThis.__camstackSharedContexts=r);let a=r.get(e);if(a)return a;let o=(0,S.createContext)(t);return r.set(e,o),o}var oN=`FEDERATION_DEBUG`,sN={AT:`@`,HYPHEN:`-`,SLASH:`/`},cN={[sN.AT]:`scope_`,[sN.HYPHEN]:`_`,[sN.SLASH]:`__`};cN[sN.AT],sN.AT,cN[sN.HYPHEN],sN.HYPHEN,cN[sN.SLASH],sN.SLASH;var lN=function(e){return e[e.UNKNOWN=1]=`UNKNOWN`,e[e.CALCULATED=2]=`CALCULATED`,e[e.NO_USE=0]=`NO_USE`,e}({}),uN=typeof ENV_TARGET<`u`?ENV_TARGET===`web`:typeof window<`u`&&window.document!==void 0;function dN(){return uN}function fN(){return typeof navigator<`u`&&navigator?.product===`ReactNative`}function pN(){try{if(dN()&&window.localStorage)return!!localStorage.getItem(oN)}catch{return!1}return!1}function mN(){return typeof process<`u`&&{}.FEDERATION_DEBUG?!!{}.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<`u`&&FEDERATION_DEBUG?!0:pN()}var hN=`[ Federation Runtime ]`,gN=function(...e){return e.length?e.reduce((e,t)=>t?e?`${e}:${t}`:t:e,``):``},_N=(e,t)=>{if(`getPublicPath`in e){let n;return n=e.getPublicPath.startsWith(`function`)?Function(`return `+e.getPublicPath)()():Function(e.getPublicPath)(),`${n}${t}`}else if(`publicPath`in e)return!dN()&&!fN()&&`ssrPublicPath`in e&&typeof e.ssrPublicPath==`string`?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`;else return console.warn(`Cannot get resource URL. If in debug mode, please ignore.`,e,t),``},vN=e=>{console.warn(`${hN}: ${e}`)};function yN(e){try{return JSON.stringify(e,null,2)}catch{return``}}var bN=(e,t)=>{if(!e)return t;let n=(e=>{if(e===`.`)return``;if(e.startsWith(`./`))return e.replace(`./`,``);if(e.startsWith(`/`)){let t=e.slice(1);return t.endsWith(`/`)?t.slice(0,-1):t}return e})(e);return n?n.endsWith(`/`)?`${n}${t}`:`${n}/${t}`:t};function xN(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function SN(e,t={}){let{remotes:n={},overrides:r={},version:a}=t,o,s=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&a?xN(a):e.metaData.publicPath:e.metaData.getPublicPath,c=Object.keys(r),l={};Object.keys(n).length||(l=e.remotes?.reduce((e,t)=>{let n,a=t.federationContainerName;return n=c.includes(a)?r[a]:`version`in t?t.version:t.entry,e[a]={matchedVersion:n},e},{})||{}),Object.keys(n).forEach(e=>l[e]={matchedVersion:c.includes(e)?r[e]:n[e]});let{remoteEntry:{path:u,name:d,type:f},types:p={path:``,name:``,zip:``,api:``},buildInfo:{buildVersion:m},globalName:h,ssrRemoteEntry:g}=e.metaData,{exposes:_}=e,v={version:a||``,buildVersion:m,globalName:h,remoteEntry:bN(u,d),remoteEntryType:f,remoteTypes:bN(p.path,p.name),remoteTypesZip:p.zip||``,remoteTypesAPI:p.api||``,remotesInfo:l,shared:e?.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]})),modules:_?.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(`publicPath`in e.metaData?(o={...v,publicPath:s()},typeof e.metaData.ssrPublicPath==`string`&&(o.ssrPublicPath=e.metaData.ssrPublicPath)):o={...v,getPublicPath:s()},g){let e=bN(g.path,g.name);o.ssrRemoteEntry=e,o.ssrRemoteEntryType=g.type||`commonjs-module`}return o}function CN(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var wN=`[ Module Federation ]`,TN=console,EN=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function DN(){try{let e=Error().stack;if(!e)return;let[,...t]=e.split(`
75
- `),n=t.filter(e=>!EN.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(`
76
- `)}`:void 0}catch{return}}var ON=class{constructor(e,t=TN){this.prefix=e,this.delegate=t??TN}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??TN}emit(e,t){let n=this.delegate,r=mN()?DN():void 0,a=r?[...t,r]:t,o=(()=>{switch(e){case`log`:return[`log`,`info`];case`info`:return[`info`,`log`];case`warn`:return[`warn`,`info`,`log`];case`error`:return[`error`,`warn`,`log`];default:return[`debug`,`log`]}})();for(let e of o){let t=n[e];if(typeof t==`function`){t.call(n,this.prefix,...a);return}}for(let e of o){let t=TN[e];if(typeof t==`function`){t.call(TN,this.prefix,...a);return}}}log(...e){this.emit(`log`,e)}warn(...e){this.emit(`warn`,e)}error(...e){this.emit(`error`,e)}success(...e){this.emit(`info`,e)}info(...e){this.emit(`info`,e)}ready(...e){this.emit(`info`,e)}debug(...e){mN()&&this.emit(`debug`,e)}};function kN(e){return new ON(e)}function AN(e){let t=new ON(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}kN(wN),AN(wN);async function jN(e,t){try{return await e()}catch(e){!t&&vN(e);return}}function MN(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function NN(e){let t=null,n=!0,r=2e4,a,o=document.getElementsByTagName(`script`);for(let r=0;r<o.length;r++){let a=o[r],s=a.getAttribute(`src`);if(s&&MN(s,e.url)){t=a,n=!1;break}}if(!t){let n=e.attrs;t=document.createElement(`script`),t.type=n?.type===`module`?`module`:`text/javascript`;let a;e.createScriptHook&&(a=e.createScriptHook(e.url,e.attrs),a instanceof HTMLScriptElement?t=a:typeof a==`object`&&(`script`in a&&a.script&&(t=a.script),`timeout`in a&&a.timeout&&(r=a.timeout))),t.src||=e.url,n&&!a&&Object.keys(n).forEach(e=>{t&&(e===`async`||e===`defer`?t[e]=n[e]:t.getAttribute(e)||t.setAttribute(e,n[e]))})}let s=null,c=typeof window<`u`?t=>{if(t.filename&&MN(t.filename,e.url)){let n=Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);n.name=`ScriptExecutionError`,s=n}}:null;c&&window.addEventListener(`error`,c);let l=async(n,r)=>{clearTimeout(a),c&&window.removeEventListener(`error`,c);let o=()=>{if(r?.type===`error`){let t=Error(r?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);t.name=`ScriptNetworkError`,e?.onErrorCallback&&e?.onErrorCallback(t)}else s?e?.onErrorCallback&&e?.onErrorCallback(s):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,jN(()=>{let{needDeleteScript:n=!0}=e;n&&t?.parentNode&&t.parentNode.removeChild(t)}),n&&typeof n==`function`)){let e=n(r);if(e instanceof Promise){let t=await e;return o(),t}return o(),e}o()};return t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),a=setTimeout(()=>{l(null,{type:`error`,isTimeout:!0})},r),{script:t,needAttach:n}}function PN(e){let t=null,n=!0,r=2e4,a,o=document.getElementsByTagName(`link`);for(let r=0;r<o.length;r++){let a=o[r],s=a.getAttribute(`href`),c=a.getAttribute(`rel`);if(s&&MN(s,e.url)&&c===e.attrs.rel){t=a,n=!1;break}}if(!t){t=document.createElement(`link`),t.setAttribute(`href`,e.url);let n,a=!0,o=e.attrs;e.createLinkHook&&(n=e.createLinkHook(e.url,o),n instanceof HTMLLinkElement?(t=n,a=!1):typeof n==`object`&&(`link`in n&&n.link&&(t=n.link,a=!1),`timeout`in n&&n.timeout&&(r=n.timeout))),o&&a&&Object.keys(o).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,o[e])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};let s=(n,r)=>{a&&clearTimeout(a);let o=()=>{if(r?.type===`error`){let t=Error(r?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name=`LinkNetworkError`,e?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,jN(()=>{let{needDeleteLink:n=!0}=e;n&&t?.parentNode&&t.parentNode.removeChild(t)}),n)){let e=n(r);return o(),e}o()};return t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),a=setTimeout(()=>{s(null,{type:`error`,isTimeout:!0})},r),{link:t,needAttach:n}}function FN(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,a)=>{let{script:o,needAttach:s}=NN({url:e,cb:t,onErrorCallback:a,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});s&&document.head.appendChild(o)})}var IN=new Map;function LN(e){if(!e)throw Error(`import specifier is required`);if(IN.has(e))return IN.get(e);let t=Function(`name`,`return import(name)`)(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),IN.delete(e),t});return IN.set(e,t),t}var RN=async()=>{let e=await LN(`node-fetch`);return e.default||e},zN=async(e,t,n)=>{let r=await((e,t)=>n.lifecycle.fetch.emit(e,t))(e,t||{});return!r||!(r instanceof Response)?(typeof fetch>`u`?await RN():fetch)(e,t||{}):r},BN=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t,n,r)=>{if(r?.createScriptHook){let t=r.createScriptHook(e);t&&typeof t==`object`&&`url`in t&&(e=t.url)}let a;try{a=new URL(e)}catch(e){console.error(`Error constructing URL:`,e),t(Error(`Invalid URL: ${e}`));return}let o=async()=>r?.fetch?(e,t)=>zN(e,t,r):typeof fetch>`u`?RN():fetch,s=async(e,r)=>{try{let a=await(await e(r.href)).text(),[o,s]=await Promise.all([LN(`path`),LN(`vm`)]),c={exports:{},module:{exports:{}}},l=r.pathname.split(`/`).slice(0,-1).join(`/`),u=o.basename(r.pathname),d=new s.Script(`(function(exports, module, require, __dirname, __filename) {${a}\n})`,{filename:u,importModuleDynamically:s.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??LN}),f;f=(await LN(`node:module`)).createRequire(r.protocol===`file:`||r.protocol===`node:`?r.href:o.join(process.cwd(),`__mf_require_base__.js`)),d.runInThisContext()(c.exports,c.module,f,l,u);let p=c.module.exports||c.exports;if(n&&p&&n.globalName){t(void 0,p[n.globalName]||p);return}t(void 0,p)}catch(e){t(e instanceof Error?e:Error(`Script execution error: ${e}`))}};o().then(async e=>{if(n?.type===`esm`||n?.type===`module`)return UN(a.href,{fetch:e,vm:await LN(`vm`)}).then(async e=>{await e.evaluate(),t(void 0,e.namespace)}).catch(e=>{t(e instanceof Error?e:Error(`Script execution error: ${e}`))});s(e,a)}).catch(e=>{t(e)})}:(e,t,n,r)=>{t(Error(`createScriptNode is disabled in non-Node.js environment`))},VN=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t)=>new Promise((n,r)=>{BN(e,(e,a)=>{if(e)r(e);else{let e=t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`;n(globalThis[e]=a)}},t.attrs,t.loaderHook)}):(e,t)=>{throw Error(`loadScriptNode is disabled in non-Node.js environment`)},HN=new Map;async function UN(e,t){if(HN.has(e))return HN.get(e);let{fetch:n,vm:r}=t,a=await(await n(e)).text(),o=new r.SourceTextModule(a,{importModuleDynamically:async(n,r)=>{let a=new URL(n,e).href;return UN(a,t)}});return HN.set(e,o),await o.link(async n=>{let r=new URL(n,e).href;return await UN(r,t)}),o}var WN=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,GN=(e,t,n,r)=>{let a=[`${[t[e]]} #${e}`];return n&&a.push(`args: ${JSON.stringify(n)}`),a.push(WN(e)),r&&a.push(`Original Error Message:\n ${r}`),a.join(`
77
- `)};function KN(e,t,n,r,a,o){return r(GN(e,t,n,a))}var qN=`[ Federation Runtime ]`,JN=kN(qN);function YN(e,t,n,r,a){e||(n===void 0?XN(t):XN(t,n,r,void 0,a))}function XN(e,t,n,r,a){if(t!==void 0)return KN(e,t,n??{},e=>{throw Error(`${qN}: ${e}`)},r,a);let o=e;throw o instanceof Error?(o.message.startsWith(qN)||(o.message=`${qN}: ${o.message}`),o):Error(`${qN}: ${o}`)}function ZN(e){e instanceof Error&&(e.message.startsWith(qN)||(e.message=`${qN}: ${e.message}`)),JN.warn(e)}function QN(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function $N(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function eP(e){return e.entry!==void 0}function tP(e){return!e.entry.includes(`.json`)}function nP(e){return e&&typeof e==`object`}var rP=Object.prototype.toString;function iP(e){return rP.call(e)===`[object Object]`}function aP(e){return Array.isArray(e)?e:[e]}function oP(e){let t={url:``,type:`global`,globalName:``};return uN||fN()||!(`ssrRemoteEntry`in e)?`remoteEntry`in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:`ssrRemoteEntry`in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}var sP=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},cP=typeof globalThis==`object`?globalThis:window,lP=(()=>{try{return document.defaultView}catch{return cP}})(),uP=lP;function dP(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function fP(e,t){return Object.hasOwnProperty.call(e,t)}fP(cP,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||dP(cP,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var pP=cP.__GLOBAL_LOADING_REMOTE_ENTRY__;function mP(e){fP(e,`__VMOK__`)&&!fP(e,`__FEDERATION__`)&&dP(e,`__FEDERATION__`,e.__VMOK__),fP(e,`__FEDERATION__`)||(dP(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),dP(e,`__VMOK__`,e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}mP(cP),mP(lP);function hP(e,t=mN()){t&&(cP.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,cP.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.5.1`)}function gP(e,t){if(typeof t==`string`){if(e[t])return{value:e[t],key:t};{let n=Object.keys(e);for(let r of n){let[n,a]=r.split(`:`),o=`${n}:${t}`,s=e[o];if(s)return{value:s,key:o}}return{value:void 0,key:t}}}else XN(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var _P=()=>lP.__FEDERATION__.moduleInfo,vP=(e,t)=>{let n=gP(t,$N(e)).value;if(n&&!n.version&&`version`in e&&e.version&&(n.version=e.version),n)return n;if(`version`in e&&e.version){let{version:t,...n}=e,r=$N(n),a=gP(lP.__FEDERATION__.moduleInfo,r).value;if(a?.version===t)return a}},yP=e=>vP(e,lP.__FEDERATION__.moduleInfo),bP=(e,t)=>{let n=$N(e);return lP.__FEDERATION__.moduleInfo[n]=t,lP.__FEDERATION__.moduleInfo},xP=e=>(lP.__FEDERATION__.moduleInfo={...lP.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete lP.__FEDERATION__.moduleInfo[e]}),SP=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:cP[n]}},CP=()=>lP.__FEDERATION__.__GLOBAL_PLUGIN__,wP=e=>cP.__FEDERATION__.__PRELOADED_MAP__.get(e),TP=e=>cP.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),EP=`[0-9A-Za-z-]+`,DP=`(?:\\+(${EP}(?:\\.${EP})*))`,OP=`0|[1-9]\\d*`,kP=`[0-9]+`,AP=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,jP=`(?:${kP}|${AP})`,MP=`(?:-?(${jP}(?:\\.${jP})*))`,NP=`(?:${OP}|${AP})`,PP=`(?:-(${NP}(?:\\.${NP})*))`,FP=`${OP}|x|X|\\*`,IP=`[v=\\s]*(${FP})(?:\\.(${FP})(?:\\.(${FP})(?:${PP})?${DP}?)?)?`,LP=`^\\s*(${IP})\\s+-\\s+(${IP})\\s*$`,RP=`[v=\\s]*${`(${kP})\\.(${kP})\\.(${kP})`}${MP}?${DP}?`,zP=`((?:<|>)?=?)`,BP=`(\\s*)${zP}\\s*(${RP}|${IP})`,VP=`(?:~>?)`,HP=`(\\s*)${VP}\\s+`,UP=`(?:\\^)`,WP=`(\\s*)${UP}\\s+`,GP=`(<|>)?=?\\s*\\*`,KP=`^${UP}${IP}$`,qP=`v?${`(${OP})\\.(${OP})\\.(${OP})`}${PP}?${DP}?`,JP=`^${VP}${IP}$`,YP=`^${zP}\\s*${IP}$`,XP=`^${zP}\\s*(${qP})$|^$`,ZP=`^\\s*>=\\s*0.0.0\\s*$`;function QP(e){return new RegExp(e)}function $P(e){return!e||e.toLowerCase()===`x`||e===`*`}function eF(...e){return t=>e.reduce((e,t)=>t(e),t)}function tF(e){return e.match(QP(XP))}function nF(e,t,n,r){let a=`${e}.${t}.${n}`;return r?`${a}-${r}`:a}function rF(e){return e.replace(QP(LP),(e,t,n,r,a,o,s,c,l,u,d,f)=>(t=$P(n)?``:$P(r)?`>=${n}.0.0`:$P(a)?`>=${n}.${r}.0`:`>=${t}`,c=$P(l)?``:$P(u)?`<${Number(l)+1}.0.0-0`:$P(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:`<=${c}`,`${t} ${c}`.trim()))}function iF(e){return e.replace(QP(BP),`$1$2$3`)}function aF(e){return e.replace(QP(HP),`$1~`)}function oF(e){return e.replace(QP(WP),`$1^`)}function sF(e){return e.trim().split(/\s+/).map(e=>e.replace(QP(KP),(e,t,n,r,a)=>$P(t)?``:$P(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:$P(r)?t===`0`?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0 <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${r}-${a} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${r} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${Number(t)+1}.0.0-0`)).join(` `)}function cF(e){return e.trim().split(/\s+/).map(e=>e.replace(QP(JP),(e,t,n,r,a)=>$P(t)?``:$P(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:$P(r)?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${r}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`)).join(` `)}function lF(e){return e.split(/\s+/).map(e=>e.trim().replace(QP(YP),(e,t,n,r,a,o)=>{let s=$P(n),c=s||$P(r),l=c||$P(a);return t===`=`&&l&&(t=``),o=``,s?t===`>`||t===`<`?`<0.0.0-0`:`*`:t&&l?(c&&(r=0),a=0,t===`>`?(t=`>=`,c?(n=Number(n)+1,r=0,a=0):(r=Number(r)+1,a=0)):t===`<=`&&(t=`<`,c?n=Number(n)+1:r=Number(r)+1),t===`<`&&(o=`-0`),`${t+n}.${r}.${a}${o}`):c?`>=${n}.0.0${o} <${Number(n)+1}.0.0-0`:l?`>=${n}.${r}.0${o} <${n}.${Number(r)+1}.0-0`:e})).join(` `)}function uF(e){return e.trim().replace(QP(GP),``)}function dF(e){return e.trim().replace(QP(ZP),``)}function fF(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function pF(e,t){let{preRelease:n}=e,{preRelease:r}=t;if(n===void 0&&r)return 1;if(n&&r===void 0)return-1;if(n===void 0&&r===void 0)return 0;for(let e=0,t=n.length;e<=t;e++){let t=n[e],a=r[e];if(t!==a)return t===void 0&&a===void 0?0:t?a?fF(t,a):-1:1}return 0}function mF(e,t){return fF(e.major,t.major)||fF(e.minor,t.minor)||fF(e.patch,t.patch)||pF(e,t)}function hF(e,t){return e.version===t.version}function gF(e,t){switch(e.operator){case``:case`=`:return hF(e,t);case`>`:return mF(e,t)<0;case`>=`:return hF(e,t)||mF(e,t)<0;case`<`:return mF(e,t)>0;case`<=`:return hF(e,t)||mF(e,t)>0;case void 0:return!0;default:return!1}}function _F(e){return eF(sF,cF,lF,uF)(e)}function vF(e){return eF(rF,iF,aF,oF)(e.trim()).split(/\s+/).join(` `)}function yF(e,t){if(!e)return!1;let n=tF(e);if(!n)return!1;let[,r,,a,o,s,c]=n,l={operator:r,version:nF(a,o,s,c),major:a,minor:o,patch:s,preRelease:c?.split(`.`)},u=t.split(`||`);for(let e of u){let t=e.trim();if(!t||t===`*`||t===`x`)return!0;try{let e=vF(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>_F(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>dF(e)).filter(Boolean);if(r.length===0)continue;let a=!0;for(let e of r){let t=tF(e);if(!t){a=!1;break}let[,n,,r,o,s,c]=t;if(!gF({operator:n,version:nF(r,o,s,c),major:r,minor:o,patch:s,preRelease:c?.split(`.`)},l)){a=!1;break}}if(a)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}var bF=`default`,xF=`global`;function SF(e,t,n,r){let a;return a=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{XN(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&XN(`Invalid shared config for "${n}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:a,loaded:e?.loaded||`lib`in e?!0:void 0,version:e.version??`0`,scope:Array.isArray(e.scope)?e.scope:[e.scope??`default`],strategy:(e.strategy??r)||`version-first`,treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??`server-calc`,status:e.treeShaking.status??lN.UNKNOWN,useIn:[]}:void 0}}function CF(e,t){let n=t.shared||{},r=t.name,a=Object.keys(n).reduce((e,a)=>{let o=aP(n[a]);return e[a]=e[a]||[],o.forEach(n=>{e[a].push(SF(n,r,a,t.shareStrategy))}),e},{}),o={...e.shared};return Object.keys(a).forEach(e=>{o[e]?a[e].forEach(t=>{o[e].find(e=>e.version===t.version)||o[e].push(t)}):o[e]=a[e]}),{allShareInfos:o,newShareInfos:a}}function wF(e,t){if(!e)return!1;let{status:n,mode:r}=e;return n===lN.NO_USE?!1:n===lN.CALCULATED?!0:r===`runtime-infer`?t?kF(e,t):!0:!1}function TF(e,t){let n=e=>{if(!Number.isNaN(Number(e))){let t=e.split(`.`),n=e;for(let e=0;e<3-t.length;e++)n+=`.0`;return n}return e};return!!yF(n(e),`<=${n(t)}`)}var EF=(e,t)=>{let n=t||function(e,t){return TF(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},DF=e=>!!e.loaded||typeof e.lib==`function`,OF=e=>!!e.loading,kF=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function AF(e,t,n,r){let a=e[t][n],o=``,s=wF(r),c=function(e,t){return s?a[e].treeShaking?a[t].treeShaking?!DF(a[e].treeShaking)&&TF(e,t):!1:!0:!DF(a[e])&&TF(e,t)};if(s){if(o=EF(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:EF(e[t][n],c),useTreesShaking:s}}var jF=e=>DF(e)||OF(e);function MF(e,t,n,r){let a=e[t][n],o=``,s=wF(r),c=function(e,t){if(s){if(!a[e].treeShaking)return!0;if(!a[t].treeShaking)return!1;if(jF(a[t].treeShaking))return jF(a[e].treeShaking)?!!TF(e,t):!0;if(jF(a[e].treeShaking))return!1}return jF(a[t])?jF(a[e])?!!TF(e,t):!0:jF(a[e])?!1:TF(e,t)};if(s){if(o=EF(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:EF(e[t][n],c),useTreesShaking:s}}function NF(e){return e===`loaded-first`?MF:AF}function PF(e,t,n,r){if(!e)return;let{shareConfig:a,scope:o=bF,strategy:s,treeShaking:c}=n,l=Array.isArray(o)?o:[o];for(let o of l)if(a&&e[o]&&e[o][t]){let{requiredVersion:l}=a,{version:u,useTreesShaking:d}=NF(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:uP.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!yF(u,l)){let e=`Version ${u} from ${u&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${l})`;a.strictVersion?XN(e):ZN(e)}return{shared:r,useTreesShaking:d}}else{if(l===!1||l===`*`||yF(u,l))return{shared:r,useTreesShaking:d};let n=wF(c);if(n){for(let[r,a]of Object.entries(e[o][t]))if(wF(a.treeShaking,c?.usedExports)&&yF(r,l))return{shared:a,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(yF(n,l))return{shared:r,useTreesShaking:!1}}}};return(r.emit(f)||f).resolver()}}function FF(){return uP.__FEDERATION__.__SHARE__}function IF(e){let{pkgName:t,extraOptions:n,shareInfos:r}=e,a=n?.resolver??(e=>{if(!e)return;let t={};return e.forEach(e=>{t[e.version]=e}),t[EF(t,function(e,n){return!DF(t[e])&&TF(e,n)})]}),o=e=>typeof e==`object`&&!!e&&!Array.isArray(e),s=(...e)=>{let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n)){let n=t[e];o(n)&&o(r)?t[e]=s(n,r):r!==void 0&&(t[e]=r)}return t};return s(a(r[t]),n?.customShareInfo)}var LF=(e,t)=>{e.useIn||=[],QN(e.useIn,t)};function RF(e,t){return t&&e.treeShaking?e.treeShaking:e}function zF(e,t){return!t||t===`.`?e:`${e}/${t.replace(/^\.\//,``)}`}function BF(e,t){for(let n of e){let e=t.startsWith(n.name),r=t.replace(n.name,``);if(e){if(r.startsWith(`/`)){let e=n.name;return r=`.${r}`,{pkgNameOrAlias:e,expose:r,remote:n}}else if(r===``)return{pkgNameOrAlias:n.name,expose:`.`,remote:n}}let a=n.alias&&t.startsWith(n.alias),o=n.alias&&t.replace(n.alias,``);if(n.alias&&a){if(o&&o.startsWith(`/`)){let e=n.alias;return o=`.${o}`,{pkgNameOrAlias:e,expose:o,remote:n}}else if(o===``)return{pkgNameOrAlias:n.alias,expose:`.`,remote:n}}}}function VF(e,t){for(let n of e)if(t===n.name||n.alias&&t===n.alias)return n}var HF=`RUNTIME-001`,UF=`RUNTIME-002`,WF=`RUNTIME-003`,GF=`RUNTIME-004`,KF=`RUNTIME-005`,qF=`RUNTIME-006`,JF=`RUNTIME-007`,YF=`RUNTIME-008`,XF=`RUNTIME-009`,ZF=`RUNTIME-010`,QF=`RUNTIME-011`,$F=`RUNTIME-012`,eI=`RUNTIME-013`,tI=`RUNTIME-014`,nI=`RUNTIME-015`,rI=`TYPE-001`,iI=`BUILD-001`,aI=`BUILD-002`,oI={[HF]:`Failed to get remoteEntry exports.`,[UF]:`The remote entry interface does not contain "init"`,[WF]:`Failed to get manifest.`,[GF]:`Failed to locate remote.`,[KF]:`Invalid loadShareSync function call from bundler runtime`,[qF]:`Invalid loadShareSync function call from runtime`,[JF]:`Failed to get remote snapshot.`,[YF]:`Failed to load script resources.`,[XF]:`Please call createInstance first.`,[ZF]:`The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.`,[QF]:`The remoteEntry URL is missing from the remote snapshot.`,[$F]:`The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.`,[eI]:`The manifest is not a valid Module Federation manifest.`,[tI]:`The remote does not expose the requested module.`,[nI]:`Remote container initialization failed.`},sI={[rI]:`Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.`},cI={[iI]:`Failed to find expose module.`,[aI]:`PublicPath is required in prod mode.`};({...oI,...sI,...cI});var lI=`.then(callbacks[0]).catch(callbacks[1])`;async function uI({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${e}")${lI}`)([n,r]):fs(()=>import(e).then(n),[],import.meta.url).catch(r)}catch(t){XN(`Failed to load ESM entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}async function dI({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof __system_context__>`u`?System.import(e).then(n).catch(r):Function(`callbacks`,`System.import("${e}")${lI}`)([n,r])}catch(t){XN(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function fI(e,t,n){let{remoteEntryKey:r,entryExports:a}=SP(e,t);return a||XN(HF,oI,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),a}async function pI({name:e,globalName:t,entry:n,remoteInfo:r,loaderHook:a,getEntryUrl:o,resourceContext:s}){let{entryExports:c}=SP(e,t);if(c)return c;let l=o?o(n):n;return FN(l,{attrs:{},createScriptHook:(e,t)=>{let n=a.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:s?{...s,url:e}:void 0});if(n&&(n instanceof HTMLScriptElement||`script`in n||`timeout`in n))return n}}).then(()=>fI(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);XN(YF,oI,{remoteName:e,resourceUrl:l},n)})}async function mI({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:r,resourceContext:a}){let{entry:o,entryGlobalName:s,name:c,type:l}=e;switch(l){case`esm`:case`module`:return uI({entry:o,remoteEntryExports:t});case`system`:return dI({entry:o,remoteEntryExports:t});default:return pI({entry:o,globalName:s,name:c,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:a})}}async function hI({remoteInfo:e,loaderHook:t,resourceContext:n}){let{entry:r,entryGlobalName:a,name:o,type:s}=e,{entryExports:c}=SP(o,a);return c||VN(r,{attrs:{name:o,globalName:a,type:s},loaderHook:{createScriptHook:(r,a={})=>{let o=t.lifecycle.createScript.emit({url:r,attrs:a,remoteInfo:e,resourceContext:n?{...n,url:r}:void 0});if(o&&`url`in o)return o}}}).then(()=>fI(o,a,r)).catch(e=>{XN(`Failed to load Node.js entry for remote "${o}" from "${r}". ${e instanceof Error?e.message:String(e)}`)})}function gI(e){let{entry:t,name:n}=e;return gN(n,t)}async function _I(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:a,resourceContext:o,_inErrorHandling:s=!1}=e,c=gI(r);if(n)return n;if(!pP[c]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;pP[c]=e.emit({origin:t,loaderHook:l,remoteInfo:r,remoteEntryExports:n}).then(e=>e||((typeof ENV_TARGET<`u`?ENV_TARGET===`web`:uN)?mI({remoteInfo:r,remoteEntryExports:n,loaderHook:l,getEntryUrl:a,resourceContext:o}):hI({remoteInfo:r,loaderHook:l,resourceContext:o}))).then(async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e}),e)).catch(async e=>{let a=gI(r),o=e instanceof Error&&e.message.includes(`ScriptExecutionError`);if(e instanceof Error&&e.message.includes(`RUNTIME-008`)&&!o&&!s){let e=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e=>_I({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:pP,uniqueKey:a});if(e)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,recovered:!0}),e}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,error:e}),e})}return pP[c]}function vI(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function yI(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function bI(e,t){let n=CP(),r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return n.length>0&&n.forEach(t=>{e?.find(e=>e.name!==t.name)&&e.push(t)}),e&&e.length>0&&e.forEach(e=>{r.forEach(n=>{n.applyPlugin(e,t)})}),e}function xI(e){return{name:e.name,alias:e.alias,entry:`entry`in e?e.entry:void 0,version:`version`in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function SI(e){let t={};for(let[n,r]of Object.entries(e.shared)){let e=r[0];e&&(t[n]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:e.shareConfig?.requiredVersion===!1?!1:e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?`host`:`unknown`},mfConfig:{name:e.name,remotes:e.remotes?.map(xI)??[],shared:t}}}function CI(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,...e}}function wI(e,t){return t.map(t=>{let n=VF(e,t.nameOrAlias);return YN(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&yN({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:CI(t)}})}function TI(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function EI(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function DI(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}async function OI(e,t,n,r){let a=e.moduleCache.get(n.name),o=n.entry;if(a?.remoteEntryExports)return DI(r,o,`cached`);try{if(!await _I({origin:e,remoteInfo:n,remoteEntryExports:a?.remoteEntryExports,resourceContext:{...r,url:o}}))throw Error(`Failed to load remoteEntry "${o}".`);return DI(r,o,`success`)}catch(e){return DI(r,o,EI(e)?`timeout`:`error`,e)}}function kI({host:e,remoteInfo:t,url:n,attrs:r,context:a,needDeleteLink:o}){return new Promise(s=>{let{link:c,needAttach:l}=PN({url:n,cb:()=>{s(DI(a,n,l?`success`:`cached`))},onErrorCallback:e=>{s(DI(a,n,EI(e)?`timeout`:`error`,e))},attrs:r,createLinkHook:(n,r)=>{let o=e.loaderHook.lifecycle.createLink.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...a,url:n}});return o instanceof HTMLLinkElement,o},needDeleteLink:o});l&&document.head.appendChild(c)})}function AI({host:e,remoteInfo:t,url:n,attrs:r,context:a}){return new Promise(o=>{let{script:s,needAttach:c}=NN({url:n,cb:()=>{o(DI(a,n,c?`success`:`cached`))},onErrorCallback:e=>{o(DI(a,n,EI(e)?`timeout`:`error`,e))},attrs:r,createScriptHook:(n,r)=>{let o=e.loaderHook.lifecycle.createScript.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...a,url:n}});return o instanceof HTMLScriptElement,o},needDeleteScript:!0});c&&document.head.appendChild(s)})}function jI(e,t){return{...e,resourceType:t}}function MI(e,t,n,r=!0,a={initiator:`preloadRemote`,id:e.name}){let{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:c}=n,l=[];if(t.options.inBrowser){if(c.forEach(n=>{let{moduleInfo:r}=n;l.push(OI(t,e,r,jI(a,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{l.push(kI({host:t,remoteInfo:e,url:r,attrs:n,context:jI(a,`css`)}))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{l.push(kI({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:jI(a,`css`)}))})}if(r){let n={rel:`preload`,as:`script`};s.forEach(r=>{l.push(kI({host:t,remoteInfo:e,url:r,attrs:n,context:jI(a,`js`)}))})}else{let n={fetchpriority:`high`,type:e?.type===`module`?`module`:`text/javascript`};s.forEach(r=>{l.push(AI({host:t,remoteInfo:e,url:r,attrs:n,context:jI(a,`js`)}))})}}return Promise.all(l)}function NI(e){if(!e||!(`modules`in e)||!Array.isArray(e.modules))return;let t=e.modules.map(e=>e.moduleName).filter(Boolean);return t.length?t.join(`,`):void 0}function PI(e,t,n){let r=t,a=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];a.length||a.push(`default`),a.forEach(e=>{r[e]||(r[e]={})});let o={version:e.version||``,shareScopeKeys:Array.isArray(e.shareScope)?a:e.shareScope||`default`};return Object.defineProperty(o,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:o,shareScope:r[a[0]],initScope:n??[]}}var FI=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;let t=await _I({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:`loadRemote`,id:zF(this.remoteInfo.name,e),resourceType:`remoteEntry`}});return YN(t,`remoteEntryExports is undefined \n ${yN(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,n,r){let a=await this.getEntry(r);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host}),a;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,cached:!0,origin:this.host}),n}return a}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});let{remoteEntryInitOptions:r,shareScope:o,initScope:s}=PI(this.remoteInfo,this.host.shareScopeMap,n),c=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:o,remoteEntryInitOptions:r,initScope:s,remoteInfo:this.remoteInfo,origin:this.host});a?.init===void 0&&XN(UF,oI,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,SI(this.host.options));try{await a.init(c.shareScope,c.initScope,c.remoteEntryInitOptions)}catch(e){XN(nI,oI,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,SI(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...c,id:e,remoteSnapshot:t,remoteEntryExports:a}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,origin:this.host}),n}finally{this.initing=!1,this.initPromise=void 0}return a}async get(e,t,n,r){let{loadFactory:a=!0}=n||{loadFactory:!0},o=await this.init(e,r,void 0,t);this.lib=o,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,origin:this.host});let s;try{let n=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:o,expose:t,moduleInfo:this.remoteInfo});s=typeof n==`function`?n:void 0,s||=await o.get(t),s||XN(tI,oI,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:NI(r)},void 0,SI(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,moduleFactory:s,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,error:n,origin:this.host}),n}let c=sP(this.remoteInfo.name,t),l=this.wraperFactory(s,c);if(!a)return l;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,origin:this.host});try{let n=await l();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,exposeModule:n,origin:this.host}),n}catch(n){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,error:n,origin:this.host}),n}}wraperFactory(e,t){function n(e,t){e&&typeof e==`object`&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for(`mf_module_id`))&&Object.defineProperty(e,Symbol.for(`mf_module_id`),{value:t,enumerable:!1})}return()=>{let r=e();return r instanceof Promise?r.then(e=>(n(e,t),e)):(n(r,t),r)}}},II=class{constructor(e){this.type=``,this.listeners=new Set,e&&(this.type=e)}on(e){typeof e==`function`&&this.listeners.add(e)}once(e){let t=this;this.on(function n(...r){return t.remove(n),e.apply(null,r)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(n=>{let r=n(...e);r!==void 0&&(t=r)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},LI=class extends II{emit(...e){let t,n=Array.from(this.listeners);if(n.length>0){let r=0,a=t=>t===!1?!1:r<n.length?Promise.resolve(n[r++].apply(null,e)).then(n=>n===void 0||e.length===1&&n===e[0]?a(t):a(n)):t;t=a()}return Promise.resolve(t)}};function RI(e,t){if(!nP(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var zI=class extends II{constructor(e){super(),this.onerror=XN,this.type=e}emit(e){nP(e)||XN(`The data for the "${this.type}" hook should be an object.`);for(let t of this.listeners)try{let n=t(e);if(n===void 0)continue;if(RI(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){ZN(e),this.onerror(e)}return e}},BI=class extends II{constructor(e){super(),this.onerror=XN,this.type=e}emit(e){nP(e)||XN(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let n=0,r=t=>(ZN(t),this.onerror(t),e),a=o=>{if(o!==void 0&&RI(e,o))e=o;else if(o!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(n<t.length)try{return Promise.resolve(t[n++](e)).then(a,r)}catch(e){return r(e)}return e};return Promise.resolve(a(e))}return Promise.resolve(e)}},VI=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){YN(iP(e),`Plugin configuration is invalid.`);let n=e.name;YN(n,`A name must be provided by the plugin.`),this.registerPlugins[n]||(this.registerPlugins[n]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach(t=>{let n=e[t];n&&this.lifecycle[t].on(n)}))}removePlugin(e){YN(e,`A name is required.`);let t=this.registerPlugins[e];YN(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{e!==`name`&&this.lifecycle[e].remove(t[e])})}};function HI(e,t){let n=oP(t);n.url||XN(QF,oI,{remoteName:e.name});let r=_N(t,n.url);!uN&&!r.startsWith(`http`)&&(r=`https:${r}`),e.type=n.type,e.entryGlobalName=n.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}function UI(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:a,remoteInfo:o,id:s}=e;if(!eP(t)||!tP(t)){let{remoteSnapshot:c,globalSnapshot:l}=await a.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:zF(t.name,r)});HI(o,c);let u={remote:t,preloadConfig:{nameOrAlias:n,exposes:[r],resourceCategory:`sync`,share:!1,depsRemote:!1}},d=await a.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:a,preloadOptions:u,remoteInfo:o,remote:t,remoteSnapshot:c,globalSnapshot:l});return d&&MI(o,a,d,!1,{initiator:`loadRemote`,id:s}).catch(()=>void 0),{...e,remoteSnapshot:c}}return e}}}function WI(e){let t=e.split(`:`);return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function GI(e,t,n,r,a={},o){let{value:s}=gP(e,$N(t)),c=o||s;if(c&&!CN(c)&&(n(c,t,r),c.remotesInfo)){let t=Object.keys(c.remotesInfo);for(let r of t){if(a[r])continue;a[r]=!0;let t=WI(r),o=c.remotesInfo[r];GI(e,{name:t.name,version:o.matchedVersion},n,!1,a,void 0)}}}var KI=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function qI(e,t,n,r,a){let o=[],s=[],c=[],l=new Set,u=new Set,{options:d}=e,{preloadConfig:f}=t,{depsRemote:p}=f;if(GI(r,n,(t,n,r)=>{let a;if(r)a=f;else if(Array.isArray(p)){let e=p.find(e=>e.nameOrAlias===n.name||e.nameOrAlias===n.alias);if(!e)return;a=CI(e)}else if(p===!0)a=f;else return;let l=_N(t,oP(t).url);l&&c.push({name:n.name,moduleInfo:{name:n.name,entry:l,type:`remoteEntryType`in t?t.remoteEntryType:`global`,entryGlobalName:`globalName`in t?t.globalName:n.name,shareScope:``,version:`version`in t?t.version:void 0},url:l});let u=`modules`in t?t.modules:[],d=TI(a.exposes);d.length&&`modules`in t&&(u=t?.modules?.reduce((e,t)=>(d?.indexOf(t.moduleName)!==-1&&e.push(t),e),[]));function m(e){let n=e.map(e=>_N(t,e));return a.filter?n.filter(a.filter):n}if(u){let r=u.length;for(let c=0;c<r;c++){let r=u[c],l=`${n.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:r.moduleName===`.`?n.name:l,name:n.name,remoteSnapshot:t,preloadConfig:a,remote:n,origin:e}),!wP(l)&&(a.resourceCategory===`all`?(o.push(...m(r.assets.css.async)),o.push(...m(r.assets.css.sync)),s.push(...m(r.assets.js.async)),s.push(...m(r.assets.js.sync))):a.resourceCategory===`sync`&&(o.push(...m(r.assets.css.sync)),s.push(...m(r.assets.js.sync))),TP(l))}}},!0,{},a),a.shared&&a.shared.length>0){let t=(t,n)=>{let{shared:r}=PF(e.shareScopeMap,n.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&typeof r.lib==`function`&&(n.assets.js.sync.forEach(e=>{l.add(e)}),n.assets.css.sync.forEach(e=>{u.add(e)}))};a.shared.forEach(e=>{let n=d.shared?.[e.sharedName];if(!n)return;let r=e.version?n.find(t=>t.version===e.version):n;r&&aP(r).forEach(n=>{t(n,e)})})}let m=s.filter(e=>!l.has(e)&&!KI(`script`,e));return{cssAssets:o.filter(e=>!u.has(e)&&!KI(`link`,e)),jsAssetsWithoutEntry:m,entryAssets:c.filter(e=>!KI(`script`,e.url))}}var JI=function(){return{name:`generate-preload-assets-plugin`,async generatePreloadAssets(e){let{origin:t,preloadOptions:n,remoteInfo:r,remote:a,globalSnapshot:o,remoteSnapshot:s}=e;return uN?eP(a)&&tP(a)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:a.name,url:a.entry,moduleInfo:{name:r.name,entry:a.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(HI(r,s),qI(t,n,r,o,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function YI(e,t){let n=yP({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&gP(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:_P(),remoteSnapshot:yP({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:_P(),remoteSnapshot:yP({name:e.name,version:`version`in e?e.version:void 0})}}var XI=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new VI({beforeLoadRemoteSnapshot:new LI(`beforeLoadRemoteSnapshot`),loadSnapshot:new BI(`loadGlobalSnapshot`),loadRemoteSnapshot:new BI(`loadRemoteSnapshot`),afterLoadSnapshot:new BI(`afterLoadSnapshot`)}),this.manifestLoading=uP.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:n=`loadRemote`}){let{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let a=yP({name:this.HostInstance.options.name,version:this.HostInstance.options.version});a||(a={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},xP({[this.HostInstance.options.name]:a})),a&&`remotesInfo`in a&&!gP(a.remotesInfo,e.name).value&&(`version`in e||`entry`in e)&&(a.remotesInfo={...a?.remotesInfo,[e.name]:{matchedVersion:`version`in e?e.version:e.entry}});let{hostGlobalSnapshot:o,remoteSnapshot:s,globalSnapshot:c}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:u}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:o,remoteSnapshot:s,globalSnapshot:c}),d,f;if(l)if(CN(l)){let r=uN?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||``,a=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),o=bP({...e,entry:r},a);d=a,f=o}else{let{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:`global`});d=t,f=u}else if(eP(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),a=bP(e,r);d=r,f=a}else XN(JF,oI,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(u)},void 0,SI(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:d}),{remoteSnapshot:d,globalSnapshot:f}}getGlobalRemoteInfo(e){return YI(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=vI(t),a=this.manifestCache.get(e);if(a)return a;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},n,r?{...r,url:e,resourceType:`manifest`}:void 0);(!t||!(t instanceof Response))&&(t=await fetch(e,{})),a=await t.json()}catch(r){a=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),a||(delete this.manifestLoading[e],XN(WF,oI,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,SI(this.HostInstance.options)))}let o=[!a.metaData&&`metaData`,!a.exposes&&`exposes`,!a.shared&&`shared`].filter(Boolean);return o.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${o.join(`, `)}.`),from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),o.length>0&&XN(eI,oI,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:o.join(`,`)},void 0,SI(this.HostInstance.options)),this.manifestCache.set(e,a),a})()}async loadManifestSnapshot(e,t,n,r){let a=async()=>{let a=await this.getManifestJson(e,t,n,r),o=SN(a,{version:e}),{remoteSnapshot:s}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:a,remoteSnapshot:o,manifestUrl:e,from:`manifest`});return s};return this.manifestLoading[e]||(this.manifestLoading[e]=a().then(e=>e)),this.manifestLoading[e]}},ZI=class{constructor(e){this.hooks=new VI({beforeRegisterShare:new zI(`beforeRegisterShare`),afterResolve:new BI(`afterResolve`),beforeLoadShare:new BI(`beforeLoadShare`),loadShare:new LI,afterLoadShare:new II(`afterLoadShare`),errorLoadShare:new II(`errorLoadShare`),resolveShare:new zI(`resolveShare`),initContainerShareScopeMap:new zI(`initContainerShareScopeMap`)}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:r}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(e){ZN(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:r,recovered:a}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:a})}catch(e){ZN(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=CF(e,t);return Object.keys(n).forEach(e=>{n[e].forEach(n=>{n.scope.forEach(r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:n}),this.shareScopeMap[r]?.[e]||this.setShared({pkgName:e,lib:n.lib,get:n.get,loaded:n.loaded||!!n.lib,shared:n,from:t.name})})})}),{newShareInfos:n,allShareInfos:r}}async loadShare(e,t){let{host:n}=this,r=IF({pkgName:e,extraOptions:t,shareInfos:n.options.shared}),a=r;try{r?.scope&&await Promise.all(r.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))})),a=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:n.options.shared,origin:n})).shareInfo,YN(a,`Cannot find shared "${e}" in host "${n.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);let o=a,{shared:s,useTreesShaking:c}=PF(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){let t=RF(s,c);if(t.lib)return LF(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),t.lib;if(t.loading&&!t.loaded){let r=await t.loading;return t.loaded=!0,t.lib||=r,LF(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),r}else{let r=(async()=>{let e=await t.get();return LF(t,n.options.name),t.loaded=!0,t.lib=e,e})();this.setShared({pkgName:e,loaded:!1,shared:s,from:n.options.name,lib:null,loading:r,treeShaking:c?t:void 0});let a=await r;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),a}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,recovered:!0}),!1;let r=wF(o.treeShaking),a=RF(o,r),s=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,LF(a,n.options.name);let{shared:r,useTreesShaking:s}=PF(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(r){let e=RF(r,s);e.lib=t,e.loaded=!0,r.from=o.from}return t})();this.setShared({pkgName:e,loaded:!1,shared:o,from:n.options.name,lib:null,loading:s,treeShaking:r?a:void 0});let c=await s;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:o}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,error:t}),t}}initializeSharing(e=bF,t){let{host:n}=this,r=t?.from,a=t?.strategy,o=t?.initScope,s=[];if(r!==`build`){let{initTokens:t}=this;o||=[];let n=t[e];if(n||=t[e]={from:this.host.name},o.indexOf(n)>=0)return s;o.push(n)}let c=this.shareScopeMap,l=n.options.name;c[e]||(c[e]={});let u=c[e],d=(e,t)=>{let{version:n,eager:r}=t;u[e]=u[e]||{};let a=u[e],o=a[n]&&RF(a[n]),s=!!(o&&(`eager`in o&&o.eager||`shareConfig`in o&&o.shareConfig?.eager));(!o||o.strategy!==`loaded-first`&&!o.loaded&&(!r==!s?l>a[n].from:r))&&(a[n]=t)},f=async e=>{let{module:t}=await n.remoteHandler.getRemoteModuleAndOptions({id:e}),r;try{r=await t.getEntry()}catch(a){if(r=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:a,from:`runtime`,lifecycle:`beforeLoadShare`,remote:t.remoteInfo,origin:n}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,o))}};return Object.keys(n.options.shared).forEach(t=>{n.options.shared[t].forEach(n=>{n.scope.includes(e)&&d(t,n)})}),(n.options.shareStrategy===`version-first`||a===`version-first`)&&n.options.remotes.forEach(t=>{t.shareScope===e&&s.push(f(t.name))}),s}loadShareSync(e,t){let{host:n}=this,r=IF({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{r?.scope&&r.scope.forEach(e=>{this.initializeSharing(e,{strategy:r.strategy})});let{shared:a}=PF(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(a){if(typeof a.lib==`function`)return LF(a,n.options.name),a.loaded||(a.loaded=!0,a.from===n.options.name&&(r.loaded=!0)),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:a}),a.lib;if(typeof a.get==`function`){let t=a.get();if(!(t instanceof Promise))return LF(a,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:t,shared:a}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:a}),t}}if(r.lib)return r.loaded||=!0,this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:r}),r.lib;if(r.get){let a=r.get();return a instanceof Promise&&XN(t?.from===`build`?KF:qF,oI,{hostName:n.options.name,sharedPkgName:e},void 0,SI(n.options)),r.lib=a,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:r.lib,shared:r}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:r}),r.lib}XN(qF,oI,{hostName:n.options.name,sharedPkgName:e},void 0,SI(n.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,error:t}),t}}initShareScopeMap(e,t,n={}){let{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:r,loading:a,loaded:o,get:s,treeShaking:c}){let{version:l,scope:u=`default`,...d}=t,f=Array.isArray(u)?u:[u],p=e=>{let t=(e,t,n)=>{n&&!e[t]&&(e[t]=n)},n=c?e.treeShaking:e;t(n,`loaded`,o),t(n,`loading`,a),t(n,`get`,s)};f.forEach(t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][l]||(this.shareScopeMap[t][e][l]={version:l,scope:[t],...d,lib:r});let a=this.shareScopeMap[t][e][l];p(a),n&&a.from!==n&&(a.from=n)})}_setGlobalShareScopeMap(e){let t=FF(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},QI=class{constructor(e){this.hooks=new VI({beforeRegisterRemote:new zI(`beforeRegisterRemote`),registerRemote:new zI(`registerRemote`),beforeRequest:new BI(`beforeRequest`),afterMatchRemote:new LI(`afterMatchRemote`),onLoad:new LI(`onLoad`),afterLoadRemote:new LI(`afterLoadRemote`),handlePreloadModule:new II(`handlePreloadModule`),errorLoadRemote:new LI(`errorLoadRemote`),beforePreloadRemote:new LI(`beforePreloadRemote`),generatePreloadAssets:new LI(`generatePreloadAssets`),afterPreloadRemote:new LI(`afterPreloadRemote`),loadEntry:new LI}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:n,expose:r}=t,{name:a,alias:o}=n;if(this.idToRemoteMap[e]={name:n.name,expose:r},o&&e.startsWith(a)){let t=e.replace(a,o);this.idToRemoteMap[t]={name:n.name,expose:r};return}if(o&&e.startsWith(o)){let t=e.replace(o,a);this.idToRemoteMap[t]={name:n.name,expose:r}}}async loadRemote(e,t){let{host:n}=this,r=BF(n.options.remotes,e),a=e,o=r?.expose,s=r?vI(r.remote):void 0,c;try{let{loadFactory:r=!0}=t||{loadFactory:!0},{module:l,moduleOptions:u,remoteMatchInfo:d}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:f,remote:p,expose:m,id:h,remoteSnapshot:g}=d;a=h,o=m,s=vI(p);let _=await l.get(h,m,t,g),v=await this.hooks.lifecycle.onLoad.emit({id:h,pkgNameOrAlias:f,expose:m,exposeModule:r?_:void 0,exposeModuleFactory:r?void 0:_,remote:p,options:u,moduleInstance:l,origin:n});return this.setIdToRemoteMap(e,d),c={id:a,expose:o,remote:s,options:t,origin:n},typeof v==`function`?v:_}catch(r){let{from:l=`runtime`}=t||{from:`runtime`},u;try{u=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:l,lifecycle:`onLoad`,expose:o,remote:s,origin:n})}catch(e){throw c={id:a,expose:o,remote:s,options:t,error:e,origin:n},e}if(!u)throw c={id:a,expose:o,remote:s,options:t,error:r,origin:n},r;return c={id:a,expose:o,remote:s,options:t,error:r,origin:n,recovered:!0},u}finally{c&&await this.hooks.lifecycle.afterLoadRemote.emit(c)}}async preloadRemote(e){let{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=wI(t.options.remotes,e),a=e=>{let{preloadConfig:t,remote:n}=e,r=t.exposes||[];return r.length?r.map(r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:zF(n.name,r)})):[{ops:e,id:`${n.name}/*`}]},o;await Promise.all(r.flatMap(a).map(async e=>{let{ops:r,id:a}=e,{remote:o,preloadConfig:s}=r,c=vI(o);try{let{globalSnapshot:e,remoteSnapshot:l}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o,id:a,initiator:`preloadRemote`}),u=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:o,remoteInfo:c,globalSnapshot:e,remoteSnapshot:l});if(!u)return;let d=await MI(c,t,u,!0,{initiator:`preloadRemote`,id:a});n.push({remote:o,remoteInfo:c,preloadConfig:s,id:a,results:d})}catch(e){n.push({remote:o,remoteInfo:c,preloadConfig:s,id:a,results:[{url:c.entry,status:`error`,resourceType:/\.json(?:$|[?#])/i.test(c.entry)?`manifest`:`remoteEntry`,initiator:`preloadRemote`,id:a,error:e}]})}}));let s=n.flatMap(e=>e.results.filter(e=>e.status===`error`||e.status===`timeout`));if(s.length>0&&(o=Error(`preloadRemote failed to load ${s.length} resource(s).`),Object.assign(o,{results:n,failedResults:s})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:o}),o)throw o}registerRemotes(e,t){let{host:n}=this;e.forEach(e=>{this.registerRemote(e,n.options.remotes,{force:t?.force})})}async getRemoteModuleAndOptions(e){let{host:t}=this,{id:n}=e,r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:`runtime`,error:e,lifecycle:`beforeRequest`}),!r)throw e}let{id:a}=r,o=BF(t.options.remotes,a);if(!o)try{XN(GF,oI,{hostName:t.options.name,requestId:a},void 0,SI(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:a,options:t.options,error:e,origin:t}),e}let{remote:s}=o,c=vI(s);await this.hooks.lifecycle.afterMatchRemote.emit({id:a,...o,options:t.options,remoteInfo:c,origin:t});let l=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:a,...o,options:t.options,origin:t,remoteInfo:c}),{remote:u,expose:d}=l;YN(u&&d,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);let f=t.moduleCache.get(u.name),p={host:t,remoteInfo:c};return f||(f=new FI(p),t.moduleCache.set(u.name,f)),{module:f,moduleOptions:p,remoteMatchInfo:l}}registerRemote(e,t,n){let{host:r}=this,a=()=>{if(e.alias){let n=t.find(t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias)));YN(!n,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${n&&n.name} name or alias`)}`entry`in e&&uN&&typeof window<`u`&&!e.entry.startsWith(`http`)&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||=bF,e.type||=xF};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});let o=t.find(t=>t.name===e.name);if(!o)a(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r});else{let s=[`The remote "${e.name}" is already registered.`,`Please note that overriding it may cause unexpected errors.`];n?.force&&(this.removeRemote(o),a(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),vN(s.join(` `)))}}removeRemote(e){try{let{host:t}=this,{name:n}=e,r=t.options.remotes.findIndex(e=>e.name===n);r!==-1&&t.options.remotes.splice(r,1);let a=t.moduleCache.get(e.name);if(a){let n=a.remoteInfo,r=n.entryGlobalName;cP[r]&&(Object.getOwnPropertyDescriptor(cP,r)?.configurable?delete cP[r]:cP[r]=void 0);let o=gI(a.remoteInfo);pP[o]&&delete pP[o],t.snapshotHandler.manifestCache.delete(n.entry);let s=n.buildVersion?gN(n.name,n.buildVersion):n.name,c=cP.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===s:e.name===s);if(c!==-1){let e=cP.__FEDERATION__.__INSTANCES__[c];s=e.options.id||s;let t=FF(),r=!0,a=[];Object.keys(t).forEach(e=>{let o=t[e];o&&Object.keys(o).forEach(t=>{let s=o[t];s&&Object.keys(s).forEach(o=>{let c=s[o];c&&Object.keys(c).forEach(s=>{let l=c[s];l&&typeof l==`object`&&l.from===n.name&&(l.loaded||l.loading?(l.useIn=l.useIn.filter(e=>e!==n.name),l.useIn.length?r=!1:a.push([e,t,o,s])):a.push([e,t,o,s]))})})})}),r&&(e.shareScopeMap={},delete t[s]),a.forEach(([e,n,r,a])=>{delete t[e]?.[n]?.[r]?.[a]}),cP.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:l}=YI(e,t);if(l){let t=l&&`remotesInfo`in l&&l.remotesInfo&&gP(l.remotesInfo,e.name).key;t&&(delete l.remotesInfo[t],uP.__FEDERATION__.__MANIFEST_LOADING__[t]&&delete uP.__FEDERATION__.__MANIFEST_LOADING__[t])}t.moduleCache.delete(e.name)}}catch(e){JN.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},$I=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN==`boolean`?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;hP(class{constructor(e){this.hooks=new VI({beforeInit:new zI(`beforeInit`),init:new II,beforeInitContainer:new BI(`beforeInitContainer`),initContainer:new BI(`initContainer`)}),this.version=`2.5.1`,this.moduleCache=new Map,this.loaderHook=new VI({getModuleInfo:new II,createScript:new II,createLink:new II,fetch:new LI,loadEntryError:new LI,afterLoadEntry:new LI(`afterLoadEntry`),beforeInitRemote:new LI(`beforeInitRemote`),afterInitRemote:new LI(`afterInitRemote`),beforeGetExpose:new LI(`beforeGetExpose`),afterGetExpose:new LI(`afterGetExpose`),beforeExecuteFactory:new LI(`beforeExecuteFactory`),afterExecuteFactory:new LI(`afterExecuteFactory`),getModuleFactory:new LI}),this.bridgeHook=new VI({beforeBridgeRender:new II,afterBridgeRender:new II,beforeBridgeDestroy:new II,afterBridgeDestroy:new II});let t=$I?[UI(),JI()]:[],n={id:yI(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:uN};this.name=e.name,this.options=n,this.snapshotHandler=new XI(this),this.sharedHandler=new ZI(this),this.remoteHandler=new QI(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){e.name&&e.name!==this.options.name&&XN(GN(ZF,oI)),this.registerPlugins(e.plugins);let t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=bF,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){let r=vI({name:e,entry:t}),a=new FI({host:this,remoteInfo:r});return a.remoteEntryExports=n,this.moduleCache.set(e,a),a}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,n={}){this.sharedHandler.initShareScopeMap(e,t,n)}formatOptions(e,t){let{allShareInfos:n}=CF(e,t),{userOptions:r,options:a}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),o=this.remoteHandler.formatAndRegisterRemote(a,r),{allShareInfos:s}=this.sharedHandler.registerShared(a,r),c=[...a.plugins];r.plugins&&r.plugins.forEach(e=>{c.includes(e)||c.push(e)});let l={...e,...t,plugins:c,remotes:o,shared:s,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:l}),l}registerPlugins(e){let t=bI(e,this);this.options.plugins=this.options.plugins.reduce((e,t)=>(t&&e&&!e.find(e=>e.name===t.name)&&e.push(t),e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}});var eL=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),tL=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),nL=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),rL=e=>{let t=nL(e);return t.charAt(0).toUpperCase()+t.slice(1)},iL={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},aL=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},oL=(0,S.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a=``,children:o,iconNode:s,...c},l)=>(0,S.createElement)(`svg`,{ref:l,...iL,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:eL(`lucide`,a),...!o&&!aL(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,S.createElement)(e,t)),...Array.isArray(o)?o:[o]])),Q=(e,t)=>{let n=(0,S.forwardRef)(({className:n,...r},a)=>(0,S.createElement)(oL,{ref:a,iconNode:t,className:eL(`lucide-${tL(rL(e))}`,`lucide-${e}`,n),...r}));return n.displayName=rL(e),n},sL=Q(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),cL=Q(`air-vent`,[[`path`,{d:`M18 17.5a2.5 2.5 0 1 1-4 2.03V12`,key:`yd12zl`}],[`path`,{d:`M6 12H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`larmp2`}],[`path`,{d:`M6 8h12`,key:`6g4wlu`}],[`path`,{d:`M6.6 15.572A2 2 0 1 0 10 17v-5`,key:`1x1kqn`}]]),lL=Q(`alarm-smoke`,[[`path`,{d:`M11 21c0-2.5 2-2.5 2-5`,key:`1sicvv`}],[`path`,{d:`M16 21c0-2.5 2-2.5 2-5`,key:`1o3eny`}],[`path`,{d:`m19 8-.8 3a1.25 1.25 0 0 1-1.2 1H7a1.25 1.25 0 0 1-1.2-1L5 8`,key:`1bvca4`}],[`path`,{d:`M21 3a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1z`,key:`x3qr1j`}],[`path`,{d:`M6 21c0-2.5 2-2.5 2-5`,key:`i3w1gp`}]]);Q(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Q(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Q(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Q(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Q(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),Q(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Q(`baby`,[[`path`,{d:`M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5`,key:`1u7htd`}],[`path`,{d:`M15 12h.01`,key:`1k8ypt`}],[`path`,{d:`M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1`,key:`11xh7x`}],[`path`,{d:`M9 12h.01`,key:`157uk2`}]]);var uL=Q(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),dL=Q(`bath`,[[`path`,{d:`M10 4 8 6`,key:`1rru8s`}],[`path`,{d:`M17 19v2`,key:`ts1sot`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`M7 19v2`,key:`12npes`}],[`path`,{d:`M9 5 7.621 3.621A2.121 2.121 0 0 0 4 5v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5`,key:`14ym8i`}]]);Q(`battery-full`,[[`path`,{d:`M10 10v4`,key:`1mb2ec`}],[`path`,{d:`M14 10v4`,key:`1nt88p`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 10v4`,key:`1n77qd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`battery-low`,[[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 14v-4`,key:`14a6bd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]);var fL=Q(`battery-medium`,[[`path`,{d:`M10 14v-4`,key:`suye4c`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 14v-4`,key:`14a6bd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),pL=Q(`battery-warning`,[[`path`,{d:`M10 17h.01`,key:`nbq80n`}],[`path`,{d:`M10 7v6`,key:`nne03l`}],[`path`,{d:`M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2`,key:`1m83kb`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`h8lgfh`}]]);Q(`battery`,[[`path`,{d:`M 22 14 L 22 10`,key:`nqc4tb`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]);var mL=Q(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]);Q(`bike`,[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]),Q(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]);var hL=Q(`blinds`,[[`path`,{d:`M3 3h18`,key:`o7r712`}],[`path`,{d:`M20 7H8`,key:`gd2fo2`}],[`path`,{d:`M20 11H8`,key:`1ynp89`}],[`path`,{d:`M10 19h10`,key:`19hjk5`}],[`path`,{d:`M8 15h12`,key:`1yqzne`}],[`path`,{d:`M4 3v14`,key:`fggqzn`}],[`circle`,{cx:`4`,cy:`19`,r:`2`,key:`p3m9r0`}]]),gL=Q(`bone`,[[`path`,{d:`M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z`,key:`w610uw`}]]),_L=Q(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),vL=Q(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]);Q(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Q(`bus`,[[`path`,{d:`M8 6v6`,key:`18i7km`}],[`path`,{d:`M15 6v6`,key:`1sg6z9`}],[`path`,{d:`M2 12h19.6`,key:`de5uta`}],[`path`,{d:`M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3`,key:`1wwztk`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}],[`path`,{d:`M9 18h5`,key:`lrx6i`}],[`circle`,{cx:`16`,cy:`18`,r:`2`,key:`1v4tcr`}]]);var yL=Q(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]);Q(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),Q(`cast`,[[`path`,{d:`M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6`,key:`3zrzxg`}],[`path`,{d:`M2 12a9 9 0 0 1 8 8`,key:`g6cvee`}],[`path`,{d:`M2 16a5 5 0 0 1 4 4`,key:`1y1dii`}],[`line`,{x1:`2`,x2:`2.01`,y1:`20`,y2:`20`,key:`xu2jvo`}]]),Q(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]);var bL=Q(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),xL=Q(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);Q(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);var SL=Q(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),CL=Q(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);Q(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Q(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Q(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Q(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);var wL=Q(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),TL=Q(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]);Q(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Q(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),Q(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Q(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]);var EL=Q(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),DL=Q(`cloud-fog`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 17H7`,key:`pygtm1`}],[`path`,{d:`M17 21H9`,key:`1u2q02`}]]),OL=Q(`cloud-lightning`,[[`path`,{d:`M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973`,key:`1cez44`}],[`path`,{d:`m13 12-3 5h4l-3 5`,key:`1t22er`}]]),kL=Q(`cloud-rain`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 14v6`,key:`1j4efv`}],[`path`,{d:`M8 14v6`,key:`17c4r9`}],[`path`,{d:`M12 16v6`,key:`c8a4gj`}]]),AL=Q(`cloud-snow`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M8 15h.01`,key:`a7atzg`}],[`path`,{d:`M8 19h.01`,key:`puxtts`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M12 21h.01`,key:`h35vbk`}],[`path`,{d:`M16 15h.01`,key:`rnfrdf`}],[`path`,{d:`M16 19h.01`,key:`1vcnzz`}]]),jL=Q(`cloud-sun`,[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}],[`path`,{d:`M15.947 12.65a4 4 0 0 0-5.925-4.128`,key:`dpwdj0`}],[`path`,{d:`M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z`,key:`s09mg5`}]]),ML=Q(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]);Q(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),Q(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`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`}]]),Q(`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`}]]),Q(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]);var NL=Q(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]);Q(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Q(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]);var PL=Q(`door-closed`,[[`path`,{d:`M10 12h.01`,key:`1kxr2c`}],[`path`,{d:`M18 20V6a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v14`,key:`36qu9e`}],[`path`,{d:`M2 20h20`,key:`owomy5`}]]),FL=Q(`door-open`,[[`path`,{d:`M11 20H2`,key:`nlcfvz`}],[`path`,{d:`M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z`,key:`au4z13`}],[`path`,{d:`M11 4H8a2 2 0 0 0-2 2v14`,key:`74r1mk`}],[`path`,{d:`M14 12h.01`,key:`1jfl7z`}],[`path`,{d:`M22 20h-3`,key:`vhrsz`}]]),IL=Q(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),LL=Q(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),RL=Q(`droplets`,[[`path`,{d:`M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z`,key:`1ptgy4`}],[`path`,{d:`M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97`,key:`1sl1rz`}]]);Q(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Q(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);var zL=Q(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]);Q(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);var BL=Q(`fan`,[[`path`,{d:`M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z`,key:`484a7f`}],[`path`,{d:`M12 12v.01`,key:`u5ubse`}]]),VL=Q(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]);Q(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]);var HL=Q(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),UL=Q(`flashlight`,[[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z`,key:`17vh7j`}],[`path`,{d:`M6 6h12`,key:`n6hhss`}]]),WL=Q(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),GL=Q(`footprints`,[[`path`,{d:`M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z`,key:`1dudjm`}],[`path`,{d:`M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z`,key:`l2t8xc`}],[`path`,{d:`M16 17h4`,key:`1dejxt`}],[`path`,{d:`M4 13h4`,key:`1bwh8b`}]]);Q(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Q(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]);var KL=Q(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]);Q(`grip-horizontal`,[[`circle`,{cx:`12`,cy:`9`,r:`1`,key:`124mty`}],[`circle`,{cx:`19`,cy:`9`,r:`1`,key:`1ruzo2`}],[`circle`,{cx:`5`,cy:`9`,r:`1`,key:`1a8b28`}],[`circle`,{cx:`12`,cy:`15`,r:`1`,key:`1e56xg`}],[`circle`,{cx:`19`,cy:`15`,r:`1`,key:`1a92ep`}],[`circle`,{cx:`5`,cy:`15`,r:`1`,key:`5r1jwy`}]]),Q(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),Q(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]);var qL=Q(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),JL=Q(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),YL=Q(`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`}]]),XL=Q(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]);Q(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Q(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Q(`laugh`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z`,key:`b2q4dd`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Q(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]);var ZL=Q(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),QL=Q(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),$L=Q(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),eR=Q(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),tR=Q(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);Q(`locate-fixed`,[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);var nR=Q(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),rR=Q(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),iR=Q(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),aR=Q(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]);Q(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]);var oR=Q(`megaphone`,[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]);Q(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]);var sR=Q(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]);Q(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),Q(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Q(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]);var cR=Q(`monitor-play`,[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]),lR=Q(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),uR=Q(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),dR=Q(`move-horizontal`,[[`path`,{d:`m18 8 4 4-4 4`,key:`1ak13k`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}]]),fR=Q(`move-vertical`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]);Q(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]);var pR=Q(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),mR=Q(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]),hR=Q(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]);Q(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]);var gR=Q(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),_R=Q(`paw-print`,[[`circle`,{cx:`11`,cy:`4`,r:`2`,key:`vol9p0`}],[`circle`,{cx:`18`,cy:`8`,r:`2`,key:`17gozi`}],[`circle`,{cx:`20`,cy:`16`,r:`2`,key:`1v9bxh`}],[`path`,{d:`M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z`,key:`1ydw1z`}]]);Q(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Q(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]);var vR=Q(`pipette`,[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`,key:`1y3wsu`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`,key:`110lr1`}],[`path`,{d:`m2 22 .414-.414`,key:`jhxm08`}]]);Q(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]);var yR=Q(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);Q(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Q(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Q(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]);var bR=Q(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]);Q(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]);var xR=Q(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]);Q(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]);var SR=Q(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),CR=Q(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);Q(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Q(`sailboat`,[[`path`,{d:`M10 2v15`,key:`1qf71f`}],[`path`,{d:`M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z`,key:`1pxcvx`}],[`path`,{d:`M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z`,key:`5oog16`}]]),Q(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Q(`scan`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]);var wR=Q(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]);Q(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Q(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Q(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]);var TR=Q(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),ER=Q(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),DR=Q(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),OR=Q(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]);Q(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]);var kR=Q(`siren`,[[`path`,{d:`M7 18v-6a5 5 0 1 1 10 0v6`,key:`pcx96s`}],[`path`,{d:`M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z`,key:`1b4s83`}],[`path`,{d:`M21 12h1`,key:`jtio3y`}],[`path`,{d:`M18.5 4.5 18 5`,key:`g5sp9y`}],[`path`,{d:`M2 12h1`,key:`1uaihz`}],[`path`,{d:`M12 2v1`,key:`11qlp1`}],[`path`,{d:`m4.929 4.929.707.707`,key:`1i51kw`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}]]),AR=Q(`skip-back`,[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`15892j`}],[`path`,{d:`M3 20V4`,key:`1ptbpl`}]]),jR=Q(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]),MR=Q(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),NR=Q(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),PR=Q(`snowflake`,[[`path`,{d:`m10 20-1.25-2.5L6 18`,key:`18frcb`}],[`path`,{d:`M10 4 8.75 6.5 6 6`,key:`7mghy3`}],[`path`,{d:`m14 20 1.25-2.5L18 18`,key:`1chtki`}],[`path`,{d:`m14 4 1.25 2.5L18 6`,key:`1b4wsy`}],[`path`,{d:`m17 21-3-6h-4`,key:`15hhxa`}],[`path`,{d:`m17 3-3 6 1.5 3`,key:`11697g`}],[`path`,{d:`M2 12h6.5L10 9`,key:`kv9z4n`}],[`path`,{d:`m20 10-1.5 2 1.5 2`,key:`1swlpi`}],[`path`,{d:`M22 12h-6.5L14 15`,key:`1mxi28`}],[`path`,{d:`m4 10 1.5 2L4 14`,key:`k9enpj`}],[`path`,{d:`m7 21 3-6-1.5-3`,key:`j8hb9u`}],[`path`,{d:`m7 3 3 6h4`,key:`1otusx`}]]),FR=Q(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),IR=Q(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),LR=Q(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);Q(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);var RR=Q(`sun-medium`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 3v1`,key:`1asbbs`}],[`path`,{d:`M12 20v1`,key:`1wcdkc`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M20 12h1`,key:`1vloll`}],[`path`,{d:`m18.364 5.636-.707.707`,key:`1hakh0`}],[`path`,{d:`m6.343 17.657-.707.707`,key:`18m9nf`}],[`path`,{d:`m5.636 5.636.707.707`,key:`1xv1c5`}],[`path`,{d:`m17.657 17.657.707.707`,key:`vl76zb`}]]),zR=Q(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),BR=Q(`sunrise`,[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m4.93 10.93 1.41 1.41`,key:`2a7f42`}],[`path`,{d:`M2 18h2`,key:`j10viu`}],[`path`,{d:`M20 18h2`,key:`wocana`}],[`path`,{d:`m19.07 10.93-1.41 1.41`,key:`15zs5n`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}],[`path`,{d:`M16 18a4 4 0 0 0-8 0`,key:`1lzouq`}]]);Q(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),Q(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Q(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]);var VR=Q(`thermometer`,[[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]),HR=Q(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]);Q(`toggle-right`,[[`circle`,{cx:`15`,cy:`12`,r:`3`,key:`1afu0r`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]);var UR=Q(`tractor`,[[`path`,{d:`m10 11 11 .9a1 1 0 0 1 .8 1.1l-.665 4.158a1 1 0 0 1-.988.842H20`,key:`she1j9`}],[`path`,{d:`M16 18h-5`,key:`bq60fd`}],[`path`,{d:`M18 5a1 1 0 0 0-1 1v5.573`,key:`1kv8ia`}],[`path`,{d:`M3 4h8.129a1 1 0 0 1 .99.863L13 11.246`,key:`1q1ert`}],[`path`,{d:`M4 11V4`,key:`9ft8pt`}],[`path`,{d:`M7 15h.01`,key:`k5ht0j`}],[`path`,{d:`M8 10.1V4`,key:`1jgyzo`}],[`circle`,{cx:`18`,cy:`18`,r:`2`,key:`1emm8v`}],[`circle`,{cx:`7`,cy:`15`,r:`5`,key:`ddtuc`}]]);Q(`train-front`,[[`path`,{d:`M8 3.1V7a4 4 0 0 0 8 0V3.1`,key:`1v71zp`}],[`path`,{d:`m9 15-1-1`,key:`1yrq24`}],[`path`,{d:`m15 15 1-1`,key:`1t0d6s`}],[`path`,{d:`M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z`,key:`1p0hjs`}],[`path`,{d:`m8 19-2 3`,key:`13i0xs`}],[`path`,{d:`m16 19 2 3`,key:`xo31yx`}]]);var WR=Q(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);Q(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),Q(`trending-down`,[[`path`,{d:`M16 17h6v-6`,key:`t6n2it`}],[`path`,{d:`m22 17-8.5-8.5-5 5L2 7`,key:`x473p`}]]);var GR=Q(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);Q(`truck`,[[`path`,{d:`M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2`,key:`wrbu53`}],[`path`,{d:`M15 18H9`,key:`1lyqi6`}],[`path`,{d:`M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14`,key:`lysw3i`}],[`circle`,{cx:`17`,cy:`18`,r:`2`,key:`332jqn`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}]]);var KR=Q(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]);Q(`unlink-2`,[[`path`,{d:`M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2`,key:`1re2ne`}]]),Q(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Q(`user-check`,[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Q(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Q(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);var qR=Q(`utensils-crossed`,[[`path`,{d:`m16 2-2.3 2.3a3 3 0 0 0 0 4.2l1.8 1.8a3 3 0 0 0 4.2 0L22 8`,key:`n7qcjb`}],[`path`,{d:`M15 15 3.3 3.3a4.2 4.2 0 0 0 0 6l7.3 7.3c.7.7 2 .7 2.8 0L15 15Zm0 0 7 7`,key:`d0u48b`}],[`path`,{d:`m2.1 21.8 6.4-6.3`,key:`yn04lh`}],[`path`,{d:`m19 5-7 7`,key:`194lzd`}]]),JR=Q(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),YR=Q(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),XR=Q(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),ZR=Q(`waves`,[[`path`,{d:`M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`knzxuh`}],[`path`,{d:`M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`2jd2cc`}],[`path`,{d:`M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`rd2r6e`}]]),QR=Q(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),$R=Q(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),ez=Q(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]),tz=Q(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]);Q(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]);var nz=Q(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),rz=Q(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),iz=Q(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),az=Q(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),oz=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,sz=yj,cz=(e,t)=>n=>{if(t?.variants==null)return sz(e,n?.class,n?.className);let{variants:r,defaultVariants:a}=t,o=Object.keys(r).map(e=>{let t=n?.[e],o=a?.[e];if(t===null)return null;let s=oz(t)||oz(o);return r[e][s]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return sz(e,o,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},lz=cz(`inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-surface text-foreground hover:bg-surface-hover`,ghost:`hover:bg-surface-hover text-foreground-muted`,danger:`bg-danger text-white hover:bg-danger/90`,outline:`border border-border bg-transparent text-foreground hover:bg-surface-hover`},size:{sm:`h-7 px-2.5 text-xs gap-1.5`,md:`h-8 px-3 text-sm gap-2`,lg:`h-9 px-4 text-sm gap-2`}},defaultVariants:{variant:`primary`,size:`sm`}}),uz=(0,S.forwardRef)(({className:e,variant:t,size:n,...r},a)=>(0,C.jsx)(`button`,{ref:a,className:Z(lz({variant:t,size:n}),e),...r}));uz.displayName=`Button`;var dz=cz(`inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-surface text-foreground hover:bg-surface-hover`,ghost:`hover:bg-surface-hover text-foreground-muted`,danger:`bg-danger text-white hover:bg-danger/90`,outline:`border border-border bg-transparent hover:bg-surface-hover`},size:{sm:`h-7 w-7`,md:`h-8 w-8`,lg:`h-9 w-9`}},defaultVariants:{variant:`primary`,size:`sm`}}),fz=(0,S.forwardRef)(({className:e,variant:t,size:n,icon:r,...a},o)=>(0,C.jsx)(`button`,{ref:o,className:Z(dz({variant:t,size:n}),e),...a,children:(0,C.jsx)(r,{className:`h-4 w-4`})}));fz.displayName=`IconButton`;var pz=cz(`inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5`,{variants:{variant:{default:`bg-surface-hover text-foreground`,success:`bg-success/15 text-success`,warning:`bg-warning/15 text-warning`,danger:`bg-danger/15 text-danger`,info:`bg-info/15 text-info`},styleVariant:{solid:``,outline:`border bg-transparent`}},defaultVariants:{variant:`default`,styleVariant:`solid`}}),mz=(0,S.forwardRef)(({className:e,variant:t,style:n,...r},a)=>(0,C.jsx)(`span`,{ref:a,className:Z(pz({variant:t,styleVariant:n}),e),...r}));mz.displayName=`Badge`;var hz=cz(`rounded-lg p-3`,{variants:{variant:{flat:`bg-surface`,bordered:`bg-surface border border-border`}},defaultVariants:{variant:`bordered`}}),gz=(0,S.forwardRef)(({className:e,variant:t,...n},r)=>(0,C.jsx)(`div`,{ref:r,className:Z(hz({variant:t}),e),...n}));gz.displayName=`Card`;var _z=(0,S.forwardRef)(({className:e,...t},n)=>(0,C.jsx)(`label`,{ref:n,className:Z(`text-[10px] uppercase tracking-wider text-foreground-muted font-medium`,e),...t}));_z.displayName=`Label`;var vz=cz(``,{variants:{orientation:{horizontal:`h-px w-full bg-border-subtle`,vertical:`w-px h-full bg-border-subtle`}},defaultVariants:{orientation:`horizontal`}}),yz=(0,S.forwardRef)(({className:e,orientation:t,...n},r)=>(0,C.jsx)(`div`,{ref:r,role:`separator`,className:Z(vz({orientation:t}),e),...n}));yz.displayName=`Separator`;var bz=(0,S.forwardRef)(({className:e,...t},n)=>(0,C.jsx)(`div`,{ref:n,className:Z(`animate-pulse bg-surface-hover rounded-md h-4 w-full`,e),...t}));bz.displayName=`Skeleton`;var xz=cz(`h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors`,{variants:{state:{default:`border-border`,error:`border-danger`}},defaultVariants:{state:`default`}}),Sz=(0,S.forwardRef)(({className:e,state:t,leftSlot:n,rightSlot:r,...a},o)=>n||r?(0,C.jsxs)(`div`,{className:`relative flex items-center w-full`,children:[n&&(0,C.jsx)(`div`,{className:`absolute left-2.5 flex items-center pointer-events-none`,children:n}),(0,C.jsx)(`input`,{ref:o,className:Z(xz({state:t}),n?`pl-7`:``,r?`pr-7`:``,e),...a}),r&&(0,C.jsx)(`div`,{className:`absolute right-2.5 flex items-center pointer-events-none`,children:r})]}):(0,C.jsx)(`input`,{ref:o,className:Z(xz({state:t}),e),...a}));Sz.displayName=`Input`;var Cz=(0,S.forwardRef)(({className:e,options:t,...n},r)=>(0,C.jsxs)(`div`,{className:`relative w-full`,children:[(0,C.jsx)(`select`,{ref:r,className:Z(`h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary`,e),...n,children:t.map(e=>(0,C.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,C.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted`,children:(0,C.jsx)(xL,{className:`h-3.5 w-3.5`})})]}));Cz.displayName=`Select`;var wz=(0,S.forwardRef)(({className:e,...t},n)=>(0,C.jsx)(`input`,{ref:n,type:`checkbox`,className:Z(`w-3.5 h-3.5 rounded-sm border border-border accent-primary`,e),...t}));wz.displayName=`Checkbox`;var Tz=(0,S.forwardRef)(({className:e,checked:t,onCheckedChange:n,label:r,...a},o)=>(0,C.jsxs)(`button`,{ref:o,role:`switch`,"aria-checked":t,type:`button`,onClick:()=>n(!t),className:Z(`inline-flex items-center gap-2`,e),...a,children:[(0,C.jsx)(`span`,{className:Z(`w-8 h-4 rounded-full transition-colors`,t?`bg-primary`:`bg-surface-hover`),children:(0,C.jsx)(`span`,{className:Z(`block w-3.5 h-3.5 rounded-full bg-white transition-transform`,t?`translate-x-4`:`translate-x-0.5`)})}),r&&(0,C.jsx)(`span`,{className:`text-xs text-foreground`,children:r})]}));Tz.displayName=`Switch`;var Ez=(0,S.createContext)(null);function Dz(){let e=(0,S.useContext)(Ez);if(!e)throw Error(`Dialog compound components must be used within <Dialog>`);return e}function Oz({children:e,open:t,onOpenChange:n}){let[r,a]=(0,S.useState)(!1),o=t??r,s=(0,S.useId)(),c=(0,S.useCallback)(e=>{n?.(e),t===void 0&&a(e)},[t,n]);return(0,C.jsx)(Ez.Provider,{value:{open:o,setOpen:c,contentId:s},children:e})}var kz=cz(`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 m-0 w-[calc(100vw-2rem)] bg-background-elevated text-foreground border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-h-[calc(100dvh-2rem)] overflow-y-auto [&:not([open])]:hidden`,{variants:{width:{sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`},placement:{center:``,"sheet-on-mobile":`bottom-0 left-0 right-0 top-auto w-full max-w-full translate-x-0 translate-y-0 rounded-b-none max-h-[92dvh] md:left-1/2 md:top-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-lg md:bottom-auto md:max-h-[calc(100dvh-2rem)]`}},compoundVariants:[{placement:`sheet-on-mobile`,width:`sm`,class:`md:w-[calc(100vw-2rem)] md:max-w-sm`},{placement:`sheet-on-mobile`,width:`md`,class:`md:w-[calc(100vw-2rem)] md:max-w-md`},{placement:`sheet-on-mobile`,width:`lg`,class:`md:w-[calc(100vw-2rem)] md:max-w-lg`}],defaultVariants:{width:`md`,placement:`center`}}),Az=(0,S.forwardRef)(({className:e,width:t,placement:n,children:r,...a},o)=>{let{open:s,setOpen:c,contentId:l}=Dz(),u=(0,S.useRef)(null),d=o??u;return(0,S.useEffect)(()=>{let e=d.current;e&&(s&&!e.open&&e.showModal(),!s&&e.open&&e.close())},[s,d]),(0,C.jsx)(`dialog`,{ref:d,id:l,className:Z(kz({width:t,placement:n}),e),onClick:e=>{e.target===e.currentTarget&&c(!1)},onClose:()=>c(!1),...a,children:r})});Az.displayName=`DialogContent`;function jz({className:e,...t}){return(0,C.jsx)(`div`,{className:Z(`flex flex-col gap-1 mb-3`,e),...t})}function Mz({className:e,...t}){return(0,C.jsx)(`div`,{className:Z(`flex justify-end gap-2 mt-4`,e),...t})}function Nz({className:e,...t}){return(0,C.jsx)(`h2`,{className:Z(`text-sm font-semibold text-foreground`,e),...t})}function Pz({className:e,...t}){return(0,C.jsx)(`p`,{className:Z(`text-xs text-foreground-muted`,e),...t})}(0,S.createContext)(null),(0,S.createContext)(null),(0,S.createContext)(null),(0,S.createContext)(null);var Fz=(0,S.forwardRef)(({className:e,...t},n)=>(0,C.jsx)(`div`,{ref:n,className:Z(`overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full`,e),...t}));Fz.displayName=`ScrollArea`;var Iz=typeof globalThis<`u`?globalThis.__camstackTrpcReact:void 0,$=Iz??Hk();typeof globalThis<`u`&&!Iz&&(globalThis.__camstackTrpcReact=$);var Lz=aN(`camstack:system`,null);function Rz({system:e,children:t}){return(0,C.jsx)(Lz.Provider,{value:e,children:t})}function zz(){let e=(0,S.useContext)(Lz);if(!e)throw Error(`useSystem(): no <SystemProvider> in tree`);return e}function Bz(e,t){let n=zz(),r=(0,S.useRef)(t);r.current=t;let[a,o]=(0,S.useState)(n.connectionVersion);(0,S.useEffect)(()=>n.subscribeConnectionEvents((e,t)=>{e===`connected`&&o(t)}),[n]),(0,S.useEffect)(()=>n.subscribeEvent(e,e=>{r.current(e)}),[n,e,a])}aN(`camstack:confirm-dialog`,null);var Vz=`capability.binding-changed`;function Hz(e,t){let[n,r]=(0,S.useState)(null);return(0,S.useEffect)(()=>{if(t===null){r(null);return}let n=!1,a=async()=>{try{let a=await e.deviceManager.getBindings.query({deviceId:t});n||r(a)}catch{n||r(e=>e)}};a();let o=e.live?.onEvent.subscribe({category:Vz},{onData:e=>{let n=e.data?.source;if(!n){a();return}n.type===`device`&&n.id===t&&a()}});return()=>{n=!0,o?.unsubscribe()}},[e,t]),(0,S.useMemo)(()=>n?zs(e,n):null,[e,n])}function Uz(e){let t=(0,S.useCallback)(t=>e?e.subscribe(()=>t()):()=>void 0,[e]),n=(0,S.useCallback)(()=>e?.value,[e]);return(0,S.useSyncExternalStore)(t,n,n)}function Wz(e){let t=Hz(e.trpc,e.deviceId),n=Uz(t===null?void 0:e.slice(t)),r=t===null?void 0:e.cap(t),a=Uz(t===null?void 0:t.state.deviceStatus),o=a?.online??!0,s=o?null:a?.lastChangedAt??null;return{dev:t,cap:r,slice:n,available:(e.requireFeature===void 0||(e.deviceFeatures??[]).includes(e.requireFeature))&&r!==void 0&&n!==void 0&&o,online:o,offlineSince:s}}function Gz({value:e,unit:t,onDelta:n}){return(0,C.jsxs)(`div`,{className:`flex h-8 w-full overflow-hidden rounded-lg border border-border bg-surface`,children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":`Decrement`,className:`w-9 shrink-0 bg-surface-hover text-base text-foreground`,onClick:()=>n(-1),children:`−`}),(0,C.jsxs)(`span`,{className:`flex flex-1 items-center justify-center gap-0.5 border-x border-border/60 text-sm`,children:[e,t?(0,C.jsx)(`span`,{"data-unit":!0,className:`text-[11px] text-foreground-subtle`,children:t}):null]}),(0,C.jsx)(`button`,{type:`button`,"aria-label":`Increment`,className:`w-9 shrink-0 bg-surface-hover text-base text-foreground`,onClick:()=>n(1),children:`+`})]})}function Kz({on:e,targetLabel:t,onConfirm:n}){let r=(0,S.useRef)(null),a=(0,S.useRef)(!1);return(0,C.jsxs)(`div`,{className:Z(`relative h-12 w-full rounded-full border flex items-center`,e?`bg-emerald-50 border-emerald-200 pl-4`:`bg-amber-50 border-amber-200 justify-end pr-4`),children:[(0,C.jsx)(`span`,{className:`text-xs font-semibold opacity-60`,children:t}),(0,C.jsx)(`span`,{"data-testid":`slide-thumb`,className:`absolute top-1 left-1 h-10 w-14 rounded-[19px] bg-surface shadow flex items-center justify-center`,onPointerDown:e=>{e.currentTarget.setPointerCapture?.(e.pointerId),r.current=e.clientX,a.current=!1},onPointerMove:e=>{r.current!==null&&Math.abs(e.clientX-r.current)>40&&(a.current=!0)},onPointerUp:()=>{a.current&&n(),a.current=!1,r.current=null},onPointerCancel:()=>{a.current=!1,r.current=null}})]})}var qz=2,Jz=270,Yz=315;function Xz(e){let t=(e-135+360)%360;return t>Jz?+(t<=Yz):t/Jz}function Zz({fraction:e,color:t,knobTopPx:n,onDragFraction:r}){let a=-135+e*270,o=(0,S.useRef)(null),[s,c]=(0,S.useState)(!1),l=r!==void 0,u=n??qz,d=e=>{r!==void 0&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),c(!0))},f=e=>{if(r===void 0||!s)return;let t=o.current;if(t===null)return;let n=t.getBoundingClientRect(),a=n.left+n.width/2,c=n.top+n.height/2;r(Xz(Math.atan2(e.clientY-c,e.clientX-a)*180/Math.PI))},p=e=>{r!==void 0&&(e.currentTarget.releasePointerCapture?.(e.pointerId),c(!1))};return(0,C.jsx)(`div`,{ref:o,className:`absolute inset-0`,style:{transform:`rotate(${a}deg)`},children:(0,C.jsx)(`div`,{className:Z(`absolute left-1/2 h-5 w-5 -translate-x-1/2 rounded-full bg-white shadow`,l&&(s?`cursor-grabbing`:`cursor-grab`)),style:{top:u,border:`3px solid ${t}`},...l?{onPointerDown:d,onPointerMove:f,onPointerUp:p,onPointerCancel:p}:{}})})}function Qz({fraction:e,color:t}){return(0,C.jsxs)(`div`,{className:`relative h-2 w-full rounded-full bg-border`,children:[(0,C.jsx)(`div`,{className:`absolute left-0 top-0 h-2 rounded-full`,style:{width:`${e*100}%`,background:t??`var(--color-primary)`}}),(0,C.jsx)(`div`,{className:`absolute -top-1 h-4 w-4 rounded-full bg-white shadow`,style:{left:`calc(${e*100}% - 8px)`}})]})}function $z({trpc:e,deviceId:t}){let n=Hz(e,t),r=n===null?void 0:n.button;if(r===void 0)return null;let a=()=>{r.press({deviceId:t})};return(0,C.jsxs)(`button`,{type:`button`,"aria-label":`Press`,title:`Press`,onClick:e=>{e.stopPropagation(),a()},className:Z(`inline-flex h-5 items-center gap-1 rounded px-1.5 text-xs`,`bg-primary text-primary-foreground hover:bg-primary/90 transition-colors`),children:[(0,C.jsx)(uR,{className:`h-3 w-3`}),(0,C.jsx)(`span`,{children:`Press`})]})}function eB({trpc:e,deviceId:t}){let n=Hz(e,t),r=n===null?void 0:n.button;return r===void 0?null:(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-4 rounded-lg border border-border bg-surface p-6`,children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":`Press button`,onClick:()=>{r.press({deviceId:t})},className:Z(`inline-flex h-14 w-14 items-center justify-center rounded-full`,`bg-primary text-primary-foreground hover:bg-primary/90 transition-colors`,`shadow-md`),children:(0,C.jsx)(uR,{className:`h-6 w-6`})}),(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Press`})]})}var tB=4e3;function nB(e){if(e!==void 0)return typeof e==`object`&&e&&`lastChangedAt`in e&&typeof e.lastChangedAt==`number`?e.lastChangedAt:e}function rB(e,t){let n=t?.enabled!==!1,r=t?.timeoutMs??tB,[a,o]=(0,S.useState)(void 0),s=(0,S.useRef)(void 0),c=(0,S.useRef)(void 0),l=(0,S.useRef)(!1),u=(0,S.useRef)(void 0),d=(0,S.useCallback)(()=>{u.current!==void 0&&(clearTimeout(u.current),u.current=void 0),s.current=void 0,l.current=!1,c.current=void 0,o(void 0)},[]);(0,S.useEffect)(()=>{if(!n||!l.current)return;let t=nB(e),r=c.current;t!==void 0&&t!==r&&d()}),(0,S.useEffect)(()=>()=>{u.current!==void 0&&clearTimeout(u.current)},[]);let f=(0,S.useCallback)(t=>{if(!n)return;u.current!==void 0&&(clearTimeout(u.current),u.current=void 0);let a=s.current??e;if(a!==void 0){let e={...a,...t};s.current=e,o(e)}c.current=nB(e),l.current=!0,u.current=setTimeout(d,r)},[n,e,d,r]);return n?{display:a===void 0?e:a,applyOptimistic:f}:{display:e,applyOptimistic:()=>{}}}function iB(e){switch(e){case`opening`:return{up:`accent`,stop:`neutral`,down:`neutral`};case`closing`:return{up:`neutral`,stop:`neutral`,down:`accent`};case`open`:return{up:`filled`,stop:`neutral`,down:`neutral`};case`closed`:return{up:`neutral`,stop:`neutral`,down:`filled`};default:return{up:`neutral`,stop:`neutral`,down:`neutral`}}}function aB(e){switch(e){case`accent`:return`bg-primary text-primary-foreground`;case`filled`:return`bg-primary/15 text-primary`;case`neutral`:return``}}function oB({label:e,busy:t,variant:n,onClick:r,children:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),r()},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,aB(n),t&&`opacity-40 cursor-not-allowed`),children:a})}function sB({trpc:e,deviceId:t,optimistic:n}){let{cap:r,slice:a,available:o}=Wz({trpc:e,deviceId:t,cap:e=>e.cover,slice:e=>e.state.cover}),{display:s,applyOptimistic:c}=rB(a,{enabled:n??!0});if(r===void 0)return null;let l=iB(s?.state),u=!o,d=(e,t)=>{u||!e||(t!==void 0&&c(t),e({}))};return(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,C.jsx)(oB,{label:`Open`,busy:u,variant:l.up,onClick:()=>d(r?.open,{state:`opening`}),children:(0,C.jsx)(CL,{className:`h-3.5 w-3.5`})}),(0,C.jsx)(oB,{label:`Stop`,busy:u,variant:l.stop,onClick:()=>d(r?.stop,{state:`stopped`}),children:(0,C.jsx)(LR,{className:`h-3 w-3`})}),(0,C.jsx)(oB,{label:`Close`,busy:u,variant:l.down,onClick:()=>d(r?.close,{state:`closing`}),children:(0,C.jsx)(xL,{className:`h-3.5 w-3.5`})}),s!==void 0&&s.position!==null&&(0,C.jsxs)(`span`,{className:`tabular-nums text-xs text-foreground-subtle ml-1`,children:[s.position,`%`]})]})}function cB({label:e,busy:t,variant:n,onClick:r,children:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),r()},className:Z(`inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,n===`accent`&&`bg-primary text-primary-foreground hover:bg-primary/90`,n===`filled`&&`bg-primary/15 text-primary`,t&&`opacity-40 cursor-not-allowed`),children:a})}function lB(){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-y-0 left-1/2 w-px -translate-x-px bg-white/60`}),(0,C.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-x-0 top-1/2 h-px -translate-y-px bg-white/60`})]})}function uB({position:e,interactive:t,onSetPosition:n}){let r=(1-e/100)*100,a=(0,S.useRef)(null),o=(0,S.useRef)(!1),s=(0,S.useRef)(null),c=t=>{let n=a.current;if(n===null)return e;let r=n.getBoundingClientRect();if(r.height<=0)return e;let o=(t-r.top)/r.height,s=Math.round(100-o*100);return Math.min(100,Math.max(0,s))},l=e=>{if(n===void 0)return;let t=c(e);s.current!==t&&(s.current=t,n(t))},u=e=>{t&&(e.stopPropagation(),e.preventDefault(),o.current=!0,s.current=null,e.currentTarget.setPointerCapture(e.pointerId),l(e.clientY))},d=e=>{!t||!o.current||(e.stopPropagation(),l(e.clientY))},f=e=>{!t||!o.current||(e.stopPropagation(),o.current=!1,s.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,C.jsxs)(`div`,{ref:a,"data-testid":`cover-window`,...t?{"aria-label":`Drag to set position`,role:`slider`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e}:{"aria-hidden":`true`},onPointerDown:t?u:void 0,onPointerMove:t?d:void 0,onPointerUp:t?f:void 0,onPointerCancel:t?f:void 0,className:Z(`relative w-28 h-36 rounded border-2 border-amber-700/60 bg-gradient-to-b from-sky-200 to-sky-50 overflow-hidden flex-shrink-0`,t&&`cursor-ns-resize touch-none select-none`),style:{boxShadow:`inset 0 0 0 2px rgba(255,255,255,.5)`},children:[(0,C.jsx)(lB,{}),(0,C.jsx)(`div`,{className:`absolute inset-x-0 top-0 transition-all duration-200`,style:{height:`${r}%`,background:`repeating-linear-gradient(#c9cdd2, #c9cdd2 6px, #b7bcc2 6px, #b7bcc2 8px)`,borderBottom:r>0?`1px solid #9aa`:`none`}}),(0,C.jsxs)(`div`,{"data-testid":`cover-lever`,className:Z(`absolute inset-x-0 h-4 flex items-center justify-center gap-1 z-10 transition-all duration-200`,t&&`cursor-grab active:cursor-grabbing`),style:{top:`calc(${r}% - 8px)`},children:[(0,C.jsx)(`div`,{className:`absolute -inset-x-1.5 h-full rounded-lg bg-slate-600 shadow-md`}),(0,C.jsx)(`span`,{className:`h-1 w-1 rounded-full bg-white/70 relative z-10`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`h-1 w-1 rounded-full bg-white/70 relative z-10`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`h-1 w-1 rounded-full bg-white/70 relative z-10`,"aria-hidden":`true`}),(0,C.jsxs)(`span`,{"data-testid":`cover-position-pct`,className:`absolute left-full ml-2 text-xs font-semibold text-foreground tabular-nums whitespace-nowrap`,children:[e,`%`]})]})]})}function dB({isOpen:e}){return(0,C.jsxs)(`div`,{"data-testid":`cover-window`,"aria-hidden":`true`,className:`relative w-28 h-36 rounded border-2 border-amber-700/60 bg-gradient-to-b from-sky-200 to-sky-50 overflow-hidden flex-shrink-0`,style:{boxShadow:`inset 0 0 0 2px rgba(255,255,255,.5)`},children:[(0,C.jsx)(lB,{}),!e&&(0,C.jsx)(`div`,{className:`absolute inset-0`,style:{background:`repeating-linear-gradient(#c9cdd2, #c9cdd2 6px, #b7bcc2 6px, #b7bcc2 8px)`}})]})}function fB({trpc:e,deviceId:t,features:n,optimistic:r}){let{cap:a,slice:o,available:s}=Wz({trpc:e,deviceId:t,cap:e=>e.cover,slice:e=>e.state.cover}),{display:c,applyOptimistic:l}=rB(o,{enabled:r??!0});if(a===void 0)return null;let u=!s,d=(n??[]).includes(js.CoverPositionable),f=(n??[]).includes(js.CoverTilt),p=iB(c?.state),m=c?.position??null,h=m!==null,g=c?.state===`open`||c?.state===`opening`,_=(e,t)=>{u||!e||(t!==void 0&&l(t),e({}))},v=e=>{u||(l({position:e}),a?.setPosition({position:e}))};return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-6`,children:[h?(0,C.jsx)(uB,{position:m,interactive:d,onSetPosition:d?v:void 0}):(0,C.jsx)(dB,{isOpen:g}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[h&&(0,C.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums text-foreground`,children:m}),(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle`,children:`%`}),(0,C.jsx)(`span`,{className:`text-xs text-foreground-subtle ml-1`,children:`open`})]}),!h&&(0,C.jsx)(`div`,{className:`flex items-baseline gap-1`,children:(0,C.jsx)(`span`,{className:`text-3xl font-semibold capitalize text-foreground`,children:c?.state??`—`})}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(cB,{label:`Open`,busy:u,variant:p.up,onClick:()=>_(a?.open,{state:`opening`}),children:(0,C.jsx)(CL,{className:`h-5 w-5`})}),(0,C.jsx)(cB,{label:`Stop`,busy:u,variant:p.stop,onClick:()=>_(a?.stop,{state:`stopped`}),children:(0,C.jsx)(LR,{className:`h-4 w-4`})}),(0,C.jsx)(cB,{label:`Close`,busy:u,variant:p.down,onClick:()=>_(a?.close,{state:`closing`}),children:(0,C.jsx)(xL,{className:`h-5 w-5`})})]})]})]}),d&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:`w-12 shrink-0`,children:`Position`}),(0,C.jsx)(`input`,{"aria-label":`Position`,type:`range`,min:0,max:100,step:1,value:m??0,disabled:u,className:`flex-1`,onChange:e=>{v(Number(e.target.value))}}),(0,C.jsxs)(`span`,{className:`w-8 text-right tabular-nums`,children:[m??`—`,`%`]})]}),!d&&m!==null&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:`w-12 shrink-0`,children:`Position`}),(0,C.jsx)(`input`,{"aria-label":`Position`,type:`range`,min:0,max:100,step:1,value:m,disabled:!0,readOnly:!0,className:`flex-1 opacity-60`}),(0,C.jsxs)(`span`,{className:`w-8 text-right tabular-nums`,children:[m,`%`]})]}),f&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:`w-12 shrink-0`,children:`Tilt`}),(0,C.jsx)(`input`,{"aria-label":`Tilt position`,type:`range`,min:0,max:100,step:1,value:c?.tiltPosition??0,disabled:u,className:`flex-1`,onChange:e=>{let t=Number(e.target.value);l({tiltPosition:t}),u||a?.setTiltPosition({tiltPosition:t})}}),(0,C.jsxs)(`span`,{className:`w-8 text-right tabular-nums`,children:[c?.tiltPosition??`—`,`%`]})]})]})}function pB(e){return(0,C.jsx)(`span`,{className:`text-foreground-subtle text-xs select-none`,"aria-hidden":`true`,children:`—`})}function mB(e){return(0,C.jsx)(`div`,{className:`rounded border border-border bg-surface-subtle px-3 py-2 text-xs text-foreground-subtle`,children:`Controls coming soon`})}$.accessories.setChildHidden.useMutation,$.accessories.getStatus.useQuery,$.addonPages.listPages.useQuery,$.addons.list.useQuery,$.addons.getLogs.useQuery,$.addons.listPackages.useQuery,$.addons.installPackage.useMutation,$.addons.installFromWorkspace.useMutation,$.addons.isWorkspaceAvailable.useQuery,$.addons.listWorkspacePackages.useQuery,$.addons.uninstallPackage.useMutation,$.addons.reloadPackages.useMutation,$.addons.searchAvailable.useQuery,$.addons.listUpdates.useQuery,$.addons.updatePackage.useMutation,$.addons.rollbackPackage.useMutation,$.addons.forceRefresh.useMutation,$.addons.restartServer.useMutation,$.addons.getLastRestart.useQuery,$.addons.listFrameworkPackages.useQuery,$.addons.listCapabilityProviders.useQuery,$.addons.setCapabilityProviderEnabled.useMutation,$.addons.getVersions.useQuery,$.addons.restartAddon.useMutation,$.addons.retryLoad.useMutation,$.addons.getAutoUpdateSettings.useQuery,$.addons.setAutoUpdateSettings.useMutation,$.addons.getAddonAutoUpdate.useQuery,$.addons.setAddonAutoUpdate.useMutation,$.addons.applyAutoUpdateToAll.useMutation,$.addons.custom.useMutation,$.addons.startJob.useMutation,$.addons.getJob.useQuery,$.addons.listJobs.useQuery,$.addons.cancelJob.useMutation,$.addons.onAddonLogs.useSubscription,$.addonSettings.getGlobalSettings.useQuery,$.addonSettings.updateGlobalSettings.useMutation,$.addonSettings.getDeviceSettings.useQuery,$.addonSettings.updateDeviceSettings.useMutation,$.addonWidgets.listWidgets.useQuery,$.airQualitySensor.getStatus.useQuery,$.alarmPanel.arm.useMutation,$.alarmPanel.disarm.useMutation,$.alarmPanel.trigger.useMutation,$.alarmPanel.getStatus.useQuery,$.alerts.emit.useMutation,$.alerts.update.useMutation,$.alerts.list.useQuery,$.alerts.getUnreadCount.useQuery,$.alerts.markRead.useMutation,$.alerts.markAllRead.useMutation,$.alerts.dismiss.useMutation,$.ambientLightSensor.getStatus.useQuery,$.audioAnalysis.resolveDeviceSettings.useQuery,$.audioAnalysis.getDeviceSettingsContribution.useQuery,$.audioAnalysis.getDeviceLiveContribution.useQuery,$.audioAnalysis.applyDeviceSettingsPatch.useMutation,$.audioAnalyzer.analyseChunk.useMutation,$.audioAnalyzer.classify.useQuery,$.audioAnalyzer.isReady.useQuery,$.audioAnalyzer.dispose.useMutation,$.audioAnalyzer.reprobeAudioEngine.useMutation,$.audioCodec.listSupportedCodecs.useQuery,$.audioCodec.canHandle.useQuery,$.audioCodec.createDecodeSession.useMutation,$.audioCodec.createEncodeSession.useMutation,$.audioCodec.closeSession.useMutation,$.audioCodec.pushEncodedFrame.useMutation,$.audioCodec.pullPcm.useQuery,$.audioCodec.pushPcm.useMutation,$.audioCodec.pullEncoded.useQuery,$.audioCodec.flushEncode.useMutation,$.audioCodec.listActiveSessions.useQuery,$.audioMetrics.getCurrentSnapshot.useQuery,$.audioMetrics.getHistory.useQuery,$.automationControl.enable.useMutation,$.automationControl.disable.useMutation,$.automationControl.trigger.useMutation,$.automationControl.getStatus.useQuery,$.backup.listDestinations.useQuery,$.backup.trigger.useMutation,$.backup.list.useQuery,$.backup.listLocations.useQuery,$.backup.getEntries.useQuery,$.backup.restore.useMutation,$.backup.delete.useMutation,$.backup.listArchives.useQuery,$.backup.upsertDestinationPolicy.useMutation,$.backup.previewSchedule.useQuery,$.backup.listSchedules.useQuery,$.backup.upsertSchedule.useMutation,$.backup.deleteSchedule.useMutation,$.battery.wakeForStream.useMutation,$.battery.getStatus.useQuery,$.binary.getStatus.useQuery,$.brightness.setBrightness.useMutation,$.brightness.getStatus.useQuery,$.broker.list.useQuery,$.broker.get.useQuery,$.broker.listProviders.useQuery,$.broker.add.useMutation,$.broker.remove.useMutation,$.broker.testConnection.useMutation,$.broker.getSettings.useQuery,$.broker.setSettings.useMutation,$.broker.getBrokerConfig.useQuery,$.broker.getSettingsSchema.useQuery,$.broker.testSettings.useMutation,$.broker.publish.useMutation,$.broker.subscribe.useMutation,$.broker.unsubscribe.useMutation,$.broker.getState.useQuery,$.broker.getStatus.useQuery,$.button.press.useMutation,$.cameraCredentials.getCredentials.useQuery,$.cameraCredentials.getStatus.useQuery,$.cameraPipelineConfig.getDeviceSettingsContribution.useQuery,$.cameraPipelineConfig.getDeviceLiveContribution.useQuery,$.cameraPipelineConfig.applyDeviceSettingsPatch.useMutation,$.cameraStreams.getCameraStreams.useQuery,$.cameraStreams.getBrokerStreams.useQuery,$.cameraStreams.getRtspEntries.useQuery,$.cameraStreams.getProfileRtspEntries.useQuery,$.cameraStreams.pickStream.useQuery,$.carbonMonoxide.getStatus.useQuery,$.climateControl.setMode.useMutation,$.climateControl.setFanMode.useMutation,$.climateControl.setPreset.useMutation,$.climateControl.setTarget.useMutation,$.climateControl.setTargetRange.useMutation,$.climateControl.setTargetHumidity.useMutation,$.climateControl.setSwingVertical.useMutation,$.climateControl.setSwingHorizontal.useMutation,$.climateControl.getStatus.useQuery,$.color.setColor.useMutation,$.color.getStatus.useQuery,$.connectivity.getStatus.useQuery,$.consumables.reset.useMutation,$.consumables.getStatus.useQuery,$.contact.getStatus.useQuery,$.control.setValue.useMutation,$.control.getStatus.useQuery,$.cover.open.useMutation,$.cover.close.useMutation,$.cover.stop.useMutation,$.cover.setPosition.useMutation,$.cover.setTiltPosition.useMutation,$.cover.getStatus.useQuery,$.dayNight.getOptions.useQuery,$.dayNight.setSettings.useMutation,$.dayNight.getStatus.useQuery,$.decoder.supportsCodec.useQuery,$.decoder.getInfo.useQuery,$.decoder.createSession.useQuery,$.decoder.destroySession.useQuery,$.decoder.pushPacket.useQuery,$.decoder.openStream.useQuery,$.decoder.pullFrames.useQuery,$.decoder.pullHandles.useQuery,$.decoder.getFrame.useQuery,$.decoder.getShmStats.useQuery,$.decoder.updateConfig.useQuery,$.decoder.getStats.useQuery,$.decoder.listActiveSessions.useQuery,$.decoder.reprobeHwaccel.useMutation,$.detectionPipeline.getDeviceSettingsContribution.useQuery,$.detectionPipeline.getDeviceLiveContribution.useQuery,$.detectionPipeline.applyDeviceSettingsPatch.useMutation,$.deviceAdoption.listCandidateFilters.useQuery,$.deviceAdoption.listCandidates.useQuery,$.deviceAdoption.getCandidate.useQuery,$.deviceAdoption.refresh.useMutation,$.deviceAdoption.adopt.useMutation,$.deviceAdoption.release.useMutation,$.deviceAdoption.resync.useMutation,$.deviceAdoption.getStatus.useQuery,$.deviceDiscovery.listDiscovered.useQuery,$.deviceDiscovery.refreshDiscovery.useMutation,$.deviceDiscovery.adoptDevice.useMutation,$.deviceDiscovery.releaseDevice.useMutation,$.deviceDiscovery.getStatus.useQuery,$.deviceExport.getStatus.useQuery,$.deviceExport.listSupportedDeviceKinds.useQuery,$.deviceExport.listExposedDevices.useQuery,$.deviceExport.exposeDevice.useMutation,$.deviceExport.unexposeDevice.useMutation,$.deviceExport.getDeviceSettingsContribution.useQuery,$.deviceExport.getDeviceLiveContribution.useQuery,$.deviceExport.applyDeviceSettingsPatch.useMutation,$.deviceManager.allocateDeviceId.useMutation,$.deviceManager.registerDevice.useMutation,$.deviceManager.removeDevice.useMutation,$.deviceManager.persistConfig.useMutation,$.deviceManager.loadConfig.useQuery,$.deviceManager.loadRuntimeState.useQuery,$.deviceManager.loadMeta.useQuery,$.deviceManager.setName.useMutation,$.deviceManager.setLocation.useMutation,$.deviceManager.setType.useMutation,$.deviceManager.setIntegrationId.useMutation,$.deviceManager.setLinkDeviceId.useMutation,$.deviceManager.setPrimaryChildEntityId.useMutation,$.deviceManager.setChildLayout.useMutation,$.deviceManager.setDeviceLinks.useMutation,$.deviceManager.setDisplay.useMutation;var hB=$.deviceManager.getRoleDisplayDefaults.useQuery;$.deviceManager.setRoleDisplayDefaults.useMutation,$.deviceManager.getWireableFields.useQuery,$.deviceManager.setRole.useMutation,$.deviceManager.applyInitialMeta.useMutation,$.deviceManager.setMetadata.useMutation,$.deviceManager.listLocations.useQuery,$.deviceManager.addLocation.useMutation,$.deviceManager.removeLocation.useMutation,$.deviceManager.setDisabled.useMutation,$.deviceManager.listPersistedByAddon.useQuery,$.deviceManager.listAll.useQuery;var gB=$.deviceManager.getDevice.useQuery;$.deviceManager.getChildren.useQuery,$.deviceManager.getLinkedDevices.useQuery,$.deviceManager.getStreamSources.useQuery,$.deviceManager.getConfigSchema.useQuery,$.deviceManager.getSettingsSchema.useQuery,$.deviceManager.updateConfig.useMutation,$.deviceManager.enable.useMutation,$.deviceManager.disable.useMutation,$.deviceManager.remove.useMutation,$.deviceManager.removeByIntegration.useMutation,$.deviceManager.getStreamProfileMap.useQuery,$.deviceManager.setStreamProfileMap.useMutation,$.deviceManager.probeStreams.useMutation,$.deviceManager.getBindings.useQuery,$.deviceManager.getAllBindings.useQuery,$.deviceManager.setWrapperActive.useMutation,$.deviceManager.listWrappersForCap.useQuery,$.deviceManager.listBindableCapsForDeviceType.useQuery,$.deviceManager.getDeviceSettingsAggregate.useQuery,$.deviceManager.getDeviceLiveInfoAggregate.useQuery,$.deviceManager.getDeviceAggregate.useQuery,$.deviceManager.runDeviceAction.useMutation,$.deviceManager.updateDeviceField.useMutation,$.deviceManager.updateDeviceFieldsBatch.useMutation,$.deviceManager.discoverDevices.useMutation,$.deviceManager.adoptDevice.useMutation,$.deviceManager.getCreationSchema.useQuery,$.deviceManager.createDevice.useMutation,$.deviceManager.testCreationField.useMutation,$.deviceManager.adoptionListCandidateFilters.useQuery,$.deviceManager.adoptionListCandidates.useQuery,$.deviceManager.adoptionRefresh.useMutation,$.deviceManager.adoptionAdopt.useMutation,$.deviceManager.adoptionRelease.useMutation,$.deviceManager.adoptionResync.useMutation,$.deviceManager.discoveryProviders.useQuery,$.deviceManager.discoverAllProviders.useMutation,$.deviceManager.discoverProvider.useMutation,$.deviceManager.providerCreationType.useQuery,$.deviceManager.providerDiscoveryParamsSchema.useQuery,$.deviceManager.testField.useMutation,$.deviceManager.getDeviceStatusAggregate.useQuery,$.deviceManager.getDeviceStatusAggregateBatch.useQuery,$.deviceManager.getDeviceSettingsContribution.useQuery,$.deviceManager.getDeviceLiveContribution.useQuery,$.deviceManager.applyDeviceSettingsPatch.useMutation,$.deviceOps.getStreamSources.useQuery,$.deviceOps.getConfigEntries.useQuery,$.deviceOps.setConfig.useMutation,$.deviceOps.runAction.useMutation,$.deviceOps.removeDevice.useMutation,$.deviceOps.getSettingsSchema.useQuery,$.deviceOps.getRawState.useQuery,$.deviceProvider.start.useMutation,$.deviceProvider.stop.useMutation,$.deviceProvider.getStatus.useQuery,$.deviceProvider.getDevices.useQuery,$.deviceProvider.supportsDiscovery.useQuery,$.deviceProvider.discoverDevices.useMutation,$.deviceProvider.getDiscoveryParamsSchema.useQuery,$.deviceProvider.getManualCreationType.useQuery,$.deviceProvider.adoptDiscoveredDevice.useMutation,$.deviceProvider.supportsManualCreation.useQuery,$.deviceProvider.getChildCreationSchema.useQuery,$.deviceProvider.createDevice.useMutation,$.deviceProvider.testCreationField.useMutation,$.deviceState.getSnapshot.useQuery,$.deviceState.getCapSlice.useQuery,$.deviceState.getAllSnapshots.useQuery,$.deviceState.setCapSlice.useMutation,$.deviceStatus.getStatus.useQuery,$.doorbell.getStatus.useQuery,$.doorbell.getDeviceSettingsContribution.useQuery,$.doorbell.getDeviceLiveContribution.useQuery,$.doorbell.applyDeviceSettingsPatch.useMutation,$.enumSensor.getStatus.useQuery,$.eventEmitter.getStatus.useQuery,$.events.getEvents.useQuery,$.events.getEventThumbnail.useQuery,$.events.getEventClipUrl.useQuery,$.faceGallery.listIdentities.useQuery,$.faceGallery.createIdentity.useMutation,$.faceGallery.renameIdentity.useMutation,$.faceGallery.deleteIdentity.useMutation,$.faceGallery.listIdentitySamples.useQuery,$.faceGallery.removeSample.useMutation,$.faceGallery.listRecentFaces.useQuery,$.faceGallery.getFaceByTrack.useQuery,$.faceGallery.getFaceMedia.useQuery,$.faceGallery.assignFace.useMutation,$.faceGallery.unassignFace.useMutation,$.faceGallery.deleteFace.useMutation,$.faceGallery.assignFaces.useMutation,$.faceGallery.unassignFaces.useMutation,$.faceGallery.suggestFaceClusters.useQuery,$.fanControl.setPercentage.useMutation,$.fanControl.setPreset.useMutation,$.fanControl.setDirection.useMutation,$.fanControl.setOscillating.useMutation,$.fanControl.getStatus.useQuery,$.featureProbe.getStatus.useQuery,$.flood.getStatus.useQuery,$.gas.getStatus.useQuery,$.humidifier.setOn.useMutation,$.humidifier.setTargetHumidity.useMutation,$.humidifier.setMode.useMutation,$.humidifier.getStatus.useQuery,$.humiditySensor.getStatus.useQuery,$.image.getStatus.useQuery,$.imageSettings.getOptions.useQuery,$.imageSettings.setSettings.useMutation,$.imageSettings.getStatus.useQuery,$.integrations.list.useQuery,$.integrations.get.useQuery,$.integrations.getByAddonId.useQuery,$.integrations.create.useMutation,$.integrations.update.useMutation,$.integrations.delete.useMutation,$.integrations.getSettings.useQuery,$.integrations.setSettings.useMutation,$.integrations.getAvailableTypes.useQuery,$.integrations.testConnection.useMutation;var _B=$.intercom.startSession.useMutation,vB=$.intercom.handleAnswer.useMutation,yB=$.intercom.stopSession.useMutation;$.intercom.startTalkSession.useMutation,$.intercom.pushTalkAudio.useMutation,$.intercom.endTalkSession.useMutation,$.intercom.getStatus.useQuery,$.lawnMowerControl.startMowing.useMutation,$.lawnMowerControl.pause.useMutation,$.lawnMowerControl.dock.useMutation,$.lawnMowerControl.getStatus.useQuery,$.llm.generate.useMutation,$.llm.generateVision.useMutation,$.llm.listProfileKinds.useQuery,$.llm.listProfiles.useQuery,$.llm.upsertProfile.useMutation,$.llm.deleteProfile.useMutation,$.llm.testProfile.useMutation,$.llm.listModels.useQuery,$.llm.getDefaults.useQuery,$.llm.setDefault.useMutation,$.llm.getUsage.useQuery,$.llm.listModelCatalog.useQuery,$.llm.listRuntimeNodes.useQuery,$.llm.listNodeModels.useQuery,$.llm.installModel.useMutation,$.llm.deleteModel.useMutation,$.llm.getRuntimeStatus.useQuery,$.llm.startRuntime.useMutation,$.llm.stopRuntime.useMutation,$.localNetwork.list.useQuery,$.localNetwork.getPreferred.useQuery,$.localNetwork.getConnectionEndpoints.useQuery,$.localNetwork.getNotificationEndpoint.useQuery,$.localNetwork.setNotificationEndpoint.useMutation,$.localNetwork.getAllowedAddresses.useQuery,$.localNetwork.setAllowedAddresses.useMutation,$.localNetwork.resetAllowlistToBestMatch.useMutation,$.lockControl.lock.useMutation,$.lockControl.unlock.useMutation,$.lockControl.open.useMutation,$.lockControl.getStatus.useQuery,$.mediaPlayer.play.useMutation,$.mediaPlayer.pause.useMutation,$.mediaPlayer.stop.useMutation,$.mediaPlayer.next.useMutation,$.mediaPlayer.previous.useMutation,$.mediaPlayer.seek.useMutation,$.mediaPlayer.setVolume.useMutation,$.mediaPlayer.setMute.useMutation,$.mediaPlayer.setShuffle.useMutation,$.mediaPlayer.setRepeat.useMutation,$.mediaPlayer.selectSource.useMutation,$.mediaPlayer.playMedia.useMutation,$.mediaPlayer.getStatus.useQuery,$.meshNetwork.getStatus.useQuery,$.meshNetwork.join.useMutation,$.meshNetwork.startLogin.useMutation,$.meshNetwork.leave.useMutation,$.meshNetwork.logout.useMutation,$.meshNetwork.listPeers.useQuery,$.meshNetwork.testConnection.useMutation,$.metricsProvider.collectSnapshot.useQuery,$.metricsProvider.getCached.useQuery,$.metricsProvider.getCurrent.useQuery,$.metricsProvider.getDiskSpace.useQuery,$.metricsProvider.getGpuInfo.useQuery,$.metricsProvider.getCpuTemperature.useQuery,$.metricsProvider.getProcessStats.useQuery,$.metricsProvider.listAddonInstances.useQuery,$.metricsProvider.getAddonStats.useQuery,$.metricsProvider.listNodeProcesses.useQuery,$.metricsProvider.killProcess.useMutation,$.metricsProvider.dumpHeapSnapshot.useMutation,$.motion.isDetected.useQuery,$.motion.getStatus.useQuery,$.motionDetection.analyze.useMutation,$.motionDetection.removeCamera.useMutation,$.motionDetection.reset.useMutation,$.motionDetection.getDeviceSettingsContribution.useQuery,$.motionDetection.getDeviceLiveContribution.useQuery,$.motionDetection.applyDeviceSettingsPatch.useMutation,$.motionTrigger.setMotionTrigger.useMutation,$.motionTrigger.getStatus.useQuery,$.motionZones.getOptions.useQuery,$.motionZones.setZone.useMutation,$.motionZones.getStatus.useQuery,$.mqttBroker.listBrokers.useQuery,$.mqttBroker.getBrokerConfig.useQuery,$.mqttBroker.addBroker.useMutation,$.mqttBroker.removeBroker.useMutation,$.mqttBroker.testConnection.useMutation,$.mqttBroker.startEmbeddedBroker.useMutation,$.mqttBroker.stopEmbeddedBroker.useMutation,$.mqttBroker.getStatus.useQuery,$.nativeObjectDetection.setEnabled.useMutation,$.nativeObjectDetection.getStatus.useQuery,$.networkAccess.start.useMutation,$.networkAccess.stop.useMutation,$.networkAccess.getEndpoint.useQuery,$.networkAccess.getStatus.useQuery,$.networkAccess.listEndpoints.useQuery,$.networkQuality.getDeviceStats.useQuery,$.networkQuality.getAllStats.useQuery,$.networkQuality.reportClientStats.useMutation,$.nodes.topology.useQuery,$.nodes.deployAddon.useMutation,$.nodes.undeployAddon.useMutation,$.nodes.restartAddon.useMutation,$.nodes.restartProcess.useMutation,$.nodes.restartNode.useMutation,$.nodes.shutdownNode.useMutation,$.nodes.renameNode.useMutation,$.nodes.clusterAddonStatus.useQuery,$.nodes.getCapUsageGraph.useQuery,$.nodes.getNodeAddons.useQuery,$.nodes.setProcessLogLevel.useMutation,$.nodes.executeQuery.useMutation,$.notificationOutput.listTargetKinds.useQuery,$.notificationOutput.listTargets.useQuery,$.notificationOutput.discoverTargets.useQuery,$.notificationOutput.send.useMutation,$.notificationOutput.testTarget.useMutation,$.notificationOutput.upsertTarget.useMutation,$.notificationOutput.deleteTarget.useMutation,$.notificationOutput.setTargetEnabled.useMutation,$.notificationRules.listRules.useQuery,$.notificationRules.getRule.useQuery,$.notificationRules.createRule.useMutation,$.notificationRules.updateRule.useMutation,$.notificationRules.deleteRule.useMutation,$.notificationRules.setRuleEnabled.useMutation,$.notificationRules.testRule.useMutation,$.notificationRules.getConditionCatalog.useQuery,$.notificationRules.getHistory.useQuery,$.notifier.send.useMutation,$.notifier.cancel.useMutation,$.notifier.getStatus.useQuery,$.numericSensor.getStatus.useQuery,$.osd.setOverlay.useMutation,$.osd.getStatus.useQuery,$.petFeeder.feed.useMutation,$.petFeeder.cancelFeed.useMutation,$.petFeeder.resetDesiccant.useMutation,$.petFeeder.markFoodReplenished.useMutation,$.petFeeder.callPet.useMutation,$.petFeeder.playSound.useMutation,$.petFeeder.setChildLock.useMutation,$.petFeeder.setIndicatorLight.useMutation,$.petFeeder.setFeedSound.useMutation,$.petFeeder.setVolume.useMutation,$.petFeeder.getStatus.useQuery,$.pipelineAnalytics.getActiveTracks.useQuery,$.pipelineAnalytics.getTrack.useQuery,$.pipelineAnalytics.listTracks.useQuery,$.pipelineAnalytics.listRecentTracks.useQuery,$.pipelineAnalytics.clearTracks.useMutation,$.pipelineAnalytics.getMotionEvents.useQuery,$.pipelineAnalytics.getObjectEvents.useQuery,$.pipelineAnalytics.getAudioEvents.useQuery,$.pipelineAnalytics.listEventKinds.useQuery,$.pipelineAnalytics.getSensorEvents.useQuery,$.pipelineAnalytics.getKeyEvents.useQuery,$.pipelineAnalytics.getEventDensity.useQuery,$.pipelineAnalytics.pruneEventsBefore.useMutation,$.pipelineAnalytics.pruneTracksBefore.useMutation,$.pipelineAnalytics.wipeAllAnalytics.useMutation,$.pipelineAnalytics.deleteTracks.useMutation,$.pipelineAnalytics.getEventStoreFootprint.useQuery,$.pipelineAnalytics.pruneEvents.useMutation,$.pipelineAnalytics.deleteDeviceEvents.useMutation,$.pipelineAnalytics.relocateMedia.useMutation,$.pipelineAnalytics.getMediaRelocateStatus.useQuery,$.pipelineAnalytics.cancelMediaRelocate.useMutation,$.pipelineAnalytics.listOpsLog.useQuery,$.pipelineAnalytics.getEventMedia.useQuery,$.pipelineAnalytics.getTrackMedia.useQuery,$.pipelineAnalytics.searchObjectEvents.useQuery,$.pipelineAnalytics.getDeviceSettingsContribution.useQuery,$.pipelineAnalytics.getDeviceLiveContribution.useQuery,$.pipelineAnalytics.applyDeviceSettingsPatch.useMutation,$.pipelineExecutor.getAvailableEngines.useQuery,$.pipelineExecutor.getSelectedEngine.useQuery,$.pipelineExecutor.getDefaultSteps.useQuery,$.pipelineExecutor.getEngineProvisioning.useQuery,$.pipelineExecutor.getVideoPipelineSteps.useQuery,$.pipelineExecutor.setVideoPipelineSteps.useMutation,$.pipelineExecutor.clearDeviceOverrides.useMutation,$.pipelineExecutor.getSchema.useQuery,$.pipelineExecutor.getGlobalSteps.useQuery,$.pipelineExecutor.getGlobalPipelineConfig.useQuery,$.pipelineExecutor.getOrchestratorConfigSchema.useQuery,$.pipelineExecutor.validatePipeline.useQuery,$.pipelineExecutor.listTemplates.useQuery,$.pipelineExecutor.saveTemplate.useMutation,$.pipelineExecutor.updateTemplate.useMutation,$.pipelineExecutor.deleteTemplate.useMutation,$.pipelineExecutor.getCapabilities.useQuery,$.pipelineExecutor.getAddonModels.useQuery,$.pipelineExecutor.downloadModel.useMutation,$.pipelineExecutor.deleteModel.useMutation,$.pipelineExecutor.runPipeline.useMutation,$.pipelineExecutor.runPipelineBatch.useMutation,$.pipelineExecutor.cacheFrameInPool.useMutation,$.pipelineExecutor.inferCached.useMutation,$.pipelineExecutor.uncacheFrame.useMutation,$.pipelineExecutor.getEffectiveTuning.useQuery,$.pipelineExecutor.listLoadedEngines.useQuery,$.pipelineExecutor.spinEngine.useMutation,$.pipelineExecutor.killEngine.useMutation,$.pipelineExecutor.listReferenceImages.useQuery,$.pipelineExecutor.getReferenceImage.useQuery,$.pipelineExecutor.getReferenceAudioFiles.useQuery,$.pipelineExecutor.getReferenceAudio.useQuery,$.pipelineExecutor.getAudioCapabilities.useQuery,$.pipelineExecutor.runAudioTest.useMutation,$.pipelineExecutor.getDetectionConfigSchema.useQuery,$.pipelineOrchestrator.assignPipeline.useMutation,$.pipelineOrchestrator.unassignPipeline.useMutation,$.pipelineOrchestrator.setPipelineDevicePin.useMutation,$.pipelineOrchestrator.getPipelineDevicePin.useQuery,$.pipelineOrchestrator.rebalance.useMutation,$.pipelineOrchestrator.getPipelineAssignments.useQuery,$.pipelineOrchestrator.getPipelineAssignment.useQuery,$.pipelineOrchestrator.getAgentLoad.useQuery,$.pipelineOrchestrator.getGlobalMetrics.useQuery,$.pipelineOrchestrator.getCameraMetrics.useQuery,$.pipelineOrchestrator.getCapabilityBindings.useQuery,$.pipelineOrchestrator.setCapabilityBinding.useMutation,$.pipelineOrchestrator.getIngestOwner.useQuery,$.pipelineOrchestrator.assignAudio.useMutation,$.pipelineOrchestrator.unassignAudio.useMutation,$.pipelineOrchestrator.getAudioAssignment.useQuery,$.pipelineOrchestrator.getAudioNodeLoad.useQuery,$.pipelineOrchestrator.getAudioAssignments.useQuery,$.pipelineOrchestrator.getAgentSettings.useQuery,$.pipelineOrchestrator.listAgentSettings.useQuery,$.pipelineOrchestrator.removeAgentSettings.useMutation,$.pipelineOrchestrator.setAgentMaxCameras.useMutation,$.pipelineOrchestrator.setAgentDetectWeight.useMutation,$.pipelineOrchestrator.setAgentCapabilities.useMutation,$.pipelineOrchestrator.setAgentReachableHost.useMutation,$.pipelineOrchestrator.setAgentInferenceDevices.useMutation,$.pipelineOrchestrator.getNodeInferenceDevices.useQuery,$.pipelineOrchestrator.resetNodePipelineDefaults.useMutation,$.pipelineOrchestrator.getCameraSettings.useQuery,$.pipelineOrchestrator.setCameraStepToggle.useMutation,$.pipelineOrchestrator.getCameraStepOverrides.useQuery,$.pipelineOrchestrator.setCameraStepOverride.useMutation,$.pipelineOrchestrator.setCameraPipelineForAgent.useMutation,$.pipelineOrchestrator.resolvePipeline.useQuery,$.pipelineOrchestrator.getCameraStatus.useQuery,$.pipelineOrchestrator.getCameraStatuses.useQuery,$.pipelineOrchestrator.listTemplates.useQuery,$.pipelineOrchestrator.saveTemplate.useMutation,$.pipelineOrchestrator.updateTemplate.useMutation,$.pipelineOrchestrator.deleteTemplate.useMutation,$.pipelineOrchestrator.getDeviceSettingsContribution.useQuery,$.pipelineOrchestrator.getDeviceLiveContribution.useQuery,$.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation,$.pipelineRunner.attachCamera.useMutation,$.pipelineRunner.detachCamera.useMutation,$.pipelineRunner.reportMotion.useMutation,$.pipelineRunner.getLocalLoad.useQuery,$.pipelineRunner.getLocalMetrics.useQuery,$.pipelineRunner.getCameraMetrics.useQuery,$.pipelineRunner.getAllCameraMetrics.useQuery,$.pipelineRunner.getLocalCameras.useQuery,$.pipelineRunner.getNativeCrop.useQuery,$.pipelineRunner.runDetailSubtree.useMutation,$.plateGallery.listPlates.useQuery,$.plateGallery.getPlateByTrack.useQuery,$.plateGallery.getPlateMedia.useQuery,$.plateGallery.searchPlates.useQuery,$.plateGallery.suggestPlateClusters.useQuery,$.plateGallery.correctPlateText.useMutation,$.plateGallery.deletePlate.useMutation,$.plateGallery.listVehicles.useQuery,$.plateGallery.createVehicle.useMutation,$.plateGallery.renameVehicle.useMutation,$.plateGallery.deleteVehicle.useMutation,$.plateGallery.listVehicleSamples.useQuery,$.plateGallery.removeVehicleSample.useMutation,$.plateGallery.assignPlate.useMutation,$.plateGallery.unassignPlate.useMutation,$.plateGallery.assignPlates.useMutation,$.plateGallery.unassignPlates.useMutation,$.powerMeter.getStatus.useQuery,$.presence.getStatus.useQuery,$.pressureSensor.getStatus.useQuery,$.privacyMask.getOptions.useQuery,$.privacyMask.setMask.useMutation,$.privacyMask.getStatus.useQuery,$.ptz.move.useMutation,$.ptz.continuousMove.useMutation,$.ptz.stop.useMutation,$.ptz.getPresets.useQuery,$.ptz.goToPreset.useMutation,$.ptz.savePreset.useMutation,$.ptz.deletePreset.useMutation,$.ptz.getOptions.useQuery,$.ptz.goHome.useMutation,$.ptz.getPosition.useQuery,$.ptz.setAutofocus.useMutation,$.ptz.getStatus.useQuery,$.ptzAutotrack.getStatus.useQuery,$.ptzAutotrack.setEnabled.useMutation,$.ptzAutotrack.getSettings.useQuery,$.ptzAutotrack.setSettings.useMutation,$.reboot.reboot.useMutation,$.recording.getAvailability.useQuery,$.recording.getDaysWithRecordings.useQuery,$.recording.getPlaybackManifest.useQuery,$.recording.getStorageUsage.useQuery,$.recording.getDeviceConfig.useQuery,$.recording.locateSegment.useQuery,$.recording.readSegmentBytes.useQuery,$.recording.setDeviceConfig.useMutation,$.recording.rescanStorage.useMutation,$.recording.pruneFootage.useMutation,$.recording.deleteFootprint.useMutation,$.recording.listOpsLog.useQuery,$.recording.renderGif.useMutation,$.recording.renderClip.useMutation,$.recording.relocateFootage.useMutation,$.recording.getRelocateStatus.useQuery,$.recording.cancelRelocate.useMutation,$.recording.getStatus.useQuery,$.recording.getDeviceSettingsContribution.useQuery,$.recording.getDeviceLiveContribution.useQuery,$.recording.applyDeviceSettingsPatch.useMutation,$.recordingExport.createExport.useMutation,$.recordingExport.listExports.useQuery,$.recordingExport.getExport.useQuery,$.recordingExport.cancelExport.useMutation,$.recordingExport.deleteExport.useMutation,$.recordingExport.getDownloadUrl.useQuery,$.sceneMonitor.listScenes.useQuery,$.sceneMonitor.createScene.useMutation,$.sceneMonitor.updateScene.useMutation,$.sceneMonitor.deleteScene.useMutation,$.sceneMonitor.captureReference.useMutation,$.sceneMonitor.deleteReference.useMutation,$.sceneMonitor.recheckNow.useMutation,$.sceneMonitor.getStatus.useQuery,$.scriptRunner.run.useMutation,$.scriptRunner.stop.useMutation,$.scriptRunner.getStatus.useQuery,$.serverManagement.getServerPackageStatus.useQuery,$.serverManagement.checkServerUpdate.useMutation,$.serverManagement.applyServerUpdate.useMutation,$.serverManagement.rollbackServerUpdate.useMutation,$.serverManagement.restartServer.useMutation,$.settingsStore.get.useQuery,$.settingsStore.set.useMutation,$.settingsStore.query.useQuery,$.settingsStore.insert.useMutation,$.settingsStore.update.useMutation,$.settingsStore.delete.useMutation,$.settingsStore.count.useQuery,$.settingsStore.histogram.useQuery,$.settingsStore.isEmpty.useQuery,$.settingsStore.declareCollection.useMutation,$.smoke.getStatus.useQuery,$.snapshot.getSnapshot.useQuery,$.snapshot.invalidateCache.useMutation,$.snapshot.getSnapshotOverview.useQuery,$.snapshot.getStatus.useQuery,$.snapshot.getDeviceSettingsContribution.useQuery,$.snapshot.getDeviceLiveContribution.useQuery,$.snapshot.applyDeviceSettingsPatch.useMutation,$.storage.resolve.useQuery,$.storage.write.useMutation,$.storage.read.useQuery,$.storage.exists.useQuery,$.storage.list.useQuery,$.storage.delete.useMutation,$.storage.getAvailableSpace.useQuery,$.storage.beginUpload.useMutation,$.storage.writeChunk.useMutation,$.storage.finalizeUpload.useMutation,$.storage.abortUpload.useMutation,$.storage.beginDownload.useMutation,$.storage.readChunk.useQuery,$.storage.endDownload.useMutation,$.storage.listLocations.useQuery,$.storage.getDefaultLocation.useQuery,$.storage.listLocationDeclarations.useQuery,$.storage.upsertLocation.useMutation,$.storage.deleteLocation.useMutation,$.storage.testLocation.useQuery,$.storage.listProviders.useQuery,$.storage.testConfig.useQuery,$.streamBroker.publishCameraStream.useMutation,$.streamBroker.retractCameraStream.useMutation,$.streamBroker.assignProfile.useMutation,$.streamBroker.unassignProfile.useMutation,$.streamBroker.renderPreBufferClip.useMutation,$.streamBroker.listAllCameraStreams.useQuery,$.streamBroker.listAllProfileSlots.useQuery,$.streamBroker.getBrokerStats.useQuery,$.streamBroker.probeStream.useMutation,$.streamBroker.listClients.useQuery,$.streamBroker.killClient.useMutation,$.streamBroker.restartProfile.useMutation,$.streamBroker.getStreamUrl.useQuery,$.streamBroker.getStreamWithCodec.useMutation,$.streamBroker.releaseStreamWithCodec.useMutation,$.streamBroker.subscribeAudioChunks.useMutation,$.streamBroker.pullAudioChunks.useQuery,$.streamBroker.unsubscribeAudioChunks.useMutation,$.streamBroker.subscribeFrames.useMutation,$.streamBroker.pullFrameHandles.useQuery,$.streamBroker.unsubscribeFrames.useMutation,$.streamBroker.setPreBufferDuration.useMutation,$.streamBroker.getPreBufferInfo.useQuery,$.streamBroker.getRtspPort.useQuery,$.streamBroker.getAllRtspEntries.useQuery,$.streamBroker.getRtspEntry.useQuery,$.streamBroker.regenerateRtspToken.useMutation,$.streamBroker.setRtspEnabled.useMutation,$.streamBroker.isRtspEnabled.useQuery,$.streamBroker.getDeviceSettingsContribution.useQuery,$.streamBroker.getDeviceLiveContribution.useQuery,$.streamBroker.applyDeviceSettingsPatch.useMutation,$.streamCatalog.getCatalog.useQuery,$.streamParams.getOptions.useQuery,$.streamParams.setProfile.useMutation,$.streamParams.getConfigSchema.useQuery,$.streamParams.getStatus.useQuery,$.switch.setState.useMutation,$.switch.getStatus.useQuery,$.system.info.useQuery,$.system.health.useQuery,$.system.featureFlags.useQuery,$.system.networkAddresses.useQuery,$.system.getRetentionConfig.useQuery,$.system.setRetentionConfig.useMutation,$.system.forceRetentionCleanup.useMutation,$.tamper.getStatus.useQuery,$.temperatureSensor.getStatus.useQuery,$.terminalSession.listProfiles.useQuery,$.terminalSession.listSessions.useQuery,$.terminalSession.openSession.useMutation,$.terminalSession.resize.useMutation,$.terminalSession.close.useMutation,$.toast.onToast.useSubscription,$.turnProvider.getTurnServers.useQuery,$.update.installUpdate.useMutation,$.update.getStatus.useQuery,$.userManagement.listUsers.useQuery,$.userManagement.createUser.useMutation,$.userManagement.updateUser.useMutation,$.userManagement.deleteUser.useMutation,$.userManagement.resetPassword.useMutation,$.userManagement.setUserScopes.useMutation,$.userManagement.validateCredentials.useMutation,$.userManagement.listApiKeys.useQuery,$.userManagement.createApiKey.useMutation,$.userManagement.revokeApiKey.useMutation,$.userManagement.validateApiKey.useMutation,$.userManagement.createScopedToken.useMutation,$.userManagement.revokeScopedToken.useMutation,$.userManagement.validateScopedToken.useQuery,$.userManagement.listScopedTokens.useQuery,$.userManagement.setupTotp.useMutation,$.userManagement.confirmTotp.useMutation,$.userManagement.disableTotp.useMutation,$.userManagement.getTotpStatus.useQuery,$.userManagement.verifyTotp.useMutation,$.userManagement.oauthIssueCode.useMutation,$.userManagement.oauthExchangeCode.useMutation,$.userManagement.oauthRefresh.useMutation,$.userManagement.oauthVerifyAccessToken.useQuery,$.userManagement.listOauthSessions.useQuery,$.userManagement.revokeOauthSession.useMutation,$.vacuumControl.start.useMutation,$.vacuumControl.pause.useMutation,$.vacuumControl.stop.useMutation,$.vacuumControl.returnToBase.useMutation,$.vacuumControl.locate.useMutation,$.vacuumControl.setFanSpeed.useMutation,$.vacuumControl.getStatus.useQuery,$.valve.open.useMutation,$.valve.close.useMutation,$.valve.stop.useMutation,$.valve.setPosition.useMutation,$.valve.getStatus.useQuery,$.vibration.getStatus.useQuery,$.videoclips.listClips.useQuery,$.videoclips.getClipPlayback.useQuery,$.waterHeater.setTargetTemp.useMutation,$.waterHeater.setOperationMode.useMutation,$.waterHeater.setAway.useMutation,$.waterHeater.getStatus.useQuery,$.weather.getStatus.useQuery,$.webrtcSession.listStreams.useQuery,$.webrtcSession.createSession.useMutation,$.webrtcSession.handleOffer.useMutation,$.webrtcSession.handleAnswer.useMutation,$.webrtcSession.addIceCandidate.useMutation,$.webrtcSession.getIceCandidates.useQuery,$.webrtcSession.closeSession.useMutation,$.webrtcSession.hasAdaptiveBitrate.useQuery,$.webrtcSession.getSessionState.useQuery,$.zoneAnalytics.getCurrentSnapshot.useQuery,$.zoneAnalytics.getZoneHistory.useQuery,$.zoneAnalytics.getCameraHistory.useQuery,$.zoneAnalytics.getUnzonedHistory.useQuery,$.zoneRules.listRules.useQuery,$.zoneRules.setRules.useMutation,$.zones.listZones.useQuery,$.zones.addZone.useMutation,$.zones.removeZone.useMutation,$.zones.updateZone.useMutation;var bB={kind:`binary`,field:`on`,onLabel:`Low`,offLabel:`Normal`,getSliceHandle:e=>e.binary};function xB(e){return e===`battery-sensor`}function SB(e,t){if(!wB(e))return!1;let n=e[t];if(typeof n!=`number`)return!1;let r=e.lastFetchedAt;return!(n===0&&r===0)}var CB={"temperature-sensor":{kind:`numeric`,field:`celsius`,canonicalUnit:`°C`,getSliceHandle:e=>e.temperatureSensor},"humidity-sensor":{kind:`numeric`,field:`percent`,canonicalUnit:`%`,getSliceHandle:e=>e.humiditySensor},"ambient-light-sensor":{kind:`numeric`,field:`lux`,canonicalUnit:`lx`,getSliceHandle:e=>e.ambientLightSensor},"pressure-sensor":{kind:`numeric`,field:`hpa`,canonicalUnit:`hPa`,getSliceHandle:e=>e.pressureSensor},"numeric-sensor":{kind:`numeric`,field:`value`,getSliceHandle:e=>e.numericSensor},"wind-sensor":{kind:`numeric`,field:`value`,getSliceHandle:e=>e.numericSensor},"rain-sensor":{kind:`numeric`,field:`value`,getSliceHandle:e=>e.numericSensor},"uv-sensor":{kind:`numeric`,field:`value`,getSliceHandle:e=>e.numericSensor},"solar-radiation-sensor":{kind:`numeric`,field:`value`,getSliceHandle:e=>e.numericSensor},"soil-moisture-sensor":{kind:`numeric`,field:`value`,getSliceHandle:e=>e.numericSensor},"power-sensor":{kind:`numeric`,field:`watts`,canonicalUnit:`W`,getSliceHandle:e=>e.powerMeter},"energy-sensor":{kind:`numeric`,field:`kwhTotal`,canonicalUnit:`kWh`,getSliceHandle:e=>e.powerMeter},"voltage-sensor":{kind:`numeric`,field:`volts`,canonicalUnit:`V`,getSliceHandle:e=>e.powerMeter},"current-sensor":{kind:`numeric`,field:`amps`,canonicalUnit:`A`,getSliceHandle:e=>e.powerMeter},"battery-sensor":{kind:`numeric`,field:`value`,canonicalUnit:`%`,getSliceHandle:e=>e.numericSensor},"generic-sensor":{kind:`numeric`,field:`value`,getSliceHandle:e=>e.numericSensor},"motion-sensor":{kind:`binary`,field:`detected`,onLabel:`Detected`,offLabel:`Clear`,getSliceHandle:e=>e.motion},"pir-sensor":{kind:`binary`,field:`detected`,onLabel:`Detected`,offLabel:`Clear`,getSliceHandle:e=>e.motion},"contact-sensor":{kind:`binary`,field:`entryOpen`,onLabel:`Open`,offLabel:`Closed`,getSliceHandle:e=>e.contact},"smoke-sensor":{kind:`binary`,field:`detected`,onLabel:`Smoke!`,offLabel:`Clear`,getSliceHandle:e=>e.smoke},"leak-sensor":{kind:`binary`,field:`flooded`,onLabel:`Leak!`,offLabel:`Dry`,getSliceHandle:e=>e.flood},"co-sensor":{kind:`binary`,field:`detected`,onLabel:`CO!`,offLabel:`Clear`,getSliceHandle:e=>e.carbonMonoxide},"binary-sensor":{kind:`binary`,field:`on`,onLabel:`On`,offLabel:`Off`,getSliceHandle:e=>e.binary},presence:{kind:`presence`,getSliceHandle:e=>e.presence},"enum-sensor":{kind:`string`,getSliceHandle:e=>e.enumSensor},"datetime-sensor":{kind:`datetime`,format:`datetime`,getSliceHandle:e=>e.enumSensor}};function wB(e){return typeof e==`object`&&!!e}function TB(e){return typeof e==`object`&&!!e}function EB(e){return typeof e==`object`&&!!e&&`state`in e&&typeof e.state==`string`}function DB(e){return typeof e==`object`&&!!e&&`value`in e&&typeof e.value==`string`}function OB(e){if(typeof e!=`object`||!e)return;let t=e.format;if(t===`date`||t===`time`||t===`datetime`)return t}function kB(e){return e===`home`?`Home`:e===`not_home`?`Away`:e.charAt(0).toUpperCase()+e.slice(1)}function AB({trpc:e,device:t}){let n=t.role==null?void 0:CB[t.role],r=xB(t.role),{data:a}=hB({},{staleTime:6e4}),o=Hz(e,t.id),s=Uz(o!==null&&n!==void 0?n.getSliceHandle(o.state):void 0),c=Uz(o!==null&&n?.kind===`numeric`?o.state.enumSensor:void 0),l=Uz(o!==null&&r?o.state.binary:void 0),u=r&&n?.kind===`numeric`&&!SB(s,n.field)&&l!==void 0,d=u?bB:n,f=u?l:s;if(d===void 0||f===void 0)return null;if(d.kind===`numeric`){if(!wB(f))return null;let e=f[d.field];if(typeof e!=`number`)return null;let n=f.lastFetchedAt,r=e===0&&n===0;if(r&&DB(c)&&c.value!==``)return(0,C.jsx)(`span`,{className:Z(`inline-flex items-baseline text-xs text-foreground`),children:c.value});if(r)return null;let o=f,s=typeof o.unit==`string`?o.unit:void 0,l=typeof o.precision==`number`?o.precision:void 0,u=tN({display:t.display,capName:t.role===`numeric-sensor`?`numeric-sensor`:void 0,roleDefault:t.role==null?void 0:a?.defaults[t.role],sliceUnit:s,slicePrecision:l,canonicalUnit:d.canonicalUnit}),p=u.unit,m=$M(u.toDisplayValue(e),u.precision);return(0,C.jsxs)(`span`,{className:Z(`inline-flex items-baseline gap-0.5 tabular-nums text-xs text-foreground`),children:[(0,C.jsx)(`span`,{children:m}),p&&(0,C.jsx)(`span`,{className:`text-foreground-subtle`,children:p})]})}if(d.kind===`binary`){if(!TB(f))return null;let e=!!f[d.field],t=e?d.onLabel:d.offLabel;return(0,C.jsx)(`span`,{className:Z(`inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium`,e?`bg-warning/15 text-warning`:`bg-surface-subtle text-foreground-subtle`),children:t})}if(d.kind===`string`)return!DB(f)||f.value===``?null:(0,C.jsx)(`span`,{className:Z(`inline-flex items-baseline text-xs text-foreground`),children:f.value});if(d.kind===`datetime`){if(!DB(f)||f.value===``)return null;let e=OB(f)??d.format,t=QM(f.value,e);return(0,C.jsx)(`span`,{className:Z(`inline-flex items-baseline text-xs text-foreground`),children:t})}if(!EB(f))return null;let p=kB(f.state);return(0,C.jsx)(`span`,{className:Z(`inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium`,f.state===`home`?`bg-success/15 text-success`:`bg-surface-subtle text-foreground-subtle`),children:p})}function jB(e){return{id:e.id,stableId:e.stableId,addonId:e.addonId,type:e.type,name:e.name,online:e.online,disabled:e.disabled,parentDeviceId:e.parentDeviceId,role:e.role??void 0,features:e.features}}function MB({trpc:e,deviceId:t}){let{data:n}=gB({deviceId:t},{staleTime:6e4});return n===void 0?null:(0,C.jsx)(AB,{trpc:e,device:jB(n)})}function NB(e){return typeof e==`object`&&!!e}function PB(e){return typeof e==`object`&&!!e}function FB(e){return typeof e==`object`&&!!e&&`state`in e&&typeof e.state==`string`}function IB(e){return e===`home`?`Home`:e===`not_home`?`Away`:e.charAt(0).toUpperCase()+e.slice(1)}var LB={low:`bg-danger`,medium:`bg-warning`,high:`bg-success`};function RB(e){return e<=20?`low`:e<=50?`medium`:`high`}function zB({percent:e}){let t=Math.min(100,Math.max(0,e)),n=RB(t);return(0,C.jsx)(`div`,{"data-testid":`battery-bar`,"data-band":n,className:`h-2 w-24 overflow-hidden rounded-full bg-border`,children:(0,C.jsx)(`div`,{className:Z(`h-full rounded-full transition-all`,LB[n]),style:{width:`${t}%`}})})}function BB({trpc:e,device:t}){let n=t.role==null?void 0:CB[t.role],r=xB(t.role),{data:a}=hB({},{staleTime:6e4}),o=Hz(e,t.id),s=Uz(o!==null&&n!==void 0?n.getSliceHandle(o.state):void 0),c=Uz(o!==null&&r?o.state.binary:void 0),l=r&&n?.kind===`numeric`&&!SB(s,n.field)&&c!==void 0,u=l?bB:n,d=l?c:s;if(u===void 0||d===void 0)return(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]`,children:[(0,C.jsx)(`span`,{className:`text-sm text-foreground-subtle`,children:t.name}),(0,C.jsx)(`span`,{className:`text-xs text-foreground-subtle italic`,children:`Awaiting state…`})]});if(u.kind===`numeric`){if(!NB(d))return null;let e=d[u.field];if(typeof e!=`number`)return null;let n=d,o=typeof n.unit==`string`?n.unit:void 0,s=typeof n.precision==`number`?n.precision:void 0,c=tN({display:t.display,capName:t.role===`numeric-sensor`?`numeric-sensor`:void 0,roleDefault:t.role==null?void 0:a?.defaults[t.role],sliceUnit:o,slicePrecision:s,canonicalUnit:u.canonicalUnit}),l=c.unit;return(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums text-foreground`,children:$M(c.toDisplayValue(e),c.precision)}),l&&(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle`,children:l})]}),r&&(0,C.jsx)(zB,{percent:e}),(0,C.jsx)(`span`,{className:`text-sm text-foreground-subtle`,children:t.name})]})}if(u.kind===`binary`){if(!PB(d))return null;let e=!!d[u.field],n=e?u.onLabel:u.offLabel;return(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsx)(`span`,{className:Z(`inline-flex items-center rounded px-3 py-1.5 text-lg font-semibold`,e?`bg-warning/15 text-warning`:`bg-surface-subtle text-foreground-subtle`),children:n}),(0,C.jsx)(`span`,{className:`text-sm text-foreground-subtle`,children:t.name})]})}if(u.kind===`datetime`){if(!DB(d))return null;if(d.value===``)return(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]`,children:[(0,C.jsx)(`span`,{className:`text-sm text-foreground-subtle`,children:t.name}),(0,C.jsx)(`span`,{className:`text-xs text-foreground-subtle italic`,children:`Awaiting state…`})]});let e=OB(d)??u.format;return(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums text-foreground`,children:QM(d.value,e)}),(0,C.jsx)(`span`,{className:`text-sm text-foreground-subtle`,children:t.name})]})}if(u.kind===`string`)return!DB(d)||d.value===``?null:(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:d.value}),(0,C.jsx)(`span`,{className:`text-sm text-foreground-subtle`,children:t.name})]});if(!FB(d))return null;let f=IB(d.state);return(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsx)(`span`,{className:Z(`inline-flex items-center rounded px-3 py-1.5 text-lg font-semibold`,d.state===`home`?`bg-success/15 text-success`:`bg-surface-subtle text-foreground-subtle`),children:f}),(0,C.jsx)(`span`,{className:`text-sm text-foreground-subtle`,children:t.name})]})}function VB({trpc:e,deviceId:t}){let{data:n}=gB({deviceId:t},{staleTime:6e4});return n===void 0?null:(0,C.jsx)(BB,{trpc:e,device:n})}function HB(e){return e===void 0||e.inProgress?!1:e.availableVersion!==null&&e.currentVersion!==null&&e.availableVersion!==e.currentVersion}function UB(e,t){return Wz({trpc:e,deviceId:t,cap:e=>e.update,slice:e=>e.state.update})}function WB({trpc:e,deviceId:t}){let{cap:n,slice:r}=UB(e,t);return n===void 0?null:r?.inProgress?(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-foreground-subtle`,children:[(0,C.jsx)(tR,{className:`h-3.5 w-3.5 animate-spin`}),`Updating…`]}):HB(r)?(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-warning/15 px-1.5 py-0.5 text-[10px] font-medium text-warning`,children:[(0,C.jsx)(IL,{className:`h-3 w-3`}),`Update`]}):(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] text-foreground-subtle`,children:[(0,C.jsx)(bL,{className:`h-3 w-3 text-success`}),r?.currentVersion??`Up to date`]})}function GB({trpc:e,deviceId:t}){let{cap:n,slice:r,available:a}=UB(e,t);if(n===void 0)return null;let o=r?.inProgress===!0,s=HB(r),c=r?.currentVersion??`—`,l=()=>{!a||n===void 0||!s||n.installUpdate({})};return(0,C.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums text-foreground`,children:c}),s&&r?.availableVersion!=null&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle`,children:`→`}),(0,C.jsx)(`span`,{className:`text-base font-medium text-warning tabular-nums`,children:r.availableVersion})]})]}),o?(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-sm font-medium text-foreground-subtle`,children:[(0,C.jsx)(tR,{className:`h-4 w-4 animate-spin`}),`Installing…`]}):s?(0,C.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),l()},disabled:!a,className:`inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground shadow-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:[(0,C.jsx)(IL,{className:`h-4 w-4`}),`Install update`]}):(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded bg-success/15 px-3 py-1 text-sm font-medium text-success`,children:[(0,C.jsx)(bL,{className:`h-4 w-4`}),`Up to date`]}),r?.state!=null&&r.state!==``&&(0,C.jsx)(`span`,{className:`text-[10px] text-foreground-subtle`,children:r.state})]})}function KB(e){switch(e){case`cleaning`:return{label:`Cleaning`,tone:`text-primary`};case`paused`:return{label:`Paused`,tone:`text-warning`};case`returning`:return{label:`Returning`,tone:`text-primary`};case`docked`:return{label:`Docked`,tone:`text-success`};case`drying`:return{label:`Drying`,tone:`text-warning`};case`idle`:return{label:`Idle`,tone:`text-foreground-subtle`};case`error`:return{label:`Error`,tone:`text-destructive`};case void 0:return{label:`Unknown`,tone:`text-foreground-subtle`}}}function qB(e,t){return Wz({trpc:e,deviceId:t,cap:e=>e.vacuumControl,slice:e=>e.state.vacuumControl})}function JB({label:e,busy:t,active:n,onClick:r,children:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),r()},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,n&&`bg-primary text-primary-foreground`,t&&`opacity-40 cursor-not-allowed`),children:a})}function YB(e){switch(e){case`cleaning`:return{glow:`bg-primary/15`,accent:`text-primary`,docked:!1,active:!0};case`returning`:return{glow:`bg-primary/10`,accent:`text-primary`,docked:!1,active:!0};case`docked`:return{glow:`bg-success/10`,accent:`text-success`,docked:!0,active:!1};case`drying`:return{glow:`bg-warning/10`,accent:`text-warning`,docked:!0,active:!1};case`paused`:return{glow:`bg-warning/10`,accent:`text-warning`,docked:!1,active:!1};case`error`:return{glow:`bg-destructive/10`,accent:`text-destructive`,docked:!1,active:!1};case`idle`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,docked:!1,active:!1};case void 0:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,docked:!1,active:!1}}}var XB=`
78
- @keyframes rg-breathe { 0%,100%{opacity:.78;transform:scale(1)} 50%{opacity:1;transform:scale(1.05)} }
79
- @keyframes rg-zzz { 0%{opacity:0;transform:translateY(3px)} 30%{opacity:.85} 100%{opacity:0;transform:translateY(-9px)} }
80
- @keyframes rg-spark { 0%,100%{opacity:.25;transform:scale(.9)} 50%{opacity:1;transform:scale(1.1)} }
81
- @keyframes rg-pulse { 0%,100%{opacity:.35} 50%{opacity:.85} }
82
- @keyframes rg-blink { 0%,49%{opacity:1} 50%,100%{opacity:.3} }
83
- @keyframes rg-spin { to { transform:rotate(360deg) } }
84
- @media (prefers-reduced-motion: reduce) { .rg-a { animation: none !important; } }
85
- `;function ZB({state:e,batteryLevel:t}){let n=YB(e),r=n.docked&&t!=null&&t<100,a=n.docked&&!r,o=e===`error`,s=a?{animation:`rg-breathe 3.4s ease-in-out infinite`,transformBox:`fill-box`,transformOrigin:`center`}:o?{animation:`rg-blink 1s steps(1) infinite`}:void 0;return(0,C.jsxs)(`div`,{"aria-hidden":`true`,className:`relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0`,style:{boxShadow:`inset 0 0 0 2px rgba(255,255,255,.06)`},children:[(0,C.jsx)(`style`,{children:XB}),(0,C.jsx)(`div`,{className:Z(`absolute inset-0 transition-colors duration-300`,n.glow)}),(0,C.jsx)(`div`,{className:Z(`absolute inset-0 flex items-center justify-center`,n.accent),children:(0,C.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`w-20 h-20`,fill:`none`,children:[n.docked&&(0,C.jsx)(`rect`,{x:`34`,y:`80`,width:`32`,height:`8`,rx:`2`,fill:`currentColor`,opacity:`0.35`,className:Z(r&&`rg-a`),style:r?{animation:`rg-pulse 1.2s ease-in-out infinite`}:void 0}),n.active&&(0,C.jsx)(`circle`,{cx:`50`,cy:`50`,r:`44`,stroke:`currentColor`,strokeWidth:`2`,opacity:`0.4`,className:`animate-ping`,style:{transformOrigin:`center`}}),(0,C.jsxs)(`g`,{className:Z((a||o)&&`rg-a`),style:s,children:[(0,C.jsx)(`circle`,{cx:`50`,cy:`50`,r:`34`,fill:`currentColor`,fillOpacity:`0.12`,stroke:`currentColor`,strokeWidth:`2.5`}),(0,C.jsx)(`path`,{d:`M 24 42 A 34 34 0 0 1 76 42`,stroke:`currentColor`,strokeWidth:`3`,opacity:`0.55`,strokeLinecap:`round`}),(0,C.jsxs)(`g`,{className:Z(n.active&&`rg-a`),style:n.active?{animation:`rg-spin 3s linear infinite`,transformBox:`fill-box`,transformOrigin:`center`}:void 0,children:[(0,C.jsx)(`circle`,{cx:`50`,cy:`50`,r:`9`,fill:`currentColor`,fillOpacity:`0.25`,stroke:`currentColor`,strokeWidth:`2`}),(0,C.jsx)(`circle`,{cx:`50`,cy:`43`,r:`2.4`,fill:`currentColor`})]})]}),a&&(0,C.jsxs)(`g`,{fill:`currentColor`,fontFamily:`sans-serif`,fontWeight:`700`,children:[(0,C.jsx)(`text`,{x:`64`,y:`30`,fontSize:`13`,opacity:`0.7`,className:`rg-a`,style:{animation:`rg-zzz 3.4s ease-in-out infinite`},children:`z`}),(0,C.jsx)(`text`,{x:`73`,y:`23`,fontSize:`10`,opacity:`0.6`,className:`rg-a`,style:{animation:`rg-zzz 3.4s ease-in-out .7s infinite`},children:`z`}),(0,C.jsx)(`text`,{x:`80`,y:`17`,fontSize:`8`,opacity:`0.5`,className:`rg-a`,style:{animation:`rg-zzz 3.4s ease-in-out 1.4s infinite`},children:`z`})]}),r&&(0,C.jsx)(`path`,{d:`M53 20 L44 40 L50 40 L46 56 L60 34 L53 34 Z`,fill:`#fbbf24`,stroke:`#f59e0b`,strokeWidth:`1`,className:`rg-a`,style:{animation:`rg-spark 1s ease-in-out infinite`,transformBox:`fill-box`,transformOrigin:`center`}})]})})]})}function QB({level:e}){return(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle`,children:[(0,C.jsx)(fL,{className:`h-3.5 w-3.5`}),e,`%`]})}function $B(e){switch(e){case`cleanWater`:return!0;case`detergent`:return!0;case`dirtyWater`:return!1;case`dustBin`:return!1;default:return e}}function eV(e,t){let n=$B(e);return t.level===null?t.status===null?`ok`:n?t.status===`low`?`warning`:`ok`:t.status===`full`?`warning`:`ok`:n?t.level<=15?`warning`:`ok`:t.level>=85?`warning`:`ok`}function tV(e){switch(e){case`cleanWater`:return{label:`Clean water`,icon:(0,C.jsx)(LL,{className:`h-3.5 w-3.5`})};case`dirtyWater`:return{label:`Dirty water`,icon:(0,C.jsx)(RL,{className:`h-3.5 w-3.5`})};case`detergent`:return{label:`Detergent`,icon:(0,C.jsx)(WL,{className:`h-3.5 w-3.5`})};case`dustBin`:return{label:`Dust bin`,icon:(0,C.jsx)(WR,{className:`h-3.5 w-3.5`})};default:return e}}function nV({kind:e,tank:t}){if(t===null)return null;let n=tV(e),r=eV(e,t)===`warning`;return t.level===null?t.status===null?(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 w-24 shrink-0 text-foreground-subtle`,children:[n.icon,n.label]}),(0,C.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium bg-surface-hover text-foreground-subtle`,children:`—`})]}):(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsxs)(`span`,{className:Z(`inline-flex items-center gap-1 w-24 shrink-0`,r?`text-warning`:`text-foreground-subtle`),children:[n.icon,n.label]}),(0,C.jsx)(`span`,{className:Z(`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium`,r?`bg-warning/15 text-warning`:`bg-primary/15 text-foreground-subtle`),children:t.status})]}):(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,C.jsxs)(`span`,{className:Z(`inline-flex items-center gap-1 w-24 shrink-0`,r?`text-warning`:`text-foreground-subtle`),children:[n.icon,n.label]}),(0,C.jsx)(`span`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-surface-hover`,children:(0,C.jsx)(`span`,{className:Z(`absolute inset-y-0 left-0 rounded-full transition-all`,r?`bg-warning`:`bg-primary`),style:{width:`${t.level}%`}})}),(0,C.jsxs)(`span`,{className:Z(`tabular-nums w-9 text-right`,r?`text-warning`:`text-foreground-subtle`),children:[t.level,`%`]})]})}function rV({cleanWater:e,dirtyWater:t,detergent:n,dustBin:r}){let a=[[`cleanWater`,e],[`dirtyWater`,t],[`detergent`,n],[`dustBin`,r]];return a.some(([,e])=>e!==null)?(0,C.jsx)(`div`,{className:`grid grid-cols-1 gap-x-6 gap-y-2 rounded-md border border-border bg-surface-hover/40 p-3 sm:grid-cols-2`,children:a.map(([e,t])=>(0,C.jsx)(nV,{kind:e,tank:t},e))}):null}function iV({trpc:e,deviceId:t}){let{cap:n,slice:r,available:a}=qB(e,t);if(n===void 0)return null;let o=!a,s=r?.state,c=s===`cleaning`,l=e=>{o||e===void 0||e({})};return(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,C.jsx)(JB,{label:`Start`,busy:o,active:c,onClick:()=>l(n.start),children:(0,C.jsx)(yR,{className:`h-3 w-3`})}),(0,C.jsx)(JB,{label:`Pause`,busy:o,active:s===`paused`,onClick:()=>l(n.pause),children:(0,C.jsx)(gR,{className:`h-3 w-3`})}),(0,C.jsx)(JB,{label:`Return to base`,busy:o,active:s===`returning`||s===`docked`,onClick:()=>l(n.returnToBase),children:(0,C.jsx)(JL,{className:`h-3.5 w-3.5`})}),r?.batteryLevel!=null&&(0,C.jsx)(`span`,{className:`ml-1`,children:(0,C.jsx)(QB,{level:r.batteryLevel})})]})}function aV({label:e,busy:t,active:n,onClick:r,children:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),r()},className:Z(`inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,n&&`bg-primary text-primary-foreground hover:bg-primary/90`,t&&`opacity-40 cursor-not-allowed`),children:a})}function oV({trpc:e,deviceId:t}){let{cap:n,slice:r,available:a}=qB(e,t);if(n===void 0)return null;let o=!a,s=r?.state,c=KB(s),l=r?.availableFanSpeeds??[],u=e=>{o||e===void 0||e({})},d=e=>{o||e===``||n.setFanSpeed({speed:e})};return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,C.jsx)(ZB,{state:s,batteryLevel:r?.batteryLevel??null}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsx)(`span`,{className:Z(`text-3xl font-semibold`,c.tone),children:c.label}),r?.batteryLevel!=null&&(0,C.jsx)(QB,{level:r.batteryLevel})]}),r?.progressPercent!=null&&(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(`div`,{className:`h-1.5 flex-1 rounded bg-surface-hover overflow-hidden`,children:(0,C.jsx)(`div`,{className:`h-full bg-primary transition-[width] duration-500`,style:{width:`${Math.max(0,Math.min(100,r.progressPercent))}%`}})}),(0,C.jsxs)(`span`,{className:`tabular-nums text-xs text-foreground-subtle`,children:[Math.round(r.progressPercent),`%`]})]}),r?.errorCode!=null&&r.errorCode!==0&&(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1 text-xs text-destructive`,children:[(0,C.jsx)(GR,{className:`h-3.5 w-3.5`}),(0,C.jsx)(`span`,{children:r.errorLabel??`Error ${r.errorCode}`})]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(aV,{label:`Start`,busy:o,active:s===`cleaning`,onClick:()=>u(n.start),children:(0,C.jsx)(yR,{className:`h-5 w-5`})}),(0,C.jsx)(aV,{label:`Pause`,busy:o,active:s===`paused`,onClick:()=>u(n.pause),children:(0,C.jsx)(gR,{className:`h-5 w-5`})}),(0,C.jsx)(aV,{label:`Stop`,busy:o,active:!1,onClick:()=>u(n.stop),children:(0,C.jsx)(LR,{className:`h-4 w-4`})}),(0,C.jsx)(aV,{label:`Return to base`,busy:o,active:s===`returning`||s===`docked`,onClick:()=>u(n.returnToBase),children:(0,C.jsx)(JL,{className:`h-5 w-5`})}),(0,C.jsx)(aV,{label:`Locate`,busy:o,active:!1,onClick:()=>u(n.locate),children:(0,C.jsx)(oR,{className:`h-5 w-5`})})]})]})]}),l.length>0&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:`w-16 shrink-0`,children:`Fan speed`}),(0,C.jsxs)(`select`,{"aria-label":`Fan speed`,value:r?.fanSpeed??``,disabled:o,onChange:e=>{d(e.target.value)},onClick:e=>{e.stopPropagation()},className:`flex-1 rounded border border-border bg-surface px-2 py-1 text-foreground disabled:opacity-50`,children:[r?.fanSpeed==null&&(0,C.jsx)(`option`,{value:``,children:`—`}),l.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]})]}),(0,C.jsx)(rV,{cleanWater:r?.cleanWater??null,dirtyWater:r?.dirtyWater??null,detergent:r?.detergent??null,dustBin:r?.dustBin??null})]})}function sV(e){switch(e){case`mowing`:return{label:`Mowing`,tone:`text-primary`};case`paused`:return{label:`Paused`,tone:`text-warning`};case`docked`:return{label:`Docked`,tone:`text-success`};case`idle`:return{label:`Idle`,tone:`text-foreground-subtle`};case`error`:return{label:`Error`,tone:`text-destructive`};case void 0:return{label:`Unknown`,tone:`text-foreground-subtle`}}}function cV(e,t){return Wz({trpc:e,deviceId:t,cap:e=>e.lawnMowerControl,slice:e=>e.state.lawnMowerControl})}function lV(e){switch(e){case`mowing`:return{glow:`bg-primary/15`,accent:`text-primary`,docked:!1,active:!0};case`docked`:return{glow:`bg-success/10`,accent:`text-success`,docked:!0,active:!1};case`paused`:return{glow:`bg-warning/10`,accent:`text-warning`,docked:!1,active:!1};case`error`:return{glow:`bg-destructive/10`,accent:`text-destructive`,docked:!1,active:!1};case`idle`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,docked:!1,active:!1};case void 0:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,docked:!1,active:!1}}}var uV=`
86
- @keyframes rg-breathe { 0%,100%{opacity:.78;transform:scale(1)} 50%{opacity:1;transform:scale(1.05)} }
87
- @keyframes rg-zzz { 0%{opacity:0;transform:translateY(3px)} 30%{opacity:.85} 100%{opacity:0;transform:translateY(-9px)} }
88
- @keyframes rg-spark { 0%,100%{opacity:.25;transform:scale(.9)} 50%{opacity:1;transform:scale(1.1)} }
89
- @keyframes rg-pulse { 0%,100%{opacity:.35} 50%{opacity:.85} }
90
- @keyframes rg-blink { 0%,49%{opacity:1} 50%,100%{opacity:.3} }
91
- @keyframes rg-spin { to { transform:rotate(360deg) } }
92
- @media (prefers-reduced-motion: reduce) { .rg-a { animation: none !important; } }
93
- `;function dV({activity:e,batteryLevel:t}){let n=lV(e),r=n.docked&&t!=null&&t<100,a=n.docked&&!r,o=e===`error`,s=a?{animation:`rg-breathe 3.4s ease-in-out infinite`,transformBox:`fill-box`,transformOrigin:`center`}:o?{animation:`rg-blink 1s steps(1) infinite`}:void 0;return(0,C.jsxs)(`div`,{"aria-hidden":`true`,className:`relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-emerald-700/40 to-emerald-900/30 overflow-hidden flex-shrink-0`,style:{boxShadow:`inset 0 0 0 2px rgba(255,255,255,.06)`},children:[(0,C.jsx)(`style`,{children:uV}),(0,C.jsx)(`div`,{className:Z(`absolute inset-0 transition-colors duration-300`,n.glow)}),(0,C.jsx)(`div`,{className:Z(`absolute inset-0 flex items-center justify-center`,n.accent),children:(0,C.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`w-20 h-20`,fill:`none`,children:[n.docked&&(0,C.jsx)(`rect`,{x:`30`,y:`78`,width:`40`,height:`9`,rx:`2`,fill:`currentColor`,opacity:`0.35`,className:Z(r&&`rg-a`),style:r?{animation:`rg-pulse 1.2s ease-in-out infinite`}:void 0}),n.active&&(0,C.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,opacity:`0.5`,children:[(0,C.jsx)(`line`,{x1:`18`,y1:`36`,x2:`10`,y2:`36`,className:`animate-pulse`}),(0,C.jsx)(`line`,{x1:`18`,y1:`50`,x2:`6`,y2:`50`,className:`animate-pulse`}),(0,C.jsx)(`line`,{x1:`18`,y1:`64`,x2:`10`,y2:`64`,className:`animate-pulse`})]}),(0,C.jsxs)(`g`,{className:Z((a||o)&&`rg-a`),style:s,children:[(0,C.jsx)(`rect`,{x:`28`,y:`34`,width:`44`,height:`34`,rx:`8`,fill:`currentColor`,fillOpacity:`0.14`,stroke:`currentColor`,strokeWidth:`2.5`}),(0,C.jsx)(`line`,{x1:`34`,y1:`60`,x2:`66`,y2:`60`,stroke:`currentColor`,strokeWidth:`2`,opacity:`0.5`}),(0,C.jsxs)(`g`,{className:Z(n.active&&`rg-a`),style:n.active?{animation:`rg-spin 0.9s linear infinite`,transformBox:`fill-box`,transformOrigin:`center`}:void 0,children:[(0,C.jsx)(`circle`,{cx:`50`,cy:`48`,r:`5`,stroke:`currentColor`,strokeWidth:`2`,opacity:`0.6`}),(0,C.jsx)(`line`,{x1:`45`,y1:`48`,x2:`55`,y2:`48`,stroke:`currentColor`,strokeWidth:`2`,opacity:`0.7`})]}),(0,C.jsx)(`circle`,{cx:`34`,cy:`68`,r:`6`,fill:`currentColor`,fillOpacity:`0.3`,stroke:`currentColor`,strokeWidth:`2`}),(0,C.jsx)(`circle`,{cx:`66`,cy:`68`,r:`6`,fill:`currentColor`,fillOpacity:`0.3`,stroke:`currentColor`,strokeWidth:`2`})]}),a&&(0,C.jsxs)(`g`,{fill:`currentColor`,fontFamily:`sans-serif`,fontWeight:`700`,children:[(0,C.jsx)(`text`,{x:`64`,y:`30`,fontSize:`13`,opacity:`0.7`,className:`rg-a`,style:{animation:`rg-zzz 3.4s ease-in-out infinite`},children:`z`}),(0,C.jsx)(`text`,{x:`73`,y:`23`,fontSize:`10`,opacity:`0.6`,className:`rg-a`,style:{animation:`rg-zzz 3.4s ease-in-out .7s infinite`},children:`z`}),(0,C.jsx)(`text`,{x:`80`,y:`17`,fontSize:`8`,opacity:`0.5`,className:`rg-a`,style:{animation:`rg-zzz 3.4s ease-in-out 1.4s infinite`},children:`z`})]}),r&&(0,C.jsx)(`path`,{d:`M53 20 L44 40 L50 40 L46 56 L60 34 L53 34 Z`,fill:`#fbbf24`,stroke:`#f59e0b`,strokeWidth:`1`,className:`rg-a`,style:{animation:`rg-spark 1s ease-in-out infinite`,transformBox:`fill-box`,transformOrigin:`center`}})]})})]})}function fV(e){switch(e){case`error`:return`text-destructive`;case`warning`:return`text-warning`;case`info`:return`text-foreground-subtle`}}function pV({percent:e}){return(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(`div`,{className:`h-1.5 flex-1 rounded bg-surface-hover overflow-hidden`,children:(0,C.jsx)(`div`,{className:`h-full bg-primary transition-[width] duration-500`,style:{width:`${Math.max(0,Math.min(100,e))}%`}})}),(0,C.jsxs)(`span`,{className:`tabular-nums text-xs text-foreground-subtle`,children:[Math.round(e),`%`]})]})}function mV({code:e,label:t,severity:n}){return(0,C.jsxs)(`div`,{className:Z(`inline-flex items-center gap-1 text-xs`,fV(n)),children:[n!==`info`&&(0,C.jsx)(GR,{className:`h-3.5 w-3.5`}),(0,C.jsx)(`span`,{children:t??`Code ${e}`})]})}function hV({level:e}){return(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle`,children:[(0,C.jsx)(fL,{className:`h-3.5 w-3.5`}),e,`%`]})}function gV({label:e,busy:t,active:n,onClick:r,children:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),r()},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,n&&`bg-primary text-primary-foreground`,t&&`opacity-40 cursor-not-allowed`),children:a})}function _V({trpc:e,deviceId:t}){let{cap:n,slice:r,available:a}=cV(e,t);if(n===void 0)return null;let o=!a,s=r?.activity,c=e=>{o||e===void 0||e({})};return(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,C.jsx)(gV,{label:`Mow`,busy:o,active:s===`mowing`,onClick:()=>c(n.startMowing),children:(0,C.jsx)(yR,{className:`h-3 w-3`})}),(0,C.jsx)(gV,{label:`Pause`,busy:o,active:s===`paused`,onClick:()=>c(n.pause),children:(0,C.jsx)(gR,{className:`h-3 w-3`})}),(0,C.jsx)(gV,{label:`Dock`,busy:o,active:s===`docked`,onClick:()=>c(n.dock),children:(0,C.jsx)(JL,{className:`h-3.5 w-3.5`})}),r?.batteryLevel!=null&&(0,C.jsx)(`span`,{className:`ml-1`,children:(0,C.jsx)(hV,{level:r.batteryLevel})})]})}function vV({label:e,busy:t,active:n,onClick:r,children:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),r()},className:Z(`inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,n&&`bg-primary text-primary-foreground hover:bg-primary/90`,t&&`opacity-40 cursor-not-allowed`),children:a})}function yV({trpc:e,deviceId:t}){let{cap:n,slice:r,available:a}=cV(e,t);if(n===void 0)return null;let o=!a,s=r?.activity,c=sV(s),l=e=>{o||e===void 0||e({})};return(0,C.jsx)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:(0,C.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,C.jsx)(dV,{activity:s,batteryLevel:r?.batteryLevel??null}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsx)(`span`,{className:Z(`text-3xl font-semibold`,c.tone),children:c.label}),r?.batteryLevel!=null&&(0,C.jsx)(hV,{level:r.batteryLevel})]}),r?.progressPercent!=null&&(0,C.jsx)(pV,{percent:r.progressPercent}),r?.currentCode!=null&&(0,C.jsx)(mV,{code:r.currentCode,label:r.currentCodeLabel,severity:r.severity}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(vV,{label:`Start mowing`,busy:o,active:s===`mowing`,onClick:()=>l(n.startMowing),children:(0,C.jsx)(yR,{className:`h-5 w-5`})}),(0,C.jsx)(vV,{label:`Pause`,busy:o,active:s===`paused`,onClick:()=>l(n.pause),children:(0,C.jsx)(gR,{className:`h-5 w-5`})}),(0,C.jsx)(vV,{label:`Dock`,busy:o,active:s===`docked`,onClick:()=>l(n.dock),children:(0,C.jsx)(JL,{className:`h-5 w-5`})})]})]})]})})}function bV(e){switch(e){case`open`:return{label:`Open`,tone:`text-primary`};case`opening`:return{label:`Opening`,tone:`text-primary`};case`closing`:return{label:`Closing`,tone:`text-warning`};case`closed`:return{label:`Closed`,tone:`text-foreground-subtle`};case`stopped`:return{label:`Stopped`,tone:`text-warning`};case void 0:return{label:`Unknown`,tone:`text-foreground-subtle`}}}function xV(e,t){return Wz({trpc:e,deviceId:t,cap:e=>e.valve,slice:e=>e.state.valve})}function SV(e){switch(e){case`accent`:return`bg-primary text-primary-foreground`;case`filled`:return`bg-primary/15 text-primary`;case`neutral`:return``}}function CV({label:e,busy:t,variant:n,onClick:r,children:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),r()},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,SV(n),t&&`opacity-40 cursor-not-allowed`),children:a})}function wV({trpc:e,deviceId:t,optimistic:n}){let{cap:r,slice:a,available:o}=xV(e,t),{display:s,applyOptimistic:c}=rB(a,{enabled:n??!0});if(r===void 0)return null;let l=!o,u=iB(s?.state),d=(e,t)=>{l||!e||(t!==void 0&&c(t),e({}))};return(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,C.jsx)(CV,{label:`Open`,busy:l,variant:u.up,onClick:()=>d(r.open,{state:`opening`}),children:(0,C.jsx)(CL,{className:`h-3.5 w-3.5`})}),(0,C.jsx)(CV,{label:`Stop`,busy:l,variant:u.stop,onClick:()=>d(r.stop,{state:`stopped`}),children:(0,C.jsx)(LR,{className:`h-3 w-3`})}),(0,C.jsx)(CV,{label:`Close`,busy:l,variant:u.down,onClick:()=>d(r.close,{state:`closing`}),children:(0,C.jsx)(xL,{className:`h-3.5 w-3.5`})}),s!==void 0&&s.position!==null&&(0,C.jsxs)(`span`,{className:`tabular-nums text-xs text-foreground-subtle ml-1`,children:[s.position,`%`]})]})}function TV(e){switch(e){case`open`:return{glow:`bg-primary/15`,accent:`text-primary`,flowing:!0,active:!1};case`opening`:return{glow:`bg-primary/10`,accent:`text-primary`,flowing:!0,active:!0};case`closing`:return{glow:`bg-warning/10`,accent:`text-warning`,flowing:!1,active:!0};case`closed`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,flowing:!1,active:!1};case`stopped`:return{glow:`bg-warning/10`,accent:`text-warning`,flowing:!1,active:!1};case void 0:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,flowing:!1,active:!1}}}function EV(e){switch(e){case`open`:return 0;case`opening`:return 0;case`closed`:return 1;case`closing`:return 1;case`stopped`:return 1;case void 0:return 1}}function DV({state:e,position:t,interactive:n,onSetPosition:r}){let a=TV(e),o=t===null?EV(e):1-t/100,s=41+o*8,c=-90*(1-o),l=(0,S.useRef)(null),u=(0,S.useRef)(!1),d=(0,S.useRef)(null),f=e=>{let n=t??0,r=l.current;if(r===null)return n;let a=r.getBoundingClientRect();if(a.height<=0)return n;let o=(e-a.top)/a.height,s=Math.round(100-o*100);return Math.min(100,Math.max(0,s))},p=e=>{if(r===void 0)return;let t=f(e);d.current!==t&&(d.current=t,r(t))},m=e=>{n&&(e.stopPropagation(),e.preventDefault(),u.current=!0,d.current=null,e.currentTarget.setPointerCapture(e.pointerId),p(e.clientY))},h=e=>{!n||!u.current||(e.stopPropagation(),p(e.clientY))},g=e=>{!n||!u.current||(e.stopPropagation(),u.current=!1,d.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,C.jsxs)(`div`,{ref:l,"data-testid":`valve-graphic`,...n?{"aria-label":`Drag to set position`,role:`slider`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t??0}:{"aria-hidden":`true`},onPointerDown:n?m:void 0,onPointerMove:n?h:void 0,onPointerUp:n?g:void 0,onPointerCancel:n?g:void 0,className:Z(`relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0`,n&&`cursor-ns-resize touch-none select-none`),style:{boxShadow:`inset 0 0 0 2px rgba(255,255,255,.06)`},children:[(0,C.jsx)(`div`,{className:Z(`absolute inset-0 transition-colors duration-300`,a.glow)}),(0,C.jsx)(`div`,{className:Z(`absolute inset-0 flex items-center justify-center`,a.accent),"aria-hidden":`true`,children:(0,C.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`w-24 h-28`,fill:`none`,children:[(0,C.jsx)(`rect`,{x:`40`,y:`4`,width:`20`,height:`92`,rx:`3`,fill:`currentColor`,fillOpacity:`0.06`,stroke:`currentColor`,strokeWidth:`2.5`}),a.flowing&&(0,C.jsx)(`line`,{x1:`50`,y1:`8`,x2:`50`,y2:`92`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,strokeDasharray:`4 8`,opacity:`0.5`,className:`animate-pulse`}),a.active&&(0,C.jsx)(`circle`,{cx:`50`,cy:`50`,r:`22`,stroke:`currentColor`,strokeWidth:`2`,opacity:`0.4`,className:`animate-ping`,style:{transformOrigin:`center`}}),(0,C.jsx)(`circle`,{cx:`50`,cy:`50`,r:`17`,fill:`currentColor`,fillOpacity:`0.12`,stroke:`currentColor`,strokeWidth:`2.5`}),(0,C.jsx)(`rect`,{x:`43`,y:s,width:`14`,height:`6`,rx:`1.5`,fill:`currentColor`,fillOpacity:`0.55`,className:`transition-all duration-200`}),(0,C.jsx)(`line`,{x1:`50`,y1:`33`,x2:`50`,y2:`22`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`}),(0,C.jsx)(`g`,{style:{transform:`rotate(${c}deg)`,transformOrigin:`50px 20px`,transition:`transform 200ms`},children:(0,C.jsx)(`rect`,{x:`34`,y:`17`,width:`32`,height:`6`,rx:`3`,fill:`currentColor`,fillOpacity:`0.7`})})]})})]})}function OV({label:e,busy:t,variant:n,onClick:r,children:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),r()},className:Z(`inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,SV(n),t&&`opacity-40 cursor-not-allowed`),children:a})}function kV({trpc:e,deviceId:t,features:n,optimistic:r}){let{cap:a,slice:o,available:s}=xV(e,t),{display:c,applyOptimistic:l}=rB(o,{enabled:r??!0});if(a===void 0)return null;let u=!s,d=(n??[]).includes(js.ValvePositionable),f=iB(c?.state),p=bV(c?.state),m=c?.position??null,h=m!==null,g=(e,t)=>{u||!e||(t!==void 0&&l(t),e({}))},_=e=>{u||(l({position:e}),a.setPosition({position:e}))};return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,C.jsx)(DV,{state:c?.state,position:m,interactive:d&&h,onSetPosition:d&&h?_:void 0}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[h&&(0,C.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums text-foreground`,children:m}),(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle`,children:`%`}),(0,C.jsx)(`span`,{className:`text-xs text-foreground-subtle ml-1`,children:`open`})]}),!h&&(0,C.jsx)(`div`,{className:`flex items-baseline gap-1`,children:(0,C.jsx)(`span`,{className:Z(`text-3xl font-semibold`,p.tone),children:p.label})}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(OV,{label:`Open`,busy:u,variant:f.up,onClick:()=>g(a.open,{state:`opening`}),children:(0,C.jsx)(CL,{className:`h-5 w-5`})}),(0,C.jsx)(OV,{label:`Stop`,busy:u,variant:f.stop,onClick:()=>g(a.stop,{state:`stopped`}),children:(0,C.jsx)(LR,{className:`h-4 w-4`})}),(0,C.jsx)(OV,{label:`Close`,busy:u,variant:f.down,onClick:()=>g(a.close,{state:`closing`}),children:(0,C.jsx)(xL,{className:`h-5 w-5`})})]})]})]}),d&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:`w-12 shrink-0`,children:`Position`}),(0,C.jsx)(`input`,{"aria-label":`Position`,type:`range`,min:0,max:100,step:1,value:m??0,disabled:u,className:`flex-1`,onChange:e=>{_(Number(e.target.value))}}),(0,C.jsxs)(`span`,{className:`w-8 text-right tabular-nums`,children:[m??`—`,`%`]})]}),!d&&h&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:`w-12 shrink-0`,children:`Position`}),(0,C.jsx)(`input`,{"aria-label":`Position`,type:`range`,min:0,max:100,step:1,value:m,disabled:!0,readOnly:!0,className:`flex-1 opacity-60`}),(0,C.jsxs)(`span`,{className:`w-8 text-right tabular-nums`,children:[m,`%`]})]})]})}function AV(e,t){switch(t){case`humidifying`:return{glow:`bg-primary/15`,accent:`text-primary`,misting:!0};case`drying`:return{glow:`bg-warning/10`,accent:`text-warning`,misting:!1};case`idle`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,misting:!1};case`off`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,misting:!1};default:return e?{glow:`bg-primary/10`,accent:`text-primary`,misting:!0}:{glow:`bg-transparent`,accent:`text-foreground-subtle`,misting:!1}}}function jV(e,t){return Wz({trpc:e,deviceId:t,cap:e=>e.humidifier,slice:e=>e.state.humidifier})}function MV({trpc:e,deviceId:t,optimistic:n}){let{cap:r,slice:a,available:o}=jV(e,t),{display:s,applyOptimistic:c}=rB(a,{enabled:n??!0});if(r===void 0)return null;let l=!o,u=s?.on??!1,d=()=>{l||(c({on:!u}),r.setOn({on:!u}))};return(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-2`,children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":u?`Turn off`:`Turn on`,title:u?`Turn off`:`Turn on`,disabled:l,onClick:e=>{e.stopPropagation(),d()},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-xs transition-colors`,u?`bg-primary text-primary-foreground`:`text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,l&&`opacity-40 cursor-not-allowed`),children:(0,C.jsx)(bR,{className:`h-3.5 w-3.5`})}),s!==void 0&&s.targetHumidity!==null&&(0,C.jsxs)(`span`,{className:`tabular-nums text-xs text-foreground-subtle`,children:[s.currentHumidity!==null&&(0,C.jsxs)(C.Fragment,{children:[s.currentHumidity,`%`,(0,C.jsx)(`span`,{className:`mx-0.5`,children:`→`})]}),s.targetHumidity,`%`]})]})}function NV({fillPct:e,tint:t}){let n=82-Math.min(100,Math.max(0,e))/100*56,r=`humidifier-droplet-clip-${(0,S.useId)()}`;return(0,C.jsxs)(`div`,{"data-testid":`humidifier-graphic`,"aria-hidden":`true`,className:`relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0`,style:{boxShadow:`inset 0 0 0 2px rgba(255,255,255,.06)`},children:[(0,C.jsx)(`div`,{className:Z(`absolute inset-0 transition-colors duration-300`,t.glow)}),(0,C.jsx)(`div`,{className:Z(`absolute inset-0 flex items-center justify-center`,t.accent),children:(0,C.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`w-24 h-28`,fill:`none`,children:[(0,C.jsx)(`defs`,{children:(0,C.jsx)(`clipPath`,{id:r,children:(0,C.jsx)(`path`,{d:`M50 26 C50 26 30 52 30 66 a20 20 0 0 0 40 0 C70 52 50 26 50 26 Z`})})}),t.misting&&(0,C.jsxs)(`g`,{className:`animate-pulse`,opacity:`0.55`,children:[(0,C.jsx)(`line`,{x1:`42`,y1:`20`,x2:`42`,y2:`8`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`3 5`}),(0,C.jsx)(`line`,{x1:`50`,y1:`18`,x2:`50`,y2:`4`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`3 5`}),(0,C.jsx)(`line`,{x1:`58`,y1:`20`,x2:`58`,y2:`8`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`3 5`})]}),(0,C.jsx)(`path`,{d:`M50 26 C50 26 30 52 30 66 a20 20 0 0 0 40 0 C70 52 50 26 50 26 Z`,fill:`currentColor`,fillOpacity:`0.08`,stroke:`currentColor`,strokeWidth:`2.5`}),(0,C.jsx)(`g`,{clipPath:`url(#${r})`,children:(0,C.jsx)(`rect`,{x:`28`,y:n,width:`44`,height:`60`,fill:`currentColor`,fillOpacity:`0.4`,className:`transition-all duration-300`})}),(0,C.jsx)(`circle`,{cx:`43`,cy:`56`,r:`3`,fill:`currentColor`,fillOpacity:`0.5`})]})})]})}function PV({trpc:e,deviceId:t,optimistic:n}){let{cap:r,slice:a,available:o}=jV(e,t),{display:s,applyOptimistic:c}=rB(a,{enabled:n??!0});if(r===void 0||s===void 0)return null;let l=!o,u=AV(s.on,s.action),d=s.minHumidity??0,f=s.maxHumidity??100,p=s.targetHumidity,m=s.currentHumidity,h=m??p??0,g=()=>{l||(c({on:!s.on}),r.setOn({on:!s.on}))},_=e=>{l||(c({targetHumidity:e}),r.setTargetHumidity({humidity:e}))};return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,C.jsx)(NV,{fillPct:h,tint:u}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums text-foreground`,children:p===null?`—`:p}),(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle`,children:`%`}),(0,C.jsx)(`span`,{className:`text-xs text-foreground-subtle ml-1`,children:`target`})]}),(0,C.jsxs)(`div`,{className:`text-xs text-foreground-subtle tabular-nums`,children:[`Current: `,m===null?`—`:`${m}%`,s.action!==null&&(0,C.jsxs)(`span`,{className:`ml-2 capitalize`,children:[`· `,s.action]})]}),(0,C.jsxs)(`button`,{type:`button`,"aria-label":s.on?`Turn off`:`Turn on`,disabled:l,onClick:e=>{e.stopPropagation(),g()},className:Z(`inline-flex w-fit items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors`,s.on?`bg-primary text-primary-foreground`:`border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,l&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(bR,{className:`h-4 w-4`}),s.on?`On`:`Off`]})]})]}),(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:`w-12 shrink-0`,children:`Target`}),(0,C.jsx)(`input`,{"aria-label":`Target humidity`,type:`range`,min:d,max:f,step:1,value:p??d,disabled:l,className:`flex-1`,onChange:e=>{_(Number(e.target.value))}}),(0,C.jsxs)(`span`,{className:`w-8 text-right tabular-nums`,children:[p??`—`,`%`]})]}),s.availableModes.length>0&&(0,C.jsx)(`select`,{"aria-label":`Mode`,value:s.mode??``,disabled:l,onChange:e=>{e.stopPropagation();let t=s.availableModes.find(t=>t===e.target.value);!l&&t!==void 0&&(c({mode:t}),r.setMode({mode:t}))},className:Z(`w-full rounded border border-border bg-surface px-3 py-1.5 text-sm`,l&&`opacity-40 cursor-not-allowed`),children:s.availableModes.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))})]})}function FV(e){switch(e){case`heating`:return{glow:`bg-warning/10`,accent:`text-warning`,heating:!0};case`idle`:return{glow:`bg-primary/10`,accent:`text-primary`,heating:!1};case`off`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`,heating:!1}}}function IV(e,t,n){return e===null||e===`off`?`off`:t!==null&&n!==null&&t<n?`heating`:`idle`}function LV(e,t){return Wz({trpc:e,deviceId:t,cap:e=>e.waterHeater,slice:e=>e.state.waterHeater})}function RV({trpc:e,deviceId:t,optimistic:n}){let{cap:r,slice:a}=LV(e,t),{display:o}=rB(a,{enabled:n??!0});return r===void 0||o===void 0?null:(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 text-xs text-foreground-subtle`,children:[(0,C.jsxs)(`span`,{className:`tabular-nums`,children:[o.currentTemp!==null&&(0,C.jsxs)(C.Fragment,{children:[o.currentTemp,`°`,(0,C.jsx)(`span`,{className:`mx-0.5`,children:`→`})]}),o.targetTemp===null?`—`:`${o.targetTemp}°`]}),o.operationMode!==null&&(0,C.jsxs)(`span`,{className:`capitalize text-foreground-subtle/80`,children:[`· `,o.operationMode.replace(/_/g,` `)]})]})}function zV({fillPct:e,tint:t}){let n=86-Math.min(100,Math.max(0,e))/100*68,r=`water-heater-tank-clip-${(0,S.useId)()}`;return(0,C.jsxs)(`div`,{"data-testid":`water-heater-graphic`,"aria-hidden":`true`,className:`relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0`,style:{boxShadow:`inset 0 0 0 2px rgba(255,255,255,.06)`},children:[(0,C.jsx)(`div`,{className:Z(`absolute inset-0 transition-colors duration-300`,t.glow)}),(0,C.jsx)(`div`,{className:Z(`absolute inset-0 flex items-center justify-center`,t.accent),children:(0,C.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`w-24 h-28`,fill:`none`,children:[(0,C.jsx)(`defs`,{children:(0,C.jsx)(`clipPath`,{id:r,children:(0,C.jsx)(`rect`,{x:`30`,y:`18`,width:`40`,height:`68`,rx:`14`})})}),(0,C.jsx)(`g`,{clipPath:`url(#${r})`,children:(0,C.jsx)(`rect`,{x:`28`,y:n,width:`44`,height:`72`,fill:`currentColor`,fillOpacity:`0.32`,className:`transition-all duration-300`})}),(0,C.jsx)(`rect`,{x:`30`,y:`18`,width:`40`,height:`68`,rx:`14`,fill:`currentColor`,fillOpacity:`0.06`,stroke:`currentColor`,strokeWidth:`2.5`}),(0,C.jsx)(`line`,{x1:`50`,y1:`18`,x2:`50`,y2:`8`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`}),(0,C.jsx)(`rect`,{x:`40`,y:`6`,width:`20`,height:`5`,rx:`2`,fill:`currentColor`,fillOpacity:`0.6`}),(0,C.jsx)(`g`,{className:t.heating?`animate-pulse`:void 0,opacity:t.heating?.9:.35,children:(0,C.jsx)(`path`,{d:`M38 74 q4 -6 8 0 q4 6 8 0 q4 -6 8 0`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,fill:`none`})}),(0,C.jsx)(`circle`,{cx:`62`,cy:`34`,r:`3.5`,stroke:`currentColor`,strokeWidth:`2`,fill:t.heating?`currentColor`:`none`,fillOpacity:`0.6`})]})})]})}function BV({trpc:e,deviceId:t,optimistic:n}){let{cap:r,slice:a,available:o}=LV(e,t),{display:s,applyOptimistic:c}=rB(a,{enabled:n??!0});if(r===void 0||s===void 0)return null;let l=!o,u=IV(s.operationMode,s.currentTemp,s.targetTemp),d=FV(u),f=s.currentTemp,p=s.targetTemp,m=s.minTemp,h=s.maxTemp,g=f!==null&&p!==null&&p>0?Math.min(100,f/p*100):f!==null&&h!==null&&h>0?Math.min(100,f/h*100):50,_=e=>{let t=e;return m!==null&&(t=Math.max(m,t)),h!==null&&(t=Math.min(h,t)),t},v=e=>{if(l||p===null)return;let t=_(p+e);c({targetTemp:t}),r.setTargetTemp({temp:t})},y=()=>{l||s.away===null||(c({away:!s.away}),r.setAway({on:!s.away}))};return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,C.jsx)(zV,{fillPct:g,tint:d}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums text-foreground`,children:f===null?`—`:f}),(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle`,children:`°`})]}),(0,C.jsxs)(`div`,{className:`text-xs text-foreground-subtle tabular-nums`,children:[`Target: `,p===null?`—`:`${p}°`,(0,C.jsxs)(`span`,{className:`ml-2 capitalize`,children:[`· `,u]})]}),p!==null&&(0,C.jsx)(`div`,{className:`w-[180px]`,children:(0,C.jsx)(Gz,{value:p,unit:`°`,onDelta:v})})]})]}),s.availableModes.length>0&&(0,C.jsx)(`select`,{"aria-label":`Operation mode`,value:s.operationMode??``,disabled:l,onChange:e=>{e.stopPropagation();let t=s.availableModes.find(t=>t===e.target.value);!l&&t!==void 0&&(c({operationMode:t}),r.setOperationMode({mode:t}))},className:Z(`w-full rounded border border-border bg-surface px-3 py-1.5 text-sm`,l&&`opacity-40 cursor-not-allowed`),children:s.availableModes.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))}),s.away!==null&&(0,C.jsxs)(`button`,{type:`button`,"aria-label":s.away?`Disable away mode`:`Enable away mode`,disabled:l,onClick:e=>{e.stopPropagation(),y()},className:Z(`inline-flex w-fit items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors`,s.away?`bg-primary text-primary-foreground`:`border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,l&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(bR,{className:`h-4 w-4`}),`Away `,s.away?`on`:`off`]})]})}function VV(e){switch(e){case`sunny`:return{label:`Sunny`,glyph:`sun`};case`clear-night`:return{label:`Clear night`,glyph:`clear-night`};case`partlycloudy`:return{label:`Partly cloudy`,glyph:`partly-cloudy`};case`cloudy`:return{label:`Cloudy`,glyph:`cloudy`};case`rainy`:return{label:`Rainy`,glyph:`rain`};case`pouring`:return{label:`Pouring`,glyph:`rain`};case`snowy`:return{label:`Snowy`,glyph:`snow`};case`snowy-rainy`:return{label:`Sleet`,glyph:`snow`};case`lightning`:return{label:`Lightning`,glyph:`lightning`};case`lightning-rainy`:return{label:`Thunderstorm`,glyph:`lightning`};case`fog`:return{label:`Fog`,glyph:`fog`};case`windy`:return{label:`Windy`,glyph:`wind`};case`windy-variant`:return{label:`Windy`,glyph:`wind`};case`hail`:return{label:`Hail`,glyph:`hail`};case`exceptional`:return{label:`Exceptional`,glyph:`cloudy`};case null:return{label:`Unknown`,glyph:`cloudy`};default:return{label:e,glyph:`cloudy`}}}function HV(e){switch(e){case`sunny`:return{glow:`bg-warning/15`,accent:`text-warning`};case`clear-night`:return{glow:`bg-primary/10`,accent:`text-primary`};case`partlycloudy`:return{glow:`bg-warning/10`,accent:`text-warning`};case`cloudy`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`};case`rainy`:case`pouring`:return{glow:`bg-primary/15`,accent:`text-primary`};case`snowy`:case`snowy-rainy`:return{glow:`bg-primary/10`,accent:`text-primary`};case`lightning`:case`lightning-rainy`:return{glow:`bg-warning/20`,accent:`text-warning`};case`fog`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`};case`windy`:case`windy-variant`:return{glow:`bg-transparent`,accent:`text-foreground-subtle`};case`hail`:return{glow:`bg-primary/10`,accent:`text-primary`};default:return{glow:`bg-transparent`,accent:`text-foreground-subtle`}}}function UV(e){let t=`h-4 w-4`;switch(e){case`sun`:return(0,C.jsx)(zR,{className:t});case`clear-night`:return(0,C.jsx)(lR,{className:t});case`partly-cloudy`:return(0,C.jsx)(jL,{className:t});case`cloudy`:return(0,C.jsx)(ML,{className:t});case`rain`:return(0,C.jsx)(kL,{className:t});case`snow`:return(0,C.jsx)(AL,{className:t});case`lightning`:return(0,C.jsx)(OL,{className:t});case`fog`:return(0,C.jsx)(DL,{className:t});case`wind`:return(0,C.jsx)(ez,{className:t});case`hail`:return(0,C.jsx)(AL,{className:t});default:return null}}function WV(e,t){return Wz({trpc:e,deviceId:t,cap:e=>e.weather,slice:e=>e.state.weather})}function GV(e,t){return e===null?`—`:`${Math.round(e)}${t??`°`}`}function KV({trpc:e,deviceId:t}){let{slice:n}=WV(e,t);if(n===void 0)return null;let r=VV(n.condition);return(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:Z(`inline-flex`,HV(n.condition).accent),title:r.label,"aria-label":r.label,children:UV(r.glyph)}),(0,C.jsx)(`span`,{className:`tabular-nums`,children:GV(n.temperature,n.temperatureUnit)})]})}function qV({glyph:e,tint:t}){let n=(0,S.useId)();return(0,C.jsxs)(`div`,{"data-testid":`weather-scene`,"aria-hidden":`true`,className:`relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0`,style:{boxShadow:`inset 0 0 0 2px rgba(255,255,255,.06)`},children:[(0,C.jsx)(`div`,{className:Z(`absolute inset-0 transition-colors duration-300`,t.glow)}),(0,C.jsx)(`div`,{className:Z(`absolute inset-0 flex items-center justify-center`,t.accent),children:(0,C.jsx)(`svg`,{viewBox:`0 0 100 100`,className:`w-24 h-28`,fill:`none`,"data-glyph":e,children:YV(e,n)})})]})}function JV({cx:e,cy:t,scale:n=1}){return(0,C.jsx)(`g`,{transform:`translate(${e} ${t}) scale(${n})`,children:(0,C.jsx)(`path`,{d:`M-22 8 a13 13 0 0 1 4 -25 a16 16 0 0 1 30 4 a11 11 0 0 1 -2 21 Z`,fill:`currentColor`,fillOpacity:`0.12`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinejoin:`round`})})}function YV(e,t){switch(e){case`sun`:return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(`circle`,{cx:`50`,cy:`48`,r:`16`,fill:`currentColor`,fillOpacity:`0.18`,stroke:`currentColor`,strokeWidth:`2.5`}),(0,C.jsx)(`g`,{stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,children:[0,45,90,135,180,225,270,315].map(e=>{let n=e*Math.PI/180;return(0,C.jsx)(`line`,{x1:50+Math.cos(n)*22,y1:48+Math.sin(n)*22,x2:50+Math.cos(n)*30,y2:48+Math.sin(n)*30},`${t}-ray-${e}`)})})]});case`clear-night`:return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(`path`,{d:`M62 30 a22 22 0 1 0 8 38 a18 18 0 0 1 -8 -38 Z`,fill:`currentColor`,fillOpacity:`0.18`,stroke:`currentColor`,strokeWidth:`2.5`}),(0,C.jsx)(`circle`,{cx:`34`,cy:`32`,r:`1.6`,fill:`currentColor`}),(0,C.jsx)(`circle`,{cx:`28`,cy:`48`,r:`1.2`,fill:`currentColor`}),(0,C.jsx)(`circle`,{cx:`40`,cy:`62`,r:`1.4`,fill:`currentColor`})]});case`partly-cloudy`:return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(`circle`,{cx:`38`,cy:`38`,r:`12`,fill:`currentColor`,fillOpacity:`0.18`,stroke:`currentColor`,strokeWidth:`2.5`}),(0,C.jsx)(`g`,{stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,children:[200,240,300].map(e=>{let n=e*Math.PI/180;return(0,C.jsx)(`line`,{x1:38+Math.cos(n)*16,y1:38+Math.sin(n)*16,x2:38+Math.cos(n)*22,y2:38+Math.sin(n)*22},`${t}-pcray-${e}`)})}),(0,C.jsx)(JV,{cx:58,cy:60})]});case`cloudy`:return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(JV,{cx:40,cy:44,scale:.9}),(0,C.jsx)(JV,{cx:62,cy:58})]});case`rain`:return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(JV,{cx:50,cy:42}),(0,C.jsxs)(`g`,{className:`animate-pulse`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,opacity:`0.7`,children:[(0,C.jsx)(`line`,{x1:`38`,y1:`62`,x2:`34`,y2:`78`}),(0,C.jsx)(`line`,{x1:`50`,y1:`62`,x2:`46`,y2:`80`}),(0,C.jsx)(`line`,{x1:`62`,y1:`62`,x2:`58`,y2:`78`})]})]});case`snow`:return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(JV,{cx:50,cy:42}),(0,C.jsxs)(`g`,{fill:`currentColor`,opacity:`0.8`,className:`animate-pulse`,children:[(0,C.jsx)(`circle`,{cx:`38`,cy:`70`,r:`2.5`}),(0,C.jsx)(`circle`,{cx:`50`,cy:`76`,r:`2.5`}),(0,C.jsx)(`circle`,{cx:`62`,cy:`70`,r:`2.5`})]})]});case`lightning`:return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(JV,{cx:50,cy:40}),(0,C.jsx)(`path`,{d:`M52 58 L42 74 L50 74 L46 88 L62 68 L53 68 L58 58 Z`,fill:`currentColor`,fillOpacity:`0.85`,className:`animate-pulse`})]});case`fog`:return(0,C.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,opacity:`0.6`,children:[(0,C.jsx)(`line`,{x1:`26`,y1:`40`,x2:`74`,y2:`40`}),(0,C.jsx)(`line`,{x1:`30`,y1:`52`,x2:`70`,y2:`52`}),(0,C.jsx)(`line`,{x1:`24`,y1:`64`,x2:`68`,y2:`64`}),(0,C.jsx)(`line`,{x1:`32`,y1:`76`,x2:`76`,y2:`76`})]});case`wind`:return(0,C.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,fill:`none`,opacity:`0.75`,children:[(0,C.jsx)(`path`,{d:`M22 42 H60 a7 7 0 1 0 -7 -7`}),(0,C.jsx)(`path`,{d:`M22 56 H72 a7 7 0 1 1 -7 7`}),(0,C.jsx)(`path`,{d:`M22 70 H52 a6 6 0 1 0 -6 -6`})]});case`hail`:return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(JV,{cx:50,cy:42}),(0,C.jsxs)(`g`,{fill:`currentColor`,opacity:`0.85`,className:`animate-pulse`,children:[(0,C.jsx)(`circle`,{cx:`40`,cy:`70`,r:`3`}),(0,C.jsx)(`circle`,{cx:`52`,cy:`78`,r:`3`}),(0,C.jsx)(`circle`,{cx:`62`,cy:`68`,r:`3`})]})]});default:return null}}function XV({icon:e,label:t,value:n}){return(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-foreground-subtle`,title:t,children:[(0,C.jsx)(`span`,{className:`inline-flex text-foreground-subtle`,"aria-hidden":`true`,children:e}),(0,C.jsx)(`span`,{className:`tabular-nums text-foreground`,children:n})]})}function ZV({trpc:e,deviceId:t}){let{slice:n}=WV(e,t);if(n===void 0)return null;let r=VV(n.condition),a=HV(n.condition),o=n.temperatureUnit??`°`;return(0,C.jsx)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:(0,C.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,C.jsx)(qV,{glyph:r.glyph,tint:a}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums text-foreground`,children:n.temperature===null?`—`:Math.round(n.temperature)}),(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle`,children:o}),(0,C.jsx)(`span`,{className:`text-xs text-foreground-subtle ml-2 capitalize`,children:r.label})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n.humidity!==null&&(0,C.jsx)(XV,{icon:(0,C.jsx)(RL,{className:`h-3.5 w-3.5`}),label:`Humidity`,value:`${Math.round(n.humidity)}%`}),n.windSpeed!==null&&(0,C.jsx)(XV,{icon:n.windBearing===null?(0,C.jsx)(ez,{className:`h-3.5 w-3.5`}):(0,C.jsx)(mR,{className:`h-3.5 w-3.5`,style:{transform:`rotate(${n.windBearing}deg)`}}),label:`Wind`,value:`${Math.round(n.windSpeed)} ${n.windSpeedUnit??``}`.trim()}),n.pressure!==null&&(0,C.jsx)(XV,{icon:(0,C.jsx)(KL,{className:`h-3.5 w-3.5`}),label:`Pressure`,value:`${Math.round(n.pressure)} ${n.pressureUnit??``}`.trim()})]})]})]})})}function QV(e,t){return Wz({trpc:e,deviceId:t,cap:e=>e.image,slice:e=>e.state.image})}var $V=1,eH=6,tH=.5;function nH({url:e,alt:t,open:n,onOpenChange:r}){let[a,o]=(0,S.useState)(1);(0,S.useEffect)(()=>{n&&o(1)},[n,e]);let s=(0,S.useCallback)(()=>o(e=>Math.min(eH,e+tH)),[]),c=(0,S.useCallback)(()=>o(e=>Math.max($V,e-tH)),[]),l=(0,S.useCallback)(()=>o(1),[]);return(0,C.jsx)(Oz,{open:n,onOpenChange:r,children:(0,C.jsxs)(Az,{width:`lg`,className:`max-w-5xl p-6`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-3`,children:[(0,C.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:t}),(0,C.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,C.jsx)(rH,{label:`Zoom out`,disabled:a<=$V,onClick:c,children:(0,C.jsx)(az,{className:`h-4 w-4`})}),(0,C.jsxs)(`span`,{className:`tabular-nums text-xs text-foreground-subtle w-10 text-center`,children:[Math.round(a*100),`%`]}),(0,C.jsx)(rH,{label:`Zoom in`,disabled:a>=eH,onClick:s,children:(0,C.jsx)(iz,{className:`h-4 w-4`})}),(0,C.jsx)(rH,{label:`Reset zoom`,disabled:a===1,onClick:l,children:(0,C.jsx)(CR,{className:`h-4 w-4`})}),(0,C.jsx)(rH,{label:`Close`,onClick:()=>r(!1),children:(0,C.jsx)(nz,{className:`h-4 w-4`})})]})]}),(0,C.jsx)(`div`,{className:`max-h-[78vh] overflow-auto rounded border border-border bg-gradient-to-b from-surface-hover to-surface p-6`,children:(0,C.jsx)(`img`,{src:e,alt:t,style:{width:`${a*100}%`,maxWidth:`none`},className:`mx-auto block h-auto transition-[width] duration-150`})})]})})}function rH({label:e,disabled:t,onClick:n,children:r}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:n,className:`inline-flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:r})}function iH({trpc:e,deviceId:t}){let{slice:n}=QV(e,t),[r,a]=(0,S.useState)(!1);if(n===void 0)return null;let o=n.url;return o===null?(0,C.jsx)(`span`,{className:`inline-flex h-7 w-7 items-center justify-center rounded bg-surface-hover text-foreground-subtle`,title:`No image`,children:(0,C.jsx)(YL,{className:`h-4 w-4`,"aria-hidden":`true`})}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`button`,{type:`button`,title:`View image`,onClick:e=>{e.stopPropagation(),a(!0)},className:`inline-flex items-center justify-center rounded ring-offset-1 hover:ring-2 hover:ring-primary/50 transition`,children:(0,C.jsx)(`img`,{src:o,alt:`Image`,className:`h-7 w-7 rounded object-cover`})}),(0,C.jsx)(nH,{url:o,alt:`Image`,open:r,onOpenChange:a})]})}function aH({trpc:e,deviceId:t,deviceName:n}){let{slice:r}=QV(e,t),[a,o]=(0,S.useState)(!1),[s,c]=(0,S.useState)(!1),l=r?.url??null;return(0,S.useEffect)(()=>{o(!1)},[l]),r===void 0?null:(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-3 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsx)(`div`,{className:`flex w-full items-center justify-center overflow-hidden rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface`,children:r.url!==null&&!a?(0,C.jsx)(`button`,{type:`button`,title:`View image`,onClick:()=>c(!0),className:`flex w-full cursor-zoom-in items-center justify-center`,children:(0,C.jsx)(`img`,{src:r.url,alt:n??`Image`,onError:()=>o(!0),className:`max-h-72 w-full object-contain`})}):(0,C.jsxs)(`div`,{"data-testid":`image-placeholder`,className:`flex h-48 w-full flex-col items-center justify-center gap-2 text-foreground-subtle`,children:[(0,C.jsx)(YL,{className:`h-8 w-8`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`text-xs`,children:`No image`})]})}),l!==null&&!a&&(0,C.jsx)(nH,{url:l,alt:n??`Image`,open:s,onOpenChange:c})]})}var oH=20,sH=9,cH=`#f59e0b`,lH=`#ef4444`;function uH(e){return Math.min(200,Math.max(4,e))}var dH=`
94
- @keyframes pf-eat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(2px)} }
95
- @keyframes pf-pulse { 0%,100%{opacity:.55} 50%{opacity:1} }
96
- @media (prefers-reduced-motion: reduce) {
97
- .pf-eat, .pf-pulse { animation: none !important; }
98
- }
99
- `;function fH({trpc:e,deviceId:t,layout:n,optimistic:r}){let{cap:a,slice:o,available:s}=Wz({trpc:e,deviceId:t,cap:e=>e.petFeeder,slice:e=>e.state.petFeeder}),{display:c,applyOptimistic:l}=rB(o,{enabled:r??!0}),[u,d]=(0,S.useState)(oH),[f,p]=(0,S.useState)(oH),[m,h]=(0,S.useState)(oH);if(a===void 0||c===void 0)return null;let g=!s,_=c.error&&c.error!==`no_error`?c.error:null,v=c.status===`offline`,y=c.status===`on_batteries`;if(n===`compact`)return(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-2`,children:[(_!==null||v)&&(0,C.jsx)(`span`,{className:`inline-flex items-center text-destructive`,title:_??`Offline`,"aria-label":_??`Offline`,children:v?(0,C.jsx)(QR,{className:`h-3.5 w-3.5`,"aria-hidden":!0}):(0,C.jsx)(GR,{className:`h-3.5 w-3.5`,"aria-hidden":!0})}),(0,C.jsxs)(`span`,{className:Z(`inline-flex items-center gap-1 text-xs tabular-nums font-medium`,c.lowFood?`text-destructive`:`text-foreground`),children:[(0,C.jsx)(qR,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),c.foodLevel??`—`,(0,C.jsx)(`span`,{className:`text-foreground-subtle`,children:`g`})]}),c.batteryPower!==null&&(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-xs tabular-nums text-foreground-subtle`,children:[(0,C.jsx)(fL,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),c.batteryPower,`%`]}),(0,C.jsxs)(`button`,{type:`button`,"aria-label":`Feed now`,disabled:g||c.feeding,onClick:e=>{e.stopPropagation(),!(g||c.feeding)&&(l({feeding:!0}),a.feed({grams:oH}))},className:Z(`inline-flex items-center gap-1 rounded-md border border-border bg-surface px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-surface-hover`,(g||c.feeding)&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(_R,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Feed`]})]});let b=e=>{g||c.feeding||(l({feeding:!0}),a.feed({grams:uH(e)}))};return(0,C.jsxs)(`div`,{className:`relative flex flex-col items-stretch gap-3 overflow-hidden rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsx)(`style`,{children:dH}),(0,C.jsxs)(`div`,{className:`flex items-center gap-4 rounded-lg border border-border/50 bg-surface-subtle/40 p-3`,children:[(0,C.jsx)(hH,{grams:c.foodLevel,low:c.lowFood,eating:c.feeding}),(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,C.jsx)(`span`,{className:`text-3xl font-bold leading-none tabular-nums`,style:{color:c.lowFood?lH:cH},children:c.foodLevel??`—`}),(0,C.jsx)(`span`,{className:`text-sm text-foreground-subtle`,children:`g in bowl`})]}),(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-foreground-subtle`,children:[c.batteryPower!==null&&(0,C.jsx)(mH,{icon:(0,C.jsx)(fL,{className:`h-3.5 w-3.5`}),label:`${c.batteryPower}%`}),c.desiccantLeftDays!==null&&(0,C.jsx)(mH,{icon:(0,C.jsx)(ez,{className:`h-3.5 w-3.5`}),label:`${c.desiccantLeftDays}d desiccant`}),y&&(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-amber-500`,children:[(0,C.jsx)(pL,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`On battery`]}),v?(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-destructive`,children:[(0,C.jsx)(QR,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Offline`]}):c.feeding?(0,C.jsxs)(`span`,{className:`pf-pulse inline-flex items-center gap-1 font-medium text-amber-500`,style:{animation:`pf-pulse 1.2s ease-in-out infinite`},children:[(0,C.jsx)(_R,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Feeding…`]}):c.lowFood?(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-destructive`,children:[(0,C.jsx)(uL,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Low food`]}):(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-success`,children:[(0,C.jsx)(wL,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Ready`]})]})]})]}),_!==null&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs font-medium text-destructive`,children:[(0,C.jsx)(GR,{className:`mt-px h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,C.jsx)(`span`,{className:`min-w-0 break-words`,children:_})]}),c.isDualHopper?(0,C.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,C.jsx)(gH,{label:`Hopper 1`,grams:f,busy:g||c.feeding,onGrams:p,onFeed:()=>{g||c.feeding||(l({feeding:!0}),a.feed({hopper1:uH(f)}))}}),(0,C.jsx)(gH,{label:`Hopper 2`,grams:m,busy:g||c.feeding,onGrams:h,onFeed:()=>{g||c.feeding||(l({feeding:!0}),a.feed({hopper2:uH(m)}))}})]}):(0,C.jsx)(gH,{label:`Manual feed`,grams:u,busy:g||c.feeding,onGrams:d,onFeed:()=>b(u)}),(0,C.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,C.jsx)(vH,{icon:(0,C.jsx)(_R,{className:`h-4 w-4`}),label:`Call pet`,busy:g,onClick:()=>void a.callPet({})}),(0,C.jsx)(vH,{icon:(0,C.jsx)(SR,{className:`h-4 w-4`}),label:`Reset desiccant`,busy:g,onClick:()=>void a.resetDesiccant({})}),(0,C.jsx)(vH,{icon:(0,C.jsx)(qR,{className:`h-4 w-4`}),label:`Mark refilled`,busy:g,onClick:()=>void a.markFoodReplenished({})})]}),c.feeding&&(0,C.jsxs)(`button`,{type:`button`,disabled:g,onClick:()=>{l({feeding:!1}),a.cancelFeed({})},className:Z(`flex items-center justify-center gap-2 rounded-lg border border-destructive/40 bg-destructive/10 px-2 py-1.5 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20`,g&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(uL,{className:`h-4 w-4`,"aria-hidden":!0}),`Cancel feed`]}),(0,C.jsx)(pH,{label:`Settings`,children:(0,C.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,C.jsx)(yH,{icon:(0,C.jsx)(rR,{className:`h-4 w-4`}),label:`Child lock`,on:c.childLock,busy:g,onToggle:e=>{l({childLock:e}),a.setChildLock({on:e})}}),(0,C.jsx)(yH,{icon:(0,C.jsx)(QL,{className:`h-4 w-4`}),label:`Light`,on:c.indicatorLight,busy:g,onToggle:e=>{l({indicatorLight:e}),a.setIndicatorLight({on:e})}}),(0,C.jsx)(yH,{icon:(0,C.jsx)(mL,{className:`h-4 w-4`}),label:`Feed sound`,on:c.feedSound,busy:g,onToggle:e=>{l({feedSound:e}),a.setFeedSound({on:e})}})]})}),(0,C.jsx)(pH,{label:`Volume`,children:(0,C.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,C.jsx)(YR,{className:`h-4 w-4 shrink-0 text-foreground-subtle`,"aria-hidden":!0}),(0,C.jsx)(_H,{label:`Decrease volume`,symbol:`−`,disabled:g||c.volume<=0,onClick:()=>{let e=Math.max(0,c.volume-1);l({volume:e}),a.setVolume({level:e})}}),(0,C.jsx)(`span`,{className:`w-6 text-center text-lg font-semibold tabular-nums text-foreground`,children:c.volume}),(0,C.jsx)(_H,{label:`Increase volume`,symbol:`+`,disabled:g||c.volume>=sH,onClick:()=>{let e=Math.min(sH,c.volume+1);l({volume:e}),a.setVolume({level:e})}})]})})]})}function pH({label:e,children:t}){return(0,C.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,C.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:e}),t]})}function mH({icon:e,label:t}){return(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 tabular-nums`,children:[(0,C.jsx)(`span`,{className:`text-foreground-subtle`,children:e}),t]})}function hH({grams:e,low:t,eating:n}){let r=Math.min(1,Math.max(0,(e??0)/200)),a=t?lH:cH,o=52-r*24;return(0,C.jsxs)(`svg`,{width:72,height:72,viewBox:`0 0 72 72`,role:`img`,"aria-label":e===null?`Food level unknown`:`${e} grams in bowl`,className:`shrink-0`,children:[(0,C.jsx)(`defs`,{children:(0,C.jsx)(`clipPath`,{id:`pf-bowl-clip`,children:(0,C.jsx)(`path`,{d:`M14 26 H58 L52 54 A6 6 0 0 1 46 58 H26 A6 6 0 0 1 20 54 Z`})})}),(0,C.jsxs)(`g`,{clipPath:`url(#pf-bowl-clip)`,className:n?`pf-eat`:void 0,style:n?{animation:`pf-eat 1.1s ease-in-out infinite`}:void 0,children:[(0,C.jsx)(`rect`,{x:`14`,y:o,width:`44`,height:`34`,fill:a,opacity:.9}),(0,C.jsx)(`ellipse`,{cx:`36`,cy:o,rx:`22`,ry:`4`,fill:a})]}),(0,C.jsx)(`path`,{d:`M14 26 H58 L52 54 A6 6 0 0 1 46 58 H26 A6 6 0 0 1 20 54 Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:`text-border`}),(0,C.jsx)(`rect`,{x:`11`,y:`22`,width:`50`,height:`6`,rx:`3`,fill:`currentColor`,className:`text-border`})]})}function gH({label:e,grams:t,busy:n,onGrams:r,onFeed:a}){return(0,C.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,C.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:e}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-1 rounded-lg border border-border/60 bg-surface-subtle px-1 py-1`,children:[(0,C.jsx)(_H,{label:`Decrease ${e} portion`,symbol:`−`,disabled:n||t<=4,onClick:()=>r(uH(t-1))}),(0,C.jsxs)(`span`,{className:`w-12 text-center text-sm font-semibold tabular-nums text-foreground`,children:[t,(0,C.jsx)(`span`,{className:`text-xs text-foreground-subtle`,children:`g`})]}),(0,C.jsx)(_H,{label:`Increase ${e} portion`,symbol:`+`,disabled:n||t>=200,onClick:()=>r(uH(t+1))})]}),(0,C.jsxs)(`button`,{type:`button`,disabled:n,onClick:a,className:Z(`flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent bg-amber-400 px-2 py-2 text-sm font-semibold text-amber-950 transition-colors hover:bg-amber-300 active:scale-95`,n&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(_R,{className:`h-4 w-4`,"aria-hidden":!0}),`Feed`]})]})]})}function _H({label:e,symbol:t,disabled:n,onClick:r}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,disabled:n,onClick:r,className:Z(`flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border bg-surface text-base leading-none text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground active:scale-95`,n&&`opacity-40 cursor-not-allowed`),children:t})}function vH({icon:e,label:t,busy:n,onClick:r}){return(0,C.jsxs)(`button`,{type:`button`,disabled:n,onClick:r,className:Z(`flex flex-col items-center justify-center gap-1 rounded-lg border border-border/60 bg-surface-subtle px-1 py-2 text-[11px] font-medium text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground`,n&&`opacity-40 cursor-not-allowed`),children:[e,t]})}function yH({icon:e,label:t,on:n,busy:r,onToggle:a}){return(0,C.jsxs)(`button`,{type:`button`,"aria-label":t,"aria-pressed":n,disabled:r,onClick:()=>{r||a(!n)},className:Z(`flex flex-col items-center justify-center gap-1 rounded-lg border px-1 py-2 text-[11px] font-medium transition-colors`,n?`border-transparent bg-indigo-400 text-indigo-950 shadow-sm`:`border-border/60 bg-surface-subtle text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,r&&`opacity-40 cursor-not-allowed`),children:[e,t]})}function bH({trpc:e,deviceId:t,features:n,optimistic:r}){return(0,C.jsx)(fH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r})}function xH({trpc:e,deviceId:t,features:n,optimistic:r}){return(0,C.jsx)(fH,{trpc:e,deviceId:t,features:n,layout:`full`,optimistic:r})}function SH({trpc:e,deviceId:t,optimistic:n}){let{cap:r,slice:a,available:o}=Wz({trpc:e,deviceId:t,cap:e=>e.switch,slice:e=>e.state.switch}),{display:s,applyOptimistic:c}=rB(a,{enabled:n??!0}),[l,u]=(0,S.useState)(!1);if(s===void 0)return null;let d=s.on===!0,f=l||!o,p={transform:d?`translateX(14px)`:`translateX(2px)`},m=async()=>{if(f||!r)return;let e=!d;c({on:e}),u(!0);try{await r.setState({on:e})}finally{u(!1)}};return(0,C.jsx)(`button`,{type:`button`,"aria-pressed":d,title:d?`Turn off`:`Turn on`,disabled:f,onClick:e=>{e.stopPropagation(),m()},className:Z(`relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0`,d?`bg-success/30 border-success/50`:`bg-surface-hover border-border`,f&&`opacity-60`),children:(0,C.jsx)(`span`,{className:Z(`absolute h-3 w-3 rounded-full transition-all`,d?`bg-success`:`bg-foreground-subtle`),style:p})})}function CH(e){return e instanceof Error?e.message:String(e)}function wH({trpc:e,deviceId:t,layout:n,optimistic:r,features:a}){let{cap:o,slice:s,available:c}=Wz({trpc:e,deviceId:t,cap:e=>e.lockControl,slice:e=>e.state.lockControl}),{display:l,applyOptimistic:u}=rB(s,{enabled:r??!0}),[d,f]=(0,S.useState)(null),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(null);if(l===void 0)return null;let _=l.state===`locked`||l.state===`locking`,v=!c||l.state===`jammed`,y=a?.includes(js.LockOpen)===!0,b=n===`compact`,x=()=>{u({state:`locking`}),o?.lock({})},w=()=>{u({state:`unlocking`}),o?.unlock({})},T=()=>{o?.open({})},E=()=>{if(!v){if(!_){x();return}if(b){g(null),f(`unlock`);return}w()}},D=()=>{if(!v){if(b){g(null),f(`open`);return}T()}},ee=()=>{p||f(null)},te=async()=>{if(!(p||d===null)){g(null),m(!0);try{d===`unlock`?(u({state:`unlocking`}),await o?.unlock({})):await o?.open({}),f(null)}catch(e){g(CH(e))}finally{m(!1)}}},O=_?`Unlock`:`Lock`,ne=d===`open`?`Open door?`:`Unlock device?`,re=d===`open`?`This will release the latch and open the door.`:`This will unlock the device.`,ie=d===`open`?`Confirm open`:`Confirm unlock`,ae=d===`open`?(0,C.jsx)(FL,{className:`h-4 w-4 text-amber-400`}):(0,C.jsx)(nR,{className:`h-4 w-4 text-amber-400`});return(0,C.jsxs)(`div`,{className:Z(`inline-flex items-center`,n===`full`?`gap-2`:`gap-1`),children:[(0,C.jsxs)(`button`,{type:`button`,"aria-label":O,title:l.state===`jammed`?`Jammed`:O,disabled:v,onClick:e=>{e.stopPropagation(),E()},className:Z(`inline-flex items-center justify-center rounded transition-colors`,n===`full`?`h-7 gap-1.5 px-2 text-xs`:`h-5 w-5`,_?`text-success`:`text-warning`,v&&`opacity-40 cursor-not-allowed`,`hover:bg-surface-hover`),children:[_?(0,C.jsx)(rR,{className:`h-3.5 w-3.5`}):(0,C.jsx)(nR,{className:`h-3.5 w-3.5`}),n===`full`&&(0,C.jsx)(`span`,{children:l.state})]}),y&&(0,C.jsxs)(`button`,{type:`button`,"aria-label":`Open door`,title:`Open door`,disabled:v,onClick:e=>{e.stopPropagation(),D()},className:Z(`inline-flex items-center justify-center rounded transition-colors`,n===`full`?`h-7 gap-1.5 px-2 text-xs`:`h-5 w-5`,`text-foreground-muted`,v&&`opacity-40 cursor-not-allowed`,`hover:bg-surface-hover`),children:[(0,C.jsx)(FL,{className:`h-3.5 w-3.5`}),n===`full`&&(0,C.jsx)(`span`,{children:`Open`})]}),b&&(0,C.jsx)(Oz,{open:d!==null,onOpenChange:e=>{e||ee()},children:(0,C.jsxs)(Az,{width:`sm`,onClick:e=>e.stopPropagation(),children:[(0,C.jsxs)(jz,{children:[(0,C.jsxs)(Nz,{className:`flex items-center gap-2`,children:[ae,ne]}),(0,C.jsx)(Pz,{children:re})]}),h!==null&&(0,C.jsx)(`div`,{className:`mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10 text-xs text-danger`,children:h}),(0,C.jsxs)(Mz,{children:[(0,C.jsx)(uz,{type:`button`,variant:`ghost`,size:`sm`,disabled:p,onClick:()=>ee(),children:`Cancel`}),(0,C.jsxs)(uz,{type:`button`,variant:`danger`,size:`sm`,"aria-label":ie,disabled:p,onClick:()=>{te()},children:[p&&(0,C.jsx)(tR,{className:`h-3.5 w-3.5 animate-spin`}),ie]})]})]})})]})}function TH({trpc:e,deviceId:t,layout:n,optimistic:r}){let{cap:a,slice:o,available:s}=Wz({trpc:e,deviceId:t,cap:e=>e.brightness,slice:e=>e.state.brightness}),{display:c,applyOptimistic:l}=rB(o,{enabled:r??!0});if(c===void 0)return null;let u=!s;return(0,C.jsxs)(`label`,{className:Z(`flex items-center gap-2 text-xs text-foreground-subtle`,n===`compact`&&`min-w-[140px]`),children:[(0,C.jsx)(`input`,{"aria-label":`Brightness`,type:`range`,min:0,max:100,step:1,value:c.percentage,disabled:u,onChange:e=>{let t=Number(e.target.value);l({percentage:t}),u||a?.setBrightness({percentage:t})}}),(0,C.jsxs)(`span`,{className:`tabular-nums w-8 text-right`,children:[c.percentage,`%`]})]})}function EH({trpc:e,deviceId:t,features:n,layout:r,optimistic:a}){let{cap:o,slice:s,available:c}=Wz({trpc:e,deviceId:t,cap:e=>e.fanControl,slice:e=>e.state.fanControl}),{display:l,applyOptimistic:u}=rB(s,{enabled:a??!0});if(l===void 0)return null;let d=!c,f=n??[],p=f.includes(`fan-speed`),m=f.includes(`fan-preset`),h=s?.percentageStep!=null&&s.percentageStep>0?s.percentageStep:1;return(0,C.jsxs)(`div`,{className:Z(`inline-flex items-center gap-2`,r===`full`&&`flex-col items-stretch`),children:[p&&(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`input`,{"aria-label":`Fan speed`,type:`range`,min:0,max:100,step:h,value:l.percentage??0,disabled:d,onChange:e=>{let t=Number(e.target.value),n=Math.min(100,Math.max(0,Math.round(t/h)*h));u({percentage:n}),d||o?.setPercentage({percentage:n})}}),(0,C.jsxs)(`span`,{className:`tabular-nums w-8 text-right`,children:[l.percentage??`—`,`%`]})]}),m&&l.availablePresets.length>0&&(0,C.jsx)(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:(0,C.jsxs)(`select`,{"aria-label":`Fan preset`,value:l.preset,disabled:d,onChange:e=>{let t=e.target.value;!d&&t&&(u({preset:t}),o?.setPreset({preset:t}))},className:`bg-surface border border-border rounded px-1 py-0.5`,children:[(0,C.jsx)(`option`,{value:``,disabled:!0,children:`—`}),l.availablePresets.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]})})]})}var DH={heat:`border-amber-400 bg-amber-50 dark:bg-amber-950`,cool:`border-blue-400 bg-blue-50 dark:bg-blue-950`,auto:`border-purple-400 bg-purple-50 dark:bg-purple-950`,heat_cool:`border-fuchsia-400 bg-fuchsia-50 dark:bg-fuchsia-950`,fan_only:`border-slate-400 bg-slate-50 dark:bg-slate-950`,dry:`border-cyan-400 bg-cyan-50 dark:bg-cyan-950`,off:`border-zinc-300 bg-zinc-50 dark:bg-zinc-900`},OH={heat:`text-amber-600 dark:text-amber-400`,cool:`text-blue-600 dark:text-blue-400`,auto:`text-purple-600 dark:text-purple-400`,heat_cool:`text-fuchsia-600 dark:text-fuchsia-400`,fan_only:`text-slate-600 dark:text-slate-400`,dry:`text-cyan-600 dark:text-cyan-400`,off:`text-foreground`},kH={heat:`bg-amber-400 text-amber-950`,cool:`bg-blue-400 text-blue-950`,auto:`bg-purple-400 text-purple-950`,heat_cool:`bg-fuchsia-400 text-fuchsia-950`,fan_only:`bg-slate-400 text-slate-950`,dry:`bg-cyan-400 text-cyan-950`,off:`bg-zinc-300 text-zinc-700`};function AH({trpc:e,deviceId:t,features:n,layout:r,optimistic:a}){let{cap:o,slice:s,available:c}=Wz({trpc:e,deviceId:t,cap:e=>e.climateControl,slice:e=>e.state.climateControl}),{display:l,applyOptimistic:u}=rB(s,{enabled:a??!0});if(o===void 0||l===void 0)return null;let d=!c;if(r===`compact`)return(0,C.jsxs)(`div`,{"data-mode":l.mode,className:`inline-flex items-center gap-1`,children:[(0,C.jsx)(`span`,{className:Z(`text-xs tabular-nums font-medium`,OH[l.mode]),children:l.target===null?l.currentTemp===null?null:(0,C.jsxs)(`span`,{className:`text-foreground-subtle`,children:[l.currentTemp,`°`]}):(0,C.jsxs)(C.Fragment,{children:[l.target,`°`,l.currentTemp!==null&&(0,C.jsxs)(`span`,{className:`text-foreground-subtle font-normal`,children:[` `,`(`,l.currentTemp,`°)`]})]})}),l.target!==null&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":`Decrease target`,disabled:d,onClick:e=>{if(e.stopPropagation(),!d&&l.target!==null){let e=l.target-1;u({target:e}),o.setTarget({target:e})}},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs`,d&&`opacity-40 cursor-not-allowed`),children:`−`}),(0,C.jsx)(`button`,{type:`button`,"aria-label":`Increase target`,disabled:d,onClick:e=>{if(e.stopPropagation(),!d&&l.target!==null){let e=l.target+1;u({target:e}),o.setTarget({target:e})}},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs`,d&&`opacity-40 cursor-not-allowed`),children:`+`})]}),(0,C.jsx)(`select`,{"aria-label":`Mode`,value:l.mode,disabled:d,onChange:e=>{e.stopPropagation();let t=e.target.value;d||(u({mode:t}),o.setMode({mode:t}))},className:Z(`bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer`,d&&`opacity-40 cursor-not-allowed`),children:l.availableModes.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))})]});let f=l.mode===`heat_cool`||l.targetLow!==null&&l.targetHigh!==null,p=!f&&l.target!==null;return(0,C.jsxs)(`div`,{"data-mode":l.mode,className:Z(`inline-flex items-center gap-2 rounded border px-2 py-1 transition-colors`,DH[l.mode],`flex-col items-stretch gap-3`),children:[(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1 text-xs tabular-nums`,children:[l.currentTemp!==null&&(0,C.jsxs)(`span`,{className:`text-foreground-subtle`,children:[l.currentTemp,`°`]}),p&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`text-foreground-subtle`,children:`→`}),(0,C.jsxs)(`span`,{className:`font-medium`,children:[l.target,`°`]}),(0,C.jsx)(`button`,{type:`button`,"aria-label":`Decrease target`,disabled:d,onClick:e=>{if(e.stopPropagation(),!d&&l.target!==null){let e=l.target-1;u({target:e}),o.setTarget({target:e})}},className:Z(`inline-flex h-4 w-4 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,d&&`opacity-40 cursor-not-allowed`),children:`−`}),(0,C.jsx)(`button`,{type:`button`,"aria-label":`Increase target`,disabled:d,onClick:e=>{if(e.stopPropagation(),!d&&l.target!==null){let e=l.target+1;u({target:e}),o.setTarget({target:e})}},className:Z(`inline-flex h-4 w-4 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,d&&`opacity-40 cursor-not-allowed`),children:`+`})]})]}),(0,C.jsx)(`div`,{className:`inline-flex items-center gap-0.5 rounded bg-surface-subtle p-0.5`,children:l.availableModes.map(e=>(0,C.jsx)(`button`,{type:`button`,"aria-label":e,disabled:d,onClick:t=>{t.stopPropagation(),d||(u({mode:e}),o.setMode({mode:e}))},className:Z(`rounded px-1.5 py-0.5 text-xs transition-colors`,e===l.mode?kH[e]:`text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,d&&`opacity-40 cursor-not-allowed`),children:e},e))}),f&&(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsxs)(`label`,{className:`flex items-center gap-1`,children:[(0,C.jsx)(`span`,{children:`Low`}),(0,C.jsx)(`input`,{"aria-label":`Target low`,type:`number`,step:.5,value:l.targetLow??``,disabled:d,onChange:e=>{if(!d){let t=Number(e.target.value),n=l.targetHigh??t;u({targetLow:t}),o.setTargetRange({targetLow:t,targetHigh:n})}},className:`w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums`})]}),(0,C.jsxs)(`label`,{className:`flex items-center gap-1`,children:[(0,C.jsx)(`span`,{children:`High`}),(0,C.jsx)(`input`,{"aria-label":`Target high`,type:`number`,step:.5,value:l.targetHigh??``,disabled:d,onChange:e=>{if(!d){let t=Number(e.target.value),n=l.targetLow??t;u({targetHigh:t}),o.setTargetRange({targetLow:n,targetHigh:t})}},className:`w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums`})]})]}),l.availableFanModes.length>0&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{children:`Fan`}),(0,C.jsxs)(`select`,{"aria-label":`Fan mode`,value:l.fanMode,disabled:d,onChange:e=>{let t=e.target.value;!d&&t&&(u({fanMode:t}),o.setFanMode({fanMode:t}))},className:`rounded border border-border bg-surface px-1 py-0.5`,children:[(0,C.jsx)(`option`,{value:``,disabled:!0,children:`—`}),l.availableFanModes.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]})]}),l.availablePresets.length>0&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{children:`Preset`}),(0,C.jsxs)(`select`,{"aria-label":`Preset`,value:l.preset,disabled:d,onChange:e=>{let t=e.target.value;!d&&t&&(u({preset:t}),o.setPreset({preset:t}))},className:`rounded border border-border bg-surface px-1 py-0.5`,children:[(0,C.jsx)(`option`,{value:``,disabled:!0,children:`—`}),l.availablePresets.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]})]}),l.targetHumidity!==null&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{children:`Humidity`}),(0,C.jsx)(`input`,{"aria-label":`Target humidity`,type:`range`,min:0,max:100,step:1,value:l.targetHumidity,disabled:d,onChange:e=>{let t=Number(e.target.value);u({targetHumidity:t}),d||o.setTargetHumidity({targetHumidity:t})}}),(0,C.jsxs)(`span`,{className:`tabular-nums w-8 text-right`,children:[l.targetHumidity,`%`]})]})]})}var jH={cool:`Cool`,heat:`Heat`,auto:`Auto`,heat_cool:`Heat·Cool`,fan_only:`Fan`,dry:`Dry`,off:`Off`},MH={cool:PR,heat:HL,auto:FR,heat_cool:VR,fan_only:BL,dry:RL,off:bR},NH={heat:`#f59e0b`,cool:`#60a5fa`,auto:`#c084fc`,heat_cool:`#e879f9`,fan_only:`#94a3b8`,dry:`#22d3ee`,off:`#a1a1aa`},PH=16,FH=30;function IH(e){let t=e.replace(/_/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)}function LH(e){switch(e){case`turbo`:return rz;case`quiet`:return VL;case`sleep`:return lR;case`eco`:return ZL;case`8c_heat`:return PR;case`none`:return uL;default:return FR}}function RH(e){switch(e){case`high`:return 1;case`medium_high`:return 1.3;case`medium`:return 1.6;case`medium_low`:return 1.9;case`low`:return 2.2;default:return 1.8}}var zH=`
100
- @keyframes acv-fall { 0%{transform:translateY(-1.75rem);opacity:0} 18%{opacity:.7} 82%{opacity:.7} 100%{transform:translateY(7.5rem);opacity:0} }
101
- @keyframes acv-rise { 0%{transform:translateY(7.5rem);opacity:0} 18%{opacity:.7} 82%{opacity:.7} 100%{transform:translateY(-1.75rem);opacity:0} }
102
- @keyframes acv-sway { 0%,100%{transform:translateX(-9%)} 50%{transform:translateX(9%)} }
103
- @keyframes acv-swing-h { 0%,100%{transform:translateX(-22%)} 50%{transform:translateX(22%)} }
104
- @keyframes acv-swing-v { 0%,100%{transform:translateY(-22%)} 50%{transform:translateY(22%)} }
105
- @keyframes acv-spin { to { transform:rotate(360deg) } }
106
- @keyframes acv-glow { 0%,100%{opacity:.35;transform:scale(1)} 50%{opacity:.6;transform:scale(1.06)} }
107
- @media (prefers-reduced-motion: reduce) {
108
- .acv-streak, .acv-fan, .acv-sway-wrap, .acv-glow, .acv-swing { animation: none !important; }
109
- }
110
- `;function BH({trpc:e,deviceId:t,layout:n,optimistic:r}){let{cap:a,slice:o,available:s}=Wz({trpc:e,deviceId:t,cap:e=>e.climateControl,slice:e=>e.state.climateControl}),{display:c,applyOptimistic:l}=rB(o,{enabled:r??!0});if(a===void 0||c===void 0)return null;let u=!s;if(n===`compact`)return(0,C.jsxs)(`div`,{"data-mode":c.mode,className:`inline-flex items-center gap-1`,children:[(0,C.jsx)(`span`,{className:Z(`text-xs tabular-nums font-medium`,OH[c.mode]),children:c.target===null?c.currentTemp===null?null:(0,C.jsxs)(`span`,{className:`text-foreground-subtle`,children:[c.currentTemp,`°`]}):(0,C.jsxs)(C.Fragment,{children:[c.target,`°`,c.currentTemp!==null&&(0,C.jsxs)(`span`,{className:`text-foreground-subtle font-normal`,children:[` `,`(`,c.currentTemp,`°)`]})]})}),c.target!==null&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":`Decrease target`,disabled:u,onClick:e=>{if(e.stopPropagation(),!u&&c.target!==null){let e=c.target-1;l({target:e}),a.setTarget({target:e})}},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs`,u&&`opacity-40 cursor-not-allowed`),children:`−`}),(0,C.jsx)(`button`,{type:`button`,"aria-label":`Increase target`,disabled:u,onClick:e=>{if(e.stopPropagation(),!u&&c.target!==null){let e=c.target+1;l({target:e}),a.setTarget({target:e})}},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs`,u&&`opacity-40 cursor-not-allowed`),children:`+`})]}),(0,C.jsx)(`select`,{"aria-label":`Mode`,value:c.mode,disabled:u,onChange:e=>{e.stopPropagation();let t=c.availableModes.find(t=>t===e.target.value);!u&&t&&(l({mode:t}),a.setMode({mode:t}))},className:Z(`bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer`,u&&`opacity-40 cursor-not-allowed`),children:c.availableModes.map(e=>(0,C.jsx)(`option`,{value:e,children:jH[e]},e))})]});let d=NH[c.mode],f=c.mode!==`off`,p=LH(c.preset),m=c.preset===`turbo`,h=Math.max(.55,RH(c.fanMode)*(m?.6:1)),g=c.swingVertical!==null,_=c.swingHorizontal!==null,v=f&&(c.swingVertical===!0||c.swingHorizontal===!0);return(0,C.jsxs)(`div`,{"data-mode":c.mode,className:Z(`relative flex flex-col items-stretch gap-2.5 overflow-hidden rounded-lg border p-3 transition-colors`,DH[c.mode]),children:[(0,C.jsx)(`style`,{children:zH}),(0,C.jsxs)(`div`,{className:`relative z-10 flex flex-col items-center justify-center gap-1 overflow-hidden rounded-lg border border-border/50 bg-surface/30 px-3 py-3`,children:[(0,C.jsx)(`div`,{className:`pointer-events-none absolute inset-0 opacity-60`,children:(0,C.jsx)(KH,{mode:c.mode,accent:d,periodSec:h,swaying:v})}),(0,C.jsx)(`div`,{className:`pointer-events-none absolute inset-0 bg-gradient-to-b from-surface/50 via-transparent to-surface/50`}),f&&(0,C.jsx)(`span`,{"aria-hidden":!0,className:`acv-glow pointer-events-none absolute left-1/2 top-1/2 h-16 w-16 -translate-x-1/2 -translate-y-1/2 rounded-full blur-2xl`,style:{background:d,animation:`acv-glow 3.2s ease-in-out infinite`}}),(0,C.jsxs)(`div`,{className:`relative z-10 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide`,style:{color:d},children:[(0,C.jsx)(HH,{mode:c.mode,className:`h-3.5 w-3.5`}),jH[c.mode],c.currentTemp!==null&&(0,C.jsxs)(`span`,{className:`normal-case text-foreground-subtle`,children:[`· `,c.currentTemp,`° now`]}),c.currentHumidity!==null&&(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 normal-case text-foreground-subtle`,children:[(0,C.jsx)(RL,{className:`h-3 w-3`}),c.currentHumidity,`%`]})]}),c.target===null?(0,C.jsxs)(`div`,{className:`relative z-10 flex items-baseline gap-0.5`,children:[(0,C.jsx)(`span`,{className:`text-4xl font-bold leading-none tabular-nums text-foreground`,children:c.currentTemp??`—`}),(0,C.jsx)(`span`,{className:`text-lg text-foreground-subtle`,children:`°`})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`relative z-10 flex items-center gap-3`,children:[(0,C.jsx)(WH,{label:`Decrease target`,symbol:`−`,disabled:u,onClick:()=>{if(u||c.target===null)return;let e=c.target-1;l({target:e}),a.setTarget({target:e})}}),(0,C.jsxs)(`div`,{className:`flex items-baseline gap-0.5`,children:[(0,C.jsx)(`span`,{className:`text-4xl font-bold leading-none tabular-nums`,style:{color:d},children:c.target}),(0,C.jsx)(`span`,{className:`text-lg text-foreground-subtle`,children:`°`})]}),(0,C.jsx)(WH,{label:`Increase target`,symbol:`+`,disabled:u,onClick:()=>{if(u||c.target===null)return;let e=c.target+1;l({target:e}),a.setTarget({target:e})}})]}),(0,C.jsx)(`div`,{className:`relative z-10 w-36`,children:(0,C.jsx)(GH,{value:c.target,min:PH,max:FH,accent:d})})]})]}),(0,C.jsxs)(`div`,{className:`relative z-10 grid grid-cols-3 gap-2`,children:[(0,C.jsx)(UH,{label:`Mode`,icon:(0,C.jsx)(`span`,{style:{color:d},className:`flex`,children:(0,C.jsx)(HH,{mode:c.mode,className:`h-4 w-4`})}),value:c.mode,options:c.availableModes.map(e=>({value:e,label:jH[e]})),disabled:u,onChange:e=>{let t=c.availableModes.find(t=>t===e);t&&(l({mode:t}),a.setMode({mode:t}))}}),c.availableFanModes.length>0&&(0,C.jsx)(UH,{label:`Fan`,icon:(0,C.jsx)(ez,{className:`h-4 w-4 text-sky-500`}),value:c.fanMode,options:c.availableFanModes.map(e=>({value:e,label:IH(e)})),disabled:u,onChange:e=>{l({fanMode:e}),a.setFanMode({fanMode:e})}}),c.availablePresets.length>0&&(0,C.jsx)(UH,{label:`Preset`,icon:(0,C.jsx)(p,{className:`h-4 w-4 text-emerald-500`}),value:c.preset,options:c.availablePresets.map(e=>({value:e,label:IH(e)})),disabled:u,onChange:e=>{l({preset:e}),a.setPreset({preset:e})}})]}),(g||_)&&(0,C.jsx)(VH,{label:`Swing`,children:(0,C.jsxs)(`div`,{className:`grid grid-cols-2 gap-1`,children:[g&&(0,C.jsx)(JH,{axis:`vertical`,on:c.swingVertical??!1,busy:u,onToggle:e=>{l({swingVertical:e}),a.setSwingVertical({on:e})}}),_&&(0,C.jsx)(JH,{axis:`horizontal`,on:c.swingHorizontal??!1,busy:u,onToggle:e=>{l({swingHorizontal:e}),a.setSwingHorizontal({on:e})}})]})})]})}function VH({label:e,children:t}){return(0,C.jsxs)(`div`,{className:`relative z-10 flex flex-col gap-1`,children:[(0,C.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:e}),t]})}function HH({mode:e,className:t}){let n=MH[e];return(0,C.jsx)(n,{className:t,"aria-hidden":!0})}function UH({label:e,icon:t,value:n,options:r,disabled:a,onChange:o}){return(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,C.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle`,children:e}),(0,C.jsxs)(`div`,{className:Z(`flex items-center gap-1 overflow-hidden rounded-lg border border-border/60 bg-surface-subtle px-1.5 py-1.5`,a&&`opacity-40`),children:[(0,C.jsx)(`span`,{className:`flex shrink-0`,children:t}),(0,C.jsx)(`select`,{"aria-label":e,value:n,disabled:a,onChange:e=>{e.stopPropagation(),a||o(e.target.value)},className:`min-w-0 flex-1 cursor-pointer appearance-none truncate bg-transparent text-xs font-medium text-foreground outline-none`,children:r.map(e=>(0,C.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,C.jsx)(xL,{className:`h-3 w-3 shrink-0 text-foreground-subtle`})]})]})}function WH({label:e,symbol:t,disabled:n,onClick:r}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,disabled:n,onClick:r,className:Z(`flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-border bg-surface text-lg leading-none text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground active:scale-95`,n&&`opacity-40 cursor-not-allowed`),children:t})}function GH({value:e,min:t,max:n,accent:r}){let a=`${Math.min(1,Math.max(0,(e-t)/(n-t)))*100}%`;return(0,C.jsxs)(`div`,{className:`mt-2 w-full`,children:[(0,C.jsxs)(`div`,{className:`relative h-1.5 w-full rounded-full bg-surface-subtle`,children:[(0,C.jsx)(`div`,{className:`absolute inset-y-0 left-0 rounded-full`,style:{width:a,background:r}}),(0,C.jsx)(`div`,{className:`absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-surface shadow`,style:{left:a,background:r}})]}),(0,C.jsxs)(`div`,{className:`mt-0.5 flex justify-between text-[9px] tabular-nums text-foreground-subtle`,children:[(0,C.jsxs)(`span`,{children:[t,`°`]}),(0,C.jsxs)(`span`,{children:[n,`°`]})]})]})}function KH({mode:e,accent:t,periodSec:n,swaying:r}){let a=[0,1,2,3,4,5],o=e===`heat`,s=e===`dry`;return(0,C.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-0 overflow-hidden`,children:e===`off`?(0,C.jsx)(`div`,{className:`flex h-full items-center justify-center gap-2 opacity-30`,children:a.map(e=>(0,C.jsx)(`span`,{className:`h-8 w-1 rounded-full bg-foreground-subtle opacity-40`},e))}):e===`fan_only`?(0,C.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,C.jsx)(qH,{color:t,periodSec:Math.max(.5,n*.7),size:56})}):(0,C.jsx)(`div`,{className:Z(`acv-sway-wrap absolute inset-0`,r&&`acv-sway`),style:r?{animation:`acv-sway 2.6s ease-in-out infinite`}:void 0,children:a.map(e=>(0,C.jsx)(`span`,{className:`acv-streak absolute rounded-full`,style:{left:`${8+e*15}%`,width:s?`0.4rem`:`0.3rem`,height:s?`0.4rem`:`1.9rem`,background:t,boxShadow:`0 0 6px ${t}`,animationName:o?`acv-rise`:`acv-fall`,animationTimingFunction:`linear`,animationIterationCount:`infinite`,animationDuration:`${n}s`,animationDelay:`${e%3*(n/3)+e*.05}s`}},e))})})}function qH({color:e,periodSec:t,size:n}){return(0,C.jsxs)(`svg`,{width:n,height:n,viewBox:`0 0 100 100`,className:`acv-fan`,style:{animation:`acv-spin ${t}s linear infinite`,transformOrigin:`50% 50%`},"aria-hidden":!0,children:[[0,120,240].map(t=>(0,C.jsx)(`path`,{d:`M50 50 C 58 30, 78 26, 84 12 C 66 20, 54 34, 50 50 Z`,fill:e,opacity:.85,transform:`rotate(${t} 50 50)`},t)),(0,C.jsx)(`circle`,{cx:`50`,cy:`50`,r:`7`,fill:e})]})}function JH({axis:e,on:t,busy:n,onToggle:r}){let a=e===`vertical`?`Vertical`:`Horizontal`,o=e===`vertical`?fR:dR,s=e===`vertical`?`acv-swing-v`:`acv-swing-h`;return(0,C.jsxs)(`button`,{type:`button`,"aria-label":`${a} swing`,"aria-pressed":t,disabled:n,onClick:()=>{n||r(!t)},className:Z(`flex items-center justify-center gap-2 rounded-lg border px-2 py-1.5 text-xs font-medium transition-colors`,t?`border-transparent bg-indigo-400 text-indigo-950 shadow-sm`:`border-border/60 bg-surface-subtle text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,n&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(o,{className:`acv-swing h-4 w-4`,"aria-hidden":!0,style:t?{animation:`${s} 1.4s ease-in-out infinite`}:void 0}),a]})}var YH={playing:`border-green-400 bg-green-50 dark:bg-green-950`,paused:`border-amber-400 bg-amber-50 dark:bg-amber-950`,buffering:`border-blue-400 bg-blue-50 dark:bg-blue-950`,on:`border-slate-400 bg-slate-50 dark:bg-slate-950`,idle:`border-slate-400 bg-slate-50 dark:bg-slate-950`,off:`border-zinc-300 bg-zinc-50 dark:bg-zinc-900`,standby:`border-zinc-300 bg-zinc-50 dark:bg-zinc-900`},XH={playing:`bg-green-500`,paused:`bg-amber-400`,buffering:`bg-blue-400`,on:`bg-slate-400`,idle:`bg-slate-400`,off:`bg-zinc-300`,standby:`bg-zinc-300`},ZH=[`off`,`all`,`one`];function QH(e){return ZH.includes(e)}var $H={off:`Off`,all:`All`,one:`One`};function eU(e){return e===`playing`||e===`buffering`?`pause`:`play`}function tU({trpc:e,deviceId:t,features:n,layout:r,optimistic:a}){let{cap:o,slice:s,available:c}=Wz({trpc:e,deviceId:t,cap:e=>e.mediaPlayer,slice:e=>e.state.mediaPlayer}),{display:l,applyOptimistic:u}=rB(s,{enabled:a??!0});if(l===void 0)return null;let d=!c,f=eU(l.state);return(0,C.jsxs)(`div`,{"data-state":l.state,className:Z(`inline-flex items-center gap-2 rounded border px-2 py-1 transition-colors`,YH[l.state],r===`full`&&`flex-col items-stretch gap-3`),children:[(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-2`,children:[(0,C.jsx)(`span`,{role:`status`,"aria-label":l.state,className:Z(`inline-block h-2 w-2 rounded-full flex-shrink-0`,XH[l.state])}),(0,C.jsx)(`button`,{type:`button`,"aria-label":f===`play`?`Play`:`Pause`,disabled:d,onClick:e=>{e.stopPropagation(),!d&&(f===`play`?(u({state:`playing`}),o?.play({})):(u({state:`paused`}),o?.pause({})))},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs`,d&&`opacity-40 cursor-not-allowed`),children:f===`play`?`▶`:`⏸`})]}),r===`full`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":`Previous`,disabled:d,onClick:e=>{e.stopPropagation(),d||o?.previous({})},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs`,d&&`opacity-40 cursor-not-allowed`),children:`⏮`}),(0,C.jsx)(`button`,{type:`button`,"aria-label":`Next`,disabled:d,onClick:e=>{e.stopPropagation(),d||o?.next({})},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs`,d&&`opacity-40 cursor-not-allowed`),children:`⏭`})]}),l.volumeLevel!==null&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{children:`Vol`}),(0,C.jsx)(`input`,{"aria-label":`Volume`,type:`range`,min:0,max:100,step:1,value:l.volumeLevel,disabled:d,onChange:e=>{let t=Number(e.target.value);u({volumeLevel:t}),d||o?.setVolume({volumeLevel:t})}}),(0,C.jsxs)(`span`,{className:`tabular-nums w-8 text-right`,children:[l.volumeLevel,`%`]})]}),l.isMuted!==null&&(0,C.jsx)(`button`,{type:`button`,"aria-label":l.isMuted?`Unmute`:`Mute`,disabled:d,onClick:e=>{if(e.stopPropagation(),!d&&l.isMuted!==null){let e=!l.isMuted;u({isMuted:e}),o?.setMute({muted:e})}},className:Z(`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors`,l.isMuted?`bg-amber-400 text-amber-950`:`text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,d&&`opacity-40 cursor-not-allowed`),children:l.isMuted?`🔇`:`🔊`}),l.availableSources.length>0&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{children:`Source`}),(0,C.jsxs)(`select`,{"aria-label":`Source`,value:l.source,disabled:d,onChange:e=>{let t=e.target.value;!d&&t&&(u({source:t}),o?.selectSource({source:t}))},className:`rounded border border-border bg-surface px-1 py-0.5`,children:[(0,C.jsx)(`option`,{value:``,disabled:!0,children:`—`}),l.availableSources.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]})]}),l.shuffle!==null&&(0,C.jsx)(`button`,{type:`button`,"aria-label":`Shuffle`,disabled:d,onClick:e=>{if(e.stopPropagation(),!d&&l.shuffle!==null){let e=!l.shuffle;u({shuffle:e}),o?.setShuffle({shuffle:e})}},className:Z(`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors`,l.shuffle?`bg-green-400 text-green-950`:`text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,d&&`opacity-40 cursor-not-allowed`),children:`⇌ Shuffle`}),l.repeat!==null&&(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{children:`Repeat`}),(0,C.jsx)(`select`,{"aria-label":`Repeat`,value:l.repeat,disabled:d,onChange:e=>{let t=e.target.value;!d&&QH(t)&&(u({repeat:t}),o?.setRepeat({repeat:t}))},className:`rounded border border-border bg-surface px-1 py-0.5`,children:ZH.map(e=>(0,C.jsx)(`option`,{value:e,children:$H[e]},e))})]})]})]})}function nU(e){return e.slice(0,10)}function rU(e){return e.slice(0,5)}function iU(e){return(e.includes(`T`)?e:e.replace(` `,`T`)).slice(0,16)}function aU({value:e,busy:t,onCommit:n,unit:r,min:a,max:o,step:s,precision:c}){let[l,u]=(0,S.useState)($M(e,c)),d=Number(l),f=l!==``&&!Number.isNaN(d),p=s??1,m=e=>{let t=e;return a!==void 0&&(t=Math.max(a,t)),o!==void 0&&(t=Math.min(o,t)),t},h=()=>{!t&&f&&n(m(d))};return(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":`Decrement`,disabled:t,onClick:r=>{if(r.stopPropagation(),!t){let t=m(e-p);u($M(t,c)),n(t)}},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded border border-border bg-surface text-xs transition-colors hover:bg-surface-hover`,t&&`opacity-40 cursor-not-allowed`),children:`−`}),(0,C.jsx)(`input`,{"aria-label":`Numeric value`,type:`number`,disabled:t,value:l,onChange:e=>{u(e.target.value);let r=Number(e.target.value);e.target.value!==``&&!Number.isNaN(r)&&(t||n(m(r)))},onBlur:h,onKeyDown:e=>{e.key===`Enter`&&h()},className:Z(`w-16 rounded border border-border bg-surface px-1 py-0.5 text-xs tabular-nums text-center`,t&&`opacity-40 cursor-not-allowed`)}),r!==void 0&&(0,C.jsx)(`span`,{className:`text-foreground-subtle text-xs`,children:r}),(0,C.jsx)(`button`,{type:`button`,"aria-label":`Increment`,disabled:t,onClick:r=>{if(r.stopPropagation(),!t){let t=m(e+p);u($M(t,c)),n(t)}},className:Z(`inline-flex h-5 w-5 items-center justify-center rounded border border-border bg-surface text-xs transition-colors hover:bg-surface-hover`,t&&`opacity-40 cursor-not-allowed`),children:`+`})]})}function oU({value:e,busy:t,onCommit:n}){let[r,a]=(0,S.useState)(e);return(0,C.jsx)(`input`,{type:`text`,disabled:t,value:r,onChange:e=>a(e.target.value),onBlur:()=>{t||n(r)},onKeyDown:e=>{e.key===`Enter`&&!t&&n(r)},className:Z(`rounded border border-border bg-surface px-2 py-0.5 text-xs`,t&&`opacity-40 cursor-not-allowed`)})}function sU({slice:e,busy:t,setValueFn:n,layout:r}){switch(e.kind){case`numeric`:return(0,C.jsx)(aU,{value:typeof e.value==`number`?e.value:Number(e.value),busy:t,onCommit:e=>{n({control:{kind:`numeric`,value:e}})},unit:e.unit,min:e.min,max:e.max,step:e.step,precision:e.precision});case`select`:return(0,C.jsx)(`select`,{"aria-label":`Control value`,disabled:t,value:String(e.value),onChange:e=>{e.stopPropagation(),t||n({control:{kind:`select`,value:e.target.value}})},className:Z(`w-full max-w-full min-w-0 truncate rounded border border-border bg-surface px-1 py-0.5 text-xs`,t&&`opacity-40 cursor-not-allowed`),children:e.options.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))});case`text`:return(0,C.jsx)(oU,{value:String(e.value),busy:t,onCommit:e=>{n({control:{kind:`text`,value:e}})}});case`datetime`:{let a=String(e.value),o=e.format??`datetime`;return r===`compact`?a===``?(0,C.jsx)(`span`,{"aria-label":`Control value`,className:`text-xs text-foreground-subtle`,children:`—`}):(0,C.jsx)(`span`,{"aria-label":`Control value`,className:`text-xs text-foreground`,children:QM(a,o)}):(0,C.jsx)(`input`,{type:o===`date`?`date`:o===`time`?`time`:`datetime-local`,"aria-label":`Control value`,disabled:t,value:o===`date`?nU(a):o===`time`?rU(a):iU(a),onChange:e=>{e.stopPropagation(),t||n({control:{kind:`datetime`,value:e.target.value}})},className:Z(`rounded border border-border bg-surface px-1 py-0.5 text-xs`,t&&`opacity-40 cursor-not-allowed`)})}default:return null}}function cU({trpc:e,deviceId:t,features:n,layout:r,optimistic:a}){let{cap:o,slice:s,available:c}=Wz({trpc:e,deviceId:t,cap:e=>e.control,slice:e=>e.state.control}),{display:l,applyOptimistic:u}=rB(s,{enabled:a??!0});if(l===void 0)return null;let d=!c;return(0,C.jsx)(`div`,{"data-kind":l.kind,className:`inline-flex min-w-0 max-w-full items-center gap-1 rounded border border-border px-2 py-1 transition-colors`,children:(0,C.jsx)(sU,{slice:l,busy:d,setValueFn:e=>{!d&&o&&(u({value:e.control.value}),o.setValue(e))},layout:r})})}var lU=5,uU=35;function dU(e,t,n){return n<=t?0:Math.min(1,Math.max(0,(e-t)/(n-t)))}function fU(e,t,n){return Math.round(t+e*(n-t))}var pU=176,mU=76,hU=2*Math.PI*mU,gU=270/360*hU,_U=pU/2-mU-10;function vU(e){let t=pU/2,n=pU/2,r=hU-gU,a=e.mode===`band`?(()=>{let t=e.band.from*gU,n=Math.max(0,(e.band.to-e.band.from)*gU);return{dasharray:`${n} ${hU-n}`,dashoffset:-t}})():(()=>{let t=e.fraction*gU;return{dasharray:`${t} ${hU-t}`,dashoffset:void 0}})();return(0,C.jsxs)(`svg`,{width:pU,height:pU,viewBox:`0 0 ${pU} ${pU}`,"aria-hidden":`true`,className:`absolute inset-0`,style:{transform:`rotate(135deg)`},children:[(0,C.jsx)(`circle`,{cx:t,cy:n,r:mU,fill:`none`,stroke:`var(--color-border)`,strokeWidth:12,strokeDasharray:`${gU} ${r}`,strokeLinecap:`round`}),(0,C.jsx)(`circle`,{cx:t,cy:n,r:mU,fill:`none`,stroke:e.color,strokeWidth:12,strokeDasharray:a.dasharray,...a.dashoffset===void 0?{}:{strokeDashoffset:a.dashoffset},strokeLinecap:`round`})]})}var yU={heat:`#f59e0b`,cool:`#60a5fa`,auto:`#c084fc`,heat_cool:`#e879f9`,fan_only:`#94a3b8`,dry:`#22d3ee`,off:`#d4d4d8`};function bU({trpc:e,deviceId:t,features:n,optimistic:r}){let{cap:a,slice:o,available:s}=Wz({trpc:e,deviceId:t,cap:e=>e.climateControl,slice:e=>e.state.climateControl}),{display:c,applyOptimistic:l}=rB(o,{enabled:r??!0});if(a===void 0||c===void 0)return null;let u=!s,d=yU[c.mode],f=c.mode===`heat_cool`||c.targetLow!==null&&c.targetHigh!==null,p=lU,m=uU,h=!f&&c.target!==null?dU(c.target,p,m):0,g=f&&c.targetLow!==null?dU(c.targetLow,p,m):0,_=f&&c.targetHigh!==null?dU(c.targetHigh,p,m):0;return(0,C.jsxs)(`div`,{"data-mode":c.mode,className:Z(`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4 transition-colors`,DH[c.mode]),children:[(0,C.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,C.jsxs)(`div`,{className:`relative`,style:{width:pU,height:pU},children:[f?(0,C.jsx)(vU,{mode:`band`,band:{from:g,to:_},color:d}):(0,C.jsx)(vU,{mode:`fill`,fraction:h,color:d}),f?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`div`,{"data-testid":`arc-knob`,children:(0,C.jsx)(Zz,{fraction:g,color:d,knobTopPx:_U,onDragFraction:e=>{if(u||c.targetHigh===null)return;let t=Math.min(fU(e,p,m),c.targetHigh);l({targetLow:t}),a.setTargetRange({targetLow:t,targetHigh:c.targetHigh})}})}),(0,C.jsx)(`div`,{"data-testid":`arc-knob`,children:(0,C.jsx)(Zz,{fraction:_,color:d,knobTopPx:_U,onDragFraction:e=>{if(u||c.targetLow===null)return;let t=Math.max(fU(e,p,m),c.targetLow);l({targetHigh:t}),a.setTargetRange({targetLow:c.targetLow,targetHigh:t})}})})]}):(0,C.jsx)(`div`,{"data-testid":`arc-knob`,children:(0,C.jsx)(Zz,{fraction:h,color:d,knobTopPx:_U,onDragFraction:e=>{if(u)return;let t=fU(e,p,m);l({target:t}),a.setTarget({target:t})}})}),(0,C.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-0.5 pointer-events-none`,children:[(0,C.jsxs)(`div`,{"data-testid":`current-temp`,className:`text-4xl font-bold tabular-nums text-foreground leading-none`,children:[c.currentTemp===null?`—`:c.currentTemp,(0,C.jsx)(`span`,{className:`text-lg text-foreground-subtle font-normal ml-0.5`,children:`°`})]}),!f&&c.target!==null&&(0,C.jsxs)(`div`,{className:`text-xs font-semibold`,style:{color:d},children:[`set `,c.target,`°`]}),f&&c.targetLow!==null&&c.targetHigh!==null&&(0,C.jsxs)(`div`,{className:`text-xs font-semibold`,style:{color:d},children:[c.targetLow,`° – `,c.targetHigh,`°`]})]})]}),!f&&c.target!==null&&(0,C.jsx)(`div`,{className:`w-[200px]`,children:(0,C.jsx)(Gz,{value:`${c.target}°`,onDelta:e=>{if(u||c.target===null)return;let t=c.target+e;l({target:t}),a.setTarget({target:t})}})})]}),(0,C.jsx)(`select`,{"aria-label":`Mode`,value:c.mode,disabled:u,onChange:e=>{e.stopPropagation();let t=e.target.value;!u&&t&&(l({mode:c.availableModes.find(e=>e===t)??c.mode}),a.setMode({mode:c.availableModes.find(e=>e===t)??c.mode}))},className:Z(`w-full rounded border border-border bg-surface px-3 py-1.5 text-sm`,u&&`opacity-40 cursor-not-allowed`),children:c.availableModes.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))})]})}function xU(e){return e===`locked`||e===`locking`}function SU(e){return e===`jammed`}var CU={locked:{colorClass:`border-success/30 bg-success/10 text-success`,icon:`locked`},locking:{colorClass:`border-success/30 bg-success/10 text-success`,icon:`locked`},unlocked:{colorClass:`border-warning/30 bg-warning/10 text-warning`,icon:`open`},unlocking:{colorClass:`border-warning/30 bg-warning/10 text-warning`,icon:`open`},jammed:{colorClass:`border-danger/30 bg-danger/10 text-danger`,icon:`locked`}};function wU({state:e}){let t=CU[e];return(0,C.jsx)(`div`,{"data-testid":`lock-glyph`,"data-state":e,className:Z(`flex h-16 w-16 items-center justify-center rounded-full border-2`,t.colorClass),children:t.icon===`locked`?(0,C.jsx)(rR,{className:`h-8 w-8`,"aria-hidden":`true`}):(0,C.jsx)(nR,{className:`h-8 w-8`,"aria-hidden":`true`})})}function TU({state:e}){return(0,C.jsx)(`span`,{className:Z(`text-sm font-medium capitalize`,SU(e)?`text-danger`:`text-foreground-muted`),children:e})}function EU({busy:e,onOpen:t}){return(0,C.jsxs)(`button`,{type:`button`,"aria-label":`Open (unlatch)`,title:`Open (unlatch)`,disabled:e,onClick:e=>{e.stopPropagation(),t()},className:Z(`inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium`,`text-foreground-muted hover:bg-surface-hover transition-colors`,e&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(FL,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`Open`]})}function DU({trpc:e,deviceId:t,features:n,optimistic:r}){let{cap:a,slice:o,available:s}=Wz({trpc:e,deviceId:t,cap:e=>e.lockControl,slice:e=>e.state.lockControl}),{display:c,applyOptimistic:l}=rB(o,{enabled:r??!0});if(a===void 0||c===void 0)return null;let u=xU(c.state),d=SU(c.state)||!s,f=n?.includes(js.LockOpen)===!0,p=()=>{d||(u?(l({state:`unlocking`}),a.unlock({})):(l({state:`locking`}),a.lock({})))},m=()=>{d||a.open({})},h=u?`Unlock`:`Lock`;return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,C.jsx)(wU,{state:c.state}),(0,C.jsx)(TU,{state:c.state})]}),(0,C.jsx)(`div`,{className:Z(d&&`pointer-events-none opacity-40`),children:(0,C.jsx)(Kz,{on:u,targetLabel:h,onConfirm:p})}),f&&(0,C.jsx)(`div`,{className:`flex justify-center`,children:(0,C.jsx)(EU,{busy:d,onOpen:m})})]})}var OU=150,kU=64,AU=OU/2,jU=2*Math.PI*kU,MU=270/360*jU;function NU({fraction:e,color:t,children:n,onDragFraction:r}){let a=Math.min(1,Math.max(0,e)),o=OU/2,s=OU/2,c=jU-MU,l=a*MU;return(0,C.jsxs)(`div`,{className:`relative`,style:{width:OU,height:OU},children:[(0,C.jsxs)(`svg`,{width:OU,height:OU,viewBox:`0 0 ${OU} ${OU}`,"aria-hidden":`true`,className:`absolute inset-0`,style:{transform:`rotate(135deg)`},children:[(0,C.jsx)(`circle`,{cx:o,cy:s,r:kU,fill:`none`,stroke:`var(--color-border)`,strokeWidth:11,strokeDasharray:`${MU} ${c}`,strokeLinecap:`round`}),(0,C.jsx)(`circle`,{cx:o,cy:s,r:kU,fill:`none`,stroke:t,strokeWidth:11,strokeDasharray:`${l} ${jU-l}`,strokeLinecap:`round`})]}),(0,C.jsx)(`div`,{"data-testid":`arc-knob`,children:(0,C.jsx)(Zz,{fraction:a,color:t,knobTopPx:AU-kU-10,...r===void 0?{}:{onDragFraction:r}})}),(0,C.jsx)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-0.5 pointer-events-none`,children:n})]})}function PU({on:e,busy:t,onToggle:n}){let r={transform:e?`translateX(30px)`:`translateX(3px)`};return(0,C.jsx)(`button`,{type:`button`,"aria-pressed":e,title:e?`Turn off`:`Turn on`,disabled:t,onClick:e=>{e.stopPropagation(),n()},className:Z(`relative inline-flex h-8 w-16 items-center rounded-full border transition-colors flex-shrink-0`,e?`bg-success/30 border-success/50`:`bg-surface-hover border-border`,t&&`opacity-60 cursor-not-allowed`),children:(0,C.jsx)(`span`,{className:Z(`absolute h-6 w-6 rounded-full transition-all`,e?`bg-success`:`bg-foreground-subtle`),style:r})})}var FU=500,IU=150,LU=`linear-gradient(90deg, #9ec9ff, #ffffff, #ffb24d)`;function RU(e,t,n){return n<=t?0:Math.min(1,Math.max(0,(e-t)/(n-t)))}function zU(e){return RU(e,IU,FU)}var BU=`#f4b740`,VU=`#d4d4d8`;function HU({trpc:e,deviceId:t,features:n,optimistic:r}){let a=Wz({trpc:e,deviceId:t,cap:e=>e.switch,slice:e=>e.state.switch}),o=Wz({trpc:e,deviceId:t,cap:e=>e.brightness,slice:e=>e.state.brightness}),s=Wz({trpc:e,deviceId:t,cap:e=>e.color,slice:e=>e.state.color}),c=rB(a.slice,{enabled:r??!0}),l=rB(o.slice,{enabled:r??!0}),u=rB(s.slice,{enabled:r??!0});if(a.cap===void 0||c.display===void 0)return null;let d=c.display.on===!0,f=!a.available,p=l.display?.percentage??0,m=!o.available,h=d?p/100:0,g=d?BU:VU,_=(n?.includes(js.LightColorMired)??!1)&&s.cap!==void 0,v=u.display?.mireds,y=!s.available;return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,C.jsxs)(NU,{fraction:h,color:g,children:[(0,C.jsxs)(`div`,{"data-testid":`brightness-readout`,className:`text-3xl font-bold tabular-nums text-foreground leading-none`,children:[p,(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle font-normal ml-0.5`,children:`%`})]}),(0,C.jsx)(QL,{className:`h-5 w-5 text-foreground-subtle`,"aria-hidden":`true`})]}),o.cap!==void 0&&(0,C.jsxs)(`label`,{className:`flex w-full items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{className:`w-16`,children:`Brightness`}),(0,C.jsx)(`input`,{"aria-label":`Brightness`,type:`range`,min:0,max:100,step:1,className:`flex-1`,value:p,disabled:m||!d,onChange:e=>{let t=Number(e.target.value);l.applyOptimistic({percentage:t}),m||o.cap?.setBrightness({percentage:t})}}),(0,C.jsxs)(`span`,{className:`tabular-nums w-9 text-right`,children:[p,`%`]})]})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground-muted`,children:d?`On`:`Off`}),(0,C.jsx)(PU,{on:d,busy:f,onToggle:()=>{if(f)return;let e=!d;c.applyOptimistic({on:e}),a.cap?.setState({on:e})}})]}),_&&(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,"data-testid":`color-temp-strip`,children:[(0,C.jsx)(VR,{className:`h-4 w-4 text-foreground-subtle`,"aria-hidden":`true`}),(0,C.jsxs)(`label`,{className:`flex-1`,children:[(0,C.jsx)(`span`,{className:`sr-only`,children:`Colour temperature`}),(0,C.jsx)(`input`,{"aria-label":`Colour temperature`,type:`range`,min:IU,max:FU,step:1,className:`w-full`,value:v??FU,disabled:y||!d,onChange:e=>{let t=Number(e.target.value);u.applyOptimistic({mode:`mired`,mireds:t}),y||s.cap?.setColor({color:{mode:`mired`,mireds:t}})}}),(0,C.jsx)(`div`,{className:`pointer-events-none mt-1`,children:(0,C.jsx)(Qz,{fraction:v===void 0?.5:zU(v),color:LU})})]})]})]})}var UU=`#3aa6a0`,WU=`#d4d4d8`;function GU({trpc:e,deviceId:t,features:n,optimistic:r}){let a=Wz({trpc:e,deviceId:t,cap:e=>e.switch,slice:e=>e.state.switch}),o=Wz({trpc:e,deviceId:t,cap:e=>e.fanControl,slice:e=>e.state.fanControl}),s=rB(a.slice,{enabled:r??!0}),c=rB(o.slice,{enabled:r??!0});if(a.cap===void 0||s.display===void 0)return null;let l=s.display.on===!0,u=!a.available,d=c.display?.percentage??0,f=!o.available,p=l?d/100:0,m=l?UU:WU,h=n?.includes(js.FanSpeed)??!1,g=(n?.includes(js.FanOscillating)??!1)&&o.cap!==void 0,_=c.display?.availablePresets??[],v=(n?.includes(js.FanPreset)??!1)&&o.cap!==void 0&&_.length>0,y=c.display?.preset??``,b=c.display?.oscillating===!0,x=()=>{if(u)return;let e=!l;s.applyOptimistic({on:e}),a.cap?.setState({on:e})},S=()=>{if(f)return;let e=!b;c.applyOptimistic({oscillating:e}),o.cap?.setOscillating({oscillating:e})},w=e=>{if(f)return;let t=c.display;if(t===void 0)return;let n=t.percentageStep!==void 0&&t.percentageStep>0?t.percentageStep:1,r=Math.min(100,Math.max(0,Math.round(e*100/n)*n));c.applyOptimistic({percentage:r}),o.cap?.setPercentage({percentage:r})},T=e=>{f||e===``||(c.applyOptimistic({preset:e}),o.cap?.setPreset({preset:e}))};return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4`,children:[(0,C.jsx)(`div`,{className:`flex flex-col items-center gap-3`,children:h?(0,C.jsxs)(NU,{fraction:p,color:m,onDragFraction:w,children:[(0,C.jsxs)(`div`,{"data-testid":`speed-readout`,className:`text-3xl font-bold tabular-nums text-foreground leading-none`,children:[d,(0,C.jsx)(`span`,{className:`text-base text-foreground-subtle font-normal ml-0.5`,children:`%`})]}),(0,C.jsx)(BL,{className:`h-5 w-5 text-foreground-subtle`,"aria-hidden":`true`})]}):(0,C.jsx)(`div`,{"data-testid":`fan-onoff-icon`,className:`flex h-[150px] w-[150px] items-center justify-center`,children:(0,C.jsx)(BL,{className:`h-16 w-16`,style:{color:m},"aria-hidden":`true`})})}),v&&(0,C.jsx)(`div`,{className:`flex justify-center`,children:(0,C.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[(0,C.jsx)(`span`,{children:`Preset`}),(0,C.jsxs)(`select`,{"aria-label":`Fan preset`,value:y,disabled:f,onChange:e=>{e.stopPropagation(),T(e.target.value)},className:Z(`bg-surface border border-border rounded px-1 py-0.5`,f&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(`option`,{value:``,disabled:!0,children:`—`}),_.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]})]})}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[g?(0,C.jsxs)(`button`,{type:`button`,"aria-label":`Oscillate`,"aria-pressed":b,disabled:f,onClick:e=>{e.stopPropagation(),S()},className:Z(`inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors`,b?`border-success/50 bg-success/10 text-success`:`border-border text-foreground-muted hover:bg-surface-hover`,f&&`opacity-40 cursor-not-allowed`),children:[(0,C.jsx)(SR,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`Oscillate`]}):(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground-muted`,children:l?`On`:`Off`}),(0,C.jsx)(PU,{on:l,busy:u,onToggle:x})]})]})}function KU({trpc:e,deviceId:t,optimistic:n}){let{cap:r,slice:a,available:o}=Wz({trpc:e,deviceId:t,cap:e=>e.switch,slice:e=>e.state.switch}),{display:s,applyOptimistic:c}=rB(a,{enabled:n??!0});if(r===void 0||s===void 0)return null;let l=s.on===!0,u=!o;return(0,C.jsxs)(`div`,{className:`flex flex-col items-center gap-4 rounded-lg border border-border bg-surface p-6`,children:[(0,C.jsx)(`div`,{"data-testid":`switch-glyph`,"data-state":l?`on`:`off`,className:Z(`flex h-16 w-16 items-center justify-center rounded-full border-2 transition-colors`,l?`border-success/30 bg-success/10 text-success`:`border-border bg-surface-subtle text-foreground-subtle`),children:(0,C.jsx)(bR,{className:`h-8 w-8`,"aria-hidden":`true`})}),(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground-muted`,children:l?`On`:`Off`}),(0,C.jsx)(PU,{on:l,busy:u,onToggle:()=>{if(u)return;let e=!l;c({on:e}),r.setState({on:e})}})]})}function qU(e){return e===`playing`||e===`buffering`?`pause`:`play`}function JU(e,t){return e===null||t===null||t<=0?0:Math.min(1,Math.max(0,e/t))}function YU(e){if(e===null)return`--:--`;let t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function XU({title:e,subtitle:t}){return(0,C.jsxs)(`div`,{className:`flex flex-col items-center gap-1 text-center`,children:[(0,C.jsx)(pR,{className:`h-6 w-6 text-foreground-subtle`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`text-base font-semibold text-foreground line-clamp-1`,children:e??`Nothing playing`}),t&&(0,C.jsx)(`span`,{className:`text-xs text-foreground-subtle line-clamp-1`,children:t})]})}function ZU({label:e,busy:t,onPress:n,children:r,primary:a}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,title:e,disabled:t,onClick:e=>{e.stopPropagation(),t||n()},className:Z(`inline-flex items-center justify-center rounded-full transition-colors`,a?`h-12 w-12 bg-primary text-primary-foreground hover:bg-primary/90 shadow-md`:`h-10 w-10 text-foreground-muted hover:bg-surface-hover`,t&&`opacity-40 cursor-not-allowed`),children:r})}function QU({trpc:e,deviceId:t,features:n,optimistic:r}){let{cap:a,slice:o,available:s}=Wz({trpc:e,deviceId:t,cap:e=>e.mediaPlayer,slice:e=>e.state.mediaPlayer}),{display:c,applyOptimistic:l}=rB(o,{enabled:r??!0});if(a===void 0||c===void 0)return null;let u=!s,d=qU(c.state),f=(n?.includes(js.MediaPlayerSeek)??!1)&&c.durationMs!==null&&c.durationMs>0,p=n?.includes(js.MediaPlayerNext)??!1,m=n?.includes(js.MediaPlayerPrevious)??!1,h=(n?.includes(js.MediaPlayerVolume)??!1)&&c.volumeLevel!==null,g=()=>{u||(d===`play`?(l({state:`playing`}),a.play({})):(l({state:`paused`}),a.pause({})))},_=c.currentMedia?.artist??c.currentMedia?.album??null,v=JU(c.positionMs,c.durationMs),y=c.volumeLevel??0;return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6`,children:[(0,C.jsx)(XU,{title:c.currentMedia?.title??null,subtitle:_}),f&&(0,C.jsxs)(`div`,{"data-testid":`media-seek`,className:`flex flex-col gap-1`,children:[(0,C.jsxs)(`label`,{className:`relative block`,children:[(0,C.jsx)(`span`,{className:`sr-only`,children:`Seek`}),(0,C.jsx)(`input`,{"aria-label":`Seek`,type:`range`,min:0,max:c.durationMs??0,step:1e3,className:`absolute inset-0 h-4 w-full cursor-pointer opacity-0`,value:c.positionMs??0,disabled:u,onChange:e=>{if(u)return;let t=Number(e.target.value);l({positionMs:t}),a.seek({positionMs:t})}}),(0,C.jsx)(`div`,{className:`pointer-events-none`,children:(0,C.jsx)(Qz,{fraction:v})})]}),(0,C.jsxs)(`div`,{className:`flex justify-between text-[11px] tabular-nums text-foreground-subtle`,children:[(0,C.jsx)(`span`,{children:YU(c.positionMs)}),(0,C.jsx)(`span`,{children:YU(c.durationMs)})]})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-center gap-4`,children:[m&&(0,C.jsx)(ZU,{label:`Previous`,busy:u,onPress:()=>void a.previous({}),children:(0,C.jsx)(AR,{className:`h-5 w-5`,"aria-hidden":`true`})}),(0,C.jsx)(ZU,{label:d===`play`?`Play`:`Pause`,busy:u,onPress:g,primary:!0,children:d===`play`?(0,C.jsx)(yR,{className:`h-6 w-6`,"aria-hidden":`true`}):(0,C.jsx)(gR,{className:`h-6 w-6`,"aria-hidden":`true`})}),p&&(0,C.jsx)(ZU,{label:`Next`,busy:u,onPress:()=>void a.next({}),children:(0,C.jsx)(jR,{className:`h-5 w-5`,"aria-hidden":`true`})})]}),h&&(0,C.jsxs)(`div`,{"data-testid":`media-volume`,className:`flex items-center gap-2`,children:[(0,C.jsx)(`button`,{type:`button`,"aria-label":c.isMuted===!0?`Unmute`:`Mute`,title:c.isMuted===!0?`Unmute`:`Mute`,disabled:u,onClick:e=>{if(e.stopPropagation(),u||c.isMuted===null)return;let t=!c.isMuted;l({isMuted:t}),a.setMute({muted:t})},className:Z(`inline-flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,u&&`opacity-40 cursor-not-allowed`),children:c.isMuted===!0?(0,C.jsx)(XR,{className:`h-4 w-4`,"aria-hidden":`true`}):(0,C.jsx)(YR,{className:`h-4 w-4`,"aria-hidden":`true`})}),(0,C.jsxs)(`label`,{className:`relative block flex-1`,children:[(0,C.jsx)(`span`,{className:`sr-only`,children:`Volume`}),(0,C.jsx)(`input`,{"aria-label":`Volume`,type:`range`,min:0,max:100,step:1,className:`absolute inset-0 h-4 w-full cursor-pointer opacity-0`,value:y,disabled:u,onChange:e=>{if(u)return;let t=Number(e.target.value);l({volumeLevel:t}),a.setVolume({volumeLevel:t})}}),(0,C.jsx)(`div`,{className:`pointer-events-none`,children:(0,C.jsx)(Qz,{fraction:y/100})})]}),(0,C.jsxs)(`span`,{className:`w-9 text-right text-[11px] tabular-nums text-foreground-subtle`,children:[y,`%`]})]})]})}var $U={disarmed:{label:`Disarmed`,colorClass:`border-border bg-surface-subtle text-foreground-subtle`,icon:`disarmed`},armed_home:{label:`Armed Home`,colorClass:`border-success/30 bg-success/10 text-success`,icon:`armed`},armed_away:{label:`Armed Away`,colorClass:`border-success/30 bg-success/10 text-success`,icon:`armed`},armed_night:{label:`Armed Night`,colorClass:`border-success/30 bg-success/10 text-success`,icon:`armed`},armed_vacation:{label:`Armed Vacation`,colorClass:`border-success/30 bg-success/10 text-success`,icon:`armed`},armed_custom_bypass:{label:`Armed (Bypass)`,colorClass:`border-success/30 bg-success/10 text-success`,icon:`armed`},arming:{label:`Arming…`,colorClass:`border-warning/30 bg-warning/10 text-warning`,icon:`pending`},disarming:{label:`Disarming…`,colorClass:`border-warning/30 bg-warning/10 text-warning`,icon:`pending`},pending:{label:`Pending`,colorClass:`border-warning/30 bg-warning/10 text-warning`,icon:`pending`},triggered:{label:`Triggered`,colorClass:`border-danger/30 bg-danger/10 text-danger`,icon:`triggered`}},eW={home:`Home`,away:`Away`,night:`Night`,vacation:`Vacation`,custom_bypass:`Bypass`};function tW(e){return e.startsWith(`armed_`)}function nW(e){return e===`arming`||e===`disarming`}function rW({icon:e}){return e===`disarmed`?(0,C.jsx)(DR,{className:`h-8 w-8`,"aria-hidden":`true`}):e===`triggered`?(0,C.jsx)(TR,{className:`h-8 w-8`,"aria-hidden":`true`}):e===`pending`?(0,C.jsx)(OR,{className:`h-8 w-8`,"aria-hidden":`true`}):(0,C.jsx)(ER,{className:`h-8 w-8`,"aria-hidden":`true`})}function iW({label:e,active:t,busy:n,onSelect:r}){return(0,C.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":t,disabled:n,onClick:e=>{e.stopPropagation(),n||r()},className:Z(`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors`,t?`bg-primary text-primary-foreground shadow-sm`:`text-foreground-muted hover:bg-surface-hover`,n&&`opacity-40 cursor-not-allowed`),children:e})}function aW({state:e,availableModes:t,busy:n,onDisarm:r,onArm:a}){let o=tW(e),s=nW(e);return(0,C.jsxs)(`div`,{className:`flex items-stretch gap-1 rounded-lg border border-border bg-surface-subtle p-1`,children:[(0,C.jsx)(iW,{label:`Disarm`,active:!o&&!s,busy:n,onSelect:r}),t.map(t=>(0,C.jsx)(iW,{label:eW[t],active:!s&&e===`armed_${t}`,busy:n,onSelect:()=>a(t)},t))]})}function oW(e,t,n){let{cap:r,slice:a,available:o}=Wz({trpc:e,deviceId:t,cap:e=>e.alarmPanel,slice:e=>e.state.alarmPanel}),{display:s,applyOptimistic:c}=rB(a,{enabled:n??!0}),l=!o;return{display:s,capPresent:r!==void 0,busy:l,handleDisarm:()=>{r===void 0||l||(c({state:`disarming`}),r.disarm({}))},handleArm:e=>{r===void 0||l||(c({state:`arming`}),r.arm({mode:e}))}}}function sW({trpc:e,deviceId:t,optimistic:n}){let{display:r,capPresent:a,busy:o,handleDisarm:s,handleArm:c}=oW(e,t,n);return!a||r===void 0?null:(0,C.jsx)(aW,{state:r.state,availableModes:r.availableModes,busy:o,onDisarm:s,onArm:c})}function cW({trpc:e,deviceId:t,optimistic:n}){let{display:r,capPresent:a,busy:o,handleDisarm:s,handleArm:c}=oW(e,t,n);if(!a||r===void 0)return null;let l=$U[r.state];return(0,C.jsxs)(`div`,{className:`flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6`,children:[(0,C.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,C.jsx)(`div`,{"data-testid":`alarm-state`,"data-state":r.state,className:Z(`flex h-16 w-16 items-center justify-center rounded-full border-2`,l.colorClass),children:(0,C.jsx)(rW,{icon:l.icon})}),(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground-muted`,children:l.label})]}),(0,C.jsx)(aW,{state:r.state,availableModes:r.availableModes,busy:o,onDisarm:s,onArm:c})]})}function lW({children:e}){return(0,C.jsx)(`div`,{className:`flex flex-col items-stretch gap-3 rounded-lg border border-border bg-surface p-4`,children:e})}function uW(e,t){let{cap:n}=Wz({trpc:e,deviceId:t,cap:e=>e.switch,slice:e=>e.state.switch});return n!==void 0}function dW({trpc:e,deviceId:t,features:n,optimistic:r}){return uW(e,t)?(0,C.jsx)(SH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r}):null}function fW(e,t){let{cap:n}=Wz({trpc:e,deviceId:t,cap:e=>e.lockControl,slice:e=>e.state.lockControl});return n!==void 0}function pW({trpc:e,deviceId:t,features:n,optimistic:r}){return fW(e,t)?(0,C.jsx)(wH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r}):null}function mW({trpc:e,deviceId:t,features:n,optimistic:r}){return uW(e,t)?(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-2`,children:[(0,C.jsx)(SH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r}),(0,C.jsx)(TH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r})]}):null}function hW(e,t){let{cap:n}=Wz({trpc:e,deviceId:t,cap:e=>e.fanControl,slice:e=>e.state.fanControl});return n!==void 0}function gW({trpc:e,deviceId:t,features:n,optimistic:r}){return hW(e,t)?(0,C.jsxs)(`div`,{className:`inline-flex items-center gap-2`,children:[(0,C.jsx)(SH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r}),(0,C.jsx)(EH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r})]}):null}function _W(e,t){let{cap:n}=Wz({trpc:e,deviceId:t,cap:e=>e.climateControl,slice:e=>e.state.climateControl});return n!==void 0}function vW({trpc:e,deviceId:t,features:n,optimistic:r}){return _W(e,t)?(0,C.jsx)(AH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r}):null}function yW({trpc:e,deviceId:t,features:n,optimistic:r}){return _W(e,t)?(0,C.jsx)(BH,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r}):null}function bW({trpc:e,deviceId:t,features:n,optimistic:r}){return _W(e,t)?(0,C.jsx)(BH,{trpc:e,deviceId:t,features:n,layout:`full`,optimistic:r}):null}function xW(e,t){let{cap:n}=Wz({trpc:e,deviceId:t,cap:e=>e.mediaPlayer,slice:e=>e.state.mediaPlayer});return n!==void 0}function SW({trpc:e,deviceId:t,features:n,optimistic:r}){return xW(e,t)?(0,C.jsx)(tU,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r}):null}function CW(e,t){let{cap:n}=Wz({trpc:e,deviceId:t,cap:e=>e.control,slice:e=>e.state.control});return n!==void 0}function wW({trpc:e,deviceId:t,features:n,optimistic:r}){return CW(e,t)?(0,C.jsx)(cU,{trpc:e,deviceId:t,features:n,layout:`compact`,optimistic:r}):null}function TW({trpc:e,deviceId:t,features:n,optimistic:r}){return CW(e,t)?(0,C.jsx)(lW,{children:(0,C.jsx)(cU,{trpc:e,deviceId:t,features:n,layout:`full`,optimistic:r})}):null}var EW={cover:{InlineControl:sB,HeroCard:fB},valve:{InlineControl:wV,HeroCard:kV},humidifier:{InlineControl:MV,HeroCard:PV},"water-heater":{InlineControl:RV,HeroCard:BV},switch:{InlineControl:dW,HeroCard:KU},light:{InlineControl:mW,HeroCard:HU},fan:{InlineControl:gW,HeroCard:GU},sensor:{InlineControl:MB,HeroCard:VB},thermostat:{InlineControl:vW,HeroCard:bU},climate:{InlineControl:yW,HeroCard:bW},button:{InlineControl:$z,HeroCard:eB},update:{InlineControl:WB,HeroCard:GB},lock:{InlineControl:pW,HeroCard:DU},"media-player":{InlineControl:SW,HeroCard:QU},alarm:{InlineControl:sW,HeroCard:cW},control:{InlineControl:wW,HeroCard:TW},weather:{InlineControl:KV,HeroCard:ZV},vacuum:{InlineControl:iV,HeroCard:oV},"lawn-mower":{InlineControl:_V,HeroCard:yV},image:{InlineControl:iH,HeroCard:aH},"pet-feeder":{InlineControl:bH,HeroCard:xH},dummy:{InlineControl:pB,HeroCard:mB}};Object.fromEntries(Object.values(W).map(e=>[e,EW[Lh[e]]])),W.Cover,W.Valve,W.Thermostat,W.Climate,W.Control,W.Button,W.MediaPlayer,W.AlarmPanel,W.Lock,W.Vacuum,W.LawnMower,W.Humidifier,W.Switch,W.Siren,W.Light,W.Fan,W.WaterHeater,W.Sensor,W.Presence,W.EventEmitter,W.Notifier,W.Script,W.Automation,W.Camera,W.Hub,W.Update,W.Generic,W.Weather,W.Container,W.Image,W.PetFeeder,new Set(Object.values(W));var DW={[W.Camera]:{icon:yL,label:`Camera`},[W.Hub]:{icon:hR,label:`Hub`},[W.Light]:{icon:QL,label:`Light`},[W.Siren]:{icon:kR,label:`Siren`},[W.Switch]:{icon:HR,label:`Switch`},[W.Sensor]:{icon:sL,label:`Sensor`},[W.Thermostat]:{icon:VR,label:`Thermostat`},[W.Climate]:{icon:cL,label:`Air conditioner`},[W.Button]:{icon:TL,label:`Button`},[W.EventEmitter]:{icon:rz,label:`Event Emitter`},[W.Update]:{icon:SR,label:`Update`},[W.Generic]:{icon:vL,label:`Generic`},[W.Notifier]:{icon:mL,label:`Notifier`},[W.Script]:{icon:wR,label:`Script`},[W.Automation]:{icon:tz,label:`Automation`},[W.Lock]:{icon:rR,label:`Lock`},[W.Cover]:{icon:hL,label:`Cover`},[W.Valve]:{icon:vR,label:`Valve`},[W.Humidifier]:{icon:ZR,label:`Humidifier`},[W.WaterHeater]:{icon:dL,label:`Water heater`},[W.Fan]:{icon:BL,label:`Fan`},[W.MediaPlayer]:{icon:cR,label:`Media player`},[W.AlarmPanel]:{icon:TR,label:`Alarm panel`},[W.Control]:{icon:MR,label:`Control`},[W.Presence]:{icon:aR,label:`Presence`},[W.Weather]:{icon:jL,label:`Weather`},[W.Vacuum]:{icon:_L,label:`Vacuum`},[W.LawnMower]:{icon:UR,label:`Lawn mower`},[W.Container]:{icon:vL,label:`Container`},[W.Image]:{icon:XL,label:`Image`},[W.PetFeeder]:{icon:gL,label:`Pet feeder`}},OW={[G.Siren]:{icon:kR,label:`Siren`},[G.Floodlight]:{icon:QL,label:`Floodlight`},[G.Spotlight]:{icon:UL,label:`Spotlight`},[G.PirSensor]:{icon:xR,label:`PIR sensor`},[G.Chime]:{icon:mL,label:`Chime`},[G.Autotrack]:{icon:NL,label:`Auto-track`},[G.Nightvision]:{icon:lR,label:`Night vision`},[G.PrivacyMask]:{icon:zL,label:`Privacy mask`},[G.Doorbell]:{icon:PL,label:`Doorbell`},[G.BinaryHelper]:{icon:HR,label:`Binary helper`},[G.MotionSensor]:{icon:GL,label:`Motion sensor`},[G.ContactSensor]:{icon:FL,label:`Contact sensor`},[G.LeakSensor]:{icon:LL,label:`Leak sensor`},[G.SmokeSensor]:{icon:lL,label:`Smoke sensor`},[G.COSensor]:{icon:ez,label:`CO sensor`},[G.GasSensor]:{icon:HL,label:`Gas sensor`},[G.TamperSensor]:{icon:TR,label:`Tamper sensor`},[G.VibrationSensor]:{icon:JR,label:`Vibration sensor`},[G.ConnectivitySensor]:{icon:$R,label:`Connectivity`},[G.SoundSensor]:{icon:YR,label:`Sound sensor`},[G.BinarySensor]:{icon:HR,label:`Binary sensor`},[G.TemperatureSensor]:{icon:VR,label:`Temperature`},[G.HumiditySensor]:{icon:RL,label:`Humidity`},[G.AmbientLightSensor]:{icon:zR,label:`Ambient light`},[G.PressureSensor]:{icon:KL,label:`Pressure`},[G.WindSensor]:{icon:ez,label:`Wind`},[G.RainSensor]:{icon:kL,label:`Rain`},[G.UvSensor]:{icon:RR,label:`UV index`},[G.SolarRadiationSensor]:{icon:BR,label:`Solar radiation`},[G.SoilMoistureSensor]:{icon:IR,label:`Soil moisture`},[G.PowerSensor]:{icon:rz,label:`Power`},[G.EnergySensor]:{icon:rz,label:`Energy`},[G.VoltageSensor]:{icon:rz,label:`Voltage`},[G.CurrentSensor]:{icon:rz,label:`Current`},[G.AirQualitySensor]:{icon:ez,label:`Air quality`},[G.BatterySensor]:{icon:KL,label:`Battery`},[G.NumericSensor]:{icon:qL,label:`Numeric sensor`},[G.EnumSensor]:{icon:eR,label:`Enum sensor`},[G.DateTimeSensor]:{icon:EL,label:`Date / time`},[G.GenericSensor]:{icon:KL,label:`Sensor`},[G.NumericControl]:{icon:MR,label:`Numeric control`},[G.SelectControl]:{icon:$L,label:`Select control`},[G.TextControl]:{icon:KR,label:`Text control`},[G.DateTimeControl]:{icon:EL,label:`Date / time control`},[G.MobilePushNotifier]:{icon:NR,label:`Mobile push`},[G.MessagingNotifier]:{icon:sR,label:`Messaging`},[G.EmailNotifier]:{icon:iR,label:`Email`},[G.GenericNotifier]:{icon:mL,label:`Notifier`}},kW=new Set(Object.values(W));new Set(Object.values(G));function AW(e){return kW.has(e)}var jW=DW[W.Generic];OW[G.GenericSensor];function MW(e){return AW(e)?DW[e]??jW:jW}Object.values(W).map(e=>{let t=MW(e);return{id:e,label:t.label,icon:t.icon}}),(0,S.createContext)(null),new Set([W.Sensor,W.Presence]),Object.freeze([]);var NW={face:`#a855f7`,plate:`#ec4899`};Object.freeze({...Object.fromEntries(Object.values(qc).filter(e=>e.category===`detection`||e.kind===`motion`).map(e=>[e.kind,e.color])),...NW});var PW=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()}},FW=class{constructor(e){this.generateIdentifier=e,this.kv=new PW}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)}},IW=class extends FW{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 LW(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 RW(e,t){let n=LW(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 zW(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function BW(e,t){return e.indexOf(t)!==-1}function VW(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var HW=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return RW(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},UW=e=>Object.prototype.toString.call(e).slice(8,-1),WW=e=>e===void 0,GW=e=>e===null,KW=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,qW=e=>KW(e)&&Object.keys(e).length===0,JW=e=>Array.isArray(e),YW=e=>typeof e==`string`,XW=e=>typeof e==`number`&&!isNaN(e),ZW=e=>typeof e==`boolean`,QW=e=>e instanceof RegExp,$W=e=>e instanceof Map,eG=e=>e instanceof Set,tG=e=>UW(e)===`Symbol`,nG=e=>e instanceof Date&&!isNaN(e.valueOf()),rG=e=>e instanceof Error,iG=e=>typeof e==`number`&&isNaN(e),aG=e=>ZW(e)||GW(e)||WW(e)||XW(e)||YW(e)||tG(e),oG=e=>typeof e==`bigint`,sG=e=>e===1/0||e===-1/0,cG=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),lG=e=>e instanceof URL,uG=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),dG=e=>e.map(String).map(uG).join(`.`),fG=(e,t)=>{let n=[],r=``;for(let a=0;a<e.length;a++){let o=e.charAt(a);if(!t&&o===`\\`){let t=e.charAt(a+1);if(t===`\\`){r+=`\\`,a++;continue}else if(t!==`.`)throw Error(`invalid path`)}if(o===`\\`&&e.charAt(a+1)===`.`){r+=`.`,a++;continue}if(o===`.`){n.push(r),r=``;continue}r+=o}let a=r;return n.push(a),n};function pG(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var mG=[pG(WW,`undefined`,()=>null,()=>void 0),pG(oG,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),pG(nG,`Date`,e=>e.toISOString(),e=>new Date(e)),pG(rG,`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}),pG(QW,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),pG(eG,`set`,e=>[...e.values()],e=>new Set(e)),pG($W,`map`,e=>[...e.entries()],e=>new Map(e)),pG(e=>iG(e)||sG(e),`number`,e=>iG(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),pG(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),pG(lG,`URL`,e=>e.toString(),e=>new URL(e))];function hG(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var gG=hG((e,t)=>tG(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}),_G=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),vG=hG(cG,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=_G[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function yG(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var bG=hG(yG,(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)}),xG=hG((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)}),SG=[bG,gG,xG,vG],CG=(e,t)=>{let n=VW(SG,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=VW(mG,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},wG={};mG.forEach(e=>{wG[e.annotation]=e});var TG=(e,t,n)=>{if(JW(t))switch(t[0]){case`symbol`:return gG.untransform(e,t,n);case`class`:return bG.untransform(e,t,n);case`custom`:return xG.untransform(e,t,n);case`typed-array`:return vG.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=wG[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},EG=(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 DG(e){if(BW(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(BW(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(BW(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var OG=(e,t)=>{DG(t);for(let n=0;n<t.length;n++){let r=t[n];if(eG(e))e=EG(e,+r);else if($W(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=EG(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},kG=(e,t,n)=>{if(DG(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(JW(r)){let e=+n;r=r[e]}else if(KW(r))r=r[n];else if(eG(r)){let e=+n;r=EG(r,e)}else if($W(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=EG(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if(JW(r)?r[+a]=n(r[+a]):KW(r)&&(r[a]=n(r[a])),eG(r)){let e=EG(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if($W(r)){let e=+t[t.length-2],o=EG(r,e);switch(+a==0?`key`:`value`){case`key`:{let e=n(o);r.set(e,r.get(o)),e!==o&&r.delete(o);break}case`value`:r.set(o,n(r.get(o)));break}}return e},AG=e=>e<1;function jG(e,t,n,r=[]){if(!e)return;let a=AG(n);if(!JW(e)){zW(e,(e,o)=>jG(e,t,n,[...r,...fG(o,a)]));return}let[o,s]=e;s&&zW(s,(e,o)=>{jG(e,t,n,[...r,...fG(o,a)])}),t(o,r)}function MG(e,t,n,r){return jG(t,(t,n)=>{e=kG(e,n,e=>TG(e,t,r))},n),e}function NG(e,t,n){let r=AG(n);function a(t,n){let a=OG(e,fG(n,r));t.map(e=>fG(e,r)).forEach(t=>{e=kG(e,t,()=>a)})}if(JW(t)){let[n,o]=t;n.forEach(t=>{e=kG(e,fG(t,r),()=>e)}),o&&zW(o,a)}else zW(t,a);return e}var PG=(e,t)=>KW(e)||JW(e)||$W(e)||eG(e)||rG(e)||yG(e,t);function FG(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function IG(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[a,...o]=e;a.length===0?r=o.map(dG):n[dG(a)]=o.map(dG)}),r?qW(n)?[r]:[r,n]:qW(n)?void 0:n}var LG=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=aG(e);if(!c){FG(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!PG(e,n)){let t=CG(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(BW(o,e))return{transformedValue:null};let l=CG(e,n),u=l?.value??e,d=JW(u)?[]:{},f={};zW(u,(c,l)=>{if(l===`__proto__`||l===`constructor`||l===`prototype`)throw Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);let u=LG(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,JW(u.annotations)?f[uG(l)]=u.annotations:KW(u.annotations)&&zW(u.annotations,(e,t)=>{f[uG(l)+`.`+t]=e})});let p=qW(f)?{transformedValue:d,annotations:l?[l.type]:void 0}:{transformedValue:d,annotations:l?[l.type,f]:f};return c||s.set(e,p),p};function RG(e){return Object.prototype.toString.call(e).slice(8,-1)}function zG(e){return RG(e)===`Array`}function BG(e){if(RG(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function VG(e,t,n,r,a){let o={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;o===`enumerable`&&(e[t]=n),a&&o===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function HG(e,t={}){if(zG(e))return e.map(e=>HG(e,t));if(!BG(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||zG(t.props)&&!t.props.includes(r))return n;let a=e[r];return VG(n,r,HG(a,t),e,t.nonenumerable),n},{})}var UG=class{constructor({dedupe:e=!1}={}){this.classRegistry=new IW,this.symbolRegistry=new FW(e=>e.description??``),this.customTransformerRegistry=new HW,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=LG(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=IG(t,this.dedupe);return a&&(r.meta={...r.meta,referentialEqualities:a}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,a=t?.inPlace?n:HG(n);return r?.values&&(a=MG(a,r.values,r.v??0,this)),r?.referentialEqualities&&(a=NG(a,r.referentialEqualities,r.v??0)),a}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)}};UG.defaultInstance=new UG,UG.serialize=UG.defaultInstance.serialize.bind(UG.defaultInstance),UG.deserialize=UG.defaultInstance.deserialize.bind(UG.defaultInstance),UG.stringify=UG.defaultInstance.stringify.bind(UG.defaultInstance),UG.parse=UG.defaultInstance.parse.bind(UG.defaultInstance),UG.registerClass=UG.defaultInstance.registerClass.bind(UG.defaultInstance),UG.registerSymbol=UG.defaultInstance.registerSymbol.bind(UG.defaultInstance),UG.registerCustom=UG.defaultInstance.registerCustom.bind(UG.defaultInstance),UG.allowErrorProps=UG.defaultInstance.allowErrorProps.bind(UG.defaultInstance),UG.serialize,UG.deserialize,UG.stringify,UG.parse,UG.registerClass,UG.registerCustom,UG.registerSymbol,UG.allowErrorProps,(0,S.createContext)(null),aN(`camstack:custom-field-renderers`,{}),aN(`camstack:device-context`,null),aN(`camstack:widget-registry`,null);function WG({title:e,icon:t,headerRight:n,collapsible:r=!1,defaultOpen:a=!0,bodyClassName:o=`p-3`,children:s}){let[c,l]=(0,S.useState)(a),u=!r||c,d=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground`,children:[t,e]}),r?c?(0,C.jsx)(xL,{className:`h-3.5 w-3.5 text-foreground-subtle`}):(0,C.jsx)(SL,{className:`h-3.5 w-3.5 text-foreground-subtle`}):n]}),f=`px-4 py-2 flex items-center justify-between ${u?`border-b border-border`:``}`;return(0,C.jsxs)(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r?(0,C.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`w-full text-left ${f}`,children:d}):(0,C.jsx)(`div`,{className:f,children:d}),u?(0,C.jsx)(`div`,{className:o,children:s}):null]})}aN(`camstack:vod-playback`,{request:null,play:()=>{},clear:()=>{}}),aN(`camstack:recorded-playback`,{bindControlChannel:null,channelOpen:!1,mode:`live`,positionMs:null,send:()=>!1}),(0,S.lazy)(()=>fs(()=>import(`./MotionZonesSettings-NcxxQN8r-9D-BWwQP.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,S.lazy)(()=>fs(()=>import(`./PrivacyMaskSettings-APgPLF7p-HvAetfA4.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var GG=Object.defineProperty,KG=Object.getOwnPropertySymbols,qG=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable,YG=(e,t,n)=>t in e?GG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XG=(e,t)=>{for(var n in t||={})qG.call(t,n)&&YG(e,n,t[n]);if(KG)for(var n of KG(t))JG.call(t,n)&&YG(e,n,t[n]);return e},ZG=(e,t)=>{var n={};for(var r in e)qG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&KG)for(var r of KG(e))t.indexOf(r)<0&&JG.call(e,r)&&(n[r]=e[r]);return n},QG;(e=>{let t=class t{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(o<-1||o>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();let c=this.addEccAndInterleave(r);if(this.drawCodewords(c),o==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}a(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){let a=e.QrSegment.makeSegments(n);return t.encodeSegments(a,r)}static encodeBinary(n,r){let a=e.QrSegment.makeBytes(n);return t.encodeSegments([a],r)}static encodeSegments(e,r,o=1,c=40,l=-1,u=!0){if(!(t.MIN_VERSION<=o&&o<=c&&c<=t.MAX_VERSION)||l<-1||l>7)throw RangeError(`Invalid value`);let d,f;for(d=o;;d++){let n=t.getNumDataCodewords(d,r)*8,a=s.getTotalBits(e,d);if(a<=n){f=a;break}if(d>=c)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=t.getNumDataCodewords(d,e)*8&&(r=e);let p=[];for(let t of e){n(t.mode.modeBits,4,p),n(t.numChars,t.mode.numCharCountBits(d),p);for(let e of t.getData())p.push(e)}a(p.length==f);let m=t.getNumDataCodewords(d,r)*8;a(p.length<=m),n(0,Math.min(4,m-p.length),p),n(0,(8-p.length%8)%8,p),a(p.length%8==0);for(let e=236;p.length<m;e^=253)n(e,8,p);let h=[];for(;h.length*8<p.length;)h.push(0);return p.forEach((e,t)=>h[t>>>3]|=e<<7-(t&7)),new t(d,r,h,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let o=(t<<10|n)^21522;a(o>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(o,e));this.setFunctionModule(8,7,r(o,6)),this.setFunctionModule(8,8,r(o,7)),this.setFunctionModule(7,8,r(o,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(o,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(o,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(o,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;a(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),a=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(a,o,n),this.setFunctionModule(o,a,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let a=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,a!=2&&a!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],c=Math.floor(t.getNumRawDataModules(n)/8),l=o-c%o,u=Math.floor(c/o),d=[],f=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<o;n++){let a=e.slice(r,r+u-s+(n<l?0:1));r+=a.length;let o=t.reedSolomonComputeRemainder(a,f);n<l&&a.push(0),d.push(a.concat(o))}let p=[];for(let e=0;e<d[0].length;e++)d.forEach((t,n)=>{(e!=u-s||n>=l)&&p.push(t[e])});return a(p.length==c),p}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let a=0;a<this.size;a++)for(let o=0;o<2;o++){let s=t-o,c=t+1&2?a:this.size-1-a;!this.isFunction[c][s]&&n<e.length*8&&(this.modules[c][s]=r(e[n>>>3],7-(n&7)),n++)}}a(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,a=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(a++,a==5?e+=t.PENALTY_N1:a>5&&e++):(this.finderPenaltyAddHistory(a,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],a=1);e+=this.finderPenaltyTerminateAndCount(r,a,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,a=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(a++,a==5?e+=t.PENALTY_N1:a>5&&e++):(this.finderPenaltyAddHistory(a,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],a=1);e+=this.finderPenaltyTerminateAndCount(r,a,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let a=this.modules[n][r];a==this.modules[n][r+1]&&a==this.modules[n+1][r]&&a==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,o=Math.ceil(Math.abs(n*20-r*10)/r)-1;return a(0<=o&&o<=9),e+=o*t.PENALTY_N4,a(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return a(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let a=0;a<e;a++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let a of e){let e=a^r.shift();r.push(0),n.forEach((n,a)=>r[a]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return a(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];a(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function a(e){if(!e)throw Error(`Assertion error`)}let o=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let a=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+a),10),a*3+1,r),e+=a}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],a;for(a=0;a+2<=t.length;a+=2){let o=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a))*45;o+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a+1)),n(o,11,r)}return a<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};o.NUMERIC_REGEX=/^[0-9]*$/,o.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,o.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let s=o;e.QrSegment=o})(QG||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(QG||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(QG||={});var $G=QG,eK={L:$G.QrCode.Ecc.LOW,M:$G.QrCode.Ecc.MEDIUM,Q:$G.QrCode.Ecc.QUARTILE,H:$G.QrCode.Ecc.HIGH},tK=128,nK=`L`,rK=`#FFFFFF`,iK=`#000000`,aK=!1,oK=1,sK=4,cK=0,lK=.1;function uK(e,t=0){let n=[];return e.forEach(function(e,r){let a=null;e.forEach(function(o,s){if(!o&&a!==null){n.push(`M${a+t} ${r+t}h${s-a}v1H${a+t}z`),a=null;return}if(s===e.length-1){if(!o)return;a===null?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${a+t},${r+t} h${s+1-a}v1H${a+t}z`);return}o&&a===null&&(a=s)})}),n.join(``)}function dK(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function fK(e,t,n,r){if(r==null)return null;let a=e.length+n*2,o=Math.floor(t*lK),s=a/t,c=(r.width||o)*s,l=(r.height||o)*s,u=r.x==null?e.length/2-c/2:r.x*s,d=r.y==null?e.length/2-l/2:r.y*s,f=r.opacity==null?1:r.opacity,p=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(c+u-e),h:Math.ceil(l+d-t)}}let m=r.crossOrigin;return{x:u,y:d,h:l,w:c,excavation:p,opacity:f,crossOrigin:m}}function pK(e,t){return t==null?e?sK:cK:Math.max(Math.floor(t),0)}function mK({value:e,level:t,minVersion:n,includeMargin:r,marginSize:a,imageSettings:o,size:s,boostLevel:c}){let l=S.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...$G.QrSegment.makeSegments(t)),e),[]);return $G.QrCode.encodeSegments(r,eK[t],n,void 0,void 0,c)},[e,t,n,c]),{cells:u,margin:d,numCells:f,calculatedImageSettings:p}=S.useMemo(()=>{let e=l.getModules(),t=pK(r,a);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:fK(e,s,t,o)}},[l,s,o,r,a]);return{qrcode:l,margin:d,cells:u,numCells:f,calculatedImageSettings:p}}var hK=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),gK=S.forwardRef(function(e,t){let n=e,{value:r,size:a=tK,level:o=nK,bgColor:s=rK,fgColor:c=iK,includeMargin:l=aK,minVersion:u=oK,boostLevel:d,marginSize:f,imageSettings:p}=n,m=ZG(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:h}=m,g=ZG(m,[`style`]),_=p?.src,v=S.useRef(null),y=S.useRef(null),b=S.useCallback(e=>{v.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[x,C]=S.useState(!1),{margin:w,cells:T,numCells:E,calculatedImageSettings:D}=mK({value:r,level:o,minVersion:u,boostLevel:d,includeMargin:l,marginSize:f,imageSettings:p,size:a});S.useEffect(()=>{if(v.current!=null){let e=v.current,t=e.getContext(`2d`);if(!t)return;let n=T,r=y.current,o=D!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;o&&D.excavation!=null&&(n=dK(T,D.excavation));let l=window.devicePixelRatio||1;e.height=e.width=a*l;let u=a/E*l;t.scale(u,u),t.fillStyle=s,t.fillRect(0,0,E,E),t.fillStyle=c,hK?t.fill(new Path2D(uK(n,w))):T.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+w,n+w,1,1)})}),D&&(t.globalAlpha=D.opacity),o&&t.drawImage(r,D.x+w,D.y+w,D.w,D.h)}}),S.useEffect(()=>{C(!1)},[_]);let ee=XG({height:a,width:a},h),te=null;return _!=null&&(te=S.createElement(`img`,{src:_,key:_,style:{display:`none`},onLoad:()=>{C(!0)},ref:y,crossOrigin:D?.crossOrigin})),S.createElement(S.Fragment,null,S.createElement(`canvas`,XG({style:ee,height:a,width:a,ref:b,role:`img`},g)),te)});gK.displayName=`QRCodeCanvas`;var _K=S.forwardRef(function(e,t){let n=e,{value:r,size:a=tK,level:o=nK,bgColor:s=rK,fgColor:c=iK,includeMargin:l=aK,minVersion:u=oK,boostLevel:d,title:f,marginSize:p,imageSettings:m}=n,h=ZG(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:g,cells:_,numCells:v,calculatedImageSettings:y}=mK({value:r,level:o,minVersion:u,boostLevel:d,includeMargin:l,marginSize:p,imageSettings:m,size:a}),b=_,x=null;m!=null&&y!=null&&(y.excavation!=null&&(b=dK(_,y.excavation)),x=S.createElement(`image`,{href:m.src,height:y.h,width:y.w,x:y.x+g,y:y.y+g,preserveAspectRatio:`none`,opacity:y.opacity,crossOrigin:y.crossOrigin}));let C=uK(b,g);return S.createElement(`svg`,XG({height:a,width:a,viewBox:`0 0 ${v} ${v}`,ref:t,role:`img`},h),!!f&&S.createElement(`title`,null,f),S.createElement(`path`,{fill:s,d:`M0,0 h${v}v${v}H0z`,shapeRendering:`crispEdges`}),S.createElement(`path`,{fill:c,d:C,shapeRendering:`crispEdges`}),x)});_K.displayName=`QRCodeSVG`;function vK(e,t){e.muted=t;let n=e.srcObject;if(n instanceof MediaStream)for(let e of n.getAudioTracks())e.enabled=!t}function yK(){return typeof window>`u`?!1:window.matchMedia(`(hover: none) and (pointer: coarse)`).matches||typeof navigator<`u`&&navigator.maxTouchPoints>0||`ontouchstart`in window}function bK(e,t,n){let r=0;for(let a=0;a<8;a++)for(let o=0;o<8;o++){let s=Math.min(t-1,Math.floor((o+.5)/8*t)),c=Math.min(n-1,Math.floor((a+.5)/8*n)),{data:l}=e.getImageData(s,c,1,1);.2126*(l[0]??0)+.7152*(l[1]??0)+.0722*(l[2]??0)>12&&r++}return r<=1}function xK(e){let t={};if(typeof window<`u`){if(e){let n=e.getBoundingClientRect();n.width>0&&n.height>0&&(t.viewportWidth=Math.round(n.width),t.viewportHeight=Math.round(n.height))}t.viewportWidth===void 0&&(t.viewportWidth=window.innerWidth,t.viewportHeight=window.innerHeight),t.devicePixelRatio=window.devicePixelRatio||1;let n=navigator.connection;n?.downlink&&n.downlink>0&&(t.downlinkMbps=n.downlink)}return t}var SK=1500,CK=15e3,wK=40,TK=8e3;function EK({serverUrl:e,streamKey:t,label:n,autoPlay:r=!0,muted:a=!0,showControls:o=!0,showStats:s=!1,onPlaybackStats:c,onClientNetworkSample:l,onConnectTiming:u,className:d=``,onStateChange:f,onError:p,overlay:m,createSession:h,sendAnswer:g,handleOffer:_,getIceServers:v,addIceCandidate:y,getIceCandidates:b,closeSession:x,getSessionState:w,reoffer:T,posterUrl:E,hintsOverride:D,reconnectSignal:ee,onControlChannel:te}){let O=(0,S.useRef)(null),ne=(0,S.useRef)(null),re=(0,S.useRef)(null),ie=(0,S.useRef)(new Set),ae=(0,S.useRef)(null),oe=(0,S.useRef)(null),se=(0,S.useRef)(0),k=(0,S.useRef)(!0),A=(0,S.useRef)(te);A.current=te;let ce=(0,S.useRef)(null),le=(0,S.useRef)(null),ue=(0,S.useRef)(0),de=(0,S.useRef)(!1),j=(0,S.useRef)(async()=>{}),[M,fe]=(0,S.useState)(`idle`),[pe,me]=(0,S.useState)(``),[he,ge]=(0,S.useState)(a),_e=(0,S.useRef)(he);_e.current=he;let[N,ve]=(0,S.useState)(!1),[ye,be]=(0,S.useState)(!1),xe=yK(),[Se,Ce]=(0,S.useState)(!0),we=(0,S.useRef)(null),Te=(0,S.useRef)(!1);(g||h)&&(Te.current=!0);let Ee=Te.current,De=(0,S.useRef)(!1);_&&(De.current=!0);let Oe=De.current,[ke,Ae]=(0,S.useState)(!1),je=(0,S.useRef)(null),[Me,Ne]=(0,S.useState)(null),[Pe,Fe]=(0,S.useState)(!1),Ie=(0,S.useCallback)(()=>{let e=O.current;if(!(!e||e.readyState<2||!e.videoWidth||!e.videoHeight))try{let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight;let n=t.getContext(`2d`);if(!n||(n.drawImage(e,0,0),bK(n,t.width,t.height)))return;je.current=t.toDataURL(`image/jpeg`,.6)}catch{}},[]),Le=(0,S.useCallback)(e=>{fe(e),e===`playing`&&Ae(!0),f?.(e)},[f]),Re=(0,S.useCallback)(()=>{if(ae.current?.abort(),ae.current=null,oe.current&&=(clearTimeout(oe.current),null),le.current&&=(clearTimeout(le.current),null),ce.current=null,de.current=!1,ue.current=0,re.current&&=(re.current.close(),null),x&&ie.current.size>0){for(let e of ie.current)x(e).catch(()=>{});ie.current.clear()}},[x]),ze=(0,S.useCallback)(()=>{ae.current?.abort(),ae.current=null,oe.current&&=(clearTimeout(oe.current),null),le.current&&=(clearTimeout(le.current),null),ce.current=null,de.current=!1,ue.current=0},[]),Be=1e3,Ve=(0,S.useCallback)(e=>{if(!w||!T)return;le.current&&=(clearTimeout(le.current),null);let t=async()=>{if(k.current&&ce.current===e){if(!de.current)try{let{pendingRenegotiation:t}=await w(e);if(k.current&&ce.current===e&&t&&t.epoch>ue.current&&!de.current){ue.current=t.epoch,await j.current(e,t.target);return}}catch{}!k.current||ce.current!==e||(le.current=setTimeout(()=>{t()},Be))}};le.current=setTimeout(()=>{t()},Be)},[w,T]),He=(0,S.useCallback)(async(e=!1)=>{if(!k.current||!h||!g)return;let t=e?re.current:null,n=e?new Set(ie.current):null;e?ze():Re(),Le(`connecting`);let r=new AbortController;ae.current=r;try{let{sessionId:a,sdpOffer:o,iceServers:s}=await h({...xK(ne.current),...D});if(ie.current.add(a),!k.current||r.signal.aborted){x?.(a).catch(()=>{}),ie.current.delete(a);return}let c=new RTCPeerConnection({iceServers:[...s??[],{urls:`stun:stun.l.google.com:19302`}]});e||(re.current=c);let l=new MediaStream,u=!1,d=()=>{if(!(u||!k.current)){if(u=!0,re.current=c,O.current&&(O.current.srcObject=l,vK(O.current,_e.current),O.current.play().catch(()=>{})),t&&t!==c)try{t.close()}catch{}if(n)for(let e of n)ie.current.delete(e),x?.(e).catch(()=>{})}};c.ontrack=t=>{if(console.debug(`[WebRTC] ontrack`,t.track.kind,t.track.readyState),l.addTrack(t.track),e){d();return}O.current&&(O.current.srcObject=l,vK(O.current,_e.current),O.current.play().catch(()=>{}))},c.oniceconnectionstatechange=()=>{if(!k.current)return;let t=c.iceConnectionState;if(console.debug(`[WebRTC] ICE state:`,t),t===`connected`||t===`completed`)se.current=0,e&&d(),Le(`playing`),O.current?.paused&&(console.debug(`[WebRTC] video was paused at ICE connected — calling play()`),O.current.play().catch(()=>{}));else if(t===`failed`||t===`disconnected`||t===`closed`){if(e&&!u)try{c.close()}catch{}Le(`disconnected`),qe()}},c.onicecandidateerror=e=>{console.debug(`[WebRTC] ICE candidate error:`,e)},console.debug(`[WebRTC] Setting remote description (server offer)...`),await c.setRemoteDescription({type:`offer`,sdp:o});let f=await c.createAnswer();if(await c.setLocalDescription(f),console.debug(`[WebRTC] Local description set, waiting for ICE gathering...`),await OK(c),!k.current)return;let p=(c.localDescription?.sdp??``).split(`
111
- `).filter(e=>e.startsWith(`a=candidate:`)).length;console.debug(`[WebRTC] Sending answer to server`,{localCandidates:p,sessionId:a.slice(0,8)}),await g(a,c.localDescription?.sdp??``),console.debug(`[WebRTC] Answer sent successfully`);let m=c,_=()=>{let e=m.connectionState;if(e===`closed`||e===`failed`)return;let t=O.current;t&&t.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${m.iceConnectionState})`)};setTimeout(_,3e3),setTimeout(_,8e3)}catch(e){if(!k.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),p?.(t),qe()}},[e,t,h,g,Re,ze,x,Le,p,D]),Ue=(0,S.useCallback)(async()=>{if(k.current){Re(),Le(`connecting`);try{let n=new RTCPeerConnection({iceServers:[{urls:`stun:stun.l.google.com:19302`}]});re.current=n,n.addTransceiver(`video`,{direction:`recvonly`}),n.addTransceiver(`audio`,{direction:`recvonly`});let r=new MediaStream;n.ontrack=e=>{r.addTrack(e.track),O.current&&(O.current.srcObject=r,vK(O.current,_e.current),O.current.play().catch(()=>{}))},n.oniceconnectionstatechange=()=>{if(!k.current)return;let e=n.iceConnectionState;e===`connected`||e===`completed`?(se.current=0,Le(`playing`),O.current?.paused&&O.current.play().catch(()=>{})):(e===`failed`||e===`disconnected`||e===`closed`)&&(Le(`disconnected`),qe())};let a=await n.createOffer();if(await n.setLocalDescription(a),await OK(n),!k.current)return;let o=`${e}/api/webrtc?src=${encodeURIComponent(t)}`,s=await fetch(o,{method:`POST`,headers:{"Content-Type":`application/sdp`},body:n.localDescription?.sdp??``});if(!s.ok)throw Error(`WHEP ${s.status}: ${s.statusText}`);let c=await s.text();await n.setRemoteDescription({type:`answer`,sdp:c})}catch(e){if(!k.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),p?.(t),qe()}}},[e,t,Re,Le,p]),We=(0,S.useCallback)(async(e=!1)=>{if(!k.current||!_)return;let n=e?re.current:null,r=e?new Set(ie.current):null;e?ze():Re(),Le(`connecting`);let a=new AbortController;ae.current=a;let o=performance.now(),s=()=>Math.round(performance.now()-o),c={};try{let o=await v?.();if(c.iceServersMs=s(),!k.current||a.signal.aborted)return;let l=new RTCPeerConnection({iceServers:[...o??[],{urls:`stun:stun.l.google.com:19302`}]});e||(re.current=l);let d=new MediaStream,f=!1,p=()=>{if(!(f||!k.current)){if(f=!0,re.current=l,O.current&&(O.current.srcObject=d,vK(O.current,_e.current),O.current.play().catch(()=>{})),n&&n!==l)try{n.close()}catch{}if(r)for(let e of r)ie.current.delete(e),x?.(e).catch(()=>{})}};l.ontrack=t=>{if(c.firstTrackMs===void 0&&(c.firstTrackMs=s()),console.debug(`[WebRTC] ontrack (client-offer)`,t.track.kind,t.track.readyState),d.addTrack(t.track),e){p();return}O.current&&(O.current.srcObject=d,vK(O.current,_e.current),O.current.play().catch(()=>{}))};let m=!1;l.oniceconnectionstatechange=()=>{if(!k.current)return;let n=l.iceConnectionState;if(console.debug(`[WebRTC] ICE state (client-offer):`,n),n===`connected`||n===`completed`){if(!m){m=!0,c.iceConnectedMs=s(),console.info(`[WebRTC timing] client-offer connected`,{streamKey:t,...c}),u?.({...c});let e=O.current;e&&`requestVideoFrameCallback`in e&&(e.requestVideoFrameCallback(()=>{c.firstFrameMs=s(),console.info(`[WebRTC timing] first decoded frame`,{streamKey:t,firstFrameMs:c.firstFrameMs}),u?.({...c})}),setTimeout(()=>{k.current&&c.firstFrameMs===void 0&&console.warn(`[WebRTC timing] NO decoded frame (stalled)`,{streamKey:t,sinceIceConnectedMs:s()-(c.iceConnectedMs??0),iceConnectedMs:c.iceConnectedMs,firstTrackMs:c.firstTrackMs})},TK))}se.current=0,e&&p(),Le(`playing`),O.current?.paused&&O.current.play().catch(()=>{})}else if(n===`failed`||n===`disconnected`||n===`closed`){if(e&&!f)try{l.close()}catch{}Le(`disconnected`),qe()}};let h=null,g=[];if(l.onicecandidate=e=>{if(!e.candidate)return;let t=e.candidate.toJSON();h&&y?y(h,t).catch(()=>{}):g.push(t)},l.addTransceiver(`video`,{direction:`recvonly`}),l.addTransceiver(`audio`,{direction:`recvonly`}),A.current){let e=l.createDataChannel(`camstack-control`);A.current(e)}let S=await l.createOffer();if(c.offerCreatedMs=s(),await l.setLocalDescription(S),c.localSetMs=s(),!k.current||a.signal.aborted)return;let C={...xK(ne.current),...D},w=s(),{sessionId:T,sdpAnswer:E}=await _(l.localDescription?.sdp??S.sdp??``,void 0,C);if(c.signalingRttMs=s()-w,h=T,ie.current.add(T),ce.current=T,!k.current||a.signal.aborted){x?.(T).catch(()=>{}),ie.current.delete(T);return}if(y)for(let e of g)y(T,e).catch(()=>{});if(g.length=0,await l.setRemoteDescription({type:`answer`,sdp:E}),c.answerSetMs=s(),console.debug(`[WebRTC] Client-offer answer set (trickle)`,{sessionId:T.slice(0,8)}),b){let e=new Set,t=Date.now(),n=async()=>{if(!(!k.current||a.signal.aborted)&&!(l.connectionState===`closed`||l.signalingState===`closed`)){try{let{candidates:n,done:r}=await b(T);for(let t of n){let n=t.candidate??``;n&&!e.has(n)&&(e.add(n),l.addIceCandidate(new RTCIceCandidate(t)).catch(()=>{}))}let a=l.iceConnectionState;if(r||Date.now()-t>1e4||a===`connected`||a===`completed`)return}catch{}setTimeout(()=>{n()},200)}};n()}Ve(T)}catch(e){if(!k.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),p?.(t),qe()}},[_,v,y,b,x,Re,ze,Le,p,Ve,D]);j.current=(0,S.useCallback)(async(e,t)=>{let n=T;if(!k.current||!n)return;let r=re.current;de.current=!0;try{let a=await v?.();if(!k.current)return;let o=new RTCPeerConnection({iceServers:[...a??[],{urls:`stun:stun.l.google.com:19302`}]}),s=new MediaStream,c=!1,l=!1,u=null,d,f,p=()=>{f!==void 0&&(clearTimeout(f),f=void 0);let e=u;if(u=null,e){d!==void 0&&typeof e.cancelVideoFrameCallback==`function`&&e.cancelVideoFrameCallback(d),e.removeEventListener(`loadeddata`,m);try{e.srcObject=null}catch{}e.remove()}};function m(){if(c||!k.current){p();return}c=!0,re.current=o,O.current&&(O.current.srcObject=s,O.current.play().catch(()=>{})),r&&r!==o&&r.close(),p()}let h=()=>{if(l||c||!k.current)return;if(l=!0,typeof document>`u`){m();return}let e=document.createElement(`video`);e.muted=!0,e.playsInline=!0,e.autoplay=!0,e.style.cssText=`position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;`,e.srcObject=s,u=e,(ne.current??document.body).appendChild(e),e.play().catch(()=>{}),typeof e.requestVideoFrameCallback==`function`&&(d=e.requestVideoFrameCallback(()=>m())),e.addEventListener(`loadeddata`,m,{once:!0}),f=setTimeout(()=>m(),1800)};o.ontrack=e=>{console.debug(`[WebRTC] ontrack (reoffer)`,e.track.kind,e.track.readyState),s.addTrack(e.track),h()},o.oniceconnectionstatechange=()=>{if(!k.current)return;let e=o.iceConnectionState;console.debug(`[WebRTC] ICE state (reoffer):`,e),e===`connected`||e===`completed`?(se.current=0,h(),Le(`playing`),O.current?.paused&&O.current.play().catch(()=>{})):(e===`failed`||e===`closed`)&&(p(),!c&&e===`failed`&&o.close(),Le(`disconnected`),qe())};let g=null,_=[];if(o.onicecandidate=e=>{if(!e.candidate)return;let t=e.candidate.toJSON();g&&y?y(g,t).catch(()=>{}):_.push(t)},o.addTransceiver(`video`,{direction:`recvonly`}),o.addTransceiver(`audio`,{direction:`recvonly`}),A.current){let e=o.createDataChannel(`camstack-control`);A.current(e)}let x=await o.createOffer();if(await o.setLocalDescription(x),!k.current){o.close();return}let S={...xK(ne.current),...D},{sessionId:C,sdpAnswer:w}=await n(e,o.localDescription?.sdp??x.sdp??``,t,S);if(!k.current){o.close();return}if(g=C,ie.current.add(C),ce.current=C,y)for(let e of _)y(C,e).catch(()=>{});if(_.length=0,await o.setRemoteDescription({type:`answer`,sdp:w}),b){let e=new Set,t=Date.now(),n=async()=>{if(k.current&&!(o.connectionState===`closed`||o.signalingState===`closed`)){try{let{candidates:n,done:r}=await b(C);for(let t of n){let n=t.candidate??``;n&&!e.has(n)&&(e.add(n),o.addIceCandidate(new RTCIceCandidate(t)).catch(()=>{}))}let a=o.iceConnectionState;if(r||Date.now()-t>1e4||a===`connected`||a===`completed`)return}catch{}setTimeout(()=>{n()},200)}};n()}Ve(C)}catch(t){console.debug(`[WebRTC] reoffer failed; keeping last frame, re-arming poll`,t instanceof Error?t.message:String(t)),Ve(e)}finally{de.current=!1}},[T,v,y,b,Le,Ve,D]);let Ge=Oe?We:Ee?He:Ue,Ke=(0,S.useRef)(()=>{});Ke.current=Ge;let qe=(0,S.useCallback)(()=>{if(!k.current||se.current>=wK)return;let e=se.current;se.current+=1;let t=Math.min(CK,SK*2**e),n=Math.round(t*(.8+Math.random()*.4));oe.current=setTimeout(()=>{k.current&&Ke.current()},n)},[]);(0,S.useEffect)(()=>(k.current=!0,se.current=0,r&&Ge(),()=>{k.current=!1,Re()}),[]);let Je=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(r){if(Oe){if(!_)return}else if(Ee){if(!h||!g)return}else return;Je.current||re.current||(Je.current=!0,Ge())}},[r,Oe,Ee,_,h,g,Ge]);let Ye=()=>{se.current=0,Ge()},Xe=()=>{if(se.current=0,re.current&&Oe){We(!0);return}if(re.current&&Ee){He(!0);return}Ge()},Ze=(0,S.useRef)(e),Qe=(0,S.useRef)(t);(0,S.useEffect)(()=>{let n=Ze.current!==e,r=Qe.current!==t;if(Ze.current=e,Qe.current=t,!(!n&&!r)&&k.current){if(se.current=0,n){Re(),Ge();return}Xe()}},[e,t]);let $e=(0,S.useRef)(ee);(0,S.useEffect)(()=>{$e.current!==ee&&($e.current=ee,k.current&&Xe())},[ee]);let et=()=>{if(O.current){let e=!O.current.muted;vK(O.current,e),ge(e)}},tt=async()=>{if(ne.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(ne.current.requestFullscreen){await ne.current.requestFullscreen();return}let e=O.current;e?.webkitEnterFullscreen&&e.webkitEnterFullscreen()}catch(e){console.warn(`Fullscreen toggle failed: ${e instanceof Error?e.message:e}`)}},nt=async()=>{let e=O.current;if(e)try{if(typeof e.webkitSetPresentationMode==`function`){e.webkitSetPresentationMode(e.webkitPresentationMode===`picture-in-picture`?`inline`:`picture-in-picture`);return}document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch(e){console.warn(`PiP toggle failed: ${e instanceof Error?e.message:String(e)}`)}},rt=()=>{if(!O.current)return;let e=document.createElement(`canvas`);e.width=O.current.videoWidth||1280,e.height=O.current.videoHeight||720;let n=e.getContext(`2d`);if(!n)return;n.drawImage(O.current,0,0);let r=document.createElement(`a`);r.download=`${t.replace(/[/:]/g,`-`)}-${Date.now()}.jpg`,r.href=e.toDataURL(`image/jpeg`,.92),r.click()};(0,S.useEffect)(()=>{let e=()=>ve(!!document.fullscreenElement);document.addEventListener(`fullscreenchange`,e);let t=O.current;return t?.addEventListener(`webkitbeginfullscreen`,e),t?.addEventListener(`webkitendfullscreen`,e),()=>{document.removeEventListener(`fullscreenchange`,e),t?.removeEventListener(`webkitbeginfullscreen`,e),t?.removeEventListener(`webkitendfullscreen`,e)}},[]),(0,S.useEffect)(()=>{let e=O.current,t=typeof document<`u`&&document.pictureInPictureEnabled===!0,n=e!==null&&typeof e.webkitSetPresentationMode==`function`;be(t||n)},[]);let[it,at]=(0,S.useState)(``),ot=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!s){at(``),ot.current=null;return}let e=async()=>{let e=re.current;if(e)try{let t=await e.getStats(),n=0,r=0,a=0,o=0,s=0,c=0;t.forEach(e=>{let t=e;t.type===`inbound-rtp`&&(t.kind??t.mediaType)===`video`?(n=t.bytesReceived??0,r=t.timestamp,a=t.framesPerSecond??0,o=t.frameWidth??0,s=t.frameHeight??0):t.type===`candidate-pair`&&t.nominated&&typeof t.currentRoundTripTime==`number`&&(c=t.currentRoundTripTime)});let l=0;ot.current&&r>ot.current.ts&&(l=Math.round((n-ot.current.bytes)*8/(r-ot.current.ts))),ot.current={bytes:n,ts:r};let u=[];o&&s&&u.push(`${o}×${s}`),a&&u.push(`${Math.round(a)}fps`),l>0&&u.push(`${l} kbps`),c&&u.push(`${Math.round(c*1e3)}ms`),at(u.join(` · `))}catch{}};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[s]);let st=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!l){st.current=null;return}let e=async()=>{let e=re.current;if(e)try{let t=await e.getStats(),n=0,r=0,a=0,o=0,s=0,c=0;t.forEach(e=>{let t=e;t.type===`inbound-rtp`&&(t.kind??t.mediaType)===`video`?(n=t.packetsLost??0,r=t.packetsReceived??0,a=t.bytesReceived??0,o=t.timestamp,s=t.jitter??0):t.type===`candidate-pair`&&t.nominated&&typeof t.currentRoundTripTime==`number`&&(c=t.currentRoundTripTime)});let u=st.current;if(st.current={lost:n,recv:r,bytes:a,ts:o},!u||o<=u.ts)return;let d=Math.max(0,n-u.lost),f=d+Math.max(0,r-u.recv),p=f>0?Math.min(100,d/f*100):0,m=Math.max(0,Math.round((a-u.bytes)*8/(o-u.ts)));l({rttMs:Math.round(c*1e3),jitterMs:Math.round(s*1e3),estimatedBandwidthKbps:m,packetLossPercent:p})}catch{}},t=setInterval(()=>{e()},2e3);return()=>clearInterval(t)},[l]);let ct=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!c){ct.current=null;return}let e=async()=>{let e=re.current,t=O.current;if(e)try{let n=await e.getStats(),r=0,a=0,o=0,s=0,l=0,u=0,d=0,f=0;n.forEach(e=>{let t=e;t.type===`inbound-rtp`&&(t.kind??t.mediaType)===`video`&&(r=t.framesReceived??0,a=t.framesDecoded??0,o=t.framesDropped??0,s=t.framesPerSecond??0,l=t.freezeCount??0,u=t.totalFreezesDuration??0,d=t.jitterBufferDelay??0,f=t.jitterBufferEmittedCount??0)});let p=t?.currentTime??0,m=Date.now(),h=ct.current,g=f>0?Math.round(d/f*1e3):0;h&&c({dRecv:r-h.recv,dDec:a-h.dec,dDrop:o-h.drop,fps:Math.round(s),dFreeze:l-h.freeze,freezeTotalMs:Math.round(u*1e3),avgJitterMs:g,dCtMs:Math.round((p-h.ct)*1e3),dtMs:m-h.ts,readyState:t?.readyState??-1}),ct.current={recv:r,dec:a,drop:o,freeze:l,ct:p,ts:m}}catch{}};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[c]),(0,S.useEffect)(()=>{ge(a);let e=O.current;e&&(vK(e,a),a||e.play().catch(()=>{}))},[a]);let lt=()=>{xe||(Ce(!0),we.current&&clearTimeout(we.current),we.current=setTimeout(()=>Ce(!1),3e3))},ut=()=>{Ce(e=>!e),we.current&&clearTimeout(we.current)};(0,S.useEffect)(()=>{if(M===`playing`){Ie();let e=setInterval(Ie,2e3);return()=>clearInterval(e)}ke&&je.current&&Ne(je.current)},[M,ke,Ie]),(0,S.useEffect)(()=>{if(M!==`playing`){Fe(!1);return}let e=O.current;if(!e)return;let t=!1,n=()=>{t||Fe(!0)},r;typeof e.requestVideoFrameCallback==`function`&&(r=e.requestVideoFrameCallback(()=>n())),e.addEventListener(`loadeddata`,n,{once:!0});let a=setTimeout(n,12e3);return()=>{t=!0,clearTimeout(a),r!==void 0&&typeof e.cancelVideoFrameCallback==`function`&&e.cancelVideoFrameCallback(r),e.removeEventListener(`loadeddata`,n)}},[M]);let dt=ke&&Me?Me:E??null,ft=!Pe&&dt!==null;return(0,C.jsxs)(`div`,{ref:ne,className:`relative isolate bg-black overflow-hidden group ${d}`,onMouseMove:lt,onMouseEnter:lt,onTouchStart:ut,children:[(0,C.jsx)(`video`,{ref:O,autoPlay:r,muted:he,playsInline:!0,className:`w-full h-full object-contain relative z-0`}),ft&&dt&&(0,C.jsx)(`img`,{src:dt,alt:``,className:`absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none`}),n&&M===`playing`&&(0,C.jsx)(`div`,{className:`absolute top-2 left-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-medium`,children:n}),s&&it&&(0,C.jsx)(`div`,{className:`absolute top-2 right-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-mono`,children:it}),m,!dt&&M===`connecting`&&(0,C.jsxs)(`div`,{className:`absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2`,children:[(0,C.jsx)(`svg`,{className:`h-6 w-6 text-white/60 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:(0,C.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`32`,strokeDashoffset:`32`,className:`animate-[dash_1.5s_ease-in-out_infinite]`})}),(0,C.jsx)(`span`,{className:`text-xs text-white/60`,children:`Connecting…`})]}),!dt&&(M===`error`||M===`disconnected`)&&(0,C.jsxs)(`div`,{className:`absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2`,children:[(0,C.jsx)(`svg`,{className:`h-6 w-6 text-red-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,C.jsx)(`path`,{d:`M1 1l5.5 5.5M23 23l-5.5-5.5M8.11 15.89a8 8 0 0110.78-10.78M3.64 3.64A12 12 0 0020.36 20.36`,strokeLinecap:`round`})}),(0,C.jsx)(`span`,{className:`text-xs text-red-400 text-center px-4`,children:M===`error`?pe||`Connection failed`:`Disconnected`}),(0,C.jsx)(`button`,{onClick:Ye,className:`mt-1 inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs bg-white/10 text-white hover:bg-white/20 transition-colors`,children:`Reconnect`})]}),dt&&(M===`connecting`||M===`disconnected`)&&(0,C.jsx)(`div`,{className:`absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55`,children:(0,C.jsx)(`svg`,{className:`h-3.5 w-3.5 text-white/90 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:(0,C.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`32`,strokeDashoffset:`32`,className:`animate-[dash_1.5s_ease-in-out_infinite]`})})}),dt&&M===`error`&&(0,C.jsx)(`button`,{onClick:Ye,title:pe||`Reconnect`,className:`absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55 text-white/90 hover:bg-black/75 transition-colors`,children:(0,C.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,C.jsx)(`path`,{d:`M23 4v6h-6M1 20v-6h6`}),(0,C.jsx)(`path`,{d:`M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15`})]})}),o&&M!==`idle`&&M!==`error`&&(0,C.jsxs)(`div`,{className:`absolute bottom-0 inset-x-0 z-20 transform-gpu flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${xe||Se?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`}`,children:[(0,C.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,C.jsx)(DK,{onClick:et,title:he?`Unmute`:`Mute`,children:he?(0,C.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,C.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,C.jsx)(`line`,{x1:`23`,y1:`9`,x2:`17`,y2:`15`}),(0,C.jsx)(`line`,{x1:`17`,y1:`9`,x2:`23`,y2:`15`})]}):(0,C.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,C.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,C.jsx)(`path`,{d:`M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07`})]})})}),(0,C.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,C.jsx)(DK,{onClick:rt,title:`Take snapshot`,children:(0,C.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,C.jsx)(`path`,{d:`M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z`}),(0,C.jsx)(`circle`,{cx:`12`,cy:`13`,r:`4`})]})}),ye&&(0,C.jsx)(DK,{onClick:nt,title:`Picture-in-Picture`,children:(0,C.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,C.jsx)(`path`,{d:`M21 9V6a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h4`}),(0,C.jsx)(`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`})]})}),(0,C.jsx)(DK,{onClick:tt,title:N?`Exit fullscreen`:`Fullscreen`,children:N?(0,C.jsx)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,C.jsx)(`path`,{d:`M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3`})}):(0,C.jsx)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,C.jsx)(`path`,{d:`M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3`})})})]})]})]})}function DK({onClick:e,title:t,children:n}){return(0,C.jsx)(`button`,{onClick:e,title:t,className:`rounded-full p-1.5 min-w-[44px] min-h-[44px] flex items-center justify-center text-white/80 hover:text-white hover:bg-white/20 active:bg-white/30 transition-colors`,children:n})}async function OK(e){if(e.iceGatheringState!==`complete`)return new Promise(t=>{let n=!1,r,a=()=>{n||(n=!0,r&&clearInterval(r),e.removeEventListener(`icegatheringstatechange`,o),t())},o=()=>{e.iceGatheringState===`complete`&&a()};e.addEventListener(`icegatheringstatechange`,o);let s=Date.now();r=setInterval(()=>{let t=e.localDescription?.sdp??``;/ typ host/.test(t)&&Date.now()-s>=600&&a()},100),setTimeout(a,2500)})}aN(`camstack:player-overlays-state`,null);var kK=aN(`camstack:player-overlays-actions`,null);function AK(e){let t=(0,S.useContext)(kK);(0,S.useEffect)(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),online:I(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional(),features:z(P()).optional(),isCamera:I().optional(),sourceInfo:Od.optional()}),w.AddonStarted,w.AddonInstalled,w.AddonRestarted,w.AddonUpdated,w.AddonStopped,w.AddonUninstalled,w.AddonCrashed,w.AddonError,w.DetectionPhaseTransition,w.DetectionResult,w.DetectionEvent,w.DetectionCameraNative,w.ProviderMotion,w.MotionOnMotionChanged,w.MotionAnalysis,w.MotionZonesRaw,w.ProviderDetection,w.PipelineAudioInferenceResult,w.AgentOnline,w.AgentOffline,w.DeviceRegistered,w.DeviceUnregistered,w.DeviceStateChanged,w.EventEmitted;var jK=Object.freeze([...new Set(Object.values(w))].toSorted()),MK=Object.freeze([w.PipelineCameraMetricsSnapshot,w.PipelineRunnerLoadSnapshot,w.PipelineEngineMetricsSnapshot,w.PipelineInferenceResult,w.PipelineTrace,w.PipelineProgress,w.StreamBrokerMetricsSnapshot,w.MetricsNodeResourcesSnapshot,w.MetricsNodeProcessesSnapshot,w.ClusterTopologySnapshot,w.MotionAnalysis,w.MotionZonesRaw,w.DetectionResult,w.PipelineAudioInferenceResult,w.PlatformProbePhase,w.BenchmarkProgress,w.ModelDownloadProgress]),NK=new Set(MK);Object.freeze(jK.filter(e=>!NK.has(e))),Object.freeze([...new Set(cT.filter(e=>e.scope===`device`).map(e=>e.name))].toSorted()),aN(`camstack:zone-editing`,null);var PK=500,FK=800;function IK(e,t,n){try{let r=e.live;if(!r)return null;let a=r.onEvent;return!a||typeof a.subscribe!=`function`?null:a.subscribe({category:t},{onData:n})}catch{return null}}function LK(e,t){return e?.id===t}function RK(e,t){let[n,r]=(0,S.useState)(null),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(`watching`),d=(0,S.useRef)(void 0),f=(0,S.useRef)(void 0),p=(0,S.useRef)(void 0),m=(0,S.useRef)(0);return(0,S.useEffect)(()=>{if(t===null)return;let n=IK(e,`detection.motion-analysis`,e=>{let n=e;if(!LK(n?.source,t))return;let a=n.data;!a?.regions||a.regions.length===0||(r({zones:a.regions.map(e=>({...e.bbox,intensity:e.intensity})),frameWidth:a.frameWidth,frameHeight:a.frameHeight}),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>r(null),PK))});return()=>{n?.unsubscribe(),d.current&&clearTimeout(d.current)}},[e,t]),(0,S.useEffect)(()=>{if(t===null)return;let n=IK(e,`detection.motion-zones-raw`,e=>{let n=e;if(!LK(n?.source,t))return;let r=n.data;r?.zones&&(o({boxes:r.zones.map(e=>({bbox:e.bbox,changeScore:e.changeScore})),frameWidth:r.frameSize?.width??0,frameHeight:r.frameSize?.height??0,motionScore:r.zones.length>0?r.zones.reduce((e,t)=>e+t.changeScore,0)/r.zones.length:0}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>o(null),PK))});return()=>{n?.unsubscribe(),f.current&&clearTimeout(f.current)}},[e,t]),(0,S.useEffect)(()=>{if(m.current=0,t===null)return;let n=IK(e,`pipeline-analytics.frame-tracked`,e=>{let n=e?.data;!n||n.deviceId!==t||n.detections?.length&&typeof n.detections[0]?.kind==`string`&&(m.current=Date.now(),c({detections:n.detections,frameWidth:n.frameWidth,frameHeight:n.frameHeight}),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>c(null),FK))});return()=>{n?.unsubscribe(),p.current&&clearTimeout(p.current)}},[e,t]),(0,S.useEffect)(()=>{if(t===null)return;let n=IK(e,`detection.result`,e=>{let n=e;if(!LK(n?.source,t)||Date.now()-m.current<FK)return;let r=n.data?.frame;r?.detections?.length&&(c({detections:r.detections,frameWidth:r.width,frameHeight:r.height}),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>c(null),FK))});return()=>{n?.unsubscribe(),p.current&&clearTimeout(p.current)}},[e,t]),(0,S.useEffect)(()=>{if(t===null)return;let n=IK(e,`detection.phase-transition`,e=>{let n=e;LK(n?.source,t)&&n.data?.to&&u(n.data.to)});return()=>{n?.unsubscribe()}},[e,t]),{motion:n,motionRaw:a,detection:s,phase:l}}var zK=5*6e4,BK=new WeakMap;function VK(e,t,n=5e3){let[r,a]=(0,S.useState)([]);(0,S.useEffect)(()=>{if(t===null)return;let r=!1,o=()=>{e.webrtcSession.listStreams.query({deviceId:t}).then(e=>{r||a(e)}).catch(()=>{})};o();let s=setInterval(o,n);return()=>{r=!0,clearInterval(s)}},[e,t,n]);let[o,s]=(0,S.useState)(null);(0,S.useEffect)(()=>{if(t===null)return;let n=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:t}).then(e=>{n||!e||s({phase:e.phase,detectionFps:e.actualFps,avgInferenceMs:e.avgInferenceTimeMs,droppedFrames:e.droppedFrames})}).catch(()=>{}),()=>{n=!0}},[e,t]),Bz(`pipeline.camera-metrics-snapshot`,e=>{if(t===null)return;let n=e.data;n.deviceId!==t||!n.metrics||s({phase:n.metrics.phase,detectionFps:n.metrics.actualFps,avgInferenceMs:n.metrics.avgInferenceTimeMs,droppedFrames:n.metrics.droppedFrames})});let{streams:c,hasWebrtc:l}=(0,S.useMemo)(()=>t===null||r.length===0?{streams:[],hasWebrtc:!1}:{streams:r.map(e=>({id:e.id,label:e.label,target:e.target,status:e.status,inputFps:e.inputFps,decodeFps:e.decodeFps,bitrateKbps:e.bitrateKbps})),hasWebrtc:!0},[t,r]),u=(0,S.useCallback)(async()=>{if(!e.turnProvider)return;let t=BK.get(e);if(t&&Date.now()-t.fetchedAt<zK)return t.servers;try{let t=(await e.turnProvider.getTurnServers.query()).map(e=>({urls:typeof e.urls==`string`?e.urls:[...e.urls],...e.username===void 0?{}:{username:e.username},...e.credential===void 0?{}:{credential:e.credential}}));return BK.set(e,{servers:t,fetchedAt:Date.now()}),t}catch{return t?.servers}},[e]);(0,S.useEffect)(()=>{u()},[u]);let d=(0,S.useCallback)(async(n,r)=>{if(t===null)throw Error(`No device selected`);let a=await e.webrtcSession.createSession.mutate({deviceId:t,target:n,hints:r}),o=await u();return{sessionId:a.sessionId,sdpOffer:a.sdpOffer,...o?{iceServers:o}:{}}},[e,t,u]),f=(0,S.useCallback)(async(n,r,a,o)=>{if(t===null)throw Error(`No device selected`);return e.webrtcSession.handleOffer.mutate({deviceId:t,target:n,sdpOffer:r,...a===void 0?{}:{sessionId:a},...o===void 0?{}:{hints:o}})},[e,t]),p=(0,S.useCallback)(async(n,r)=>{if(t===null)throw Error(`No device selected`);await e.webrtcSession.handleAnswer.mutate({deviceId:t,sessionId:n,sdpAnswer:r})},[e,t]);return{streams:c,hasWebrtc:l,pipelineMetrics:o,createSession:d,handleOffer:f,getIceServers:u,addIceCandidate:(0,S.useCallback)(async(n,r)=>{t!==null&&await e.webrtcSession.addIceCandidate.mutate({deviceId:t,sessionId:n,candidate:r.candidate??``,sdpMid:r.sdpMid??null,sdpMLineIndex:r.sdpMLineIndex??null}).catch(()=>{})},[e,t]),getIceCandidates:(0,S.useCallback)(async n=>t===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:t,sessionId:n}),[e,t]),sendAnswer:p,closeSession:(0,S.useCallback)(async n=>{t!==null&&await e.webrtcSession.closeSession.mutate({deviceId:t,sessionId:n}).catch(()=>{})},[e,t]),getSessionState:(0,S.useCallback)(async n=>{if(t===null)return{pendingRenegotiation:null};try{return await e.webrtcSession.getSessionState.query({deviceId:t,sessionId:n})}catch{return{pendingRenegotiation:null}}},[e,t])}}(0,S.lazy)(()=>fs(()=>import(`./MaskShapeCanvas-DI4BY7W2-Dx-Vrpyt.js`).then(e=>({default:e.MaskShapeCanvas})),[],import.meta.url)),(0,S.lazy)(()=>fs(()=>import(`./MotionZonesSettings-NcxxQN8r-9D-BWwQP.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,S.lazy)(()=>fs(()=>import(`./PrivacyMaskSettings-APgPLF7p-HvAetfA4.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var HK=H([`auto`,`high`,`medium`,`low`]),UK=Co([U(`auto`),F().int().min(1)]),WK=B({enabled:I(),motion:I(),motionHoldSec:F().optional(),audio:H([`off`,`sensor`,`level`]),audioDb:F(),audioHoldSec:F(),detection:I(),detectionHoldSec:F(),detectionClasses:z(P()).optional(),appearance:B({motionColor:P(),audioColor:P(),detectionColor:P(),thickness:F()}).optional()}),GK=B({serverUrl:P().min(1),token:P().min(1),devices:z(F().int().nonnegative()).min(1),layout:UK,quality:HK,showName:I(),showBadges:I(),muted:I(),paused:I(),highlight:WK.optional(),activeOnly:I().optional(),showBoxes:I().optional(),audioOnIds:z(F().int().nonnegative()).optional(),pausedIds:z(F().int().nonnegative()).optional(),snapshots:V(P(),P()).optional(),ptzIds:z(F().int().nonnegative()).optional()});function KK(e){if(e==null)return{ok:!1,error:`config is required`};let t=GK.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)}}var qK=1e4;function JK(){try{return window.parent!==window}catch{return!0}}var YK=null;function XK(e){YK=e}function ZK(e){if(YK===null||typeof e!=`object`||!e)return e;let t=e;if(t.type!==`log`)return e;let n=typeof t.data==`object`&&t.data!==null?t.data:{};return{...t,data:{deviceId:YK,...n}}}function QK(e){let t=ZK(e),n=window.ReactNativeWebView;if(n){n.postMessage(JSON.stringify(t));return}JK()&&window.parent.postMessage(t,`*`)}function $K(e){let t=t=>{let n=t.data;if(typeof n!=`object`||!n)return;let r=n;r.type!==`embed-command`||typeof r.command!=`object`||r.command===null||e(r.command)};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}function eq(e,t,n,r){let a=t();if(a!=null)return Promise.resolve(n(a));if(!JK()){let t=r===void 0?null:r();return t===null?Promise.resolve({ok:!1,error:`config global for mode "${e}" is not set`}):Promise.resolve(t)}return new Promise(t=>{let r,a=e=>{let o=e.data;if(typeof o!=`object`||!o)return;let s=o;s.type===`embed-config`&&(clearTimeout(r),window.removeEventListener(`message`,a),t(n(s.config)))};window.addEventListener(`message`,a),r=setTimeout(()=>{window.removeEventListener(`message`,a),t({ok:!1,error:`config handshake timed out`})},qK),window.parent.postMessage({type:`embed-ready`,mode:e},`*`)})}function tq(e,t,n,r){let[a,o]=(0,S.useState)(null),s=(0,S.useRef)(t);s.current=t;let c=(0,S.useRef)(n);c.current=n;let l=(0,S.useRef)(r);return l.current=r,(0,S.useEffect)(()=>{let t=!0;return eq(e,()=>s.current(),e=>c.current(e),()=>l.current===void 0?null:l.current()).then(e=>{t&&o(e)}),()=>{t=!1}},[e]),a}var nq=H([`auto`,`high`,`medium`,`low`]),rq=Co([U(`auto`),F().int().min(1)]),iq=B({enabled:I(),motion:I(),audio:H([`off`,`sensor`,`level`]),audioDb:F(),audioHoldSec:F(),detection:I(),detectionHoldSec:F(),detectionClasses:z(P()).optional(),appearance:B({motionColor:P(),audioColor:P(),detectionColor:P(),thickness:F()}).optional()}),aq=B({devices:z(F().int().nonnegative()).min(1),layout:rq,quality:nq,showName:I(),audioOnIds:z(F().int().nonnegative()).optional(),activeOnly:I().optional(),boxes:I().optional(),highlight:iq.optional()}),oq=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`;function sq(e){let t=``,n=0;for(;n<e.length;){let r=e[n];if(r===void 0)return null;let a,o;if(r<128)a=r,o=0;else if((r&224)==192)a=r&31,o=1;else if((r&240)==224)a=r&15,o=2;else if((r&248)==240)a=r&7,o=3;else return null;for(let t=1;t<=o;t++){let r=e[n+t];if(r===void 0||(r&192)!=128)return null;a=a<<6|r&63}n+=o+1,t+=String.fromCodePoint(a)}return t}function cq(e){if(e.length%4==1)return null;let t=[];for(let n of e){let e=oq.indexOf(n);if(e<0)return null;t.push(e)}let n=[];for(let e=0;e<t.length;e+=4){let r=t[e],a=t[e+1];if(r===void 0||a===void 0)return null;let o=t[e+2],s=t[e+3];n.push(r<<2|a>>4),o!==void 0&&n.push((a&15)<<4|o>>2),s!==void 0&&o!==void 0&&n.push((o&3)<<6|s)}let r=sq(n);if(r===null)return null;try{return JSON.parse(r)}catch{return null}}function lq(e,t){return e.startsWith(t)?e.slice(t.length):e}function uq(e){let t=new URLSearchParams(lq(e,`#`)).get(`t`);return t!==null&&t.length>0?t:null}function dq(e,t){return new URLSearchParams(lq(e,`?`)).has(`v`)||uq(t)!==null}function fq(e){if(e.length===0)return null;let t=[];for(let n of e.split(`,`)){if(!/^\d+$/.test(n))return null;t.push(Number(n))}return t}function pq(e){return{ok:!1,error:e}}function mq(e,t){let n=new URLSearchParams(lq(e,`?`)),r=n.get(`mode`);if(r!==null&&r!==`grid`)return pq(`unsupported mode "${r}"`);let a=n.get(`v`);if(a===null)return pq(`missing share-link version (v)`);if(a!==`1`)return pq(`unsupported share-link version "${a}"`);let o=n.get(`devices`),s=o===null?null:fq(o);if(s===null||s.length===0)return pq(`invalid or missing devices list`);let c=n.get(`layout`),l;if(c===null||c===`auto`)l=`auto`;else if(/^\d+$/.test(c)&&Number(c)>=1)l=Number(c);else return pq(`invalid layout "${c}"`);let u=n.get(`q`)??`auto`,d=nq.safeParse(u);if(!d.success)return pq(`invalid quality "${u}"`);let f=n.get(`names`)??`0`;if(f!==`0`&&f!==`1`)return pq(`invalid names flag "${f}"`);let p=n.get(`audio`),m;if(p!==null){let e=fq(p);if(e===null)return pq(`invalid audio list "${p}"`);m=e}let h=n.get(`activeOnly`);if(h!==null&&h!==`0`&&h!==`1`)return pq(`invalid activeOnly flag "${h}"`);let g=h===`1`,_=n.get(`boxes`);if(_!==null&&_!==`0`&&_!==`1`)return pq(`invalid boxes flag "${_}"`);let v=_===`1`,y=n.get(`hl`),b;if(y!==null){let e=cq(y),t=iq.safeParse(e);if(e===null||!t.success)return pq(`invalid highlight config (hl)`);b=t.data}let x={devices:[...s],layout:l,quality:d.data,showName:f===`1`,...m!==void 0&&m.length>0?{audioOnIds:[...m]}:{},...g?{activeOnly:!0}:{},...v?{boxes:!0}:{},...b===void 0?{}:{highlight:b}},S=aq.safeParse(x);return S.success?{ok:!0,params:S.data,token:uq(t)}:pq(S.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `))}function hq(e,t,n){if(!dq(e,t))return null;let r=mq(e,t);if(!r.ok)return{ok:!1,error:r.error};if(r.token===null)return{ok:!1,error:`share token missing — the link must end with #t=<token>`};let a=r.params;return KK({serverUrl:n,token:r.token,devices:[...a.devices],layout:a.layout,quality:a.quality,showName:a.showName,showBadges:!0,muted:!0,paused:!1,...a.highlight===void 0?{}:{highlight:a.highlight},...a.activeOnly===!0?{activeOnly:!0}:{},...a.boxes===!0?{showBoxes:!0}:{},...a.audioOnIds!==void 0&&a.audioOnIds.length>0?{audioOnIds:[...a.audioOnIds]}:{}})}function gq(){let e=hq(location.search,location.hash,location.origin);return e!==null&&location.hash!==``&&history.replaceState(null,``,location.pathname+location.search),e}var _q=16/9;function vq(e,t,n,r){if(e<=0||t<=0||n<=0)return{cols:0,rows:0,cellW:0,cellH:0};if(typeof r==`number`&&r>=1){let a=Math.floor(r),o=Math.ceil(e/a),s=Math.min(t/a,n/o*_q);return{cols:a,rows:o,cellW:s,cellH:s/_q}}let a={cols:1,rows:e,cellW:0,cellH:0},o=-1;for(let r=1;r<=e;r++){let s=Math.ceil(e/r),c=Math.min(t/r,n/s*_q),l=c/_q,u=c*l;u>o&&(o=u,a={cols:r,rows:s,cellW:c,cellH:l})}return a}function yq(){let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(`idle`),a=(0,S.useRef)(null),o=(0,S.useRef)(null),s=(0,S.useRef)(null),c=(0,S.useRef)(0),l=(0,S.useRef)(null),u=_B(),d=vB(),f=yB(),p=(0,S.useRef)({start:u.mutateAsync,answer:d.mutateAsync,stop:f.mutateAsync});p.current={start:u.mutateAsync,answer:d.mutateAsync,stop:f.mutateAsync};let m=(0,S.useCallback)(()=>{if(a.current){try{a.current.close()}catch{}a.current=null}if(o.current){for(let e of o.current.getTracks())try{e.stop()}catch{}o.current=null}},[]),h=(0,S.useCallback)(async()=>{let e=s.current;if(s.current=null,m(),e)try{await p.current.stop({deviceId:e.deviceId,sessionId:e.sessionId})}catch{}},[m]),g=(0,S.useCallback)(async e=>{if(l.current===e){c.current+=1,l.current=null,t(null),r(`idle`),await h();return}c.current+=1;let n=c.current;l.current=e,t(e),r(`starting`);let u;try{u=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch{n===c.current&&(l.current=null,t(null),r(`error`));return}if(n!==c.current){for(let e of u.getTracks())e.stop();return}if(await h(),n!==c.current){for(let e of u.getTracks())e.stop();return}let d=null;try{o.current=u;let f=await p.current.start({deviceId:e});if(n!==c.current){try{await p.current.stop({deviceId:e,sessionId:f.sessionId})}catch{}m();return}s.current={deviceId:e,sessionId:f.sessionId},d=new RTCPeerConnection,a.current=d,d.oniceconnectionstatechange=()=>{if(n!==c.current||!d)return;let e=d.iceConnectionState;e===`connected`||e===`completed`?r(`talking`):(e===`failed`||e===`closed`||e===`disconnected`)&&(l.current=null,t(null),r(`idle`),h())};for(let e of u.getAudioTracks())d.addTrack(e,u);await d.setRemoteDescription({type:`offer`,sdp:f.sdpOffer});let g=await d.createAnswer();if(await d.setLocalDescription(g),n!==c.current)return;await p.current.answer({deviceId:e,sessionId:f.sessionId,sdpAnswer:d.localDescription?.sdp??g.sdp??``})}catch{if(d)try{d.close()}catch{}m();let e=s.current;if(s.current=null,e)try{await p.current.stop({deviceId:e.deviceId,sessionId:e.sessionId})}catch{}n===c.current&&(l.current=null,t(null),r(`error`))}},[h,m]),_=(0,S.useCallback)(e=>{if(e===null){c.current+=1,l.current=null,t(null),r(`idle`),h();return}l.current!==e&&g(e)},[h,g]);return(0,S.useEffect)(()=>()=>{c.current+=1,h()},[h]),{activeMicId:e,micState:n,toggleMic:e=>{g(e)},setActiveMic:_}}var bq=6e3,xq=500;function Sq(e,t){let n=(0,S.useRef)(new Map),[,r]=(0,S.useState)(0),a=t?.motion??!1,o=t?.audio??`off`,s=t?.audioDb??-30,c=t?.audioHoldSec??3,l=t?.detection??!1,u=t?.detectionHoldSec??3,d=t?.detectionClasses??[],f=(e,t)=>{n.current.set(e,Date.now()+t),r(e=>e+1)};Bz(w.MotionOnMotionChanged,e=>{if(!a)return;let t=e.data;t&&t.detected&&f(t.deviceId,bq)}),Bz(w.PipelineAudioInferenceResult,e=>{if(o===`off`)return;let t=e.data;t&&(o===`sensor`?t.frame.detections.length>0:(t.frame.level?.dbfs??-1/0)>=s)&&f(t.deviceId,c*1e3)}),Bz(w.DetectionResult,e=>{if(!l)return;let t=e.data;t&&t.frame.detections.some(e=>d.length===0||d.includes(e.macroClass))&&f(t.frame.deviceId,u*1e3)}),(0,S.useEffect)(()=>{let e=setInterval(()=>r(e=>e+1),xq);return()=>clearInterval(e)},[]);let p=Date.now(),m=new Set;for(let t of e){let e=n.current.get(t);e!==void 0&&p<e&&m.add(t)}return m}function Cq(e){return{type:`tileOpen`,deviceId:e}}function wq(e){return{type:`audioToggle`,deviceId:e}}function Tq(e){return{type:`pauseToggle`,deviceId:e}}function Eq(e){return{type:`ptzOpen`,deviceId:e}}function Dq(e,t){return t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t}}function Oq(e){return{type:`layout`,tiles:e}}function kq(e){QK(e)}function Aq(e,t,n,r){let a=Number.isFinite(e)&&e>0?e:0,o=Number.isFinite(t)&&t>0?t:0;if(!Number.isFinite(n)||!Number.isFinite(r)||n<=0||r<=0)return{width:a,height:o};let s=Math.min(a/n,o/r);return{width:n*s,height:r*s}}function jq(e,t,n){return!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)?0:Math.max(0,(n*t-e)/2)}function Mq(e,t,n,r){if(!Number.isFinite(e))return 0;let a=jq(t,n,r);return Math.max(-a,Math.min(a,e))}var Nq=4,Pq=8,Fq=300;function Iq(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Lq({children:e,onTap:t}){let n=(0,S.useRef)(null),r=(0,S.useRef)(null),a=(0,S.useRef)(new Map),o=(0,S.useRef)(1),s=(0,S.useRef)(0),c=(0,S.useRef)(0),l=(0,S.useRef)(null),u=(0,S.useRef)(null),d=(0,S.useRef)(0),f=()=>{let e=r.current;e&&(e.style.transform=`translate(${s.current}px, ${c.current}px) scale(${o.current})`)},p=()=>{let e=n.current?.getBoundingClientRect();if(!e||e.width<=0||e.height<=0)return;let t=r.current?.querySelector(`video`)??null,a=t?null:r.current?.querySelector(`img`)??null,l=t?.videoWidth??a?.naturalWidth??0,u=t?.videoHeight??a?.naturalHeight??0,d=Aq(e.width,e.height,l,u);s.current=Mq(s.current,e.width,d.width,o.current),c.current=Mq(c.current,e.height,d.height,o.current)},m=()=>{o.current=1,s.current=0,c.current=0,f()},h=e=>{try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}if(a.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),a.current.size===2){let e=[...a.current.values()],t=e[0],n=e[1];t&&n&&(l.current={dist:Iq(t,n),scale:o.current,cx:(t.x+n.x)/2,cy:(t.y+n.y)/2,tx:s.current,ty:c.current}),u.current=null}else a.current.size===1&&(u.current={x:e.clientX,y:e.clientY,tx:s.current,ty:c.current,moved:!1})},g=e=>{if(!a.current.has(e.pointerId))return;if(a.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),a.current.size>=2&&l.current){let e=[...a.current.values()],t=e[0],n=e[1];if(!t||!n)return;let r=Iq(t,n);l.current.dist>0&&(o.current=Math.max(1,Math.min(Nq,l.current.scale*(r/l.current.dist))));let u=(t.x+n.x)/2,d=(t.y+n.y)/2;s.current=l.current.tx+(u-l.current.cx),c.current=l.current.ty+(d-l.current.cy),p(),f();return}let t=u.current;if(a.current.size===1&&t){let n=e.clientX-t.x,r=e.clientY-t.y;(Math.abs(n)>Pq||Math.abs(r)>Pq)&&(t.moved=!0),o.current>1&&(s.current=t.tx+n,c.current=t.ty+r,p(),f())}},_=e=>{let n=a.current.size===1,r=u.current;if(a.current.delete(e.pointerId),a.current.size<2&&(l.current=null),a.current.size===0&&(u.current=null,n&&r&&!r.moved)){let e=Date.now();e-d.current<Fq?(d.current=0,m()):(d.current=e,t())}};return(0,C.jsx)(`div`,{ref:n,style:{position:`absolute`,inset:0,overflow:`hidden`,touchAction:`none`},onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,children:(0,C.jsx)(`div`,{ref:r,style:{width:`100%`,height:`100%`,transformOrigin:`center center`,willChange:`transform`},children:e})})}var Rq=2500,zq={person:`#f59e0b`,vehicle:`#3b82f6`,animal:`#22c55e`,face:`#a855f7`,plate:`#ec4899`},Bq=`#ef4444`;function Vq(e){return zq[e]??Bq}function Hq(e){return e<0?0:e>1?1:e}function Uq(e){if(e.width<=0||e.height<=0)return[];let t=[];for(let n of e.detections){let{bbox:r}=n,a=Hq(r.x/e.width),o=Hq(r.y/e.height),s=Hq((r.x+r.width)/e.width),c=Hq((r.y+r.height)/e.height);s<=a||c<=o||t.push({label:n.macroClass,score:n.score,x1:a,y1:o,x2:s,y2:c})}return t}function Wq({deviceId:e}){let[t,n]=(0,S.useState)([]),r=(0,S.useRef)(void 0);return Bz(w.DetectionResult,t=>{let a=t.data;!a||a.frame.deviceId!==e||(n(Uq(a.frame)),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n([]),Rq))}),(0,S.useEffect)(()=>()=>{r.current&&clearTimeout(r.current),n([])},[e]),t.length===0?null:(0,C.jsx)(`div`,{style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`},children:t.map((e,t)=>{let n=Vq(e.label),r=Math.round(e.score*100);return(0,C.jsx)(`div`,{style:{position:`absolute`,left:`${e.x1*100}%`,top:`${e.y1*100}%`,width:`${(e.x2-e.x1)*100}%`,height:`${(e.y2-e.y1)*100}%`,border:`2px solid ${n}`,borderRadius:3},children:(0,C.jsx)(`span`,{style:{position:`absolute`,left:-2,bottom:`100%`,background:n,color:`#fff`,fontSize:10,fontWeight:700,fontFamily:`system-ui, sans-serif`,lineHeight:`14px`,padding:`0 4px`,borderRadius:3,whiteSpace:`nowrap`},children:`${e.label} ${r}%`})},`${e.label}-${t}`)})})}var Gq=500;function Kq(e,t,n){let{motion:r,detection:a}=RK(e.trpcClient,t),o=(0,S.useRef)(0),s=(0,S.useRef)(0),c=(0,S.useRef)(0),l=(0,S.useRef)(!1),[,u]=(0,S.useState)(0),d=n?.audio??`off`,f=n?.audioDb??-30,p=n?.audioHoldSec??3,m=n?.motionHoldSec??0,h=n?.detectionHoldSec??3,g=n?.detectionClasses??[],_=g.join(`,`);if(Bz(w.MotionOnMotionChanged,e=>{let r=e.data;!r||r.deviceId!==t||!n?.motion||(r.detected===!0?(c.current=Date.now()+Math.max(1,m)*1e3,l.current=!0,u(e=>e+1)):r.detected===!1&&l.current&&(c.current=Date.now()+m*1e3,l.current=!1,u(e=>e+1)))}),Bz(w.PipelineAudioInferenceResult,e=>{let n=e.data;!n||n.deviceId!==t||d===`off`||(d===`sensor`?n.frame.detections.length>0:(n.frame.level?.dbfs??-1/0)>=f)&&(o.current=Date.now()+p*1e3,u(e=>e+1))}),(0,S.useEffect)(()=>{a&&a.detections.some(e=>g.length===0||g.includes(e.macroClass))&&(s.current=Date.now()+h*1e3,u(e=>e+1))},[a,h,_]),(0,S.useEffect)(()=>{let e=r!==null;(e||l.current)&&(c.current=Date.now()+m*1e3,e||u(e=>e+1)),l.current=e},[r,m]),(0,S.useEffect)(()=>{let e=setInterval(()=>u(e=>e+1),Gq);return()=>clearInterval(e)},[]),!n?.enabled)return null;let v=Date.now();return n.detection&&v<s.current?`detection`:d!==`off`&&v<o.current?`audio`:n.motion&&(r!==null||v<c.current)?`motion`:null}var qq={motion:`#DC2626`,audio:`#3B82F6`,detection:`#22C55E`},Jq=3500;function Yq(e){return e===`auto`?{kind:`adaptive`}:{kind:`profile`,profile:e===`medium`?`mid`:e}}function Xq({system:e,deviceId:t,name:n,online:r,quality:a,muted:o,paused:s,showName:c,audioActive:l,micActive:u,onTogglePause:d,onToggleAudio:f,onToggleMic:p,onOpen:m,ptzSupported:h,onPtz:g,highlight:_,showBoxes:v,reconnectSignal:y,posterUrl:b}){let{handleOffer:x,getIceServers:w,addIceCandidate:T,getIceCandidates:E,closeSession:D,getSessionState:ee}=VK(e.trpcClient,t),te=Kq(e,t,_),[O,ne]=(0,S.useState)(void 0);(0,S.useEffect)(()=>{if(b||s)return;let n=!1;return e.trpcClient.snapshot.getSnapshot.query({deviceId:t}).then(e=>{!n&&e?.base64&&ne(`data:${e.contentType??`image/jpeg`};base64,${e.base64}`)}).catch(()=>{}),()=>{n=!0}},[b,s,e,t]);let re=b??O,ie=(0,S.useMemo)(()=>Yq(a),[a]),ae=`grid:${t}:${a}`,oe=(0,S.useMemo)(()=>(e,t)=>x(ie,e,t),[x,ie]),se=(0,S.useMemo)(()=>(e,t,n)=>x(n,t,e),[x]),[k,A]=(0,S.useState)(!1),ce=(0,S.useRef)(null),le=()=>{ce.current&&clearTimeout(ce.current),ce.current=setTimeout(()=>A(!1),Jq)},ue=()=>{A(!0),le()},de=()=>{A(e=>{let t=!e;return t&&le(),t})},j=e=>{e.stopPropagation(),ue()};return(0,S.useEffect)(()=>()=>{ce.current&&clearTimeout(ce.current)},[]),(0,C.jsxs)(`div`,{style:{position:`relative`,width:`100%`,height:`100%`,background:`#000`},children:[(0,C.jsx)(Lq,{onTap:de,children:s?(0,C.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fafaf9`},children:(0,C.jsx)($q,{size:28})}):(0,C.jsx)(EK,{serverUrl:e.serverUrl,streamKey:ae,autoPlay:!0,muted:o,showControls:!1,className:`w-full h-full`,handleOffer:oe,reoffer:se,getSessionState:ee,getIceServers:w,addIceCandidate:T,getIceCandidates:E,closeSession:D,reconnectSignal:y,posterUrl:re,onClientNetworkSample:a===`auto`?n=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...n}).catch(()=>{})}:void 0},ae)}),v&&!s?(0,C.jsx)(Wq,{deviceId:t}):null,te&&(()=>{let e=_?.appearance,t=te===`motion`?e?.motionColor??qq.motion:te===`audio`?e?.audioColor??qq.audio:e?.detectionColor??qq.detection;return(0,C.jsx)(`div`,{style:{position:`absolute`,inset:0,border:`${e?.thickness??3}px solid ${t}`,boxShadow:`inset 0 0 12px ${t}`,pointerEvents:`none`}})})(),(c||k)&&(0,C.jsxs)(`div`,{style:{position:`absolute`,left:0,right:0,top:0,display:`flex`,alignItems:`center`,gap:6,padding:`4px 8px`,background:`rgba(0,0,0,0.6)`,color:`#fafaf9`,fontSize:12,fontWeight:600,fontFamily:`system-ui, sans-serif`,pointerEvents:`none`,opacity:c||k?1:0,transition:`opacity 150ms ease`},children:[(0,C.jsx)(`span`,{style:{width:8,height:8,borderRadius:4,background:r?`#34d399`:`#71717a`}}),(0,C.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n})]}),(0,C.jsxs)(`div`,{style:{position:`absolute`,inset:0,opacity:+!!k,transition:`opacity 150ms ease`,pointerEvents:`none`},children:[(0,C.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:(0,C.jsx)(Zq,{label:s?`Play`:`Pause`,big:!0,enabled:k,onClick:e=>{j(e),d(t)},children:s?(0,C.jsx)($q,{size:22}):(0,C.jsx)(eJ,{size:22})})}),(0,C.jsxs)(`div`,{style:{position:`absolute`,left:8,bottom:8,display:`flex`,gap:8,pointerEvents:`none`},children:[(0,C.jsx)(Zq,{label:l?`Mute`:`Listen`,active:l,enabled:k,onClick:e=>{j(e),f(t)},children:l?(0,C.jsx)(tJ,{size:18}):(0,C.jsx)(nJ,{size:18})}),(0,C.jsx)(Zq,{label:u?`Stop talk`:`Talk`,active:u,enabled:k,onClick:e=>{j(e),p(t)},children:(0,C.jsx)(rJ,{size:18,muted:!u})}),h&&g?(0,C.jsx)(Zq,{label:`PTZ`,enabled:k,onClick:e=>{j(e),g(t)},children:(0,C.jsx)(aJ,{size:18})}):null]}),(0,C.jsx)(`div`,{style:{position:`absolute`,right:8,bottom:8,pointerEvents:`none`},children:(0,C.jsx)(Zq,{label:`Open`,enabled:k,onClick:e=>{j(e),m(t)},children:(0,C.jsx)(iJ,{size:18})})})]})]})}function Zq({children:e,label:t,onClick:n,big:r=!1,active:a=!1,enabled:o=!0}){let s=r?52:40;return(0,C.jsx)(`button`,{type:`button`,"aria-label":t,onClick:n,style:{width:s,height:s,borderRadius:s/2,border:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:a?`rgba(59,130,246,0.85)`:`rgba(0,0,0,0.55)`,color:`#fafaf9`,cursor:`pointer`,padding:0,WebkitTapHighlightColor:`transparent`,pointerEvents:o?`auto`:`none`},children:e})}var Qq={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function $q({size:e}){return(0,C.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,children:(0,C.jsx)(`polygon`,{points:`6 4 20 12 6 20 6 4`,fill:`currentColor`})})}function eJ({size:e}){return(0,C.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,children:[(0,C.jsx)(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,fill:`currentColor`}),(0,C.jsx)(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,fill:`currentColor`})]})}function tJ({size:e}){return(0,C.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...Qq,children:[(0,C.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,C.jsx)(`path`,{d:`M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07`})]})}function nJ({size:e}){return(0,C.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...Qq,children:[(0,C.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,C.jsx)(`line`,{x1:`23`,y1:`9`,x2:`17`,y2:`15`}),(0,C.jsx)(`line`,{x1:`17`,y1:`9`,x2:`23`,y2:`15`})]})}function rJ({size:e,muted:t}){return(0,C.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...Qq,children:[(0,C.jsx)(`path`,{d:`M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z`}),(0,C.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2M12 19v4`}),t&&(0,C.jsx)(`line`,{x1:`3`,y1:`3`,x2:`21`,y2:`21`})]})}function iJ({size:e}){return(0,C.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...Qq,children:(0,C.jsx)(`path`,{d:`M15 3h6v6M21 3l-9 9M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5`})})}function aJ({size:e}){return(0,C.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...Qq,children:[(0,C.jsx)(`path`,{d:`M12 2v20M2 12h20`}),(0,C.jsx)(`path`,{d:`M12 2l-3 3M12 2l3 3M12 22l-3-3M12 22l3-3M2 12l3-3M2 12l3 3M22 12l-3-3M22 12l-3 3`})]})}function oJ({message:e}){return(0,S.useEffect)(()=>kq(Dq(`error`,e)),[e]),(0,C.jsxs)(`div`,{style:{position:`fixed`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#000`,color:`#f87171`,fontFamily:`system-ui, sans-serif`,fontSize:13,padding:16,textAlign:`center`},children:[`Grid embed config error: `,e]})}function sJ({system:e,config:t}){let[n,r]=(0,S.useState)(()=>new Set(t.audioOnIds??[])),a=yq(),o=(0,S.useRef)(a.setActiveMic);o.current=a.setActiveMic;let[s,c]=(0,S.useState)(()=>new Set(t.pausedIds??[])),[l,u]=(0,S.useState)(t.highlight),[d,f]=(0,S.useState)(t.activeOnly??!1),[p,m]=(0,S.useState)(t.showBoxes??!1),h=Sq(t.devices,l),g=(0,S.useMemo)(()=>d?t.devices.filter(e=>h.has(e)):t.devices,[d,t.devices,h]),[_,v]=(0,S.useState)(t.quality),[y,b]=(0,S.useState)(t.layout),[x,w]=(0,S.useState)(t.showName),[T,E]=(0,S.useState)(0),[D,ee]=(0,S.useState)(()=>t.snapshots??{}),te=(0,S.useMemo)(()=>new Set(t.ptzIds??[]),[t.ptzIds]),[O,ne]=(0,S.useState)({w:window.innerWidth,h:window.innerHeight}),[re,ie]=(0,S.useState)({});(0,S.useEffect)(()=>{let t=!1;return e.trpcClient.deviceManager.listAll.query({}).then(e=>{if(t)return;let n={};for(let t of e)n[t.id]={name:t.name??`Camera ${t.id}`,online:t.online??!1};ie(n)}).catch(()=>{}),()=>{t=!0}},[e]),(0,S.useEffect)(()=>(window.__camstackGrid={setAudioOn:e=>r(new Set(e)),setMutedAll:e=>{e&&r(new Set)},setActiveMic:e=>o.current(e),setHighlight:e=>u(e),setActiveOnly:e=>f(e),setShowBoxes:e=>m(e),setPaused:e=>c(new Set(e)),setQuality:e=>v(e),setLayout:e=>b(e),setShowName:w,setShowBadges:()=>{},setSnapshots:e=>ee(e),fit:(e,t)=>ne({w:e,h:t}),reconnect:()=>E(e=>e+1)},kq(Dq(`ready`)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),(0,S.useEffect)(()=>$K(e=>{let t=window.__camstackGrid;if(t)switch(e.kind){case`setAudioOn`:t.setAudioOn(e.value);break;case`setMutedAll`:t.setMutedAll(e.value);break;case`setActiveMic`:t.setActiveMic(e.value);break;case`setHighlight`:t.setHighlight(e.value);break;case`setActiveOnly`:t.setActiveOnly(e.value);break;case`setShowBoxes`:t.setShowBoxes(e.value===!0);break;case`setPaused`:t.setPaused(e.value);break;case`setQuality`:t.setQuality(e.value);break;case`setLayout`:t.setLayout(e.value);break;case`setShowName`:t.setShowName(e.value);break;case`setShowBadges`:t.setShowBadges(e.value);break;case`setSnapshots`:t.setSnapshots(e.value);break;case`fit`:t.fit(e.w,e.h);break;case`reconnect`:t.reconnect();break;default:break}}),[]);let ae=(0,S.useMemo)(()=>vq(g.length,O.w,O.h,y),[g.length,O.w,O.h,y]),oe=(0,S.useRef)(null);return(0,S.useEffect)(()=>{let e=oe.current;if(!e)return;let t=[];e.querySelectorAll(`[data-device-id]`).forEach(e=>{let n=Number(e.dataset.deviceId),r=e.getBoundingClientRect();t.push({deviceId:n,rect:{x:r.x,y:r.y,w:r.width,h:r.height}})}),t.length&&kq(Oq(t))},[ae,g]),(0,C.jsxs)(`div`,{ref:oe,style:{position:`fixed`,inset:0,background:`#000`,display:`flex`,flexWrap:`wrap`,alignItems:`center`,justifyContent:`center`},children:[d&&g.length===0&&(0,C.jsx)(`div`,{style:{color:`#a1a1aa`,fontFamily:`system-ui, sans-serif`,fontSize:14,padding:24,textAlign:`center`},children:`No active cameras`}),g.map(t=>(0,C.jsx)(`div`,{"data-device-id":t,style:{width:ae.cellW,height:ae.cellH},children:(0,C.jsx)(Xq,{system:e,deviceId:t,name:re[t]?.name??`Camera ${t}`,online:re[t]?.online??!1,quality:_,muted:!n.has(t),paused:s.has(t),showName:x,audioActive:n.has(t),micActive:a.activeMicId===t,onTogglePause:e=>kq(Tq(e)),onToggleAudio:e=>kq(wq(e)),onToggleMic:a.toggleMic,onOpen:e=>kq(Cq(e)),ptzSupported:te.has(t),onPtz:e=>kq(Eq(e)),highlight:l,showBoxes:p,reconnectSignal:T,posterUrl:D[String(t)]})},t))]})}function cJ(){let e=tq(`grid`,()=>window.__CAMSTACK_GRID__,KK,gq),t=(0,S.useMemo)(()=>e===null||!e.ok?null:{system:ij({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new CE({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}})},[e]);return(0,S.useEffect)(()=>{if(t)return()=>t.system.close()},[t]),e===null?null:e.ok?t?(0,C.jsx)(Rz,{system:t.system,children:(0,C.jsx)(EE,{client:t.queryClient,children:(0,C.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,C.jsx)(sJ,{system:t.system,config:e.config})})})}):(0,C.jsx)(oJ,{message:`Failed to initialise the grid embed`}):(0,C.jsx)(oJ,{message:e.error})}function lJ(e,t){if(e.length===0)return{kind:`gap`,nearestEdgeMs:null,prevEndMs:null};let n=null,r=null;for(let a of e){let e=a.startMs+a.durMs;if(t>=a.startMs&&t<e)return{kind:`segment`,seg:a};e<=t&&(n=n===null?e:Math.max(n,e)),a.startMs>t&&(r===null||a.startMs<r)&&(r=a.startMs)}if(r!==null&&n!==null&&r-n<=40&&t>=n&&t<r){let t=e.find(e=>e.startMs===r);if(t)return{kind:`segment`,seg:t}}return{kind:`gap`,nearestEdgeMs:r,prevEndMs:n}}function uJ(e,t){let n=e.length;if(n===0)return 0;let r=0,a=n-1,o=-1;for(;r<=a;){let n=r+a>>1,s=e[n];if(!s)break;s.startMs<=t?(o=n,r=n+1):a=n-1}if(o===-1)return 0;let s=e[o];if(s&&t<s.startMs+s.durMs)return o;let c=e[o+1];return s&&c?Math.abs(s.startMs-t)<=Math.abs(c.startMs-t)?o:o+1:o}function dJ(e,t){return e.length===0?null:e[uJ(e,t)]??null}var fJ=`/addon/recorder/playback`,pJ=1129530417,mJ=2;function hJ(e,t){let n=0,r=1,a=t;for(;;){let t=e[a];if(t===void 0)throw Error(`CSD1: truncated varint`);if(n+=(t&127)*r,a++,!(t&128))break;if(r*=128,r>2**53-1)throw Error(`CSD1: varint out of range`)}return{value:n,next:a}}function gJ(e){if(e.length<6)throw Error(`CSD1: too short`);if(((e[0]??0)<<24|(e[1]??0)<<16|(e[2]??0)<<8|(e[3]??0))>>>0!==pJ)throw Error(`CSD1: bad magic`);let t=e[4];if(t!==1&&t!==mJ)throw Error(`CSD1: unsupported version ${String(t)}`);let n=e[5]===1,r=6,a=hJ(e,r);r=a.next;let o=new TextDecoder().decode(e.subarray(r,r+a.value));r+=a.value;let s=hJ(e,r);r=s.next;let c=hJ(e,r);r=c.next;let l=[],u=0;for(let n=0;n<c.value;n++){let n=hJ(e,r);r=n.next;let a=hJ(e,r);r=a.next;let o=hJ(e,r);r=o.next;let s=u+n.value;u=s;let c;if(t===mJ){let t=hJ(e,r);if(r=t.next,t.value>0){let n=hJ(e,r);r=n.next;let a=hJ(e,r);r=a.next;let o=[],s=0,l=0;for(let n=0;n<t.value;n++){let t=hJ(e,r);r=t.next;let n=hJ(e,r);r=n.next,s+=t.value,l+=n.value,o.push({timeTicks:s,moofOffset:l})}c={trackId:n.value,mfraOffset:a.value,samples:o}}}l.push({startMs:s,durMs:a.value,bytes:o.value,...c?{mfra:c}:{}})}return{profile:o,hydrated:n,asOfMs:s.value,rows:l}}var _J=36e5,vJ=5*6e4;function yJ(e,t){let n=[...e,t].sort((e,t)=>e.fromMs-t.fromMs),r=[];for(let e of n){let t=r[r.length-1];t&&e.fromMs<=t.toMs?r[r.length-1]={fromMs:t.fromMs,toMs:Math.max(t.toMs,e.toMs)}:r.push(e)}return r}function bJ(e,t,n){return e.some(e=>e.fromMs<=t&&e.toMs>=n)}var xJ=class{deps;fetchImpl;rows=[];coverage=[];servedProfile=null;allCache=null;inFlight=new Map;constructor(e){this.deps=e,this.fetchImpl=e.fetchImpl??((e,t)=>fetch(e,t))}urlFor(e,t){let n=new Date(t.startMs),r=e=>String(e).padStart(2,`0`),a=`${e}/${n.getUTCFullYear()}/${r(n.getUTCMonth()+1)}/${r(n.getUTCDate())}/${r(n.getUTCHours())}`,o=`${t.startMs}-${t.durMs}-${t.bytes}.m4s`;return`${this.deps.baseUrl}/${this.deps.deviceId}/${a}/${o}`}async ensure(e,t){if(bJ(this.coverage,e,t))return this.window(e,t,!0);let n=`${e}:${t}`,r=this.inFlight.get(n);if(r)return await r,this.window(e,t,bJ(this.coverage,e,t));let a=this.fetchWindow(e,t);this.inFlight.set(n,a);try{await a}finally{this.inFlight.get(n)===a&&this.inFlight.delete(n)}return this.window(e,t,bJ(this.coverage,e,t))}async fetchWindow(e,t){let n=this.deps.profile===void 0?``:`&profile=${encodeURIComponent(this.deps.profile)}`,r=`${this.deps.baseUrl}/${this.deps.deviceId}/directory?from=${Math.floor(e)}&to=${Math.ceil(t)}${n}`,a=await this.fetchImpl(r,{headers:{...this.deps.headers},credentials:`include`});if(!a.ok)throw Error(`directory: HTTP ${a.status}`);let o=gJ(new Uint8Array(await a.arrayBuffer()));o.profile!==``&&(this.servedProfile=o.profile);let s=new Set(this.rows.map(e=>e.startMs));for(let e of o.rows)s.has(e.startMs)||this.rows.push(e);if(this.rows.sort((e,t)=>e.startMs-t.startMs),this.allCache=null,o.hydrated){let n=o.asOfMs>0?Math.min(t,o.asOfMs):t;n>e&&(this.coverage=yJ(this.coverage,{fromMs:e,toMs:n}))}this.deps.onLog?.(`directory:fetched`,{fromMs:e,toMs:t,rows:o.rows.length,hydrated:o.hydrated,profile:o.profile})}window(e,t,n){let r=this.servedProfile;return r===null?{segments:[],profile:null,hydrated:n}:{segments:this.rows.filter(n=>n.startMs<t&&n.startMs+n.durMs>e).map(e=>({uri:this.urlFor(r,e),startMs:e.startMs,durMs:e.durMs,bytes:e.bytes,...e.mfra?{mfra:e.mfra}:{}})),profile:r,hydrated:n}}all(){if(this.allCache)return this.allCache;let e=this.servedProfile;return e===null?[]:(this.allCache=this.rows.map(t=>({uri:this.urlFor(e,t),startMs:t.startMs,durMs:t.durMs,bytes:t.bytes,...t.mfra?{mfra:t.mfra}:{}})),this.allCache)}async ensureAround(e){let t=Math.floor(e/_J)*_J,n=t-(e<t+vJ?_J:0),r=t+_J+(e>=t+_J-vJ?_J:0);return this.ensure(n,r)}isCovered(e){return bJ(this.coverage,e,e)}clear(){this.rows=[],this.coverage=[],this.servedProfile=null,this.allCache=null,this.inFlight.clear()}},SJ=u(s((e=>{var t=(function(){var e=new Date,n=4,r=3,a=2,o=1,s=n;return{setLogLevel:function(e){s=e==this.debug?o:e==this.info?a:e==this.warn?r:(this.error,n)},debug:function(n,r){console.debug===void 0&&(console.debug=console.log),o>=s&&console.debug(`[`+t.getDurationString(new Date-e,1e3)+`]`,`[`+n+`]`,r)},log:function(e,t){this.debug(e.msg)},info:function(n,r){a>=s&&console.info(`[`+t.getDurationString(new Date-e,1e3)+`]`,`[`+n+`]`,r)},warn:function(n,a){r>=s&&console.warn(`[`+t.getDurationString(new Date-e,1e3)+`]`,`[`+n+`]`,a)},error:function(r,a){n>=s&&console.error(`[`+t.getDurationString(new Date-e,1e3)+`]`,`[`+r+`]`,a)}}})();t.getDurationString=function(e,t){var n;function r(e,t){for(var n=(``+e).split(`.`);n[0].length<t;)n[0]=`0`+n[0];return n.join(`.`)}e<0?(n=!0,e=-e):n=!1;var a=e/(t||1),o=Math.floor(a/3600);a-=o*3600;var s=Math.floor(a/60);a-=s*60;var c=a*1e3;return a=Math.floor(a),c-=a*1e3,c=Math.floor(c),(n?`-`:``)+o+`:`+r(s,2)+`:`+r(a,2)+`.`+r(c,3)},t.printRanges=function(e){var n=e.length;if(n>0){for(var r=``,a=0;a<n;a++)a>0&&(r+=`,`),r+=`[`+t.getDurationString(e.start(a))+`,`+t.getDurationString(e.end(a))+`]`;return r}else return`(empty)`},e!==void 0&&(e.Log=t);var n=function(e){if(e instanceof ArrayBuffer)this.buffer=e,this.dataview=new DataView(e);else throw`Needs an array buffer`;this.position=0};n.prototype.getPosition=function(){return this.position},n.prototype.getEndPosition=function(){return this.buffer.byteLength},n.prototype.getLength=function(){return this.buffer.byteLength},n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.buffer.byteLength,e));return this.position=isNaN(t)||!isFinite(t)?0:t,!0},n.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},n.prototype.readAnyInt=function(e,t){var n=0;if(this.position+e<=this.buffer.byteLength){switch(e){case 1:n=t?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:n=t?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(t)throw`No method for reading signed 24 bits values`;n=this.dataview.getUint8(this.position)<<16,n|=this.dataview.getUint8(this.position+1)<<8,n|=this.dataview.getUint8(this.position+2);break;case 4:n=t?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(t)throw`No method for reading signed 64 bits values`;n=this.dataview.getUint32(this.position)<<32,n|=this.dataview.getUint32(this.position+4);break;default:throw`readInt method not implemented for size: `+e}return this.position+=e,n}else throw`Not enough bytes in buffer`},n.prototype.readUint8=function(){return this.readAnyInt(1,!1)},n.prototype.readUint16=function(){return this.readAnyInt(2,!1)},n.prototype.readUint24=function(){return this.readAnyInt(3,!1)},n.prototype.readUint32=function(){return this.readAnyInt(4,!1)},n.prototype.readUint64=function(){return this.readAnyInt(8,!1)},n.prototype.readString=function(e){if(this.position+e<=this.buffer.byteLength){for(var t=``,n=0;n<e;n++)t+=String.fromCharCode(this.readUint8());return t}else throw`Not enough bytes in buffer`},n.prototype.readCString=function(){for(var e=[];;){var t=this.readUint8();if(t!==0)e.push(t);else break}return String.fromCharCode.apply(null,e)},n.prototype.readInt8=function(){return this.readAnyInt(1,!0)},n.prototype.readInt16=function(){return this.readAnyInt(2,!0)},n.prototype.readInt32=function(){return this.readAnyInt(4,!0)},n.prototype.readInt64=function(){return this.readAnyInt(8,!1)},n.prototype.readUint8Array=function(e){for(var t=new Uint8Array(e),n=0;n<e;n++)t[n]=this.readUint8();return t},n.prototype.readInt16Array=function(e){for(var t=new Int16Array(e),n=0;n<e;n++)t[n]=this.readInt16();return t},n.prototype.readUint16Array=function(e){for(var t=new Int16Array(e),n=0;n<e;n++)t[n]=this.readUint16();return t},n.prototype.readUint32Array=function(e){for(var t=new Uint32Array(e),n=0;n<e;n++)t[n]=this.readUint32();return t},n.prototype.readInt32Array=function(e){for(var t=new Int32Array(e),n=0;n<e;n++)t[n]=this.readInt32();return t},e!==void 0&&(e.MP4BoxStream=n);var r=function(e,t,n){this._byteOffset=t||0,e instanceof ArrayBuffer?this.buffer=e:typeof e==`object`?(this.dataView=e,t&&(this._byteOffset+=t)):this.buffer=new ArrayBuffer(e||0),this.position=0,this.endianness=n??r.LITTLE_ENDIAN};r.prototype={},r.prototype.getPosition=function(){return this.position},r.prototype._realloc=function(e){if(this._dynamicSize){var t=this._byteOffset+this.position+e,n=this._buffer.byteLength;if(t<=n){t>this._byteLength&&(this._byteLength=t);return}for(n<1&&(n=1);t>n;)n*=2;var r=new ArrayBuffer(n),a=new Uint8Array(this._buffer);new Uint8Array(r,0,a.length).set(a),this.buffer=r,this._byteLength=t}},r.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var e=new ArrayBuffer(this._byteLength),t=new Uint8Array(e),n=new Uint8Array(this._buffer,0,t.length);t.set(n),this.buffer=e}},r.BIG_ENDIAN=!1,r.LITTLE_ENDIAN=!0,r.prototype._byteLength=0,Object.defineProperty(r.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this._trimAlloc(),this._buffer},set:function(e){this._buffer=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(r.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(r.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset,this._buffer=e.buffer,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._byteOffset+e.byteLength}}),r.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t},r.prototype.isEof=function(){return this.position>=this._byteLength},r.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=e*1,t},r.prototype.readInt32Array=function(e,t){e??=this.byteLength-this.position/4;var n=new Int32Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readInt16Array=function(e,t){e??=this.byteLength-this.position/2;var n=new Int16Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readInt8Array=function(e){e??=this.byteLength-this.position;var t=new Int8Array(e);return r.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},r.prototype.readUint32Array=function(e,t){e??=this.byteLength-this.position/4;var n=new Uint32Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readUint16Array=function(e,t){e??=this.byteLength-this.position/2;var n=new Uint16Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readUint8Array=function(e){e??=this.byteLength-this.position;var t=new Uint8Array(e);return r.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},r.prototype.readFloat64Array=function(e,t){e??=this.byteLength-this.position/8;var n=new Float64Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readFloat32Array=function(e,t){e??=this.byteLength-this.position/4;var n=new Float32Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readInt32=function(e){var t=this._dataView.getInt32(this.position,e??this.endianness);return this.position+=4,t},r.prototype.readInt16=function(e){var t=this._dataView.getInt16(this.position,e??this.endianness);return this.position+=2,t},r.prototype.readInt8=function(){var e=this._dataView.getInt8(this.position);return this.position+=1,e},r.prototype.readUint32=function(e){var t=this._dataView.getUint32(this.position,e??this.endianness);return this.position+=4,t},r.prototype.readUint16=function(e){var t=this._dataView.getUint16(this.position,e??this.endianness);return this.position+=2,t},r.prototype.readUint8=function(){var e=this._dataView.getUint8(this.position);return this.position+=1,e},r.prototype.readFloat32=function(e){var t=this._dataView.getFloat32(this.position,e??this.endianness);return this.position+=4,t},r.prototype.readFloat64=function(e){var t=this._dataView.getFloat64(this.position,e??this.endianness);return this.position+=8,t},r.endianness=new Int8Array(new Int16Array([1]).buffer)[0]>0,r.memcpy=function(e,t,n,r,a){var o=new Uint8Array(e,t,a),s=new Uint8Array(n,r,a);o.set(s)},r.arrayToNative=function(e,t){return t==this.endianness?e:this.flipArrayEndianness(e)},r.nativeToEndian=function(e,t){return this.endianness==t?e:this.flipArrayEndianness(e)},r.flipArrayEndianness=function(e){for(var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=0;n<e.byteLength;n+=e.BYTES_PER_ELEMENT)for(var r=n+e.BYTES_PER_ELEMENT-1,a=n;r>a;r--,a++){var o=t[a];t[a]=t[r],t[r]=o}return e},r.prototype.failurePosition=0,String.fromCharCodeUint8=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return String.fromCharCode.apply(null,t)},r.prototype.readString=function(e,t){return t==null||t==`ASCII`?String.fromCharCodeUint8.apply(null,[this.mapUint8Array(e??this.byteLength-this.position)]):new TextDecoder(t).decode(this.mapUint8Array(e))},r.prototype.readCString=function(e){var t=this.byteLength-this.position,n=new Uint8Array(this._buffer,this._byteOffset+this.position),r=t;e!=null&&(r=Math.min(e,t));for(var a=0;a<r&&n[a]!==0;a++);var o=String.fromCharCodeUint8.apply(null,[this.mapUint8Array(a)]);return e==null?a!=t&&(this.position+=1):this.position+=r-a,o};var a=2**32;r.prototype.readInt64=function(){return this.readInt32()*a+this.readUint32()},r.prototype.readUint64=function(){return this.readUint32()*a+this.readUint32()},r.prototype.readInt64=function(){return this.readUint32()*a+this.readUint32()},r.prototype.readUint24=function(){return(this.readUint8()<<16)+(this.readUint8()<<8)+this.readUint8()},e!==void 0&&(e.DataStream=r),r.prototype.save=function(e){var t=new Blob([this.buffer]);if(window.URL&&URL.createObjectURL){var n=window.URL.createObjectURL(t),r=document.createElement(`a`);document.body.appendChild(r),r.setAttribute(`href`,n),r.setAttribute(`download`,e),r.setAttribute(`target`,`_self`),r.click(),window.URL.revokeObjectURL(n)}else throw`DataStream.save: Can't create object URL.`},r.prototype._dynamicSize=!0,Object.defineProperty(r.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){e||this._trimAlloc(),this._dynamicSize=e}}),r.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e),n=new Uint8Array(t),r=new Uint8Array(this._buffer,e,n.length);n.set(r),this.buffer=t,this.position-=e},r.prototype.writeInt32Array=function(e,t){if(this._realloc(e.length*4),e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt32Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeInt32(e[n],t)},r.prototype.writeInt16Array=function(e,t){if(this._realloc(e.length*2),e instanceof Int16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt16Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeInt16(e[n],t)},r.prototype.writeInt8Array=function(e){if(this._realloc(e.length*1),e instanceof Int8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt8Array(e.length);else for(var t=0;t<e.length;t++)this.writeInt8(e[t])},r.prototype.writeUint32Array=function(e,t){if(this._realloc(e.length*4),e instanceof Uint32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint32Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeUint32(e[n],t)},r.prototype.writeUint16Array=function(e,t){if(this._realloc(e.length*2),e instanceof Uint16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint16Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeUint16(e[n],t)},r.prototype.writeUint8Array=function(e){if(this._realloc(e.length*1),e instanceof Uint8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint8Array(e.length);else for(var t=0;t<e.length;t++)this.writeUint8(e[t])},r.prototype.writeFloat64Array=function(e,t){if(this._realloc(e.length*8),e instanceof Float64Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapFloat64Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeFloat64(e[n],t)},r.prototype.writeFloat32Array=function(e,t){if(this._realloc(e.length*4),e instanceof Float32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapFloat32Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeFloat32(e[n],t)},r.prototype.writeInt32=function(e,t){this._realloc(4),this._dataView.setInt32(this.position,e,t??this.endianness),this.position+=4},r.prototype.writeInt16=function(e,t){this._realloc(2),this._dataView.setInt16(this.position,e,t??this.endianness),this.position+=2},r.prototype.writeInt8=function(e){this._realloc(1),this._dataView.setInt8(this.position,e),this.position+=1},r.prototype.writeUint32=function(e,t){this._realloc(4),this._dataView.setUint32(this.position,e,t??this.endianness),this.position+=4},r.prototype.writeUint16=function(e,t){this._realloc(2),this._dataView.setUint16(this.position,e,t??this.endianness),this.position+=2},r.prototype.writeUint8=function(e){this._realloc(1),this._dataView.setUint8(this.position,e),this.position+=1},r.prototype.writeFloat32=function(e,t){this._realloc(4),this._dataView.setFloat32(this.position,e,t??this.endianness),this.position+=4},r.prototype.writeFloat64=function(e,t){this._realloc(8),this._dataView.setFloat64(this.position,e,t??this.endianness),this.position+=8},r.prototype.writeUCS2String=function(e,t,n){n??=e.length;for(var r=0;r<e.length&&r<n;r++)this.writeUint16(e.charCodeAt(r),t);for(;r<n;r++)this.writeUint16(0)},r.prototype.writeString=function(e,t,n){var r=0;if(t==null||t==`ASCII`)if(n!=null){var a=Math.min(e.length,n);for(r=0;r<a;r++)this.writeUint8(e.charCodeAt(r));for(;r<n;r++)this.writeUint8(0)}else for(r=0;r<e.length;r++)this.writeUint8(e.charCodeAt(r));else this.writeUint8Array(new TextEncoder(t).encode(e.substring(0,n)))},r.prototype.writeCString=function(e,t){var n=0;if(t!=null){var r=Math.min(e.length,t);for(n=0;n<r;n++)this.writeUint8(e.charCodeAt(n));for(;n<t;n++)this.writeUint8(0)}else{for(n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));this.writeUint8(0)}},r.prototype.writeStruct=function(e,t){for(var n=0;n<e.length;n+=2){var r=e[n+1];this.writeType(r,t[e[n]],t)}},r.prototype.writeType=function(e,t,n){var a;if(typeof e==`function`)return e(this,t);if(typeof e==`object`&&!(e instanceof Array))return e.set(this,t,n);var o=null,s=`ASCII`,c=this.position;switch(typeof e==`string`&&/:/.test(e)&&(a=e.split(`:`),e=a[0],o=parseInt(a[1])),typeof e==`string`&&/,/.test(e)&&(a=e.split(`,`),e=a[0],s=parseInt(a[1])),e){case`uint8`:this.writeUint8(t);break;case`int8`:this.writeInt8(t);break;case`uint16`:this.writeUint16(t,this.endianness);break;case`int16`:this.writeInt16(t,this.endianness);break;case`uint32`:this.writeUint32(t,this.endianness);break;case`int32`:this.writeInt32(t,this.endianness);break;case`float32`:this.writeFloat32(t,this.endianness);break;case`float64`:this.writeFloat64(t,this.endianness);break;case`uint16be`:this.writeUint16(t,r.BIG_ENDIAN);break;case`int16be`:this.writeInt16(t,r.BIG_ENDIAN);break;case`uint32be`:this.writeUint32(t,r.BIG_ENDIAN);break;case`int32be`:this.writeInt32(t,r.BIG_ENDIAN);break;case`float32be`:this.writeFloat32(t,r.BIG_ENDIAN);break;case`float64be`:this.writeFloat64(t,r.BIG_ENDIAN);break;case`uint16le`:this.writeUint16(t,r.LITTLE_ENDIAN);break;case`int16le`:this.writeInt16(t,r.LITTLE_ENDIAN);break;case`uint32le`:this.writeUint32(t,r.LITTLE_ENDIAN);break;case`int32le`:this.writeInt32(t,r.LITTLE_ENDIAN);break;case`float32le`:this.writeFloat32(t,r.LITTLE_ENDIAN);break;case`float64le`:this.writeFloat64(t,r.LITTLE_ENDIAN);break;case`cstring`:this.writeCString(t,o);break;case`string`:this.writeString(t,s,o);break;case`u16string`:this.writeUCS2String(t,this.endianness,o);break;case`u16stringle`:this.writeUCS2String(t,r.LITTLE_ENDIAN,o);break;case`u16stringbe`:this.writeUCS2String(t,r.BIG_ENDIAN,o);break;default:if(e.length==3){for(var l=e[1],u=0;u<t.length;u++)this.writeType(l,t[u]);break}else{this.writeStruct(e,t);break}}o!=null&&(this.position=c,this._realloc(o),this.position=c+o)},r.prototype.writeUint64=function(e){var t=Math.floor(e/a);this.writeUint32(t),this.writeUint32(e&4294967295)},r.prototype.writeUint24=function(e){this.writeUint8((e&16711680)>>16),this.writeUint8((e&65280)>>8),this.writeUint8(e&255)},r.prototype.adjustUint32=function(e,t){var n=this.position;this.seek(e),this.writeUint32(t),this.seek(n)},r.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var n=new Int32Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*4,n},r.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var n=new Int16Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*2,n},r.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=e*1,t},r.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var n=new Uint32Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*4,n},r.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var n=new Uint16Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*2,n},r.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var n=new Float64Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*8,n},r.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var n=new Float32Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*4,n};var o=function(e){this.buffers=[],this.bufferIndex=-1,e&&(this.insertBuffer(e),this.bufferIndex=0)};o.prototype=new r(new ArrayBuffer,0,r.BIG_ENDIAN),o.prototype.initialized=function(){var e;return this.bufferIndex>-1?!0:this.buffers.length>0?(e=this.buffers[0],e.fileStart===0?(this.buffer=e,this.bufferIndex=0,t.debug(`MultiBufferStream`,`Stream ready for parsing`),!0):(t.warn(`MultiBufferStream`,`The first buffer should have a fileStart of 0`),this.logBufferLevel(),!1)):(t.warn(`MultiBufferStream`,`No buffer to start parsing from`),this.logBufferLevel(),!1)},ArrayBuffer.concat=function(e,n){t.debug(`ArrayBuffer`,`Trying to create a new buffer of size: `+(e.byteLength+n.byteLength));var r=new Uint8Array(e.byteLength+n.byteLength);return r.set(new Uint8Array(e),0),r.set(new Uint8Array(n),e.byteLength),r.buffer},o.prototype.reduceBuffer=function(e,t,n){var r=new Uint8Array(n);return r.set(new Uint8Array(e,t,n)),r.buffer.fileStart=e.fileStart+t,r.buffer.usedBytes=0,r.buffer},o.prototype.insertBuffer=function(e){for(var n=!0,r=0;r<this.buffers.length;r++){var a=this.buffers[r];if(e.fileStart<=a.fileStart){if(e.fileStart===a.fileStart)if(e.byteLength>a.byteLength){this.buffers.splice(r,1),r--;continue}else t.warn(`MultiBufferStream`,`Buffer (fileStart: `+e.fileStart+` - Length: `+e.byteLength+`) already appended, ignoring`);else e.fileStart+e.byteLength<=a.fileStart||(e=this.reduceBuffer(e,0,a.fileStart-e.fileStart)),t.debug(`MultiBufferStream`,`Appending new buffer (fileStart: `+e.fileStart+` - Length: `+e.byteLength+`)`),this.buffers.splice(r,0,e),r===0&&(this.buffer=e);n=!1;break}else if(e.fileStart<a.fileStart+a.byteLength){var o=a.fileStart+a.byteLength-e.fileStart,s=e.byteLength-o;if(s>0)e=this.reduceBuffer(e,o,s);else{n=!1;break}}}n&&(t.debug(`MultiBufferStream`,`Appending new buffer (fileStart: `+e.fileStart+` - Length: `+e.byteLength+`)`),this.buffers.push(e),r===0&&(this.buffer=e))},o.prototype.logBufferLevel=function(e){var n,r,a,o,s=[],c,l=``;for(a=0,o=0,n=0;n<this.buffers.length;n++)r=this.buffers[n],n===0?(c={},s.push(c),c.start=r.fileStart,c.end=r.fileStart+r.byteLength,l+=`[`+c.start+`-`):c.end===r.fileStart?c.end=r.fileStart+r.byteLength:(c={},c.start=r.fileStart,l+=s[s.length-1].end-1+`], [`+c.start+`-`,c.end=r.fileStart+r.byteLength,s.push(c)),a+=r.usedBytes,o+=r.byteLength;s.length>0&&(l+=c.end-1+`]`);var u=e?t.info:t.debug;this.buffers.length===0?u(`MultiBufferStream`,`No more buffer in memory`):u(`MultiBufferStream`,``+this.buffers.length+` stored buffer(s) (`+a+`/`+o+` bytes), continuous ranges: `+l)},o.prototype.cleanBuffers=function(){var e,n;for(e=0;e<this.buffers.length;e++)n=this.buffers[e],n.usedBytes===n.byteLength&&(t.debug(`MultiBufferStream`,`Removing buffer #`+e),this.buffers.splice(e,1),e--)},o.prototype.mergeNextBuffer=function(){var e;if(this.bufferIndex+1<this.buffers.length)if(e=this.buffers[this.bufferIndex+1],e.fileStart===this.buffer.fileStart+this.buffer.byteLength){var n=this.buffer.byteLength,r=this.buffer.usedBytes,a=this.buffer.fileStart;return this.buffers[this.bufferIndex]=ArrayBuffer.concat(this.buffer,e),this.buffer=this.buffers[this.bufferIndex],this.buffers.splice(this.bufferIndex+1,1),this.buffer.usedBytes=r,this.buffer.fileStart=a,t.debug(`ISOFile`,`Concatenating buffer for box parsing (length: `+n+`->`+this.buffer.byteLength+`)`),!0}else return!1;else return!1},o.prototype.findPosition=function(e,n,r){var a,o=null,s=-1;for(a=e===!0?0:this.bufferIndex;a<this.buffers.length&&(o=this.buffers[a],o.fileStart<=n);)s=a,r&&(o.fileStart+o.byteLength<=n?o.usedBytes=o.byteLength:o.usedBytes=n-o.fileStart,this.logBufferLevel()),a++;return s===-1?-1:(o=this.buffers[s],o.fileStart+o.byteLength>=n?(t.debug(`MultiBufferStream`,`Found position in existing buffer #`+s),s):-1)},o.prototype.findEndContiguousBuf=function(e){var t,n,r,a=e===void 0?this.bufferIndex:e;if(n=this.buffers[a],this.buffers.length>a+1)for(t=a+1;t<this.buffers.length&&(r=this.buffers[t],r.fileStart===n.fileStart+n.byteLength);t++)n=r;return n.fileStart+n.byteLength},o.prototype.getEndFilePositionAfter=function(e){var t=this.findPosition(!0,e,!1);return t===-1?e:this.findEndContiguousBuf(t)},o.prototype.addUsedBytes=function(e){this.buffer.usedBytes+=e,this.logBufferLevel()},o.prototype.setAllUsedBytes=function(){this.buffer.usedBytes=this.buffer.byteLength,this.logBufferLevel()},o.prototype.seek=function(e,n,r){var a=this.findPosition(n,e,r);return a===-1?(t.debug(`MultiBufferStream`,`Position `+e+` not found in buffered data`),!1):(this.buffer=this.buffers[a],this.bufferIndex=a,this.position=e-this.buffer.fileStart,t.debug(`MultiBufferStream`,`Repositioning parser at buffer position: `+this.position),!0)},o.prototype.getPosition=function(){if(this.bufferIndex===-1||this.buffers[this.bufferIndex]===null)throw`Error accessing position in the MultiBufferStream`;return this.buffers[this.bufferIndex].fileStart+this.position},o.prototype.getLength=function(){return this.byteLength},o.prototype.getEndPosition=function(){if(this.bufferIndex===-1||this.buffers[this.bufferIndex]===null)throw`Error accessing position in the MultiBufferStream`;return this.buffers[this.bufferIndex].fileStart+this.byteLength},e!==void 0&&(e.MultiBufferStream=o);var s=function(){var e=3,n=4,r=5,a=6,o=[];o[e]=`ES_Descriptor`,o[n]=`DecoderConfigDescriptor`,o[r]=`DecoderSpecificInfo`,o[a]=`SLConfigDescriptor`,this.getDescriptorName=function(e){return o[e]};var s=this,c={};return this.parseOneDescriptor=function(e){var n=0,r=0,a=e.readUint8(),s,l;for(n++,l=e.readUint8(),n++;l&128;)r=(r<<7)+(l&127),l=e.readUint8(),n++;return r=(r<<7)+(l&127),t.debug(`MPEG4DescriptorParser`,`Found `+(o[a]||`Descriptor `+a)+`, size `+r+` at position `+e.getPosition()),s=o[a]?new c[o[a]](r):new c.Descriptor(r),s.parse(e),s},c.Descriptor=function(e,t){this.tag=e,this.size=t,this.descs=[]},c.Descriptor.prototype.parse=function(e){this.data=e.readUint8Array(this.size)},c.Descriptor.prototype.findDescriptor=function(e){for(var t=0;t<this.descs.length;t++)if(this.descs[t].tag==e)return this.descs[t];return null},c.Descriptor.prototype.parseRemainingDescriptors=function(e){for(var t=e.position;e.position<t+this.size;){var n=s.parseOneDescriptor(e);this.descs.push(n)}},c.ES_Descriptor=function(t){c.Descriptor.call(this,e,t)},c.ES_Descriptor.prototype=new c.Descriptor,c.ES_Descriptor.prototype.parse=function(e){if(this.ES_ID=e.readUint16(),this.flags=e.readUint8(),this.size-=3,this.flags&128?(this.dependsOn_ES_ID=e.readUint16(),this.size-=2):this.dependsOn_ES_ID=0,this.flags&64){var t=e.readUint8();this.URL=e.readString(t),this.size-=t+1}else this.URL=``;this.flags&32?(this.OCR_ES_ID=e.readUint16(),this.size-=2):this.OCR_ES_ID=0,this.parseRemainingDescriptors(e)},c.ES_Descriptor.prototype.getOTI=function(e){var t=this.findDescriptor(n);return t?t.oti:0},c.ES_Descriptor.prototype.getAudioConfig=function(e){var t=this.findDescriptor(n);if(!t)return null;var a=t.findDescriptor(r);if(a&&a.data){var o=(a.data[0]&248)>>3;return o===31&&a.data.length>=2&&(o=32+((a.data[0]&7)<<3)+((a.data[1]&224)>>5)),o}else return null},c.DecoderConfigDescriptor=function(e){c.Descriptor.call(this,n,e)},c.DecoderConfigDescriptor.prototype=new c.Descriptor,c.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8(),this.streamType=e.readUint8(),this.upStream=(this.streamType>>1&1)!=0,this.streamType>>>=2,this.bufferSize=e.readUint24(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32(),this.size-=13,this.parseRemainingDescriptors(e)},c.DecoderSpecificInfo=function(e){c.Descriptor.call(this,r,e)},c.DecoderSpecificInfo.prototype=new c.Descriptor,c.SLConfigDescriptor=function(e){c.Descriptor.call(this,a,e)},c.SLConfigDescriptor.prototype=new c.Descriptor,this};e!==void 0&&(e.MPEG4DescriptorParser=s);var c={ERR_INVALID_DATA:-1,ERR_NOT_ENOUGH_DATA:0,OK:1,BASIC_BOXES:[{type:`mdat`,name:`MediaDataBox`},{type:`idat`,name:`ItemDataBox`},{type:`free`,name:`FreeSpaceBox`},{type:`skip`,name:`FreeSpaceBox`},{type:`meco`,name:`AdditionalMetadataContainerBox`},{type:`strk`,name:`SubTrackBox`}],FULL_BOXES:[{type:`hmhd`,name:`HintMediaHeaderBox`},{type:`nmhd`,name:`NullMediaHeaderBox`},{type:`iods`,name:`ObjectDescriptorBox`},{type:`xml `,name:`XMLBox`},{type:`bxml`,name:`BinaryXMLBox`},{type:`ipro`,name:`ItemProtectionBox`},{type:`mere`,name:`MetaboxRelationBox`}],CONTAINER_BOXES:[[{type:`moov`,name:`CompressedMovieBox`},[`trak`,`pssh`]],[{type:`trak`,name:`TrackBox`}],[{type:`edts`,name:`EditBox`}],[{type:`mdia`,name:`MediaBox`}],[{type:`minf`,name:`MediaInformationBox`}],[{type:`dinf`,name:`DataInformationBox`}],[{type:`stbl`,name:`SampleTableBox`},[`sgpd`,`sbgp`]],[{type:`mvex`,name:`MovieExtendsBox`},[`trex`]],[{type:`moof`,name:`CompressedMovieFragmentBox`},[`traf`]],[{type:`traf`,name:`TrackFragmentBox`},[`trun`,`sgpd`,`sbgp`]],[{type:`vttc`,name:`VTTCueBox`}],[{type:`tref`,name:`TrackReferenceBox`}],[{type:`iref`,name:`ItemReferenceBox`}],[{type:`mfra`,name:`MovieFragmentRandomAccessBox`},[`tfra`]],[{type:`meco`,name:`AdditionalMetadataContainerBox`}],[{type:`hnti`,name:`trackhintinformation`}],[{type:`hinf`,name:`hintstatisticsbox`}],[{type:`strk`,name:`SubTrackBox`}],[{type:`strd`,name:`SubTrackDefinitionBox`}],[{type:`sinf`,name:`ProtectionSchemeInfoBox`}],[{type:`rinf`,name:`RestrictedSchemeInfoBox`}],[{type:`schi`,name:`SchemeInformationBox`}],[{type:`trgr`,name:`TrackGroupBox`}],[{type:`udta`,name:`UserDataBox`},[`kind`]],[{type:`iprp`,name:`ItemPropertiesBox`},[`ipma`]],[{type:`ipco`,name:`ItemPropertyContainerBox`}],[{type:`grpl`,name:`GroupsListBox`}],[{type:`j2kH`,name:`J2KHeaderInfoBox`}],[{type:`etyp`,name:`ExtendedTypeBox`},[`tyco`]]],boxCodes:[],fullBoxCodes:[],containerBoxCodes:[],sampleEntryCodes:{},sampleGroupEntryCodes:[],trackGroupTypes:[],UUIDBoxes:{},UUIDs:[],initialize:function(){c.FullBox.prototype=new c.Box,c.ContainerBox.prototype=new c.Box,c.SampleEntry.prototype=new c.Box,c.TrackGroupTypeBox.prototype=new c.FullBox,c.BASIC_BOXES.forEach(function(e){c.createBoxCtor(e.type,e.name)}),c.FULL_BOXES.forEach(function(e){c.createFullBoxCtor(e.type,e.name)}),c.CONTAINER_BOXES.forEach(function(e){c.createContainerBoxCtor(e[0].type,e[0].name,null,e[1])})},Box:function(e,t,n,r){this.type=e,this.box_name=n,this.size=t,this.uuid=r},FullBox:function(e,t,n,r){c.Box.call(this,e,t,n,r),this.flags=0,this.version=0},ContainerBox:function(e,t,n,r){c.Box.call(this,e,t,n,r),this.boxes=[]},SampleEntry:function(e,t,n,r){c.ContainerBox.call(this,e,t),this.hdr_size=n,this.start=r},SampleGroupEntry:function(e){this.grouping_type=e},TrackGroupTypeBox:function(e,t){c.FullBox.call(this,e,t)},createBoxCtor:function(e,t,n){c.boxCodes.push(e),c[e+`Box`]=function(n){c.Box.call(this,e,n,t)},c[e+`Box`].prototype=new c.Box,n&&(c[e+`Box`].prototype.parse=n)},createFullBoxCtor:function(e,t,n){c[e+`Box`]=function(n){c.FullBox.call(this,e,n,t)},c[e+`Box`].prototype=new c.FullBox,c[e+`Box`].prototype.parse=function(e){this.parseFullHeader(e),n&&n.call(this,e)}},addSubBoxArrays:function(e){if(e){this.subBoxNames=e;for(var t=e.length,n=0;n<t;n++)this[e[n]+`s`]=[]}},createContainerBoxCtor:function(e,t,n,r){c[e+`Box`]=function(n){c.ContainerBox.call(this,e,n,t),c.addSubBoxArrays.call(this,r)},c[e+`Box`].prototype=new c.ContainerBox,n&&(c[e+`Box`].prototype.parse=n)},createMediaSampleEntryCtor:function(e,t,n){c.sampleEntryCodes[e]=[],c[e+`SampleEntry`]=function(e,t){c.SampleEntry.call(this,e,t),c.addSubBoxArrays.call(this,n)},c[e+`SampleEntry`].prototype=new c.SampleEntry,t&&(c[e+`SampleEntry`].prototype.parse=t)},createSampleEntryCtor:function(e,t,n,r){c.sampleEntryCodes[e].push(t),c[t+`SampleEntry`]=function(n){c[e+`SampleEntry`].call(this,t,n),c.addSubBoxArrays.call(this,r)},c[t+`SampleEntry`].prototype=new c[e+`SampleEntry`],n&&(c[t+`SampleEntry`].prototype.parse=n)},createEncryptedSampleEntryCtor:function(e,t,n){c.createSampleEntryCtor.call(this,e,t,n,[`sinf`])},createSampleGroupCtor:function(e,t){c[e+`SampleGroupEntry`]=function(t){c.SampleGroupEntry.call(this,e,t)},c[e+`SampleGroupEntry`].prototype=new c.SampleGroupEntry,t&&(c[e+`SampleGroupEntry`].prototype.parse=t)},createTrackGroupCtor:function(e,t){c[e+`TrackGroupTypeBox`]=function(t){c.TrackGroupTypeBox.call(this,e,t)},c[e+`TrackGroupTypeBox`].prototype=new c.TrackGroupTypeBox,t&&(c[e+`TrackGroupTypeBox`].prototype.parse=t)},createUUIDBox:function(e,t,n,r,a){c.UUIDs.push(e),c.UUIDBoxes[e]=function(a){n?c.FullBox.call(this,`uuid`,a,t,e):r?c.ContainerBox.call(this,`uuid`,a,t,e):c.Box.call(this,`uuid`,a,t,e)},c.UUIDBoxes[e].prototype=n?new c.FullBox:r?new c.ContainerBox:new c.Box,a&&(n?c.UUIDBoxes[e].prototype.parse=function(e){this.parseFullHeader(e),a&&a.call(this,e)}:c.UUIDBoxes[e].prototype.parse=a)}};c.initialize(),c.TKHD_FLAG_ENABLED=1,c.TKHD_FLAG_IN_MOVIE=2,c.TKHD_FLAG_IN_PREVIEW=4,c.TFHD_FLAG_BASE_DATA_OFFSET=1,c.TFHD_FLAG_SAMPLE_DESC=2,c.TFHD_FLAG_SAMPLE_DUR=8,c.TFHD_FLAG_SAMPLE_SIZE=16,c.TFHD_FLAG_SAMPLE_FLAGS=32,c.TFHD_FLAG_DUR_EMPTY=65536,c.TFHD_FLAG_DEFAULT_BASE_IS_MOOF=131072,c.TRUN_FLAGS_DATA_OFFSET=1,c.TRUN_FLAGS_FIRST_FLAG=4,c.TRUN_FLAGS_DURATION=256,c.TRUN_FLAGS_SIZE=512,c.TRUN_FLAGS_FLAGS=1024,c.TRUN_FLAGS_CTS_OFFSET=2048,c.Box.prototype.add=function(e){return this.addBox(new c[e+`Box`])},c.Box.prototype.addBox=function(e){return this.boxes.push(e),this[e.type+`s`]?this[e.type+`s`].push(e):this[e.type]=e,e},c.Box.prototype.set=function(e,t){return this[e]=t,this},c.Box.prototype.addEntry=function(e,t){var n=t||`entries`;return this[n]||(this[n]=[]),this[n].push(e),this},e!==void 0&&(e.BoxParser=c),c.parseUUID=function(e){return c.parseHex16(e)},c.parseHex16=function(e){for(var t=``,n=0;n<16;n++){var r=e.readUint8().toString(16);t+=r.length===1?`0`+r:r}return t},c.parseOneBox=function(e,n,r){var a,o=e.getPosition(),s=0,l,u;if(e.getEndPosition()-o<8)return t.debug(`BoxParser`,`Not enough data in stream to parse the type and size of the box`),{code:c.ERR_NOT_ENOUGH_DATA};if(r&&r<8)return t.debug(`BoxParser`,`Not enough bytes left in the parent box to parse a new box`),{code:c.ERR_NOT_ENOUGH_DATA};var d=e.readUint32(),f=e.readString(4),p=f;if(t.debug(`BoxParser`,`Found box of type '`+f+`' and size `+d+` at position `+o),s=8,f==`uuid`){if(e.getEndPosition()-e.getPosition()<16||r-s<16)return e.seek(o),t.debug(`BoxParser`,`Not enough bytes left in the parent box to parse a UUID box`),{code:c.ERR_NOT_ENOUGH_DATA};u=c.parseUUID(e),s+=16,p=u}if(d==1){if(e.getEndPosition()-e.getPosition()<8||r&&r-s<8)return e.seek(o),t.warn(`BoxParser`,`Not enough data in stream to parse the extended size of the "`+f+`" box`),{code:c.ERR_NOT_ENOUGH_DATA};d=e.readUint64(),s+=8}else if(d===0){if(r)d=r;else if(f!==`mdat`)return t.error(`BoxParser`,`Unlimited box size not supported for type: '`+f+`'`),a=new c.Box(f,d),{code:c.OK,box:a,size:a.size}}return d!==0&&d<s?(t.error(`BoxParser`,`Box of type `+f+` has an invalid size `+d+` (too small to be a box)`),{code:c.ERR_NOT_ENOUGH_DATA,type:f,size:d,hdr_size:s,start:o}):d!==0&&r&&d>r?(t.error(`BoxParser`,`Box of type '`+f+`' has a size `+d+` greater than its container size `+r),{code:c.ERR_NOT_ENOUGH_DATA,type:f,size:d,hdr_size:s,start:o}):d!==0&&o+d>e.getEndPosition()?(e.seek(o),t.info(`BoxParser`,`Not enough data in stream to parse the entire '`+f+`' box`),{code:c.ERR_NOT_ENOUGH_DATA,type:f,size:d,hdr_size:s,start:o}):n?{code:c.OK,type:f,size:d,hdr_size:s,start:o}:(c[f+`Box`]?a=new c[f+`Box`](d):f===`uuid`?c.UUIDBoxes[u]?a=new c.UUIDBoxes[u](d):(t.warn(`BoxParser`,`Unknown uuid type: '`+u+`'`),a=new c.Box(f,d),a.uuid=u,a.has_unparsed_data=!0):(t.warn(`BoxParser`,`Unknown box type: '`+f+`'`),a=new c.Box(f,d),a.has_unparsed_data=!0),a.hdr_size=s,a.start=o,a.write===c.Box.prototype.write&&a.type!==`mdat`&&(t.info(`BoxParser`,`'`+p+`' box writing not yet implemented, keeping unparsed data in memory for later write`),a.parseDataAndRewind(e)),a.parse(e),l=e.getPosition()-(a.start+a.size),l<0?(t.warn(`BoxParser`,`Parsing of box '`+p+`' did not read the entire indicated box data size (missing `+-l+` bytes), seeking forward`),e.seek(a.start+a.size)):l>0&&(t.error(`BoxParser`,`Parsing of box '`+p+`' read `+l+` more bytes than the indicated box data size, seeking backwards`),a.size!==0&&e.seek(a.start+a.size)),{code:c.OK,box:a,size:a.size})},c.Box.prototype.parse=function(e){this.type==`mdat`?this.size===0?e.seek(e.getEndPosition()):e.seek(this.start+this.size):this.data=e.readUint8Array(this.size-this.hdr_size)},c.Box.prototype.parseDataAndRewind=function(e){this.data=e.readUint8Array(this.size-this.hdr_size),e.position-=this.size-this.hdr_size},c.FullBox.prototype.parseDataAndRewind=function(e){this.parseFullHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size),this.hdr_size-=4,e.position-=this.size-this.hdr_size},c.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8(),this.flags=e.readUint24(),this.hdr_size+=4},c.FullBox.prototype.parse=function(e){this.parseFullHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},c.ContainerBox.prototype.parse=function(e){for(var n,r;e.getPosition()<this.start+this.size;)if(n=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),n.code===c.OK)if(r=n.box,this.boxes.push(r),this.subBoxNames&&this.subBoxNames.indexOf(r.type)!=-1)this[this.subBoxNames[this.subBoxNames.indexOf(r.type)]+`s`].push(r);else{var a=r.type===`uuid`?r.uuid:r.type;this[a]?t.warn(`Box of type `+a+` already stored in field of this type`):this[a]=r}else return},c.Box.prototype.parseLanguage=function(e){this.language=e.readUint16();var t=[];t[0]=this.language>>10&31,t[1]=this.language>>5&31,t[2]=this.language&31,this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96)},c.SAMPLE_ENTRY_TYPE_VISUAL=`Visual`,c.SAMPLE_ENTRY_TYPE_AUDIO=`Audio`,c.SAMPLE_ENTRY_TYPE_HINT=`Hint`,c.SAMPLE_ENTRY_TYPE_METADATA=`Metadata`,c.SAMPLE_ENTRY_TYPE_SUBTITLE=`Subtitle`,c.SAMPLE_ENTRY_TYPE_SYSTEM=`System`,c.SAMPLE_ENTRY_TYPE_TEXT=`Text`,c.SampleEntry.prototype.parseHeader=function(e){e.readUint8Array(6),this.data_reference_index=e.readUint16(),this.hdr_size+=8},c.SampleEntry.prototype.parse=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},c.SampleEntry.prototype.parseDataAndRewind=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size),this.hdr_size-=8,e.position-=this.size-this.hdr_size},c.SampleEntry.prototype.parseFooter=function(e){c.ContainerBox.prototype.parse.call(this,e)},c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_HINT),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SYSTEM),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_TEXT),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,function(e){var t;this.parseHeader(e),e.readUint16(),e.readUint16(),e.readUint32Array(3),this.width=e.readUint16(),this.height=e.readUint16(),this.horizresolution=e.readUint32(),this.vertresolution=e.readUint32(),e.readUint32(),this.frame_count=e.readUint16(),t=Math.min(31,e.readUint8()),this.compressorname=e.readString(t),t<31&&e.readString(31-t),this.depth=e.readUint16(),e.readUint16(),this.parseFooter(e)}),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,function(e){this.parseHeader(e),e.readUint32Array(2),this.channel_count=e.readUint16(),this.samplesize=e.readUint16(),e.readUint16(),e.readUint16(),this.samplerate=e.readUint32()/65536,this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avc1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avc2`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avc3`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avc4`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`av01`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`dav1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`hvc1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`hev1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`hvt1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`lhe1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`dvh1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`dvhe`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vvc1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vvi1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vvs1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vvcN`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vp08`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vp09`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avs3`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`j2ki`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`mjp2`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`mjpg`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`uncv`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mp4a`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`ac-3`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`ac-4`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`ec-3`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`Opus`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mha1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mha2`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mhm1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mhm2`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`fLaC`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`encv`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`enca`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`encu`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SYSTEM,`encs`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_TEXT,`enct`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA,`encm`),c.createBoxCtor(`a1lx`,`AV1LayeredImageIndexingProperty`,function(e){var t=((e.readUint8()&1)+1)*16;this.layer_size=[];for(var n=0;n<3;n++)t==16?this.layer_size[n]=e.readUint16():this.layer_size[n]=e.readUint32()}),c.createBoxCtor(`a1op`,`OperatingPointSelectorProperty`,function(e){this.op_index=e.readUint8()}),c.createFullBoxCtor(`auxC`,`AuxiliaryTypeProperty`,function(e){this.aux_type=e.readCString();var t=this.size-this.hdr_size-(this.aux_type.length+1);this.aux_subtype=e.readUint8Array(t)}),c.createBoxCtor(`av1C`,`AV1CodecConfigurationBox`,function(e){var n=e.readUint8();if((n>>7&1)!=1){t.error(`av1C marker problem`);return}if(this.version=n&127,this.version!==1){t.error(`av1C version `+this.version+` not supported`);return}if(n=e.readUint8(),this.seq_profile=n>>5&7,this.seq_level_idx_0=n&31,n=e.readUint8(),this.seq_tier_0=n>>7&1,this.high_bitdepth=n>>6&1,this.twelve_bit=n>>5&1,this.monochrome=n>>4&1,this.chroma_subsampling_x=n>>3&1,this.chroma_subsampling_y=n>>2&1,this.chroma_sample_position=n&3,n=e.readUint8(),this.reserved_1=n>>5&7,this.reserved_1!==0){t.error(`av1C reserved_1 parsing problem`);return}if(this.initial_presentation_delay_present=n>>4&1,this.initial_presentation_delay_present===1)this.initial_presentation_delay_minus_one=n&15;else if(this.reserved_2=n&15,this.reserved_2!==0){t.error(`av1C reserved_2 parsing problem`);return}var r=this.size-this.hdr_size-4;this.configOBUs=e.readUint8Array(r)});function l(e){var t=`<table class='inner-table'>`;t+=`<thead><tr><th>length</th><th>nalu_data</th></tr></thead>`,t+=`<tbody>`;for(var n=0;n<e.length;n++){var r=e[n];t+=`<tr>`,t+=`<td>`+r.length+`</td>`,t+=`<td>`,t+=r.nalu.reduce(function(e,t){return e+t.toString(16).padStart(2,`0`)},`0x`),t+=`</td></tr>`}return t+=`</tbody></table>`,t}c.createBoxCtor(`avcC`,`AVCConfigurationBox`,function(e){var t,n;for(this.configurationVersion=e.readUint8(),this.AVCProfileIndication=e.readUint8(),this.profile_compatibility=e.readUint8(),this.AVCLevelIndication=e.readUint8(),this.lengthSizeMinusOne=e.readUint8()&3,this.nb_SPS_nalus=e.readUint8()&31,n=this.size-this.hdr_size-6,this.SPS=[],this.SPS.toString=function(){return l(this)},t=0;t<this.nb_SPS_nalus;t++)this.SPS[t]={},this.SPS[t].length=e.readUint16(),this.SPS[t].nalu=e.readUint8Array(this.SPS[t].length),n-=2+this.SPS[t].length;for(this.nb_PPS_nalus=e.readUint8(),n--,this.PPS=[],this.PPS.toString=function(){return l(this)},t=0;t<this.nb_PPS_nalus;t++)this.PPS[t]={},this.PPS[t].length=e.readUint16(),this.PPS[t].nalu=e.readUint8Array(this.PPS[t].length),n-=2+this.PPS[t].length;n>0&&(this.ext=e.readUint8Array(n))}),c.createBoxCtor(`btrt`,`BitRateBox`,function(e){this.bufferSizeDB=e.readUint32(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32()}),c.createFullBoxCtor(`ccst`,`CodingConstraintsBox`,function(e){var t=e.readUint8();this.all_ref_pics_intra=(t&128)==128,this.intra_pred_used=(t&64)==64,this.max_ref_per_pic=(t&63)>>2,e.readUint24()}),c.createBoxCtor(`cdef`,`ComponentDefinitionBox`,function(e){var t;for(this.channel_count=e.readUint16(),this.channel_indexes=[],this.channel_types=[],this.channel_associations=[],t=0;t<this.channel_count;t++)this.channel_indexes.push(e.readUint16()),this.channel_types.push(e.readUint16()),this.channel_associations.push(e.readUint16())}),c.createBoxCtor(`clap`,`CleanApertureBox`,function(e){this.cleanApertureWidthN=e.readUint32(),this.cleanApertureWidthD=e.readUint32(),this.cleanApertureHeightN=e.readUint32(),this.cleanApertureHeightD=e.readUint32(),this.horizOffN=e.readUint32(),this.horizOffD=e.readUint32(),this.vertOffN=e.readUint32(),this.vertOffD=e.readUint32()}),c.createBoxCtor(`clli`,`ContentLightLevelBox`,function(e){this.max_content_light_level=e.readUint16(),this.max_pic_average_light_level=e.readUint16()}),c.createFullBoxCtor(`cmex`,`CameraExtrinsicMatrixProperty`,function(e){this.flags&1&&(this.pos_x=e.readInt32()),this.flags&2&&(this.pos_y=e.readInt32()),this.flags&4&&(this.pos_z=e.readInt32()),this.flags&8&&(this.version==0?this.flags&16?(this.quat_x=e.readInt32(),this.quat_y=e.readInt32(),this.quat_z=e.readInt32()):(this.quat_x=e.readInt16(),this.quat_y=e.readInt16(),this.quat_z=e.readInt16()):this.version),this.flags&32&&(this.id=e.readUint32())}),c.createFullBoxCtor(`cmin`,`CameraIntrinsicMatrixProperty`,function(e){this.focal_length_x=e.readInt32(),this.principal_point_x=e.readInt32(),this.principal_point_y=e.readInt32(),this.flags&1&&(this.focal_length_y=e.readInt32(),this.skew_factor=e.readInt32())}),c.createBoxCtor(`cmpd`,`ComponentDefinitionBox`,function(e){for(this.component_count=e.readUint32(),this.component_types=[],this.component_type_urls=[],i=0;i<this.component_count;i++){var t=e.readUint16();this.component_types.push(t),t>=32768&&this.component_type_urls.push(e.readCString())}}),c.createFullBoxCtor(`co64`,`ChunkLargeOffsetBox`,function(e){var t=e.readUint32(),n;if(this.chunk_offsets=[],this.version===0)for(n=0;n<t;n++)this.chunk_offsets.push(e.readUint64())}),c.createFullBoxCtor(`CoLL`,`ContentLightLevelBox`,function(e){this.maxCLL=e.readUint16(),this.maxFALL=e.readUint16()}),c.createBoxCtor(`colr`,`ColourInformationBox`,function(e){if(this.colour_type=e.readString(4),this.colour_type===`nclx`){this.colour_primaries=e.readUint16(),this.transfer_characteristics=e.readUint16(),this.matrix_coefficients=e.readUint16();var t=e.readUint8();this.full_range_flag=t>>7}else (this.colour_type===`rICC`||this.colour_type===`prof`)&&(this.ICC_profile=e.readUint8Array(this.size-4))}),c.createFullBoxCtor(`cprt`,`CopyrightBox`,function(e){this.parseLanguage(e),this.notice=e.readCString()}),c.createFullBoxCtor(`cslg`,`CompositionToDecodeBox`,function(e){this.version===0&&(this.compositionToDTSShift=e.readInt32(),this.leastDecodeToDisplayDelta=e.readInt32(),this.greatestDecodeToDisplayDelta=e.readInt32(),this.compositionStartTime=e.readInt32(),this.compositionEndTime=e.readInt32())}),c.createFullBoxCtor(`ctts`,`CompositionOffsetBox`,function(e){var n=e.readUint32(),r;if(this.sample_counts=[],this.sample_offsets=[],this.version===0)for(r=0;r<n;r++){this.sample_counts.push(e.readUint32());var a=e.readInt32();a<0&&t.warn(`BoxParser`,`ctts box uses negative values without using version 1`),this.sample_offsets.push(a)}else if(this.version==1)for(r=0;r<n;r++)this.sample_counts.push(e.readUint32()),this.sample_offsets.push(e.readInt32())}),c.createBoxCtor(`dac3`,`AC3SpecificBox`,function(e){var t=e.readUint8(),n=e.readUint8(),r=e.readUint8();this.fscod=t>>6,this.bsid=t>>1&31,this.bsmod=(t&1)<<2|n>>6&3,this.acmod=n>>3&7,this.lfeon=n>>2&1,this.bit_rate_code=n&3|r>>5&7}),c.createBoxCtor(`dec3`,`EC3SpecificBox`,function(e){var t=e.readUint16();this.data_rate=t>>3,this.num_ind_sub=t&7,this.ind_subs=[];for(var n=0;n<this.num_ind_sub+1;n++){var r={};this.ind_subs.push(r);var a=e.readUint8(),o=e.readUint8(),s=e.readUint8();r.fscod=a>>6,r.bsid=a>>1&31,r.bsmod=(a&1)<<4|o>>4&15,r.acmod=o>>1&7,r.lfeon=o&1,r.num_dep_sub=s>>1&15,r.num_dep_sub>0&&(r.chan_loc=(s&1)<<8|e.readUint8())}}),c.createFullBoxCtor(`dfLa`,`FLACSpecificBox`,function(e){var t=127,n=128,r=[],a=[`STREAMINFO`,`PADDING`,`APPLICATION`,`SEEKTABLE`,`VORBIS_COMMENT`,`CUESHEET`,`PICTURE`,`RESERVED`];do{var o=e.readUint8(),s=Math.min(o&t,a.length-1);if(s?e.readUint8Array(e.readUint24()):(e.readUint8Array(13),this.samplerate=e.readUint32()>>12,e.readUint8Array(20)),r.push(a[s]),o&n)break}while(!0);this.numMetadataBlocks=r.length+` (`+r.join(`, `)+`)`}),c.createBoxCtor(`dimm`,`hintimmediateBytesSent`,function(e){this.bytessent=e.readUint64()}),c.createBoxCtor(`dmax`,`hintlongestpacket`,function(e){this.time=e.readUint32()}),c.createBoxCtor(`dmed`,`hintmediaBytesSent`,function(e){this.bytessent=e.readUint64()}),c.createBoxCtor(`dOps`,`OpusSpecificBox`,function(e){if(this.Version=e.readUint8(),this.OutputChannelCount=e.readUint8(),this.PreSkip=e.readUint16(),this.InputSampleRate=e.readUint32(),this.OutputGain=e.readInt16(),this.ChannelMappingFamily=e.readUint8(),this.ChannelMappingFamily!==0){this.StreamCount=e.readUint8(),this.CoupledCount=e.readUint8(),this.ChannelMapping=[];for(var t=0;t<this.OutputChannelCount;t++)this.ChannelMapping[t]=e.readUint8()}}),c.createFullBoxCtor(`dref`,`DataReferenceBox`,function(e){var t,n;this.entries=[];for(var r=e.readUint32(),a=0;a<r;a++)if(t=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),t.code===c.OK)n=t.box,this.entries.push(n);else return}),c.createBoxCtor(`drep`,`hintrepeatedBytesSent`,function(e){this.bytessent=e.readUint64()}),c.createFullBoxCtor(`elng`,`ExtendedLanguageBox`,function(e){this.extended_language=e.readString(this.size-this.hdr_size)}),c.createFullBoxCtor(`elst`,`EditListBox`,function(e){this.entries=[];for(var t=e.readUint32(),n=0;n<t;n++){var r={};this.entries.push(r),this.version===1?(r.segment_duration=e.readUint64(),r.media_time=e.readInt64()):(r.segment_duration=e.readUint32(),r.media_time=e.readInt32()),r.media_rate_integer=e.readInt16(),r.media_rate_fraction=e.readInt16()}}),c.createFullBoxCtor(`emsg`,`EventMessageBox`,function(e){this.version==1?(this.timescale=e.readUint32(),this.presentation_time=e.readUint64(),this.event_duration=e.readUint32(),this.id=e.readUint32(),this.scheme_id_uri=e.readCString(),this.value=e.readCString()):(this.scheme_id_uri=e.readCString(),this.value=e.readCString(),this.timescale=e.readUint32(),this.presentation_time_delta=e.readUint32(),this.event_duration=e.readUint32(),this.id=e.readUint32());var t=this.size-this.hdr_size-(16+(this.scheme_id_uri.length+1)+(this.value.length+1));this.version==1&&(t-=4),this.message_data=e.readUint8Array(t)}),c.createEntityToGroupCtor=function(e,t){c[e+`Box`]=function(t){c.FullBox.call(this,e,t)},c[e+`Box`].prototype=new c.FullBox,c[e+`Box`].prototype.parse=function(e){if(this.parseFullHeader(e),t)t.call(this,e);else for(this.group_id=e.readUint32(),this.num_entities_in_group=e.readUint32(),this.entity_ids=[],i=0;i<this.num_entities_in_group;i++){var n=e.readUint32();this.entity_ids.push(n)}}},c.createEntityToGroupCtor(`aebr`),c.createEntityToGroupCtor(`afbr`),c.createEntityToGroupCtor(`albc`),c.createEntityToGroupCtor(`altr`),c.createEntityToGroupCtor(`brst`),c.createEntityToGroupCtor(`dobr`),c.createEntityToGroupCtor(`eqiv`),c.createEntityToGroupCtor(`favc`),c.createEntityToGroupCtor(`fobr`),c.createEntityToGroupCtor(`iaug`),c.createEntityToGroupCtor(`pano`),c.createEntityToGroupCtor(`slid`),c.createEntityToGroupCtor(`ster`),c.createEntityToGroupCtor(`tsyn`),c.createEntityToGroupCtor(`wbbr`),c.createEntityToGroupCtor(`prgr`),c.createEntityToGroupCtor(`pymd`,function(e){this.group_id=e.readUint32(),this.num_entities_in_group=e.readUint32(),this.entity_ids=[];for(var t=0;t<this.num_entities_in_group;t++){var n=e.readUint32();this.entity_ids.push(n)}for(this.tile_size_x=e.readUint16(),this.tile_size_y=e.readUint16(),this.layer_binning=[],this.tiles_in_layer_column_minus1=[],this.tiles_in_layer_row_minus1=[],t=0;t<this.num_entities_in_group;t++)this.layer_binning[t]=e.readUint16(),this.tiles_in_layer_row_minus1[t]=e.readUint16(),this.tiles_in_layer_column_minus1[t]=e.readUint16()}),c.createFullBoxCtor(`esds`,`ElementaryStreamDescriptorBox`,function(e){var t=e.readUint8Array(this.size-this.hdr_size);if(s!==void 0){var n=new s;this.esd=n.parseOneDescriptor(new r(t.buffer,0,r.BIG_ENDIAN))}}),c.createBoxCtor(`fiel`,`FieldHandlingBox`,function(e){this.fieldCount=e.readUint8(),this.fieldOrdering=e.readUint8()}),c.createBoxCtor(`frma`,`OriginalFormatBox`,function(e){this.data_format=e.readString(4)}),c.createBoxCtor(`ftyp`,`FileTypeBox`,function(e){var t=this.size-this.hdr_size;this.major_brand=e.readString(4),this.minor_version=e.readUint32(),t-=8,this.compatible_brands=[];for(var n=0;t>=4;)this.compatible_brands[n]=e.readString(4),t-=4,n++}),c.createFullBoxCtor(`hdlr`,`HandlerBox`,function(e){this.version===0&&(e.readUint32(),this.handler=e.readString(4),e.readUint32Array(3),this.name=e.readString(this.size-this.hdr_size-20),this.name[this.name.length-1]===`\0`&&(this.name=this.name.slice(0,-1)))}),c.createBoxCtor(`hvcC`,`HEVCConfigurationBox`,function(e){var t,n,r,a;this.configurationVersion=e.readUint8(),a=e.readUint8(),this.general_profile_space=a>>6,this.general_tier_flag=(a&32)>>5,this.general_profile_idc=a&31,this.general_profile_compatibility=e.readUint32(),this.general_constraint_indicator=e.readUint8Array(6),this.general_level_idc=e.readUint8(),this.min_spatial_segmentation_idc=e.readUint16()&4095,this.parallelismType=e.readUint8()&3,this.chroma_format_idc=e.readUint8()&3,this.bit_depth_luma_minus8=e.readUint8()&7,this.bit_depth_chroma_minus8=e.readUint8()&7,this.avgFrameRate=e.readUint16(),a=e.readUint8(),this.constantFrameRate=a>>6,this.numTemporalLayers=(a&13)>>3,this.temporalIdNested=(a&4)>>2,this.lengthSizeMinusOne=a&3,this.nalu_arrays=[],this.nalu_arrays.toString=function(){var e=`<table class='inner-table'>`;e+=`<thead><tr><th>completeness</th><th>nalu_type</th><th>nalu_data</th></tr></thead>`,e+=`<tbody>`;for(var t=0;t<this.length;t++){var n=this[t];e+=`<tr>`,e+=`<td rowspan='`+n.length+`'>`+n.completeness+`</td>`,e+=`<td rowspan='`+n.length+`'>`+n.nalu_type+`</td>`;for(var r=0;r<n.length;r++){var a=n[r];r!==0&&(e+=`<tr>`),e+=`<td>`,e+=a.data.reduce(function(e,t){return e+t.toString(16).padStart(2,`0`)},`0x`),e+=`</td></tr>`}}return e+=`</tbody></table>`,e};var o=e.readUint8();for(t=0;t<o;t++){var s=[];this.nalu_arrays.push(s),a=e.readUint8(),s.completeness=(a&128)>>7,s.nalu_type=a&63;var c=e.readUint16();for(n=0;n<c;n++){var l={};s.push(l),r=e.readUint16(),l.data=e.readUint8Array(r)}}}),c.createFullBoxCtor(`iinf`,`ItemInfoBox`,function(e){var n;this.version===0?this.entry_count=e.readUint16():this.entry_count=e.readUint32(),this.item_infos=[];for(var r=0;r<this.entry_count;r++)if(n=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),n.code===c.OK)n.box.type!==`infe`&&t.error(`BoxParser`,`Expected 'infe' box, got `+n.box.type),this.item_infos[r]=n.box;else return}),c.createFullBoxCtor(`iloc`,`ItemLocationBox`,function(e){var t=e.readUint8();this.offset_size=t>>4&15,this.length_size=t&15,t=e.readUint8(),this.base_offset_size=t>>4&15,this.version===1||this.version===2?this.index_size=t&15:this.index_size=0,this.items=[];var n=0;if(this.version<2)n=e.readUint16();else if(this.version===2)n=e.readUint32();else throw`version of iloc box not supported`;for(var r=0;r<n;r++){var a={};if(this.items.push(a),this.version<2)a.item_ID=e.readUint16();else if(this.version===2)a.item_ID=e.readUint32();else throw`version of iloc box not supported`;switch(this.version===1||this.version===2?a.construction_method=e.readUint16()&15:a.construction_method=0,a.data_reference_index=e.readUint16(),this.base_offset_size){case 0:a.base_offset=0;break;case 4:a.base_offset=e.readUint32();break;case 8:a.base_offset=e.readUint64();break;default:throw`Error reading base offset size`}var o=e.readUint16();a.extents=[];for(var s=0;s<o;s++){var c={};if(a.extents.push(c),this.version===1||this.version===2)switch(this.index_size){case 0:c.extent_index=0;break;case 4:c.extent_index=e.readUint32();break;case 8:c.extent_index=e.readUint64();break;default:throw`Error reading extent index`}switch(this.offset_size){case 0:c.extent_offset=0;break;case 4:c.extent_offset=e.readUint32();break;case 8:c.extent_offset=e.readUint64();break;default:throw`Error reading extent index`}switch(this.length_size){case 0:c.extent_length=0;break;case 4:c.extent_length=e.readUint32();break;case 8:c.extent_length=e.readUint64();break;default:throw`Error reading extent index`}}}}),c.createBoxCtor(`imir`,`ImageMirror`,function(e){var t=e.readUint8();this.reserved=t>>7,this.axis=t&1}),c.createFullBoxCtor(`infe`,`ItemInfoEntry`,function(e){if((this.version===0||this.version===1)&&(this.item_ID=e.readUint16(),this.item_protection_index=e.readUint16(),this.item_name=e.readCString(),this.content_type=e.readCString(),this.content_encoding=e.readCString()),this.version===1){this.extension_type=e.readString(4),t.warn(`BoxParser`,`Cannot parse extension type`),e.seek(this.start+this.size);return}this.version>=2&&(this.version===2?this.item_ID=e.readUint16():this.version===3&&(this.item_ID=e.readUint32()),this.item_protection_index=e.readUint16(),this.item_type=e.readString(4),this.item_name=e.readCString(),this.item_type===`mime`?(this.content_type=e.readCString(),this.content_encoding=e.readCString()):this.item_type===`uri `&&(this.item_uri_type=e.readCString()))}),c.createFullBoxCtor(`ipma`,`ItemPropertyAssociationBox`,function(e){var t,n;for(entry_count=e.readUint32(),this.associations=[],t=0;t<entry_count;t++){var r={};this.associations.push(r),this.version<1?r.id=e.readUint16():r.id=e.readUint32();var a=e.readUint8();for(r.props=[],n=0;n<a;n++){var o=e.readUint8(),s={};r.props.push(s),s.essential=(o&128)>>7==1,this.flags&1?s.property_index=(o&127)<<8|e.readUint8():s.property_index=o&127}}}),c.createFullBoxCtor(`iref`,`ItemReferenceBox`,function(e){var n,r;for(this.references=[];e.getPosition()<this.start+this.size;)if(n=c.parseOneBox(e,!0,this.size-(e.getPosition()-this.start)),n.code===c.OK)r=this.version===0?new c.SingleItemTypeReferenceBox(n.type,n.size,n.hdr_size,n.start):new c.SingleItemTypeReferenceBoxLarge(n.type,n.size,n.hdr_size,n.start),r.write===c.Box.prototype.write&&r.type!==`mdat`&&(t.warn(`BoxParser`,r.type+` box writing not yet implemented, keeping unparsed data in memory for later write`),r.parseDataAndRewind(e)),r.parse(e),this.references.push(r);else return}),c.createBoxCtor(`irot`,`ImageRotation`,function(e){this.angle=e.readUint8()&3}),c.createFullBoxCtor(`ispe`,`ImageSpatialExtentsProperty`,function(e){this.image_width=e.readUint32(),this.image_height=e.readUint32()}),c.createFullBoxCtor(`kind`,`KindBox`,function(e){this.schemeURI=e.readCString(),this.value=e.readCString()}),c.createFullBoxCtor(`leva`,`LevelAssignmentBox`,function(e){var n=e.readUint8();this.levels=[];for(var r=0;r<n;r++){var a={};this.levels[r]=a,a.track_ID=e.readUint32();var o=e.readUint8();switch(a.padding_flag=o>>7,a.assignment_type=o&127,a.assignment_type){case 0:a.grouping_type=e.readString(4);break;case 1:a.grouping_type=e.readString(4),a.grouping_type_parameter=e.readUint32();break;case 2:break;case 3:break;case 4:a.sub_track_id=e.readUint32();break;default:t.warn(`BoxParser`,`Unknown leva assignement type`)}}}),c.createBoxCtor(`lhvC`,`LHEVCConfigurationBox`,function(e){var t,n,r;this.configurationVersion=e.readUint8(),this.min_spatial_segmentation_idc=e.readUint16()&4095,this.parallelismType=e.readUint8()&3,r=e.readUint8(),this.numTemporalLayers=(r&13)>>3,this.temporalIdNested=(r&4)>>2,this.lengthSizeMinusOne=r&3,this.nalu_arrays=[],this.nalu_arrays.toString=function(){var e=`<table class='inner-table'>`;e+=`<thead><tr><th>completeness</th><th>nalu_type</th><th>nalu_data</th></tr></thead>`,e+=`<tbody>`;for(var t=0;t<this.length;t++){var n=this[t];e+=`<tr>`,e+=`<td rowspan='`+n.length+`'>`+n.completeness+`</td>`,e+=`<td rowspan='`+n.length+`'>`+n.nalu_type+`</td>`;for(var r=0;r<n.length;r++){var a=n[r];r!==0&&(e+=`<tr>`),e+=`<td>`,e+=a.data.reduce(function(e,t){return e+t.toString(16).padStart(2,`0`)},`0x`),e+=`</td></tr>`}}return e+=`</tbody></table>`,e};var a=e.readUint8();for(t=0;t<a;t++){var o=[];this.nalu_arrays.push(o),r=e.readUint8(),o.completeness=(r&128)>>7,o.nalu_type=r&63;var s=e.readUint16();for(n=0;n<s;n++){var c={};o.push(c);var l=e.readUint16();c.data=e.readUint8Array(l)}}}),c.createBoxCtor(`lsel`,`LayerSelectorProperty`,function(e){this.layer_id=e.readUint16()}),c.createBoxCtor(`maxr`,`hintmaxrate`,function(e){this.period=e.readUint32(),this.bytes=e.readUint32()});function u(e,t){this.x=e,this.y=t}u.prototype.toString=function(){return`(`+this.x+`,`+this.y+`)`},c.createBoxCtor(`mdcv`,`MasteringDisplayColourVolumeBox`,function(e){this.display_primaries=[],this.display_primaries[0]=new u(e.readUint16(),e.readUint16()),this.display_primaries[1]=new u(e.readUint16(),e.readUint16()),this.display_primaries[2]=new u(e.readUint16(),e.readUint16()),this.white_point=new u(e.readUint16(),e.readUint16()),this.max_display_mastering_luminance=e.readUint32(),this.min_display_mastering_luminance=e.readUint32()}),c.createFullBoxCtor(`mdhd`,`MediaHeaderBox`,function(e){this.version==1?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.parseLanguage(e),e.readUint16()}),c.createFullBoxCtor(`mehd`,`MovieExtendsHeaderBox`,function(e){this.flags&1&&(t.warn(`BoxParser`,`mehd box incorrectly uses flags set to 1, converting version to 1`),this.version=1),this.version==1?this.fragment_duration=e.readUint64():this.fragment_duration=e.readUint32()}),c.createFullBoxCtor(`meta`,`MetaBox`,function(e){this.boxes=[],c.ContainerBox.prototype.parse.call(this,e)}),c.createFullBoxCtor(`mfhd`,`MovieFragmentHeaderBox`,function(e){this.sequence_number=e.readUint32()}),c.createFullBoxCtor(`mfro`,`MovieFragmentRandomAccessOffsetBox`,function(e){this._size=e.readUint32()}),c.createFullBoxCtor(`mskC`,`MaskConfigurationProperty`,function(e){this.bits_per_pixel=e.readUint8()}),c.createFullBoxCtor(`mvhd`,`MovieHeaderBox`,function(e){this.version==1?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.rate=e.readUint32(),this.volume=e.readUint16()>>8,e.readUint16(),e.readUint32Array(2),this.matrix=e.readUint32Array(9),e.readUint32Array(6),this.next_track_id=e.readUint32()}),c.createBoxCtor(`npck`,`hintPacketsSent`,function(e){this.packetssent=e.readUint32()}),c.createBoxCtor(`nump`,`hintPacketsSent`,function(e){this.packetssent=e.readUint64()}),c.createFullBoxCtor(`padb`,`PaddingBitsBox`,function(e){var t=e.readUint32();this.padbits=[];for(var n=0;n<Math.floor((t+1)/2);n++)this.padbits=e.readUint8()}),c.createBoxCtor(`pasp`,`PixelAspectRatioBox`,function(e){this.hSpacing=e.readUint32(),this.vSpacing=e.readUint32()}),c.createBoxCtor(`payl`,`CuePayloadBox`,function(e){this.text=e.readString(this.size-this.hdr_size)}),c.createBoxCtor(`payt`,`hintpayloadID`,function(e){this.payloadID=e.readUint32();var t=e.readUint8();this.rtpmap_string=e.readString(t)}),c.createFullBoxCtor(`pdin`,`ProgressiveDownloadInfoBox`,function(e){var t=(this.size-this.hdr_size)/8;this.rate=[],this.initial_delay=[];for(var n=0;n<t;n++)this.rate[n]=e.readUint32(),this.initial_delay[n]=e.readUint32()}),c.createFullBoxCtor(`pitm`,`PrimaryItemBox`,function(e){this.version===0?this.item_id=e.readUint16():this.item_id=e.readUint32()}),c.createFullBoxCtor(`pixi`,`PixelInformationProperty`,function(e){var t;for(this.num_channels=e.readUint8(),this.bits_per_channels=[],t=0;t<this.num_channels;t++)this.bits_per_channels[t]=e.readUint8()}),c.createBoxCtor(`pmax`,`hintlargestpacket`,function(e){this.bytes=e.readUint32()}),c.createFullBoxCtor(`prdi`,`ProgressiveDerivedImageItemInformationProperty`,function(e){if(this.step_count=e.readUint16(),this.item_count=[],this.flags&2)for(var t=0;t<this.step_count;t++)this.item_count[t]=e.readUint16()}),c.createFullBoxCtor(`prft`,`ProducerReferenceTimeBox`,function(e){this.ref_track_id=e.readUint32(),this.ntp_timestamp=e.readUint64(),this.version===0?this.media_time=e.readUint32():this.media_time=e.readUint64()}),c.createFullBoxCtor(`pssh`,`ProtectionSystemSpecificHeaderBox`,function(e){if(this.system_id=c.parseHex16(e),this.version>0){var t=e.readUint32();this.kid=[];for(var n=0;n<t;n++)this.kid[n]=c.parseHex16(e)}var r=e.readUint32();r>0&&(this.data=e.readUint8Array(r))}),c.createFullBoxCtor(`clef`,`TrackCleanApertureDimensionsBox`,function(e){this.width=e.readUint32(),this.height=e.readUint32()}),c.createFullBoxCtor(`enof`,`TrackEncodedPixelsDimensionsBox`,function(e){this.width=e.readUint32(),this.height=e.readUint32()}),c.createFullBoxCtor(`prof`,`TrackProductionApertureDimensionsBox`,function(e){this.width=e.readUint32(),this.height=e.readUint32()}),c.createContainerBoxCtor(`tapt`,`TrackApertureModeDimensionsBox`,null,[`clef`,`prof`,`enof`]),c.createBoxCtor(`rtp `,`rtpmoviehintinformation`,function(e){this.descriptionformat=e.readString(4),this.sdptext=e.readString(this.size-this.hdr_size-4)}),c.createFullBoxCtor(`saio`,`SampleAuxiliaryInformationOffsetsBox`,function(e){this.flags&1&&(this.aux_info_type=e.readString(4),this.aux_info_type_parameter=e.readUint32());var t=e.readUint32();this.offset=[];for(var n=0;n<t;n++)this.version===0?this.offset[n]=e.readUint32():this.offset[n]=e.readUint64()}),c.createFullBoxCtor(`saiz`,`SampleAuxiliaryInformationSizesBox`,function(e){if(this.flags&1&&(this.aux_info_type=e.readString(4),this.aux_info_type_parameter=e.readUint32()),this.default_sample_info_size=e.readUint8(),this.sample_count=e.readUint32(),this.sample_info_size=[],this.default_sample_info_size===0)for(var t=0;t<this.sample_count;t++)this.sample_info_size[t]=e.readUint8()}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA,`mett`,function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA,`metx`,function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.namespace=e.readCString(),this.schema_location=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`sbtt`,function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`stpp`,function(e){this.parseHeader(e),this.namespace=e.readCString(),this.schema_location=e.readCString(),this.auxiliary_mime_types=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`stxt`,function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`tx3g`,function(e){this.parseHeader(e),this.displayFlags=e.readUint32(),this.horizontal_justification=e.readInt8(),this.vertical_justification=e.readInt8(),this.bg_color_rgba=e.readUint8Array(4),this.box_record=e.readInt16Array(4),this.style_record=e.readUint8Array(12),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA,`wvtt`,function(e){this.parseHeader(e),this.parseFooter(e)}),c.createSampleGroupCtor(`alst`,function(e){var t,n=e.readUint16();for(this.first_output_sample=e.readUint16(),this.sample_offset=[],t=0;t<n;t++)this.sample_offset[t]=e.readUint32();var r=this.description_length-4-4*n;for(this.num_output_samples=[],this.num_total_samples=[],t=0;t<r/4;t++)this.num_output_samples[t]=e.readUint16(),this.num_total_samples[t]=e.readUint16()}),c.createSampleGroupCtor(`avll`,function(e){this.layerNumber=e.readUint8(),this.accurateStatisticsFlag=e.readUint8(),this.avgBitRate=e.readUint16(),this.avgFrameRate=e.readUint16()}),c.createSampleGroupCtor(`avss`,function(e){this.subSequenceIdentifier=e.readUint16(),this.layerNumber=e.readUint8();var t=e.readUint8();this.durationFlag=t>>7,this.avgRateFlag=t>>6&1,this.durationFlag&&(this.duration=e.readUint32()),this.avgRateFlag&&(this.accurateStatisticsFlag=e.readUint8(),this.avgBitRate=e.readUint16(),this.avgFrameRate=e.readUint16()),this.dependency=[];for(var n=e.readUint8(),r=0;r<n;r++){var a={};this.dependency.push(a),a.subSeqDirectionFlag=e.readUint8(),a.layerNumber=e.readUint8(),a.subSequenceIdentifier=e.readUint16()}}),c.createSampleGroupCtor(`dtrt`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`mvif`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`prol`,function(e){this.roll_distance=e.readInt16()}),c.createSampleGroupCtor(`rap `,function(e){var t=e.readUint8();this.num_leading_samples_known=t>>7,this.num_leading_samples=t&127}),c.createSampleGroupCtor(`rash`,function(e){if(this.operation_point_count=e.readUint16(),this.description_length!==2+(this.operation_point_count===1?2:this.operation_point_count*6)+9)t.warn(`BoxParser`,`Mismatch in `+this.grouping_type+` sample group length`),this.data=e.readUint8Array(this.description_length-2);else{if(this.operation_point_count===1)this.target_rate_share=e.readUint16();else{this.target_rate_share=[],this.available_bitrate=[];for(var n=0;n<this.operation_point_count;n++)this.available_bitrate[n]=e.readUint32(),this.target_rate_share[n]=e.readUint16()}this.maximum_bitrate=e.readUint32(),this.minimum_bitrate=e.readUint32(),this.discard_priority=e.readUint8()}}),c.createSampleGroupCtor(`roll`,function(e){this.roll_distance=e.readInt16()}),c.SampleGroupEntry.prototype.parse=function(e){t.warn(`BoxParser`,`Unknown Sample Group type: `+this.grouping_type),this.data=e.readUint8Array(this.description_length)},c.createSampleGroupCtor(`scif`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`scnm`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`seig`,function(e){this.reserved=e.readUint8();var t=e.readUint8();this.crypt_byte_block=t>>4,this.skip_byte_block=t&15,this.isProtected=e.readUint8(),this.Per_Sample_IV_Size=e.readUint8(),this.KID=c.parseHex16(e),this.constant_IV_size=0,this.constant_IV=0,this.isProtected===1&&this.Per_Sample_IV_Size===0&&(this.constant_IV_size=e.readUint8(),this.constant_IV=e.readUint8Array(this.constant_IV_size))}),c.createSampleGroupCtor(`stsa`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`sync`,function(e){var t=e.readUint8();this.NAL_unit_type=t&63}),c.createSampleGroupCtor(`tele`,function(e){var t=e.readUint8();this.level_independently_decodable=t>>7}),c.createSampleGroupCtor(`tsas`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`tscl`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`vipr`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createFullBoxCtor(`sbgp`,`SampleToGroupBox`,function(e){this.grouping_type=e.readString(4),this.version===1?this.grouping_type_parameter=e.readUint32():this.grouping_type_parameter=0,this.entries=[];for(var t=e.readUint32(),n=0;n<t;n++){var r={};this.entries.push(r),r.sample_count=e.readInt32(),r.group_description_index=e.readInt32()}});function d(e,t){this.bad_pixel_row=e,this.bad_pixel_column=t}d.prototype.toString=function(){return`[row: `+this.bad_pixel_row+`, column: `+this.bad_pixel_column+`]`},c.createFullBoxCtor(`sbpm`,`SensorBadPixelsMapBox`,function(e){var t;for(this.component_count=e.readUint16(),this.component_index=[],t=0;t<this.component_count;t++)this.component_index.push(e.readUint16());var n=e.readUint8();for(this.correction_applied=(n&128)==128,this.num_bad_rows=e.readUint32(),this.num_bad_cols=e.readUint32(),this.num_bad_pixels=e.readUint32(),this.bad_rows=[],this.bad_columns=[],this.bad_pixels=[],t=0;t<this.num_bad_rows;t++)this.bad_rows.push(e.readUint32());for(t=0;t<this.num_bad_cols;t++)this.bad_columns.push(e.readUint32());for(t=0;t<this.num_bad_pixels;t++){var r=e.readUint32(),a=e.readUint32();this.bad_pixels.push(new d(r,a))}}),c.createFullBoxCtor(`schm`,`SchemeTypeBox`,function(e){this.scheme_type=e.readString(4),this.scheme_version=e.readUint32(),this.flags&1&&(this.scheme_uri=e.readString(this.size-this.hdr_size-8))}),c.createBoxCtor(`sdp `,`rtptracksdphintinformation`,function(e){this.sdptext=e.readString(this.size-this.hdr_size)}),c.createFullBoxCtor(`sdtp`,`SampleDependencyTypeBox`,function(e){var t,n=this.size-this.hdr_size;this.is_leading=[],this.sample_depends_on=[],this.sample_is_depended_on=[],this.sample_has_redundancy=[];for(var r=0;r<n;r++)t=e.readUint8(),this.is_leading[r]=t>>6,this.sample_depends_on[r]=t>>4&3,this.sample_is_depended_on[r]=t>>2&3,this.sample_has_redundancy[r]=t&3}),c.createFullBoxCtor(`senc`,`SampleEncryptionBox`),c.createFullBoxCtor(`sgpd`,`SampleGroupDescriptionBox`,function(e){this.grouping_type=e.readString(4),t.debug(`BoxParser`,`Found Sample Groups of type `+this.grouping_type),this.version===1?this.default_length=e.readUint32():this.default_length=0,this.version>=2&&(this.default_group_description_index=e.readUint32()),this.entries=[];for(var n=e.readUint32(),r=0;r<n;r++){var a=c[this.grouping_type+`SampleGroupEntry`]?new c[this.grouping_type+`SampleGroupEntry`](this.grouping_type):new c.SampleGroupEntry(this.grouping_type);this.entries.push(a),this.version===1&&this.default_length===0?a.description_length=e.readUint32():a.description_length=this.default_length,a.write===c.SampleGroupEntry.prototype.write&&(t.info(`BoxParser`,`SampleGroup for type `+this.grouping_type+` writing not yet implemented, keeping unparsed data in memory for later write`),a.data=e.readUint8Array(a.description_length),e.position-=a.description_length),a.parse(e)}}),c.createFullBoxCtor(`sidx`,`CompressedSegmentIndexBox`,function(e){this.reference_ID=e.readUint32(),this.timescale=e.readUint32(),this.version===0?(this.earliest_presentation_time=e.readUint32(),this.first_offset=e.readUint32()):(this.earliest_presentation_time=e.readUint64(),this.first_offset=e.readUint64()),e.readUint16(),this.references=[];for(var t=e.readUint16(),n=0;n<t;n++){var r={};this.references.push(r);var a=e.readUint32();r.reference_type=a>>31&1,r.referenced_size=a&2147483647,r.subsegment_duration=e.readUint32(),a=e.readUint32(),r.starts_with_SAP=a>>31&1,r.SAP_type=a>>28&7,r.SAP_delta_time=a&268435455}}),c.SingleItemTypeReferenceBox=function(e,t,n,r){c.Box.call(this,e,t),this.hdr_size=n,this.start=r},c.SingleItemTypeReferenceBox.prototype=new c.Box,c.SingleItemTypeReferenceBox.prototype.parse=function(e){this.from_item_ID=e.readUint16();var t=e.readUint16();this.references=[];for(var n=0;n<t;n++)this.references[n]={},this.references[n].to_item_ID=e.readUint16()},c.SingleItemTypeReferenceBoxLarge=function(e,t,n,r){c.Box.call(this,e,t),this.hdr_size=n,this.start=r},c.SingleItemTypeReferenceBoxLarge.prototype=new c.Box,c.SingleItemTypeReferenceBoxLarge.prototype.parse=function(e){this.from_item_ID=e.readUint32();var t=e.readUint16();this.references=[];for(var n=0;n<t;n++)this.references[n]={},this.references[n].to_item_ID=e.readUint32()},c.createFullBoxCtor(`SmDm`,`SMPTE2086MasteringDisplayMetadataBox`,function(e){this.primaryRChromaticity_x=e.readUint16(),this.primaryRChromaticity_y=e.readUint16(),this.primaryGChromaticity_x=e.readUint16(),this.primaryGChromaticity_y=e.readUint16(),this.primaryBChromaticity_x=e.readUint16(),this.primaryBChromaticity_y=e.readUint16(),this.whitePointChromaticity_x=e.readUint16(),this.whitePointChromaticity_y=e.readUint16(),this.luminanceMax=e.readUint32(),this.luminanceMin=e.readUint32()}),c.createFullBoxCtor(`smhd`,`SoundMediaHeaderBox`,function(e){this.balance=e.readUint16(),e.readUint16()}),c.createFullBoxCtor(`ssix`,`CompressedSubsegmentIndexBox`,function(e){this.subsegments=[];for(var t=e.readUint32(),n=0;n<t;n++){var r={};this.subsegments.push(r),r.ranges=[];for(var a=e.readUint32(),o=0;o<a;o++){var s={};r.ranges.push(s),s.level=e.readUint8(),s.range_size=e.readUint24()}}}),c.createFullBoxCtor(`stco`,`ChunkOffsetBox`,function(e){var t=e.readUint32();if(this.chunk_offsets=[],this.version===0)for(var n=0;n<t;n++)this.chunk_offsets.push(e.readUint32())}),c.createFullBoxCtor(`stdp`,`DegradationPriorityBox`,function(e){var t=(this.size-this.hdr_size)/2;this.priority=[];for(var n=0;n<t;n++)this.priority[n]=e.readUint16()}),c.createFullBoxCtor(`sthd`,`SubtitleMediaHeaderBox`),c.createFullBoxCtor(`stri`,`SubTrackInformationBox`,function(e){this.switch_group=e.readUint16(),this.alternate_group=e.readUint16(),this.sub_track_id=e.readUint32();var t=(this.size-this.hdr_size-8)/4;this.attribute_list=[];for(var n=0;n<t;n++)this.attribute_list[n]=e.readUint32()}),c.createFullBoxCtor(`stsc`,`SampleToChunkBox`,function(e){var t=e.readUint32(),n;if(this.first_chunk=[],this.samples_per_chunk=[],this.sample_description_index=[],this.version===0)for(n=0;n<t;n++)this.first_chunk.push(e.readUint32()),this.samples_per_chunk.push(e.readUint32()),this.sample_description_index.push(e.readUint32())}),c.createFullBoxCtor(`stsd`,`SampleDescriptionBox`,function(e){var n,r,a,o;for(this.entries=[],a=e.readUint32(),n=1;n<=a;n++)if(r=c.parseOneBox(e,!0,this.size-(e.getPosition()-this.start)),r.code===c.OK)c[r.type+`SampleEntry`]?(o=new c[r.type+`SampleEntry`](r.size),o.hdr_size=r.hdr_size,o.start=r.start):(t.warn(`BoxParser`,`Unknown sample entry type: `+r.type),o=new c.SampleEntry(r.type,r.size,r.hdr_size,r.start)),o.write===c.SampleEntry.prototype.write&&(t.info(`BoxParser`,`SampleEntry `+o.type+` box writing not yet implemented, keeping unparsed data in memory for later write`),o.parseDataAndRewind(e)),o.parse(e),this.entries.push(o);else return}),c.createFullBoxCtor(`stsg`,`SubTrackSampleGroupBox`,function(e){this.grouping_type=e.readUint32();var t=e.readUint16();this.group_description_index=[];for(var n=0;n<t;n++)this.group_description_index[n]=e.readUint32()}),c.createFullBoxCtor(`stsh`,`ShadowSyncSampleBox`,function(e){var t=e.readUint32(),n;if(this.shadowed_sample_numbers=[],this.sync_sample_numbers=[],this.version===0)for(n=0;n<t;n++)this.shadowed_sample_numbers.push(e.readUint32()),this.sync_sample_numbers.push(e.readUint32())}),c.createFullBoxCtor(`stss`,`SyncSampleBox`,function(e){var t,n=e.readUint32();if(this.version===0)for(this.sample_numbers=[],t=0;t<n;t++)this.sample_numbers.push(e.readUint32())}),c.createFullBoxCtor(`stsz`,`SampleSizeBox`,function(e){var t;if(this.sample_sizes=[],this.version===0)for(this.sample_size=e.readUint32(),this.sample_count=e.readUint32(),t=0;t<this.sample_count;t++)this.sample_size===0?this.sample_sizes.push(e.readUint32()):this.sample_sizes[t]=this.sample_size}),c.createFullBoxCtor(`stts`,`TimeToSampleBox`,function(e){var n=e.readUint32(),r,a;if(this.sample_counts=[],this.sample_deltas=[],this.version===0)for(r=0;r<n;r++)this.sample_counts.push(e.readUint32()),a=e.readInt32(),a<0&&(t.warn(`BoxParser`,`File uses negative stts sample delta, using value 1 instead, sync may be lost!`),a=1),this.sample_deltas.push(a)}),c.createFullBoxCtor(`stvi`,`StereoVideoBox`,function(e){var t=e.readUint32();this.single_view_allowed=t&3,this.stereo_scheme=e.readUint32();var n=e.readUint32();this.stereo_indication_type=e.readString(n);var r,a;for(this.boxes=[];e.getPosition()<this.start+this.size;)if(r=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),r.code===c.OK)a=r.box,this.boxes.push(a),this[a.type]=a;else return}),c.createBoxCtor(`styp`,`SegmentTypeBox`,function(e){c.ftypBox.prototype.parse.call(this,e)}),c.createFullBoxCtor(`stz2`,`CompactSampleSizeBox`,function(e){var n,r;if(this.sample_sizes=[],this.version===0)if(this.reserved=e.readUint24(),this.field_size=e.readUint8(),r=e.readUint32(),this.field_size===4)for(n=0;n<r;n+=2){var a=e.readUint8();this.sample_sizes[n]=a>>4&15,this.sample_sizes[n+1]=a&15}else if(this.field_size===8)for(n=0;n<r;n++)this.sample_sizes[n]=e.readUint8();else if(this.field_size===16)for(n=0;n<r;n++)this.sample_sizes[n]=e.readUint16();else t.error(`BoxParser`,`Error in length field in stz2 box`)}),c.createFullBoxCtor(`subs`,`SubSampleInformationBox`,function(e){var t,n,r=e.readUint32(),a;for(this.entries=[],t=0;t<r;t++){var o={};if(this.entries[t]=o,o.sample_delta=e.readUint32(),o.subsamples=[],a=e.readUint16(),a>0)for(n=0;n<a;n++){var s={};o.subsamples.push(s),this.version==1?s.size=e.readUint32():s.size=e.readUint16(),s.priority=e.readUint8(),s.discardable=e.readUint8(),s.codec_specific_parameters=e.readUint32()}}}),c.createFullBoxCtor(`tenc`,`TrackEncryptionBox`,function(e){if(e.readUint8(),this.version===0)e.readUint8();else{var t=e.readUint8();this.default_crypt_byte_block=t>>4&15,this.default_skip_byte_block=t&15}this.default_isProtected=e.readUint8(),this.default_Per_Sample_IV_Size=e.readUint8(),this.default_KID=c.parseHex16(e),this.default_isProtected===1&&this.default_Per_Sample_IV_Size===0&&(this.default_constant_IV_size=e.readUint8(),this.default_constant_IV=e.readUint8Array(this.default_constant_IV_size))}),c.createFullBoxCtor(`tfdt`,`TrackFragmentBaseMediaDecodeTimeBox`,function(e){this.version==1?this.baseMediaDecodeTime=e.readUint64():this.baseMediaDecodeTime=e.readUint32()}),c.createFullBoxCtor(`tfhd`,`TrackFragmentHeaderBox`,function(e){var t=0;this.track_id=e.readUint32(),this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_BASE_DATA_OFFSET?(this.base_data_offset=e.readUint64(),t+=8):this.base_data_offset=0,this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_SAMPLE_DESC?(this.default_sample_description_index=e.readUint32(),t+=4):this.default_sample_description_index=0,this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_SAMPLE_DUR?(this.default_sample_duration=e.readUint32(),t+=4):this.default_sample_duration=0,this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_SAMPLE_SIZE?(this.default_sample_size=e.readUint32(),t+=4):this.default_sample_size=0,this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_SAMPLE_FLAGS?(this.default_sample_flags=e.readUint32(),t+=4):this.default_sample_flags=0}),c.createFullBoxCtor(`tfra`,`TrackFragmentRandomAccessBox`,function(e){this.track_ID=e.readUint32(),e.readUint24();var t=e.readUint8();this.length_size_of_traf_num=t>>4&3,this.length_size_of_trun_num=t>>2&3,this.length_size_of_sample_num=t&3,this.entries=[];for(var n=e.readUint32(),r=0;r<n;r++)this.version===1?(this.time=e.readUint64(),this.moof_offset=e.readUint64()):(this.time=e.readUint32(),this.moof_offset=e.readUint32()),this.traf_number=e[`readUint`+8*(this.length_size_of_traf_num+1)](),this.trun_number=e[`readUint`+8*(this.length_size_of_trun_num+1)](),this.sample_number=e[`readUint`+8*(this.length_size_of_sample_num+1)]()}),c.createFullBoxCtor(`tkhd`,`TrackHeaderBox`,function(e){this.version==1?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.track_id=e.readUint32(),e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.track_id=e.readUint32(),e.readUint32(),this.duration=e.readUint32()),e.readUint32Array(2),this.layer=e.readInt16(),this.alternate_group=e.readInt16(),this.volume=e.readInt16()>>8,e.readUint16(),this.matrix=e.readInt32Array(9),this.width=e.readUint32(),this.height=e.readUint32()}),c.createBoxCtor(`tmax`,`hintmaxrelativetime`,function(e){this.time=e.readUint32()}),c.createBoxCtor(`tmin`,`hintminrelativetime`,function(e){this.time=e.readUint32()}),c.createBoxCtor(`totl`,`hintBytesSent`,function(e){this.bytessent=e.readUint32()}),c.createBoxCtor(`tpay`,`hintBytesSent`,function(e){this.bytessent=e.readUint32()}),c.createBoxCtor(`tpyl`,`hintBytesSent`,function(e){this.bytessent=e.readUint64()}),c.TrackGroupTypeBox.prototype.parse=function(e){this.parseFullHeader(e),this.track_group_id=e.readUint32()},c.createTrackGroupCtor(`msrc`),c.TrackReferenceTypeBox=function(e,t,n,r){c.Box.call(this,e,t),this.hdr_size=n,this.start=r},c.TrackReferenceTypeBox.prototype=new c.Box,c.TrackReferenceTypeBox.prototype.parse=function(e){this.track_ids=e.readUint32Array((this.size-this.hdr_size)/4)},c.trefBox.prototype.parse=function(e){for(var n,r;e.getPosition()<this.start+this.size;)if(n=c.parseOneBox(e,!0,this.size-(e.getPosition()-this.start)),n.code===c.OK)r=new c.TrackReferenceTypeBox(n.type,n.size,n.hdr_size,n.start),r.write===c.Box.prototype.write&&r.type!==`mdat`&&(t.info(`BoxParser`,`TrackReference `+r.type+` box writing not yet implemented, keeping unparsed data in memory for later write`),r.parseDataAndRewind(e)),r.parse(e),this.boxes.push(r);else return},c.createFullBoxCtor(`trep`,`TrackExtensionPropertiesBox`,function(e){for(this.track_ID=e.readUint32(),this.boxes=[];e.getPosition()<this.start+this.size;)if(ret=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),ret.code===c.OK)box=ret.box,this.boxes.push(box);else return}),c.createFullBoxCtor(`trex`,`TrackExtendsBox`,function(e){this.track_id=e.readUint32(),this.default_sample_description_index=e.readUint32(),this.default_sample_duration=e.readUint32(),this.default_sample_size=e.readUint32(),this.default_sample_flags=e.readUint32()}),c.createBoxCtor(`trpy`,`hintBytesSent`,function(e){this.bytessent=e.readUint64()}),c.createFullBoxCtor(`trun`,`TrackRunBox`,function(e){var t=0;if(this.sample_count=e.readUint32(),t+=4,this.size-this.hdr_size>t&&this.flags&c.TRUN_FLAGS_DATA_OFFSET?(this.data_offset=e.readInt32(),t+=4):this.data_offset=0,this.size-this.hdr_size>t&&this.flags&c.TRUN_FLAGS_FIRST_FLAG?(this.first_sample_flags=e.readUint32(),t+=4):this.first_sample_flags=0,this.sample_duration=[],this.sample_size=[],this.sample_flags=[],this.sample_composition_time_offset=[],this.size-this.hdr_size>t)for(var n=0;n<this.sample_count;n++)this.flags&c.TRUN_FLAGS_DURATION&&(this.sample_duration[n]=e.readUint32()),this.flags&c.TRUN_FLAGS_SIZE&&(this.sample_size[n]=e.readUint32()),this.flags&c.TRUN_FLAGS_FLAGS&&(this.sample_flags[n]=e.readUint32()),this.flags&c.TRUN_FLAGS_CTS_OFFSET&&(this.version===0?this.sample_composition_time_offset[n]=e.readUint32():this.sample_composition_time_offset[n]=e.readInt32())}),c.createFullBoxCtor(`tsel`,`TrackSelectionBox`,function(e){this.switch_group=e.readUint32();var t=(this.size-this.hdr_size-4)/4;this.attribute_list=[];for(var n=0;n<t;n++)this.attribute_list[n]=e.readUint32()}),c.createFullBoxCtor(`txtC`,`TextConfigBox`,function(e){this.config=e.readCString()}),c.createBoxCtor(`tyco`,`TypeCombinationBox`,function(e){var t=(this.size-this.hdr_size)/4;this.compatible_brands=[];for(var n=0;n<t;n++)this.compatible_brands[n]=e.readString(4)}),c.createFullBoxCtor(`udes`,`UserDescriptionProperty`,function(e){this.lang=e.readCString(),this.name=e.readCString(),this.description=e.readCString(),this.tags=e.readCString()}),c.createFullBoxCtor(`uncC`,`UncompressedFrameConfigBox`,function(e){var t;if(this.profile=e.readString(4),this.version!=1&&this.version==0){for(this.component_count=e.readUint32(),this.component_index=[],this.component_bit_depth_minus_one=[],this.component_format=[],this.component_align_size=[],t=0;t<this.component_count;t++)this.component_index.push(e.readUint16()),this.component_bit_depth_minus_one.push(e.readUint8()),this.component_format.push(e.readUint8()),this.component_align_size.push(e.readUint8());this.sampling_type=e.readUint8(),this.interleave_type=e.readUint8(),this.block_size=e.readUint8();var n=e.readUint8();this.component_little_endian=n>>7&1,this.block_pad_lsb=n>>6&1,this.block_little_endian=n>>5&1,this.block_reversed=n>>4&1,this.pad_unknown=n>>3&1,this.pixel_size=e.readUint32(),this.row_align_size=e.readUint32(),this.tile_align_size=e.readUint32(),this.num_tile_cols_minus_one=e.readUint32(),this.num_tile_rows_minus_one=e.readUint32()}}),c.createFullBoxCtor(`url `,`DataEntryUrlBox`,function(e){this.flags!==1&&(this.location=e.readCString())}),c.createFullBoxCtor(`urn `,`DataEntryUrnBox`,function(e){this.name=e.readCString(),this.size-this.hdr_size-this.name.length-1>0&&(this.location=e.readCString())}),c.createUUIDBox(`a5d40b30e81411ddba2f0800200c9a66`,`LiveServerManifestBox`,!0,!1,function(e){this.LiveServerManifest=e.readString(this.size-this.hdr_size).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`)}),c.createUUIDBox(`d08a4f1810f34a82b6c832d8aba183d3`,`PiffProtectionSystemSpecificHeaderBox`,!0,!1,function(e){this.system_id=c.parseHex16(e);var t=e.readUint32();t>0&&(this.data=e.readUint8Array(t))}),c.createUUIDBox(`a2394f525a9b4f14a2446c427c648df4`,`PiffSampleEncryptionBox`,!0,!1),c.createUUIDBox(`8974dbce7be74c5184f97148f9882554`,`PiffTrackEncryptionBox`,!0,!1,function(e){this.default_AlgorithmID=e.readUint24(),this.default_IV_size=e.readUint8(),this.default_KID=c.parseHex16(e)}),c.createUUIDBox(`d4807ef2ca3946958e5426cb9e46a79f`,`TfrfBox`,!0,!1,function(e){this.fragment_count=e.readUint8(),this.entries=[];for(var t=0;t<this.fragment_count;t++){var n={},r=0,a=0;this.version===1?(r=e.readUint64(),a=e.readUint64()):(r=e.readUint32(),a=e.readUint32()),n.absolute_time=r,n.absolute_duration=a,this.entries.push(n)}}),c.createUUIDBox(`6d1d9b0542d544e680e2141daff757b2`,`TfxdBox`,!0,!1,function(e){this.version===1?(this.absolute_time=e.readUint64(),this.duration=e.readUint64()):(this.absolute_time=e.readUint32(),this.duration=e.readUint32())}),c.createFullBoxCtor(`vmhd`,`VideoMediaHeaderBox`,function(e){this.graphicsmode=e.readUint16(),this.opcolor=e.readUint16Array(3)}),c.createFullBoxCtor(`vpcC`,`VPCodecConfigurationRecord`,function(e){var t;this.version===1?(this.profile=e.readUint8(),this.level=e.readUint8(),t=e.readUint8(),this.bitDepth=t>>4,this.chromaSubsampling=t>>1&7,this.videoFullRangeFlag=t&1,this.colourPrimaries=e.readUint8(),this.transferCharacteristics=e.readUint8(),this.matrixCoefficients=e.readUint8(),this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize)):(this.profile=e.readUint8(),this.level=e.readUint8(),t=e.readUint8(),this.bitDepth=t>>4&15,this.colorSpace=t&15,t=e.readUint8(),this.chromaSubsampling=t>>4&15,this.transferFunction=t>>1&7,this.videoFullRangeFlag=t&1,this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize))}),c.createBoxCtor(`vttC`,`WebVTTConfigurationBox`,function(e){this.text=e.readString(this.size-this.hdr_size)}),c.createFullBoxCtor(`vvcC`,`VvcConfigurationBox`,function(e){var t,n,r={held_bits:void 0,num_held_bits:0,stream_read_1_bytes:function(e){this.held_bits=e.readUint8(),this.num_held_bits=8},stream_read_2_bytes:function(e){this.held_bits=e.readUint16(),this.num_held_bits=16},extract_bits:function(e){var t=this.held_bits>>this.num_held_bits-e&(1<<e)-1;return this.num_held_bits-=e,t}};if(r.stream_read_1_bytes(e),r.extract_bits(5),this.lengthSizeMinusOne=r.extract_bits(2),this.ptl_present_flag=r.extract_bits(1),this.ptl_present_flag){if(r.stream_read_2_bytes(e),this.ols_idx=r.extract_bits(9),this.num_sublayers=r.extract_bits(3),this.constant_frame_rate=r.extract_bits(2),this.chroma_format_idc=r.extract_bits(2),r.stream_read_1_bytes(e),this.bit_depth_minus8=r.extract_bits(3),r.extract_bits(5),r.stream_read_2_bytes(e),r.extract_bits(2),this.num_bytes_constraint_info=r.extract_bits(6),this.general_profile_idc=r.extract_bits(7),this.general_tier_flag=r.extract_bits(1),this.general_level_idc=e.readUint8(),r.stream_read_1_bytes(e),this.ptl_frame_only_constraint_flag=r.extract_bits(1),this.ptl_multilayer_enabled_flag=r.extract_bits(1),this.general_constraint_info=new Uint8Array(this.num_bytes_constraint_info),this.num_bytes_constraint_info){for(t=0;t<this.num_bytes_constraint_info-1;t++){var a=r.extract_bits(6);r.stream_read_1_bytes(e);var o=r.extract_bits(2);this.general_constraint_info[t]=a<<2|o}this.general_constraint_info[this.num_bytes_constraint_info-1]=r.extract_bits(6)}else r.extract_bits(6);if(this.num_sublayers>1){for(r.stream_read_1_bytes(e),this.ptl_sublayer_present_mask=0,n=this.num_sublayers-2;n>=0;--n){var s=r.extract_bits(1);this.ptl_sublayer_present_mask|=s<<n}for(n=this.num_sublayers;n<=8&&this.num_sublayers>1;++n)r.extract_bits(1);for(this.sublayer_level_idc=[],n=this.num_sublayers-2;n>=0;--n)this.ptl_sublayer_present_mask&1<<n&&(this.sublayer_level_idc[n]=e.readUint8())}if(this.ptl_num_sub_profiles=e.readUint8(),this.general_sub_profile_idc=[],this.ptl_num_sub_profiles)for(t=0;t<this.ptl_num_sub_profiles;t++)this.general_sub_profile_idc.push(e.readUint32());this.max_picture_width=e.readUint16(),this.max_picture_height=e.readUint16(),this.avg_frame_rate=e.readUint16()}var c=12,l=13;this.nalu_arrays=[];var u=e.readUint8();for(t=0;t<u;t++){var d=[];this.nalu_arrays.push(d),r.stream_read_1_bytes(e),d.completeness=r.extract_bits(1),r.extract_bits(2),d.nalu_type=r.extract_bits(5);var f=1;for(d.nalu_type!=l&&d.nalu_type!=c&&(f=e.readUint16()),n=0;n<f;n++){var p=e.readUint16();d.push({data:e.readUint8Array(p),length:p})}}}),c.createFullBoxCtor(`vvnC`,`VvcNALUConfigBox`,function(e){var t=strm.readUint8();this.lengthSizeMinusOne=t&3}),c.SampleEntry.prototype.isVideo=function(){return!1},c.SampleEntry.prototype.isAudio=function(){return!1},c.SampleEntry.prototype.isSubtitle=function(){return!1},c.SampleEntry.prototype.isMetadata=function(){return!1},c.SampleEntry.prototype.isHint=function(){return!1},c.SampleEntry.prototype.getCodec=function(){return this.type.replace(`.`,``)},c.SampleEntry.prototype.getWidth=function(){return``},c.SampleEntry.prototype.getHeight=function(){return``},c.SampleEntry.prototype.getChannelCount=function(){return``},c.SampleEntry.prototype.getSampleRate=function(){return``},c.SampleEntry.prototype.getSampleSize=function(){return``},c.VisualSampleEntry.prototype.isVideo=function(){return!0},c.VisualSampleEntry.prototype.getWidth=function(){return this.width},c.VisualSampleEntry.prototype.getHeight=function(){return this.height},c.AudioSampleEntry.prototype.isAudio=function(){return!0},c.AudioSampleEntry.prototype.getChannelCount=function(){return this.channel_count},c.AudioSampleEntry.prototype.getSampleRate=function(){return this.samplerate},c.AudioSampleEntry.prototype.getSampleSize=function(){return this.samplesize},c.SubtitleSampleEntry.prototype.isSubtitle=function(){return!0},c.MetadataSampleEntry.prototype.isMetadata=function(){return!0},c.decimalToHex=function(e,t){var n=Number(e).toString(16);for(t??=t=2;n.length<t;)n=`0`+n;return n},c.avc1SampleEntry.prototype.getCodec=c.avc2SampleEntry.prototype.getCodec=c.avc3SampleEntry.prototype.getCodec=c.avc4SampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this);return this.avcC?e+`.`+c.decimalToHex(this.avcC.AVCProfileIndication)+c.decimalToHex(this.avcC.profile_compatibility)+c.decimalToHex(this.avcC.AVCLevelIndication):e},c.hev1SampleEntry.prototype.getCodec=c.hvc1SampleEntry.prototype.getCodec=function(){var e,t=c.SampleEntry.prototype.getCodec.call(this);if(this.hvcC){switch(t+=`.`,this.hvcC.general_profile_space){case 0:t+=``;break;case 1:t+=`A`;break;case 2:t+=`B`;break;case 3:t+=`C`;break}t+=this.hvcC.general_profile_idc,t+=`.`;var n=this.hvcC.general_profile_compatibility,r=0;for(e=0;e<32&&(r|=n&1,e!=31);e++)r<<=1,n>>=1;t+=c.decimalToHex(r,0),t+=`.`,this.hvcC.general_tier_flag===0?t+=`L`:t+=`H`,t+=this.hvcC.general_level_idc;var a=!1,o=``;for(e=5;e>=0;e--)(this.hvcC.general_constraint_indicator[e]||a)&&(o=`.`+c.decimalToHex(this.hvcC.general_constraint_indicator[e],0)+o,a=!0);t+=o}return t},c.vvc1SampleEntry.prototype.getCodec=c.vvi1SampleEntry.prototype.getCodec=function(){var e,t=c.SampleEntry.prototype.getCodec.call(this);if(this.vvcC){t+=`.`+this.vvcC.general_profile_idc,this.vvcC.general_tier_flag?t+=`.H`:t+=`.L`,t+=this.vvcC.general_level_idc;var n=``;if(this.vvcC.general_constraint_info){var r=[],a=0;a|=this.vvcC.ptl_frame_only_constraint<<7,a|=this.vvcC.ptl_multilayer_enabled<<6;var o;for(e=0;e<this.vvcC.general_constraint_info.length;++e)a|=this.vvcC.general_constraint_info[e]>>2&63,r.push(a),a&&(o=e),a=this.vvcC.general_constraint_info[e]>>2&3;if(o===void 0)n=`.CA`;else{n=`.C`;var s=`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,l=0,u=0;for(e=0;e<=o;++e)for(l=l<<8|r[e],u+=8;u>=5;){var d=l>>u-5&31;n+=s[d],u-=5,l&=(1<<u)-1}u&&(l<<=5-u,n+=s[l&31])}}t+=n}return t},c.mp4aSampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI(),n=this.esds.esd.getAudioConfig();return e+`.`+c.decimalToHex(t)+(n?`.`+n:``)}else return e},c.stxtSampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this);return this.mime_format?e+`.`+this.mime_format:e},c.vp08SampleEntry.prototype.getCodec=c.vp09SampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this),t=this.vpcC.level;t==0&&(t=`00`);var n=this.vpcC.bitDepth;return n==8&&(n=`08`),e+`.0`+this.vpcC.profile+`.`+t+`.`+n},c.av01SampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this),t=this.av1C.seq_level_idx_0;t<10&&(t=`0`+t);var n;return this.av1C.seq_profile===2&&this.av1C.high_bitdepth===1?n=this.av1C.twelve_bit===1?`12`:`10`:this.av1C.seq_profile<=2&&(n=this.av1C.high_bitdepth===1?`10`:`08`),e+`.`+this.av1C.seq_profile+`.`+t+(this.av1C.seq_tier_0?`H`:`M`)+`.`+n},c.Box.prototype.writeHeader=function(e,n){this.size+=8,this.size>a&&(this.size+=8),this.type===`uuid`&&(this.size+=16),t.debug(`BoxWriter`,`Writing box `+this.type+` of size: `+this.size+` at position `+e.getPosition()+(n||``)),this.size>a?e.writeUint32(1):(this.sizePosition=e.getPosition(),e.writeUint32(this.size)),e.writeString(this.type,null,4),this.type===`uuid`&&e.writeUint8Array(this.uuid),this.size>a&&e.writeUint64(this.size)},c.FullBox.prototype.writeHeader=function(e){this.size+=4,c.Box.prototype.writeHeader.call(this,e,` v=`+this.version+` f=`+this.flags),e.writeUint8(this.version),e.writeUint24(this.flags)},c.Box.prototype.write=function(e){this.type===`mdat`?this.data&&(this.size=this.data.length,this.writeHeader(e),e.writeUint8Array(this.data)):(this.size=this.data?this.data.length:0,this.writeHeader(e),this.data&&e.writeUint8Array(this.data))},c.ContainerBox.prototype.write=function(e){this.size=0,this.writeHeader(e);for(var n=0;n<this.boxes.length;n++)this.boxes[n]&&(this.boxes[n].write(e),this.size+=this.boxes[n].size);t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.TrackReferenceTypeBox.prototype.write=function(e){this.size=this.track_ids.length*4,this.writeHeader(e),e.writeUint32Array(this.track_ids)},c.avcCBox.prototype.write=function(e){var t;for(this.size=7,t=0;t<this.SPS.length;t++)this.size+=2+this.SPS[t].length;for(t=0;t<this.PPS.length;t++)this.size+=2+this.PPS[t].length;for(this.ext&&(this.size+=this.ext.length),this.writeHeader(e),e.writeUint8(this.configurationVersion),e.writeUint8(this.AVCProfileIndication),e.writeUint8(this.profile_compatibility),e.writeUint8(this.AVCLevelIndication),e.writeUint8(this.lengthSizeMinusOne+252),e.writeUint8(this.SPS.length+224),t=0;t<this.SPS.length;t++)e.writeUint16(this.SPS[t].length),e.writeUint8Array(this.SPS[t].nalu);for(e.writeUint8(this.PPS.length),t=0;t<this.PPS.length;t++)e.writeUint16(this.PPS[t].length),e.writeUint8Array(this.PPS[t].nalu);this.ext&&e.writeUint8Array(this.ext)},c.co64Box.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.chunk_offsets.length,this.writeHeader(e),e.writeUint32(this.chunk_offsets.length),t=0;t<this.chunk_offsets.length;t++)e.writeUint64(this.chunk_offsets[t])},c.cslgBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20,this.writeHeader(e),e.writeInt32(this.compositionToDTSShift),e.writeInt32(this.leastDecodeToDisplayDelta),e.writeInt32(this.greatestDecodeToDisplayDelta),e.writeInt32(this.compositionStartTime),e.writeInt32(this.compositionEndTime)},c.cttsBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.sample_counts.length,this.writeHeader(e),e.writeUint32(this.sample_counts.length),t=0;t<this.sample_counts.length;t++)e.writeUint32(this.sample_counts[t]),this.version===1?e.writeInt32(this.sample_offsets[t]):e.writeUint32(this.sample_offsets[t])},c.drefBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.entries.length);for(var n=0;n<this.entries.length;n++)this.entries[n].write(e),this.size+=this.entries[n].size;t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.elngBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=this.extended_language.length,this.writeHeader(e),e.writeString(this.extended_language)},c.elstBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+12*this.entries.length,this.writeHeader(e),e.writeUint32(this.entries.length);for(var t=0;t<this.entries.length;t++){var n=this.entries[t];e.writeUint32(n.segment_duration),e.writeInt32(n.media_time),e.writeInt16(n.media_rate_integer),e.writeInt16(n.media_rate_fraction)}},c.emsgBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=16+this.message_data.length+(this.scheme_id_uri.length+1)+(this.value.length+1),this.writeHeader(e),e.writeCString(this.scheme_id_uri),e.writeCString(this.value),e.writeUint32(this.timescale),e.writeUint32(this.presentation_time_delta),e.writeUint32(this.event_duration),e.writeUint32(this.id),e.writeUint8Array(this.message_data)},c.ftypBox.prototype.write=function(e){this.size=8+4*this.compatible_brands.length,this.writeHeader(e),e.writeString(this.major_brand,null,4),e.writeUint32(this.minor_version);for(var t=0;t<this.compatible_brands.length;t++)e.writeString(this.compatible_brands[t],null,4)},c.hdlrBox.prototype.write=function(e){this.size=20+this.name.length+1,this.version=0,this.flags=0,this.writeHeader(e),e.writeUint32(0),e.writeString(this.handler,null,4),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeCString(this.name)},c.hvcCBox.prototype.write=function(e){var t,n;for(this.size=23,t=0;t<this.nalu_arrays.length;t++)for(this.size+=3,n=0;n<this.nalu_arrays[t].length;n++)this.size+=2+this.nalu_arrays[t][n].data.length;for(this.writeHeader(e),e.writeUint8(this.configurationVersion),e.writeUint8((this.general_profile_space<<6)+(this.general_tier_flag<<5)+this.general_profile_idc),e.writeUint32(this.general_profile_compatibility),e.writeUint8Array(this.general_constraint_indicator),e.writeUint8(this.general_level_idc),e.writeUint16(this.min_spatial_segmentation_idc+(15<<24)),e.writeUint8(this.parallelismType+252),e.writeUint8(this.chroma_format_idc+252),e.writeUint8(this.bit_depth_luma_minus8+248),e.writeUint8(this.bit_depth_chroma_minus8+248),e.writeUint16(this.avgFrameRate),e.writeUint8((this.constantFrameRate<<6)+(this.numTemporalLayers<<3)+(this.temporalIdNested<<2)+this.lengthSizeMinusOne),e.writeUint8(this.nalu_arrays.length),t=0;t<this.nalu_arrays.length;t++)for(e.writeUint8((this.nalu_arrays[t].completeness<<7)+this.nalu_arrays[t].nalu_type),e.writeUint16(this.nalu_arrays[t].length),n=0;n<this.nalu_arrays[t].length;n++)e.writeUint16(this.nalu_arrays[t][n].data.length),e.writeUint8Array(this.nalu_arrays[t][n].data)},c.kindBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=this.schemeURI.length+1+(this.value.length+1),this.writeHeader(e),e.writeCString(this.schemeURI),e.writeCString(this.value)},c.mdhdBox.prototype.write=function(e){this.size=20,this.flags=0,this.version=0,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.timescale),e.writeUint32(this.duration),e.writeUint16(this.language),e.writeUint16(0)},c.mehdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.fragment_duration)},c.mfhdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.sequence_number)},c.mvhdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=96,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.timescale),e.writeUint32(this.duration),e.writeUint32(this.rate),e.writeUint16(this.volume<<8),e.writeUint16(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32Array(this.matrix),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(this.next_track_id)},c.SampleEntry.prototype.writeHeader=function(e){this.size=8,c.Box.prototype.writeHeader.call(this,e),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint16(this.data_reference_index)},c.SampleEntry.prototype.writeFooter=function(e){for(var n=0;n<this.boxes.length;n++)this.boxes[n].write(e),this.size+=this.boxes[n].size;t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.SampleEntry.prototype.write=function(e){this.writeHeader(e),e.writeUint8Array(this.data),this.size+=this.data.length,t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.VisualSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=70,e.writeUint16(0),e.writeUint16(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint16(this.width),e.writeUint16(this.height),e.writeUint32(this.horizresolution),e.writeUint32(this.vertresolution),e.writeUint32(0),e.writeUint16(this.frame_count),e.writeUint8(Math.min(31,this.compressorname.length)),e.writeString(this.compressorname,null,31),e.writeUint16(this.depth),e.writeInt16(-1),this.writeFooter(e)},c.AudioSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=20,e.writeUint32(0),e.writeUint32(0),e.writeUint16(this.channel_count),e.writeUint16(this.samplesize),e.writeUint16(0),e.writeUint16(0),e.writeUint32(this.samplerate<<16),this.writeFooter(e)},c.stppSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=this.namespace.length+1+this.schema_location.length+1+this.auxiliary_mime_types.length+1,e.writeCString(this.namespace),e.writeCString(this.schema_location),e.writeCString(this.auxiliary_mime_types),this.writeFooter(e)},c.SampleGroupEntry.prototype.write=function(e){e.writeUint8Array(this.data)},c.sbgpBox.prototype.write=function(e){this.version=1,this.flags=0,this.size=12+8*this.entries.length,this.writeHeader(e),e.writeString(this.grouping_type,null,4),e.writeUint32(this.grouping_type_parameter),e.writeUint32(this.entries.length);for(var t=0;t<this.entries.length;t++){var n=this.entries[t];e.writeInt32(n.sample_count),e.writeInt32(n.group_description_index)}},c.sgpdBox.prototype.write=function(e){var t,n;for(this.flags=0,this.size=12,t=0;t<this.entries.length;t++)n=this.entries[t],this.version===1&&(this.default_length===0&&(this.size+=4),this.size+=n.data.length);for(this.writeHeader(e),e.writeString(this.grouping_type,null,4),this.version===1&&e.writeUint32(this.default_length),this.version>=2&&e.writeUint32(this.default_sample_description_index),e.writeUint32(this.entries.length),t=0;t<this.entries.length;t++)n=this.entries[t],this.version===1&&this.default_length===0&&e.writeUint32(n.description_length),n.write(e)},c.sidxBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20+12*this.references.length,this.writeHeader(e),e.writeUint32(this.reference_ID),e.writeUint32(this.timescale),e.writeUint32(this.earliest_presentation_time),e.writeUint32(this.first_offset),e.writeUint16(0),e.writeUint16(this.references.length);for(var t=0;t<this.references.length;t++){var n=this.references[t];e.writeUint32(n.reference_type<<31|n.referenced_size),e.writeUint32(n.subsegment_duration),e.writeUint32(n.starts_with_SAP<<31|n.SAP_type<<28|n.SAP_delta_time)}},c.smhdBox.prototype.write=function(e){this.version=0,this.flags=1,this.size=4,this.writeHeader(e),e.writeUint16(this.balance),e.writeUint16(0)},c.stcoBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+4*this.chunk_offsets.length,this.writeHeader(e),e.writeUint32(this.chunk_offsets.length),e.writeUint32Array(this.chunk_offsets)},c.stscBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+12*this.first_chunk.length,this.writeHeader(e),e.writeUint32(this.first_chunk.length),t=0;t<this.first_chunk.length;t++)e.writeUint32(this.first_chunk[t]),e.writeUint32(this.samples_per_chunk[t]),e.writeUint32(this.sample_description_index[t])},c.stsdBox.prototype.write=function(e){var n;for(this.version=0,this.flags=0,this.size=0,this.writeHeader(e),e.writeUint32(this.entries.length),this.size+=4,n=0;n<this.entries.length;n++)this.entries[n].write(e),this.size+=this.entries[n].size;t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.stshBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.shadowed_sample_numbers.length,this.writeHeader(e),e.writeUint32(this.shadowed_sample_numbers.length),t=0;t<this.shadowed_sample_numbers.length;t++)e.writeUint32(this.shadowed_sample_numbers[t]),e.writeUint32(this.sync_sample_numbers[t])},c.stssBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+4*this.sample_numbers.length,this.writeHeader(e),e.writeUint32(this.sample_numbers.length),e.writeUint32Array(this.sample_numbers)},c.stszBox.prototype.write=function(e){var t,n=!0;if(this.version=0,this.flags=0,this.sample_sizes.length>0)for(t=0;t+1<this.sample_sizes.length;)if(this.sample_sizes[t+1]!==this.sample_sizes[0]){n=!1;break}else t++;else n=!1;this.size=8,n||(this.size+=4*this.sample_sizes.length),this.writeHeader(e),n?e.writeUint32(this.sample_sizes[0]):e.writeUint32(0),e.writeUint32(this.sample_sizes.length),n||e.writeUint32Array(this.sample_sizes)},c.sttsBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.sample_counts.length,this.writeHeader(e),e.writeUint32(this.sample_counts.length),t=0;t<this.sample_counts.length;t++)e.writeUint32(this.sample_counts[t]),e.writeUint32(this.sample_deltas[t])},c.tfdtBox.prototype.write=function(e){var t=2**32-1;this.version=+(this.baseMediaDecodeTime>t),this.flags=0,this.size=4,this.version===1&&(this.size+=4),this.writeHeader(e),this.version===1?e.writeUint64(this.baseMediaDecodeTime):e.writeUint32(this.baseMediaDecodeTime)},c.tfhdBox.prototype.write=function(e){this.version=0,this.size=4,this.flags&c.TFHD_FLAG_BASE_DATA_OFFSET&&(this.size+=8),this.flags&c.TFHD_FLAG_SAMPLE_DESC&&(this.size+=4),this.flags&c.TFHD_FLAG_SAMPLE_DUR&&(this.size+=4),this.flags&c.TFHD_FLAG_SAMPLE_SIZE&&(this.size+=4),this.flags&c.TFHD_FLAG_SAMPLE_FLAGS&&(this.size+=4),this.writeHeader(e),e.writeUint32(this.track_id),this.flags&c.TFHD_FLAG_BASE_DATA_OFFSET&&e.writeUint64(this.base_data_offset),this.flags&c.TFHD_FLAG_SAMPLE_DESC&&e.writeUint32(this.default_sample_description_index),this.flags&c.TFHD_FLAG_SAMPLE_DUR&&e.writeUint32(this.default_sample_duration),this.flags&c.TFHD_FLAG_SAMPLE_SIZE&&e.writeUint32(this.default_sample_size),this.flags&c.TFHD_FLAG_SAMPLE_FLAGS&&e.writeUint32(this.default_sample_flags)},c.tkhdBox.prototype.write=function(e){this.version=0,this.size=80,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.track_id),e.writeUint32(0),e.writeUint32(this.duration),e.writeUint32(0),e.writeUint32(0),e.writeInt16(this.layer),e.writeInt16(this.alternate_group),e.writeInt16(this.volume<<8),e.writeUint16(0),e.writeInt32Array(this.matrix),e.writeUint32(this.width),e.writeUint32(this.height)},c.trexBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20,this.writeHeader(e),e.writeUint32(this.track_id),e.writeUint32(this.default_sample_description_index),e.writeUint32(this.default_sample_duration),e.writeUint32(this.default_sample_size),e.writeUint32(this.default_sample_flags)},c.trunBox.prototype.write=function(e){this.version=0,this.size=4,this.flags&c.TRUN_FLAGS_DATA_OFFSET&&(this.size+=4),this.flags&c.TRUN_FLAGS_FIRST_FLAG&&(this.size+=4),this.flags&c.TRUN_FLAGS_DURATION&&(this.size+=4*this.sample_duration.length),this.flags&c.TRUN_FLAGS_SIZE&&(this.size+=4*this.sample_size.length),this.flags&c.TRUN_FLAGS_FLAGS&&(this.size+=4*this.sample_flags.length),this.flags&c.TRUN_FLAGS_CTS_OFFSET&&(this.size+=4*this.sample_composition_time_offset.length),this.writeHeader(e),e.writeUint32(this.sample_count),this.flags&c.TRUN_FLAGS_DATA_OFFSET&&(this.data_offset_position=e.getPosition(),e.writeInt32(this.data_offset)),this.flags&c.TRUN_FLAGS_FIRST_FLAG&&e.writeUint32(this.first_sample_flags);for(var t=0;t<this.sample_count;t++)this.flags&c.TRUN_FLAGS_DURATION&&e.writeUint32(this.sample_duration[t]),this.flags&c.TRUN_FLAGS_SIZE&&e.writeUint32(this.sample_size[t]),this.flags&c.TRUN_FLAGS_FLAGS&&e.writeUint32(this.sample_flags[t]),this.flags&c.TRUN_FLAGS_CTS_OFFSET&&(this.version===0?e.writeUint32(this.sample_composition_time_offset[t]):e.writeInt32(this.sample_composition_time_offset[t]))},c[`url Box`].prototype.write=function(e){this.version=0,this.location?(this.flags=0,this.size=this.location.length+1):(this.flags=1,this.size=0),this.writeHeader(e),this.location&&e.writeCString(this.location)},c[`urn Box`].prototype.write=function(e){this.version=0,this.flags=0,this.size=this.name.length+1+(this.location?this.location.length+1:0),this.writeHeader(e),e.writeCString(this.name),this.location&&e.writeCString(this.location)},c.vmhdBox.prototype.write=function(e){this.version=0,this.flags=1,this.size=8,this.writeHeader(e),e.writeUint16(this.graphicsmode),e.writeUint16Array(this.opcolor)},c.cttsBox.prototype.unpack=function(e){var t,n,r=0;for(t=0;t<this.sample_counts.length;t++)for(n=0;n<this.sample_counts[t];n++)e[r].pts=e[r].dts+this.sample_offsets[t],r++},c.sttsBox.prototype.unpack=function(e){var t,n,r=0;for(t=0;t<this.sample_counts.length;t++)for(n=0;n<this.sample_counts[t];n++)r===0?e[r].dts=0:e[r].dts=e[r-1].dts+this.sample_deltas[t],r++},c.stcoBox.prototype.unpack=function(e){var t;for(t=0;t<this.chunk_offsets.length;t++)e[t].offset=this.chunk_offsets[t]},c.stscBox.prototype.unpack=function(e){var t,n,r,a=0,o=0;for(t=0;t<this.first_chunk.length;t++)for(n=0;n<(t+1<this.first_chunk.length?this.first_chunk[t+1]:1/0);n++)for(o++,r=0;r<this.samples_per_chunk[t];r++){if(e[a])e[a].description_index=this.sample_description_index[t],e[a].chunk_index=o;else return;a++}},c.stszBox.prototype.unpack=function(e){var t;for(t=0;t<this.sample_sizes.length;t++)e[t].size=this.sample_sizes[t]},c.DIFF_BOXES_PROP_NAMES=[`boxes`,`entries`,`references`,`subsamples`,`items`,`item_infos`,`extents`,`associations`,`subsegments`,`ranges`,`seekLists`,`seekPoints`,`esd`,`levels`],c.DIFF_PRIMITIVE_ARRAY_PROP_NAMES=[`compatible_brands`,`matrix`,`opcolor`,`sample_counts`,`sample_deltas`,`first_chunk`,`samples_per_chunk`,`sample_sizes`,`chunk_offsets`,`sample_offsets`,`sample_description_index`,`sample_duration`],c.boxEqualFields=function(e,t){if(e&&!t)return!1;for(var n in e)if(c.DIFF_BOXES_PROP_NAMES.indexOf(n)>-1)continue;else if(e[n]instanceof c.Box||t[n]instanceof c.Box)continue;else if(e[n]===void 0||t[n]===void 0)continue;else if(typeof e[n]==`function`||typeof t[n]==`function`)continue;else if(e.subBoxNames&&e.subBoxNames.indexOf(n.slice(0,4))>-1||t.subBoxNames&&t.subBoxNames.indexOf(n.slice(0,4))>-1)continue;else if(n===`data`||n===`start`||n===`size`||n===`creation_time`||n===`modification_time`)continue;else if(c.DIFF_PRIMITIVE_ARRAY_PROP_NAMES.indexOf(n)>-1)continue;else if(e[n]!==t[n])return!1;return!0},c.boxEqual=function(e,t){if(!c.boxEqualFields(e,t))return!1;for(var n=0;n<c.DIFF_BOXES_PROP_NAMES.length;n++){var r=c.DIFF_BOXES_PROP_NAMES[n];if(e[r]&&t[r]&&!c.boxEqual(e[r],t[r]))return!1}return!0};var f=function(){};f.prototype.parseSample=function(e){var t,r,a=new n(e.buffer);for(t=[];!a.isEos();)r=c.parseOneBox(a,!1),r.code===c.OK&&r.box.type===`vttc`&&t.push(r.box);return t},f.prototype.getText=function(e,t,n){function r(e,t,n){return n||=`0`,e+=``,e.length>=t?e:Array(t-e.length+1).join(n)+e}function a(e){var t=Math.floor(e/3600),n=Math.floor((e-t*3600)/60),a=Math.floor(e-t*3600-n*60),o=Math.floor((e-t*3600-n*60-a)*1e3);return``+r(t,2)+`:`+r(n,2)+`:`+r(a,2)+`.`+r(o,3)}for(var o=this.parseSample(n),s=``,c=0;c<o.length;c++){var l=o[c];s+=a(e)+` --> `+a(t)+`\r
112
- `,s+=l.payl.text}return s};var p=function(){};p.prototype.parseSample=function(e){var t={},r;t.resources=[];var a=new n(e.data.buffer);if(!e.subsamples||e.subsamples.length===0)t.documentString=a.readString(e.data.length);else if(t.documentString=a.readString(e.subsamples[0].size),e.subsamples.length>1)for(r=1;r<e.subsamples.length;r++)t.resources[r]=a.readUint8Array(e.subsamples[r].size);return typeof DOMParser<`u`&&(t.document=new DOMParser().parseFromString(t.documentString,`application/xml`)),t};var m=function(){};m.prototype.parseSample=function(e){return new n(e.data.buffer).readString(e.data.length)},m.prototype.parseConfig=function(e){var t,r=new n(e.buffer);return r.readUint32(),t=r.readCString(),t},e!==void 0&&(e.VTTin4Parser=f,e.XMLSubtitlein4Parser=p,e.Textin4Parser=m);var h=function(e){this.stream=e||new o,this.boxes=[],this.mdats=[],this.moofs=[],this.isProgressive=!1,this.moovStartFound=!1,this.onMoovStart=null,this.moovStartSent=!1,this.onReady=null,this.readySent=!1,this.onSegment=null,this.onSamples=null,this.onError=null,this.sampleListBuilt=!1,this.fragmentedTracks=[],this.extractedTracks=[],this.isFragmentationInitialized=!1,this.sampleProcessingStarted=!1,this.nextMoofNumber=0,this.itemListBuilt=!1,this.items=[],this.entity_groups=[],this.onSidx=null,this.sidxSent=!1};h.prototype.setSegmentOptions=function(e,t,n){var r=this.getTrackById(e);if(r){var a={};this.fragmentedTracks.push(a),a.id=e,a.user=t,a.trak=r,r.nextSample=0,a.segmentStream=null,a.nb_samples=1e3,a.rapAlignement=!0,n&&(n.nbSamples&&(a.nb_samples=n.nbSamples),n.rapAlignement&&(a.rapAlignement=n.rapAlignement))}},h.prototype.unsetSegmentOptions=function(e){for(var t=-1,n=0;n<this.fragmentedTracks.length;n++)this.fragmentedTracks[n].id==e&&(t=n);t>-1&&this.fragmentedTracks.splice(t,1)},h.prototype.setExtractionOptions=function(e,t,n){var r=this.getTrackById(e);if(r){var a={};this.extractedTracks.push(a),a.id=e,a.user=t,a.trak=r,r.nextSample=0,a.nb_samples=1e3,a.samples=[],n&&n.nbSamples&&(a.nb_samples=n.nbSamples)}},h.prototype.unsetExtractionOptions=function(e){for(var t=-1,n=0;n<this.extractedTracks.length;n++)this.extractedTracks[n].id==e&&(t=n);t>-1&&this.extractedTracks.splice(t,1)},h.prototype.parse=function(){var e,n,r=!1;if(!(this.restoreParsePosition&&!this.restoreParsePosition()))for(;;)if(this.hasIncompleteMdat&&this.hasIncompleteMdat()){if(this.processIncompleteMdat())continue;return}else if(this.saveParsePosition&&this.saveParsePosition(),e=c.parseOneBox(this.stream,r),e.code===c.ERR_NOT_ENOUGH_DATA)if(this.processIncompleteBox){if(this.processIncompleteBox(e))continue;return}else return;else{var a;switch(n=e.box,a=n.type===`uuid`?n.uuid:n.type,this.boxes.push(n),a){case`mdat`:this.mdats.push(n);break;case`moof`:this.moofs.push(n);break;case`moov`:this.moovStartFound=!0,this.mdats.length===0&&(this.isProgressive=!0);default:this[a]!==void 0&&t.warn(`ISOFile`,`Duplicate Box of type: `+a+`, overriding previous occurrence`),this[a]=n;break}this.updateUsedBytes&&this.updateUsedBytes(n,e)}},h.prototype.checkBuffer=function(e){if(e==null)throw`Buffer must be defined and non empty`;if(e.fileStart===void 0)throw`Buffer must have a fileStart property`;return e.byteLength===0?(t.warn(`ISOFile`,`Ignoring empty buffer (fileStart: `+e.fileStart+`)`),this.stream.logBufferLevel(),!1):(t.info(`ISOFile`,`Processing buffer (fileStart: `+e.fileStart+`)`),e.usedBytes=0,this.stream.insertBuffer(e),this.stream.logBufferLevel(),this.stream.initialized()?!0:(t.warn(`ISOFile`,`Not ready to start parsing`),!1))},h.prototype.appendBuffer=function(e,n){var r;if(this.checkBuffer(e))return this.parse(),this.moovStartFound&&!this.moovStartSent&&(this.moovStartSent=!0,this.onMoovStart&&this.onMoovStart()),this.moov?(this.sampleListBuilt||=(this.buildSampleLists(),!0),this.updateSampleLists(),this.onReady&&!this.readySent&&(this.readySent=!0,this.onReady(this.getInfo())),this.processSamples(n),this.nextSeekPosition?(r=this.nextSeekPosition,this.nextSeekPosition=void 0):r=this.nextParsePosition,this.stream.getEndFilePositionAfter&&(r=this.stream.getEndFilePositionAfter(r))):r=this.nextParsePosition?this.nextParsePosition:0,this.sidx&&this.onSidx&&!this.sidxSent&&(this.onSidx(this.sidx),this.sidxSent=!0),this.meta&&(this.flattenItemInfo&&!this.itemListBuilt&&(this.flattenItemInfo(),this.itemListBuilt=!0),this.processItems&&this.processItems(this.onItem)),this.stream.cleanBuffers&&(t.info(`ISOFile`,`Done processing buffer (fileStart: `+e.fileStart+`) - next buffer to fetch should have a fileStart position of `+r),this.stream.logBufferLevel(),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0),t.info(`ISOFile`,`Sample data size in memory: `+this.getAllocatedSampleDataSize())),r},h.prototype.getInfo=function(){var e,t,n={},r,a,o,s,c=new Date(`1904-01-01T00:00:00Z`).getTime();if(this.moov)for(n.hasMoov=!0,n.duration=this.moov.mvhd.duration,n.timescale=this.moov.mvhd.timescale,n.isFragmented=this.moov.mvex!=null,n.isFragmented&&this.moov.mvex.mehd&&(n.fragment_duration=this.moov.mvex.mehd.fragment_duration),n.isProgressive=this.isProgressive,n.hasIOD=this.moov.iods!=null,n.brands=[],n.brands.push(this.ftyp.major_brand),n.brands=n.brands.concat(this.ftyp.compatible_brands),n.created=new Date(c+this.moov.mvhd.creation_time*1e3),n.modified=new Date(c+this.moov.mvhd.modification_time*1e3),n.tracks=[],n.audioTracks=[],n.videoTracks=[],n.subtitleTracks=[],n.metadataTracks=[],n.hintTracks=[],n.otherTracks=[],e=0;e<this.moov.traks.length;e++){if(r=this.moov.traks[e],s=r.mdia.minf.stbl.stsd.entries[0],a={},n.tracks.push(a),a.id=r.tkhd.track_id,a.name=r.mdia.hdlr.name,a.references=[],r.tref)for(t=0;t<r.tref.boxes.length;t++)o={},a.references.push(o),o.type=r.tref.boxes[t].type,o.track_ids=r.tref.boxes[t].track_ids;r.edts&&(a.edits=r.edts.elst.entries),a.created=new Date(c+r.tkhd.creation_time*1e3),a.modified=new Date(c+r.tkhd.modification_time*1e3),a.movie_duration=r.tkhd.duration,a.movie_timescale=n.timescale,a.layer=r.tkhd.layer,a.alternate_group=r.tkhd.alternate_group,a.volume=r.tkhd.volume,a.matrix=r.tkhd.matrix,a.track_width=r.tkhd.width/65536,a.track_height=r.tkhd.height/65536,a.timescale=r.mdia.mdhd.timescale,a.cts_shift=r.mdia.minf.stbl.cslg,a.duration=r.mdia.mdhd.duration,a.samples_duration=r.samples_duration,a.codec=s.getCodec(),a.kind=r.udta&&r.udta.kinds.length?r.udta.kinds[0]:{schemeURI:``,value:``},a.language=r.mdia.elng?r.mdia.elng.extended_language:r.mdia.mdhd.languageString,a.nb_samples=r.samples.length,a.size=r.samples_size,a.bitrate=a.size*8*a.timescale/a.samples_duration,s.isAudio()?(a.type=`audio`,n.audioTracks.push(a),a.audio={},a.audio.sample_rate=s.getSampleRate(),a.audio.channel_count=s.getChannelCount(),a.audio.sample_size=s.getSampleSize()):s.isVideo()?(a.type=`video`,n.videoTracks.push(a),a.video={},a.video.width=s.getWidth(),a.video.height=s.getHeight()):s.isSubtitle()?(a.type=`subtitles`,n.subtitleTracks.push(a)):s.isHint()?(a.type=`metadata`,n.hintTracks.push(a)):s.isMetadata()?(a.type=`metadata`,n.metadataTracks.push(a)):(a.type=`metadata`,n.otherTracks.push(a))}else n.hasMoov=!1;if(n.mime=``,n.hasMoov&&n.tracks){for(n.videoTracks&&n.videoTracks.length>0?n.mime+=`video/mp4; codecs="`:n.audioTracks&&n.audioTracks.length>0?n.mime+=`audio/mp4; codecs="`:n.mime+=`application/mp4; codecs="`,e=0;e<n.tracks.length;e++)e!==0&&(n.mime+=`,`),n.mime+=n.tracks[e].codec;n.mime+=`"; profiles="`,n.mime+=this.ftyp.compatible_brands.join(),n.mime+=`"`}return n},h.prototype.setNextSeekPositionFromSample=function(e){e&&(this.nextSeekPosition?this.nextSeekPosition=Math.min(e.offset+e.alreadyRead,this.nextSeekPosition):this.nextSeekPosition=e.offset+e.alreadyRead)},h.prototype.processSamples=function(e){var n,r;if(this.sampleProcessingStarted){if(this.isFragmentationInitialized&&this.onSegment!==null)for(n=0;n<this.fragmentedTracks.length;n++){var a=this.fragmentedTracks[n];for(r=a.trak;r.nextSample<r.samples.length&&this.sampleProcessingStarted;){t.debug(`ISOFile`,`Creating media fragment on track #`+a.id+` for sample `+r.nextSample);var o=this.createFragment(a.id,r.nextSample,a.segmentStream);if(o)a.segmentStream=o,r.nextSample++;else break;if((r.nextSample%a.nb_samples===0||e||r.nextSample>=r.samples.length)&&(t.info(`ISOFile`,`Sending fragmented data on track #`+a.id+` for samples [`+Math.max(0,r.nextSample-a.nb_samples)+`,`+(r.nextSample-1)+`]`),t.info(`ISOFile`,`Sample data size in memory: `+this.getAllocatedSampleDataSize()),this.onSegment&&this.onSegment(a.id,a.user,a.segmentStream.buffer,r.nextSample,e||r.nextSample>=r.samples.length),a.segmentStream=null,a!==this.fragmentedTracks[n]))break}}if(this.onSamples!==null)for(n=0;n<this.extractedTracks.length;n++){var s=this.extractedTracks[n];for(r=s.trak;r.nextSample<r.samples.length&&this.sampleProcessingStarted;){t.debug(`ISOFile`,`Exporting on track #`+s.id+` sample #`+r.nextSample);var c=this.getSample(r,r.nextSample);if(c)r.nextSample++,s.samples.push(c);else{this.setNextSeekPositionFromSample(r.samples[r.nextSample]);break}if((r.nextSample%s.nb_samples===0||r.nextSample>=r.samples.length)&&(t.debug(`ISOFile`,`Sending samples on track #`+s.id+` for sample `+r.nextSample),this.onSamples&&this.onSamples(s.id,s.user,s.samples),s.samples=[],s!==this.extractedTracks[n]))break}}}},h.prototype.getBox=function(e){var t=this.getBoxes(e,!0);return t.length?t[0]:null},h.prototype.getBoxes=function(e,t){var n=[];return h._sweep.call(this,e,n,t),n},h._sweep=function(e,t,n){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;h._sweep.call(this.boxes[r],e,t,n)}},h.prototype.getTrackSamplesInfo=function(e){var t=this.getTrackById(e);if(t)return t.samples},h.prototype.getTrackSample=function(e,t){var n=this.getTrackById(e);return this.getSample(n,t)},h.prototype.releaseUsedSamples=function(e,n){var r=0,a=this.getTrackById(e);a.lastValidSample||=0;for(var o=a.lastValidSample;o<n;o++)r+=this.releaseSample(a,o);t.info(`ISOFile`,`Track #`+e+` released samples up to `+n+` (released size: `+r+`, remaining: `+this.samplesDataSize+`)`),a.lastValidSample=n},h.prototype.start=function(){this.sampleProcessingStarted=!0,this.processSamples(!1)},h.prototype.stop=function(){this.sampleProcessingStarted=!1},h.prototype.flush=function(){t.info(`ISOFile`,`Flushing remaining samples`),this.updateSampleLists(),this.processSamples(!0),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0)},h.prototype.seekTrack=function(e,n,r){var a,o,s=1/0,c=0,l=0,u;if(r.samples.length===0)return t.info(`ISOFile`,`No sample in track, cannot seek! Using time `+t.getDurationString(0,1)+` and offset: 0`),{offset:0,time:0};for(a=0;a<r.samples.length;a++){if(o=r.samples[a],a===0)l=0,u=o.timescale;else if(o.cts>e*o.timescale){l=a-1;break}n&&o.is_sync&&(c=a)}for(n&&(l=c),e=r.samples[l].cts,r.nextSample=l;r.samples[l].alreadyRead===r.samples[l].size&&r.samples[l+1];)l++;return s=r.samples[l].offset+r.samples[l].alreadyRead,t.info(`ISOFile`,`Seeking to `+(n?`RAP`:``)+` sample #`+r.nextSample+` on track `+r.tkhd.track_id+`, time `+t.getDurationString(e,u)+` and offset: `+s),{offset:s,time:e/u}},h.prototype.getTrackDuration=function(e){var t;return e.samples?(t=e.samples[e.samples.length-1],(t.cts+t.duration)/t.timescale):1/0},h.prototype.seek=function(e,n){var r=this.moov,a,o,s,c={offset:1/0,time:1/0};if(this.moov){for(s=0;s<r.traks.length;s++)a=r.traks[s],!(e>this.getTrackDuration(a))&&(o=this.seekTrack(e,n,a),o.offset<c.offset&&(c.offset=o.offset),o.time<c.time&&(c.time=o.time));return t.info(`ISOFile`,`Seeking at time `+t.getDurationString(c.time,1)+` needs a buffer with a fileStart position of `+c.offset),c.offset===1/0?c={offset:this.nextParsePosition,time:0}:c.offset=this.stream.getEndFilePositionAfter(c.offset),t.info(`ISOFile`,`Adjusted seek position (after checking data already in buffer): `+c.offset),c}else throw`Cannot seek: moov not received!`},h.prototype.equal=function(e){for(var t=0;t<this.boxes.length&&t<e.boxes.length;){var n=this.boxes[t],r=e.boxes[t];if(!c.boxEqual(n,r))return!1;t++}return!0},e!==void 0&&(e.ISOFile=h),h.prototype.lastBoxStartPosition=0,h.prototype.parsingMdat=null,h.prototype.nextParsePosition=0,h.prototype.discardMdatData=!1,h.prototype.processIncompleteBox=function(e){var t,n,r;return e.type===`mdat`?(t=new c[e.type+`Box`](e.size),this.parsingMdat=t,this.boxes.push(t),this.mdats.push(t),t.start=e.start,t.hdr_size=e.hdr_size,this.stream.addUsedBytes(t.hdr_size),this.lastBoxStartPosition=t.start+t.size,r=this.stream.seek(t.start+t.size,!1,this.discardMdatData),r?(this.parsingMdat=null,!0):(this.moovStartFound?this.nextParsePosition=this.stream.findEndContiguousBuf():this.nextParsePosition=t.start+t.size,!1)):(e.type===`moov`&&(this.moovStartFound=!0,this.mdats.length===0&&(this.isProgressive=!0)),n=this.stream.mergeNextBuffer?this.stream.mergeNextBuffer():!1,n?(this.nextParsePosition=this.stream.getEndPosition(),!0):(e.type?this.moovStartFound?this.nextParsePosition=this.stream.getEndPosition():this.nextParsePosition=this.stream.getPosition()+e.size:this.nextParsePosition=this.stream.getEndPosition(),!1))},h.prototype.hasIncompleteMdat=function(){return this.parsingMdat!==null},h.prototype.processIncompleteMdat=function(){var e=this.parsingMdat;return this.stream.seek(e.start+e.size,!1,this.discardMdatData)?(t.debug(`ISOFile`,`Found 'mdat' end in buffered data`),this.parsingMdat=null,!0):(this.nextParsePosition=this.stream.findEndContiguousBuf(),!1)},h.prototype.restoreParsePosition=function(){return this.stream.seek(this.lastBoxStartPosition,!0,this.discardMdatData)},h.prototype.saveParsePosition=function(){this.lastBoxStartPosition=this.stream.getPosition()},h.prototype.updateUsedBytes=function(e,t){this.stream.addUsedBytes&&(e.type===`mdat`?(this.stream.addUsedBytes(e.hdr_size),this.discardMdatData&&this.stream.addUsedBytes(e.size-e.hdr_size)):this.stream.addUsedBytes(e.size))},h.prototype.add=c.Box.prototype.add,h.prototype.addBox=c.Box.prototype.addBox,h.prototype.init=function(e){var t=e||{};this.add(`ftyp`).set(`major_brand`,t.brands&&t.brands[0]||`iso4`).set(`minor_version`,0).set(`compatible_brands`,t.brands||[`iso4`]);var n=this.add(`moov`);return n.add(`mvhd`).set(`timescale`,t.timescale||600).set(`rate`,t.rate||65536).set(`creation_time`,0).set(`modification_time`,0).set(`duration`,t.duration||0).set(`volume`,t.width?0:256).set(`matrix`,[65536,0,0,0,65536,0,0,0,1073741824]).set(`next_track_id`,1),n.add(`mvex`),this},h.prototype.addTrack=function(e){this.moov||this.init(e);var t=e||{};t.width=t.width||320,t.height=t.height||320,t.id=t.id||this.moov.mvhd.next_track_id,t.type=t.type||`avc1`;var r=this.moov.add(`trak`);this.moov.mvhd.next_track_id=t.id+1,r.add(`tkhd`).set(`flags`,c.TKHD_FLAG_ENABLED|c.TKHD_FLAG_IN_MOVIE|c.TKHD_FLAG_IN_PREVIEW).set(`creation_time`,0).set(`modification_time`,0).set(`track_id`,t.id).set(`duration`,t.duration||0).set(`layer`,t.layer||0).set(`alternate_group`,0).set(`volume`,1).set(`matrix`,[65536,0,0,0,65536,0,0,0,1073741824]).set(`width`,t.width<<16).set(`height`,t.height<<16);var a=r.add(`mdia`);a.add(`mdhd`).set(`creation_time`,0).set(`modification_time`,0).set(`timescale`,t.timescale||1).set(`duration`,t.media_duration||0).set(`language`,t.language||`und`),a.add(`hdlr`).set(`handler`,t.hdlr||`vide`).set(`name`,t.name||`Track created with MP4Box.js`),a.add(`elng`).set(`extended_language`,t.language||`fr-FR`);var o=a.add(`minf`);if(c[t.type+`SampleEntry`]!==void 0){var s=new c[t.type+`SampleEntry`];s.data_reference_index=1;var l=``;for(var u in c.sampleEntryCodes)for(var d=c.sampleEntryCodes[u],f=0;f<d.length;f++)if(d.indexOf(t.type)>-1){l=u;break}switch(l){case`Visual`:if(o.add(`vmhd`).set(`graphicsmode`,0).set(`opcolor`,[0,0,0]),s.set(`width`,t.width).set(`height`,t.height).set(`horizresolution`,72<<16).set(`vertresolution`,72<<16).set(`frame_count`,1).set(`compressorname`,t.type+` Compressor`).set(`depth`,24),t.avcDecoderConfigRecord){var p=new c.avcCBox;p.parse(new n(t.avcDecoderConfigRecord)),s.addBox(p)}else if(t.hevcDecoderConfigRecord){var m=new c.hvcCBox;m.parse(new n(t.hevcDecoderConfigRecord)),s.addBox(m)}break;case`Audio`:o.add(`smhd`).set(`balance`,t.balance||0),s.set(`channel_count`,t.channel_count||2).set(`samplesize`,t.samplesize||16).set(`samplerate`,t.samplerate||65536);break;case`Hint`:o.add(`hmhd`);break;case`Subtitle`:switch(o.add(`sthd`),t.type){case`stpp`:s.set(`namespace`,t.namespace||`nonamespace`).set(`schema_location`,t.schema_location||``).set(`auxiliary_mime_types`,t.auxiliary_mime_types||``);break}break;case`Metadata`:o.add(`nmhd`);break;case`System`:o.add(`nmhd`);break;default:o.add(`nmhd`);break}t.description&&s.addBox(t.description),t.description_boxes&&t.description_boxes.forEach(function(e){s.addBox(e)}),o.add(`dinf`).add(`dref`).addEntry(new c[`url Box`]().set(`flags`,1));var h=o.add(`stbl`);return h.add(`stsd`).addEntry(s),h.add(`stts`).set(`sample_counts`,[]).set(`sample_deltas`,[]),h.add(`stsc`).set(`first_chunk`,[]).set(`samples_per_chunk`,[]).set(`sample_description_index`,[]),h.add(`stco`).set(`chunk_offsets`,[]),h.add(`stsz`).set(`sample_sizes`,[]),this.moov.mvex.add(`trex`).set(`track_id`,t.id).set(`default_sample_description_index`,t.default_sample_description_index||1).set(`default_sample_duration`,t.default_sample_duration||0).set(`default_sample_size`,t.default_sample_size||0).set(`default_sample_flags`,t.default_sample_flags||0),this.buildTrakSampleLists(r),t.id}},c.Box.prototype.computeSize=function(e){var t=e||new r;t.endianness=r.BIG_ENDIAN,this.write(t)},h.prototype.addSample=function(e,t,n){var r=n||{},a={},o=this.getTrackById(e);if(o!==null){a.number=o.samples.length,a.track_id=o.tkhd.track_id,a.timescale=o.mdia.mdhd.timescale,a.description_index=r.sample_description_index?r.sample_description_index-1:0,a.description=o.mdia.minf.stbl.stsd.entries[a.description_index],a.data=t,a.size=t.byteLength,a.alreadyRead=a.size,a.duration=r.duration||1,a.cts=r.cts||0,a.dts=r.dts||0,a.is_sync=r.is_sync||!1,a.is_leading=r.is_leading||0,a.depends_on=r.depends_on||0,a.is_depended_on=r.is_depended_on||0,a.has_redundancy=r.has_redundancy||0,a.degradation_priority=r.degradation_priority||0,a.offset=0,a.subsamples=r.subsamples,o.samples.push(a),o.samples_size+=a.size,o.samples_duration+=a.duration,o.first_dts===void 0&&(o.first_dts=r.dts),this.processSamples();var s=this.createSingleSampleMoof(a);return this.addBox(s),s.computeSize(),s.trafs[0].truns[0].data_offset=s.size+8,this.add(`mdat`).data=new Uint8Array(t),a}},h.prototype.createSingleSampleMoof=function(e){var t=0;t=e.is_sync?1<<25:65536;var n=new c.moofBox;n.add(`mfhd`).set(`sequence_number`,this.nextMoofNumber),this.nextMoofNumber++;var r=n.add(`traf`),a=this.getTrackById(e.track_id);return r.add(`tfhd`).set(`track_id`,e.track_id).set(`flags`,c.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),r.add(`tfdt`).set(`baseMediaDecodeTime`,e.dts-(a.first_dts||0)),r.add(`trun`).set(`flags`,c.TRUN_FLAGS_DATA_OFFSET|c.TRUN_FLAGS_DURATION|c.TRUN_FLAGS_SIZE|c.TRUN_FLAGS_FLAGS|c.TRUN_FLAGS_CTS_OFFSET).set(`data_offset`,0).set(`first_sample_flags`,0).set(`sample_count`,1).set(`sample_duration`,[e.duration]).set(`sample_size`,[e.size]).set(`sample_flags`,[t]).set(`sample_composition_time_offset`,[e.cts-e.dts]),n},h.prototype.lastMoofIndex=0,h.prototype.samplesDataSize=0,h.prototype.resetTables=function(){var e,t,n,r,a,o,s,c;for(this.initial_duration=this.moov.mvhd.duration,this.moov.mvhd.duration=0,e=0;e<this.moov.traks.length;e++){t=this.moov.traks[e],t.tkhd.duration=0,t.mdia.mdhd.duration=0,n=t.mdia.minf.stbl.stco||t.mdia.minf.stbl.co64,n.chunk_offsets=[],r=t.mdia.minf.stbl.stsc,r.first_chunk=[],r.samples_per_chunk=[],r.sample_description_index=[],a=t.mdia.minf.stbl.stsz||t.mdia.minf.stbl.stz2,a.sample_sizes=[],o=t.mdia.minf.stbl.stts,o.sample_counts=[],o.sample_deltas=[],s=t.mdia.minf.stbl.ctts,s&&(s.sample_counts=[],s.sample_offsets=[]),c=t.mdia.minf.stbl.stss;var l=t.mdia.minf.stbl.boxes.indexOf(c);l!=-1&&(t.mdia.minf.stbl.boxes[l]=null)}},h.initSampleGroups=function(e,t,n,r,a){var o,s,c,l;function u(e,t,n){this.grouping_type=e,this.grouping_type_parameter=t,this.sbgp=n,this.last_sample_in_run=-1,this.entry_index=-1}for(t&&(t.sample_groups_info=[]),e.sample_groups_info||=[],s=0;s<n.length;s++){for(l=n[s].grouping_type+`/`+n[s].grouping_type_parameter,c=new u(n[s].grouping_type,n[s].grouping_type_parameter,n[s]),t&&(t.sample_groups_info[l]=c),e.sample_groups_info[l]||(e.sample_groups_info[l]=c),o=0;o<r.length;o++)r[o].grouping_type===n[s].grouping_type&&(c.description=r[o],c.description.used=!0);if(a)for(o=0;o<a.length;o++)a[o].grouping_type===n[s].grouping_type&&(c.fragment_description=a[o],c.fragment_description.used=!0,c.is_fragment=!0)}if(!t)for(s=0;s<r.length;s++)!r[s].used&&r[s].version>=2&&(l=r[s].grouping_type+`/0`,c=new u(r[s].grouping_type,0),e.sample_groups_info[l]||(e.sample_groups_info[l]=c));else if(a)for(s=0;s<a.length;s++)!a[s].used&&a[s].version>=2&&(l=a[s].grouping_type+`/0`,c=new u(a[s].grouping_type,0),c.is_fragment=!0,t.sample_groups_info[l]||(t.sample_groups_info[l]=c))},h.setSampleGroupProperties=function(e,t,n,r){var a,o;for(a in t.sample_groups=[],r)if(t.sample_groups[a]={},t.sample_groups[a].grouping_type=r[a].grouping_type,t.sample_groups[a].grouping_type_parameter=r[a].grouping_type_parameter,n>=r[a].last_sample_in_run&&(r[a].last_sample_in_run<0&&(r[a].last_sample_in_run=0),r[a].entry_index++,r[a].entry_index<=r[a].sbgp.entries.length-1&&(r[a].last_sample_in_run+=r[a].sbgp.entries[r[a].entry_index].sample_count)),r[a].entry_index<=r[a].sbgp.entries.length-1?t.sample_groups[a].group_description_index=r[a].sbgp.entries[r[a].entry_index].group_description_index:t.sample_groups[a].group_description_index=-1,t.sample_groups[a].group_description_index!==0){var s=r[a].fragment_description?r[a].fragment_description:r[a].description;t.sample_groups[a].group_description_index>0?(o=t.sample_groups[a].group_description_index>65535?(t.sample_groups[a].group_description_index>>16)-1:t.sample_groups[a].group_description_index-1,s&&o>=0&&(t.sample_groups[a].description=s.entries[o])):s&&s.version>=2&&s.default_group_description_index>0&&(t.sample_groups[a].description=s.entries[s.default_group_description_index-1])}},h.process_sdtp=function(e,t,n){t&&(e?(t.is_leading=e.is_leading[n],t.depends_on=e.sample_depends_on[n],t.is_depended_on=e.sample_is_depended_on[n],t.has_redundancy=e.sample_has_redundancy[n]):(t.is_leading=0,t.depends_on=0,t.is_depended_on=0,t.has_redundancy=0))},h.prototype.buildSampleLists=function(){var e,t;for(e=0;e<this.moov.traks.length;e++)t=this.moov.traks[e],this.buildTrakSampleLists(t)},h.prototype.buildTrakSampleLists=function(e){var t,n,r,a,o,s,c,l,u,d,f,p,m,g,_,v,y,b,x,S,C,w,T,E;if(e.samples=[],e.samples_duration=0,e.samples_size=0,n=e.mdia.minf.stbl.stco||e.mdia.minf.stbl.co64,r=e.mdia.minf.stbl.stsc,a=e.mdia.minf.stbl.stsz||e.mdia.minf.stbl.stz2,o=e.mdia.minf.stbl.stts,s=e.mdia.minf.stbl.ctts,c=e.mdia.minf.stbl.stss,l=e.mdia.minf.stbl.stsd,u=e.mdia.minf.stbl.subs,p=e.mdia.minf.stbl.stdp,d=e.mdia.minf.stbl.sbgps,f=e.mdia.minf.stbl.sgpds,b=-1,x=-1,S=-1,C=-1,w=0,T=0,E=0,h.initSampleGroups(e,null,d,f),a!==void 0){for(t=0;t<a.sample_sizes.length;t++){var D={};D.number=t,D.track_id=e.tkhd.track_id,D.timescale=e.mdia.mdhd.timescale,D.alreadyRead=0,e.samples[t]=D,D.size=a.sample_sizes[t],e.samples_size+=D.size,t===0?(g=1,m=0,D.chunk_index=g,D.chunk_run_index=m,y=r.samples_per_chunk[m],v=0,_=m+1<r.first_chunk.length?r.first_chunk[m+1]-1:1/0):t<y?(D.chunk_index=g,D.chunk_run_index=m):(g++,D.chunk_index=g,v=0,g<=_||(m++,_=m+1<r.first_chunk.length?r.first_chunk[m+1]-1:1/0),D.chunk_run_index=m,y+=r.samples_per_chunk[m]),D.description_index=r.sample_description_index[D.chunk_run_index]-1,D.description=l.entries[D.description_index],D.offset=n.chunk_offsets[D.chunk_index-1]+v,v+=D.size,t>b&&(x++,b<0&&(b=0),b+=o.sample_counts[x]),t>0?(e.samples[t-1].duration=o.sample_deltas[x],e.samples_duration+=e.samples[t-1].duration,D.dts=e.samples[t-1].dts+e.samples[t-1].duration):D.dts=0,s?(t>=S&&(C++,S<0&&(S=0),S+=s.sample_counts[C]),D.cts=e.samples[t].dts+s.sample_offsets[C]):D.cts=D.dts,c?(t==c.sample_numbers[w]-1?(D.is_sync=!0,w++):(D.is_sync=!1,D.degradation_priority=0),u&&u.entries[T].sample_delta+E==t+1&&(D.subsamples=u.entries[T].subsamples,E+=u.entries[T].sample_delta,T++)):D.is_sync=!0,h.process_sdtp(e.mdia.minf.stbl.sdtp,D,D.number),p?D.degradation_priority=p.priority[t]:D.degradation_priority=0,u&&u.entries[T].sample_delta+E==t&&(D.subsamples=u.entries[T].subsamples,E+=u.entries[T].sample_delta),(d.length>0||f.length>0)&&h.setSampleGroupProperties(e,D,t,e.sample_groups_info)}t>0&&(e.samples[t-1].duration=Math.max(e.mdia.mdhd.duration-e.samples[t-1].dts,0),e.samples_duration+=e.samples[t-1].duration)}},h.prototype.updateSampleLists=function(){var e,t,n,r,a,o,s,l,u,d,f,p,m,g,_;if(this.moov!==void 0){for(;this.lastMoofIndex<this.moofs.length;)if(u=this.moofs[this.lastMoofIndex],this.lastMoofIndex++,u.type==`moof`)for(d=u,e=0;e<d.trafs.length;e++){for(f=d.trafs[e],p=this.getTrackById(f.tfhd.track_id),m=this.getTrexById(f.tfhd.track_id),r=f.tfhd.flags&c.TFHD_FLAG_SAMPLE_DESC?f.tfhd.default_sample_description_index:m?m.default_sample_description_index:1,a=f.tfhd.flags&c.TFHD_FLAG_SAMPLE_DUR?f.tfhd.default_sample_duration:m?m.default_sample_duration:0,o=f.tfhd.flags&c.TFHD_FLAG_SAMPLE_SIZE?f.tfhd.default_sample_size:m?m.default_sample_size:0,s=f.tfhd.flags&c.TFHD_FLAG_SAMPLE_FLAGS?f.tfhd.default_sample_flags:m?m.default_sample_flags:0,f.sample_number=0,f.sbgps.length>0&&h.initSampleGroups(p,f,f.sbgps,p.mdia.minf.stbl.sgpds,f.sgpds),t=0;t<f.truns.length;t++){var v=f.truns[t];for(n=0;n<v.sample_count;n++){g={},g.moof_number=this.lastMoofIndex,g.number_in_traf=f.sample_number,f.sample_number++,g.number=p.samples.length,f.first_sample_index=p.samples.length,p.samples.push(g),g.track_id=p.tkhd.track_id,g.timescale=p.mdia.mdhd.timescale,g.description_index=r-1,g.description=p.mdia.minf.stbl.stsd.entries[g.description_index],g.size=o,v.flags&c.TRUN_FLAGS_SIZE&&(g.size=v.sample_size[n]),p.samples_size+=g.size,g.duration=a,v.flags&c.TRUN_FLAGS_DURATION&&(g.duration=v.sample_duration[n]),p.samples_duration+=g.duration,p.first_traf_merged||n>0?g.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration:(f.tfdt?g.dts=f.tfdt.baseMediaDecodeTime:g.dts=0,p.first_traf_merged=!0),g.cts=g.dts,v.flags&c.TRUN_FLAGS_CTS_OFFSET&&(g.cts=g.dts+v.sample_composition_time_offset[n]),_=s,v.flags&c.TRUN_FLAGS_FLAGS?_=v.sample_flags[n]:n===0&&v.flags&c.TRUN_FLAGS_FIRST_FLAG&&(_=v.first_sample_flags),g.is_sync=!(_>>16&1),g.is_leading=_>>26&3,g.depends_on=_>>24&3,g.is_depended_on=_>>22&3,g.has_redundancy=_>>20&3,g.degradation_priority=_&65535;var y=!!(f.tfhd.flags&c.TFHD_FLAG_BASE_DATA_OFFSET),b=!!(f.tfhd.flags&c.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),x=!!(v.flags&c.TRUN_FLAGS_DATA_OFFSET),S=0;S=y?f.tfhd.base_data_offset:b||t===0?d.start:l,t===0&&n===0?x?g.offset=S+v.data_offset:g.offset=S:g.offset=l,l=g.offset+g.size,(f.sbgps.length>0||f.sgpds.length>0||p.mdia.minf.stbl.sbgps.length>0||p.mdia.minf.stbl.sgpds.length>0)&&h.setSampleGroupProperties(p,g,g.number_in_traf,f.sample_groups_info)}}if(f.subs){p.has_fragment_subsamples=!0;var C=f.first_sample_index;for(t=0;t<f.subs.entries.length;t++)C+=f.subs.entries[t].sample_delta,g=p.samples[C-1],g.subsamples=f.subs.entries[t].subsamples}}}},h.prototype.getSample=function(e,n){var a,o=e.samples[n];if(!this.moov)return null;if(!o.data)o.data=new Uint8Array(o.size),o.alreadyRead=0,this.samplesDataSize+=o.size,t.debug(`ISOFile`,`Allocating sample #`+n+` on track #`+e.tkhd.track_id+` of size `+o.size+` (total: `+this.samplesDataSize+`)`);else if(o.alreadyRead==o.size)return o;for(;;){var s=this.stream.findPosition(!0,o.offset+o.alreadyRead,!1);if(s>-1){a=this.stream.buffers[s];var c=a.byteLength-(o.offset+o.alreadyRead-a.fileStart);if(o.size-o.alreadyRead<=c)return t.debug(`ISOFile`,`Getting sample #`+n+` data (alreadyRead: `+o.alreadyRead+` offset: `+(o.offset+o.alreadyRead-a.fileStart)+` read size: `+(o.size-o.alreadyRead)+` full size: `+o.size+`)`),r.memcpy(o.data.buffer,o.alreadyRead,a,o.offset+o.alreadyRead-a.fileStart,o.size-o.alreadyRead),a.usedBytes+=o.size-o.alreadyRead,this.stream.logBufferLevel(),o.alreadyRead=o.size,o;if(c===0)return null;t.debug(`ISOFile`,`Getting sample #`+n+` partial data (alreadyRead: `+o.alreadyRead+` offset: `+(o.offset+o.alreadyRead-a.fileStart)+` read size: `+c+` full size: `+o.size+`)`),r.memcpy(o.data.buffer,o.alreadyRead,a,o.offset+o.alreadyRead-a.fileStart,c),o.alreadyRead+=c,a.usedBytes+=c,this.stream.logBufferLevel()}else return null}},h.prototype.releaseSample=function(e,t){var n=e.samples[t];return n.data?(this.samplesDataSize-=n.size,n.data=null,n.alreadyRead=0,n.size):0},h.prototype.getAllocatedSampleDataSize=function(){return this.samplesDataSize},h.prototype.getCodecs=function(){var e,t=``;for(e=0;e<this.moov.traks.length;e++){var n=this.moov.traks[e];e>0&&(t+=`,`),t+=n.mdia.minf.stbl.stsd.entries[0].getCodec()}return t},h.prototype.getTrexById=function(e){var t;if(!this.moov||!this.moov.mvex)return null;for(t=0;t<this.moov.mvex.trexs.length;t++){var n=this.moov.mvex.trexs[t];if(n.track_id==e)return n}return null},h.prototype.getTrackById=function(e){if(this.moov===void 0)return null;for(var t=0;t<this.moov.traks.length;t++){var n=this.moov.traks[t];if(n.tkhd.track_id==e)return n}return null},h.prototype.itemsDataSize=0,h.prototype.flattenItemInfo=function(){var e=this.items,n=this.entity_groups,r,a,o,s=this.meta;if(s!=null&&s.hdlr!==void 0&&s.iinf!==void 0){for(r=0;r<s.iinf.item_infos.length;r++)o={},o.id=s.iinf.item_infos[r].item_ID,e[o.id]=o,o.ref_to=[],o.name=s.iinf.item_infos[r].item_name,s.iinf.item_infos[r].protection_index>0&&(o.protection=s.ipro.protections[s.iinf.item_infos[r].protection_index-1]),s.iinf.item_infos[r].item_type?o.type=s.iinf.item_infos[r].item_type:o.type=`mime`,o.content_type=s.iinf.item_infos[r].content_type,o.content_encoding=s.iinf.item_infos[r].content_encoding,o.item_uri_type=s.iinf.item_infos[r].item_uri_type;if(s.grpl)for(r=0;r<s.grpl.boxes.length;r++)entity_group={},entity_group.id=s.grpl.boxes[r].group_id,entity_group.entity_ids=s.grpl.boxes[r].entity_ids,entity_group.type=s.grpl.boxes[r].type,n[entity_group.id]=entity_group;if(s.iloc)for(r=0;r<s.iloc.items.length;r++){var c=s.iloc.items[r];switch(o=e[c.item_ID],c.data_reference_index!==0&&(t.warn(`Item storage with reference to other files: not supported`),o.source=s.dinf.boxes[c.data_reference_index-1]),c.construction_method){case 0:break;case 1:break;case 2:t.warn(`Item storage with construction_method : not supported`);break}for(o.extents=[],o.size=0,a=0;a<c.extents.length;a++)o.extents[a]={},o.extents[a].offset=c.extents[a].extent_offset+c.base_offset,c.construction_method==1&&(o.extents[a].offset+=s.idat.start+s.idat.hdr_size),o.extents[a].length=c.extents[a].extent_length,o.extents[a].alreadyRead=0,o.size+=o.extents[a].length}if(s.pitm&&(e[s.pitm.item_id].primary=!0),s.iref)for(r=0;r<s.iref.references.length;r++){var l=s.iref.references[r];for(a=0;a<l.references.length;a++)e[l.from_item_ID].ref_to.push({type:l.type,id:l.references[a]})}if(s.iprp)for(var u=0;u<s.iprp.ipmas.length;u++){var d=s.iprp.ipmas[u];for(r=0;r<d.associations.length;r++){var f=d.associations[r];if(o=e[f.id],o||=n[f.id],o)for(o.properties===void 0&&(o.properties={},o.properties.boxes=[]),a=0;a<f.props.length;a++){var p=f.props[a];if(p.property_index>0&&p.property_index-1<s.iprp.ipco.boxes.length){var m=s.iprp.ipco.boxes[p.property_index-1];o.properties[m.type]=m,o.properties.boxes.push(m)}}}}}},h.prototype.getItem=function(e){var n,a;if(!this.meta)return null;if(a=this.items[e],!a.data&&a.size)a.data=new Uint8Array(a.size),a.alreadyRead=0,this.itemsDataSize+=a.size,t.debug(`ISOFile`,`Allocating item #`+e+` of size `+a.size+` (total: `+this.itemsDataSize+`)`);else if(a.alreadyRead===a.size)return a;for(var o=0;o<a.extents.length;o++){var s=a.extents[o];if(s.alreadyRead!==s.length){var c=this.stream.findPosition(!0,s.offset+s.alreadyRead,!1);if(c>-1){n=this.stream.buffers[c];var l=n.byteLength-(s.offset+s.alreadyRead-n.fileStart);if(s.length-s.alreadyRead<=l)t.debug(`ISOFile`,`Getting item #`+e+` extent #`+o+` data (alreadyRead: `+s.alreadyRead+` offset: `+(s.offset+s.alreadyRead-n.fileStart)+` read size: `+(s.length-s.alreadyRead)+` full extent size: `+s.length+` full item size: `+a.size+`)`),r.memcpy(a.data.buffer,a.alreadyRead,n,s.offset+s.alreadyRead-n.fileStart,s.length-s.alreadyRead),n.usedBytes+=s.length-s.alreadyRead,this.stream.logBufferLevel(),a.alreadyRead+=s.length-s.alreadyRead,s.alreadyRead=s.length;else return t.debug(`ISOFile`,`Getting item #`+e+` extent #`+o+` partial data (alreadyRead: `+s.alreadyRead+` offset: `+(s.offset+s.alreadyRead-n.fileStart)+` read size: `+l+` full extent size: `+s.length+` full item size: `+a.size+`)`),r.memcpy(a.data.buffer,a.alreadyRead,n,s.offset+s.alreadyRead-n.fileStart,l),s.alreadyRead+=l,a.alreadyRead+=l,n.usedBytes+=l,this.stream.logBufferLevel(),null}else return null}}return a.alreadyRead===a.size?a:null},h.prototype.releaseItem=function(e){var t=this.items[e];if(t.data){this.itemsDataSize-=t.size,t.data=null,t.alreadyRead=0;for(var n=0;n<t.extents.length;n++){var r=t.extents[n];r.alreadyRead=0}return t.size}else return 0},h.prototype.processItems=function(e){for(var t in this.items){var n=this.items[t];this.getItem(n.id),e&&!n.sent&&(e(n),n.sent=!0,n.data=null)}},h.prototype.hasItem=function(e){for(var t in this.items){var n=this.items[t];if(n.name===e)return n.id}return-1},h.prototype.getMetaHandler=function(){return this.meta?this.meta.hdlr.handler:null},h.prototype.getPrimaryItem=function(){return!this.meta||!this.meta.pitm?null:this.getItem(this.meta.pitm.item_id)},h.prototype.itemToFragmentedTrackFile=function(e){var t=e||{},n=null;if(n=t.itemId?this.getItem(t.itemId):this.getPrimaryItem(),n==null)return null;var r=new h;r.discardMdatData=!1;var a={type:n.type,description_boxes:n.properties.boxes};n.properties.ispe&&(a.width=n.properties.ispe.image_width,a.height=n.properties.ispe.image_height);var o=r.addTrack(a);return o?(r.addSample(o,n.data),r):null},h.prototype.write=function(e){for(var t=0;t<this.boxes.length;t++)this.boxes[t].write(e)},h.prototype.createFragment=function(e,n,a){var o=this.getTrackById(e),s=this.getSample(o,n);if(s==null)return this.setNextSeekPositionFromSample(o.samples[n]),null;var l=a||new r;l.endianness=r.BIG_ENDIAN;var u=this.createSingleSampleMoof(s);u.write(l),u.trafs[0].truns[0].data_offset=u.size+8,t.debug(`MP4Box`,`Adjusting data_offset with new value `+u.trafs[0].truns[0].data_offset),l.adjustUint32(u.trafs[0].truns[0].data_offset_position,u.trafs[0].truns[0].data_offset);var d=new c.mdatBox;return d.data=s.data,d.write(l),l},h.writeInitializationSegment=function(e,n,a,o){var s;t.debug(`ISOFile`,`Generating initialization segment`);var c=new r;c.endianness=r.BIG_ENDIAN,e.write(c);var l=n.add(`mvex`);for(a&&l.add(`mehd`).set(`fragment_duration`,a),s=0;s<n.traks.length;s++)l.add(`trex`).set(`track_id`,n.traks[s].tkhd.track_id).set(`default_sample_description_index`,1).set(`default_sample_duration`,o).set(`default_sample_size`,0).set(`default_sample_flags`,65536);return n.write(c),c.buffer},h.prototype.save=function(e){var t=new r;t.endianness=r.BIG_ENDIAN,this.write(t),t.save(e)},h.prototype.getBuffer=function(){var e=new r;return e.endianness=r.BIG_ENDIAN,this.write(e),e.buffer},h.prototype.initializeSegmentation=function(){var e,n,r,a;for(this.onSegment===null&&t.warn(`MP4Box`,`No segmentation callback set!`),this.isFragmentationInitialized||(this.isFragmentationInitialized=!0,this.nextMoofNumber=0,this.resetTables()),n=[],e=0;e<this.fragmentedTracks.length;e++){var o=new c.moovBox;o.mvhd=this.moov.mvhd,o.boxes.push(o.mvhd),r=this.getTrackById(this.fragmentedTracks[e].id),o.boxes.push(r),o.traks.push(r),a={},a.id=r.tkhd.track_id,a.user=this.fragmentedTracks[e].user,a.buffer=h.writeInitializationSegment(this.ftyp,o,this.moov.mvex&&this.moov.mvex.mehd?this.moov.mvex.mehd.fragment_duration:void 0,this.moov.traks[e].samples.length>0?this.moov.traks[e].samples[0].duration:0),n.push(a)}return n},c.Box.prototype.printHeader=function(e){this.size+=8,this.size>a&&(this.size+=8),this.type===`uuid`&&(this.size+=16),e.log(e.indent+`size:`+this.size),e.log(e.indent+`type:`+this.type)},c.FullBox.prototype.printHeader=function(e){this.size+=4,c.Box.prototype.printHeader.call(this,e),e.log(e.indent+`version:`+this.version),e.log(e.indent+`flags:`+this.flags)},c.Box.prototype.print=function(e){this.printHeader(e)},c.ContainerBox.prototype.print=function(e){this.printHeader(e);for(var t=0;t<this.boxes.length;t++)if(this.boxes[t]){var n=e.indent;e.indent+=` `,this.boxes[t].print(e),e.indent=n}},h.prototype.print=function(e){e.indent=``;for(var t=0;t<this.boxes.length;t++)this.boxes[t]&&this.boxes[t].print(e)},c.mvhdBox.prototype.print=function(e){c.FullBox.prototype.printHeader.call(this,e),e.log(e.indent+`creation_time: `+this.creation_time),e.log(e.indent+`modification_time: `+this.modification_time),e.log(e.indent+`timescale: `+this.timescale),e.log(e.indent+`duration: `+this.duration),e.log(e.indent+`rate: `+this.rate),e.log(e.indent+`volume: `+(this.volume>>8)),e.log(e.indent+`matrix: `+this.matrix.join(`, `)),e.log(e.indent+`next_track_id: `+this.next_track_id)},c.tkhdBox.prototype.print=function(e){c.FullBox.prototype.printHeader.call(this,e),e.log(e.indent+`creation_time: `+this.creation_time),e.log(e.indent+`modification_time: `+this.modification_time),e.log(e.indent+`track_id: `+this.track_id),e.log(e.indent+`duration: `+this.duration),e.log(e.indent+`volume: `+(this.volume>>8)),e.log(e.indent+`matrix: `+this.matrix.join(`, `)),e.log(e.indent+`layer: `+this.layer),e.log(e.indent+`alternate_group: `+this.alternate_group),e.log(e.indent+`width: `+this.width),e.log(e.indent+`height: `+this.height)};var g={};g.createFile=function(e,t){var n=e===void 0?!0:e,r=new h(t);return r.discardMdatData=!n,r},e!==void 0&&(e.createFile=g.createFile)}))()),CJ=class extends Error{unsupported=!0;codec;constructor(e){super(`unsupported codec: ${e}`),this.name=`UnsupportedCodecError`,this.codec=e}};function wJ(e){return e instanceof Error&&e.unsupported===!0}function TJ(e){return e.replace(/^hev1\./i,`hvc1.`)}function EJ(e,t){let n=e.getTrackById(t)?.mdia?.minf?.stbl?.stsd?.entries??[];for(let e of n){let t=e.hvcC??e.avcC;if(t){let e=new SJ.DataStream(void 0,0,SJ.DataStream.BIG_ENDIAN);return t.write(e),new Uint8Array(e.buffer,8)}}}function DJ(e,t){if(e.length===0)return null;let n=e.findIndex(e=>e.is_sync);n<0&&(n=0);let r=e[n],a=r.cts/r.timescale*1e3,o=n;for(let r=n+1;r<e.length;r++){let n=e[r];if(n.cts/n.timescale*1e3-a<=t)o=r;else break}return{start:n,end:o}}function OJ(e,t){return new Promise((n,r)=>{e.onError=e=>r(Error(`mp4box: ${e}`)),e.onReady=t=>{let a=t.videoTracks?.[0];if(!a){r(Error(`no video track`));return}let o=EJ(e,a.id);n({config:{codec:TJ(a.codec),codedWidth:a.video?.width,codedHeight:a.video?.height,...o?{description:o}:{}},trackId:a.id})};let a=t;a.fileStart=0,e.appendBuffer(a),e.flush()})}async function kJ(e){let t=SJ.createFile(),{config:n,trackId:r}=await OJ(t,e);return{config:n,chunk:await new Promise((e,n)=>{t.onSamples=(t,r,a)=>{let o=a.find(e=>e.is_sync)??a[0];if(!o){n(Error(`no sample`));return}e(new EncodedVideoChunk({type:`key`,timestamp:Math.round(o.cts/o.timescale*1e6),data:o.data}))},t.setExtractionOptions(r,null,{nbSamples:1}),t.start()})}}var AJ=2048;async function jJ(e,t){let n=SJ.createFile(),{config:r,trackId:a}=await OJ(n,e);return{config:r,chunks:await new Promise((e,r)=>{n.onSamples=(n,a,o)=>{let s=DJ(o,t);if(!s){r(Error(`no sample`));return}let c=[];for(let e=s.start;e<=s.end;e++){let t=o[e];c.push(new EncodedVideoChunk({type:t.is_sync?`key`:`delta`,timestamp:Math.round(t.cts/t.timescale*1e6),data:t.data}))}e(c)},n.setExtractionOptions(a,null,{nbSamples:AJ}),n.start()})}}var MJ=class{decoder=null;async decodeSegment(e){let{config:t,chunk:n}=await kJ(e);if(!(await VideoDecoder.isConfigSupported(t)).supported)throw new CJ(t.codec);return await new Promise((e,r)=>{this.decoder&&this.decoder.state!==`closed`&&this.decoder.close();let a=new VideoDecoder({output:t=>e(t),error:e=>r(e)});a.configure(t),this.decoder=a,a.decode(n),a.flush().catch(r)})}async decodeSegmentAt(e,t){let{config:n,chunks:r}=await jJ(e,t);if(!(await VideoDecoder.isConfigSupported(n)).supported)throw new CJ(n.codec);return await new Promise((e,t)=>{this.decoder&&this.decoder.state!==`closed`&&this.decoder.close();let a=null,o=new VideoDecoder({output:e=>{a?.close(),a=e},error:e=>t(e)});o.configure(n),this.decoder=o;for(let e of r)o.decode(e);o.flush().then(()=>{a?e(a):t(Error(`no frame decoded`))}).catch(t)})}close(){this.decoder&&this.decoder.state!==`closed`&&this.decoder.close(),this.decoder=null}};new Uint8Array([67,83,83,49]).length+1;var NJ=1129531697,PJ=1;function FJ(e,t){let n=0,r=1,a=t;for(;;){let t=e[a];if(t===void 0)throw Error(`CSI1: truncated varint`);if(n+=(t&127)*r,a++,!(t&128))break;if(r*=128,r>2**53-1)throw Error(`CSI1: varint out of range`)}return{value:n,next:a}}function IJ(e){if(e.length<6)throw Error(`CSI1: too short`);if(((e[0]??0)<<24|(e[1]??0)<<16|(e[2]??0)<<8|(e[3]??0))>>>0!==NJ)throw Error(`CSI1: bad magic`);if(e[4]!==PJ)throw Error(`CSI1: unsupported version ${String(e[4])}`);let t=5,n=FJ(e,t);t=n.next;let r=[],a=0,o=0;for(let s=0;s<n.value;s++){let n=FJ(e,t);t=n.next;let s=FJ(e,t);t=s.next;let c=FJ(e,t);t=c.next,a+=n.value,o+=s.value,r.push({tsMs:a,offset:o,bytes:c.value})}return r}var LJ=class{capacity;dispose;map=new Map;constructor(e,t){this.capacity=e,this.dispose=t}has(e){return this.map.has(e)}get(e){if(!this.map.has(e))return;let t=this.map.get(e);return this.map.delete(e),t!==void 0&&this.map.set(e,t),t}set(e,t){if(this.map.has(e)){let t=this.map.get(e);this.map.delete(e),t!==void 0&&this.dispose?.(t)}for(this.map.set(e,t);this.map.size>this.capacity;){let e=this.map.keys().next().value;if(e===void 0)break;let t=this.map.get(e);this.map.delete(e),t!==void 0&&this.dispose?.(t)}}clear(){this.map.forEach(e=>this.dispose?.(e)),this.map.clear()}},RJ=36e5,zJ=5e3,BJ=48,VJ=8e3,HJ=class{deps;fetchImpl;hours=new Map;hoursInFlight=new Map;bitmaps=new LJ(BJ,e=>{e.close?.()});bitmapsInFlight=new Map;constructor(e){this.deps=e,this.fetchImpl=e.fetchImpl??((e,t)=>fetch(e,t))}now(){return this.deps.now?.()??Date.now()}hourOf(e){return Math.floor(e/RJ)*RJ}async ensureHour(e){let t=this.hours.get(e);if(t&&(!(this.now()<e+RJ)||this.now()-t.fetchedAt<zJ))return t;let n=this.hoursInFlight.get(e);if(n)return n;let r=(async()=>{let t=`${this.deps.baseUrl}/${this.deps.deviceId}/strip-index?hour=${e}`,n=await this.fetchImpl(t,{headers:{...this.deps.headers},credentials:`include`}),r=null;if(n.status===204)r=null;else if(n.ok)r=IJ(new Uint8Array(await n.arrayBuffer()));else throw Error(`strip-index: HTTP ${n.status}`);let a={entries:r,fetchedAt:this.now()};return this.hours.set(e,a),this.deps.onLog?.(`strip:index`,{hourStart:e,entries:r?.length??null}),a})();this.hoursInFlight.set(e,r);try{return await r}finally{this.hoursInFlight.get(e)===r&&this.hoursInFlight.delete(e)}}async thumbAt(e){let t=this.hourOf(e),n=await this.ensureHour(t);if(n.entries===null||n.entries.length===0)return null;let r=WJ(n.entries,e);if(r===null||Math.abs(r.tsMs-e)>VJ)return null;let a=await this.fetchBitmap(t,r);return a===null?null:{bitmap:a,tsMs:r.tsMs}}prefetchAhead(e,t,n){let r=this.hourOf(e);this.ensureHour(r).then(a=>{if(a.entries===null)return;let o=UJ(a.entries,e);for(let e=1;e<=n;e++){let n=a.entries[o+e*t];n&&this.fetchBitmap(r,n)}let s=t===1?a.entries.at(-1):a.entries[0];s&&Math.abs(s.tsMs-e)<n*4e3&&this.ensureHour(r+t*RJ).catch(()=>{})}).catch(()=>{})}isAvailable(e){let t=this.hours.get(this.hourOf(e));return t===void 0?(this.ensureHour(this.hourOf(e)).catch(()=>{}),!1):t.entries!==null&&t.entries.length>0}async fetchBitmap(e,t){let n=`${e}:${t.offset}`,r=this.bitmaps.get(n);if(r)return r;let a=this.bitmapsInFlight.get(n);if(a)return a;let o=(async()=>{let r=`${this.deps.baseUrl}/${this.deps.deviceId}/strip?hour=${e}`,a=await this.fetchImpl(r,{headers:{...this.deps.headers,range:`bytes=${t.offset}-${t.offset+t.bytes-1}`},credentials:`include`});if(!a.ok&&a.status!==206)throw Error(`strip: HTTP ${a.status}`);let o=new Uint8Array(await a.arrayBuffer()),s=await(this.deps.decodeBitmap??(e=>createImageBitmap(new Blob([e],{type:`image/jpeg`}))))(o);return this.bitmaps.set(n,s),s})().catch(n=>(this.deps.onLog?.(`strip:thumb-failed`,{hourStart:e,offset:t.offset,error:n instanceof Error?n.message:String(n)}),null));this.bitmapsInFlight.set(n,o);try{return await o}finally{this.bitmapsInFlight.get(n)===o&&this.bitmapsInFlight.delete(n)}}dispose(){this.bitmaps.clear(),this.hours.clear(),this.hoursInFlight.clear(),this.bitmapsInFlight.clear()}};function UJ(e,t){let n=0,r=e.length-1,a=-1;for(;n<=r;){let o=n+r>>1;e[o].tsMs<=t?(a=o,n=o+1):r=o-1}if(a===-1)return 0;let o=e[a],s=e[a+1];return s&&Math.abs(s.tsMs-t)<Math.abs(o.tsMs-t)?a+1:a}function WJ(e,t){return e.length===0?null:e[UJ(e,t)]??null}var GJ=class extends Error{needBytes;constructor(e,t){super(e),this.needBytes=t,this.name=`MfraParseError`}},KJ=16;function qJ(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function JJ(e,t){let n=t.charCodeAt(0),r=t.charCodeAt(1),a=t.charCodeAt(2),o=t.charCodeAt(3);for(let t=e.length-4;t>=0;t--)if(e[t]===n&&e[t+1]===r&&e[t+2]===a&&e[t+3]===o)return t;return-1}var YJ=2048;function XJ(e,t,n){let r=8;for(;r+8<=e.length;){let a=t.getUint32(r);if(a<8||r+a>e.length)break;if(String.fromCharCode(e[r+4],e[r+5],e[r+6],e[r+7])===`tfra`&&(n===void 0||t.getUint32(r+12)===n))return r+4;r+=a}return-1}function ZJ(e,t,n={}){if(e.length<KJ)throw new GJ(`tail too short to contain mfro`,YJ);let r=qJ(e),a=JJ(e,`mfro`);if(a<0)throw new GJ(`no mfro box in tail`);let o=r.getUint32(a+8);if(o<=0||o>t)throw new GJ(`implausible mfra size ${o}`);if(o>e.length)throw new GJ(`mfra spans ${o} bytes, tail has ${e.length}`,o);let s=e.length-o,c=e.subarray(s),l=t-o,u=qJ(c),d=XJ(c,u,n.trackId);if(d<0)throw new GJ(n.trackId===void 0?`no tfra box inside mfra`:`no tfra box for track ${n.trackId}`);let f=d+4,p=c[f]??0;f+=4;let m=u.getUint32(f);f+=4;let h=u.getUint32(f);f+=4;let g=(h>>4&3)+1,_=(h>>2&3)+1,v=(h&3)+1,y=u.getUint32(f);f+=4;let b=[];for(let e=0;e<y;e++){let e,t;if(p===1?(e=Number(u.getBigUint64(f)),f+=8,t=Number(u.getBigUint64(f)),f+=8):(e=u.getUint32(f),f+=4,t=u.getUint32(f),f+=4),f+=g+_+v,f>c.length)throw new GJ(`tfra declares ${y} entries but the box ends early`);b.push({timeTicks:e,moofOffset:t})}if(b.length===0)throw new GJ(`tfra has no entries`);return{samples:b,mfraOffset:l,trackId:m}}function QJ(e,t){let{samples:n,mfraOffset:r}=e,a=0,o=n.length-1,s=0;for(;a<=o;){let e=a+o>>1,r=n[e];if(r===void 0)break;r.timeTicks<=t?(s=e,a=e+1):o=e-1}return{start:n[s]?.moofOffset??0,end:n[s+1]?.moofOffset??r,sampleIndex:s}}function*$J(e,t=0,n=e.length){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t;for(;a+8<=n;){let t=r.getUint32(a),o=String.fromCharCode(e[a+4],e[a+5],e[a+6],e[a+7]);if(t<8)return;let s=Math.min(a+t,n);yield[o,a,s],a=s}}function eY(e,t,n=0,r=e.length){for(let[a,o,s]of $J(e,n,r))if(a===t)return[o,s];return null}function tY(e){let t=eY(e,`moof`);if(!t)return null;let[n,r]=t;if(r>e.length)return null;let a=eY(e,`traf`,n+8,r);if(!a)return null;let o=eY(e,`trun`,a[0]+8,a[1]);if(!o)return null;let s=new DataView(e.buffer,e.byteOffset,e.byteLength),c=o[0]+8,l=s.getUint32(c)&16777215;c+=4;let u=s.getUint32(c);c+=4;let d=(l&1)!=0,f=(l&4)!=0,p=(l&256)!=0,m=(l&512)!=0,h=(l&1024)!=0,g=(l&2048)!=0,_=r-n+8;if(d&&(_=s.getInt32(c),c+=4),f&&(c+=4),!m)return null;let v=[];for(let t=0;t<u;t++){p&&(c+=4);let t=s.getUint32(c);if(c+=4,h&&(c+=4),g&&(c+=4),c>e.length)return null;v.push(t)}return{sizes:v,dataOffset:_}}function*nY(e,t,n,r){let a=n;for(;a+8<=r;){let n=t.getUint32(a);if(n<8)return;let o=String.fromCharCode(e[a+4],e[a+5],e[a+6],e[a+7]),s=a+n;if(s>r)return;yield[o,a,s],a=s}}function rY(e,t){return e[t+8]??0}function iY(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let[n,r,a]of nY(e,t,0,e.length))if(n===`moov`)for(let[n,o,s]of nY(e,t,r+8,a)){if(n!==`trak`)continue;let r=aY(e,t,o,s);if(r)return{...r,initEnd:a}}return null}function aY(e,t,n,r){let a=null,o=null,s=!1;for(let[c,l,u]of nY(e,t,n+8,r))if(c===`tkhd`)a=t.getUint32(l+12+(rY(e,l)===1?16:8));else if(c===`mdia`){for(let[n,r,a]of nY(e,t,l+8,u))if(n===`mdhd`)o=t.getUint32(r+12+(rY(e,r)===1?16:8));else if(n===`hdlr`){let t=r+16;t+4<=a&&(s=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])===`vide`)}}return!s||a===null||o===null||o<=0?null:{videoTrackId:a,videoTimescale:o}}function oY(e){let t=e.headers?.get?.(`content-range`);if(!t)return null;let n=/\/(\d+)\s*$/.exec(t)?.[1];if(n===void 0)return null;let r=Number(n);return Number.isFinite(r)&&r>0?r:null}function sY(e,t,n,r){let a=Math.max(0,n-t.startMs),o=e.samples[0]?.timeTicks??0;if(r!==null&&r>0)return o+a/1e3*r;let s=e.samples[e.samples.length-1]?.timeTicks??0,c=t.durMs>0?a/t.durMs:0;return Math.round(s*c)}var cY=8,lY=128*1024,uY=512*1024,dY=4096,fY=class{deps;fetchImpl;headers;now;fragmentCacheSize;smallFragmentBytes;initByProfile=new Map;indexByUrl=new Map;fragments=new Map;reads=[];constructor(e={}){this.deps=e,this.fetchImpl=e.fetchImpl??((e,t)=>fetch(e,t)),this.headers=e.headers??{},this.now=e.now??(()=>Date.now()),this.fragmentCacheSize=e.fragmentCacheSize??cY,this.smallFragmentBytes=e.smallFragmentBytes??lY}async readRange(e,t,n){let r=this.now(),a=await this.fetchImpl(e,{headers:{...this.headers,range:t},credentials:`include`,...n?{signal:n}:{}});if(!a.ok&&a.status!==206)throw Error(`byte-range ${t} on ${e}: HTTP ${a.status}`);let o=new Uint8Array(await a.arrayBuffer());return this.record({bytes:o.length,ms:this.now()-r}),{bytes:o,totalBytes:oY(a)}}record(e){this.reads.push(e),this.reads.length>32&&this.reads.shift()}throughputBytesPerMs(){let e=this.reads.filter(e=>e.bytes>16*1024&&e.ms>0);if(e.length<3)return null;let t=e.reduce((e,t)=>e+t.bytes,0),n=e.reduce((e,t)=>e+t.ms,0);return n>0?t/n:null}async init(e,t,n){let r=this.initByProfile.get(e);if(r)return r;let{bytes:a}=await this.readRange(t.url,`bytes=0-${dY-1}`,n),o=iY(a);o===null&&this.deps.onLog?.(`init:unparsed`,{url:t.url,profile:e});let s={bytes:o===null?a:a.subarray(0,o.initEnd),info:o};return this.initByProfile.set(e,s),s}async index(e,t,n){let r=this.indexByUrl.get(e.url);if(r)return r;let a=e.mfra;if(a!==void 0&&(t===void 0||t===a.trackId)){let t={samples:a.samples,mfraOffset:a.mfraOffset,trackId:a.trackId};return this.indexByUrl.set(e.url,t),t}let o=YJ;for(let r=0;r<2;r++){let a=await this.readRange(e.url,`bytes=-${o}`,n),s=a.totalBytes??e.bytes;if(s===void 0)throw new GJ(`unknown size for ${e.url} — no Content-Range, no byte count`);try{let n=ZJ(a.bytes,s,t===void 0?{}:{trackId:t});return this.indexByUrl.set(e.url,n),n}catch(t){if(t instanceof GJ&&t.needBytes&&r===0){o=t.needBytes+64,this.deps.onLog?.(`mfra:refetch`,{url:e.url,tailBytes:o});continue}throw t}}throw new GJ(`could not read an index for ${e.url}`)}async fragmentAt(e,t,n,r){let{index:a,timescale:o}=await this.locate(e,t,r),{start:s,end:c,sampleIndex:l}=QJ(a,sY(a,t,n,o));return{bytes:await this.fragmentBytes(t,s,c,r),sampleIndex:l,index:a,timescale:o}}async locate(e,t,n){let r=await this.init(e,t,n);return{index:await this.index(t,r.info?.videoTrackId,n),timescale:r.info?.videoTimescale??null}}async keyframeAt(e,t,n,r){let{index:a,timescale:o}=await this.locate(e,t,r),{start:s,end:c,sampleIndex:l}=QJ(a,sY(a,t,n,o));if(c-s<=this.smallFragmentBytes)return{bytes:await this.fragmentBytes(t,s,c,r),sampleIndex:l,index:a,timescale:o};let u=Math.min(c,s+uY),d=await this.fragmentBytes(t,s,u,r),f=tY(d),p=f?.sizes[0];if(f===null||p===void 0)return this.deps.onLog?.(`keyframe:no-trun`,{url:t.url,start:s}),{bytes:await this.fragmentBytes(t,s,c,r),sampleIndex:l,index:a,timescale:o};let m=f.dataOffset+p;if(m<=d.length)return{bytes:d.subarray(0,m),sampleIndex:l,index:a,timescale:o};let h=Math.min(c,s+m);return{bytes:await this.fragmentBytes(t,s,h,r),sampleIndex:l,index:a,timescale:o}}async fragmentAfter(e,t,n,r){let a=t.samples[n+1];if(a===void 0)return null;let o=t.samples[n+2];return this.fragmentBytes(e,a.moofOffset,o?.moofOffset??t.mfraOffset,r)}async fragmentBytes(e,t,n,r){let a=`${e.url}#${t}-${n}`,o=this.fragments.get(a);if(o)return this.fragments.delete(a),this.fragments.set(a,o),o;let{bytes:s}=await this.readRange(e.url,`bytes=${t}-${n-1}`,r);for(this.fragments.set(a,s);this.fragments.size>this.fragmentCacheSize;){let e=this.fragments.keys().next().value;if(e===void 0)break;this.fragments.delete(e)}return s}clear(){this.initByProfile.clear(),this.indexByUrl.clear(),this.fragments.clear(),this.reads.length=0}},pY=class{windowMs;maxSamples;samples=[];constructor(e){this.windowMs=e.windowMs,this.maxSamples=Math.max(2,e.maxSamples??6)}add(e,t){this.samples.push({epochMs:e,at:t}),this.samples.length>this.maxSamples&&(this.samples=this.samples.slice(this.samples.length-this.maxSamples))}velocity(){if(this.samples.length<2)return 0;let e=this.samples[0],t=this.samples[this.samples.length-1],n=t.at-e.at;return n<=0?0:(t.epochMs-e.epochMs)/n}windowKey(e){return Math.floor(e/this.windowMs)*this.windowMs}projectedWindowKeys(e,t,n){let r=Math.max(1,n),a=this.windowKey(e),o=this.velocity();if(o===0)return[a,a-this.windowMs,a+this.windowMs].slice(0,r);let s=e+o*t,c=o>0?1:-1,l=[a],u=a;for(;l.length<r&&(u+=c*this.windowMs,!(c>0&&u>s+this.windowMs||c<0&&u<s-this.windowMs));)l.push(u);return l.slice(0,r)}reset(){this.samples=[]}},mY=`low`,hY=10,gY=4e3,_Y=6,vY=6e4,yY=class{deps;inFlight=null;disposed=!1;velocity=new pY({windowMs:vY});lastSampleAt=0;pendingEpoch=null;running=!1;constructor(e){this.deps=e}async scrubTo(e){if(this.disposed)return`no-footage`;let t=this.deps.now?.()??Date.now();if(t-this.lastSampleAt>500&&this.velocity.reset(),this.lastSampleAt=t,this.velocity.add(e,t),this.pendingEpoch=e,this.running)return`queued`;this.running=!0;try{let e=`no-footage`;for(;!this.disposed;){let t=this.pendingEpoch;if(t===null)break;this.pendingEpoch=null,e=await this.paintOne(t)}return e}finally{this.running=!1}}async paintOne(e){let t=this.velocity.velocity(),n=1e3/hY*Math.abs(t),r=this.deps.strip;if(r&&n>gY&&r.isAvailable(e))try{let a=await r.thumbAt(e);if(this.disposed)return`no-footage`;if(a!==null)return this.deps.draw(a.bitmap),this.deps.onDrawn?.(),r.prefetchAhead(e,t>=0?1:-1,_Y),this.deps.onLog?.(`scrub:drawn`,{epochMs:e,depth:`strip`,thumbTs:a.tsMs,stepMs:Math.round(n)}),`drawn`}catch(t){this.deps.onLog?.(`scrub:strip-failed`,{epochMs:e,error:t instanceof Error?t.message:String(t)})}let a=new AbortController;this.inFlight=a;let o,s=0,c=-1;try{let t=await this.deps.locate(e);if(this.disposed)return`no-footage`;if(t===null)return this.deps.onLog?.(`scrub:no-segment`,{epochMs:e}),`no-footage`;let[n,r]=await Promise.all([this.deps.source.keyframeAt(mY,t,e,a.signal),this.deps.source.init(mY,t,a.signal)]);if(this.disposed)return`no-footage`;s=n.bytes.length,c=n.sampleIndex;let l=new Uint8Array(r.bytes.length+n.bytes.length);l.set(r.bytes,0),l.set(n.bytes,r.bytes.length),o=await this.deps.decode(l.buffer)}catch(t){return this.deps.onLog?.(`scrub:failed`,{epochMs:e,disposed:this.disposed,error:t instanceof Error?t.message:String(t)}),`no-footage`}return this.disposed?(o.close(),`no-footage`):(this.deps.draw(o),o.close(),this.deps.onDrawn?.(),this.deps.warmAhead?.(e,t>=0?1:-1),this.deps.onLog?.(`scrub:drawn`,{epochMs:e,depth:`keyframe`,bytes:s,sampleIndex:c}),`drawn`)}armPrefetch(e){this.disposed||(async()=>{try{let t=await this.deps.locate(e);if(t===null||this.disposed)return;let{info:n}=await this.deps.source.init(mY,t);await this.deps.source.index(t,n?.videoTrackId)}catch{}})()}dispose(){this.disposed=!0,this.pendingEpoch=null,this.inFlight?.abort(),this.inFlight=null}};function bY(){let e=!1;return{fire(){return e?!1:(e=!0,!0)},reset(){e=!1}}}async function xY(e){if(!e.hasVideoDecoder)return{capability:`unavailable`,reason:`no VideoDecoder`};let t=!1;try{t=await e.isVideoSupported(e.videoConfig)}catch{t=!1}return t?e.hasAudioDecoder?{capability:`webcodecs-av`,reason:`ok`}:{capability:`webcodecs-video-only`,reason:`no AudioDecoder`}:{capability:`unavailable`,reason:`video config unsupported: ${e.videoConfig.codec}`}}function SY(e){return!Number.isFinite(e)||e<=0?0:Math.min(4,Math.max(.25,e))}function CY(e,t,n,r){return e<t&&n<r}var wY=1500,TY=8,EY=1e3,DY=2,OY=50,kY=30,AY=[`high`,`mid`,`low`],jY=350,MY=1e3,NY=2500,PY=12e3,FY=6e3;function IY(e){let t=AY.indexOf(e);return t>=0&&t<AY.length-1?AY[t+1]:null}function LY(e,t){let n=AY.indexOf(e),r=AY.indexOf(t);if(n<=0||r<0)return null;let a=AY[n-1];return AY.indexOf(a)>=r?a:null}function RY(e){typeof e==`object`&&e&&`unref`in e&&e.unref()}var zY=class{deps;gen=0;audioArmedGen=-1;disposed=!1;dead=!1;requestedRate;requestedProfile;activeProfile;current=null;lastDrawn=null;cancelRaf=null;positionTimer=null;submittedUpToUs=0;tickCount=0;activeLoadAc=null;targetAheadMs;maxQueue;adaptive;abrFailingSince=0;abrHealthySince=0;abrLastChangeAt=0;abrSwitching=!1;constructor(e){this.deps=e,this.requestedRate=e.initialRate??0,this.requestedProfile=e.profile,this.activeProfile=e.profile,this.targetAheadMs=e.targetAheadMs??wY,this.maxQueue=e.maxQueue??TY,this.adaptive=e.adaptive??!1,this.scheduleDraw()}mode(){return this.requestedRate===1&&this.deps.audio?`audio`:`video`}log(e,t){this.deps.onLog?.(`wc-engine`,e,t)}supersede(){return this.activeLoadAc?.abort(),this.activeLoadAc=null,++this.gen}abortDead(e,t){this.dead||this.disposed||(this.dead=!0,this.supersede(),this.deps.clock.pause(),this.deps.audio?.stop(),this.cancelRaf?.(),this.cancelRaf=null,this.stopPositionReports(),this.deps.onState(`error`),this.deps.onDead(t??this.deps.clock.playheadMs(),e))}async seek(e){let t=this.supersede();this.lastSteppedTsMs=null,this.log(`seek`,{epochMs:e,rate:this.requestedRate}),this.deps.onState(`loading`),this.deps.video.reset(),this.deps.ring.clear(),this.deps.audio?.stop(),this.lastDrawn=null;try{await this.deps.ensureIndex(e)}catch(n){this.log(`seek:ensureIndex-threw`,{error:n instanceof Error?n.message:String(n)}),t===this.gen&&this.abortDead(n,e);return}if(this.disposed||t!==this.gen){this.log(`seek:superseded-after-index`,{gen:t,cur:this.gen,disposed:this.disposed});return}let n=this.deps.locate(e),r=e;if(this.log(`seek:located`,{epochMs:e,kind:n.kind}),n.kind===`gap`){if(n.nearestEdgeMs===null){this.log(`seek:ended-no-edge`,{epochMs:e}),this.deps.clock.seekTo(e),this.deps.onState(`ended`),this.stopPositionReports();return}if(r=n.nearestEdgeMs,n=this.deps.locate(r),n.kind!==`segment`){this.log(`seek:gap-edge-not-segment`,{target:r,kind:n.kind}),this.deps.onState(`gap`);return}}let a=n.seg,o=new AbortController;this.activeLoadAc=o;let s;try{s=await this.deps.loadRun(r,o.signal)}catch(n){this.log(`seek:loadRun-threw`,{target:r,segStartMs:a.startMs,superseded:t!==this.gen,error:n instanceof Error?n.message:String(n)}),t===this.gen&&this.abortDead(n,e);return}if(this.disposed||t!==this.gen){this.log(`seek:superseded-after-load`,{gen:t,cur:this.gen});return}if(s===null){this.log(`seek:no-run`,{target:r}),this.abortDead(Error(`no run covers ${r}`),e);return}this.current=s;let c=s.demux;this.deps.video.configure(c.video.config);let l=r*1e3,u=0;for(let e of c.video.chunks)if(this.deps.video.submit(e),u=e.timestamp,e.timestamp>=l)break;if(this.submittedUpToUs=u,await this.deps.video.flush(),this.disposed||t!==this.gen){this.log(`seek:superseded-after-flush`,{gen:t,cur:this.gen});return}this.deps.clock.seekTo(r);let d=this.deps.ring.frameFor(r);if(d&&(this.deps.draw(d),this.lastDrawn=d),this.deps.onPosition(r),this.log(`seek:decoded`,{target:r,painted:!!d,chunks:c.video.chunks.length,rate:this.requestedRate,codec:c.video.config.codec,w:c.video.config.codedWidth,h:c.video.config.codedHeight}),this.requestedRate===0){this.deps.onState(`paused`),this.stopPositionReports();return}this.deps.video.reset(),this.deps.video.configure(c.video.config),this.submittedUpToUs=-1,this.startPlaying(r,c)}startPlaying(e,t){this.deps.audio?.stop(),this.abrLastChangeAt=this.deps.now(),this.abrFailingSince=0,this.abrHealthySince=0;let n=this.deps.audio,r=t.audio,a=this.gen;this.deps.onState(`playing`),this.startPositionReports(),this.log(`startPlaying`,{fromEpochMs:e,rate:this.requestedRate,wantAudioMaster:this.mode()===`audio`&&!!r}),this.deps.clock.play(this.requestedRate,`video`),this.decodeAheadLoop(a),this.mode()===`audio`&&n&&r&&(n.configure(r.config),n.resumeContext().then(()=>{if(this.disposed||a!==this.gen||this.deps.clock.paused)return;let e=this.deps.clock.playheadMs();n.enqueue(r.chunks,e),this.audioArmedGen=a,this.deps.clock.play(1,`audio`,e,()=>n.audioNowSec()),this.log(`audio-master-armed`,{anchor:e})}).catch(e=>{this.log(`audio-resume-failed`,{error:e instanceof Error?e.message:String(e)})}))}async decodeAheadLoop(e){let t=0;for(;!this.disposed&&e===this.gen&&!this.deps.clock.paused;){let n=this.deps.clock.playheadMs(),r=this.deps.ring.bufferedAheadMs(n),a=CY(this.deps.video.queueSize,this.maxQueue,r,this.targetAheadMs);if(t++%20==0&&this.log(`loop`,{q:this.deps.video.queueSize,ahead:Math.round(r),ring:this.deps.ring.size,submit:a,subUpToMs:Math.round(this.submittedUpToUs/1e3),curChunks:this.current?.demux.video.chunks.length??-1}),a){let t;try{t=await this.nextChunk(e)}catch(t){if(this.disposed||e!==this.gen){this.log(`loop:exit-nextchunk-superseded`,{disposed:this.disposed});return}this.abortDead(t);return}if(this.disposed||e!==this.gen){this.log(`loop:exit-post-nextchunk-superseded`,{disposed:this.disposed});return}if(t)try{this.deps.video.submit(t)}catch(e){this.log(`loop:submit-threw`,{error:e instanceof Error?e.message:String(e),tsMs:Math.round(t.timestamp/1e3)}),this.abortDead(e);return}else await this.sleep(OY)}else await this.sleep(kY)}this.log(`loop:exit`,{disposed:this.disposed,genMismatch:e!==this.gen,paused:this.deps.clock.paused})}async nextChunk(e){let t=this.current;if(!t)return null;for(let e of t.demux.video.chunks)if(e.timestamp>this.submittedUpToUs)return this.submittedUpToUs=e.timestamp,e;let n=t.startMs+t.durMs,r=this.deps.locate(n),a;if(r.kind===`segment`)a=n;else if(r.nearestEdgeMs!==null)a=r.nearestEdgeMs;else return this.log(`nextChunk:exhausted-ended`,{tail:n,kind:r.kind}),null;if(this.deps.locate(a).kind!==`segment`)return this.log(`nextChunk:next-not-segment`,{edge:a}),null;this.log(`nextChunk:advance-run`,{from:t.startMs,to:a});let o=new AbortController;this.activeLoadAc=o;let s=await this.deps.loadRun(a,o.signal);if(this.disposed||e!==this.gen||s===null)return null;if(s.startMs+s.durMs<=t.startMs+t.durMs)return this.log(`nextChunk:run-did-not-advance`,{from:t.startMs+t.durMs,got:s.startMs+s.durMs}),null;this.current=s,this.audioArmedGen===this.gen&&s.demux.audio&&this.deps.audio?.append(s.demux.audio.chunks),this.deps.video.configure(s.demux.video.config);let c=s.demux.video.chunks[0];return c?(this.submittedUpToUs=c.timestamp,c):null}__nextChunkForTest(){return this.nextChunk(this.gen)}tick(){if(this.disposed||this.dead)return;let e=this.deps.clock.playheadMs();if(this.current&&!this.deps.clock.paused&&e>=this.current.startMs+this.current.durMs){let t=this.deps.locate(e);if(t.kind===`gap`){if(t.nearestEdgeMs===null){this.deps.clock.pause(),this.deps.onState(`ended`),this.stopPositionReports();return}this.deps.onState(`gap`),this.deps.clock.seekTo(t.nearestEdgeMs),this.seek(t.nearestEdgeMs);return}}let t=this.deps.ring.frameFor(e),n=!!t&&t!==this.lastDrawn;n&&(this.deps.draw(t),this.lastDrawn=t),!this.deps.clock.paused&&this.tickCount++%30==0&&this.log(`tick`,{playhead:Math.round(e),rate:this.requestedRate,ring:this.deps.ring.size,drew:n,frameTs:t?Math.round(t.tsMs):null,ahead:Math.round(this.deps.ring.bufferedAheadMs(e))}),this.adaptive&&this.requestedRate===1&&!this.deps.clock.paused&&this.current!==null&&this.evaluateAbr(this.deps.now(),e),this.deps.ring.evictBehind(e)}evaluateAbr(e,t){if(this.abrSwitching||e-this.abrLastChangeAt<FY)return;let n=this.deps.ring.bufferedAheadMs(t);if(n<jY?(this.abrFailingSince===0&&(this.abrFailingSince=e),this.abrHealthySince=0):n>=MY&&(this.abrHealthySince===0&&(this.abrHealthySince=e),this.abrFailingSince=0),this.abrFailingSince!==0&&e-this.abrFailingSince>=NY){let t=IY(this.activeProfile);t?this.abrSwitch(t,`starved`,n,e):this.abrFailingSince=0;return}if(this.abrHealthySince!==0&&e-this.abrHealthySince>=PY){let t=LY(this.activeProfile,this.requestedProfile);t?this.abrSwitch(t,`healthy`,n,e):this.abrHealthySince=0}}abrSwitch(e,t,n,r){this.log(`abr`,{from:this.activeProfile,to:e,reason:t,ahead:Math.round(n)}),this.abrFailingSince=0,this.abrHealthySince=0,this.abrLastChangeAt=r,this.abrSwitching=!0,this.setProfile(e,!0).catch(e=>{this.disposed||this.abortDead(e)}).finally(()=>{this.abrSwitching=!1})}scheduleDraw(){let e=()=>{this.tick(),!this.disposed&&!this.dead&&(this.cancelRaf=this.deps.raf(e))};this.cancelRaf=this.deps.raf(e)}setRate(e){let t=SY(e);if(t===this.requestedRate)return;this.log(`setRate`,{from:this.requestedRate,to:t}),this.requestedRate=t;let n=t>DY?`low`:this.requestedProfile;if(n!==this.activeProfile){this.setProfile(n,!0).catch(e=>{this.disposed||this.abortDead(e)});return}if(this.supersede(),t===0){this.deps.clock.pause(),this.deps.audio?.stop(),this.deps.onState(`paused`),this.stopPositionReports();return}let r=this.deps.clock.playheadMs();if(!this.current){this.seek(r);return}this.deps.video.reset(),this.deps.video.configure(this.current.demux.video.config),this.submittedUpToUs=-1,this.startPlaying(r,this.current.demux)}getActiveProfile(){return this.activeProfile}async setProfile(e,t=!1){t||(this.requestedProfile=e),this.activeProfile=e;let n=this.deps.clock.playheadMs();await this.deps.ensureIndex(n),!this.disposed&&await this.seek(n)}stepTimesUs=null;lastSteppedTsMs=null;timesUsFor(e){if(this.stepTimesUs?.key===e.startMs)return this.stepTimesUs.times;let t=e.demux.video.chunks.map(e=>e.timestamp).toSorted((e,t)=>e-t);return this.stepTimesUs={key:e.startMs,times:t},t}stepFrame(e){if(this.disposed||this.requestedRate!==0)return;let t=this.current;if(!t)return;let n=this.timesUsFor(t);if(n.length===0)return;let r=this.lastSteppedTsMs??this.deps.clock.playheadMs(),a=r*1e3,o=-1;for(let e=0;e<n.length&&n[e]<=a+500;e++)o=e;let s=o+e;if(s>=0&&s<n.length){let t=n[s]/1e3;this.log(`stepFrame`,{dir:e,fromMs:Math.round(r),toMs:Math.round(t),frame:s,of:n.length}),this.paintExact(t);return}if(e===1){let n=t.startMs+t.durMs,a=this.deps.locate(n);this.log(`stepFrame`,{dir:e,fromMs:Math.round(r),boundary:n,kind:a.kind}),a.kind===`segment`?this.seek(n):a.nearestEdgeMs!==null&&this.seek(a.nearestEdgeMs);return}let c=t.startMs-1,l=this.deps.locate(c);this.log(`stepFrame`,{dir:e,fromMs:Math.round(r),boundary:c,kind:l.kind}),l.kind===`segment`?this.seek(c):l.prevEndMs!==null&&this.seek(l.prevEndMs-1)}async paintExact(e){let t=this.supersede(),n=this.current;if(!n)return;this.deps.video.reset(),this.deps.ring.clear(),this.lastDrawn=null,this.deps.video.configure(n.demux.video.config);let r=0;for(let e of n.demux.video.chunks)this.deps.video.submit(e),r=e.timestamp;if(this.submittedUpToUs=r,await this.deps.video.flush(),this.disposed||t!==this.gen)return;this.deps.clock.seekTo(e);let a=this.deps.ring.frameFor(e);a&&(this.deps.draw(a),this.lastDrawn=a),this.lastSteppedTsMs=e,this.deps.onPosition(e),this.deps.onState(`paused`)}pauseForScrub(){this.supersede(),this.deps.clock.pause(),this.deps.audio?.stop(),this.stopPositionReports()}async resumeFromScrub(e){await this.seek(e)}startPositionReports(){if(this.positionTimer)return;let e=setInterval(()=>{!this.disposed&&!this.deps.clock.paused&&this.deps.onPosition(this.deps.clock.playheadMs())},EY);RY(e),this.positionTimer=e}stopPositionReports(){this.positionTimer&&=(clearInterval(this.positionTimer),null)}sleep(e){return new Promise(t=>{RY(setTimeout(t,e))})}dispose(){this.disposed=!0,this.supersede(),this.cancelRaf?.(),this.cancelRaf=null,this.stopPositionReports(),this.lastDrawn=null,this.deps.ring.clear(),this.deps.video.close(),this.deps.audio?.close()}},BY={video:e=>new EncodedVideoChunk(e),audio:e=>new EncodedAudioChunk(e)};function VY(e){return e.replace(/^hev1\./i,`hvc1.`)}function HY(e,t,n,r){return Math.round((e+(t-n)/r*1e3)*1e3)}function UY(e,t){let n=e.getTrackById(t)?.mdia?.minf?.stbl?.stsd?.entries??[];for(let e of n){let t=e.hvcC??e.avcC;if(t){let e=new SJ.DataStream(void 0,0,SJ.DataStream.BIG_ENDIAN);return t.write(e),new Uint8Array(e.buffer,8)}}}function WY(e,t){return new Promise((n,r)=>{e.onError=e=>r(Error(`mp4box: ${e}`)),e.onReady=t=>{let a=t.videoTracks?.[0];if(!a){r(Error(`no video track`));return}let o=UY(e,a.id),s={codec:VY(a.codec),codedWidth:a.video?.width,codedHeight:a.video?.height,optimizeForLatency:!0,...o?{description:o}:{}},c=t.audioTracks?.[0],l=null,u=null;c&&(l=c.id,u={codec:c.codec,sampleRate:c.audio?.sample_rate??48e3,numberOfChannels:c.audio?.channel_count??1}),n({videoTrackId:a.id,videoConfig:s,audioTrackId:l,audioConfig:u})};let a=t;a.fileStart=0,e.appendBuffer(a),e.flush()})}async function GY(e,t,n,r=BY,a={}){let o=await WY(e,t),s=[],c=[],l=a.firstCts??null,u=null,d=0;e.onSamples=(e,t,a)=>{for(let t of a)e===o.videoTrackId?(l===null&&(l=t.cts),d=t.timescale,s.push(r.video({type:t.is_sync?`key`:`delta`,timestamp:HY(n,t.cts,l,t.timescale),data:t.data}))):o.audioTrackId!==null&&e===o.audioTrackId&&(u===null&&(u=t.cts),c.push(r.audio({type:`key`,timestamp:HY(n,t.cts,u,t.timescale),data:t.data})))},e.setExtractionOptions(o.videoTrackId,null,{nbSamples:1e5}),o.audioTrackId!==null&&e.setExtractionOptions(o.audioTrackId,null,{nbSamples:1e5});try{e.start()}catch{}let f=o.audioConfig&&c.length>0?{config:o.audioConfig,chunks:c}:null;return{video:{config:o.videoConfig,chunks:s,timescale:d},audio:f}}function KY(e,t,n={}){return GY(SJ.createFile(),e,t,BY,n)}var qY=1,JY=class{deps;prefetchCount;constructor(e){this.deps=e,this.prefetchCount=e.prefetchFragments??qY}async load(e,t={}){let n=this.deps.locate(e);if(n===null)return null;let{bytes:r,sampleIndex:a,index:o,timescale:s}=t.keyframeOnly?await this.deps.source.keyframeAt(this.deps.profile,n,e,t.signal):await this.deps.source.fragmentAt(this.deps.profile,n,e,t.signal),c=await this.deps.source.init(this.deps.profile,n,t.signal),l=new Uint8Array(c.bytes.length+r.length);l.set(c.bytes,0),l.set(r,c.bytes.length);let u=YY(n,o,a,s);this.deps.onLog?.(`byte-range:load`,{epochMs:e,keyframeOnly:t.keyframeOnly===!0,fragmentBytes:r.length,sampleIndex:a,ofSamples:o.samples.length,startMs:u.startMs,durMs:u.durMs}),t.keyframeOnly||this.prefetch(n,o,a,t.signal);let d=await KY(l.buffer,n.startMs,{firstCts:o.samples[0]?.timeTicks??0});return{...u,demux:d}}async prefetch(e,t,n,r){for(let a=0;a<this.prefetchCount;a++)try{if(await this.deps.source.fragmentAfter(e,t,n+a,r)===null)return}catch{return}}};function YY(e,t,n,r){let a=e.startMs+e.durMs,o=t.samples[0]?.timeTicks,s=t.samples[n]?.timeTicks;if(r===null||r<=0||o===void 0||s===void 0)return{startMs:e.startMs,durMs:e.durMs};let c=t=>e.startMs+Math.ceil((t-o)/r*1e3),l=c(s),u=t.samples[n+1]?.timeTicks,d=u===void 0?a:c(u);return{startMs:l,durMs:Math.max(1,d-l)}}var XY=class{deps;decoder=null;config=null;factory;constructor(e){this.deps=e,this.factory=e.decoderFactory??(e=>new VideoDecoder(e))}ensureDecoder(){if(this.decoder&&this.decoder.state!==`closed`)return this.decoder;let e=this.factory({output:e=>{this.deps.ring.push({tsMs:e.timestamp/1e3,frame:e,close:()=>e.close()})},error:e=>this.deps.onError(e)});return this.decoder=e,this.config&&e.configure(this.config),e}configure(e){this.config=e;let t=this.ensureDecoder();t.state!==`closed`&&t.configure(e)}submit(e){this.ensureDecoder().decode(e)}get queueSize(){return this.decoder?.decodeQueueSize??0}async flush(){if(this.decoder&&this.decoder.state===`configured`)try{await this.decoder.flush()}catch(e){this.deps.onError(e)}}reset(){this.decoder&&this.decoder.state!==`closed`&&this.decoder.close(),this.decoder=null}close(){this.reset()}},ZY=(e,t=4294967295,n=79764919)=>{let r=new Int32Array(256),a,o,s,c=t;for(a=0;a<256;a++){for(s=a<<24,o=8;o>0;--o)s=2147483648&s?s<<1^n:s<<1;r[a]=s}for(a=0;a<e.length;a++)c=c<<8^r[255&(c>>24^e[a])];return c},QY=(e,t=ZY)=>{let n=e=>new Uint8Array(e.length/2).map(((t,n)=>parseInt(e.substring(2*n,2*(n+1)),16))),r=e=>n(e)[0],a=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach(((e,t)=>a.set(e,t)));let o=new Uint8Array(e.length),s,c,l,u=!1,d=0,f=42,p=e.length>13&&e.substring(0,9)===`dynEncode`,m=0;p&&(m=11,c=r(e.substring(9,m)),c<=1&&(m+=2,f=r(e.substring(11,m))),c===1&&(m+=8,l=(e=>new DataView(n(e).buffer).getInt32(0,!0))(e.substring(13,m))));let h=256-f;for(let t=m;t<e.length;t++)if(s=e.charCodeAt(t),s!==61||u){if(s===92&&t<e.length-5&&p){let n=e.charCodeAt(t+1);n!==117&&n!==85||(s=parseInt(e.substring(t+2,t+6),16),t+=5)}if(s>255){let e=a.get(s);e&&(s=e+127)}u&&(u=!1,s-=64),o[d++]=s<f&&s>0?s+h:s-f}else u=!0;let g=o.subarray(0,d);if(p&&c===1){let e=t(g);if(e!==l)throw console.error("`simple-yenc`\n",`Decode failed crc32 validation
113
- `,`Expected: `+l+`; Got: `+e+`
114
- `,`Visit https://github.com/eshaz/simple-yenc for more information`),Error(`Decode failed crc32 validation`)}return g};function $Y(){let e=Uint8Array,t=Float32Array;$Y.modules||Object.defineProperties($Y,{modules:{value:new WeakMap},setModule:{value(e,t){$Y.modules.set(e,Promise.resolve(t))}},getModule:{value(e,t){let n=$Y.modules.get(e);return n||(t?n=WebAssembly.compile(QY(t)):(t=e.wasm,n=$Y.inflateDynEncodeString(t).then(e=>WebAssembly.compile(e))),$Y.modules.set(e,n)),n}},concatFloat32:{value(e,n){let r=new t(n),a=0,o=0;for(;a<e.length;)r.set(e[a],o),o+=e[a++].length;return r}},getDecodedAudio:{value:(e,t,n,r,a)=>({errors:e,channelData:t,samplesDecoded:n,sampleRate:r,bitDepth:a})},getDecodedAudioMultiChannel:{value(e,t,n,r,a,o){let s=[],c,l;for(c=0;c<n;c++){let e=[];for(l=0;l<t.length;)e.push(t[l++][c]||[]);s.push($Y.concatFloat32(e,r))}return $Y.getDecodedAudio(e,s,r,a,o)}},inflateDynEncodeString:{value(t){return t=QY(t),new Promise(n=>{let r=String.raw`dynEncode012804c7886d(‰›•)((()>+ˆ*§§)§ˆ,§§§§)§ˆ+§§§)§+.-()(*)-+)(ˆ.7*§)i¸¸,3§(i¸¸,3/G+.••—š¡*(,˜ŽŽ(,3‡‡‰˜‡Š‰›+)2å:-œ),§H(P*DI*H(P*@I++hH)H*r,hH(H(P*<J,i)’^*<H,H(P*4’U((I-H(H*i0’J,^*DH+H-H*œšI+H,I*4)33H(H*H)“^*DH(H+H)^*@H+i§H)œi§›™3æ*).§K(iH“I/+§H,iHn,§H+i(H+i(rCJ0I,H*I-+hH,,hH(H-V)(i)œ’J.H.W)(i)’c)(H,i)“I,H-i*’I-4)33i(I.*hH(V)(H+n5(H(i*’I-i(I,i)I.+hH,i*’J+iHn,hi(I-i*I,+hH,H/’H-c)(H,iFn,hi(I,+hH,H0n5-H*V)(J(,hH/H(i)œ’J(H(V)(J(i)’c)(H)H(i)œ’H,c)(3H*i*’I*H,i)’I,4(3(-H(H,’W)(H-’I-H,i*’I,4)3(3(3H,H-’I1H+I,H.i)œH1V)(“J.i(v5(33H.-H(H,’i(c)(H,i*’I,4)333–)-§i*I*+§H*iHn,hiž73H,H(i)8(H+šJ+H)P*(H*’V)(J-“r,§H)P*,H.i)œ’H+H,“i)œ’V)(-H*i*’I*H+i)œI+H-H.’I.H,H-’i)œI,4)333Ã+)-§iø7i(^*(iü7I,*h+hH+iDn,h*hilI+i)I,+hH+,hH+iô7’H,c)(i)H+i´8’W)(œH,’I,H+i*’I+4)-+hH(H)8*J-i(p5.*h*h*hH-i')u,hH(P*(J+,hH(P*0J,H(P*,n50H+H,’H-b((3H(P*0i)’I.4)3H-i¨*n5*H-iÅ*s,hiž73H-i)œJ+V)&+I,H(H+V)æ,8(I.H(H*8*J-i(p51H-i)œJ+i¸7’V)(H(H+iø7’V)(8(’J/H(P*0J+s,hi73H+H,H.’J,’I.H(P*(m5(H.H(P*,s5.+hH,m5*H(P*(J.H+’H.H+H/“’U((b((H(H(P*0i)’J+^*0H,i)“I,4(3(3H(H.^*03H-i¨*o5)33i(73(3(3-H,H+i)žc)(H,i*’I,H+i)’I+4)33i)I-3H-3!2)0§K(i2“J,L(H,H(^*(H,H*^*4H,i(^*0H,i(^*DH,j(_*<H,H)P*(^*,H,H+P*(^*8*h*h+hH,i)8(I3i§I**h*h*h*h*h*h*hH,i*8(6+(),03H,j(_*@i*I-H,P*<J.i,’J(H,P*8J/s50H,H.i+’J0^*<i¦I*H.H,P*4J1’J.U(*H.U((J2›i')o5/H.U()I.H,H(^*<H0H1’U((H.i0œJ.i§›i0ži')™o5/H/H.H2šJ*H(’J.q50H,P*0J/H*’I-H,P*(J0,hH,P*,H-q,hi)I-423+hH*m5+H/H0’H(H1’U((b((H/i)’I/H(i)’I(H*i)“I*4(3(3H,H.^*<H,H-^*04*3iØ1U((5+i(I(i¨7i1^*(i$6iè1^*(i°7iè6^*(i¬7iÈ6^*(+hH(iÈ*n,hiÈ*I(+hH(i¨,n,hi¨,I(+hH(iØ,n,hiØ,I(+hH(iè,o,hH,i-’H(’i0c)(H(i*’I(4)33iè1i1H,i-’iÈ*8)Bi(I(+hH(ido,hH,i-’H(’i-c)(H(i*’I(4)33iÈ6iè6H,i-’iF8)BiØ1i)b((41-H,i-’H(’i/c)(H(i*’I(4)3(3(-H,i-’H(’i1c)(H(i*’I(4)3(3(-H,i-’H(’i0c)(H(i*’I(4)3(3(3H,H/^*0H,H(^*<3i(I*4*3H,H,i¸)’^*TH,H,iø-’^*PH,H,iX’^*LH,H,i(’^*HH,i-8(I(H,i-8(I-i¥I*H,i,8(I.H(iErH-iErš5)H(i©*’I1H-i)’I0i(i;H.i,’J(i(H(i(rCJ(“J*H*i;sCI*i¨1I-H(I/+hH/,hH,i-’H-V)(i)œ’H,i+8(c)(H/i)“I/H-i*’I-H*i)’I*4)-H(i)œi¨1’I/+hH(H*o,hH,i-’H/V)(i)œ’i(c)(H/i*’I/H(i)’I(4)33i¤I*H,iø-’H,i¸)’H,i-’i;8)5+H0H1’I2i(I-+hH-H2p,hH,H,iP’8*J*i(p5-H*i7u,hH,i-’H-i)œ’H*c)(H-i)’I-4*3i(I/i+I.i+I(*h*h*hH*i8“6*(*)3H-m,hi£I*403H-i)œH,’W)-I/i*I(4)3i3I.i/I(3H2H,H(8(H.’J(H-’J.p,hi¢I*4.3H,i-’H-i)œ’I*+hH(,hH*H/c)(H*i*’I*H(i)“I(4)-H.I-4+3(3(33H,W)1m,hiŸI*4,3H,iø-’H,i¸)’H,i-’H18)J(,hi¡I*H(i(p5,H1H,V)ú-H,V)ø-’o5,3H,i(’H,iX’H,i-’H1i)œ’H08)J(,hi I*H(i(p5,H0H,V)šH,V)˜’o5,3H,H,iP’H,iH’8+I*4+3(3(3H,i$6i¬78+I*3H*H3šm5(3i)I-H*i(r5)3H)H,P*0^*(H+H,P*<^*(H*I-3H,i2’L(H-33Á)+(i¨03b+(,(-(.(/(0(1(2(3(5(7(9(;(?(C(G(K(S([(c(k({(‹(›(«(Ë(ë( (*)(iø03O)()()()(*(*(*(*(+(+(+(+(,(,(,(,(-(-(-(-(i¨13M8(9(:(((0(/(1(.(2(-(3(,(4(+(5(*(6()(7(T7œ‰šœ‡Ž‰œš›*S7•œ‰Š”U”—Љ”›S0›‘–U œ`;$Y.getModule($Y,r).then(e=>WebAssembly.instantiate(e,{})).then(({exports:r})=>{let a=new Map(Object.entries(r)),o=a.get(`puff`),s=a.get(`memory`).buffer,c=new e(s),l=new DataView(s),u=a.get(`__heap_base`),d=t.length,f=u;u+=4,l.setInt32(f,d,!0);let p=u;u+=d,c.set(t,p);let m=u;u+=4,l.setInt32(m,c.byteLength-u,!0),o(u,m,p,f),n(c.slice(u,u+l.getInt32(m,!0)))})})}}}),Object.defineProperty(this,"wasm",{enumerable:!0,get:()=>this._wasm}),this.getOutputChannels=(e,t,n)=>{let r=[],a=0;for(;a<t;)r.push(e.slice(a*n,a++*n+n));return r},this.allocateTypedArray=(e,t,n=!0)=>{let r=this._wasm.malloc(t.BYTES_PER_ELEMENT*e);return n&&this._pointers.add(r),{ptr:r,len:e,buf:new t(this._wasm.HEAP,r,e)}},this.free=()=>{this._pointers.forEach(e=>{this._wasm.free(e)}),this._pointers.clear()},this.codeToString=e=>{let t=[],n=new Uint8Array(this._wasm.HEAP);for(let r=n[e];r!==0;r=n[++e])t.push(r);return String.fromCharCode.apply(null,t)},this.addError=(e,t,n,r,a,o)=>{e.push({message:t,frameLength:n,frameNumber:r,inputBytes:a,outputSamples:o})},this.instantiate=(e,t)=>(t&&$Y.setModule(e,t),this._wasm=new e($Y).instantiate(),this._pointers=new Set,this._wasm.ready.then(()=>this))}function eX(e){var t=t;function n(){}t={};function r(e){throw e}var a,o;function s(){var e=o.buffer;new Int8Array(e),new Int16Array(e),a=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),new Uint32Array(e),new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}for(var c=()=>r(``),l=()=>{},u={},d=e=>e(),f=()=>performance.now(),p=(e,t)=>(u[e]&&(clearTimeout(u[e].id),delete u[e]),t&&(u[e]={id:setTimeout(()=>{delete u[e],d(()=>E(e,f()))},t),timeout_ms:t}),0),m=Math.cos,h=e=>(a.length,e>>>=0,!1),g=e=>{throw`exit(${e})`},_=new Uint8Array(123),v=25;v>=0;--v)_[48+v]=52+v,_[65+v]=v,_[97+v]=26+v;_[43]=62,_[47]=63;var y={d:c,c:l,e:p,a:m,f:h,b:g};function b(e){x=e.i,S=e.j,C=e.k,w=e.l,T=e.m,E=e.o}var x,S,C,w,T,E;function D(e){e.h()}eX.wasm||Object.defineProperty(eX,"wasm",{get:()=>String.raw`dynEncode013bc58350c1ŸÉð|@|O€*X–Ø3R}@³ùÆöÁš†•ƒ¤½Cu­ÙFõ¶=}Vò–nою‰–X³ˆW‰~‰aGÕ5? Q= Ú†……Î…N= ‚W„ ƒeÇ¸ß3í=MÛßǹHÜjLvïêÀ:m°‰¹30‚‹>ÉX!¿b ýŽOýn
115
- ®Fj{øú¢ç=}(ݝñŸÜnŸ moǰ¥à•eò?È×µh
116
- ØW¨;Ñ aØX­æU{¤øàÖÕÀì·ÝÌ­íø±tâÔøeVO÷PÉ´È~ÃòsX1´ÊPyK·ÿ™ŒKZçµ ›W„Ñ¡¡_‘ ‘dÍ•í+]Õ~%Yïþîñ ¾Ú·”p[òß ¶ó÷y lhnn«²ù*¶Ìéñ®ï(éÇÃRÊÆRÌ-¬ÐoÒ”Ê2z+ä$‚:ÄsxÏ#Ït!MlBqžš§%Jè„ ƒ®Ä3ó°á¸eÅ_Ö=}iTÐ͆mo †ðbMpžl–¬E›P°e,¼Æju®ix>#}N€gd™ÿÇÄbç9WZÇ·n\†Öá1ڛÈt.ú6bì:û† ào¯ú4Ÿ“Ïø ü­zå¯#ÆkŸ‡M#úÿ9›ë:üÒÝëÚà†¡d”•%0ÒekÓ×mðƸ½ùÿ⇿Ò9 ›ÄgªÕÂ%ü¸» HÁMŽ#Âqˆ²~Œèn¯ Ûa_9j= ùÿR™èæÊó%Mƒ
117
- ’¨,Àæq%98‰a9%T—˜2)´z«9gsÒ‚Ö!”ZhRõRێyÕ²ŒÝ=M<Öcº »~VFÕÖx:þrޑðnŽ£x¦8.è†$K9þ¹úSnÍ3¦ˆv…üuºsÕñ=}œ1—=M5Zʕ¦CÿSÉ2×qÒ««S†˜a»ù±(¢º]ÀmÍh÷/¥3@sns2 –%7ù-Q|nÏoöjYÛ]}à2{€EB’êÎ6ƒ>ÁbÄü
118
- á, [DAÐuùjeN‹D‹ EëÔàZ‘ºlq˜»J /˲ájº‚ßCÃÝ1 b)øtN7Ê=}gÕ®òÍá§8²kDïû¤åÒÅóºc=M²= aË.ooèf€.QZj@bñ>qV©?æ• ƒxñˆR ô|_xw ê ˆ¸÷È¡ö"C¶œ2[¼‹ï¯¸©K†ŠmäºúZ€…¡%^°bóþ»-¼Ú¥ZIŽ(pþ…µS%øµã*Ò±8f:t¡éþ†õz¶<Äfñ*žöeP8AÓ¾/g×\С1Ï"= ¤ûGsW_¹ÔÈX Tãà‚uT™íEKPüݸ#åB¢ñ?:µßĬîFŽI8QY;X… ¶íŸ¦k{|¦éíà/fªi>´EÈoK= Š6¼l„Ör²ÿ*YǏv앭dàG{Ö,Gz½.gzSdïV%…’Š˜‰z“¥8¶²bO™¡2\nOžßV—¡S2KçK´”žUûu۝Ÿã~„f¾K)ÊÖ#´?#»ÅYƒXOøò T™CB}LUk,kÍ)]ŽíiEŸ^ÿyW)Ê»³= ô1_½úÌÞÊçýS¡‰
119
- »£jŒÆkžh Ð1˜G<è^àÙç?…æF¦Ç/ã«Eý6ZI¹tšl.‚aëül|„!&:MÓå?N@øËœÅf 6cì$w–,3~„17F=M𸳞°a‰õu\9æk ‡I—&>V®‡Æ/Øa´ †%¶¢],ÿ:±wäé¬áS¥FK±U¢±ÓPóŠßœ&“®ƒe€‘= ÍÍܯÏ×À@= Ø‹#‚Ðk[NCó÷À‚ÄÞŽGQRˆcnI}HGñ—\’ç­= öè^áygyDԋa©D”¦„…'ߣMߣPI¯à¨=}˜=MUÀ¸çy 9W½LšíU·ôzwzÃsÝZòŽÓ3ŸFž¸“—Á菣âƒÑ–’nՙ%‘Í¥k…á®=Mˆ×ŸGTÀÊøfëM-UF‡;ŠuåÙ#…X#‰—
120
- nˆ©ï֟DÅñ¸q ’,Թи;h¿åñŸ#µNÓ÷¸v} *ځ‡_= ãýØb6N–=MH§'®Iƒu¯78˜–‘ªÊÝ#42p´[/ƒ¿E= =MxƒåÄV§Ým©3?;bô9fb÷Ð'¨È˜IS7ñ >¬IÍÜK tçքJ 7û6ߥA/|BÏ›=Mõª‡w¿T¼91óí•ÒèœÔ_6»Âõˆªvg2ý¡‰õ÷Ò=}Å3ýXm²¬bˆÛ}U¬0œ¸Ük~e“
121
- aY¬ÈƒÛ•µ¨¢–0N„ñ¬t³VÉhÖYvx§˜"ǘ5\N'ªÂ£æKlÂ?þ{m¼‰ôê±ñÔ|L„m¬t_œ2%¤E„}Ù>›ÎFûalSXø²tRªÀ8 ¥£Å˜š™|ÖW›(Ù)\3Úwåì:›oíý±Y4ì©géµC³¨Q‰\ÍõMÕ„
122
- !J½6ë:ËgípoÒ=}I=}ëS¯¸…ƒž™F=}ÙT__U‰¾&\íÛ ¼Âkg#ú Ú¡ÀsÏÔTžµ³ÑËߊxNÉæGç^4Ñ¡%.¦U±O[ø¼4pͺš7܆âªcÔ¦¢:oŠu¹8ÌzîXfœ¬56DC´Þ]ӆž!=MOÀՉâGÖӝ«0¤–¿‘Å2ú
123
- éηNó“ÚÄr_Z)6y&2^F|#²ì‘36eòa¦rcLõ5Hö<r¼J!í¼©DøÓ@¨åPóˆfÑ£®›·§hQ®õ ½‡c±M¥W,ÝàŒÜ««¿‰¢Vmù| ˋ·wj$témè±°&í9yò‰µ“fæuC”:‡E@[RX\.qéuDýé(‹iao»]W5?I!z®ž¡±âàk—Ëý¼ƒLó–FµUM¨cEu’¼üÃFÔì€<@y´ÜøÆ#y«™µ‡à dMå@„šÛXüû¼á¾ù[CHºÀ[4ñ5z:ӆàV[B•Ò/I!ÕÓÂXj«ýH&o³©sFÍ&-ö«7d\X#>¦€yñÜÃMG”c~#‘!‡T ütŽ? ªÌ·«‰á¨É»ÕBms¸Û®0úBšjÛ(ƒ^ÓÅ®¤ÛF¹ÐmŒ›a)'¨ë(²ÄÞÍm²¦á¡B„á|”%«L¹a\×Ub= -f‹®Ž¢Ü¢«GÌSÔxÖXc‹Ãȋ‹ŸœŠÄh½4e#"‰'…;P >Rõo;%tÐC$g%Ä>70* *©cX— !C7€yôîËtO'j?óíÛµÁûH= I†ŽróÛ= kòwi‰J]€]þ†ßY÷{šŒŸmûpLÿÊe•LA¾À <½å…i­WÎ?o©t¡caâB¼iBüÛڈ¯:_î˜OJ7"\¥^­EPHQ”¼Cõ *{ÎÁIÅŝ$ÉVÇbo]XÆs)^‘H—²®wójÔÎE“6OÙÿŽsRͨEù9ž/²OÉQÿmåŸ«õ‡ØÆœZa;ˆÄ{ <}˜¸°Ró=MÖ²ý‰Üz´|´†pµÛá!cï‡ Æ,@zÃTŠ«¶d ³åoÙ-KŠyÁÓ4gß-²ÂŸxÊØÏ\@‡q&}eÔÂèŸ\ßÍT1Ï\kŸƒì÷Úw…é\À“Ä~<à¢e«4E¡/«Ä­aõu½=}l°Ã˜Në/J­å=}ÿ®!.N‘Š8…Ær)HÖ43¡C3Ôz/N :
124
- Ú7!Z†‹1Þqöž)M%"O7^+TɚêaF8øc’2ú%ù3}Ô²dU(™³͏Zň±£y¤aŠf¿Ï•][Hþ”s·Ù$EpFæt4¦$V‰ú
125
- í!hãV53øKéâ=}Nå22Úú"AÃ5£áª6ŽŽWÕæYôȂ^ AÜÍ)ýYÌúë¾a0= ºvéèŠ:‡7“Mô=MWsE²Š£²ÇL¿òÞ² —ܳJ+= 5æ+,>
126
- ¸M÷‰7jè;/_ý7ãzÈ)D÷·Ç4*È#†Ú¹"ó­!†z0 º—®“еZ*Šìx®
127
- R>sÚýP7Š:ƒ¯ZZ=MŒͅW²Dê6Ó^Nq= fÍbN¿VþÒª£;û<cVýî’媖“6§7dËÃ-²us¶Ò¹%·iÄs4òf N…(ᨔ|õ-yZ$E)—¹ï5¶Wí]Q\·1U9†:[-zQ¼—É7÷/þžiÉõ ¿«Ob)Iµñ0
128
- …lÁNpʦË-+Kfø»
129
- cù@®W¡‘Y,îuC6ZK¤é‰Ï²µI=}= óáÔÁ4´-ƒõfԔmõVÛvFÞÀç*=}éåú6™î®£³úÄßy'GD1dƒÕ±È"šx^ù1˜)DÚ'öŽ–\©^6Œ§ö_гîªZ|¾S= @$^*- 'ªÈÄb7ÎÜt7Z4©ö§–É…šU•hY{ÓÚh£ˆ ±TޗÁÉýҎRŒ‰7Ë †¡t¨‹<#Ĩ¡@EK7†Ïb3Uri)åw –=}ø»n#MMuœåÛ™Ä œ ¼ü‰÷´ÒuâÆ8¯¬œ»R6‘I¡WBòîtžnP=Má‹-0óà¤ÕƓ+¯KæÛc„âÑG½þÛÀFä7"ATMáu+mø ¼?ә^Ê?Ts÷ÁR7ñ³!åogã _ËRª«J$¼­Ž‚nÇ ‹h‘ ýõgcíÿ·ÅºÊ§~̂= @<Ûx¿a¥L¦ÃOŸ·—òi½ eûž…ÎL~tÞ/ˆ'ž…—­=M›$x@½tZŖYÖ&¼£]6o¹åۃѕv‹àMfgp£7ŒÇ6ùßkØ5˜i>9àlÊ Š>ƒÐ7w)ý;³(JKLª.z7ðfê2jÐ"£™Ÿ.SˆJ®“.çŠòìV\3(ÎÍ­Êt"´»µ¾¸[Œ
130
- ¸8Œ÷Ê+¶AúCñ&ÿøH]÷hly^Îàî ®ðgåA‰6í”KÊ7ÒäGo¿:ƒ¥G[Åþ¡«a¶GÞ¾Ž!â
131
- =MnB»ªÖŽ1ÔIZò2»JkëÆwùºÅtªŠ’¯xÇ»×utŠ#jà:æî‹OÒ6P¿èrñË×ôm2¸ÓJ±*h«koâ}»¯£F÷§÷¸”#aƒ®—ŠÅˆ.ùÌ/³3ځ9Vϗ[³22L[ŸÓ,ö«W &$/U›Vq* fÐ;F°®/Ѧ·qo:SCÚɼñ|¨íu09é±|Þ'­ÏYÍ. 5Cm;Àúñ=MmW8ÒSŸM³¦äHmsA^mÞ¢£Â©}‚oO21*‚ÒÃʋFbäT~¿P'7ÑDØÖW®äO{ŽZ»ž A ؄;t£82Jb^“:®ÇOß­v@r*o:×>·ûxGÌt/ë*Š”F:7ÝÁwd¾º›£D´{¢= ´¾˜3EK·‚<MÉ¿†8ÂìiÔÁ°r6Ö!F{'H§Ü
132
- y¢r‚Ín(2Rƒ—æQ{ Û»Ìg{¸G%~»¥QÜm$B˒¡[Ú®jþXè59[ô
133
- âRAÁïyw—ìüwrz˜)yhX#p¼èt!’1‹~^ h6kî^C6}hpBŽ{‘£Q5—x¿ÁoН= à ˆ£É<󛫀¡ìè31ÜÌç±3X~:ÚÂS~«3/÷9ÚJ8Æ~­^\¨Õ’ÀŠvȚØýd9zX|ÿ1¨‰
134
- = S^bÅ]É:×l÷EÜ1= ¦¼Ê
135
- T4’ÙCéhåìcÅ»èZ³}!©ð–:~^¯ãó*Mï8r€Úm}6S3–# ùÊ(%òYï¬%a¶¯N½Ž
136
- ï˜õ­î/Q ½É}I£Û£þ×ÍLtä,QMÊÚ0la; {Z½¥{é¹3§£:Nj´¸ÆbýÖÜÊÝizeµvýEärìY(£Î£Ô¾oþ3Š9hn,9øÚ¯Œúõyä¿Ôb4q
137
- ÏTÊî·ÑڝQÆï+zy¥0o”b;¢ÀŒï­ˆüÕçIò‡õ[I"îšY°â‰p×AÕ ‹# }êN92‚Üž'Ú=}Å®Õà¹Xg[9„ÿÐ58¿ŒCke.ÓÏ#êzü=}ÒGkÌ%Æ"èύ^q±R3
138
- =}*@Å@¹æÛir·÷³¸{Ôd«WžÈHÒ=M®Ôæ•æa!RqÄםóÁ—ᯍSÛ®?Ãëê ¨.ÃW§r+TSóÛ5_µ®cT8_WqP†ãtå!Wü= ºmµ¬È
139
- Ò+ŸKq¢¢–ãgõ ËÁY”bHG@¡™yt‡]NÖ¥¼~0X+ûx85&Bùž2—×Ûßoç¤›„AŠ:$'áôÑÀ9º|:ª °­zï:— ­$—Jo¯’«Ë›ÜÛ÷àŽSWîK5´ÁË$fÙÓ¨Ãޚ1£L š.uïÇ-ê{¹/&ê֒VÆcí[>£µآŵûȟ{-VÊm_°S›³òÀmªŸQ©FlaÞñíÏW¬D©lÑñ)ðss½ÎÿVƒBt LªS+¬KB\;ªå'þmd'=}‘ÈnÊu&þÚ®4Ps±ô°ñZ÷¹„(ÌýlÜ*M»N«Ïö:[Վ.lrP޽0™w¬žƒ=Mâ×sWíQx_ó‘?CA'
140
- Z“W-òªi±´¥²ÊMZ§æ†„dÀZÐùõ«š˜óZ—ófÉÑüÔè­\rN’ÀóV6Á69f•~6dOgD п”o>‚‘é#Y¾u?ØÞœØš-Ù±¶WE™ ¯=M^Ïè–bȽq—Úƒäqj ‘r”œ½ZmFïâjʘ4áÃ1XÒ93Oʚ´YöcÛj¥•[Èñ£@!9+ÿI™ üb•Fu#PB©ž
141
- DÑÌYíuÃàÓ+µ"—8“q1·ìÚ¸óTü-¤‘¯ïiõæ)êI÷ïсýÙ¤†£.У‘Û P‡¬A-|¸ëu¥ätj ì¬ÔåÔ8O¥ §IØqÍB¨|D8xò)ºmÕCڒßÒ‰j&ç’þâ&}D#² –Žš½Af9«‘œ ÛБÑW‚—ï^Àþ°w4Ì÷ÿ䣁–¦›ü-yÑ‘ïc®Tú÷5YQp'ùÆ×Íçj1vaî@;åQ‘ÃÀ~¶´‡õ|Ÿ}ñh×ébÔF„4\BÂC&ÿé>SB0qç=}„¤+«mÜp®¶-[—j7ÈÁ­(’bC´=}CѼ±‰§‰ =}Êx±µn†!üÍ@je ¾Ÿ…”Új¯œq!Ró6™×üv$2ÐCÿÞ2!ý^o›äuÏtmQ»ý)ËgÏ_¦npËv õâ;þª«âÍ×;sbŸû–ûoD³auæ³e<=}ÿaSªrýô‡:kû…Üuü>YÃWa³'ÞF{À¼‚ìrag‡ÞP-n£íñN¬X—ª½Z43<yþ²]•¡a®€‰ãˆK[³'· h~ÚW6xòv2ß:.Y¢vÐ|°3‚_”+Æ×@8±+p €e+©Æû |­Ãˆ\|. gè+âT%ç#0ÃêÛ|ò4Õ®ü= 6©Q?ŽÐ¾ô‡=}V–nqæ…ö«…ø{Õ݉­£y"ërk•Ün§ÛVK ý¯«¼2Ìäí½÷Á_9¸­O$6GÌljÜÁªYý»ï#ç[ދ&0¸5á# p*zÄɦ/¦†“ßõè{š»ú-%Ç Ž.¥ ×¾A?Ñ¥m0!{eõˆR,nÖ° íe .ˍ= \pÈÞ=}4”½²N\xÏnYÏÁÏ®»Ö½T¡Ðº.„^¿€èÝۊœ.@¸u9¼p֌Z•¹ÞÐöxjC%fڃl1 ÷þ¬Ñ­q…â|Tí*mc~‚
142
- 4:íd;8Å"7Jî^óðP<ª4 ïî‰rضgcŒ
143
-
144
- m©°áԅßjf+‰áˆÁCˆ®êAªiO!Ðp8!1ǙœÒë-J‚œö9Õp+mz¸ŸŽ…K#€ôxpGS øQP@c1)Ó ¢_·’=}ºøÁ€9VÙ£Þþ”ôŽbF0‡†C“Š±œózHþ, ÏÊ?d“gºŸPÙ6‹ ì҅òÐMþz’²ÓR½Šœ7d~t¾™óÍw¼äN×3†lVªk ·6­O@*%1‡ð®Ðùã͸iæ—hÔ3é6šåº¦•ªÐN:A6xð†–éÝË Œ=}¾\„š&Š¿Š§ß<Í=MS¼Ê¬ü8â÷/Þä:ô*4Äꃯb(çi@ñ¼‰(|«¥M$.'i3ÖL>\#qkºýþé–;3éy”M)"N\>'?9.ۋ6c7síÒÛ)°tU9QA5zòfvèð.+þèÃÐg?€»|îb$±)|9äáà’gJ…aJù[ÿh:©rÎxò¼…ÿ*­ h5z«ÅضKÚÛ¯èß«Àú½¾]•½íDØÙ¼mñx½E¯T£E·*%eúٚ=}å>òGG7Õ.ì(ö,(lÙ³‘¶°çÿßrê§@óOcZßëÏ/m|Ñ4J­ô-@dbºX’„…­þx.I*çÃ3†Ÿ†éÙx9dÚ*zQÙP;Òö›nk·—µ×ú­¤îB@ÇW[3îÉ"­Lhó Y["nÌH8‹<^¬ =}µ«|ͱ^·+„¤¬Å/3h^”Óìçç» *ãöøŽ5a¿3uýñ”Ì0 |‡jW˜p.m˜Þ.˜MÉłw*iìe|ÂSÈÊWÒ£é܅…Lb–é4–^&©SÉ«°çn‡›xŸ¨Jg­Ä9°XXî=Mƒñ”Ò?Ñ¢öN¿= 
145
- „AŽèWÜ õþ5¿Œ¡œ~ì "3nßÐ׿™â¨Bªœ3ÎNdֈ”b(,,âÿé®w䨏Â[ ”þ4þè|Çaán?C¦°¼èŒ{Üsîb>ûåxmîNúÿZ"Lˆß+ŽûŽŠ= ÞßO†…üwí·™¨Ÿî®Ü_‹RŠä± \Õ싱g?Òst¢œÌcÂÉ,ÊE9<ˆ{{ì20J”ù l{JDE¯= JõËƒaÿôÀ”‘bàè±Ôˆ¥hV>¡ %á:ƯîÈ%E3-8ð = öüönÑ[Q_fTp“EF€c½´ÇƒÖýc§P€ÄO€OdâŽ‹‹ +I„ÒRƒ%σ7 ¦Ãe¬ô®9¢2Ù*4
146
- EžòCñÔ·T†¦aG¯a*1HŽOX®Ï=}J¦¿†JæÂ mœ¯Jš1«uð¦JJw
147
- Ät̕ñVÔkMqیě=MTÏ&ïÌÒ9‰}¨â—nz™ìŸrµ³¤ñæ4lÔ=MΓ7l¾É-¿oœÐwàâf¯RìàÅXÿ“bÃfõÈS$y^x{u€—=M~ÿõ K¸x}ϵRÌ&¸ÿÕ Læ5; ¬©‰܏¤{³«0{ÿ¹g«êD¾ÓWFäQ ù—]±koÊBÖUÁ!ìö›rH~.LHþ wq>nGžÂ›SÕᛖÁÜ´';§§SÕþïM]•Ê"p'­ÚÅÞ«‡€äÕãZöêAè(¦ 7fa›&ÁÜ´§BçoGžEñ¡SÕ±üµÁܘ£1;Þ.t±aƒJ öL¥o:“]ôáŸÉÊ"¨ªh쏭*GÑ=} †1Ù•’BW'(–ßk{­T΀¾!ñ’ i2k˼´•wô|&¤Õꇂ·,Ú=M™¡oV¡î|8H€ÔùK$¥J(mˌßÝïOísˆ¹Cÿ½a”u^‘<ɔd•ƒƒó/%Š›í²Ýœá'_dKÉ;æó}:5­®Ì?9ÈdÒ¯Gúa’}{=}‰¡bG‚23bؒ26‰Þpâë@QÃÞoÜ«™–í¸Äî5…ß:¶9¹4¨·ó5}A·~¯m¥©ªs™{?ÓüôZ”3r‘èzÔUª¬<ur¥}uµmT{“~ƒc3!ºù(hŸŸ$‡ÙÄ5„!8Ýö¨疽ý½lÇ·ü^VfɎ£i§³væ·3ƒBmŸ;«­ä³ãVÁ©Òò"³ñëíëß§T…¬ý¦CÝHéôtàÔ1¦<¦še¶\qÚ$9­œ2¦>‘Œ-oO
148
- !ú)h“;qS£Ç@²ä™ÃԊw×Õê99© ¯”œOñ^á|mæé4´™áíiñI¥\¼)±Ù=MÛȎ¦c™îõy–4Œ~1uh\é=Mòðs=Mˋh瞬ƒ¹Ã§ Œ¥ Ò$IºQfK·•ƒ|ëpÆ©{Ù3?œñê‚ÑKòV¨ôÿ½ªÝyÎ'¯4oôØäï§cXŽ fy¬q:ž <|µ…ÿŸ9š$9jÒ[ÙÌc#KHÜL4&‹g|ÎÝ&°¥ô££ŸÖþ(µØ€2u”3:¾JptŸjb˜^/X8½Þñ!°.^Î97ÚØ úÉcDÉP–0ó ï>Ì~y5ïÍ{ÿgµ'Næ¤ö¾+Ùʕîiì–üXRjàF1Ïñ*
149
- >Œ>¦›s'ɟ™Øð§ãñ¥œA<uÍ'XV…÷“Fdœ}^ÿÑIL֋™Ó AÅÉL^P?Y©Oð)]i$pÿõ}/Là)[­Ø“k¹Vìå6ÃÙYï‡0ƒIß#³{Ç(ù*1$q?àôb;MìÁÜ´§=}qpGžv›rH~.Ó½kGžòû1G~.pklGžö›–ÁÜ´'uko¤\sñn}}̐_ÜhùåÌ7‹oʨ»èVÁ!ì›àœ£YV½èTÁ!ìL“
150
- kïF1—ãËÝ}ôÉFàß2¸½òŽŠ¿áW±RÄËÐðã󾘇!òýù©
151
- N~%sL¬cv®)iUïJ«]R¸yJ‹r\xÿö\œPƒ¸„‰i¯e¿)–JßÌÂM§Èñ–I
152
- LUŸz¦
153
- 1µØ,‰5ôq,:
154
- EC0P$θ>Â쥪+8ÌÀš]RPļ£cÎü‚´éÿô‰ÚĄî?sÜ$ÿÆSÇDô¸]OyÎ-j¦*<a¬ßıÔ)é)%ÙéTGB>]åC½;DbM_ìO˜ÎOCKà˜»O cè ¸~)½=}4׃«Ú¯Ù2‰=}!÷´âøŠ®&Òsªï6³™ªh
155
- ¶**8º7”¨;Çÿ2Ù»ªõef^n^n^^n^^^y˜ iµÔÙ÷Ä>ÍÒ<Œ.ø²±,ŒÀ6<
156
- .VRF é üÏ@¢®gsÖí'UQ×tF ×@¢¼@¢ŽQ‡Ü›Âûd±û‘xªÐ ÉäH§¸Ú†+
157
- ÍuBý*
158
- ¬E¤´a•#±¯uÌyÊQ”åÑÏzâØåjš¨sPðÉðn±Õ¼£ááH¬óGsz„‚¶5$>àAÆbŽT§¸ßäÓB÷ûÀ‚‹˅{Ž’³á…½À5ÍÞæÓ­«Éz5%Úþ„ޱc…*|ð)o÷ ·Kôàþÿ~ŒÙc0>ãvP«ŒA°K8·¡¹ÚªÑÖ·ùgƕwƂƮ,céuÎæ´ò'•ü
159
- Èeڗð—?enojÉGþ±âRÙòõòõ 1‘~%îPozá>zwVÊuR ‘âÞR†[¯¥J%ÕSæWT_Ñ7˚Wø1*¡=MÀYµ:¥ð•ŠZ·üø¦Âõ3JÂ5ýü¤Füœ“ºQҪ֒ êBvQTŸ²ç‰)–ŽÛ
160
- %çI¯«ù
161
- õç°|Õ ïiۅê~b¼ZQ&ûÕN²ùC²(^Äv¥Äëk
162
- §.øŒÇ‚ü
163
- –Ð|Q= ˆá& !I$±bö½Âí”9îmÔ ¶IyÖg×!ļi^(¬³óŠx}5'&¶Ž2ÎgL~à"Ùϐã›^ð“ãD~šaíBÄø ãSŒ þ<@4¥è»…i䉆b#ïèUÑUhèÏ왪L[ÙQ]©â_H•i_¾°Y™îœµ7vn¶ieՌØÈF³Êåš,ŸètK™ýKÉý™BS&ØŘw»0¤Èlûͼl£[= ø5»ƒ]›a8b„ȐUÎ-,‹zDÜ«dÏäsQ
164
- ¹.Ýõã¡c…o$'ð§ é‘ÞT-¦æm&ُŒ±äÄ1ÊÉLC|($àÛC؈³W/¸â ÉÇ@âAt‡VŒˆb¸“5Àœ
165
- Ý%‰ËÞËѼžjÀß¶ÛN¿2âaä_oÃ'°^Óå‡Þ’pòÏϒýóJHð¨6ñ â×xà»öX5¯;|J È†º©(Sèþó‹MZìÞ+à#·7¼£W˜»©6zªŽ¯w±ÆAƒHcËæï‚øÝÈ­ÐF[þ‘\…Wñ£Ò¨Éýó›ª<D šéä;$-=MõmN·çeF ³ï²½öaέX´.&ICÃ~üK NߓڏÉXKè‘a2C[ñëÇY³Ì™øöµÀvޞÿRë>SJ“®sºîÜwûöHÞ [8Y/‰£ä2ϾÖr÷2ûFI÷@+óWg#7,åûŸd¨Œ×ÞyµOÊ w놾B-—~ö×/X3Íè|êÊй"Ê.A ¦ ó ö‰DYêÖDJ»5èI0*U»}:ƒ]\€X]*»‘>Béúûücv= ž}#å
166
- â˪27,7]òÛ¼ìñýWÅ8'¼ êe~»7Œ¿‚ªFËru•ÙâWë Ä«=M= ÄÏÓXI–óoN8->Yƒ/~6‚H_ƒ­Ð¥Ä𠄬ª¢c]d)Má“lúr57§k~¼÷aÃÍL}WE;ÄۊG~Mê榷Å'D^ñ<™zJµŸ,ÂÅ8ùÈ©^ζËõihê?´àž˜’¿åh÷œ÷D3ˆÔ2ëh™ð"èç°í½0•°§Ä ëPHà:Yj“u™ûŸ])²® ØXÞÉçœ]ܗ‡Œiù±Zp}ZLƒ‡¾r
167
- Iˆñ>ˆßv¼>O¡W}kb—ꓞîô¡AIزuï֎ãíå¢Úpv¿!_ÿA¬¡!ò’Ë51@B¯~¨QÂQ¦G<‘ÜclHôµ†Ó˜Ê¶=}©”T¬3Œ*ÂDà˜"ÃsI&=Mª p"EéjÊ;їÂ}¾–¯˜,¶. Þ¦òòޏC!^ kŠLØJ.Ð%~Á:ʹš:xJ'wµ+Šz³TÊ% Â+6zjx¯4ÂgU¯¬ç¨ÀZdútÚ=M“¯^U¦r–NPÔæ„O£EÖ÷i§Â*ÄZþ^í¿ޞ£‚|þÁ|:y&{6g(<«K-•Y®ûðz©m-zQ€D¢ÄÃŖl“s(Ù$ÅK-ë3Îe´Ô‚j - ¼µËüÍTITÐ)¡âZW‘äV­ëã>Ûß#ÜÆo•3<= 2ӂ£¬è ZtFtLˆüªó#Å Ct-é>Œ¯„¤Ë$¿ªBe—x„ ¦ £õÌ!Ég©åïÍB~Å4¬}­‘ÊÕåÄÑc Ÿ©þ{¢ÆˆTêU!ҕ,Ph}ä~ôçˆéU©h½Ð=}š_0©ƒïŒþFn£k¨ÓýV‡Féýïc=Máv-÷Vn= v€¹Å†g͓¸^*5Ý$¯rÜ ÞRÄK&ÊfíåÃKÈÄA¦ò¯9iië:ٚ0´.šV f$= ™¥í. òù™ØË„ŸMIƄ«¦Ë•†‡ý0ËõW6õ“ 8 I¹]&kóNg–—ì3Û¶M²«hžc.‹ùN‚= TF%É1–=}Ô;ˆñ_•Öº6@Z² î뤋žpò—6]©rcˆºa¼o2ç¶á¡Y甎dDˆÌ±H×6íãí/f¹°֝#͹G=}ˇ¬ Q°Å‚w“õ ‡ùYY$waìÿ¿³ —ħß³º¸xù4ÐøÒ¯)Ãé*-± –øÐVö–F‚éœñ#œðj^´¬N Ã{þ0ø´-vHDšå)LN¡ñ2¿ÇIܪZ{‚Ñ ë:B6ßè>Ø=}ðaÃcJ-Á_ëâÀïþ‹Çðï ð^¿åN]ÆX¦-Ô¼^&†¢j~óFÅÜSÕß¼l bR»BØöÂÍ^‘—<p$k(kCÚç§=d{()ÌJýv\ e*X€É’Ž!¢)X’Â[¿ëö Êü¢JãÛW=}±«öuï^TÔâ«9¹O$ß֗Y€™‚°€LtZؖ= qåN›2UÔ}îÓÆ¯¼‡É‚à mÉM1g%²½£hÅq]„÷•h¨oÊ$¼e>B¥]e^Ñ'QÿL= ó‡¤J¨yɏ õ<ÛJDá‚hGƒ³d[bñz-wWªxýÙcö…cÎPÆx|«A’XÚÎɊRLæ›3‘cÁ+ôšäŠ\0Wyâ?î@·a‡º3z¦ÅÁp³ “‹=}"  Ë= L0¨ÝK¶Úõ“pi¬Y{¸#ø³[¯zãBw¿‰øØ"å³ò (Œmpß³=MI-Ûp´Œ 69¬°Âe<JíªíXy¶)›kô—0¦8»ýmIó%SœÑ'‘Ov³]ó§S—|M òsz
168
- ËÁ..ˆœ#ç¬A<ð<†‹£ãOàŽ'Ü\ò§"…ùxÓh*ÅPC~
169
- Òá‹(a?-ÍJtUÿU?…=}ó
170
- lÖöa­ß.Êl.f#þxñü÷D²WdÀTæ7ÔÁ'r¬Yï6£ëö“šƒ&©ðÎ'ìÎð9(G©òä:·kãúñêU‡às±=}àۄ€¢Ud¸ !;PN4RÝõ EK妋í¥ë iuõ½ïÕ©?sxž&Ì˔jï=MÍè£ÏœzÞ|\Ùâü%Ó§¿Ííƒà±Ço³×Op{v„µ²Ä=}ŠÅ/Q£Ig&[UèY}ˆoòÄ©.¥––>½öÔ½Ãd‚RN:Î]åj­W'ÃYÒàßEqJòuJtB‘éd‚IvRñyÂÖe?íb{æl‘WÆû°uÙ3-ÇQîfSÿ‡K²sÉÃ$mm!¼MTª(‹·Û-Cß?-\HXÚ=M \é¤JÜô¦5ta,}Z±Í¨JÃÑX¢¨šÀÌÝÈFk@ª) ĜK®YvĂ}™<h%&³ÀCn¶ØEß#êöp»žn¬ÉäNŒÓ²WA>t@f½l•oso{'òɌ™Î·ŠøðŸÂ§Å¶=}ÊûN…J%ú/ˆ%:pû¹=}'µ»K€'@'! åj1l?3XF–<·Úå¯nûܹjAÎFë »è®ò;1û Ç÷k{óvîžæu{°q±ûŸL“ WùXöñK™nìM¼0ügUi©X“²{¶vÒüËuÜ| XkېŸÆm’ø÷af?÷°ªB鏶@G#fˆç¶ÛêHßQ¨õÒ±Ëà¤à0§H¿ÊÑÌç* WyTf|éw›¼½2=}®
171
- ‘ÅÃÔn­VãoM+¨±fZò|ws´+ çÄ6Kd3‹JÊl¯Éf¯}Ä^̸¸8'Ãx[V‘ ¦õÉ&+Ó\ÚÜ]©ÃIÄ^©u]Œ3œv'?—êIÁpSy„mÒÙQ#Â7s濐•¿ÕÞý€èIt£1ªÔ=}Xàv$Õn¬Æþç-µ,Qñ*À·7w ʾä…û¤z°á×K¬¿ÐtÝpŒW‘ÌđÌÂT óBGJ¦XÄÐÃk܀„•^étpï3·Mêo¤"Æ»(­ÄŠ~jr¦æàè¨Gñ‘Nß(1.©iõË=Mƒ©”ÁuµSKù¹ãÝР…~Œä¹s;©êѤ”‡rw¶O«m¾ù–钘ܡ­Ú¢”ÒÌ'"°3³ÿM{v*W¸¶]¿ÿôèxBÖÛO ï= ;n¹Îf;7:•ÝÇ1½cÞ¾¼W+Ã3ƒ¸)ÿRHñ¢Þ‘Ùô¢¨ç‡t[¥Æa£hìl, ~˝äÔ
172
- 7ª=Mû’-ÅàêÒxýað!”gGÃÿ³Ë_½)“ýŒÚÅÜ %#ay!WÔxÀÀÝåTíϤŸ¹®ø;(gU¥´(؉MȲއ†‘:•gªýü(Ï0BÝc×éË@¹¦jœ‚Îoy쯶'½‹a>õiKÂÓ÷Åc$Ããöˍ›ûÏy_UÏwø—‹{ÿm«9’? cÞT#‹Mê8=}¶Pôì_’#µýì7¼c%?gÎ}Õ›üé։ÿmNЋiF(ã q…çoxh>—Nä«Ï¤&ÈkûÈ´푅´¿ª€Õn?èÀ²ÆšÿÔxoÚi÷ÃÚ
173
- ˆ]Ø;$3DƼ„â‡W2ڇÝ= ÃBdŠ“Q}ø’……ޱW¢Ü ZUNשð´žrr+Ëϲº$)¨†˜à>ê=M&Èt¬—Ë,º/ê|ÈÇ*½“U®î*¤ïŒßÚ=Má!$92™ÕávJ›ä
174
- Ž†°ò5gqa:#D8¹ÈX™qøë±Ã:°:ôŒ>+˜K¨U°*‡ YnçÑ:32ùuÀ"öë%Kæ˜P”¯]vÎ%¥§Ñ×@“üþ±Y×Òd !ÀÚ_“¨éH8ÄgÖí˜Ù«´‚äñŸ«TÀW4*…½
175
- 4Gœ?†ÊRÛÁ[ý©L@§÷MyjÐΊôzG{¯ZŽ„ÏB¼[UGjmGÑÛ†cK„ÔÜýH¢>Qì"^Ý,XÇȖ~ÿ[ ÷â‘ÑÔ«Gï—/ò[3†Ëm<¡IS?º ‡+R|+¾폽ú¯e3Æ¡½úC½zÇê@ºÌ€M7ôx÷cC9µAç_3ÎRÉ]ÃÊÃ}üò¦?ºˆD9“^zΙqü:s2k½¸|œ9½†¨´x!{hԕ_‡iû7ƒ-wýsÅõ»zz¼S R÷-²ma½üDy~½E
176
- Y¶:q‰gWýURDÏjr¥ú>ÏüP²¨!ê=Mº_¦æŒk„ÏצÏçØmx ,17Jds!¥žá¨mòmƒý}ƒÉÍêŠÙzZ‚ïƒTòŸ%‘¼ œó—õ‡Ó”µÁQ†9Ôõ= §ò‚UB~Üáìsæi_.zWb$fc+îÏ$vD3ôì i3€u z?ªD/9k¹.r¬ó)£ê‘ðY8üš¸£"BÆÁ‹£˜Ô¹Ëd¬jhôc¬¡GÐ×5u³Ð5è\é4-››ž–ÊsàlT2”ºá¥øÉÜ6n6°˜Þbpw !×^ßdžeÛ,cg rääÃq’È·1¤Å^™o8“®â¦dæWÂßTÎaF1sºíD¶×ø’Ÿ¯
177
- ’†Z"Ü/èœïúÝ aè}Ååãòl‚êÉAîÄ<ó˜ª}V=M“bÏ>Oɋl¥+ì'U¢ø¨Ѻ?ùZ¦ï³»ºÛI©³+Èuó҅›ÿ1,ܖ머Ç
178
- Y=}Dµ”¤ç:¥áTdL÷ϠG4¨‘Q¾îm1”ü-‹ôîûYV=}æñoF§É·mO„¯¯tÞx= ¥(…ô‰Ù‡¸ ðXå©Ü5‡XF!mã^½……³’'5ÁïF×¼å×eÂc­kyß<QÞ,hòo·âªãÁêº4 :¬kçÑÖñ•™ã‚NP»QÑ Xy°( ¯°•ºmö8tb[°‚–…rH]˜=}d›^ؘKäà=M §¾”Ûäˆ~ŽRîûYpã¥A–©ð©qpµî 3 (bèÜÿÜùˆêfÝÌ®F°I0H—ê²'/e¶éàÞ,Q†“:À)#Èi=}$\Ê\ÿù]̛<ÒþMÆ¢$¤ü˜o1X¿÷9ÇHLlÑkÑÌØª6uG¶>²Ï–äT‚ÝñvŒÔÀwRa]÷pxZì¹ð>ëꈤ÷ü= ÌJvÚ¬Ø AŽÄáŸÝfçë]„þúœ·ÚÇVêym3pÊÚÀDzÇ=}U"¾îÇÐhŠP8ˉ¹ž r‰8_Œû‡L.Տ”ìÑ^ªŒÐ% ¹˜òŠì¥¿4‚L[ùˆ“ɍcÛí8Ä@Ðhå1Hå™ãYf¡hê•6&‘ÈÔ¹~åAÇÿ¶‘ì™ï–­½,iu¸„+{
179
- Û0Çóæ8ÕãѨz3Žz?Nýhg1ç^7ȗ·= ž\ؒw‘a—V5QÅ¥Fö›ÒÂÇ©’•Q'³%cogžßgÓºÂò8_uÚ…ó.ǹS¥©†Š*¬h´ƒþ¯™¬€‘²v2z-Æw &[”ÿbIû^>;?ùΫ«ˆnTj‡ÅJÑQëóÈãÖ_öÔHeÞ®Ëtǂ¤S‘—žpnáøó¿ÌuµØ~‘YPLˆ½y4æÑ;!:«¸-ô"=}ƒÒˆ±˜§»X¨™‘Ýñ¡Ì§>ŸUâ>•Y㎜¾"çaFfe´·‹6e.Ã$NɌÔÃ_ü÷ÛßË:ücóŸ'¬ð[øé.‚àú‘/hè#Nyq*¢½ûÀá̓˜ž¦Bq!9š…;ögMgùÊ«®„ºÊ$£ûÌ̤ŸK’[Ïnv(ó„$±ã‚âÉÏ-
180
- Œú{ÂÅ,<ÊT8ö¤Œê}æõq¤!aü:ʨ†Ôû\¹I}ëT5Æ\Ïiÿ0QEïµ*€ñK’Œh7b¾gæ'ÐÂdƒ–[§ˆhsYàm£¹KP®pýîöñ輸[u/Ú¸= Y6 ÀYu÷²Ö™ŸÖ]r[7„bmj¨'æjòà†’lMO* nj·¤ñ1(*TىZûÇIîiÁ„þ’.ÖûS6Õb6yYìÒ$©iêã‡â{Š9DÖ[™0t *4šÿÐzº0ð*µÝJ7НRbšå‘§ ‚G'Ká
181
- è2xêy­.êä‘:kñnËÞ8ÖúuŠqhÛâ|èä(Æ5õ}v÷ƒêÍFŒ=MîX鳓mî´ü|pî´ÌõÆÅµÔ÷)jžDo…L¾6üc€Ö•tÞÔ,Æ3 eð_—‹Äšϊ.‰3ˆ,VöHDNå@ÔI؅hÈ1¾¸Šô"†§wt]CˆŽàñìßï÷\kò†§Ëkž¡—áŽÛØ<vÐJÞQi[ƒǢNª¹˜á¥¹$­t¹Ða‰&Á_r5×hzM8%
182
- ‘Îf93é.¸E¿ÒZ_=}̯ܛµ±œüˆù×fó ùž2½NQXE‰‰œÿZ ìt«î9’^z?êfô0Hf4†ê‰†êfá¤>P^^'­Öâh䪽œ
183
- à§÷Ê‘Z4t¯.®'c™Î÷þ!%n/ =}¤‚=}}Ú²SpŠêw½ËÖPçT¤–õßª—›U‹,2õVuPT8ÌÍ!YVÕ,,]^éyào7=M™RÇt]= ….&ùdDÒh­P\Œã¨›-FRÆx3´¿¥ûOªÄ:{·ª7A=}ÛEx¥=}VîAOúõL*þ¥ÑÚ¬,t .²ÑO·(—“ùqò×Q1 Iì(é¡U©ª_L ÷¼Ü j–mªÑm_{ŒÞQQõÔ}óköJ%¡ÚL£²ÆÓ uŠSU#zÓ*§ºl¶8BÐ"@b3ôÚzbÛvÈdӟÌg&á­ê†ühSÍw3È[©tÄn*\2¢ƒ¦à
184
- €v6ßyŠÜ0Íw)à×莚S{Ñ.Ò¦Íæ ÙbµîÑ<e„á_›ñB.½®u÷\'&nRTx)= Í=}-ˆûô¥Í.>€éô5) 'ý¨êëšçõª·õžJ+•mvä¯1= †9×µÄúb3®:†OaÌw†’;±QãJt= .÷g)–^=}%9Òwq9D>èÅí‚:9º_À$˜ÒÁ{cŸžÅ?°Nzí’ø~ÊY8Ä)#ˆ2b°µ#¢ix3ñȆiæ9“z¨ÿJæ“äë%<êR MÑÄQ†Ö2Ô–½aôcŠ5}t5ìø#Vñb Iò‚†j&=M¶Êwd!
185
- –é7™[ÀÚU*l6¸ïÙ©¡NIn%ä Ì%Gù‘Ñ6¨ uo•·6Å)=}PíÎîT=M쪇¤){èÐSX&P2¿Ü ÍvHÎâ¶Á3ÇÌð¹õ•-„êÂâ©s¥‚Ÿ¾¨ò-õ£seø«OۍˆÝ·ÔnW@e¤l4¯ ÏÞ¾Qj’AޕiòÈë,òPGPñ¾ŒwfQdSu^ïÿ+‡l©„ª£¡Eõ£){æ ìððõ⡌ÿ¬ Ôé
186
- £“’¶p™œ¾lø…w³”= ¡Km=}û5HàI§Ò–%S5x÷•i$¡;ÈwßôRxfaðZj&—h6æ‘é+4²èþ"ñ­Ð
187
- ú¤ UÚª–ô‰Æœß ‹Ø°†;¯Ê¹¸ùʧÈÖßoÑZ!ޒôÙÙʙ˜Ã¾#·/ÙÀ#P±/·/}¯1𮶏zÉöóýaa’â%
188
- â]
189
- ÷^ïCÙã¥þ]÷FvȊ­ÅHÒJŽ÷†Ùñs¦ÖGúìtp»²Xæßñ 3ÞFЉ}ÃéD½~ÚkíŽ]æd®ã±êµ×èÑèq1%¹ªÓåˆÌǐ-ù˜µ“Fø•I´ðìeò3ëí
190
- #1ñ)ì”)žÞ÷ÔÊ0­ÐÊ­ÈÊЭØÊÝ÷D"¢×ûƒ>öÑ X›>>>éÍ5u²m¦œÌdlÏg=MFSôS…QÄ@ט¬Gó^Ş£y©ZIdÉܟÌý—wË}E‡¬G0Tò0RñSòÜsÁ¡¬ßâ= É÷Ù¨+­•ÒŸ_)ƒ•Mv«<§•(ÁQbùÀÇ=}Þk¨jlŠ¿ÐŸ±ðØ÷ÙjÕ²"éñžpÑ¤Š“ûر¸Ø1\’†âÙ= û ÷áùTn¯8 1˜¢:«çùdõ¦ÖÝ'dd1&"†w2u„‚ù“†$Ì$Ì%üžÕÉïÁᐝ~’E£ÄâŤÆÂ€Ú¤JÙ©¡¤î= Wxòý%=}QÚÄ­šöªÖþošpgÇ Xr*—ôMR…#ìmÕ§Íœ‡˜õp-¥ÆÑaòÿL¼šÿÑ­͖±P‘3;‘Â^šW])³Ï ã™þm¨8e»êšÈÓ=MJ­„šUðPmr ¹-=}® Äy H LúRX(,Ð:‚Ž= Õ^',Ön¶j—ØÜiPW2(ŒÒ7©<:™4Ê:2N¸ÍÊ8²Ï.ýI4·I†"k¦$ô‘q{š øâ¹f „ñež1hªQ¼[_é2Nƒ™È´jQˆ°*YÉîÍϾÿÑ
191
- Ív@ØiúŒ!zڛ.>ÔZ³b]@ëúž“²çÝ+‡ ÑFPž†¹»áEZ¥›4œÈJ- Û£-ºzUØÛq3= Å´Ôw© P±-ÊQÊfYcÊ×Á_~%*©{غ)àŽÀ҇÷„ø'Öd¯Ý²Yíì»Ço!LÍ9ËË$+À5)„OŸ½È¯¡Éz؍ŽÊqAaûԊ“4IæÊxâ&[CÊ.¥iÂw×9iWœŽ°ÀC¸(^'‚©‚ÇÊTºL±uvý‘ÀQÉënðÈ¿œ·ö!CvH²’ÇxÎÚÉ 5ÒŸÃy¶ôÿúÍŎ-
192
- †>ÉÿHìæ U4Ό¯þ§½ûmÁȔÁÈ&mG”x¹¨‘¾Tc²Ø
193
- ªŠ|ð(JK¡+BN©ÅÝácÕ®ŽO©Å݈Œöd}´sã¶Ð©~Ýî#{µ/ÅÚM8özÂ)$WÜbªÀß÷Ùϲ‰$Ì4Tú2Ö©Ÿqƒ¥VµCÙ%<PÓHùQ^h ?•ܳó‡Þ38_Ó:Mu´[‚@ ®œ2 –È,q~*:C”Œâ©µŠÏ¶i¡Ø…b´_õRàag÷†֣á=MI…Ã(\|MdX^¥–dÞH¿¯¨®ÎEWöroODlÙ¶„£¥²‘r±í”òq%@ˌ}\âÇi"PÖ ›àÂôÆß®YZ¹£Î ÞLð'7}=}:‹¢ÿÊ$¬­¥’ßÐ:£v|Ÿ M,¯ÚE¹“y5§ôŸLšóx*Ó¶¢’—…•ð¢©½é®#;8@ðn5;˜…UŒ‡I¾…w$"-ÎÁuµíƒ±ÜÚ.Jû2¦Ó™Bì+²¢˜!Qȹi¤†Öù‹•¿ìà ÿ¹·QlBa!¤kh)ý‹¹Rª ¿}I2gԇ×BԯϬª/ @õ¦*;iÂØëފpݗ= ˜ÝÃd$= ?¦OržQИŸ½Ì"x¤ÙR ²fòW*s8|¼¸2‹†Ô ‹õ †ÂcÔQ´µªôÚ<…ã6Ñ?{Âj®Rj(ÏKáW뀳½Óې[¢"ka喠k¦Ðwï…­±bëýF¦ÞàYvôr€H¨Z>èç/‰Å”¿ËTtºã#:}@÷Žæ(2Ö}væ}” ÑØI‰xÕ¨N”ÏxúÿIMc޶Òå—wšt‡J»Ç¢Ð>Q{‡Ôòh.ph.ù¡]ƼÔ¹&•¯áMÐy]­LÌÆ¥µÿ³·á*ùPŽwãSÛ|">4·[U8
194
- I‘®ð,õžï4\\A ÿb‰5+]Q—RL&5ãh£\”ÆE!ƒs1Ïı+2pӆôύ9¶ÖŒR˜¡¶m)5!^PqÏRf%\€hR'„ñ›«òSßî˓††ÍH3íÿÌ'RݯþÙJñŠÝ©–\\PVQÞ{e‡wjÍî=}ƒMå uçbÕõ·Ð?˜Âߙmìš\¡2΄‚d©E•G¥G= Ê}-ƒ¶Ùw¸R ¢zy(Ï¡Xê¿q½ö±»ýø6›v›ÞÄ7«¨¹Ü Ø=M†Õh •{çÓ]ñ1)%Ðj£TNˆqƒõœ~r¥à×õð耥®x¹BûÛèbÍ¿–‚õ-Ò¹Òæ\¤_BAý‡Q±¨4²”|×>9ŸWP®&ÊëMèØ¶&{ÑîGb¢è¦=ME…èÀ¶eî¯a=Máә€!jvñ‘#ÝÔ¦–D¨¯|;ÈRRj"éFÅ{1ÿÏr< ŽÑÄwöžå¾zÈù’Çy© ­13'&7x.uzØ"
195
- £JßóÀ@ƒ ù~TMS°@Ù\ê= ‚óe%Ñâ§mþ÷fRôAäêtjõ3I–á‹rˆ4&¤×ùÍÜ´¼Ý|Õ¥ñ³˜çBäœ!vØéX˜x˜Õ²§DˑR<˜€=}~aXuä·%Ì Ðñ—+µ‰Á–º
196
- %*g(X’ⱓ3÷ñX0ËOÊGË>Å=Md[[hg®1·D!v&/íjoô®bü= T?iBÔØ= ªX+óq6Eôyˆ‹ã a·–ÂXI¡—ª“bp¬š{•q¦-¤É­õ¢ÀÕgÚCD®±±¶ÑNŽ™?fÇ¢Ò —žlÙ­˜ûnHê¸!zþŠT”Š”hl¿VÖY5*Tº=M-füfè/”4;)
197
- «€é‚áh»¯Ü’dFÎrhÈûåžJSùáÎW¾’^7<gøò¬
198
- ÌT{Ž(êw€q¥â~-ß§“O yú^’yåæ;íšÎˆûPyÉ?÷øÆñʖµâþu¸|pa×ÅÐøj&
199
- >‰c*Ò¯1ˆ½xÈ«µwSîÃðIðO3XˀKÉ(tì66þ<çÊñ2J /bÝ}täëåq¦¸â$à’±™­G…SC°Þý§îá.èKëí
200
- ‚a„/–Z¸ðWöI¦(|R)dzÖL²,¦Þë™J¡±âM ô{ֈ㈨Œñµ«¯Î'~7,[‡‘¸ˆÌ,:Ø'zÊ9WÊlœLA—Ä›ÊK/x¼<Æí·1äÕ:½Ö¦ }ȗ¦qÑûŸÚá~†p.
201
- ž
202
- -Ù0ùýÈ= H3Âm°nOzªxŸB 4$o÷·V\…nÐà‘+“wÅV¬–® âhþ šä t¶5Nþt*6FΧû¿¿}¾Ë\¥™^igi×/._'*öÃq=}Ì=M½£á9 ?LÕÓ&­s”Ä& Ø>:Áê7žWP7'z4üºÓ‹.¦0àr"˗Nͨ °Yñ!Uñ€¤¤Óƒ&¤0 ;ˆäL= ÝD¨ŒKÃ÷Ò¿ëYžF‡Šb#2¹ôñ¸ÑÑxšì¾[/Ë·Ø¡ßyƒ9? 7s*‘Ž$‚OaìÃ=}ºñËÃàφ¿ZCəà×å…}ÆÏ³ŽÃyÈ"¦ø7ã L1 äÛqhžlfó=MȨÐZ^sfú싹ž‘9ÈLsrÂÝå|›.Á%Jðó•×zƂZŠ™¶C÷òK‰IÉÕkd
203
- Ü„¹ Ú·/v’Í6²å®v±i·4M0ñ•d*-ωÿFËÞ,X,K†îºi´å÷¹) Z6±ÊlãÙ, -G¡Y$ÒŠ+†•þÒ"‡ Y8 /©txÙ $”îæ±
204
- ݱZîÊ'bG0}av1„¶µy©"²'ä0ô-^1‡Äl“yž"â(-7p轕þ<Õk5}Jބ¦ýé":­R톲g:»…®ðuv²Io¥ÇUÝ{èÐ!Õ"fl.šW²½'š>4ŠN¨cóxí *ÃÅöèžì¼„qi‰ï hò7Ÿ·UÚ£«Ü…™ ¬g$ÝèŒõÞ¨îÜ1cÌ(ßçÉå^cãÅ- %Q>ø$Î k†Kœÿß·µ‚Øæ¬:è¼Ãƒyz…µ.R­wÃkÈ Ú,Ñ;Õ¸»^O¥' 
205
- ræï½|Ð:¯7Ú=}|ù¦õǃk'ð¯÷0ŀ·ÝŠêwµ˜²xï.WMyH¡Æ=M
206
- څÏò©ì/3_˜šÖ=M ²ü|a÷²=MÄÙ¶We©ÏäN™¹?ï×Ñ^W*s€zý~†N‚櫤Ôèímܸ«óŸä³›Ä´q9òKKZ³Û]ÂMÞеuڝÓOôxIäõ„x¼H&D'#È8Æö¥ÃrɄi ª°ÅÎYGy ñÃÐN†X۳ٗªO2¨X„¦Y=MÓ"¦&Æ' Zô2’¸IÓÃw6-®›ÐŽ€¯SïÉ÷ŠÀ»-Q9ÅÛ¡TV\å>CÇØ¡òo[+lžÞéQnU¨k®ïn ³_Λ>ø 9ß-§¼?A(QD]>ýßOɪÝ:ï´hy'„ÍRÔežL ‚Ðĺ”.jÚ-j̺¤4Қ(põ§°7­>‡ˆ­·G|wÙP¦êyÉ[YÚ/›Þ5?½³wòžZ= V}Äú;5l>û(ôûíy ¬Ú}bT2W lI7&Ò´j~®ÇvbñÁskóJ¶ ‰@æޜÚÀ"ÿ±
207
- ՚›™˜±6kVñòšòpù¸ÅªTyò½ÄE&ƒÞë^“·U—­I¼HÍeÈÝ'œˆ©L½8"ýÓTƓ#…Pº‰€n…C6ÉÏàWíPšÜ}9ÅŕhoÃ'ÃR9«“žx˜®]î*§__G¦TŽtòÛ×ΕJ}Þ(QjÈü³å /œìúJ®ó·ÿy'N"ÂÚVô/%7IEô@äµ,»jlg’~=}UQÃÌÉÁ dh‘È\SPbTzÒUUÔq‰øÖ±ÈÌGÕY.N ¾h=}ÔãiÆw{ÈèLºÒ;·$—­k¥ç<”p‹®×
208
- *¥2ÕÁbÆeý‘£³å–¢ØRŔRwîé'øa&a-þ*Hl¶ba”iç%¦/EÐX33"ݳêé|hÈp-ÆVÊ7= fþ‹j<ÚgG°¹ Êp8ÆAºšù ؼó–U7€S7hH9]G9ÑAºLAº†¾ú êB3HBºSrW7s›¬ÞüšnÏ}é얷ïQA:Q,ÑAzPfô3cvü–€žø ¥Zð>ßüfÇhÅ7 1¯ÃOEã®»gat|¸ @c¼âp³Qû¤ºßA*Næù i¸O²œ
209
- ¬ÒQP{{ˆ×ºÅ¤ê3TðÒAó@U§”â¤éóä+ƒØÞ?Ò×â0TØq©ùƘÁ^úÜùëw©g-ÜÀ\¦ùý¸K¾4Nï×ÿ.>Oª²\Åm>Â,Ò"·žÇK™U3ù² $4Öùà ÐäO:»Šȕ<ԑøƒæU=}ĨJŒ¥:€¶¨éŸÚêòϊ§”àÓÆx¸˜íˆ0ËÜܱèüx"R¹÷l±Im°¾œ•3w€AŒ­ðœÄ(îB·2‚†)7d×ÖÄê71÷·[çW.©ShêÞü6®”àù°ŸíNVRŠ‹-0S5"aÄP*{ 3[9 vcXî= ¶l›J±øÕ¥4CqèÈ´KõŒæk >âæiÚæo'ÇóӍÆö 3!7ìŒË¢Ö/õŽïæâC²,ZÝ')í)ŸŸ¹Þ!iöFÆð¹>ŽïþTTwjd–æ“äsºRøŒœ ÝI9”EyFEÜߋ¼X?«Žd Nö&gʙ6„/œ ÝÁA:ÂR§5Œm1¨|ÊјO ë»±´=}3y½>i )JFߥöÐ!í(¸×VcØS,£àe]ÅÛÓi¿cZäÀcHò«¹µc´…ª“y¾/÷Ò18Õ÷¯ìHyñ‘²Öð•ëä"ÙÈdBt 8±YªJ2Ûx6×JÈréîe)^#!¢ê;-WY„û9‹ÚS™ vM¹“Ù^4<Y„ÌS‘¢ 6›wšÙh}ÿn’!c ô‘N*5Œl~A¿â¶’¨^2¾-2~ÂcçØù-£ò)¸Ë…ƁªºtM~á*#xbÄõËD{ºöüuòªž19NLO)‚LªöçªûYP‡ô8z:µ4ǁꎺºï¥L}抌J×U¹†UJO( uóyx!PÍ<"= ô j–·ÆèÆé¤0É©òT©‚Ÿ¥ùÿ¡Th-íÓ½•3E¶ó19O[©ÕWš«IoTø~ÊCN;Ò <X 
210
- 8NIY$'ÕJ¢¡Ô·¶’¨î2.b8¯²X^ډØJØïPþ6ø,j‡})—S¬ ƒD­CÓr¿ÈŠXYìt‹žï†¯³§[r'÷tªìbWŒÊà|hÍj6;æ•#1Ä2à
211
- Ϩ]ºÄturUÀ<xdS§iÖÑÿW´ÆHð×'Åæßpº<˜}„sæjñ× jþŒ0LÔ ì¢[$;3‚_KT%‹'U침®ªðv!Ÿß*þÒY§¯¾ïÆ·¼²·‚ä‚= <Ÿ2üF Ú¸
212
- ´ñÝÀ—úÇɞTãN>ås&j•uZ ´­¼‘3‡€Rƒø“Á&~ë\rÑPÊç'iIc €šY{ªþ]»âæãZÐÂ+~ðZpj ZþÃ×ûÁ›7îßpräÆçýÀûqEâ¾,¶éV¬t—û³¦.ø
213
- ¼æqÆQƶ—ö‘¸Ó¢°Ü‹†bKmjgøÃÖ×®²T,fIZa
214
- ]Õë´U»°F°Ý³ÑTw<hҎühÇ üE’¯ÐM˜ë> †É³Tä©lW4QJÂs©r'©>™ <e Ò¾Ys¨£¹@¾f¶ÈžƒýíZŸ1¡DØê£Ù~Ò>ÞÅòñ›2aÆâ2@gÕù‰ñdªÉƒ’#¿.ÙN ëÎr:·Û-tŒÉtÜ®½¯”qµŒƒ=Mû|…èÏï±Ù}<L —%†?g xÐÂf‚ÈM¦Nî~ïîð 
215
- Ó^iÙÈÀ­œK÷R˜gЉÛÅ%šÈÙ¨Þ¢×Ëp¡^gZ·tޏã|­z£*Ø*2£Æ1ø+-[™£çR°bb§ž8«šsê,f­µ\±aœߗ=}Øèݜ™(ÜÈkӅà Ô>¦½Ø©”³ZÒÐ2ˆu‚˜AjXø1øLDâU“¼‘,gFV¿—㈪–ƒèíB-ÞsXw­Nc³”™RI+ Xjr<ä-ëèn‡ÑÚå©|ˆÃi!K1yH{ob iµ)VÏR¾ çh¢Ë÷ޞ¨vg §±™<EøÅ–¥Þ¿/½=M³,vá ©ù†4ûÅoÑÒѪ~&3]i霪@„óÃÓKíÈí厲.e,ÈþèJµôز'|bò6p¾øeKß(ð¥ÖnÄÝhóîú‚¨& ù•Ùî„xE8ó‘¢vÛÈñøMl¥Û|Z¶Œ@Õp‚žÿËϐåˆÑS€ÇP²¶­Ï³hõº˜Ü!n¨kÞ݆m7áü²ãüFrðýâ.s&ò_åì$=}U@•ãœ$üD%ZJfo=}ó“´‘(c׊}^a†¥Æ·ʟâ'Bú5
216
- ª}"mù¼Ñü?W®’ÑCh‹Í©"݀Àù¦ÇEgIË´Äю®ðRÕfËøA+ö© ø‡P‹\GTuà-yAQä?=MÇì²Ð®$T~nšÐ¢òG¤õph0¤¶Qs¹ùœ¶­”1®öD ý-–ÝZÇ|陝g®–<pp ÌE„ÑÖÛ|AŒ
217
- >Ö>·Aäނ¡ï DïìoàÈ= ·N¨¯BÆïìo‚Vìá@õvÖMAã@&æÉÀABL'?ʙ¾š)à¢Ñ
218
- +™oëR¡ÌÑFŠ«nv5°ÏÙ%åiùEqÛëXã÷†míQ N1Xä!Hc
219
- "°tt­bïØ~Å>)qcÔÒ­)Òqv}ßÈýÈQõç¡.’”¼º|џÿï¦@Ðo®uØ×½|:}ÐŽpܒ±·ÿ֞·Fy£(†…Uî¶K;¦3>€Y@Á•è›SYÀtۓQèyM‰©>ÕÁ֞%ù¨÷¼J^ ¯ôtBíü³m¡V! ûÚ/QŠA ¿¼&Ñ/R¿qWœ.Û¬¼ñËÊhTÁºå{†Ãâha]NÈÆPÙ9;bKŒwF[„€ñóƒ+²æe²ÊWe…Ì^2¡ã>1‰vÛÅé¶x Ø÷5ƒ¸©ð„i=MiMH!UQ5çŸR/ EÅÖm³Úöš¬ûƒF¤ÑZjå[ÌrP=M™x Ȯã—ÄO/ÕÈd ¢Ø4Wì=}‰·'~T "Ô¶°'ûóu‘3 •ý îçž&5MÉQ[7s¾¾¥©c"cë­„¼'lÕà{î¦ÿVÙè“OÈ
220
- YAM%£r¼Oªœ6TEú ?!©›ò\Ký©1d¦ÀÙ;Pª’>kdÇjmQ=MßRD>_®ðŠ/by©§–†9ËM¸ „‰pð';hõîêe;R¤¦ÌŒù³ô @—ãÛö‡a'Ã%´#= ¡¾g»ê°+9ߗ#,³è~>1[ð@÷X eñ¸ÑšÊ+>ý»—ÃF;[aÿâ÷™wKVÍÚmÌ
221
- ? ô!¯Údiø—<f[2Ìz\Y8›RÛ尉CW§FÆ%â3ìÀY-lòÓEðÙ_²ÞW{¸£ ®(_4!¶€WXx_0cŠHüÜœ|ÔÑG¦BKÑrwî?•¦'Ô Ä<­Q[YE€ý'ÝWÛæ8T¯ kÓ©€Œz- …Cîr˜y­´OÈч”‡iù$I‰‰,ò,Þ¬Eà¤ÏÁ‰{ Ù׎ œ¼Lá ÎàæìÝÕ¾ã XòF0ã-¤·rê!nu[jZ"ޒ¹ûq[˜cJkÏÑì‡ö14kˆòo«Ûz䩁u¢2Uúu}!º©ñ6øx¯‚—ii'GBä«XÈp7› )D'׿Wm2[)’íë8éª5DcNçZ),‡,ðš+»žŸ­6ºÂìßÇ:Áâ¸Ù3ZÀ+¡³PY\®’ßiŽ?ns–(Dõ¶ÈŠÇÁºëO •Ôg]eLÓåW‡¸1Ï",{4e­æÑ_ÄöoÅ<7?rLè‹Â¶±Áç&k=}Î%L …Λ¡)Q¦[õ·E§k \Þ,Rø§§ Ä×åJƒ‰† þ ALʭÞð¬Š7Iã|ˆ’X¢žI=}¬#Vúo<µ;ג²®w÷ºU")LíîÈÂNúE‰nMVŠ5P³IH,6~)Øeœÿ0¶¬= 9´MjR\þõ˚ÓMVã¹I%-ªcöÇ.J‚ŠJȃ•Îè=Mä ÃõV$õ1¿H+å<Tz?[«bú{·>µ=MÄHÊAN¦É{cðþlÖÑ-3۔u¶šPö6p1Y9ŸU‚ÊöL„­£¶¿l3ŒÇ²Ãð{¼‘•Ê”'h1yZͯ8ƒú>əJH’¨If~«þy3³ð½Àj•þ= Á«t;FÊ^ R”³²Šc#“ðÓq%ˑ ±Ž¦½—çcÀÕòkwé{é˜ÿM“èŠfQ ŠßßD¥œð¶ÎSË>"ÿmå(†<…çó£âüï·B-]²ãñ€ÜGþ¾R”FÃbg®”Ý.ì¶§ÎN\y©½ŽöœZshàw0ønÄ¥X¶ßù”’ F³™Ñ´‰Â¥¸µ!ƒt\=MIÔ±:S
222
- †¯E•*t9|§ä‘—Å›6äÃTï9(×ݫ՛ôŒËWɶ©òó#í7¦â‹HoëÚUfðd0·hWÓc0¨\0Ë%#°´¾½f?[´Öòp‚ŒÕ-¿HuH',œ4\âæ/=M]=}yÌâWi¶û>žlõÂÆq+IñA= =}5ëïx©ŸÆI $Cùó8Ÿ{’Ñ·o8õJ^¼+¶–—è"Ï\ëli)î2»B¢Ã tÁ=Mu/g~k ‚ŒY"Þü=}à42YÑ콌ÅÈ9’$sS@7ëHë…¾lQÆ
223
- 릶舿•ÁÒeÇ£'»ïïZ4ЁzsñNŽùá·ôá‰= e˸¬f&‘à‚ÔD‡IÏÂ!6[µ¨›Öýˆù«j+ad‰š´_R6ÂÏóâÏíð'”záaXƒD<Ç
224
- ¨Çä ni?P-oP桬-ÀÝóïM/Д‰-¸½Åã<nyµ WL(‘H«3õ<4•!:9Ù²©Öh+!8N¯ûÅ(zæ9‚B*úŒ¦oL´V^ÿ;öKåSëÁÙRÓE²«W_x7kÒß8 ð!ƪ› A[ Qřôy²Ù°wyf=}4µ'g~L´#ÃÕ÷5ÈÛ#œ™3÷1¬C= J>蓒GLÂ=MîtºôtRÏ?Ùô—yŽê1?´u
225
- î7&­0L÷z†ãE¼.ʹN6)6?sG=M¹?BœE.WÕ³!çÃÓ„
226
- zÎä}"ú3Ö¢/µIê"þøÍ¢DZ (ÕÿIõ҈ٕ TIzL0fõjûNHÛû]=M£WÐÓr@G™úi<ò,¾8b™o µ¸ê ÐN؀9ޝ.eáVHˆ^cxùê<÷p“Ƽ…&ÆmQ6þý¥XÖuE»Ö&´Ù<¿>Aö4K‘Ÿˆ†®%ƒÇäwi‚õ‡“/#oF¦5B02’4¾ÞCYZ–©eYêgŒðÂú‚³GŽ€œ–[¼°þUõIkòŠsø0$­zY6ŠÒÑo<ñoå&“&›w÷Œ*Px4H<ƒÁšë rº?¯€WìW®×î3ˆ¤öÚ6•Ét´WÕ\.ô<¨ïmÑddòiV³1;JU&æžI4A5
227
- 9Ùz.ÖÊ¿>9ÂgEb§¦Vžžá>¯ËE»£ÀÉû•ŽÃ%TY%yrßMÁæ÷%n SÑZ "¯Êš×H}Oþãmx„9:M?+ ÃpY¦*þÅ2³…æÏ«à—jð7Ó6T³Ó6Jœ“9Ü óÚþT2nꎌ€²¾·< ÆÛ!÷+æz·¿ä¡=Mô̘pPýØUb–÷_â÷RãmŒ†Î51Êï}·?þ³ógk'X//³Aþ0ËwfÌò›Yó[èu!áôÓ3$dY[¿Í)¯g$‰ÂåÈ7íHE¬ún~ÇÊB'y&LãëÅN¼ãс>¹µÓžÄ¤…50ì$’˜’9¶œî&!ò8mÌh¹Yº K/wºyÿÃ6(„— &<Œ {¥á¹«?'ç(î£ÝŠf(þ§ÝÒwD¬]sãµD—gÑEŒ¢x¬{C[Zý>>VvÆåLH€×’ÝîųgڒëÉÊX랧‹Ú?¸ƒ)Esuy¥Êu
228
- Ä~žÙå8[ÈÛÏÆÕ>\È´©™@âñXÇGN%@ÝOþW™ÛlÇ ìu½äöÙ:ø–Y瞧pŠÜãr¬®2(‹¬Ú½õâê‚G“×—{ÈcxQ«vºx©Oÿ%ÙÁˆÆõfÈäL>ZUÀ¶JÃЗ$µ=MHÒ¨Ñ(Én7§4:¶¹²Óñg͵…_Mý'^½Ð}=M\¦„E”³-}ÉYâ£wž¹—ɇâGY\‹½«]‚‘†=M­
229
- çªrŸò¬&ÐÍ੗îórÁ€Aìà֊P€ ¨Ý°ÔìÑîa´¸Ïë¹è{¢°µ¥Þ2x ‹æô²â‚ú-~êì‘íXÊ%ÕÂv
230
- ô™~)hbüXµ¨Õ4~ìÑ_ÜIϦž 닣Œ"¤—$#ç=}ø5( yW1N’a.Ðêq)àüfхüpà½fæ5®y\ = ú/+ƒ
231
- Ï8«”âPŒ
232
- ê\Ž.°û‚•é+<¦³™ºcËJš@Ò0“žˆÊ°zµ$&“EĶÁϘ2(³ ™dö©´kèqTßù*™ÆÊ°ó…ہeÅk»)p;§UyJ¨ëž¦Yò€OTr›E÷%´eTr›ET¯Ѧ0aZˆÞàò¸ãl²ž¨%Îñè‚4<¶Eˆ¢X‹Äëf¡Lð}ó;Ì}= Þ} ÛËðQZÏLÒ¨!@Ȧîö¤Õ5oöüoöP â·\îÅ¢”<®w}fÿ¼T¨˜T¨ÛÇ­Æà÷öÂÕïh–vPöG’6ì PP-nðþ$ôpŠû_~=MëNXØínîeÛÞµ[mª˜4ùG€Šl»@i5ï9¾lX© ëîN«6G0´÷#J¸å×ï…>RoîPî„cV¡C.°2Olèo9 ¡üGü)g€ëâ[¥=MÝÝÒ£“â†)îr|ŒtSZK†ÀpX"fìà§»¬= HUmÍÔlôa››2Ví9ŒY§¬k±W¡ñÍjéñZ¹¥Ê«ú\ɆL)zfBÞ<_^€“>œ‰Ÿ¬°p¥2= ûì„ÀàÁð„uäe«¼\{&;Ǚ'v•¢»†óÄ_¾¸—ÐAÕ%H<J¡Nß?߉j•Ž= ¢©'a ɰi>• ;uËD¸XCï¦$;³w“DÑRùJ®ýà/Pä%²ðš‡~¾à§k)ijr$R:ŠY®¹xv6ªÖJ&Cրç}È´ÝÖ\×?¿Þt¿ð¨×´€]kôCÍnaØýš¹õúäøt8à„v{ln3û« ÓÇmƒË½×µ¡zü7e’ÏøVÙb†ø@FE§,‡î9 }~T)ɪ¸C•·-¸?zR€f;êÈaŸgăî߯m7JòË3aJˆÒúã¢9ˆ¹I¿‚fWÇçŒ{%¨ÐÌI¡1Y¯Â
233
- ½–Ý:÷M²ipšÌ²õùÇqgܖ5«w¯hI.[+¬Å£Ôá–j¯Ï´^8Oµ­øþÒ¨qÜ? X÷o5é ¢H¤èò¨@¹Ú2žPY5¯DèFþRwyŠ(Fg58ÿ'†+ DÂhÏ|†I¨EÛcD¤J'K
234
- ËBðö:ò= ð,¼=M,yí¤l£bí—t–‘¶ìpE,›óÑ¿3œÄ$Hšr§^+5ÖóP¬0_‹V®F¦=}}ä3yЏñé%HíÓHÊ;陠Ä}›<?zêÀòp1W§0ÆuáãE¬š/E¦ÒZ8òÒêÏÚû„ïöí°¹˜‚!º6äBÔ:I*x5K,5(ØjzÚºP~q
235
- \\=MçEW^‰³æû;)š!*ÊÁÍ¥8(7 š8ævuüÿIסÞEeo OôCúÞ¹wŒp£t-¨YŽÉљ}ˆ¾ÁJ ç¦B¸´¦þ-â5hô ëG
236
- †RgêUjëG¼CÎ0šíǑ‚˜NUjPä-:5ړý,Žoáé-¼ðr]
237
- ñ|â39&9¨oŒe¼“qôä nñ¯‘Ë$reú¼æ×Ó<Nˆé ^Mŀ¨Ð~Nët¥/Shœ6š‘&«}7©‡ÃÔñl­ÙZÞè½Ð¹·ãU§'Ĭ¡ÃŽ>²®Q4!iÀéc¬ø—{ËtÔU3— 7-_ì,?UÎì ;p¿ž;PÖ»•õ'šcî™Ñj1çjÓ
238
- «ÔŠ”%àõo þvìÙ!íçsŽÌ˜í" >ËfÎDL(D\ÏCcð"‹…Wà±{d¾]³FsƒHÄ´wý6= "ÛèÌOÞ'‡›Xñ,½Øä¿±QÆB ×ƒŒ„©;‚ËÏ—ã®ÞY‡ÍŠJóUýí ~t›©V–‡~ÒlÔ{Ù(¡Dk¨!§Rr‰N®X3ªÏE/;¾3bH=}‘D¸ÿUùh›ˆ¾»‚nO@äDø–•·ÎsËÒ ýV×ׁ/n-‡<¢ÝxTcɚižªm¬Nn—äÑì–Äò¿{®OÁ2¦w0cmwˆ§Jaq\c¾ð֓AQÿíÁs°N¦ôg€v2QüûAÆì‹úÑˆÕ8{æ%!¿Œ1¦æ‚±„&ßғp±„¶ÞD3ǪtV5'Ñd•/×ëÝH°5Þ.Ï ¡È®,­ÿ}þîphËãý7Ú7"ù=}ýûö\‹¡‘p;5ftñQŸ¦¯WyÖ&$Á>GÂU—®µº•Âåqöót¹˜7ÃïçZ–ñ67o@Ä:@¼™­N6­eñÀµ,ðË3= ë¾p¾+m,³Ão ý@JæAtªž¼.í}ö­©×íLs= ¨*š€R1ú¬tar!ù %þb^ø€\ Q×ÖámfÏØ¡àdÚº¦Wðœ‹]íÓ Øa¨§¬oãπ³ƒFÂZJõ˜Ö2Akæè[&õmDÞUÝ änç€ò™mÂ0
239
- áà‡®¥ÒDÕ=MÕí/•Š—˜³²ù+)ç+'&RIÙn0õ¨[<:ƒOòëøÍ!І¦ø±¨úÈßOˆ¸~јu>ÿ5lçFùŠD"é¤s²œ‡Ô!ŽÒNU§mRu@â÷pÿÒ™»qRNlÒ÷Qv0¡8ä¤ÿƒP.ƓÌkоògŠi™h””U‘c=MÙ= úƒÓ Š9@ý6ôB²ŽmUn(ÀÕ
240
- ý )C!y‹'¿Wgõ#ïÜÑøÃ§«ã3Ôۃq¥m×3Wɳ÷.}Ax$«Üƒ9hÊ{ç•Õúˆ²­t]¨oo¯
241
- €­Ì ¿Â€§©ú,ê÷,M5)AÃN#Íp kÃm!?ê [„%¿½¶•¤¨{b>Pª…nH0%V®Öäç˜Ùv×þ0·}ô‰WOÅtƒ»ŽMÌ=MpeˆÕm¯WñÈtübš»½iØ3#sgHÙ,ºÏÇ!Êû[ñG¢s ¹ä‹fI±E]MŸeNš¸¿FÈVy4®È[ˆ.:=MÈ­G¦Ãäœ
242
- 9¯ñ‚:)ÿÓ9Šœ5M¹AR{™ë呖´—Y¸43ÓÞÉ©/YŒ¦Uµ!­Ÿ)rъH˜£;s1V8ˆ
243
- ˜ÌO*Gã0d÷@è5“¢„öDt';>ÁƒÿÝltÊÛøž ZŒ1æ¡e,+©Á Ž†×Þ ÝâjÒÚ9»DbÓåHS üìƒ ±H51˜Ž q|¶íÂ*ÑÁ^ïªØÛ’b3-ذ=}©}ԟ{?jtÛÁ5ý¶?Ðô™bXÐrhÞ8¯ðW"ˆÚéî¦ÎNûò;ÊB¶Xê/<ÿçÀk¿”ÖTgm÷ùŸÄEDö‡°“gåXë&_/™¡¥4Gö7ðÃMf9㍥G9ˑÏœ=MÀaQ™h±Xì"Öô‹ ï[•ãGŒgnâ_dU}‹Æ“°}€[íá–Àýí4‰Ú ùù@Ë¥˜š= gæý‰(p1ÇGuÆ3ìŸâQFÙôLÉè»áUJÔM‰£'ÇÔKöÖÀQŒ£õ:gxq/c/-kMpí¯ƒ–J‡…%Ö!§ï<‡n§«˜ ¨Ø•RGÿøjõqY!•˜’±¥¶°*ÔYP9h = ‹¯Þa˜]¡¹ "º¥= Ðh·šž›¯fGÙOéve^E¼çœ¡öãH1¯J‹äèØÈ0¥ Ä[‘"³ïys/֐¶¤‡nR<Ë"c€g¹UÌ­a£¼¨ç‘‚‘­Æ³fuåÖ[›—÷J‰Æ¢9|‰ƒâ@­Ó…D$Á= Úُ)üËæI sm™Où…ÈkþRòI­aëËlÑ1:Íi{¤w­²E¯Ôó…m¦7kZÚÈšY{øSeõ4'n:Ú¬(:ná:
244
- ×*BåÓè<´wCP!—„ØpæÎ¿çÎ˰%4E9{xÁU[ø©qéÒÿ­gÑwæ¾= 4\‘Ž´ÉB-Ú©Ý0ŸÓʏ¼h§HeŽÌ:£Àøˆ¨]Ÿ-B„ÕÏï2w3‚xÓ®º°ùÊêDÊÒæyó‚lÇpVÍ^µ¦ù±¿„Ów!‡6Qòý*ﻒFkª¦;ÿÛÞ¬¹š¦­ÜÖLÒ×óӅFˆ<ÙäfÒããš3|À7ñ êÒAu»ùª$Õ½ð3诃ÁO¬(µ+6ŸÝ^䒀“ÕeœMÚ\ŒåÄôä>¹š0Շïté¾)‡xêl©Èû\&kfÍ5[~pŠŠv„9¬ŠÊîRï:ȑtÅ㜬äiÑ]Šè#Pˆï_ÿéA®Þ²‘#¦ân\‰¿³âŠC´w*œW9ðpð’‘O®Wš#¡F-C(61ÅõfÃ\„¿Y´v¯•»º¥ˆÕdî ~¢;Åvʺ²¿_1ðµmˆjœW\6"h»%:ÈðäZÙ¶‹–j6%XªíŠŠËr7{OÕhUsWvÉÃVã"ƉŸsë³PÒB?Ï~²Ìƒß x£z¿t¬Û¬´ˆ ­"¯}4åàwK·´Õñ°˜•ÿJjýŸ@_ÉÓS·~Y¶‘Ö‹™&÷+AY8¦ª¹‚O4Ù¾ßRøÛüYl£Q¿þ“Ýwþô9¨¿ÐZ‡Ùª¿2j 6¿ìiîF™ˆ—6{žíT™ jΗ&^-·ÃJqjqy~l‡ÞS!ºdaâ¿bŠé[¼‰'™® NªI²ÀÌJ€•ùN›Ô ?/7-¦t‚Iç´=M†¸^\ðÚc†Ïß%|Ú8µ ¢¶,G58šJ58M u=M-ýúÁ›O0zªÓˆ»®o%ÎÿaNŠ=}ƒOï6.j*ÄѤžÚ9[q³èr.üS¦¹Äæ1”ã1Q¨š™óúˆ{ŠÆ5^¬®Ÿ”$:}—i–Q 9ØT–Iáâ¤<<¸4@ífŽyë¼EæÓ!×ðk_8*6= TŒ¨DΝ/®¯†!ƒð½-ѝVª¨´[¯U&TyðӔʚÐ=}cÆÒ:ç‹*ü£À¯k»“EÊ>õ Ñp¦éiÝ5ÓÒ¢ ¤@·Ëôe’p Á#qú®×n‹Í÷â Sk@ÑÂ?3pIÑAk¯»×ý ½6÷þ öþ°@2Õþ0±Â&D)î7d±B–M:ÚüE¼˜
245
- )›f=}6i9§(Iñeë¨9)›&=}6P7tëvÁûùÈz±BOâ3®Ÿ²ëh¼¸×zb±Bö”›
246
- -")›aë.7tðv“= ëJ,"9üIC'gºYX'ÛGñ×
247
- ž[¼àFI^֚‚Š\­òlñ äÇÚwƒ§ƒªÈ¬õ•QWF¾ßÓfá%})›¶»ä©q¢^âè¸F‡‚~aR9;È<Å3,ÉRO[P{ñf{†;ø˜<m<Oö=}¯@ëõf{Š;Vö=}gD›¦’»Ý…D›p{õ; Ðfù4A'M7ìU÷¶¨¹ì;YP[Pû8ö=}ï?«¥’»‡;b²@#Eÿé;x<WP›„;±@C±Û¥F;ÜV °ݦù˜‚ˆ=M°n °Ï
248
- s¹&®7ÊúfÁ:'ö2"Xö: ö1¢Xòz.)ó8ž*Éz7)ó88*ÉÚµ²9 1䮫¬6ªSJ=M§D;˜Z3XVš^hÄyçäÐ=MÍÑn çpŽ­Þ§¦ ô=Mr˹ Õùü/·õ×fMkåÒ¥—Ü(Úµ"2þìœÔèr³Ýªƒ2ìV¡ôÿóQ
249
- è ш§~-]DþÆOjÚ¦xµ5è5ù°Aðóœß%}+à„©¾ðѶþÏéXŽù⵪,øð¶o8D®4yÇØ5¶qB¶2Ùúf
250
- = ß˜å6BË%Zù˜zT@—çº'ZDÉó±OýÂÁòÊhžÖð&Y•#Ìo€ÿO- "d‡¶ø!= X¦_QÄA³/×›¨ =M¢-,’ÇÁî¯VŠñhK1DóW:‹²­¶5Ìó•ðu£LnŠ7ƒÔráÔr%Î.¹ÞÃä{C<ÖÈ]¤NýxC:ůn¹³/*¸"£sWh”¾‘Ï+Æ(³âóÆYt<0j]9LMs‹ScÒíß r¹aÍ3 = †,­ýø¡šU¥9^f,u53Jµ­ìí‚Ɇ³A•ð#ç¾õH­¨hüÁŠTJt¶Md°JÛÝîtÅ+~ÈsOg›gËóÊ$«c§-,uY¸Ù—Zšý†Ún\8Ÿ¾—¼âéA”#¹'à×Áàò&v¹É>=}7#PbWU<wíî "ÜV]Åx%U£¯–ð]—ÖÃçv▇õ÷/‡S±@Ýˑ>DiT:”ÿi˜Hiì+;HQ™]
251
- ßãT„´j\è´gl2X£/+SÒy\+#ÈÆ…²t„>äÏ(ô‘%†›˜–²ÞóuôëÏÈAC¡ON¾
252
- •p¥qTXü&ۖCæáÆhLH\°<ìñU›*ñhÜlÙWîtx焒‹ƒ‘ÜdŠ¢4ɦÑèÕ æëdwž÷”Hϒ~~äÀƒ/µ‡$ûE2à¶ KÌ©’KcfB°î»Q'ëÏà~¯¥+Þh\3€víÈOÿú¾ívUÈWí¹ÊIWsVþl .²0K™²·’&%÷?=M”S„Ý„ì^jú)rŽ)
253
- ³#eó§þ'6- βÿ²URp‹§/‘c°,Š}êùzI 5Ê\¦r(/rí ³ZPRÁñÁŸo;ë;T"¯æ*£þ8 u.1= J¢i–Y8†KmÙ:E
254
- iÞæ½õíÿòè•ÊÁ|š°±ð0¨]ï°s!ŸÊ­Cp‚:Ýx5"( z¦æ/Ü<˜Õ–,¨9cÝM9@•4= ¬À=M=MæãHóOŸתʀ*õD¼Ï¾j<•·’WŽÈ%Bd,´?x\W”¨ÞË=M/üÔܗ÷Ía¼H*òûGm­4I8ÖR²¨—÷*NxÇÝeU¸I]îÝ[Çð@ŽfzcŒ:Ïy÷ÓgيaS炏‘žy ½DP0†D'= 1düŒ¸ø‚~€Î^.ä×z+GBû0‹<o= È¯(Ôí{DŽM¬˜Õ†«-u˔‘á3üæߓb&›hX ¤(ÛæÄCYÞq 8K\s‚Ìðd؅ëÚðsv›Í
255
- k©ÖlVlXÒÛ{5ÿÇVaN“îç5³¾YRPô‘ä= wµb^Ùp\= )mbV= h„°¦á6u Õbæ•QŽ!e°Yª¢‡ñN™¶ÄLü,wÆìh—‚-æxAûQÚ3uÿ\\ävòe¶ŽOÏl8%µaªËeÒjö½dò‰ìwÎÊãtÒ§-´×¿‰ïYY¦Ë[Q=M€òa:ŽyG/bÞ
256
- õ†¦Kz0læ‡ð¢^D= ^Þoâ‹Û²@Ð÷fãÏ0)À.u­ùa¥/iÌ e¥ÐÈïU¯=MMd­ÍÅtaæsóãôV„ÒpÚê³SäÞ?q–¦¶]’­î¥úpUäÙë¿È¤ýQäù‰Պ§“ =}³‡+VѾÿü±¬Ï:"O%oo‹@ú2¬l»{p©®"¬ÚÅñ,¤«æÆZ\‡9©2³Ø£±ä0íg|CÍDP¬cËa8»@¤„Ân‹àU'­Ö[¦ÙÁ×ÅdÛ¥Æò&G:r ƒ¢x:j‹$¶–âD¨Øaﳸ?Æÿ7¿j×-oúFÆ3>}U[žé>#ï’}cÐå'—ÍØnÒe!,gª2z YΰV
257
- u|êÂÖãmÉçñ’u1àX-ªbO”&dŸùo‘Vˆx€Íž oÊÄy­ãhúkä“çË!¯äŽÂÏ ©dŽá_µÛ†h£ôY,É¥åK4 zC\Q.aïE,#”´†é6§,(¡ú$-3÷ÀڝËz¿^j)hâù&ð4‚³œRĸ³êPÝ¥ó1ýÄ1w:= ñè>éÄï$z$Öh„[܆½KVˆ?F˜{ÕÀ¡Rö!;|ì ·¨oF›*À~Š<tK€ ŽëØ-vçדŒÅ˜d,?ß?1ֈó’¢ÓÔ´¡9nöwö²%Ăg¦ؽLd§Æy€ÂæÀÝ}ŒÛå“ß«ÅR--€­†´è4i®Z.Ñ<BAóI³œñGrqðqhp¬pô¥'©· #óÜÿ«¾ü¢”ëçeÌ%Î&„©ÆHe TåÎ/]ÄösɊK¡ò@§¼bzIJÙ6ОD¢*œ8ÄKUˆ1 2ùS¥½¶ñ±’¯0°õ±a7÷ )ùé(J'úîúºöåòðqñsò'¤‘rÀqØ:¡7h0æ5½jÚb·é76$1„ZÚ¸‹¸#³ú8 2ò€úº²ø¬€Þí,¨~‰þ½ÁÜHX0ò&®%Î%¢¶Jèrç&0ãY´*Ä|‡û= ƒIÖý´·ÜÃÀ¿·IÒÂì½íH‚W”NLŒñü¤p‡LbÙ­ç
258
- ¶¶\xïәÍ/Ø~§éˆº„. §oØùÇNjí!Á,ÆÛ¡õÑÉ{â#
259
- ¯[¦÷AþB´]h¨ô¬
260
- F= ÞïMÈ¡Ü{ñÎ=M
261
- Ê?Æy•€–ëí#žUn•¢ŠŒ§%©Bx?ôÝ¥5oØ¿ èù²ø—YûÅ,º/÷˜4¾ƒÁ‡LJp pïÁ1ƒ;3k5dXY ZÄ\ŒzøÚüö|ºˆ/²Õȇ [Kp˜‰*â
262
- Ƀ• ¹ü³ wŠ6]f0KÄkÿ}X/’õÌéÂ^B]Pe{zËB¦xæÓ°ÂÀ5$Ue#˜ýɇǂF$%Yg©_µ¾EupïY6&Z]YX'¨%÷ô= ¯AbùÐz ’5ybðp]›z¸ÂÎàY±Ó‰!g76ǸYw¥Ö¢”‰j¡:1.˜p8v&ò)½Êsƒû|gWì45s€§ceEóÃ~E?C0±ò¸´µ,{•'ݤ¼)^Á•ÓƒO\ÿ?·YÒþ¡Ü%Jæ)÷ë^¥ý|¡mL "íÌ2¬LŒÈö¯%‹!õ Æ¡Á3¶uvIìÓTV#†_É,ðÆêÑW‡—s O‚´ÄÜYþè[¼ËƑɀG̑)ŽÑá:•5+ø‡ j&JÙø[ð1ÔðeÎÊßĞýßøâ*Ô5Àê­ç/|> seoupö/ü¶ìÄè’3%X@ЪàÙΐ„öFéznsÁaXgçµ¢›©"Xø){Œ ø·ÿÿÀ¦±˜¹-|¥m=Mº© 7Vêˆhxbi‡¸åà{¢:f²!T“u@iǘ4‘¡)siw¹’üèrÁEBÚ4,¶ÛÁ,{âÛótà²&HA3
263
- Ùòúëà$ûŒ™ŽJPªkî/Ùúo #Ô%AÔ¤Ф‚…)ùñï,CÙö%#ôBZÇ‚j—Ò´-ýÎJ-ü îM­ 8Ÿ›y'ï v‰·¦!KOôd"} .
264
- !þbg™²ë±¨.{¦Ê„®Wx.ãü·ÇP–ÊO™¸7 “y­¥¼7ZAt³ˆÈ…y²*žS¼FT©•l—ãüÇ{F_Ÿ³ó«g“VlX*üiDÐûõ“ û&c€yÿ|PžëUÃQQ½j—ۀ½2[àa}ûêà莾Î¹_Ž ɱ Y›ZG„³X²œÐ±ðdQˆÙaEÆìiœåñ]ÿ¬eZ¾{p‚ÃuÁÈýWÀ¬}^¨ sh¢¾9ªÌØc“BUŽ’>°K±Ìw‡Y ÿ‰Ã›U뛺Ë*Ö³BùN«›²ûmE®\-Ã,sÂE¶û±B+XaάTèý;r+—û}Ñ=}9ï¸3̲§\@’Ћ6M[¿˜Û儗óHÚ¼¦">ø¿›.ä‚–}ˆ£ëW|¬:¯aŒ¾ä\À»É[¦Ü넓]u‰ C³SŒâ؅q·…Àõ¼dYÈÀ{໣ô£÷#ÆW©>Ïд§\âŒÉk{]ˋ=}Ñv“]Á~HtŒÆVDÞT»Óý›U ]“³·V«R/ÙEÎê ±å?oþü5Ñsˆ±{}Dvg‡¢Mÿ;A¨òš+j«2ŸkòtÝO  ™ëDöÄ"f,b«Òùn·fbÙûýœa'$4¸d†R‡ÖWM!'oýü µ ü…†À»ÿtgòòp¸¤³”°ø'ª6òéšPlvgû¸ßÈ;ԏÚ_³#}!ñ¸B2Zy³m©Ÿòt¼å”®Ë²íL,Ä= |{Ƹυ†à=  Oz ƒóCºšÍCšš†*¤ùŽÐ¬J Pášd¶Ì̐‹ÙPPÜ-0x:å÷÷ë(ÐfÀ¨’é÷ Çw•‘ÙL²$#Üè$jE®šQX¥6øç÷k2€æ¢vêùe£ù0£œ|¡(&çºùcóŒÙP’9õwŽàçÅë/04Qø´«%c:ÉÝÇçÇÞꙢ ¸øh]¡ºÞ6oê篅2žré‘$ãCûT€¯¤máùÐÁ&l…¢¸ }tÒĤeÙzƒû}¥žÝÀݤuÈúÖ¡ã¤é³¼‘äӝM+ÁŒ‰Çò/t<"%H¨—Å|ôòyûüpPÏ7,iٌoî¶ÇêåÁ8ÈsÃJýkò:7»ÀË@ýÌ™•[{#sA?}F{ÍD „¿‘»;LSHY(rˆPÒñ2ÿ4ÖÊ&•d̞7ág•ì¬ꀒå¥Öÿ뒵?
265
- Äë0 ä-BH¥{$sqŸ¹'Á(úQš¶+ᔊqh³‘B­Yæ¬ìÀóë@f±Ošöš¿TG­-I”ï­~! ½FrÙ÷]ўA
266
- “ÕËñ*´&aÄ}$Wm¶¤ý^€Ò*qN>§—b•Íï {™¤ šÈ4ͼ1)N"ÿç9ø7 îA}eò°¼»p–I8¹4
267
- ’š„äôø†û‡5ù÷Ʋ™· níí²IÕNø±nø:ñ”ߢr¥'ÿ”læJQ˜¸3hÏÓJ°IÓTÔÓ¬ß#¾òMä=Mü =MÇ= D$B‰Ð:4åÄnZXKqj¥þ8ôR*ø¤QJS)Tí«°ÉÞ@àPÊ&•kÌ n³-ÈvÊØø,ã鐊yýnŸ‰‡5)¢éê8aÍe(wa™õa.¤}%f'bɔִß#8rˆÏÙý¡Ï:ϐ¤6Ü:¡x~f¦ôì&îÉQ™¸“êÿÑÉág™ØñB)Î5‘…m¢7/4ÎnI×÷/ëöÙÛ̞b ㇰ7'ZŠz„P^÷âãr(8(Ðöp*9’Ç/ØTTú\®:®GyÄ4«Ê„ ÄK‹=}4>f‚Ê,Raá§z¶6.³ m:øûCtìÆß§}H—Ü ëþlVqdt«yYey^ ^ñ˖?}HQ‚³Hk&œ6ãÒL’ä0Ÿ@Ü[曀º© 9Ö3°$°¤=} ‰ôûæÂ]ÔÈ¢ažqÙaˆùa$Èͧþª‹Ðւ8’YãêOLu·iBéA÷Ú[!p4Õ^•îÇ'»ï„ÃŽòdR{ƒu‹´?îôª¿H‹‰çÿš…‚?5Î/íÀœÿb#ž\ôLjÔ)ûJÌɟ[¯7šŽ ,º$ Íh‹„<xA¥vAWeû˜ŠõK= ÝM ¤<lÇrK'DËT­¦óC!òÀŸáÑ;0ÔÇOìG"ĝ®%e CjÌE“&ƒ½Z »Y ìԇix‡-ÿfäÀŸSlȕ†lêÏÐ >³œ©Ï¼#p¯”zùj D[»ÃÒk:Šÿ†%ozԋ{эלAÀv™^äÌý&§F‡ ¼ËWsæÔ5‹= Z-æÜI!0ANH¾üûö›Å¥!”¼s^x¦lŽ–éP˜õfØpʋ<"<æD‚“Tç˜Ôè  Ë°ÎŸÏßÀύ÷>𬻆ÆISopJá:
268
- NÜx16;hi ê–ƒéßÓöO÷ÀUG›(GñÞ_kÜ,Ý·÷Q¢Ë|¨¨Aa½Ëc¤ß©:À7úå#KÈÑôƒ¦ëc%¼#[= à+Xß½œÁ+EúD
269
- :•%RÌ^ôÙoâÓâF‹£ºÞ›p£½±Y7-
270
- X yk~h~’†a—[Í|’|Œjd®%ï©ñ8.æ½ÃkóAÛfûB™è‚Âo÷Œ—|k0²Ìê¼J„ÝЏyùDyŸ3«÷9øí†¢®ÉWÍóµ 'íÆ!Â3ɯ¯ëîì‹Ó$W2·63/™ Ž4bJ¡éÆÈEJÙ*"¢¤§{k:» )v™­ù3‡)ônÐRªó#&$YSzhwœ&üX²W€ÚANrg?÷ÐÑF­ž­†î]÷·˜Ê“QÊîñ:¬ã7£½Ýã7ÃÃïQ=}̓‹#íÓ-çšYzِ·³¨ßM¤Ä Ûv–3©”ÖÓS$òrmd\\]› !èúјw×ð4¬|"ÿ¦vÿ“Çë¿7µ'%ª”¦nѧ™ï= %Ý% ¡ÐúêúÊʠՒ¹¿êÍ}Ö§¤$Î9ï^bfa¡¿%05º _áêÍìßc m21Ø Bëº÷§ýИm]Ê_3= ,Rÿ…àÊê½CÐMìBÙwNÜÕ¡æÍMÐòÇL·vïÌ8I0¾°…
271
- NR鑤6òڑ$4—qÛðãjŠR¤Ð.î w‹u؎„ü˜mÇóþá¤uÖ¶¿¡#˜¿³É‘äԝWÿcBaHW6G ?ÇdBàx^ûhƬà4s5ÿ ¯¹ßlÞo%bPÛÜ[G.ËCS‚?#SM]<×¢¦ú^_c«LFŒë{G]€FŸ<^m¿…{Ë<=M=M×zêúó“²ßl6žú)¦­qN–àeÎC.DQy~­‚°8'£ª6•8"øöò ‡±®YnË_«Ü;´Üå>#4ú.‰{”˪BƒM…1}Ú®«/L8³®z;êU”û,¼v­{Q€ H+zsM¿¥ÅÍâÛ5VÎR³|ÿ‹Ä»>&’ÅÔÔ2pƒ2r]•³¾›9Xêh9ðeû µë{À4;nŽNž^~>3ÎÀOÛ5ê:aùëS@sû’iZ´ë= ‰­*(•ò§ü;Jb¦F^lÁùr7°"þv=Mé•훡£ÛÒÆÞ(¼!mDdìÌè\ÇG_O¿\i“û~ÃÈKt›Sà4dñqLì5wÂ8'S诮¸?ØM ¼ãÚcþ\_è/m&)ý#ì“SƪÚk%¢ӄ¨“j¢éÔ¯ÃVâÎȽCœâܨò›ã Ï^'Í8=M ¯•ÖÝ*>¸¸ž'6ÿW{mçžCêµaÒ") xؔzà.º]­lÚÆp‚:ëdI–3¨¥›†ö¸’‡ºë¾L6Š4+HvöÈs× 4>óX[2*o²X–þTw3NÖíáOAU¢¶ÕñE4\(-Ù4.ªTr§ÿvTÕ¤ 8ïØ%p/ޝ
272
- ZVm‰ÝœÜ)ßlðz§:8W^s=}qMnΜ‰= [C¤¤øÎäù3ºÍ†'G:âà!OrVFžCO½Èþè’Aƒ9¶‡2Âæ–ávàOÉ0–õùÏ¢b‚‰,T x {ÊýŒšòÂôD|1¡M—󮆦ö•¦:‰×!mƒÇ.ô§ë/¯o˜sï© ÿl~Hÿê4
273
- N çB#Î}yg~+
274
- YDø*
275
- â
276
- Ók‡¿%©9õh Ãy.êçþçŸ/U¸†q{¨ ¼?%·Ñ§h{ØHÀÜaw¯¶þ£¸I%©4&ŸflJ°ºåeƒÙt¿Êohj2hHSå
277
- €øzU)bÂöccI%&3-/=M ¨È«»èéöHY¼Myîîï¸å9ÊxìN(ˆƒY„¢Öt)‘5S‚ZYÒ)ÄØ›aM«Ó˜L àۂÉãd€Á>¬Î‚Èú
278
- kÝÙjPäÙmi%©µ¯·,«xIÝjjáÀH^Óx&øžlYmq㘚YQaвoM»---ùà9~/TwÕZȲ<Øî×m’(ÚÙkÂÖK—hõ!PbÎ"µIÍ¥ 0°ºª·«©2-KbôÓJ¤/¤ ÈšŽÇ‹¶³W°zŠT~Õ
279
- Èt㒸r”ø¨j®"H”ãòø,•µ»Ô;ïɊÑsVl[uú—o¨óÏ3,á“÷:[ö&±¹¸G6þ\ђ™Zn‰d&ñ(Z*)<1l!OŠòÚ²·èœ!©žÃ®T¯%Ì»iP°€Úˆ ‰]ŒîVy¾©A¾)¶ÕîÃH2&䴑SFYð
280
- rŽøÈSSxèºØ“§b!m%Êõ¤NAMW(»y9Ôîÿ“Æâ2"ò¢R=Mâ…@8#%eÊè+ŽÅ°#µœÑ= –"Él^sõ¦ˆ&ÖÅ×3„5—ø¢o\¡.¿]ÔÔÐ(£*Û+ãÿh«ö‚N¼¸^@ˆÙö3qܪç‹ 1yün!€xQT““v4 .ÝÑè“Ø tj¯!7Cÿ}ÃLQݸ'y‰j—¼…¾|džÃ’§!X@\;A5êžúîü>e¿$wo.~î[œZöÒ$«o—©JêöÂ"œz:”Â[ázÕä
281
- {»= §“+Š;æZW}ÇÒÁZ{þ$&>§›|@!/¼È( 0¥3UyêB&)$M-Ô¨T¿>Í·@Ü_sV/Fum¦g=M-“…A#k߯^{%ü1WOtC¯9µ@Wá]kHÜ
282
- [QQC¨@_™)Û¶[ä~Á£i\yM{‰W̃¿_ƒÁÇ ;ŸÄÁ]BɽÌE´òöKç+ ĹžØ‚GðoÒ$ãڝ޾>÷˜Ø'Á“ÓƒØl\q­)/ Ä9©ÞÁJSÄôC£~Åã4îá?B5óÊYyÿýÊ?Öraèŗs¶Õ uƒ½î± ßé–T.7ÔÎb4¶ô{!¼áÜÔ$¦Òj”o¢µ#¿¬Yžc çN‚2(ï¬%àLFýâA@{x¶t&¯™ ÜØT¤&N‘æ!Cž{)1(֒jØjisÔ®³š…O-é²^ɬlߞÄÑH»ÈÌtG{įOx›ö.f­’§„覥.GòÇ"s:Dõ;€:e@wktwïy²wWÞÙw -w9Á,wÖæKx@èex¿ýxŽ!ŸxLĽxÂÚÎxíàx ùóxuúxêxOÅ2xI= By/MyšlZy£fyÅsykyÏZyú‚yÉ«yëÒºy–Ây›JÊyÓ Ñy´Ùy«)áyVêy6›òyLöúybyòÝ y³eyÏöyGŽ%y(-yAÄ6yùK=}zZ•Az_ÚEz‹IzfQNGÔ>{׌WûÖ¨‘±8í¨ó˜Èô¡ñ¨1§¶ñړ±œ‹Jma1-Ï<ÐJ\Žt=}½ ¨ëIÊ0Ôr SØI!×eî_"ØHý¼\ä —i«ÞíûÎJdyS5ΓVÃèC"Êkm=}^íc՞âžô­nÙ±¢NôùoT”³eYH-´Å×å5$WEÛ
283
- í‡É—ý: q–f®Ó®xÒRV-ƒ
284
- ¢K@"PgEŽÝ2}ý{PÂÉæc#Þ!ì—Áx¥é·‘n³ÓÛû’«sšk¶Ù±|n½Ù²?N™CYøQ'9_c4is6†«6ÊÛzüeƒ9ÊàŠþŽ$\QQpp4bԁUL=Mâ#f¸Æá=M2£c”D¿ÐXÐï·LƒÚ•„ƒÔ®Á:ßùP͊5fÓ,–U2âo’¤ÉÊ=}ò—^ چ Jà5Ö½ƽdbß41FI¨Lהd#pŠ«ï‡ëC™âDíÞ@ y=}ÔÈìɛ¹ºüÅñ½Úºg厎¹–Àž¥7qåTx–Èò‹®u™ˆ¼öÕÔ5¥0nòùÕde©—‹Lò€À¯PÔÔey3åsãê‘¢PášÐ·÷ä&±= ÉŽÐ÷…Œ-û|„ʼ…8‹³’ü ¨Eo†O7ɏ ƒü¿qEe.¬Ú
285
- -Å·—Þßï™ynÖÞ´jʙ&.C
286
- ÞlÊî˜.3ŒÐƝ¢i©®«àé¦iš«¤ŽItt7[Â!ˆ®Ë˜¡ '§¿ŸŽjVågg¢lbpFfggz¡m®‚aaÔÔS#¡3d¾ÌnSg
287
- [¶A&=M$óuØÓ¯Õ2‡â (o7âßÜËúº­·2äjγÛ×㶞$lÑù‘žÔ/€A¦ ³Bs}üü‘àß=Mæ¢e* â ^jÀ ¾ŽS²^Ô>]TÊL“‰Ý§—MþÎ öÌG€]é>MÄtÚû˜´=}¦vb«&{wLL,soÇ¢Õs¯× ºX×-“7‚Í®tÁjäl§T~6H §®Ã¡¦ O¨b¬è’OÚ1ÍX„ÖC‘Qb½x—«F¢¬ SòOœÀ\–X°‹!šI¯ŸC¼Ú¾,gC¡®Ò›=MAìkà ¢>TZƒœ ;)T<CÈ;õÏ6ðÖzN‘5rÊT6·lñ14ÝJ¢··7 ÖµlWä.ݑ)À3%?ÀbZ:´« ÝBÖ³«øØÚhԕ)©oÖÖ铑ó ãÐFaà w¦%ʉ‡ç*¿‹v-1Â>’mXS3 ÙrD1G¶©8[vo©íûÑȧ q¦ÑJëá·éP*••¬±×= z–‹T¢ü ¶‹$?xIÕ®¬ßtQÕìãàTÂPá¿ÔËP›}./=Ml¡M^IïkýyK
288
- "A²l©¸Í6%ΔçÚJõoD=M lXÑI|®Åq‘šïóVßÂ^ՏGŸ† S·šÊ¡÷6£ïòÊ]ìcÁŸÊ_4 CGG‚‹u²s,¬ ºS6²J€ö‹¯mÁ«%›©ÊU‡™[H_=M¥[&QH{0øzŠ÷5® žz—V2^s÷j2/œ‹ywÊ*È!̙ï(Æ,dxÔ¯÷Bö1ûuðvUöôV5„˜±ãF±\yõnf±°]ö„bÙ@¯ õIÃÚ(Ù¬.Œ˜ÑUþñ‡e§þ¼–èäS Õú-‘ozÍX–-ê@ŠÑrb5¨nEÇÕsädVjrœ†a3p¡üÁ‡7Ëq¡HlÖ»qÒ%Ž ìy½&Lô—¾d9N?J;}{<;í¨ñ:ñ¨ñ˜¢ñ¨ñ¨¦¦‚:§V>E–+µǚ¦^žúrtëYb4•µ‡çü{òEðôÐϓÏ^ô÷GDMEPÞ™Ã=}Á¶"Ìùtҙyƒ© ȒA<V=M´ÑÚðd/«ƒ]ª¤]F„ÚX‚Þ±Gª‚®ŠiÍË<LºF^åp¿òнŒgEŸ!À;¡5ÜùҚéÏg-ýо ^6)7¢eªuì_¼Ø1g¯ïà§áHF çã%¥%Â!¯†n iNQT\l˒º/dêà7½Iª½ï˚åAP°™°ŽžXPoÞÐ˗ÞCˆ´Q0Ï^.ÉGîÞß#öÍ*:Œ¦:üº -6À'ڇ5.Ø> šÔ­F-ÑÚëS-Ìï÷²S%ú65FQ ·…”)~õ$,çÖ«¾†„’cËøƒ3¼®Ç$¶ÕKÚøxý(PBt–ñR²˜ƒØ‰=MËhB§['èþÍpÓ èç=M9)˜ÿá‰.´¦pֈ’¡[t·e27aÍ7§W„n®r©sEšÂ«µ{×í5j Æ^¯‚áónPƕ€Êš°œ‘ô“õá‹'ÒM4ý‘ÿÅé=Mœý^šè0Oe:Ø¿²ÑðóîcºN‚NÀ5W€,)ðÏãF9hu;º;»:FWÀx·x±ªx˜Oxìxô‰‚xK&tx Ágx{]ZxgøLxí’?xð(w›Rw±…ówF¸Øwmê½w5üŠw9_UweJvÔâvvi¸ô=M¬öæöáÇb÷¼d˜÷Ä÷Ûkß÷'8ù÷î÷Ñ/÷lìBøÎQP?ü>›SAO{ü™¨ñ¨ñ¨Ȩ5jñ¨q*\-ºTë§ùSUêL±„ô}ÿPd$4ƒ5AøË-Ö* ƒ@tÕÛa(
289
- ¯ ÿN„ íͺzs…WJ$c+LîjüMoz…ñP= Õj$krŠ1"ÐвÍyð„uŸÆ²ï82NfÊ:O"z«6 Z=M²:ÊŔJ…•µNðázfAìܳcn‚-ÆlSÉb± ŸÙÙÚÁÞ&‡É:sÒêÖQk‚¸l¶-ҌpœPr­¦>6º½8(—À™Gtƒ΂sª¹×¼ÐâSr WEií$E¢UêNv.q*ª~$\*w¡´*âóuz^¥6F™ù_6¦ú vG‰·²Ú7‡çêwɐû$÷Mʺ‘\‚‚Ðÿ%WÇ 1ThÁ¹âþ<˜‡=M"¹»<Â1TLŒ¨‡ûFŽ‘1p¢Îð@”†çãÊò!d–g–'“: ¼F8Ø3ԄF—ÄG²ÞŸÚBŠ…@ÀÙG7ÖÜEy£J-îÀzˆn>Ä0D5K­M}4:‹sɀL3šÅ„ŽoZ-/³Ñùˆ7z„¯e_fÐU¤/ZÓüE‡ÂŸèÚþzþ-{zÚë\À=MhÖ¼= Gc€ê’t²Oek:öÅäªå4*•‘ê^íùÙi½<{é?<ۛwñ¨ñ¨ñ–zñ¨‘
290
- 1Ƭùðžv”¶v97«2j€¬–À.:dÍMzc‰×8ãCqU¾7ºžóv¢g‚ž+©Wœ.‚&?-§bÍ2þ¹šoÄ= gfì0Ãm’VÓªá:å-¡ÕU½4:ž°1ª ûy–ά•wwáÀª¾qÁuçõÝþ|˜%W0s3ÈY†á&Þ¢»h>éhotÚYUÌ÷ýÓSN¹¹¥ý¿áׯp~&ÔTj’ÕŽR¨|.^Fyiìÿ\ÅÚª”œrÕò™q¸¦~éÿÑê¨'ó®IÜ٘•IÏZ®›~Ü^ºvýubq‚sÞ±þԊ½F¦’áØ®€âH⊩— þkJÑ9ü|Ё/÷s¹Æùoª‰2Óþz·”®ýÒÔ¹·,ûJ9woE[%‹;Áļ¯9Wƒ}ªK&н$”Z *K‘™E¹Œc‚ZÂ-™M@«ªI"÷²?ª
291
- €«[vÍÚ©mènÅX*ÞÃÙVˆÙŒGrò«fÑ¥´g´Ä¬c9R=M³9óN
292
- À1?a9Ùûã_ÌÂÎÓnrÄHsç‡gÀÀ֍#í† 7 ¡õßlõjÈuʯBT"Ðü¾Tµ¡M­[NԖQ¹¶íc«!9§)•!ËøqB¢¾—uQ ä͂wiùªyÁÊ.ôŒ˜»)²@W‰j4}×=}ÆSîòÓƝÙie!MÁ6…cô–ý7­iÐ=M#’(h —e‚• ä‚ —fã[-·@)ÐOèç*ŠÐ·¥éÝ4:3ÀŽöôÕrÎ¥ó™~#Òp÷G瀴˜hÎzŽ=MưóvkîY8µ½MV û ,Èçè¤ŁeÕS¥(҈ÿ¶oÎqæÔ¾rÖ$E¤œÍQaw¥Â㑏‘ñí7„f#qÒòŒ-ëÈçë±qj£b(v”XWÓ|þ:uSë%‚b–ØÐö+g#ê˜Óx(€›rˆÎö”·øVhY)Ò/ÛòàJµ#,# ®ªjÉâµT6éRy‰Š)ž4ÀyiÈ*b= ùZ$8Ÿš'"ì>'ÉU†;¢Aë4¸»?*|ù£XŸ11|±9mÃÜKzŸG,5K€-\¯™HœsÇã¯SÀþóØZ5¡SVÂLGF‚cÚtý&N^7³²?˜xL¦Þ€/°Ã끿 Lr™Ã3‡ˆ×S±lñÃçªÆlÑ‹)\ É¿êA_‡—^œá—}üjM5y…óœd ¨ßϨPÅ৕^ $„dš¸dà1ôÏcPTh±m©À[§ÂGîTméêά$ÃGÈæmñ9_žFTbD3UC÷²O FQS‡Q«eQëªM#WKÓsˆ]<Î0=}f±DXP#ZP3)íûÇ:C‡4‘j=}P²@]YFïùKó.›
293
- Ú=}-
294
- GÇ>¯—<OÎñ¨öüöì¨Uúñ¨ñ¨ñ¨WÈ":ª *Üz:4š *ÊúE¸:cg:é4|Ü nÀ!rPýŠe'áKô‹ÜƒÀ´EL<E¶öe¿£4‡æø¡ÝaÕtџaøöT6úa·ÊÔÓmÈ;NbæÔ° ́÷ØÇ÷8©/e>
295
- ÞGsÑn«¶ÎÙhŒµ –%$ïƒT‚XV)¤ôàˆ†ÄàU…/7:.cƒÌveù_æ‹øcýdæÃÒÀƒhŸ8=}I¿P 2¯y âÕw±žۗYøœ¿šINrŸž”hÖt”xÙaÔW’ ¹gØù°=MÔÔׁ)õ±·†ücd§&ڇ)¼_Q”_LœÎ³=}™æT®jÉ+¥¬çìÊ ·‰G₎¡ºO.Ù­ñ§_€+hׄœpÂ-³­C"‘?ÎóvÃ4â>T°n»Š8Œø.~2ÒYú·“4Ööº÷ó/Όwc2üØ»"©_¬0÷Fz2vn£ØNÊ¢t=MŸã>‘ô1/CñÞµšó‘ŠS1þÁ‘çï řÞ6íqäJçµnìj…(¼¬ˆ²ùVõlûðf°æ±ûð‰c®uMÍ <òQ(ijѬF+máp4°– -}FIª‰®¤Á%¸N…g§À»wí£Ã(%5Jè€Æõ˜‘Öˆð“,ùAúb‘¢~Ê¥×õ“@ú7sçÿÝàPkÐ"/íiþ®=M'ُÍõ腋·†l‰Ño“3’­±7ÍZ¢ù͚ Ê:&Øf0—fù϶Ú&%ʀŽ8¼G譒•Ïú= œê†ö*Ò  æF­51””¶%Ï?§zi¶RYÌz^J…ؽ¸fŸò“/\2¥ªÐÚr7.&Ÿ-í›EtVù•²•_Vg!Æ)7§TwªÁÙež6‰Í´†øŽÞàÿLÍTq}UGͲ5QG ªÌ'ï Ì֎öž÷¿jÃËúp½ÿºëò_¹¯Lғvä³÷ê×#=M˜ˆ$[@z•»ã­œ’XŒêaÅ1Z¾;‚æt©±Ù).ب§q¹óhñ¨ò(ybJö'hJ:ø¸³y1¬b9ÉeVM]°4eSøO͎*Cxæ@ÅýäÓ¸ýoÐÈýÍ(Æ@H"¤}
296
- õ‡Ü‡h{“g¿¨À~¿ÑxX¿u$õˆ+ãpq¬˜§i)çïQ½fï×Ve¶yˆã-Øîî‰6¤¸ÏÑo…š–•,ȄÈbýßJ @=MûHn= 6 ˆ3Q¤ľƒ²„%֕bèÐ)†"öúÑ=MUàß¾¨Íö}ØâÉ#ýÖ 2ÚNB­ŽL·¡xY[Ó-)2,–”·ÁåxZëÐÒU3+ â½³ëŽ_z«xÙ
297
- I„2ٟ.l€÷ô×BYc" Zâ¬Fø”wj©i™î»v—êåj"‚è‘,jT¦´ü5H—óíÔ9.ð²,&™¶ô–<9£œ™ýÊ,|j‰-ÅñE)l¿.¥Æî—:=}ʃæ!¬u©ù3eê·¾òv¯Örnjy:I›÷7!zê³6º·2(÷$vi˜9z×:ý†‰r+¸z3Õ°ú4tˆ7´|f
298
- o¨BÐ(œ=MŽ@ªœ7ˆHˆÌU+ç ÿ lXÌìáNï*½Çé#’Hax몙Šg5F²˜6Û£–š9J¢½B[¹:{3°SÇt|~Ûð®ci:UÁfÉ^Ûð³_ʂ|––Bèί ËYú&žs~o Vœœž ¢N£#ÔÜyWrÑȁ˜S—¦UƂÁ,i¯=}¹ŠÖÃIBhÛ¬Me董S©¾&1=}ÿn3‡a÷𦯱ó¯Y(:"»¹zXÜÝ)ÇFø˜KwýPbÇ+­çv)“µ›ùDh-½^.Á›(¾ª¸L©%¨ºó2J{ؑ[¹:Dÿð|+õLÇ׎\Óó\O&þëdyWi=}À~]œ2vM–逜£/iÅüƒ"“/Åþþ¢¬K²ž²¡=}=}‚b}ÓCþ„«‡¦O7´Õ½†\®‡þö*¤sú¤Mu¶ß‡žuÙè{ݐa·Z Ž¬Q=}µ¡^´ŠqYI±ü3—·ÀÐgJôe4£ØÐÊ¢ØE ž™<‘£P]¸•\QñOݘ™Lߒ€óO“Ç9"Ŭÿó?†ÒÐÛ-ªD/^†,ëíO’6ÒÜ~¹T…&›q‡A(—T}
299
- ‹”Éݛtl àWje‹W⻵@·)dëÛîMåñ…WŒA= ±e,î|Äý¹]Gç¯JRœgݟìÃzö'Ìg÷i6nLÚzÃ9\݂.z7ÚÃJ¨]ø9^=MÉr]ÔÅ__=M-G̅ˆmé’=M4…%ŸÝ_uæ[º²@ô„•‰úòƒ¥fÞ¹ õåÏÁd\hðM% ‡ €ïjóË÷^F]_Úŗ-ã҄iHÜHJí£6Á‡íH
300
- [ â¯…ź>·¤Ÿ¥‡†]1i¼!†ìÏäR~õc=MúW|öÁŽ»¦c¨hDáôV>¤óŠ€r¸¤&NªÍÙ´=M6)æÐBد¼^= ð ñ/$Ò+ŠÒçyÍ12كŠÊÞT|ž¾T0dqÜßQ~UšáŠÖú$ àӌ¯áµs(Z…öâGÝv²6Î6ùŸÓÆÑ)'‰™¯\”ꉟ¤æ„è¥/±¡Bm¬©žLôºÔ1
301
- $–¡®/= ..3šº°ÒénY—Ù&Ú¢tȐ' NçtKfZõÂhä-îGÈÐ'õ€ç£Iv¸§eæ iž^=Mn”Ê“¡Kû•ÂvîúgÓ)´^ñ¨‹¡=M¾Àïäëç¿
302
- ýt$Ñ+ã&d”µÜ´0OÜ¥ÚÊËo³Ûëõžèȉ¦Öî= 2e‡W®æ})’´Ñ&„õ€„¸¢†%ß…iȇ¸c´²5\6¤«îø4*6^31)¡·ÂØHŠ×ø!?.æÖMó*9W)¯‹üö?‡"V¥!-iQ†³
303
- æ³íÉ#(7üÌøwè(kr­wZ‡!+3@93€Xé­ÎvHô
304
- FˆÙ-Áì0÷7xzn-fÚ,bš6ñÄɧBF–PwYÝÉðzpL™DúÒ¯€›£J31&Èæ6š4;kYǼrÂ]n¦?1奍˜OGm{0•^g(¨Å$! 8uAb¸^£
305
- r–ýA”nSaýQ®ú^ÛÚNEbóÌâV=Mþx xF‚þ¸û÷7ë¡};É1H}"›—çC­ s©“]9¸OgQû_Id¢ì hL¥Í+Œƒ|8é'Õ?ø¯?)ûëjÔcãºI1Q] ™Yÿ4³öñ;ÒQ}tôCfƬí?¡%à‹˜Å¹mgnË܆ØG l­¸j‚:o@Ž@§ØÐS÷ˆÄfúÏ+]ÐÄsì’ÿ%Ö]WyÄsg‚Öƒ%€•òßf]”‡Œ&L@ „tTiÏ ²æmõŽŒ}xõPêÄÀ¯²·y¤¥ þg5¦Ù|Æ¡ßÌ ŸEsÔ{ÑÍò¦OtF^PQ‡Î8d¤ør€ê«âf$ o¤ãx8x[Ë(‹†%ÍtÉçnÞÔ6G$AXݽϤmÃi2Üiyd0¯‚…*߁á.9žŠ*oíÁr‡·2Ã(s´ÈÅz÷zY¢Á¼öÔ°ç0}Ñ4µEö‘Ö r5l®Ä'1Æüç\ã>ƊøièLï֘À|e¨ùRB’aEHÐ¢MßÏãØª$Äß=Mç.Œ·–¼ªnD õ´÷"T·ñy)5¹’ùÊÊ(·ÕJϘLr4jŠô*2÷5=MŠù#¯v#Ñå~¶¢z>õ8‹ŒySæ É{Úõ«:£¿!ÓrYŽØç µÐÜ ×>兘ۓ&¼¤æ¸kgz;Ö0}Ë«]WÒÁþwqIM,[x@UbœG'1ÿôÃê‚(}/Q Ç“‘ÁÛâm¿p /|¼éBÐc«Q (ë3º(z2é¹:ºoû;@՛S?¿G†S‰kž«70>³r<ÞaåUGÒ;BAi¤°óGåÅ¥Û7BëUi~vJ;ãG}@OUm½ÛXKÁnnál!kýŸKe[kWG¼ëÃì½ìÉìÔLs4F³SÆAvÌ{¾š—™„€ˆ˜Ž†–‚’Šš ÿ=M  ˜~Œû=Müj[cowmuai\dpxnvbêÛãï÷íõáé|~—zswuil= hnvúóçíáéìôøöªϤn¢
306
- š÷§ Õ°VrfSu5€a¢Rð¯/‰×u®9=MVñ'¶3r)w·58Ýő9Ä@ð؎!i–ò¨*Î"ªy¹84òÛí¸“‘°2ÇàV²Zx²(îòú_ øÞn†Võa•óÑØ6‰—ó¹*$&Jš:Fãs!p‡Óú±"Ì.rZø5/Ɩføœ5Õ8RZ¹7
307
- ä(Úð³4³Îæbg±'Îʺt°=}F6‘Wó15zöœ8½8²ùîTòèu8Řz÷µ1Éfª‡Mv˜3û¥Ôp8û®‘&7´âyîÕâŠ8»á«ôZgɐ&Zësª¶@†ƒJۛ<K'ô®áP¨ñåküJ{«974žñ>Óëâ@\S@;ýnñð±æ§ñ(ñ¨ñ¨+ò¨ !5¶½ÔTT7}÷‘‰Øu°û¼jÿ¦°%æâ‰(ØLT7}÷‘â™ÃÛRðõµ$=Màނ²‰ÆGy0™âŠÚy³«ÏÃÛRðõ¯974^‚±‡ÈGaúºM:‹ƒf‰ÍcîKúD²àç?–´=Ms¯]ü‰oÓÄ·‡= r•ÄÈÿìÎRˆ}j©ÍÔ!¢ašŽØb„' ˆkÃÂO²Ü”
308
- o-ÛÈsƒUB4 SïgtW¦I-ºô­ç= Á(w¦=}õ¬Ð‰prŽ4×¥©ðU–„›rêÕ½¹àë®h—ùâٶ虍
309
- ö¡›SŠd(†îϤ!ŒÖ¬ÏGI.ä=MՎŸ°Ï”TºÃ«ÐLç}–¶ó¯!M\‰m¿„·} r”Ôˆÿðî҇…ª©Œû”Q›Q‹˜¡R„((hmӂϫÌ= “ÿjo1ËÈt•B6Óï"W<Én»¬·{´”Ù°ÿïø"‡ƒ²é̤!œUš‹¨‘¢VD()pŽ=MÚ¶O¬Ù€ÓJ²Ú0‚…6¶
310
- ÇG"T —¡TÑ,Bx¡®ÉÌ ynU¨sˆq‚ÖÈ 7҃’V¥ÝÞFÒ$Ÿ®mԊ䡿ëÔ³±,í#þ¨Eu½!–%óu'aÔ¸÷¨uÁ+ÓÍiñ_Æ4ÐaYñD„"KZVÆI×b ,AmÙJäµfëٓ±+÷Ä#ü°-u÷‡"†¥óU§bÌx÷©eA«ÚÝ òc.4ÌA)ò<6„ ;*ÖÄLwb Áí×z¤¬–«×‡É+ô ¤Tív'ǺϰȠ”~¯µ3¯ Eôםiá+TñKé™lt¸ô~\"“Ãt·‚˜2“Òx_ò겇
311
- ‹Ù‹= ÑDú ^q C$X%NžÌF?tü[a+LP›€qKəklxô|y¢ÓÊT·€ˆ²“ÎX_ñâr‡{Y‹@Qž<z >q;äX#>nnͺL!Eþ“üšï/¿ht|¡‚5j\eGÃ¥6&zf꺾ގyTTQê28ÞºŽH¼°@{ë±VñĨñ4Œñ¨6(ñ¨¡)®TòÙÑ$T˜ü¡ôO)”„ýÁµdOyGNùv„œùœÜ[:•=}Âýxý*ÔM¯Žó]'°ÎÛ¹v\,çSf’±âÎä'´fЁ€ëàƒLyҕ ((3s؃ìXBIB¾q×¹Í{ørñ+ڗ-·½¹oâ@® /]ãTªÁGà!7a³:Sˆ ÈÈ£gÖñÝA—Õ|ðh0£®ÔŠ˜%랍5OŽÆø
312
- ‘ŽïH·ØrÌe¯Q(Ûá^Ð3ºSÏpß=}…ªJ=MŽâ­ s|²…¬W"ƒ™½¤’#͇lyÑÝÁ”À“˜:»uæPÛñ1TÈVÚÂÙÀª/‚I‡Ýy Î/§‡ï7|’òŸ±#m˜mÛ,ãFjG…~.¼)wº‹Eù)•–Í —Ò(©aÁ;¹6x)z™ÉfŸ¬½P“ ÃÁ¥æmºÉÿ¤Fp±FÄæUwíŠcÆïô
313
- [S¥#,4F<C§ûš’4ü
314
- Óâï3DŽQ÷øœOœüN¹´œf'Á éñwl@ÀÆ(:l¯Z?;ÿkG>Ô €h2¶ïY] gªp¢Ù"–9ÓÇØtÔvU U£Ê‚÷nÎ\”aŽíˆŸØyX=M uே$×)þ[gÁ„GÞëU¡œrGþ-kHþsçJ.ëºÁ$»;;KC}“l:厠›‡¾ïÓa¤nÈ=M¥Õào‡¤Õñsèâ´ʼ“SNìl ÿ SÅàlP–žg—'Èü“WÎìtž°)SÉ lXžw·'
315
- >´œÙV.ƒ™t
316
- Ø.‹™uŠ è.“™v
317
- ø.›™wŠ!" ÷5wâÓyCg;œS»;iKKÞ£ý•6©ZÇaj¸²4¹±8
318
- é"0µ±øÚ˜&즸±(é8°Y±ØÊ˜" 4°Z±ʘ2 8pJ±˜.7pбҘ.¡7ÐBö-œ’™'ʘ´ífš± é7B±0¾˜¸œ’ºb±0Ƙ¸ž’:‚±0Θ¸ ’º¢±0֘¸¢’: ¼˜y À˜¹ Ęù Ș9 ̘y И91Ó"÷¦ø¶èœh¦•Y1íâøØü”×× ”Øü˜ ˜ûgÿ§ç' g§ç' [FԁíÍÔ'Ÿc†Ô‘íÑô'°{R¯}r¯’¯²¯ƒÒ¯…ò¯‡¯‰2¯‹R°r°’°‘²°“Ò°•ò°—°™2T›¼DqSœÀT±SÄdñSžÈt1SŸÌ„qT Ð”±ngüP»kGþ U´•1-Êwۈ§$.7÷ºùz:Ú. 4"ù®:Ô"Ò´nº1¹r6bÊÎ÷͚-‡ùv4âÊ/Îù=Mš5‡ú$v8ÂÂ+L™ýгEšh7HÊþ"+u7I
319
- þ2+y7ÊJ3m9NJ3q9ÈÊ"3u9É
320
- 23y9:gD<»{;»kÖLýDZìøf<†J=MÂ/]8ƒŠ=MÒ/a8„Ê=Mâ/e8…
321
- =Mò/i8†J/m8‡Š/q8ˆÊ"/u8‰
322
- 2/y8
323
- J-Â7]:Š-Ò7a:Ê-â7e:
324
- -ò7i:J.7m:Š.7ñ"ºú¨£z Ú.&7vz
325
- .67zYÃJÀ3\ÙÃjÈ3^YĊÐ3= ÙĪØ3bYÅÊà3dÙÅêè3fYÆ
326
- ð3hÙÆ*ø3jYÇJ3lÙÇj3nYȊ3pÙȪ3rYÉÊ 3tÙÉê(3vYÊ
327
- 03xÙÊ*83ºí—B@;»{K¿Å´î8–4¼QB!B.À4þ·¹lÓº‚-η= º¢-Ö·b:Â-Þ·dºâ-æ·f:-î·hº"-ö·j:B.þ·lºb.·.7.·/7/·070·1714)6?ü>}[;;;ëØ¨ñ¨ñ¨ñ¨ñ¨VxÜÈí5•&éï%U¦êò-¥¦éî9…ãݼqµcÞÁau#Þ½u•#Ý{„p‘Š ‚¸’†˜PeàՁ$àוÕ$ßڅ%¤àÖ]މz&Ήx'.‰y(® zďmaʟ=M_·ƒbƗM_Ô¥Á!Ô§ÕÔ!ÓªÅ$¡Ô¦ýߍcö÷͆fî×-†døç­†Ï3&ªø6=Mæª÷8êø4 6jìA'ìUÖ'ë
328
- E&§ì½= ’«xҘ®X2˜¬h²˜ó¥V¨ò­¦¨ñ¹fèò©ÆÑ{@>§+{AH‡«ûB@¯ëû@<ÍãÃhÙÝÄdÉ3ÝÃiÑó]EpÇëþFtïkþDzÏ þErƒÞÉl1³^Êq!sÊm5“ÉSì¬'>Ç_”;»úõñ¨ê•Þ¥§ñôW¢ñ¨@"Ó¢ÿ$èP.Ï’ñZ¼4ôôDk r­Wkt’7"9ö= ¦î»÷nº™P>.mJ±Î}HQ?Û\ÂQWÃ{ŠDxÓ¾½GUë\¿_E#ûÀSI‹ü;MÙ'\ЕgD_ٗ•¬_M>à/Åj…m¤ÿыÍdßN’tƒ= ¾+j¤œ€KD ÁNŒSdÞJn7‹Ì€N±¿ÜàÃiÃKG\ָߎÊpü_͊v îÚ­5lZpožŠsuÅ$ؘWá՜»ôtÆ_T›ÅB-ÆF‚¸¸êsv5½n¢"’lëg|Cölü<Z]‹›¼F<ÿÛ|ýQŠ}¾dÉ3MÄM†—D_ѳŸ€S¶lþDz݋œÀV|ÿÌ»W¶÷D¢Z!sŠo¥ç¬bӘ_ͯ!Ua<ާËÚþè6= &ÓÙ}K¶C;ۀšà  Nh¹K8.•;™ üBSyLÆa8ô!JD„ï4˜±ñfR(€‹šHº<aŠ{.V«+n³ ®À‡zþýýøýèýðýÕë_—j'CVýhœw¢Âêyvø"…ÁžJ…úÉUÉVÊTÉ$ʤ@8ìÅçÅ'Åçí'¼9ÃùÃdêdê°–§YñµÿìFå”Ï­nèٍŠ= 2Xå„f„jd‰fpÑ*ªƒ'vMlQ•VØðrzæ[ò_øcè3«”¥ • •¢š› › åõÁ.èq²“x¥9½ÆQʓõzå%pT&IâÐYiŠh
329
- ehäk‘%ÖMÖΕÍAPlFü9ðœÔì Ð„èŒ(̘ì>œøœxœN™Ž® †i«Þøñʓx¢,í~Ñr”ôyÕ°ócøë[ú“͕׍̙Ò=MÕ é%’/ä¶o2ˆ€'?i4@¢€ÈSvÝö^Až>}Á>ÊA ?hõ©õš(­Þ"ð™²õy+ï(‘vñÆ1©Ê%5=M-E-f-Õðpdp6VŽ޵~ń˝‹xö¢y7Á»°ûC£=M|ÁKa۞á˜Â†×ÉÙRï·×ÜЄSÉz]”“usöõ¶³´6354B??A@@Æ7uÜ"Τ…!­ãã=}ҕ³öYÕ[ßPÑ[àXÙRgu{jC^ýÏ;[œó8d5ЛD3:9ä ÷ÐüWë?ç·iÉ»nEó>Ù»rF3>¼{k+R¾/OkDM¾<«¨*ªñ¨wñ¨ñ¨ñ¨6ñY¥wÒ_͇e$ŸÍˆi4O‡d ˆh0o=M‡f(¯=Mˆj8Gmc‡mgVîdÖî= –îhî^vîföîb¶îj6®[B®c®_‚®g®]b®eâ®a¢®i"®\R®dÒ®= ’®h®^r®fò®b²®j2.[J.cÊ._Š.g
330
- .]j.eê.aª.i*.\Z.dÚ.= š.h.^z.fú.bº.j:n²é4îËg tf”•NƒkÜ¿N„oìÿ΃mäß΄qôŽƒlàώ„pðƒnèï„rø/nkÞÇno1‰õ҅AÌNôPt$ø§ස'wvþð7„&·n ’µRÓV¼F(Dšmõ‡£—§¡ilnuÒÕD–iÎdâi.E®ž’€émŽ1—hÎp!ÿÀ¦((uÔèrb)Gë²¼µE͎ë~Ȓp±ªÓØEò²L±m=Mف£÷É0”×*8aüªN8bºÎØ\Ëýo¢ávvþXÔ)­¢Éö®ËâÑ·pPåèƒÈ¥h®Ô0[Žæ/èò•x$ð|
331
- ȵªÑ|ÆgŸ=Mi։T°傡¸í&ÒÛgŸu]lTʵ!íÚp¾ÈNn§ñkÞ襦n'ñr~~W‡²p³ŠîÙ)¦¢2"{êJ1ÜùvªÉ/Þ8"“:xTbu&Ÿ¢Ù%'n¬Ñö ¬"´)ù{HRæ p˜éñf³È•êŽ.H¥ú”Jò% Ixàò¶/³ú™Z.^µº‡AФÔwbÖRŸ/íç™ÐVí¶–Á*->Ô¹gŠ 7Àçrk‡I ì_œO9åBxÙsä¢nñ6íñ¨E¶¦¨ñ(™ñ¦¨È‰út7¶º½ªº¼æºBB »<?sQãK×SATÀûAÐ;ν—Q¥ 0›
332
- =}tZ÷= [Õû¯û;³ÞêBb©<­¢«2>:ck~)—Cé<¬j
333
- »·J×Z{ÒûDÑFW= ‹C‰w‡[
334
- M?òÐ0Ò@!‚|i¤q–#ˆg'ÞgÐQ.QŠFnvÿõ\÷,K9è\‰7g¿çIéXœޜ­:ÀDõ]Ã^]J€ËC ƒO¸…O.‰Ïì4q |qòtìaÁb‹îÓÞÊ1=  Òbëþ„9„÷JÍÃpŽÓBŽÇ臘ØÚÌÿFmg)@홼ôõ½…½ÂeL¦’œºÀwßUb”¾ùìAîhžzהÂ%è"ÿª%Ì"pKç\Œ= Ä´›Aô~¢± }:zF6Ž"¨xR sJ^!n1,·÷ÂQÒij/]ÙÆ¬r˜½zõOîǗ­½Ðf,fì–VÌøˆsæpÞr¦ü'Ó©þôÝX °Ï6²]n?>xã>µl0Ì6÷Z²)[µ\'ÁÌtBªXÀóµ?ŽS §,÷p+Ò萺¨Ÿ·˜ÞþjéÊÔ˗£ž½nq|G6ùÌV§Ä.‘#îòü/ª’º¶×²¨ìnb'Å7›r½æ1{XóR¡ŸZ­n2þ*ÊM«î@,C3l‹TÃü.ûªAܛ4‘KzW/€ÛÚÁ3ºë÷Ž[a@9&½Ö–h’”ãô\7v~ÿrH®®]½5[½¹w-§*K$?æ%uFóì_G2ÎÁÛÔ‡E×VkÓÔ(pŽsÔH‚Iby6œaÀÔHEnnnnî
335
- ÕÕWš’¸0922hPå“c‚A3åWã܅›·G»ñm=}ñ¾D=}n “;˜¡HsQkBs>5#AÕɻҳ;®þBÓÇi»äKÛý¹BïÝb«”ûIǨÔG/ýgIQ;ÉY;'*•ÛRÇ>á³e‹fæ<â<o¸T[:H»®²> ¬CÓ¿®{vAñ7@L»Î…LX§ÄëLÀú@[©ŠZ¿!ß\®;ý‡t¥UKŽïUœTÂã ÒK6M¬²?¶Éû6>CõuÉýBMó轛’è]#¿^?^¹}‹6lĦu̓V|ÝL¾„wúÌßÙṙ >ÍñŒE“¤R<IL«Öæ?/ãa<Ù4—ûUãÀîC\-gR2òDì%ÀË)g)âÆ+÷Ô]%,´Luœ_!ÿ'3•l ócá•„ó©M× …„#ZU›uº±ÑÝ.àã€dÙ”øÙgž…*£œÓ×ö{É]@²wŠ|²séûb¸Ð§&=}= bã  e%+†PI
336
- l›5˜p›‰U–âGäÄL#+d^©®çlV°SêlÜ2øm‘Êp= A¡ç¯ÔT˜R§ S™mâeÁ•›àä= •ïþM€¡•œ‚§ˆtªî¡m.¨#ÖÑ¥±¤pypÑÆ* ‚21³D¶±œø>¢Ô(Ãu³uŒD¢W¯ÔÄ'ºêÐ;eV;~Z»;€= »1A{{s½×ÂC%rN›ÌÛQý%†]ó|›KªÑüÌڅ+¤n½BâüޅH™T +hæNç¨1¾€œË7–sËVŽüê¦d¿õÉ>õÜI5ٖ>žWI¾ÌÂ+ÿGÞ®äY£=MƟO$uH€"pÜtŠc·Ázìø2£œ„áH´œØÑ/ó¡Ò/Ow¶ö‚Û‰FQ1'µ‹Ã6áÅÁ·RôOë<²­_¾µ°ý|”ß/öb=M†R©¡µg*5ыI6#ÜU²¸Û<n2ÛGºªሖ‡EW]ãt¿Àl¸-{+‰&å¡°ð3éð³¢ú¹Ù'7äö¨"÷ˆøýìØ‡èAµg#w¶L°ê7=}=M˜‰BФC&hé#ñ4ᙴ8 &2Éósnœæï î%í¢†-귐mœ|–h*¤–WåØ;AÀ>
337
- @3Å[ЉûNhDîQFü*Ý?uJûØ6ë
338
- A™§²Âœp˜[ô’s‹šFû .oCtï@ݘÚý‰# £=MÖ#ƒ‡wìîxýß½GÒÿDó|Ü}5jìÝNȰ5EÇ>ïvßøN’À‚ªfÈÆHøýˆ §åpª­( øç°ÓX–*)· ©T0œ¢Ç‚¹ÆÑB¿Ÿ¤iÅ5mtímhâ¡'»BNiÇ©¦=}{fLÐË+¡ùC}ØûÀÓ}qb³.x;ݎ<¸Ø<圢›‹ÆrEØø>¬C䇭‹ ·|ãKLQfäÕ6˜5av„TõÝýît›™Ð"¦6Ál¬¨6ñý>HG8¶  $  —=MøÄƒd»¥BGÁØÇ¼¹$=}¯ŸŠã)uYGz;žC}pd¿\|‘6(L=Mf_ï#ß«WÞ¥§fŸp@0N6‘
339
- Š'¤sªˆQø÷Õ¬Åq¾>.øü·¢D5³T…áhÅ8zDvO= ¯óÝyàÙåFÆÒ•çcËóŒz?Ê5cèŠ–úë.ÌðÐޛ~†O Ë|¿Ó˜Q§ v)BHXƒš6œøöDއ¥„˜ŠkÒÚa¡cÙ7—¦x©nº¡6¾}®­iÏ<ÎWhš‘2 9's"IɎ<»ïX\#F\Ë_4F[ eŠÚ ¸Šø¹2øH$žß9_xì9i 2µšã
340
- ã/¸Äyf"Ÿ5TàyÊ0îEê²Þ—€m6ëÞè6ðÏâ§9ž¬„k=}¼àt<ž‚¦Mdžç6"p_î3, oO3p"pw÷´/(1ñøs.íA/&ÏUÃ_X™ÍpÕ1hÌ80E’Qö„
341
- ow÷!x.™AÜ"¢j+惡¦¶®ä“R–ow÷!xꔊpn…â#ðù
342
- z AÍp\Ž0N˜HJê´ªØ^U
343
- I€wu¸öôú!3å6³‹âVq£³¹´RN£%y10º:pŠ#\:J:b9Hµ7h_Ž:¢I9 _¼™µV,þ <`});var ee={a:y};this.setModule=t=>{e.setModule(eX,t)},this.getModule=()=>e.getModule(eX),this.instantiate=()=>(this.getModule().then(e=>WebAssembly.instantiate(e,ee)).then(e=>{let t=e.exports;b(t),o=t.g,s(),D(t),n()}),this.ready=new Promise(e=>{n=e}).then(()=>{this.HEAP=o.buffer,this.malloc=S,this.free=T,this.opus_frame_decoder_create=x,this.opus_frame_decode_float_deinterleaved=C,this.opus_frame_decoder_destroy=w}),this)}function tX(e={}){tX.errors||Object.defineProperties(tX,{errors:{value:new Map([[-1,`OPUS_BAD_ARG: One or more invalid/out of range arguments`],[-2,`OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer`],[-3,`OPUS_INTERNAL_ERROR: An internal error was detected`],[-4,`OPUS_INVALID_PACKET: The compressed data passed is corrupted`],[-5,`OPUS_UNIMPLEMENTED: Invalid/unsupported request number`],[-6,`OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed`],[-7,`OPUS_ALLOC_FAIL: Memory allocation has failed`]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(e=>{this._common=e,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);let t=this._common.allocateTypedArray(this._channels,Uint8Array);t.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,t.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=e=>{if(!(e instanceof Uint8Array))throw Error(`Data to decode must be Uint8Array. Instead got `+typeof e);this._input.buf.set(e);let t=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,e.length,this._output.ptr),n;return t<0&&(n=`libopus `+t+` `+(tX.errors.get(t)||`Unknown Error`),console.error(n),t=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,t),samplesDecoded:t,error:n}},this.decodeFrame=e=>{let t=[],n=this._decode(e);return n.error&&this._common.addError(t,n.error,e.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=e.length,this._outputSamples+=n.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(t,[n.outputBuffer],this._outputChannels,n.samplesDecoded,this._sampleRate)},this.decodeFrames=e=>{let t=[],n=[],r=0,a=0;for(;a<e.length;){let o=e[a++],s=this._decode(o);t.push(s.outputBuffer),r+=s.samplesDecoded,s.error&&this._common.addError(n,s.error,o.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=o.length,this._outputSamples+=s.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(n,t,this._outputChannels,r,this._sampleRate)},this._isWebWorker=tX.isWebWorker,this._WASMAudioDecoderCommon=tX.WASMAudioDecoderCommon||$Y,this._EmscriptenWASM=tX.EmscriptenWASM||eX,this._module=tX.module;let t=e=>typeof e==`number`,n=e.sampleRate,r=e.channels,a=e.streamCount,o=e.coupledStreamCount,s=e.channelMappingTable,c=e.preSkip,l=+!!e.forceStereo;if(r>2&&(!t(a)||!t(o)||!Array.isArray(s)))throw Error(`Invalid Opus Decoder Options for multichannel decoding.`);return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(n)?n:48e3,this._channels=t(r)?r:2,this._streamCount=t(a)?a:1,this._coupledStreamCount=t(o)?o:this._channels-1,this._channelMappingTable=s||(this._channels===2?[0,1]:[0]),this._preSkip=c||0,this._forceStereo=r<=8&&r!=2?l:0,this._inputSize=32e3*.12*this._channels,this._outputChannelSize=5760,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}var nX=class e{onLog;constructor(e){this.onLog=e}ctx=null;gain=null;muted=!1;decoder=null;config=null;opus=null;opusReady=null;base=0;nextStartTime=0;scheduledCount=0;sources=[];gen=0;ensureCtx(){return this.ctx||(this.ctx=new AudioContext,this.gain=this.ctx.createGain(),this.gain.gain.value=+!this.muted,this.gain.connect(this.ctx.destination)),this.ctx}setMuted(e){this.muted=e,this.gain&&(this.gain.gain.value=+!e)}configure(e){this.config=e}async resumeContext(){let e=this.ensureCtx();e.state===`suspended`&&await e.resume()}isOpus(){return(this.config?.codec??``).toLowerCase().startsWith(`opus`)}static packetOf(e){let t=new Uint8Array(e.byteLength);return e.copyTo(t),t}opusDecodeAndSchedule(e,t,n){t.length!==0&&(this.opus||(this.opus=new tX,this.opusReady=this.opus.ready.then(()=>void 0)),this.opusReady?.then(()=>{if(n!==this.gen||!this.opus)return;let{channelData:r,samplesDecoded:a,sampleRate:o}=this.opus.decodeFrames(t);if(this.onLog?.(`audio:opus-decoded`,{packets:t.length,samplesDecoded:a,sampleRate:o,channels:r.length,ctxState:this.ctx?.state??`none`}),a<=0||r.length===0)return;let s=e.createBuffer(r.length,a,o);for(let e=0;e<r.length;e++)s.getChannelData(e).set(r[e].subarray(0,a));this.scheduleBuffer(e,s,n)}).catch(e=>{this.onLog?.(`audio:opus-wasm-failed`,{error:e instanceof Error?e.message:String(e)})}))}enqueue(t,n){if(!this.config||t.length===0)return;let r=this.ensureCtx(),a=++this.gen;if(this.base=n,this.nextStartTime=r.currentTime,this.scheduledCount=0,this.isOpus()){this.opus&&this.opusReady?.then(()=>this.opus?.reset());let o=t.filter(e=>e.timestamp/1e3>=n).map(t=>e.packetOf(t));this.onLog?.(`audio:enqueue`,{chunks:t.length,afterFilter:o.length,fromEpochMs:n,firstTsMs:t[0]?Math.round(t[0].timestamp/1e3):null,lastTsMs:t.at(-1)?Math.round(t.at(-1).timestamp/1e3):null,ctxState:r.state,codec:this.config.codec}),this.opusDecodeAndSchedule(r,o,a);return}this.decoder&&this.decoder.state!==`closed`&&this.decoder.close();let o=!1,s=new AudioDecoder({output:e=>this.scheduleAudioData(r,e,a),error:e=>{o||(o=!0,this.onLog?.(`audio:decode-error`,{error:e instanceof Error?e.message:String(e),codec:this.config?.codec??null}))}});try{s.configure(this.config)}catch(e){this.onLog?.(`audio:configure-failed`,{error:e instanceof Error?e.message:String(e),codec:this.config?.codec??null});return}this.decoder=s;for(let e of t)e.timestamp/1e3>=n&&s.decode(e)}append(t){if(t.length===0)return;if(this.isOpus()){let n=this.ctx;if(!n||this.nextStartTime===0){this.onLog?.(`audio:append-dropped`,{chunks:t.length,hasCtx:!!n,nextStartTime:this.nextStartTime});return}this.opusDecodeAndSchedule(n,t.map(t=>e.packetOf(t)),this.gen);return}let n=this.decoder;if(!(!n||n.state===`closed`))for(let e of t)n.decode(e)}scheduleAudioData(e,t,n){if(n!==this.gen){t.close();return}let r=t.numberOfFrames,a=t.numberOfChannels,o=t.sampleRate,s;try{s=e.createBuffer(a,r,o);for(let e=0;e<a;e++){let n=s.getChannelData(e);t.copyTo(n,{planeIndex:e,format:`f32-planar`})}}finally{t.close()}this.scheduleBuffer(e,s,n)}scheduleBuffer(e,t,n){if(n!==this.gen)return;this.scheduledCount++<3&&this.onLog?.(`audio:scheduled`,{n:this.scheduledCount,durationS:Math.round(t.duration*100)/100,startAt:Math.round(Math.max(e.currentTime,this.nextStartTime)*100)/100,ctxTime:Math.round(e.currentTime*100)/100,ctxState:e.state});let r=e.createBufferSource();r.buffer=t,r.connect(this.gain??e.destination);let a=Math.max(e.currentTime,this.nextStartTime);r.start(a),this.nextStartTime=a+t.duration,this.sources.push(r),r.onended=()=>{this.sources=this.sources.filter(e=>e!==r)}}audioNowSec(){return this.ctx?this.ctx.currentTime:0}baseEpochMs(){return this.base}stop(){this.gen++;for(let e of this.sources)try{e.stop()}catch{}this.sources=[],this.decoder&&this.decoder.state!==`closed`&&this.decoder.close(),this.decoder=null}close(){if(this.stop(),this.opus){let e=this.opus;this.opus=null,this.opusReady?.then(()=>e.free()).catch(()=>{}),this.opusReady=null}this.ctx&&this.ctx.close(),this.ctx=null,this.gain=null}},rX=class{opts;frames=[];constructor(e){this.opts=e}get size(){return this.frames.length}push(e){let t=0,n=this.frames.length;for(;t<n;){let r=t+n>>1;this.frames[r].tsMs<e.tsMs?t=r+1:n=r}for(this.frames.splice(t,0,e);this.frames.length>this.opts.maxFrames;)this.frames.shift()?.close()}frameFor(e){let t=null;for(let n of this.frames)if(n.tsMs<=e)t=n;else break;return t}bufferedAheadMs(e){let t=this.frames[this.frames.length-1];return t?Math.max(0,t.tsMs-e):0}evictBehind(e){let t=e-this.opts.keepBehindMs;for(;this.frames.length>0&&this.frames[0].tsMs<t;)this.frames.shift().close()}clear(){for(let e of this.frames)e.close();this.frames=[]}},iX=class{now;baseEpochMs=0;wallAnchorMs=0;_rate=0;_paused=!0;mode=`video`;audioAnchorS=0;audioNow=null;constructor(e=()=>performance.now()){this.now=e}get rate(){return this._rate}get paused(){return this._paused}seekTo(e){this.baseEpochMs=e,this.wallAnchorMs=this.now(),this._paused=!0,this._rate=0,this.audioNow=null}play(e,t,n,r){this.baseEpochMs=t===`audio`&&n!==void 0?n:this.playheadMs(),this.wallAnchorMs=this.now(),this._rate=e,this._paused=!1,this.mode=t,t===`audio`&&r?(this.audioNow=r,this.audioAnchorS=r()):this.audioNow=null}pause(){this.baseEpochMs=this.playheadMs(),this._paused=!0,this._rate=0,this.audioNow=null}setRate(e,t){this.baseEpochMs=this.playheadMs(),this.wallAnchorMs=this.now(),this._rate=e,this._paused=e===0,this.mode=t,this.audioNow=null}playheadMs(){return this._paused?this.baseEpochMs:this.mode===`audio`&&this.audioNow?this.baseEpochMs+(this.audioNow()-this.audioAnchorS)*1e3:this.baseEpochMs+(this.now()-this.wallAnchorMs)*this._rate}},aX=90,oX=250,sX=15e3,cX=`low`,lX=36e5,uX=5*6e4;async function dX(e,t,n){let r;try{return await Promise.race([e,new Promise((e,a)=>{r=setTimeout(()=>a(Error(`${n} timed out after ${t}ms`)),t)})])}finally{r!==void 0&&clearTimeout(r)}}var fX=class{deps;engine=null;profile;adaptive=!1;desiredRate=1;muted=!1;audio=null;dirs=new Map;scrubbing=!1;source;loaders=new Map;ring=new rX({maxFrames:aX,keepBehindMs:oX});clock=new iX;constructor(e){this.deps=e,this.profile=`high`,this.source=new fY({fetchImpl:this.doFetch(),onLog:(e,t)=>this.deps.onLog?.(`byte-range`,e,t)})}doFetch(){let e=this.deps.fetchImpl??((e,t)=>fetch(e,t)),t=this.deps.requestHeaders;return(n,r)=>{let a=new Headers(t);return r?.headers&&new Headers(r.headers).forEach((e,t)=>a.set(t,e)),e(n,{...r,credentials:`include`,headers:a})}}ensureIndex=async e=>{let t=this.engine?.getActiveProfile();t&&t!==this.profile&&(this.profile=t);let n=await this.ensureIndexFor(this.profile,e);n!==null&&n!==this.profile&&(this.profile=n)};dirFor(e){let t=this.dirs.get(e);if(t)return t;let n=this.deps.directoryFor(e);return this.dirs.set(e,n),n}async ensureIndexFor(e,t){let n=this.dirFor(e),r=n.isCovered(t);r||this.deps.onLog?.(`wc-tier`,`ensureIndex:start`,{epochMs:t,profile:e});try{let a=await dX(n.ensureAround(t),sX,`directory.ensure`);return a.profile===null?(this.deps.onLog?.(`wc-tier`,`ensureIndex:no-directory`,{epochMs:t,profile:e}),null):(r||this.deps.onLog?.(`wc-tier`,`ensureIndex:built`,{profile:a.profile,segments:a.segments.length,hydrated:a.hydrated,first:a.segments[0]?.startMs??null,last:a.segments.at(-1)?.startMs??null}),a.profile)}catch(t){throw this.deps.onLog?.(`wc-tier`,`ensureIndex:failed`,{profile:e,error:t instanceof Error?t.message:String(t)}),t}}prefetchAhead(e,t){let n=(Math.floor(t/lX)+1)*lX;if(t<n-uX)return;let r=this.dirFor(e);r.isCovered(n+1)||r.ensure(n,n+lX).catch(t=>{this.deps.onLog?.(`wc-tier`,`prefetch:failed`,{hourEnd:n,profile:e,error:t instanceof Error?t.message:String(t)})})}locate=e=>lJ(this.dirFor(this.profile).all(),e);segmentRef(e,t){let n=lJ(this.dirFor(e).all(),t);if(n.kind!==`segment`)return null;let{uri:r,startMs:a,durMs:o,bytes:s,mfra:c}=n.seg;return{url:r,startMs:a,durMs:o,...s===void 0?{}:{bytes:s},...c===void 0?{}:{mfra:c}}}loaderFor(e){let t=this.loaders.get(e);if(t)return t;let n=new JY({source:this.source,locate:t=>this.segmentRef(e,t),profile:e,onLog:(e,t)=>this.deps.onLog?.(`byte-range`,e,t)});return this.loaders.set(e,n),n}loadRun=async(e,t)=>{let n=this.scrubbing?cX:this.profile;return n!==this.profile&&await this.ensureIndexFor(n,e),this.prefetchAhead(n,e),this.loaderFor(n).load(e,{...this.scrubbing?{keyframeOnly:!0}:{},signal:t})};buildEngine(){let e=this.deps.videoFactory??(e=>new XY(e)),t=null,n=e({ring:this.ring,onError:e=>t?.abortDead(e)}),r=this.deps.audioFactory??(()=>new nX((e,t)=>this.deps.onLog?.(`audio`,e,t))),a=this.deps.hasAudio?r():null;a?.setMuted(this.muted),this.audio=a;let o=new zY({locate:this.locate,loadRun:this.loadRun,video:n,audio:a,ring:this.ring,clock:this.clock,draw:e=>this.deps.draw(e),onState:e=>this.deps.onState(e),onPosition:e=>this.deps.onPosition(e),now:()=>performance.now(),raf:this.deps.raf??(e=>{let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)}),onDead:(e,t)=>this.deps.onDead(e,t),ensureIndex:this.ensureIndex,profile:this.profile,adaptive:this.adaptive,initialRate:this.desiredRate,onLog:this.deps.onLog});return t=o,o}async playRecorded(e,t,n,r=!1){this.engine&&(n!==this.profile||r!==this.adaptive)&&(this.engine.dispose(),this.engine=null),this.profile=n,this.adaptive=r,this.scrubbing=!1,this.engine||=this.buildEngine(),await this.engine.seek(t)}async seek(e){this.engine&&await this.engine.seek(e)}async commit(e){this.scrubbing=!1,this.engine&&await this.engine.resumeFromScrub(e)}setRate(e){this.desiredRate=e,this.engine?.setRate(e)}setMuted(e){this.muted=e,this.audio?.setMuted(e)}stepFrame(e){this.engine?.stepFrame(e)}pauseForScrub(){this.scrubbing=!0,this.engine?.pauseForScrub()}dispose(){this.engine?.dispose(),this.engine=null,this.audio=null,this.ring.clear(),this.source.clear(),this.loaders.clear(),this.dirs.clear(),this.scrubbing=!1}},pX=Co([B({kind:U(`adaptive`)}),B({kind:U(`profile`),profile:ps})]),mX=B({serverUrl:P().min(1),token:P().min(1),deviceId:F().int().nonnegative(),target:pX,muted:I(),stats:I().optional(),highlight:WK.optional(),snapshot:P().optional()});function hX(e,t){try{return new URL(t,e).toString()}catch{return t}}function gX(e,t){QK(t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t})}function _X(e){switch(e){case`playing`:return`playing`;case`error`:return`error`;case`connecting`:case`disconnected`:case`idle`:return`connecting`}}function vX(e){return e.kind===`adaptive`?{kind:`adaptive`}:{kind:`profile`,profile:e.profile}}function yX(e){return e.kind===`adaptive`?`embed:adaptive`:`embed:profile:${e.profile}`}function bX(e){let t=mX.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)}}function xX({message:e}){return(0,S.useEffect)(()=>{gX(`error`,e)},[e]),(0,C.jsxs)(`div`,{style:{position:`fixed`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#000`,color:`#f87171`,fontFamily:`system-ui, sans-serif`,fontSize:13,padding:16,textAlign:`center`},children:[`Embed config error: `,e]})}function SX({system:e,deviceId:t,token:n,initialTarget:r,initialMuted:a,initialStats:o,initialHighlight:s,initialSnapshot:c}){let[l,u]=(0,S.useState)(r);(0,S.useEffect)(()=>XK(t),[t]);let d=(0,S.useRef)(l);d.current=l;let[f,p]=(0,S.useState)(a),[m,h]=(0,S.useState)(o),[g,_]=(0,S.useState)(s),[v,y]=(0,S.useState)(c),[b,x]=(0,S.useState)(0),[w,T]=(0,S.useState)({w:window.innerWidth,h:window.innerHeight}),E=Kq(e,t,g),D=yq(),ee=(0,S.useRef)(D.setActiveMic);ee.current=D.setActiveMic;let te=(0,S.useRef)(0),{handleOffer:O,getIceServers:ne,addIceCandidate:re,getIceCandidates:ie,closeSession:ae,getSessionState:oe}=VK(e.trpcClient,t),se=(0,S.useMemo)(()=>vX(l),[l]),k=(0,S.useMemo)(()=>(e,t,n)=>O(se,e,t,n),[O,se]),A=(0,S.useMemo)(()=>(e,t,n,r)=>O(n,t,e,r),[O]),ce=(0,S.useRef)(null),[le,ue]=(0,S.useState)(!1),[de,j]=(0,S.useState)(!1),M=(0,S.useRef)(null),fe=(0,S.useRef)(null),pe=(0,S.useRef)(null),me=(0,S.useRef)(null),he=(0,S.useRef)(bY()),ge=(0,S.useRef)(new Map),_e=(0,S.useRef)(!1),N=(0,S.useMemo)(()=>({Authorization:`Bearer ${n}`}),[n]),ve=(0,S.useMemo)(()=>()=>(pe.current||=new fY({headers:N}),pe.current),[N]),ye=(0,S.useMemo)(()=>n=>{let r=ge.current.get(n);if(r)return r;let a=new xJ({baseUrl:hX(e.serverUrl,fJ),deviceId:t,profile:n,headers:N,onLog:(e,t)=>QK({type:`log`,scope:`directory`,msg:e,data:t})});return ge.current.set(n,a),a},[e,t,N]),be=(0,S.useMemo)(()=>e=>{let t=ce.current,n=t?.getContext(`2d`);if(!t||!n)return;let r=window.devicePixelRatio||1,a=Math.max(1,Math.round(w.w*r)),o=Math.max(1,Math.round(w.h*r));t.width!==a&&(t.width=a),t.height!==o&&(t.height=o),n.imageSmoothingEnabled=!0,n.imageSmoothingQuality=`high`;let s=`displayWidth`in e?e.displayWidth||e.codedWidth:typeof e.width==`number`?e.width:0,c=`displayHeight`in e?e.displayHeight||e.codedHeight:typeof e.height==`number`?e.height:0;if(s<=0||c<=0)return;let l=Math.min(a/s,o/c),u=s*l,d=c*l;n.clearRect(0,0,a,o),n.drawImage(e,(a-u)/2,(o-d)/2,u,d),j(!0)},[w.w,w.h]),xe=(0,S.useRef)(be);xe.current=be;let[Se,Ce]=(0,S.useState)(null),we=(0,S.useRef)(null),[Te,Ee]=(0,S.useState)(!1),De=(0,S.useRef)(Te);De.current=Te;let Oe=(0,S.useRef)(f);Oe.current=f;let ke=(0,S.useRef)(!1);(0,S.useEffect)(()=>{QK({type:`log`,scope:`recorded:canvas`,msg:`visibility`,data:{visible:(Te||le)&&de,recordedActive:Te,scrubbing:le,previewReady:de}})},[Te,le,de]),(0,S.useEffect)(()=>{if(!(f||Te||le))return;let e=setInterval(()=>{let e=0;for(let t of Array.from(document.querySelectorAll(`video`))){t.muted||(t.muted=!0,e++);let n=t.srcObject;if(n instanceof MediaStream)for(let t of n.getAudioTracks())t.enabled&&(t.enabled=!1,e++)}e>0&&QK({type:`log`,scope:`live-audio`,msg:`re-muted`,data:{corrected:e}})},1e3);return()=>clearInterval(e)},[f,Te,le]),(0,S.useEffect)(()=>{we.current?.setMuted(f)},[f]),(0,S.useEffect)(()=>{let e=!0;return(async()=>{let t=typeof VideoDecoder<`u`,n=await xY({videoConfig:{codec:`hvc1.1.6.L120.B0`},hasVideoDecoder:t,hasAudioDecoder:typeof AudioDecoder<`u`,isVideoSupported:async e=>t?(await VideoDecoder.isConfigSupported(e)).supported===!0:!1});e&&Ce(n.capability)})(),()=>{e=!1}},[]);let Ae=(0,S.useCallback)(()=>{if(we.current)return we.current;let e=new fX({deviceId:t,requestHeaders:N,directoryFor:ye,draw:e=>{ke.current||(ke.current=!0,QK({type:`log`,scope:`recorded:draw`,msg:`first engine frame`,data:{hasFrame:!!e.frame,tsMs:Math.round(e.tsMs)}})),e.frame&&xe.current(e.frame)},onState:e=>QK({type:`recState`,state:e}),onPosition:e=>{te.current=e,QK({type:`position`,positionMs:e})},onDead:(e,t)=>{we.current?.dispose(),we.current=null,QK({type:`log`,scope:`wc-playback`,msg:`tier dead — holding last recorded frame (live NOT revealed)`,data:{epoch:e,cause:t instanceof Error?t.message:t}}),QK({type:`recState`,state:`error`})},hasAudio:Se===`webcodecs-av`,onLog:(e,t,n)=>QK({type:`log`,scope:e,msg:t,data:n})});return e.setMuted(Oe.current),we.current=e,e},[t,N,ye,Se]),je=(0,S.useRef)(Ae);je.current=Ae;let Me=(0,S.useRef)(Se);Me.current=Se;let Ne=(0,S.useMemo)(()=>async n=>{fe.current||=(me.current||=new HJ({baseUrl:hX(e.serverUrl,fJ),deviceId:t,headers:N,onLog:(e,t)=>QK({type:`log`,scope:`strip`,msg:e,data:t})}),new yY({source:ve(),warmAhead:(e,t)=>{let n=36e5,r=(Math.floor(e/n)+(t===1?1:-1))*n;ye(`low`).ensure(r,r+n).catch(()=>{})},locate:async e=>{let t=ye(`low`);await t.ensureAround(e);let n=dJ(t.all(),e);return n===null?null:{url:n.uri,startMs:n.startMs,durMs:n.durMs,...n.bytes===void 0?{}:{bytes:n.bytes}}},decode:async e=>(M.current||=new MJ,M.current.decodeSegment(e)),draw:e=>xe.current(e),onDrawn:()=>{he.current.fire()&&QK({type:`scrubDrawn`})},onLog:(e,t)=>QK({type:`log`,scope:`scrub`,msg:e,data:t})}));try{await fe.current.scrubTo(n)}catch(e){wJ(e)&&!_e.current&&(_e.current=!0,QK({type:`log`,scope:`scrub`,msg:`webcodecs-unsupported`,data:{codec:e.codec}}))}},[ye,ve,e,t,N]),Pe=(0,S.useRef)(Ne);Pe.current=Ne,(0,S.useEffect)(()=>()=>{fe.current?.dispose(),me.current?.dispose(),we.current?.dispose()},[]),(0,S.useEffect)(()=>{let e=e=>{ue(!1);let n=we.current;if(n){n.commit(e);return}if(Me.current===`unavailable`){QK({type:`recState`,state:`error`});return}Ee(!0),j(!1);let r=d.current,a=r.kind===`profile`?r.profile:`mid`;je.current().playRecorded(t,e,a,r.kind===`adaptive`)};return window.__camstackEmbed={setMuted:e=>p(e),setTarget:e=>{let t=pX.safeParse(e);t.success&&u(t.data)},setStats:e=>h(e),setHighlight:e=>_(e),setSnapshot:e=>y(e),setMic:e=>ee.current(e?t:null),fit:(e,t)=>T({w:e,h:t}),reconnect:()=>x(e=>e+1),playRecorded:(e,t,n)=>{if(Me.current===`unavailable`){QK({type:`log`,scope:`recorded:engine`,msg:`webcodecs-unavailable`,data:{capability:Me.current}}),QK({type:`recState`,state:`error`});return}Ee(!0),je.current().playRecorded(e,t,n)},seek:t=>{if(!Number.isFinite(t))return;let n=we.current;if(n){n.seek(t);return}e(t)},scrubCommit:t=>{Number.isFinite(t)&&e(t)},scrubStart:()=>{QK({type:`log`,scope:`recorded:scrub`,msg:`scrubStart`,data:{}}),we.current?.pauseForScrub(),De.current||j(!1),he.current.reset(),ue(!0),te.current>0&&fe.current?.armPrefetch(te.current)},scrubTo:e=>{Number.isFinite(e)&&Pe.current(e)},scrubEnd:t=>{Number.isFinite(t)&&e(t)},setRate:e=>{Number.isFinite(e)&&we.current?.setRate(e)},stepFrame:e=>{e!==1&&e!==-1||we.current?.stepFrame(e)},goLive:()=>{we.current?.dispose(),we.current=null,Ee(!1),QK({type:`recState`,state:`live`})}},()=>{window.__camstackEmbed&&delete window.__camstackEmbed}},[t]),(0,S.useEffect)(()=>{QK({type:`micState`,state:D.micState})},[D.micState]),(0,S.useEffect)(()=>$K(e=>{let t=window.__camstackEmbed;if(t)switch(e.kind){case`setMuted`:t.setMuted(e.value);break;case`setTarget`:t.setTarget(e.value);break;case`setStats`:t.setStats(e.value);break;case`setHighlight`:t.setHighlight(e.value);break;case`setSnapshot`:t.setSnapshot(e.value);break;case`setMic`:t.setMic(e.value);break;case`fit`:t.fit(e.w,e.h);break;case`reconnect`:t.reconnect();break;case`playRecorded`:t.playRecorded(e.deviceId,e.epochMs,e.profile);break;case`seek`:t.seek(e.epochMs??e.value);break;case`scrubCommit`:t.scrubCommit(e.epochMs??e.value);break;case`scrubStart`:t.scrubStart();break;case`scrubTo`:t.scrubTo(e.epochMs??e.value);break;case`scrubEnd`:t.scrubEnd(e.epochMs??e.value);break;case`setRate`:t.setRate(e.rate??e.value);break;case`stepFrame`:{let n=e.dir;(n===1||n===-1)&&t.stepFrame(n);break}case`goLive`:t.goLive();break;default:break}}),[]);let Fe=yX(l);return(0,C.jsxs)(`div`,{style:{position:`fixed`,left:0,top:0,width:w.w,height:w.h,background:`#000`},children:[(0,C.jsx)(EK,{serverUrl:e.serverUrl,streamKey:Fe,autoPlay:!0,muted:f||Te||le,showControls:!1,showStats:m,onPlaybackStats:e=>QK({type:`log`,scope:`playback`,msg:`stats`,data:e}),onConnectTiming:e=>QK({type:`log`,scope:`webrtc-timing`,msg:`connect`,data:e}),onClientNetworkSample:l.kind===`adaptive`?n=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...n}).catch(()=>{})}:void 0,className:`w-full h-full`,handleOffer:k,reoffer:A,getSessionState:oe,getIceServers:ne,addIceCandidate:re,getIceCandidates:ie,closeSession:ae,reconnectSignal:b,posterUrl:v,onStateChange:e=>gX(_X(e)),onError:e=>gX(`error`,e)}),(0,C.jsx)(`canvas`,{ref:ce,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,background:`#000`,pointerEvents:`none`,transform:`translateZ(0)`,zIndex:2,display:(Te||le)&&de?`block`:`none`}}),E&&(()=>{let e=g?.appearance,t=E===`motion`?e?.motionColor??qq.motion:E===`audio`?e?.audioColor??qq.audio:e?.detectionColor??qq.detection;return(0,C.jsx)(`div`,{style:{position:`absolute`,inset:0,border:`${e?.thickness??3}px solid ${t}`,boxShadow:`inset 0 0 12px ${t}`,pointerEvents:`none`,transform:`translateZ(0)`}})})()]})}function CX(){let e=tq(`player`,()=>window.__CAMSTACK_EMBED__,bX),t=(0,S.useMemo)(()=>e===null||!e.ok?null:{system:ij({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new CE({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}})},[e]);return(0,S.useEffect)(()=>{if(t)return()=>{t.system.close()}},[t]),e===null?null:e.ok?t?(0,C.jsx)(Rz,{system:t.system,children:(0,C.jsx)(EE,{client:t.queryClient,children:(0,C.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,C.jsx)(SX,{system:t.system,deviceId:e.config.deviceId,token:e.config.token,initialTarget:e.config.target,initialMuted:e.config.muted,initialStats:e.config.stats??!1,initialHighlight:e.config.highlight,initialSnapshot:e.config.snapshot})})})}):(0,C.jsx)(xX,{message:`Failed to initialise the embed player`}):(0,C.jsx)(xX,{message:e.error})}var wX=B({serverUrl:P().min(1),token:P().min(1),deviceId:F().int().nonnegative(),startMs:F().int().nonnegative().optional()});function TX(e){if(e==null)return{ok:!1,error:`config is required`};let t=wX.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)}}function EX(e,t){let n=(e-t)/1e3;return Number.isFinite(n)&&n>0?n:0}var DX=360*60*1e3;function OX(e){QK(e)}function kX(e,t,n){try{QK({type:`log`,scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??``)}catch{}}function AX({system:e,config:t}){(0,S.useEffect)(()=>XK(t.deviceId),[t.deviceId]);let n=(0,S.useRef)(null),r=(0,S.useRef)(null),a=(0,S.useRef)(0),o=(0,S.useRef)(0),s=(0,S.useRef)(0),[c,l]=(0,S.useState)({w:window.innerWidth,h:window.innerHeight}),[u,d]=(0,S.useState)(!1),f=(0,S.useRef)(!1),p=(0,S.useRef)(null),m=(0,S.useRef)(null),h=(0,S.useRef)(null),g=(0,S.useRef)(bY()),_=(0,S.useRef)(null),v=(0,S.useRef)(null),y=(0,S.useMemo)(()=>async r=>{let c=n.current;if(!c)return;let l=++s.current;o.current=performance.now(),kX(`loadAt`,`start`,{epochMs:r,window:DX}),OX({type:`state`,state:`loading`});try{let n=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:r,toMs:r+DX});if(l!==s.current){kX(`loadAt`,`superseded`,{epochMs:r});return}if(kX(`loadAt`,`manifest`,{playbackUrl:n?.playbackUrl??null,endpoints:n?.playbackEndpoints?.length??0,localMaster:!!n?.localMasterPath}),!n?.playbackUrl){OX({type:`state`,state:`error`,message:`no footage`}),d(!1);return}c.src=n.playbackUrl;let o=()=>{if(l!==s.current)return;let e=typeof c.getStartDate==`function`?c.getStartDate():null,t=e instanceof Date&&!Number.isNaN(e.getTime())?e.getTime():r;a.current=t;let n=EX(r,t);if(n>0)try{c.currentTime=n}catch(e){kX(`loadAt`,`seek-failed`,{msg:String(e)})}c.play().catch(e=>{kX(`loadAt`,`play-rejected`,{msg:String(e)})}),kX(`loadAt`,`seek`,{epochMs:r,media0Ms:t,offsetSec:n})};c.readyState>=HTMLMediaElement.HAVE_METADATA?o():c.addEventListener(`loadedmetadata`,o,{once:!0}),kX(`loadAt`,`src-set`,{src:n.playbackUrl})}catch(e){kX(`loadAt`,`error`,{msg:e instanceof Error?e.message:String(e)}),OX({type:`state`,state:`error`,message:e instanceof Error?e.message:String(e)}),d(!1)}},[e,t.deviceId]),b=(0,S.useMemo)(()=>()=>(_.current||=new xJ({baseUrl:fJ,deviceId:t.deviceId,profile:`low`,onLog:(e,t)=>kX(`directory`,e,t)}),_.current),[t.deviceId]),x=(0,S.useMemo)(()=>e=>{let t=r.current,n=t?.getContext(`2d`);if(!t||!n)return;t.width=c.w,t.height=c.h;let a=`displayWidth`in e?e.displayWidth||e.codedWidth:e.width,o=`displayHeight`in e?e.displayHeight||e.codedHeight:e.height,s=Math.min(c.w/a,c.h/o),l=a*s,u=o*s;n.clearRect(0,0,c.w,c.h),n.drawImage(e,(c.w-l)/2,(c.h-u)/2,l,u)},[c.w,c.h]),w=(0,S.useRef)(x);w.current=x;let T=(0,S.useMemo)(()=>async e=>{h.current||=(m.current||=new fY,v.current||=new HJ({baseUrl:fJ,deviceId:t.deviceId,onLog:(e,t)=>kX(`strip`,e,t)}),new yY({source:m.current,warmAhead:(e,t)=>{let n=36e5,r=(Math.floor(e/n)+(t===1?1:-1))*n;b().ensure(r,r+n).catch(()=>{})},locate:async e=>{let t=b();await t.ensureAround(e);let n=dJ(t.all(),e);return n===null?null:{url:n.uri,startMs:n.startMs,durMs:n.durMs,...n.bytes===void 0?{}:{bytes:n.bytes}}},decode:async e=>(p.current||=new MJ,p.current.decodeSegment(e)),draw:e=>w.current(e),onDrawn:()=>{g.current.fire()&&OX({type:`scrubDrawn`})},onLog:(e,t)=>kX(`scrub`,e,t)}));try{kX(`scrub`,await h.current.scrubTo(e),{epochMs:e})}catch(e){kX(`scrub`,`error`,{msg:e instanceof Error?e.message:String(e)}),f.current||(f.current=!0,OX({type:`state`,state:`error`,message:`scrub: ${e instanceof Error?e.message:String(e)}`}))}},[b]);return(0,S.useEffect)(()=>(kX(`init`,`mounted`,{deviceId:t.deviceId,startMs:t.startMs??null,hasWebCodecs:window.VideoDecoder!==void 0,ua:navigator.userAgent}),window.__camstackRecording={seekTo:e=>{kX(`cmd`,`seekTo`,{epochMs:e}),y(e)},play:()=>{kX(`cmd`,`play`),n.current?.play().catch(()=>{})},pause:()=>{kX(`cmd`,`pause`),n.current?.pause()},setRate:e=>{kX(`cmd`,`setRate`,{rate:e}),n.current&&(n.current.playbackRate=e)},fit:(e,t)=>{kX(`cmd`,`fit`,{w:e,h:t}),l({w:e,h:t})},scrubStart:()=>{kX(`cmd`,`scrubStart`),f.current=!1,g.current.reset(),d(!0);let e=n.current;e&&h.current?.armPrefetch(a.current+e.currentTime*1e3)},scrubTo:e=>{kX(`cmd`,`scrubTo`,{epochMs:e}),T(e)},scrubEnd:e=>{kX(`cmd`,`scrubEnd`,{epochMs:e}),h.current?.dispose(),h.current=null,y(e)}},t.startMs&&t.startMs>0&&y(t.startMs),()=>{window.__camstackRecording&&delete window.__camstackRecording,h.current?.dispose(),h.current=null,p.current?.close(),p.current=null}),[y,T,t.startMs,t.deviceId]),(0,S.useEffect)(()=>$K(e=>{let t=window.__camstackRecording;if(t)switch(e.kind){case`seekTo`:t.seekTo(e.value);break;case`play`:t.play();break;case`pause`:t.pause();break;case`setRate`:t.setRate(e.value);break;case`scrubStart`:t.scrubStart();break;case`scrubTo`:t.scrubTo(e.value);break;case`scrubEnd`:t.scrubEnd(e.value);break;case`fit`:t.fit(e.w,e.h);break;default:break}}),[]),(0,C.jsxs)(`div`,{style:{position:`fixed`,left:0,top:0,width:c.w,height:c.h,background:`#000`},children:[(0,C.jsx)(`video`,{ref:n,playsInline:!0,controls:!1,style:{width:`100%`,height:`100%`,objectFit:`contain`,background:`#000`},onLoadedMetadata:e=>kX(`video`,`loadedmetadata`,{w:e.currentTarget.videoWidth,h:e.currentTarget.videoHeight,dur:e.currentTarget.duration}),onPlaying:()=>{kX(`video`,`playing`,{vodStartMs:Math.round(performance.now()-o.current)}),OX({type:`state`,state:`playing`}),d(!1)},onPause:()=>OX({type:`state`,state:`paused`}),onEnded:()=>OX({type:`state`,state:`ended`}),onError:e=>{let t=e.currentTarget.error;kX(`video`,`error`,{code:t?.code??null,message:t?.message??null}),OX({type:`state`,state:`error`,message:t?.message||`video error`}),d(!1)},onTimeUpdate:e=>OX({type:`position`,positionMs:a.current+e.currentTarget.currentTime*1e3})}),(0,C.jsx)(`canvas`,{ref:r,style:{position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,background:`#000`,display:u?`block`:`none`}})]})}function jX(){let e=tq(`recording`,()=>window.__CAMSTACK_RECORDING__,TX),t=(0,S.useMemo)(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,ij({serverUrl:e.config.serverUrl,token:e.config.token})),[e]);return(0,S.useEffect)(()=>()=>t?.close(),[t]),e===null?null:e.ok?t?(0,C.jsx)(AX,{system:t,config:e.config}):(OX({type:`state`,state:`error`,message:`init failed`}),null):(OX({type:`state`,state:`error`,message:e.error}),null)}function MX(){let e=new URLSearchParams(location.search).get(`mode`)??`grid`;return e===`player`?(0,C.jsx)(CX,{}):e===`recording`?(0,C.jsx)(jX,{}):(0,C.jsx)(cJ,{})}var NX=document.getElementById(`root`);NX&&(0,x.createRoot)(NX).render((0,C.jsx)(MX,{}));export{WG as a,Hz as c,b as d,m as f,u as g,c as h,WR as i,AK as l,s as m,LR as n,Q as o,f as p,iN as r,rN as s,zL as t,zz as u};